Diff

Differences From Artifact [9534382755]:

To Artifact [9c9d67bdc5]:


     1      1   #! /usr/bin/env bash
     2      2   
     3         -if [ ! -f 'build.sh' ]; then
     4         -	echo 'ERROR: This script must be run from the directory it is in' >&2
            3  +# BuildCompatible: KitCreator
     5      4   
     6         -	exit 1
     7         -fi
     8         -if [ -z "${TCLVERS}" ]; then
     9         -	echo 'ERROR: The TCLVERS environment variable is not set' >&2
    10         -
    11         -	exit 1
    12         -fi
    13         -
    14         -TCLUDPVERS="1.0.11"
    15         -SRC="src/tcludp-${TCLUDPVERS}.tar.gz"
    16         -SRCURL="http://sourceforge.net/projects/tcludp/files/tcludp/${TCLUDPVERS}/tcludp-${TCLUDPVERS}.tar.gz"
    17         -SRCHASH='a8a29d55a718eb90aada643841b3e0715216d27cea2e2df243e184edb780aa9d'
    18         -BUILDDIR="$(pwd)/build/tcludp"
    19         -OUTDIR="$(pwd)/out"
    20         -INSTDIR="$(pwd)/inst"
    21         -PATCHDIR="$(pwd)/patches"
    22         -export TCLUDPVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR PATCHDIR
    23         -
    24         -# Set configure options for this sub-project
    25         -LDFLAGS="${LDFLAGS} ${KC_TCLUDP_LDFLAGS}"
    26         -CFLAGS="${CFLAGS} ${KC_TCLUDP_CFLAGS}"
    27         -CPPFLAGS="${CPPFLAGS} ${KC_TCLUDP_CPPFLAGS}"
    28         -LIBS="${LIBS} ${KC_TCLUDP_LIBS}"
    29         -export LDFLAGS CFLAGS CPPFLAGS LIBS
    30         -
    31         -rm -rf 'build' 'out' 'inst'
    32         -mkdir 'build' 'out' 'inst' || exit 1
    33         -
    34         -TCL_VERSION="unknown"
    35         -if [ -f "${TCLCONFIGDIR}/tclConfig.sh" ]; then
    36         -        source "${TCLCONFIGDIR}/tclConfig.sh"
    37         -fi
    38         -export TCL_VERSION
    39         -
    40         -if [ ! -f "${SRC}" ]; then
    41         -	mkdir 'src' >/dev/null 2>/dev/null
    42         -
    43         -	if [ ! -d 'buildsrc' ]; then
    44         -		download "${SRCURL}" "${SRC}" "${SRCHASH}" || exit 1
    45         -	fi
    46         -fi
    47         -
    48         -(
    49         -	cd 'build' || exit 1
    50         -
    51         -	if [ ! -d '../buildsrc' ]; then
    52         -		gzip -dc "../${SRC}" | tar -xf -
    53         -	else    
    54         -		cp -rp ../buildsrc/* './'
    55         -	fi
    56         -
    57         -	cd "${BUILDDIR}" || exit 1
    58         -
    59         -	# Try to build as a shared object if requested
    60         -	if [ "${STATICTCLUDP}" = "0" ]; then
    61         -		tryopts="--enable-shared --disable-shared"
    62         -	elif [ "${STATICTCLUDP}" = "-1" ]; then
    63         -		tryopts="--enable-shared"
    64         -	else
    65         -		tryopts="--disable-shared"
    66         -	fi
    67         -
    68         -	SAVE_CFLAGS="${CFLAGS}"
    69         -	for tryopt in $tryopts __fail__; do
    70         -		rm -rf "${INSTDIR}"
    71         -		mkdir "${INSTDIR}"
    72         -
    73         -		if [ "${tryopt}" = "__fail__" ]; then
    74         -			exit 1
    75         -		fi
    76         -
    77         -		# Clean up, if needed
    78         -		make distclean >/dev/null 2>/dev/null
    79         -		if [ "${tryopt}" == "--enable-shared" ]; then
    80         -			isshared="1"
    81         -		else
    82         -			isshared="0"
    83         -		fi
    84         -
    85         -		# If build a static TCLUDP for KitDLL, ensure that we use PIC
    86         -		# so that it can be linked into the shared object
    87         -		if [ "${isshared}" = "0" -a "${KITTARGET}" = "kitdll" ]; then
    88         -			CFLAGS="${SAVE_CFLAGS} -fPIC"
    89         -		else
    90         -			CFLAGS="${SAVE_CFLAGS}"
    91         -		fi
    92         -		export CFLAGS
    93         -
    94         -		if [ "${isshared}" = '0' ]; then
    95         -			sed 's@USE_TCL_STUBS@XXX_TCL_STUBS@g' configure > configure.new
    96         -		else
    97         -			sed 's@XXX_TCL_STUBS@USE_TCL_STUBS@g' configure > configure.new
    98         -		fi
    99         -		cat configure.new > configure
   100         -		rm -f configure.new
   101         -
   102         -		(
   103         -			echo "Running: ./configure $tryopt --prefix=\"${INSTDIR}\" --exec-prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" --with-tcl=\"${TCLCONFIGDIR}\" ac_cv_path_DTPLITE=no ${CONFIGUREEXTRA}"
   104         -			./configure $tryopt --prefix="${INSTDIR}" --exec-prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" --with-tcl="${TCLCONFIGDIR}" ac_cv_path_DTPLITE=no ${CONFIGUREEXTRA}
   105         -
   106         -			echo "Running: ${MAKE:-make} tcllibdir=\"${INSTDIR}/lib\""
   107         -			${MAKE:-make} tcllibdir="${INSTDIR}/lib" || exit 1
   108         -
   109         -			echo "Running: ${MAKE:-make} tcllibdir=\"${INSTDIR}/lib\" install"
   110         -			${MAKE:-make} tcllibdir="${INSTDIR}/lib" install || exit 1
   111         -		) || continue
   112         -
   113         -		break
   114         -	done
   115         -
   116         -	# Create pkgIndex if needed
   117         -	if [ ! -e "${INSTDIR}/lib/udp${TCLUDPVERS}/pkgIndex.tcl" ]; then
   118         -		cat << _EOF_ > "${INSTDIR}/lib/udp${TCLUDPVERS}/pkgIndex.tcl"
   119         -package ifneeded udp ${TCLUDPVERS} [list load {} udp]
   120         -_EOF_
   121         -	fi
   122         -
   123         -	# Install files needed by installation
   124         -	cp -r "${INSTDIR}/lib" "${OUTDIR}" || exit 1
   125         -	find "${OUTDIR}" -name '*.a' -type f | xargs -n 1 rm -f --
   126         -
   127         -	exit 0
   128         -) || exit 1
   129         -
   130         -exit 0
            5  +version="1.0.11"
            6  +url="http://sourceforge.net/projects/tcludp/files/tcludp/${version}/tcludp-${version}.tar.gz"
            7  +sha256='a8a29d55a718eb90aada643841b3e0715216d27cea2e2df243e184edb780aa9d'
            8  +configure_extra=(ac_cv_path_DTPLITE=no)
            9  +internalpkgname='tcludp'