Diff

Differences From Artifact [4ab5fc6711]:

To Artifact [f5f5688875]:


    33     33   
    34     34   	if test -f "${tclconfigsh}"; then
    35     35   		. "${tclconfigsh}"
    36     36   
    37     37   		CFLAGS="${CFLAGS} ${TCL_INCLUDE_SPEC} -I${TCL_SRC_DIR}/generic -I${tclconfigshdir}"
    38     38   		CPPFLAGS="${CPPFLAGS} ${TCL_INCLUDE_SPEC} -I${TCL_SRC_DIR}/generic -I${tclconfigshdir}"
    39     39   		LIBS="${LIBS} ${TCL_LIBS}"
           40  +
           41  +		KITDLL_LIB_VERSION=`echo "${TCL_VERSION}${TCL_PATCH_LEVEL}" | sed 's@\.@@g'`
    40     42   	fi
    41     43   
    42     44   	AC_SUBST(CFLAGS)
    43     45   	AC_SUBST(CPPFLAGS)
    44     46   	AC_SUBST(LIBS)
           47  +	AC_SUBST(KITDLL_LIB_VERSION)
    45     48   
    46     49   	AC_MSG_RESULT([$tclconfigsh])
    47     50   ])
    48     51   
    49     52   AC_DEFUN(DC_DO_TK, [
    50     53   	AC_MSG_CHECKING([path to tk])
    51     54   	AC_ARG_WITH(tk, AC_HELP_STRING([--with-tk], [directory containing tk configuration (tkConfig.sh)]), [], [
................................................................................
   149    152   	DC_DO_STATIC_LINK_LIB([C++ Library (Sun Studio)], [-lCstd -lCrun],, [
   150    153   		DC_DO_STATIC_LINK_LIB([C++ Library (UNIX)], [-lstdc++])
   151    154   	])
   152    155   ])
   153    156   
   154    157   AC_DEFUN(DC_FIND_TCLKIT_LIBS, [
   155    158   	DC_SETUP_TCL_PLAT_DEFS
          159  +
          160  +	dnl We will need this for the Tcl project, which we will always have
          161  +	DC_CHECK_FOR_WHOLE_ARCHIVE
   156    162   
   157    163   	for proj in mk4tcl tcl tclvfs tk; do
   158    164   		AC_MSG_CHECKING([for libraries required for ${proj}])
   159    165   
   160         -		libdir="../../../${proj}/inst"
   161         -		libfiles="`find "${libdir}" -name '*.a' 2>/dev/null | tr "\n" ' '`"
   162         -		libfilesnostub="`find "${libdir}" -name '*.a' 2>/dev/null | grep -v 'stub' | tr "\n" ' '`"
          166  +		projlibdir="../../../${proj}/inst"
          167  +		projlibfiles="`find "${projlibdir}" -name '*.a' 2>/dev/null | tr "\n" ' '`"
          168  +		projlibfilesnostub="`find "${projlibdir}" -name '*.a' 2>/dev/null | grep -v 'stub' | tr "\n" ' '`"
   163    169   
   164         -		ARCHS="${ARCHS} ${libfiles}"
          170  +		AC_MSG_RESULT([${projlibfilesnostub}])
   165    171   
   166         -		AC_MSG_RESULT([${libfiles}])
          172  +		hide_symbols="1"
   167    173   
   168         -		if test "${libfilesnostub}" != ""; then
   169         -			if test "${proj}" = "mk4tcl"; then
          174  +		if test "${proj}" = "tcl"; then
          175  +			DC_TEST_WHOLE_ARCHIVE_SHARED_LIB([$ARCHS $projlibfilesnostub], [
          176  +				projlibfiles="${projlibfilesnostub}"
          177  +			], [
          178  +				DC_TEST_WHOLE_ARCHIVE_SHARED_LIB([$ARCHS $projlibfiles], [
          179  +					projlibfiles="${projlibfiles}"
          180  +				])
          181  +			])
          182  +
          183  +			hide_symbols="0"
          184  +		fi
          185  +
          186  +		if test "${proj}" = "mk4tcl"; then
          187  +			if test -n "${projlibfiles}"; then
   170    188   				AC_DEFINE(KIT_INCLUDES_MK4TCL, [1], [Specify this if you link against mkt4tcl])
   171    189   
   172    190   				kc_cv_feature_kit_includes_mk4tcl='1'
   173    191   
   174    192   				DC_DO_STATIC_LINK_LIBCXX
   175    193   			fi
   176         -			if test "${proj}" = "tk"; then
          194  +		fi
          195  +
          196  +		if test "${proj}" = "tk"; then
          197  +			if test "${projlibfilesnostub}" != ""; then
   177    198   				DC_DO_TK
   178    199   				AC_DEFINE(KIT_INCLUDES_TK, [1], [Specify this if we link statically to Tk])
   179    200   				if test -n "${TK_VERSION}"; then
   180    201   					AC_DEFINE_UNQUOTED(KIT_TK_VERSION, "${TK_VERSION}${TK_PATCH_LEVEL}", [Specify the version of Tk])
   181    202   				fi
   182    203   
   183    204   				if test "$host_os" = "mingw32msvc" -o "$host_os" = "mingw32"; then
   184    205   					AC_DEFINE(KITSH_NEED_WINMAIN, [1], [Define if you need WinMain (Windows)])
   185    206   					CFLAGS="${CFLAGS} -mwindows"
   186    207   				fi
          208  +
          209  +				hide_symbols="0"
   187    210   			fi
   188    211   		fi
          212  +
          213  +		ARCHS="${ARCHS} ${projlibfiles}"
          214  +
          215  +		if test "${hide_symbols}" = "1"; then
          216  +			STRIPLIBS="${STRIPLIBS} ${projlibfiles}"
          217  +		fi
   189    218   	done
   190    219   
   191    220   	AC_SUBST(ARCHS)
          221  +	AC_SUBST(STRIPLIBS)
   192    222   ])
   193    223   
   194    224   AC_DEFUN(DC_SETUP_TCL_PLAT_DEFS, [
   195    225   	AC_CANONICAL_BUILD
   196    226   	AC_CANONICAL_HOST
   197    227     
   198    228   	AC_MSG_CHECKING(host operating system)
   199    229   	AC_MSG_RESULT($host_os)
   200    230     
   201    231   	case $host_os in
   202    232   		mingw32*)
   203    233   			CFLAGS="${CFLAGS} -mno-cygwin -mms-bitfields"
          234  +			WISH_CFLAGS="-mwindows"
   204    235   
   205    236   			dnl If we are building for Win32, we need to define "BUILD_tcl" so that
   206    237   			dnl TCL_STORAGE_CLASS gets defined as DLLEXPORT, to make static linking
   207    238   			dnl work
   208    239   			AC_DEFINE(BUILD_tcl, [1], [Define if you need to pretend to be building Tcl (Windows)])
   209    240   			AC_DEFINE(BUILD_tk, [1], [Define if you need to pretend to be building Tk (Windows)])
   210    241   			;;
   211    242   		cygwin*)
   212    243   			CFLAGS="${CFLAGS} -mms-bitfields"
          244  +			WISH_CFLAGS="-mwindows"
   213    245   			;;
   214    246   	esac
          247  +
          248  +	AC_SUBST(WISH_CFLAGS)
   215    249   ])
   216    250   
   217    251   AC_DEFUN(DC_STATIC_LIBGCC, [
   218    252   	AC_MSG_CHECKING([how to link statically against libgcc])
   219    253   
   220    254   	SAVELDFLAGS="${LDFLAGS}"
   221    255   	staticlibgcc=""
................................................................................
   404    438   		WHOLEARCHIVE=`echo "${wholearchive}" | cut -f 1 -d ' '`
   405    439   		NOWHOLEARCHIVE=`echo "${wholearchive}" | cut -f 2 -d ' '`
   406    440   	fi
   407    441   
   408    442   	AC_SUBST(WHOLEARCHIVE)
   409    443   	AC_SUBST(NOWHOLEARCHIVE)
   410    444   ])
          445  +
          446  +AC_DEFUN(DC_SETLDRUNPATH, [
          447  +	OLD_LDFLAGS="${LDFLAGS}"
          448  +
          449  +	for testldflags in "-Wl,-rpath -Wl,$1" "-Wl,-R -Wl,$1"; do
          450  +		LDFLAGS="${OLD_LDFLAGS} ${testldflags}"
          451  +		AC_TRY_LINK([#include <stdio.h>], [ return(0); ], [
          452  +			LDRUNPATH="$LDRUNPATH $testldflags"
          453  +
          454  +			break
          455  +		])
          456  +	done
          457  +
          458  +	LDFLAGS="${OLD_LDFLAGS}"
          459  +
          460  +	AC_SUBST(LDRUNPATH)
          461  +])