$NetBSD: patch-ab,v 1.5 2008/07/14 00:43:34 dholland Exp $ --- unix/configure.orig 2001-10-20 02:24:40.000000000 +0200 +++ unix/configure @@ -1688,7 +1688,7 @@ echo "configure:1679: checking system ve # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then - system=MP-RAS-`awk '{print }' /etc/.relid'` + system=MP-RAS-`awk '{print }' /etc/.relid` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` @@ -1746,6 +1746,7 @@ fi do64bit_ok=no fullSrcDir=`cd $srcdir; pwd` + RPATH_FLAG="" EXTRA_CFLAGS="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" @@ -2084,8 +2085,11 @@ fi LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' EXTRA_CFLAGS="" LDFLAGS="" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + TCL_LIB_VERSIONS_OK=nodots ;; - IRIX-6.*|IRIX64-6.5*) + IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' @@ -2108,6 +2112,9 @@ fi esac LDFLAGS="-n32" fi + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + TCL_LIB_VERSIONS_OK=nodots ;; IRIX64-6.*) SHLIB_CFLAGS="" @@ -2118,6 +2125,22 @@ fi DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + + # Check to enable 64-bit flags for compiler/linker + + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + echo "configure: warning: 64bit mode not supported by gcc" 1>&2 + else + do64bit_ok=yes + SHLIB_LD="ld -64 -shared -rdata_shared" + CFLAGS="$CFLAGS -64" + LDFLAGS="$LDFLAGS -64" + fi + fi + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + TCL_LIB_VERSIONS_OK=nodots ;; Linux*) SHLIB_CFLAGS="-fPIC" @@ -2136,6 +2159,9 @@ fi DL_LIBS="-ldl" LDFLAGS="-rdynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + TCL_LIB_VERSIONS_OK=nodots else ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dld.h""... $ac_c" 1>&6 @@ -2267,7 +2293,7 @@ fi LDFLAGS="-Wl,-Bexport" LD_SEARCH_FLAGS="" ;; - NetBSD-*|FreeBSD-[1-2].*|OpenBSD-*) + NetBSD-*|FreeBSD-[1-2].*|OpenBSD-*|DragonFly-*) # 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 @@ -2300,7 +2326,6 @@ 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" @@ -2321,13 +2346,23 @@ EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* + echo "$ac_t""yes" 1>&6 + SHLIB_LD='${TCL_CC} -shared -Wl,-x' + RPATH_FLAG='-Wl,-R' + LD_SEARCH_FLAGS='-Wl,-R${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + else rm -rf conftest* + echo "$ac_t""no" 1>&6 + SHLIB_LD="ld -Bshareable -x" + RPATH_FLAG='-R' + LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' + fi rm -f conftest* @@ -2539,6 +2574,9 @@ EOF DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5*) @@ -2586,6 +2624,9 @@ EOF else LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + TCL_LIB_VERSIONS_OK=nodots ;; ULTRIX-4.*) SHLIB_CFLAGS="-G 0" @@ -2828,7 +2869,7 @@ fi ;; IRIX*) ;; - NetBSD-*|FreeBSD-*|OpenBSD-*) + NetBSD-*|FreeBSD-*|OpenBSD-*|DragonFly-*) ;; Rhapsody-*|Darwin-*) ;; @@ -3837,7 +3878,11 @@ echo "configure:3835: checking for X11 l for i in $dirs ; do if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then echo "$ac_t""$i" 1>&6 + if test "${RPATH_FLAG}" != ""; then + XLIBSW="-L$i ${RPATH_FLAG}$i -lX11" + else XLIBSW="-L$i -lX11" + fi x_libraries="$i" break fi @@ -3846,12 +3891,16 @@ echo "configure:3835: checking for X11 l if test "$x_libraries" = ""; then XLIBSW=-lX11 else + if test "${RPATH_FLAG}" != ""; then + XLIBSW="-L$x_libraries ${RPATH_FLAG}$x_libraries -lX11" + else XLIBSW="-L$x_libraries -lX11" fi fi + fi if test "$XLIBSW" = nope ; then echo $ac_n "checking for XCreateWindow in -lXwindow""... $ac_c" 1>&6 -echo "configure:3855: checking for XCreateWindow in -lXwindow" >&5 +echo "configure:3879: checking for XCreateWindow in -lXwindow" >&5 ac_lib_var=`echo Xwindow'_'XCreateWindow | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3916,6 +3965,10 @@ if test "x${x_libraries}" != "x"; then fi if test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; then LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -L/g'` +elif test "${TCL_LD_SEARCH_FLAGS}" = '-R${LIB_RUNTIME_DIR}'; then + LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -R/g'` +elif test "${TCL_LD_SEARCH_FLAGS}" = '-Wl,-R${LIB_RUNTIME_DIR}'; then + LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -Wl,-R/g'` fi # The statement below is very tricky! It actually *evaluates* the @@ -4588,7 +4641,7 @@ TCL_STUB_LIB_SPEC='-L$(TCL_BIN_DIR) $(TC if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then TK_SHLIB_CFLAGS="${SHLIB_CFLAGS}" TK_LIB_FILE=libtk${TK_SHARED_LIB_SUFFIX} - MAKE_LIB="\${SHLIB_LD} -o \$@ \${OBJS} \$(TK_LD_SEARCH_FLAGS) ${TCL_STUB_LIB_SPEC} \${SHLIB_LD_LIBS}" + MAKE_LIB="\${SHLIB_LD} -o \${@:C/\.so.*/.la/} \${OBJS:.o=.lo} \$(TK_LD_SEARCH_FLAGS) ${TCL_STUB_LIB_SPEC} \${SHLIB_LD_LIBS} -version-info 1:0" RANLIB=":" # TCL_STUB_FLAGS="-DUSE_TCL_STUBS" @@ -4611,11 +4664,17 @@ eval "TK_LIB_FILE=${TK_LIB_FILE}" if test "$SHARED_BUILD" = 0 -o $TCL_NEEDS_EXP_FILE = 0; then if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}" + eval TK_BUILD_LIB_SPEC="libtk${VERSION}\${TK_DBGX}.la" else eval TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}" + eval TK_BUILD_LIB_SPEC="libtk`echo ${VERSION} | tr -d .`\${TK_DBGX}.la" + fi + if test "${RPATH_FLAG}" != ""; then + TK_LIB_SPEC_RPATH="${RPATH_FLAG}${exec_prefix}/lib" + else + TK_LIB_SPEC_RPATH="" fi - TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}" - TK_LIB_SPEC="-L${exec_prefix}/lib ${TK_LIB_FLAG}" + TK_LIB_SPEC="-L${exec_prefix}/lib ${TK_LIB_SPEC_RPATH} ${TK_LIB_FLAG}" TK_BUILD_EXP_FILE="" TK_EXP_FILE="" else