@@ -1,6 +1,9 @@ #! /usr/bin/env bash + +# Clean variables which will interfere with the build +unset MAKEFLAGS DESTDIR # Determine appropriate mode mode="build" case "$1" in clean|distclean|build|retry) @@ -8,11 +11,11 @@ shift ;; esac # Determine which Tcl version to build -TCLVERS="8.6.1" +TCLVERS="8.6.2" if echo "$1" | grep '^[0-9][0-9]*\.' >/dev/null || echo "$1" | egrep '^(cvs|fossil)_' >/dev/null; then TCLVERS="$1" shift fi @@ -29,11 +32,12 @@ echo "Please remember to run 'build/pre.sh' if you expect this build to work." >&2 fi fi # Define the list of all packages, for cleaning purposes -KITCREATOR_ALLPKGS="kitsh tcl tclvfs zlib tk itcl mk4tcl thread dbus" +KITCREATOR_ALLPKGS="kitsh tcl tclvfs zlib tk itcl mk4tcl thread dbus tls tclx tcc4tcl" + # Always rebuild kitsh rm -f "kitsh/.success" for pkg in ${KITCREATOR_ALLPKGS}; do if [ "${mode}" != "retry" -o ! -f "${pkg}/.success" ]; then rm -f "${pkg}/build.log" "${pkg}/.success" @@ -65,10 +69,29 @@ if echo " ${CONFIGUREEXTRA} " | grep ' --enable-threads' >/dev/null 2>/dev/null; then KITCREATOR_PKGS="${KITCREATOR_PKGS} thread" fi +# Determine cross-compile status +host_os="$(echo " ${CONFIGUREEXTRA} " | sed 's@^.* --host=\([^ ]*\) .*$@\1@ +t x +d +:x')" +build_os="$(echo " ${CONFIGUREEXTRA} " | sed 's@^.* --build=\([^ ]*\) .*$@\1@ +t x +d +:x')" + +if [ "${host_os}" != "${build_os}" -a -n "${host_os}" ]; then + KC_CROSSCOMPILE='1' + KC_CROSSCOMPILE_HOST_OS="${host_os}" +else + KC_CROSSCOMPILE='0' + KC_CROSSCOMPILE_HOST_OS='' +fi +export KC_CROSSCOMPILE KC_CROSSCOMPILE_HOST_OS + # Set default target KITTARGET="kitsh" export KITTARGET # Fix up package list