Index: kitcreator ================================================================== --- kitcreator +++ kitcreator @@ -73,27 +73,39 @@ elif echo " ${CONFIGUREEXTRA} " | grep ' --disable-threads ' >/dev/null 2>/dev/null; then KITCREATOR_ADD_ENABLE_THREADS='0' fi # Determine cross-compile status +kitsh_dir="$(cd kitsh/buildsrc/kitsh-* && pwd)" || exit 1 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 [ -z "${build_os}" ]; then + build_os="$("${kitsh_dir}/config.guess")" +else + build_os="$("${kitsh_dir}/config.sub" "${build_os}")" +fi +if [ -z "${host_os}" ]; then + host_os="$("${kitsh_dir}/config.guess")" +else + host_os="$("${kitsh_dir}/config.sub" "${host_os}")" +fi 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 +KC_CROSSCOMPILE_HOST_OS="${host_os}" export KC_CROSSCOMPILE KC_CROSSCOMPILE_HOST_OS +unset kitsh_dir # Set default target KITTARGET="kitsh" export KITTARGET Index: lmdb/build.sh ================================================================== --- lmdb/build.sh +++ lmdb/build.sh @@ -10,23 +10,15 @@ local name local isWindows # Windows-only isWindows='false' - if [ "${KC_CROSSCOMPILE}" = '1' ]; then - case "${KC_CROSSCOMPILE_HOST_OS}" in - *-cygwin|*-mingw32|*-mingw32-*|*-cygwin-*) - isWindows='true' - ;; - esac - else - case "${OSTYPE}" in - msys|win*|cygwin) - isWindows='true' - ;; - esac - fi + case "${KC_CROSSCOMPILE_HOST_OS}" in + *-cygwin|*-mingw32|*-mingw32-*|*-cygwin-*) + isWindows='true' + ;; + esac if [ "${isWindows}" = 'true' ]; then find "${installdir}" -type -f -name '*.a' | while IFS='' read -r name; do echo '-lntdll' > "${name}.linkadd" done