summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authordas <das>2008-06-12 06:31:32 (GMT)
committerdas <das>2008-06-12 06:31:32 (GMT)
commitad2d76384a25830d6f6801c262abd066cae7a033 (patch)
treee2a1b6b0a2eb7ef0236f97f6b5cec04360b9a3b0 /unix/tcl.m4
parentb17d28a84cdeb21ba9166f0fe62174e3b62d1667 (diff)
downloadtk-ad2d76384a25830d6f6801c262abd066cae7a033.zip
tk-ad2d76384a25830d6f6801c262abd066cae7a033.tar.gz
tk-ad2d76384a25830d6f6801c262abd066cae7a033.tar.bz2
* unix/tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc.
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m461
1 files changed, 39 insertions, 22 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 6b09a17..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.
@@ -1957,16 +1970,20 @@ dnl AC_CHECK_TOOL(AR, ar)
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}";;