@@ -86,10 +86,11 @@ tryopts="--enable-shared" else tryopts="--disable-shared" fi + SAVE_CXXFLAGS="${CXXFLAGS}" for tryopt in $tryopts __fail__; do # Clean up, if needed make distclean >/dev/null 2>/dev/null rm -rf "${INSTDIR}" mkdir "${INSTDIR}" @@ -101,10 +102,17 @@ if [ "${tryopt}" == "--enable-shared" ]; then isshared="1" else isshared="0" fi + + # If build a static Mk4tcl for KitDLL, ensure that we use PIC + # so that it can be linked into the shared object + if [ "${isshared}" = "0" -a "${KITTARGET}" = "kitdll" ]; then + CXXFLAGS="${SAVE_CXXFLAGS} -fPIC" + export CXXFLAGS + fi ( echo "Running: ./configure $tryopt --prefix=\"${INSTDIR}\" --exec-prefix=\"${INSTDIR}\" --with-tcl=\"${TCLCONFIGDIR}/../generic\" ${CONFIGUREEXTRA}" ./configure $tryopt --prefix="${INSTDIR}" --exec-prefix="${INSTDIR}" --with-tcl="${TCLCONFIGDIR}/../generic" ${CONFIGUREEXTRA}