Check-in [531fec5815]
Overview
Comment:Moved tcc4tcl to simplified build system
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:531fec5815c53aee593e2aaf3986679173464b03
User & Date: rkeene on 2016-09-06 04:39:07
Other Links: manifest | tags
Context
2016-09-06
04:41
Moved tcllib to simplified build system check-in: 5963c4d770 user: rkeene tags: trunk
04:39
Moved tcc4tcl to simplified build system check-in: 531fec5815 user: rkeene tags: trunk
04:32
Added dbus/dbif to simplified build system, which required supporting building multiple packages in a package directory check-in: dec2be8d9f user: rkeene tags: trunk
Changes

Modified tcc4tcl/build.sh from [15c640b06a] to [a69ae0135f].

     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
            5  +version="0.26"
            6  +url="http://rkeene.org/devel/tcc4tcl/tcc4tcl-${version}.tar.gz"
            7  +sha256='8116d2ab94cc611c4e0be81e34bd8cc11a6f3e1fd49d02d7e894bbadcfffde0b'
    10      8   
    11         -	exit 1
    12         -fi
            9  +function preconfigure() {
           10  +	if echo " ${CONFIGUREEXTRA} " | grep ' --disable-load ' >/dev/null; then
           11  +		configure_extra=("--with-dlopen")
           12  +	else
           13  +		configure_extra=("--without-dlopen")
           14  +	fi
           15  +}
    13     16   
    14         -TCC4TCLVERS="0.26"
    15         -SRC="src/tcc4tcl-${TCC4TCLVERS}.tar.gz"
    16         -SRCURL="http://rkeene.org/devel/tcc4tcl/tcc4tcl-${TCC4TCLVERS}.tar.gz"
    17         -SRCHASH='8116d2ab94cc611c4e0be81e34bd8cc11a6f3e1fd49d02d7e894bbadcfffde0b'
    18         -BUILDDIR="$(pwd)/build/tcc4tcl-${TCC4TCLVERS}"
    19         -OUTDIR="$(pwd)/out"
    20         -INSTDIR="$(pwd)/inst"
    21         -PATCHDIR="$(pwd)/patches"
    22         -export TCC4TCLVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR PATCHDIR
           17  +function postinstall() {
           18  +	echo "/libtcc1\.a" > "${installdir}/kitcreator-nolibs"
           19  +}
    23     20   
    24         -# Set configure options for this sub-project
    25         -LDFLAGS="${LDFLAGS} ${KC_TCC4TCL_LDFLAGS}"
    26         -CFLAGS="${CFLAGS} ${KC_TCC4TCL_CFLAGS}"
    27         -CPPFLAGS="${CPPFLAGS} ${KC_TCC4TCL_CPPFLAGS}"
    28         -LIBS="${LIBS} ${KC_TCC4TCL_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         -	# Apply required patches
    58         -	cd "${BUILDDIR}" || exit 1
    59         -
    60         -	for patch in "${PATCHDIR}/all"/tcc4tcl-${TCC4TCLVERS}-*.diff "${PATCHDIR}/${TCL_VERSION}"/tcc4tcl-${TCC4TCLVERS}-*.diff; do
    61         -		if [ ! -f "${patch}" ]; then
    62         -			continue
    63         -		fi
    64         -
    65         -		echo "Applying: ${patch}"
    66         -		${PATCH:-patch} -p1 < "${patch}"
    67         -	done
    68         -
    69         -	# Try to build as a shared object if requested
    70         -	if [ "${STATICTCC4TCL}" = "0" ]; then
    71         -		tryopts="--enable-shared --disable-shared"
    72         -	elif [ "${STATICTCC4TCL}" = "-1" ]; then
    73         -		# Require shared object if requested
    74         -		tryopts="--enable-shared"
    75         -	else
    76         -		# Default to building statically
    77         -		tryopts="--disable-shared"
    78         -	fi
    79         -
    80         -	if echo " ${CONFIGUREEXTRA} " | grep ' --disable-load ' >/dev/null; then
    81         -		dlopen_flag="--with-dlopen"
    82         -	else
    83         -		dlopen_flag="--without-dlopen"
    84         -	fi
    85         -
    86         -	SAVE_CFLAGS="${CFLAGS}"
    87         -	for tryopt in $tryopts __fail__; do
    88         -		# Clean up, if needed
    89         -		make distclean >/dev/null 2>/dev/null
    90         -		rm -rf "${INSTDIR}"
    91         -		mkdir "${INSTDIR}"
    92         -
    93         -		if [ "${tryopt}" = "__fail__" ]; then
    94         -			exit 1
    95         -		fi
    96         -
    97         -		if [ "${tryopt}" == "--enable-shared" ]; then
    98         -			isshared="1"
    99         -		else
   100         -			isshared="0"
   101         -		fi
   102         -
   103         -		# If build a static tcc4tcl for KitDLL, ensure that we use PIC
   104         -		# so that it can be linked into the shared object
   105         -		if [ "${isshared}" = "0" -a "${KITTARGET}" = "kitdll" ]; then
   106         -			CFLAGS="${SAVE_CFLAGS} -fPIC"
   107         -		else
   108         -			CFLAGS="${SAVE_CFLAGS}"
   109         -		fi
   110         -
   111         -		(
   112         -			echo "Running: ./configure $tryopt --prefix=\"${INSTDIR}\" --exec-prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" --with-tcl=\"${TCLCONFIGDIR}\" ${dlopen_flag} ${CONFIGUREEXTRA}"
   113         -			./configure $tryopt --prefix="${INSTDIR}" --exec-prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" --with-tcl="${TCLCONFIGDIR}" ${dlopen_flag} ${CONFIGUREEXTRA}
   114         -
   115         -			echo "Running: ${MAKE:-make}"
   116         -			${MAKE:-make} || exit 1
   117         -
   118         -			echo "Running: ${MAKE:-make} install"
   119         -			${MAKE:-make} install || exit 1
   120         -		) || continue
   121         -
   122         -		break
   123         -	done
           21  +function createruntime() {
           22  +	local filename
   124     23   
   125     24   	# Create VFS-insert
   126         -	cp -r "${INSTDIR}/lib" "${OUTDIR}" || exit 1
   127         -	find "${OUTDIR}" -name '*.a' -type f | grep -v '/libtcc1\.a$' | xargs rm -f
           25  +	mkdir -p "${runtimedir}" || return 1
           26  +	cp -r "${installdir}/lib" "${runtimedir}" || return 1
   128     27   
   129         -	# Tell Kitsh not to try to link against "libtcc1.a"
   130         -	echo "/libtcc1\.a" > "${INSTDIR}/kitcreator-nolibs"
   131         -
   132         -	exit 0
   133         -) || exit 1
   134         -
   135         -exit 0
           28  +	find "${runtimedir}" -name '*.a' -type f | grep -v '/libtcc1\.a$' | while IFS='' read -r filename; do
           29  +		rm -f "${filename}"
           30  +	done
           31  +}