Index: mk4tcl/build.sh ================================================================== --- mk4tcl/build.sh +++ mk4tcl/build.sh @@ -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} ADDED mk4tcl/patches/all/metakit-2.4.9.7-fixsharedobjlinker.diff Index: mk4tcl/patches/all/metakit-2.4.9.7-fixsharedobjlinker.diff ================================================================== --- /dev/null +++ mk4tcl/patches/all/metakit-2.4.9.7-fixsharedobjlinker.diff @@ -0,0 +1,26 @@ +Binary files metakit-2.4.9.7.orig/unix/.Makefile.in.swp and metakit-2.4.9.7-1rsk/unix/.Makefile.in.swp differ +Binary files metakit-2.4.9.7.orig/unix/.configure.in.swp and metakit-2.4.9.7-1rsk/unix/.configure.in.swp differ +diff -uNr metakit-2.4.9.7.orig/unix/configure metakit-2.4.9.7-1rsk/unix/configure +--- metakit-2.4.9.7.orig/unix/configure 2007-06-15 18:26:40.000000000 -0500 ++++ metakit-2.4.9.7-1rsk/unix/configure 2011-03-09 07:39:59.000000000 -0600 +@@ -1482,7 +1482,7 @@ + if test $SHARED_BUILD = 1; then + SHLIB_FLAGS="-shared" + SHLIB_CFLAGS="-fPIC -DUSE_TCL_STUBS" +- SHLIB_LD="g++ -shared" ++ SHLIB_LD="${CXX} -shared" + else + SHLIB_FLAGS="" + SHLIB_CFLAGS="" +diff -uNr metakit-2.4.9.7.orig/unix/configure.in metakit-2.4.9.7-1rsk/unix/configure.in +--- metakit-2.4.9.7.orig/unix/configure.in 2007-06-15 18:26:40.000000000 -0500 ++++ metakit-2.4.9.7-1rsk/unix/configure.in 2011-03-09 07:39:29.000000000 -0600 +@@ -117,7 +117,7 @@ + if test $SHARED_BUILD = 1; then + SHLIB_FLAGS="-shared" + SHLIB_CFLAGS="-fPIC -DUSE_TCL_STUBS" +- SHLIB_LD="g++ -shared" ++ SHLIB_LD="${CXX} -shared" + else + SHLIB_FLAGS="" + SHLIB_CFLAGS=""