Index: tk/build.sh ================================================================== --- tk/build.sh +++ tk/build.sh @@ -147,10 +147,16 @@ ( . "${patchscript}" ) fi done + + # Allow wrapper programs to supplant real programs + if [ -d 'fake-bin' ]; then + PATH="$(pwd)/fake-bin:${PATH}" + export PATH + fi for dir in "${TCLCONFIGDIRTAIL}" unix win macosx win64 __fail__; do if [ -z "${dir}" ]; then continue fi ADDED tk/patchscripts/xmkmf-donotuse.sh Index: tk/patchscripts/xmkmf-donotuse.sh ================================================================== --- /dev/null +++ tk/patchscripts/xmkmf-donotuse.sh @@ -0,0 +1,24 @@ +#! /bin/bash + +# If we are not cross-compiling then don't worry about replacing "xmkmf" with a wrapper +if [ -z "${CC}" ]; then + exit 0 +fi + +case "$(basename "${CC}")" in + *-*-*) + ;; + *) + exit 0 +esac + +# Create an "xmkmf" wrapper which exits in failure so that autoconf will try +# to locate headers/libraries normally +mkdir fake-bin >/dev/null 2>/dev/null + +cat << \_EOF_ > fake-bin/xmkmf +#! /bin/bash +exit 1 +_EOF_ + +chmod +x fake-bin/xmkmf