$NetBSD: patch-ab,v 1.1.1.1 2004/06/22 18:38:47 drochner Exp $ --- configure.orig Mon Mar 1 18:58:59 2004 +++ configure @@ -5613,12 +5613,13 @@ fi # Step 3: set configuration options based on system name and version. do64bit_ok=no + TCL_LIB_SPEC_RPATH="" EXTRA_CFLAGS="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`' ECHO_VERSION='`echo ${VERSION}`' - TCL_LIB_VERSIONS_OK=ok + TCL_LIB_VERSIONS_OK=nodots CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O if test "$GCC" = "yes" ; then @@ -5682,7 +5683,7 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" - LDFLAGS="" + LD_FLAGS="" LD_LIBRARY_PATH_VAR="LIBPATH" @@ -5693,7 +5694,7 @@ fi else do64bit_ok=yes EXTRA_CFLAGS="-q64" - LDFLAGS="-q64" + LD_FLAGS="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" @@ -5734,7 +5735,7 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} LD_LIBRARY_PATH_VAR="LIBPATH" @@ -5754,7 +5755,7 @@ fi else do64bit_ok=yes EXTRA_CFLAGS="-q64" - LDFLAGS="-q64" + LD_FLAGS="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" @@ -5830,7 +5831,7 @@ EOF SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; @@ -5841,7 +5842,7 @@ EOF SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - LDFLAGS="-export-dynamic" + LD_FLAGS="-export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; @@ -5852,7 +5853,7 @@ EOF SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; @@ -5916,7 +5917,7 @@ fi SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" - LDFLAGS="-Wl,-E" + LD_FLAGS="-Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" @@ -5952,10 +5953,10 @@ fi do64bit_ok=yes if test "`uname -m`" = "ia64" ; then EXTRA_CFLAGS="+DD64" - LDFLAGS="+DD64 $LDFLAGS" + LD_FLAGS="+DD64 $LD_FLAGS" else EXTRA_CFLAGS="+DA2.0W" - LDFLAGS="+DA2.0W $LDFLAGS" + LD_FLAGS="+DA2.0W $LD_FLAGS" fi fi fi @@ -6009,7 +6010,7 @@ fi SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" - LDFLAGS="-Wl,-E" + LD_FLAGS="-Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" @@ -6022,7 +6023,7 @@ fi SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" - LDFLAGS="-Wl,-D,08000000" + LD_FLAGS="-Wl,-D,08000000" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' @@ -6037,7 +6038,7 @@ fi CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' EXTRA_CFLAGS="" - LDFLAGS="" + LD_FLAGS="" ;; IRIX-6.*) SHLIB_CFLAGS="" @@ -6050,7 +6051,7 @@ fi LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then EXTRA_CFLAGS="-mabi=n32" - LDFLAGS="-mabi=n32" + LD_FLAGS="-mabi=n32" else case $system in IRIX-6.3) @@ -6061,7 +6062,7 @@ fi EXTRA_CFLAGS="-n32" ;; esac - LDFLAGS="-n32" + LD_FLAGS="-n32" fi ;; IRIX64-6.*) @@ -6071,7 +6072,7 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' @@ -6084,7 +6085,7 @@ fi do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" EXTRA_CFLAGS="-64" - LDFLAGS="-64" + LD_FLAGS="-64" fi fi ;; @@ -6103,7 +6104,7 @@ fi SHLIB_LD="${CC} -shared" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - LDFLAGS="-rdynamic" + LD_FLAGS="-rdynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else @@ -6139,7 +6140,7 @@ if eval "test \"`echo '$ac_cv_header_'$a SHLIB_LD="ld -shared" DL_OBJS="tclLoadDld.o" DL_LIBS="-ldld" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" else @@ -6178,7 +6179,7 @@ EOF SHLIB_LD="${CC} -shared" DL_OBJS="" DL_LIBS="-ldl" - LDFLAGS="-rdynamic" + LD_FLAGS="-rdynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" else @@ -6214,7 +6215,7 @@ if eval "test \"`echo '$ac_cv_header_'$a SHLIB_LD="ld -shared" DL_OBJS="" DL_LIBS="-ldld" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" else @@ -6233,7 +6234,7 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; @@ -6244,11 +6245,14 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - LDFLAGS="-Wl,-Bexport" + LD_FLAGS="-Wl,-Bexport" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[1-2].*|OpenBSD-*) + if test "X${COMPILER_OPTIMIZATION_BUG}" = "XYES"; then + CFLAGS_OPTIMIZE=-O0 + fi # Not available on all versions: check for include file. ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 @@ -6281,18 +6285,16 @@ if eval "test \"`echo '$ac_cv_header_'$a # NetBSD/SPARC needs -fPIC, -fpic will not do. SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' echo $ac_n "checking for ELF""... $ac_c" 1>&6 -echo "configure:6294: checking for ELF" >&5 +echo "configure:6308: checking for ELF" >&5 cat > conftest.$ac_ext <&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* - echo "$ac_t""yes" 1>&6 + + echo "$ac_t""yes" 1>&6 + SHLIB_LD='${TCL_CC} -shared -Wl,-x' + LD_SEARCH_FLAGS='-Wl,-R${LIB_RUNTIME_DIR}' + TCL_LIB_SPEC_RPATH="-Wl,-R${exec_prefix}/lib" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + else rm -rf conftest* - echo "$ac_t""no" 1>&6 + + echo "$ac_t""no" 1>&6 + SHLIB_LD="ld -Bshareable -x" + LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + TCL_LIB_SPEC_RPATH="-R${exec_prefix}/lib" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' fi @@ -6323,7 +6334,7 @@ else SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' @@ -6344,14 +6355,14 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - LDFLAGS="-export-dynamic" + LD_FLAGS="-export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "${TCL_THREADS}" = "1" ; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` EXTRA_CFLAGS="-pthread" - LDFLAGS="$LDFLAGS -pthread" + LD_FLAGS="$LD_FLAGS -pthread" fi case $system in FreeBSD-3.*) @@ -6372,7 +6383,7 @@ fi DL_OBJS="tclLoadDyld.o" PLAT_OBJS="tclMacOSXBundle.o" DL_LIBS="" - LDFLAGS="-prebind" + LD_FLAGS="-prebind" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" CFLAGS_OPTIMIZE="-Os" @@ -6389,7 +6400,7 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; @@ -6409,7 +6420,7 @@ EOF SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; @@ -6425,7 +6436,7 @@ EOF SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; @@ -6441,7 +6452,7 @@ EOF SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then @@ -6458,7 +6469,7 @@ EOF LIBS="$LIBS -lpthread -lmach -lexc" else EXTRA_CFLAGS="${EXTRA_CFLAGS} -pthread" - LDFLAGS="-pthread" + LD_FLAGS="-pthread" fi fi @@ -6473,7 +6484,7 @@ EOF DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; @@ -6484,7 +6495,7 @@ EOF SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" - LDFLAGS="-Wl,-D,08000000" + LD_FLAGS="-Wl,-D,08000000" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; @@ -6494,10 +6505,10 @@ EOF # below. if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC -melf" - LDFLAGS="-melf -Wl,-Bexport" + LD_FLAGS="-melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" - LDFLAGS="-belf -Wl,-Bexport" + LD_FLAGS="-belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" @@ -6514,7 +6525,7 @@ EOF SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; @@ -6525,7 +6536,7 @@ EOF SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} @@ -6561,7 +6572,7 @@ EOF SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - LDFLAGS="" + LD_FLAGS="" if test "$GCC" = "yes" ; then SHLIB_LD="$CC -shared" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' @@ -6587,7 +6598,7 @@ EOF SHLIB_CFLAGS="-KPIC" - LDFLAGS="" + LD_FLAGS="" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then @@ -6599,10 +6610,10 @@ EOF do64bit_ok=yes if test "$do64bitVIS" = "yes" ; then EXTRA_CFLAGS="-xarch=v9a" - LDFLAGS="-xarch=v9a" + LD_FLAGS="-xarch=v9a" else EXTRA_CFLAGS="-xarch=v9" - LDFLAGS="-xarch=v9" + LD_FLAGS="-xarch=v9" fi fi else @@ -6634,7 +6645,7 @@ EOF SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" - LDFLAGS="-Wl,-D,08000000" + LD_FLAGS="-Wl,-D,08000000" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "$GCC" != "yes" ; then @@ -6675,9 +6686,9 @@ rm -f conftest* LDFLAGS=$hold_ldflags echo "$ac_t""$found" 1>&6 if test $found = yes; then - LDFLAGS="-Wl,-Bexport" + LD_FLAGS="-Wl,-Bexport" else - LDFLAGS="" + LD_FLAGS="" fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" @@ -6852,7 +6863,7 @@ fi SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" - LDFLAGS="" + LD_FLAGS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" BUILD_DLTEST="" @@ -6889,16 +6900,16 @@ fi fi if test "$SHARED_LIB_SUFFIX" = "" ; then - SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then - UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' fi if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then LIB_SUFFIX=${SHARED_LIB_SUFFIX} - MAKE_LIB='${SHLIB_LD} -o $@ ${SHLIB_LD_FLAGS} ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' + MAKE_LIB='${SHLIB_LD} -o $@ ${SHLIB_LD_FLAGS} ${OBJS:.o=.lo} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS} -version-info 1:0' + INSTALL_LIB='$(INSTALL_LIBRARY) $(TCL_LA_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' else LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} @@ -7217,7 +7228,7 @@ elif test "$SHARED_BUILD" = "0" || test TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`\${TCL_DBGX}" fi TCL_BUILD_LIB_SPEC="-L`pwd` ${TCL_LIB_FLAG}" - TCL_LIB_SPEC="-L${libdir} ${TCL_LIB_FLAG}" + TCL_LIB_SPEC="${TCL_LIB_SPEC_RPATH} -L${libdir} ${TCL_LIB_FLAG}" else TCL_BUILD_EXP_FILE="lib.exp" eval "TCL_EXP_FILE=libtcl${TCL_EXPORT_FILE_SUFFIX}" @@ -7247,13 +7258,19 @@ VERSION=${TCL_VERSION} #-------------------------------------------------------------------- if test "$FRAMEWORK_BUILD" = "1" ; then - TCL_PACKAGE_PATH="${libdir}/Resources/Scripts" + TCL_PACKAGE_PATH_ADD="${libdir}/Resources/Scripts" elif test "$prefix" != "$exec_prefix"; then - TCL_PACKAGE_PATH="${libdir} ${prefix}/lib" + TCL_PACKAGE_PATH_ADD="${libdir}/tcl ${prefix}/lib" else - TCL_PACKAGE_PATH="${prefix}/lib" + TCL_PACKAGE_PATH_ADD="${prefix}/lib/tcl" fi - +for dir in ${TCL_PACKAGE_PATH_ADD}; do + if test -z "${TCL_PACKAGE_PATH}"; then + TCL_PACKAGE_PATH="$dir" + else + TCL_PACKAGE_PATH="${TCL_PACKAGE_PATH} $dir" + fi +done #-------------------------------------------------------------------- # The statements below define various symbols relating to Tcl # stub support. @@ -7487,6 +7504,7 @@ s%@LDFLAGS_DEBUG@%$LDFLAGS_DEBUG%g s%@LDFLAGS_OPTIMIZE@%$LDFLAGS_OPTIMIZE%g s%@CC_SEARCH_FLAGS@%$CC_SEARCH_FLAGS%g s%@LD_SEARCH_FLAGS@%$LD_SEARCH_FLAGS%g +s%@LD_FLAGS@%$LD_FLAGS%g s%@STLIB_LD@%$STLIB_LD%g s%@SHLIB_LD@%$SHLIB_LD%g s%@TCL_SHLIB_LD_EXTRAS@%$TCL_SHLIB_LD_EXTRAS%g