summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m468
1 files changed, 15 insertions, 53 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index b7ad5d9..d56745f 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -761,9 +761,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
@@ -912,16 +909,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.
@@ -929,13 +925,12 @@ 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")
+ AC_MSG_WARN([64bit mode not supported with GCC on $system])
else
do64bit_ok=yes
CFLAGS="$CFLAGS -q64"
@@ -958,33 +953,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}.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}.exp'
# AIX v<=4.1 has some different flags than 4.2+
if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
@@ -992,21 +972,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_ARCH="-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
@@ -1093,8 +1058,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
@@ -1110,8 +1074,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")
@@ -1609,7 +1573,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
@@ -1838,7 +1801,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}
@@ -1907,7 +1870,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)