Diff

Differences From Artifact [bc43649110]:

To Artifact [e537bcd01c]:


    90     90   	AC_SUBST(CFLAGS)
    91     91   	AC_SUBST(CPPFLAGS)
    92     92   	AC_SUBST(LIBS)
    93     93   
    94     94   	AC_MSG_RESULT([$tkconfigsh])
    95     95   ])
    96     96   
    97         -AC_DEFUN(DC_DO_STATIC_LINK_LIBCXX, [
    98         -	AC_MSG_CHECKING([for how to statically link to libstdc++])
           97  +AC_DEFUN(DC_DO_STATIC_LINK_LIB, [
           98  +	AC_MSG_CHECKING([for how to statically link to $1])
    99     99   
   100    100   	SAVELIBS="${LIBS}"
   101         -	staticlibcxx=""
          101  +	staticlib=""
          102  +	found="0"
   102    103   	dnl HP/UX uses -Wl,-a,archive -lstdc++ -Wl,-a,shared_archive
   103    104   	dnl Linux and Solaris us -Wl,-Bstatic ... -Wl,-Bdynamic
   104         -	dnl
   105         -	dnl Sun Studio uses -lCstd -lCrun, most platforms use -lstdc++
   106         -	for trylink in "-Wl,-a,archive -lstdc++ -Wl,-a,shared_archive" "-Wl,-Bstatic -lCstd -lCrun -Wl,-Bdynamic" "-Wl,-Bstatic -lstdc++ -Wl,-Bdynamic" "-lCstd -lCrun" "-lstdc++"; do
          105  +	for trylink in "-Wl,-a,archive $2 -Wl,-a,shared_archive" "-Wl,-Bstatic $2 -Wl,-Bdynamic" "$2"; do
   107    106   		LIBS="${SAVELIBS} ${trylink}"
   108    107   
   109    108   		AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [
   110         -			staticlibcxx="${trylink}"
          109  +			staticlib="${trylink}"
          110  +			found="1"
   111    111   
   112    112   			break
   113    113   		])
   114    114   	done
   115         -	LIBS="${SAVELIBS} ${staticlibcxx}"
   116    115   
   117         -	AC_MSG_RESULT([${staticlibcxx}])
          116  +	if test "${found}" = "1"; then
          117  +		LIBS="${SAVELIBS} ${staticlib}"
   118    118   
   119         -	AC_SUBST(LIBS)
          119  +		AC_MSG_RESULT([${staticlib}])
          120  +
          121  +		AC_SUBST(LIBS)
          122  +
          123  +		$3
          124  +	else
          125  +		LIBS="${SAVELIBS}"
          126  +
          127  +		AC_MSG_RESULT([cant])
          128  +
          129  +		$4
          130  +	fi
          131  +])
          132  +
          133  +AC_DEFUN(DC_DO_STATIC_LINK_LIBCXX, [
          134  +	dnl Sun Studio uses -lCstd -lCrun, most platforms use -lstdc++
          135  +	DC_DO_STATIC_LINK_LIB([C++ Library (Sun Studio)], [-lCstd -lCrun],, [
          136  +		DC_DO_STATIC_LINK_LIB([C++ Library (UNIX)], [-lstdc++])
          137  +	])
   120    138   ])
   121    139   
   122    140   AC_DEFUN(DC_FIND_TCLKIT_LIBS, [
   123    141   	DC_SETUP_TCL_PLAT_DEFS
   124    142   
   125    143   	for proj in mk4tcl tcl tclvfs tk; do
   126    144   		AC_MSG_CHECKING([for libraries required for ${proj}])