diff options
author | das <das> | 2008-06-12 06:35:22 (GMT) |
---|---|---|
committer | das <das> | 2008-06-12 06:35:22 (GMT) |
commit | d7fee8d3277d15301871b1b37cccc456d5fe0391 (patch) | |
tree | db5e47a9060bea6733b013a3598566c2941cc207 /unix | |
parent | 7b54fd55f4cc8300fec06e8ef725a67916cf1939 (diff) | |
download | tk-d7fee8d3277d15301871b1b37cccc456d5fe0391.zip tk-d7fee8d3277d15301871b1b37cccc456d5fe0391.tar.gz tk-d7fee8d3277d15301871b1b37cccc456d5fe0391.tar.bz2 |
* unix/tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc.
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tcl.m4 | 63 |
1 files changed, 39 insertions, 24 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4 index bf1c524..1659a12 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1918,33 +1918,46 @@ dnl AC_CHECK_TOOL(AR, ar) ]) ], [AS_IF([test "$arch" = "amd64 i386"], [ AS_IF([test "$GCC" = yes], [ - AC_MSG_WARN([64bit mode not supported with GCC on $system]) + case $system in + SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*) + do64bit_ok=yes + CFLAGS="$CFLAGS -m64" + LDFLAGS="$LDFLAGS -m64";; + *) + AC_MSG_WARN([64bit mode not supported with GCC on $system]);; + esac ], [ do64bit_ok=yes - CFLAGS="$CFLAGS -xarch=amd64" - LDFLAGS="$LDFLAGS -xarch=amd64" + case $system in + SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*) + CFLAGS="$CFLAGS -m64" + LDFLAGS="$LDFLAGS -m64";; + *) + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64";; + esac ]) ], [AC_MSG_WARN([64bit mode not supported for $arch])])]) ]) #-------------------------------------------------------------------- # On Solaris 5.x i386 with the sunpro compiler we need to link - # with sunmath to get floating point rounding control - #-------------------------------------------------------------------- - AS_IF([test "$GCC" = yes],[use_sunmath=no],[ + # with sunmath to get floating point rounding control + #-------------------------------------------------------------------- + AS_IF([test "$GCC" = yes],[use_sunmath=no],[ arch=`isainfo` - AC_MSG_CHECKING([whether to use -lsunmath for fp rounding control]) + AC_MSG_CHECKING([whether to use -lsunmath for fp rounding control]) AS_IF([test "$arch" = "amd64 i386"], [ - AC_MSG_RESULT([yes]) + AC_MSG_RESULT([yes]) MATH_LIBS="-lsunmath $MATH_LIBS" - AC_CHECK_HEADER(sunmath.h) + AC_CHECK_HEADER(sunmath.h) use_sunmath=yes - ], [ + ], [ AC_MSG_RESULT([no]) use_sunmath=no - ]) - ]) - + ]) + ]) + # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. @@ -1952,23 +1965,25 @@ dnl AC_CHECK_TOOL(AR, ar) SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - - AS_IF([test "$GCC" = yes], [ SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} AS_IF([test "$do64bit_ok" = yes], [ - # We need to specify -static-libgcc or we need to - # add the path to the sparv9 libgcc. - SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" - # for finding sparcv9 libgcc, get the regular libgcc - # path, remove so name and append 'sparcv9' - #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." - #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + AS_IF([test "$arch" = "sparcv9 sparc"], [ + # We need to specify -static-libgcc or we need to + # add the path to the sparv9 libgcc. + SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" + # for finding sparcv9 libgcc, get the regular libgcc + # path, remove so name and append 'sparcv9' + #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." + #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + ], [AS_IF([test "$arch" = "amd64 i386"], [ + SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" + ])]) ]) ], [ - AS_IF([test "$use_sunmath" = yes], [textmode=textoff],[textmode=text]) + AS_IF([test "$use_sunmath" = yes], [textmode=textoff],[textmode=text]) case $system in SunOS-5.[[1-9]][[0-9]]*) SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";; @@ -2613,7 +2628,7 @@ AC_DEFUN([SC_TCL_LINK_LIBS], [ AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) - + #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. |