summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authorhobbs <hobbs>2005-02-10 23:40:08 (GMT)
committerhobbs <hobbs>2005-02-10 23:40:08 (GMT)
commit767ffd22849381d6abc8bd53097e43ee6e136cb1 (patch)
treee1abe8f0ebdc2480b19b31119ab30e8bb026b5bd /unix/tcl.m4
parent79cafbd6c0706fdb54e160111eb9a04bfcd5da64 (diff)
downloadtcl-767ffd22849381d6abc8bd53097e43ee6e136cb1.zip
tcl-767ffd22849381d6abc8bd53097e43ee6e136cb1.tar.gz
tcl-767ffd22849381d6abc8bd53097e43ee6e136cb1.tar.bz2
* unix/Makefile.in: remove SHLIB_LD_FLAGS (only for AIX, inlined
* unix/tcl.m4: into SHLIB_LD). Combine AIX-* and AIX-5 * unix/configure: branches in SC_CONFIG_CFLAGS. Enable 64-bit gcc builds for AIX-4+, correct gcc builds for HP-UX-11.
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m470
1 files changed, 16 insertions, 54 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index bc1025b..16eb892 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -747,9 +747,6 @@ AC_DEFUN(SC_CONFIG_MANPAGES, [
# code, among other things).
# SHLIB_LD - Base command to use for combining object files
# into a shared library.
-# SHLIB_LD_FLAGS -Flags to pass when building a shared library. This
-# differes from the SHLIB_CFLAGS as it is not used
-# when building object files or executables.
# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
# creating shared libraries. This symbol typically
# goes at the end of the "ld" commands that build
@@ -891,16 +888,15 @@ dnl AC_CHECK_TOOL(AR, ar)
LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
PLAT_OBJS=""
case $system in
- AIX-5.*)
+ AIX-*)
if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
# AIX requires the _r compiler when gcc isn't being used
if test "${CC}" != "cc_r" ; then
CC=${CC}_r
fi
- AC_MSG_RESULT(Using $CC for compiling with threads)
+ AC_MSG_RESULT([Using $CC for compiling with threads])
fi
LIBS="$LIBS -lc"
- # AIX-5 uses ELF style dynamic libraries
SHLIB_CFLAGS=""
# Note: need the LIBS below, otherwise Tk won't find Tcl's
# symbols when dynamically loaded into tclsh.
@@ -908,14 +904,13 @@ dnl AC_CHECK_TOOL(AR, ar)
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
-
LD_LIBRARY_PATH_VAR="LIBPATH"
- # Check to enable 64-bit flags for compiler/linker
- if test "$do64bit" = "yes" ; then
+ # Check to enable 64-bit flags for compiler/linker on AIX 4+
+ if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then
if test "$GCC" = "yes" ; then
- AC_MSG_WARN("64bit mode not supported with GCC on $system")
- else
+ AC_MSG_WARN([64bit mode not supported with GCC on $system])
+ else
do64bit_ok=yes
CFLAGS="$CFLAGS -q64"
LDFLAGS="$LDFLAGS -q64"
@@ -937,33 +932,18 @@ dnl AC_CHECK_TOOL(AR, ar)
fi
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
else
- SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}"
+ if test "$GCC" = "yes" ; then
+ SHLIB_LD="gcc -shared"
+ else
+ SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
+ fi
+ SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}"
DL_LIBS="-ldl"
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
TCL_NEEDS_EXP_FILE=1
TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
fi
- ;;
- AIX-*)
- if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
- # AIX requires the _r compiler when gcc isn't being used
- if test "${CC}" != "cc_r" ; then
- CC=${CC}_r
- fi
- AC_MSG_RESULT(Using $CC for compiling with threads)
- fi
- LIBS="$LIBS -lc"
- SHLIB_CFLAGS=""
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
- LD_LIBRARY_PATH_VAR="LIBPATH"
- TCL_NEEDS_EXP_FILE=1
- TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
# AIX v<=4.1 has some different flags than 4.2+
if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
@@ -971,21 +951,6 @@ dnl AC_CHECK_TOOL(AR, ar)
DL_LIBS="-lld"
fi
- # Check to enable 64-bit flags for compiler/linker
- if test "$do64bit" = "yes" ; then
- if test "$GCC" = "yes" ; then
- AC_MSG_WARN("64bit mode not supported with GCC on $system")
- else
- do64bit_ok=yes
- CFLAGS="$CFLAGS -q64"
- LDFLAGS="$LDFLAGS -q64"
- RANLIB="${RANLIB} -X64"
- AR="${AR} -X64"
- SHLIB_LD_FLAGS="-b64"
- fi
- fi
- SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}"
-
# On AIX <=v4 systems, libbsd.a has to be linked in to support
# non-blocking file IO. This library has to be linked in after
# the MATH_LIBS or it breaks the pow() function. The way to
@@ -1072,8 +1037,7 @@ dnl AC_CHECK_TOOL(AR, ar)
if test "$GCC" = "yes" ; then
SHLIB_LD="gcc -shared"
SHLIB_LD_LIBS='${LIBS}'
- LD_SEARCH_FLAGS=''
- CC_SEARCH_FLAGS=''
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
fi
# Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
@@ -1089,8 +1053,8 @@ dnl AC_CHECK_TOOL(AR, ar)
do64bit_ok=yes
SHLIB_LD="gcc -shared"
SHLIB_LD_LIBS='${LIBS}'
- LD_SEARCH_FLAGS=''
- CC_SEARCH_FLAGS=''
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
;;
*)
AC_MSG_WARN("64bit mode not supported with GCC on $system")
@@ -1584,7 +1548,6 @@ dnl AC_CHECK_TOOL(AR, ar)
CFLAGS="$CFLAGS -m64 -mcpu=v9"
LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD_FLAGS=""
fi
else
do64bit_ok=yes
@@ -1807,7 +1770,7 @@ dnl AC_CHECK_TOOL(AR, ar)
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}'
+ MAKE_LIB='${SHLIB_LD} -o [$]@ ${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)'
else
LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
@@ -1865,7 +1828,6 @@ dnl esac
AC_SUBST(SHLIB_LD)
AC_SUBST(TCL_SHLIB_LD_EXTRAS)
AC_SUBST(TK_SHLIB_LD_EXTRAS)
- AC_SUBST(SHLIB_LD_FLAGS)
AC_SUBST(SHLIB_LD_LIBS)
AC_SUBST(SHLIB_CFLAGS)
AC_SUBST(SHLIB_SUFFIX)