Check-in [0eca481f01]
Overview
Comment:Updated to build static library as PIC when building for KitDLL

Fixed issue with Metakit using "g++" for the shared object linker, even when cross-compiling

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:0eca481f0182660f8906c399d286de193cde7c34
User & Date: rkeene on 2011-03-09 14:35:53
Other Links: manifest | tags
Context
2011-03-09
14:36
Updated to build full Tclkit when cross-compiling to Linux/amd64 check-in: 53587b62ec user: rkeene tags: trunk
14:35
Updated to build static library as PIC when building for KitDLL

Fixed issue with Metakit using "g++" for the shared object linker, even when cross-compiling check-in: 0eca481f01 user: rkeene tags: trunk

2011-03-08
04:23
Added build script to cross-compile Linux/amd64 kits check-in: 5715f1901b user: rkeene tags: trunk
Changes

Modified mk4tcl/build.sh from [9c93a36278] to [1ccf77c409].

    84     84   		tryopts="--enable-shared --disable-shared"
    85     85   	elif [ "${STATICMK4}" = "-1" ]; then
    86     86   		tryopts="--enable-shared"
    87     87   	else
    88     88   		tryopts="--disable-shared"
    89     89   	fi
    90     90   
           91  +	SAVE_CXXFLAGS="${CXXFLAGS}"
    91     92   	for tryopt in $tryopts __fail__; do
    92     93   		# Clean up, if needed
    93     94   		make distclean >/dev/null 2>/dev/null
    94     95   		rm -rf "${INSTDIR}"
    95     96   		mkdir "${INSTDIR}"
    96     97   
    97     98   		if [ "${tryopt}" = "__fail__" ]; then
................................................................................
    99    100   		fi
   100    101   
   101    102   		if [ "${tryopt}" == "--enable-shared" ]; then
   102    103   			isshared="1"
   103    104   		else
   104    105   			isshared="0"
   105    106   		fi
          107  +
          108  +		# If build a static Mk4tcl for KitDLL, ensure that we use PIC
          109  +		# so that it can be linked into the shared object
          110  +		if [ "${isshared}" = "0" -a "${KITTARGET}" = "kitdll" ]; then
          111  +			CXXFLAGS="${SAVE_CXXFLAGS} -fPIC"
          112  +			export CXXFLAGS
          113  +		fi
   106    114   
   107    115   		(
   108    116   			echo "Running: ./configure $tryopt --prefix=\"${INSTDIR}\" --exec-prefix=\"${INSTDIR}\" --with-tcl=\"${TCLCONFIGDIR}/../generic\" ${CONFIGUREEXTRA}"
   109    117   			./configure $tryopt --prefix="${INSTDIR}" --exec-prefix="${INSTDIR}" --with-tcl="${TCLCONFIGDIR}/../generic" ${CONFIGUREEXTRA}
   110    118   
   111    119   			echo "Running: ${MAKE:-make} tcllibdir=\"${INSTDIR}/lib\" AR=\"${AR:-ar}\" RANLIB=\"${RANLIB:-ranlib}\""
   112    120   			${MAKE:-make} tcllibdir="${INSTDIR}/lib" AR="${AR:-ar}" RANLIB="${RANLIB:-ranlib}" || exit 1

Added mk4tcl/patches/all/metakit-2.4.9.7-fixsharedobjlinker.diff version [6280191256].

            1  +Binary files metakit-2.4.9.7.orig/unix/.Makefile.in.swp and metakit-2.4.9.7-1rsk/unix/.Makefile.in.swp differ
            2  +Binary files metakit-2.4.9.7.orig/unix/.configure.in.swp and metakit-2.4.9.7-1rsk/unix/.configure.in.swp differ
            3  +diff -uNr metakit-2.4.9.7.orig/unix/configure metakit-2.4.9.7-1rsk/unix/configure
            4  +--- metakit-2.4.9.7.orig/unix/configure	2007-06-15 18:26:40.000000000 -0500
            5  ++++ metakit-2.4.9.7-1rsk/unix/configure	2011-03-09 07:39:59.000000000 -0600
            6  +@@ -1482,7 +1482,7 @@
            7  + if test $SHARED_BUILD = 1; then
            8  +   SHLIB_FLAGS="-shared"
            9  +   SHLIB_CFLAGS="-fPIC -DUSE_TCL_STUBS"
           10  +-  SHLIB_LD="g++ -shared"
           11  ++  SHLIB_LD="${CXX} -shared"
           12  + else
           13  +   SHLIB_FLAGS=""
           14  +   SHLIB_CFLAGS=""
           15  +diff -uNr metakit-2.4.9.7.orig/unix/configure.in metakit-2.4.9.7-1rsk/unix/configure.in
           16  +--- metakit-2.4.9.7.orig/unix/configure.in	2007-06-15 18:26:40.000000000 -0500
           17  ++++ metakit-2.4.9.7-1rsk/unix/configure.in	2011-03-09 07:39:29.000000000 -0600
           18  +@@ -117,7 +117,7 @@
           19  + if test $SHARED_BUILD = 1; then
           20  +   SHLIB_FLAGS="-shared"
           21  +   SHLIB_CFLAGS="-fPIC -DUSE_TCL_STUBS"
           22  +-  SHLIB_LD="g++ -shared"
           23  ++  SHLIB_LD="${CXX} -shared"
           24  + else
           25  +   SHLIB_FLAGS=""
           26  +   SHLIB_CFLAGS=""