Index: kitcreator ================================================================== --- kitcreator +++ kitcreator @@ -23,11 +23,11 @@ CONFIGUREEXTRA="$@" export CONFIGUREEXTRA failedpkgs="" buildfailed="0" -for pkg in tcl tk itcl mk4tcl tclvfs kitsh; do +for pkg in tcl tk itcl mk4tcl tclvfs zlib kitsh; do if [ "${mode}" = "distclean" ]; then rm -rf "${pkg}/src" fi if [ "${mode}" = "clean" -o "${mode}" = "distclean" ]; then Index: kitsh/build.sh ================================================================== --- kitsh/build.sh +++ kitsh/build.sh @@ -31,13 +31,28 @@ cp -r 'buildsrc' 'build' cd "${BUILDDIR}" || exit 1 # Cleanup, just incase the incoming directory was not pre-cleaned ${MAKE:-make} distclean >/dev/null 2>/dev/null + + # Figure out if zlib compiled + ZLIBDIR=$(cd "${OTHERPKGSDIR}/zlib/inst"; pwd) + export ZLIBDIR + if [ ! -f "${ZLIBDIR}/lib/libz.a" ]; then + unset ZLIBDIR + fi # Compile Kitsh - ./configure --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA} + if [ -z "${ZLIBDIR}" ]; then + echo "./configure --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}" + + ./configure --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA} + else + echo "./configure --with-tcl=\"${TCLCONFIGDIR}\" --with-zlib=\"${ZLIBDIR}\" ${CONFIGUREEXTRA}" + + ./configure --with-tcl="${TCLCONFIGDIR}" --with-zlib="${ZLIBDIR}" ${CONFIGUREEXTRA} + fi ${MAKE:-make} || exit 1 # Strip the kit of all symbols, if possible strip kit >/dev/null 2>/dev/null ADDED zlib/build.sh Index: zlib/build.sh ================================================================== --- /dev/null +++ zlib/build.sh @@ -0,0 +1,55 @@ +#! /bin/bash + +if [ ! -f 'build.sh' ]; then + echo 'ERROR: This script must be run from the directory it is in' >&2 + + exit 1 +fi +if [ -z "${TCLVERS}" ]; then + echo 'ERROR: The TCLVERS environment variable is not set' >&2 + + exit 1 +fi + +ZLIBVERS="1.2.3" +SRC="src/zlib-${ZLIBVERS}.tar.gz" +SRCURL="http://www.zlib.net/zlib-${ZLIBVERS}.tar.gz" +BUILDDIR="$(pwd)/build/zlib-${ZLIBVERS}" +OUTDIR="$(pwd)/out" +INSTDIR="$(pwd)/inst" +export ZLIBVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR + +rm -rf 'build' 'out' 'inst' +mkdir 'build' 'out' 'inst' || exit 1 + +if [ ! -f "${SRC}" ]; then + mkdir 'src' >/dev/null 2>/dev/null + + rm -f "${SRC}.tmp" + wget -O "${SRC}.tmp" "${SRCURL}" || exit 1 + mv "${SRC}.tmp" "${SRC}" +fi + +( + cd 'build' || exit 1 + + if [ ! -d '../buildsrc' ]; then + gzip -dc "../${SRC}" | tar -xf - + else + cp -rp ../buildsrc/* './' + fi + + cd "${BUILDDIR}" || exit 1 + # We don't pass CONFIGUREEXTRA here, since this isn't a GNU autoconf + # script and will puke + ./configure --prefix="${INSTDIR}" + + ${MAKE:-make} || exit 1 + + ${MAKE:-make} install + + # We don't really care too much about failure in zlib + exit 0 +) || exit 1 + +exit 0