summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authorhobbs <hobbs>2005-01-28 20:59:06 (GMT)
committerhobbs <hobbs>2005-01-28 20:59:06 (GMT)
commite538470aa3811dd335a03635a14ef8a9aabb6918 (patch)
tree5dad17b4011a8b85ed57d178784f5117643952c1 /unix/tcl.m4
parentf70e69a0741a996977dba7906363d025b26988a7 (diff)
downloadtk-e538470aa3811dd335a03635a14ef8a9aabb6918.zip
tk-e538470aa3811dd335a03635a14ef8a9aabb6918.tar.gz
tk-e538470aa3811dd335a03635a14ef8a9aabb6918.tar.bz2
* unix/configure, unix/tcl.m4: add solaris 64-bit gcc build
support. [Bug 1021871]
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m475
1 files changed, 70 insertions, 5 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 4e47554..af4f8e4 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -435,6 +435,9 @@ AC_DEFUN(SC_ENABLE_THREADS, [
# allocator that significantly reduces lock contention
AC_DEFINE(USE_THREAD_ALLOC)
AC_DEFINE(_REENTRANT)
+ if test "`uname -s`" = "SunOS" ; then
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
+ fi
AC_DEFINE(_THREAD_SAFE)
AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
if test "$tcl_ok" = "no"; then
@@ -478,6 +481,42 @@ AC_DEFUN(SC_ENABLE_THREADS, [
AC_CHECK_FUNCS(pthread_atfork)
LIBS=$ac_saved_libs
AC_CHECK_FUNCS(readdir_r)
+ if test "x$ac_cv_func_readdir_r" = "xyes"; then
+ AC_MSG_CHECKING([how many args readdir_r takes])
+ # IRIX 5.3 has a 2 arg version of readdir_r
+ # while other systems have a 3 arg version.
+ AC_CACHE_VAL(tcl_cv_two_arg_readdir_r,
+ AC_TRY_COMPILE([#include <stdlib.h>
+#include <sys/types.h>
+#ifdef NO_DIRENT_H
+# include <sys/dir.h> /* logic from tcl/compat/dirent.h *
+# define dirent direct * */
+#else
+# include <dirent.h>
+#endif
+], [readdir_r(NULL, NULL);],
+ tcl_cv_two_arg_readdir_r=yes, tcl_cv_two_arg_readdir_r=no))
+ AC_CACHE_VAL(tcl_cv_three_arg_readdir_r,
+ AC_TRY_COMPILE([#include <stdlib.h>
+#include <sys/types.h>
+#ifdef NO_DIRENT_H
+# include <sys/dir.h> /* logic from tcl/compat/dirent.h *
+# define dirent direct * */
+#else
+# include <dirent.h>
+#endif
+], [readdir_r(NULL, NULL, NULL);],
+ tcl_cv_three_arg_readdir_r=yes, tcl_cv_three_arg_readdir_r=no))
+ if test "x$tcl_cv_two_arg_readdir_r" = "xyes" ; then
+ AC_MSG_RESULT([2])
+ AC_DEFINE(HAVE_TWO_ARG_READDIR_R)
+ elif test "x$tcl_cv_three_arg_readdir_r" = "xyes" ; then
+ AC_MSG_RESULT([3])
+ AC_DEFINE(HAVE_THREE_ARG_READDIR_R)
+ else
+ AC_MSG_ERROR([unknown number of args for readdir_r])
+ fi
+ fi
else
TCL_THREADS=0
AC_MSG_RESULT([no (default)])
@@ -1538,7 +1577,15 @@ dnl AC_CHECK_TOOL(AR, ar)
arch=`isainfo`
if test "$arch" = "sparcv9 sparc" ; then
if test "$GCC" = "yes" ; then
- AC_MSG_WARN("64bit mode not supported with GCC on $system")
+ if test "`gcc -dumpversion` | awk -F. '{print $1}'" -lt "3" ; then
+ AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system])
+ else
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64 -mcpu=v9"
+ LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD_FLAGS=""
+ fi
else
do64bit_ok=yes
if test "$do64bitVIS" = "yes" ; then
@@ -1548,9 +1595,11 @@ dnl AC_CHECK_TOOL(AR, ar)
CFLAGS="$CFLAGS -xarch=v9"
LDFLAGS="$LDFLAGS -xarch=v9"
fi
+ # Solaris 64 uses this as well
+ #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
fi
else
- AC_MSG_WARN("64bit mode only supported sparcv9 system")
+ AC_MSG_WARN([64bit mode only supported sparcv9 system])
fi
fi
@@ -1565,6 +1614,15 @@ dnl AC_CHECK_TOOL(AR, ar)
SHLIB_LD="$CC -shared"
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ if test "$do64bit" = "yes" ; then
+ # 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"
+ fi
else
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
@@ -2506,8 +2564,15 @@ AC_DEFUN(SC_TCL_64BIT_FLAGS, [
AC_TRY_COMPILE([#include <sys/types.h>],[off64_t offset;
],
tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)])
- if test "x${tcl_cv_type_off64_t}" = "xyes" ; then
- AC_DEFINE(HAVE_TYPE_OFF64_T)
+ AC_CHECK_FUNCS(open64 lseek64)
+ dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the
+ dnl functions lseek64 and open64 are defined.
+ if test "x${tcl_cv_type_off64_t}" = "xyes" && \
+ test "x${ac_cv_func_lseek64}" = "xyes" && \
+ test "x${ac_cv_func_open64}" = "xyes" ; then
+ AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in <sys/types.h>?])
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
fi
- AC_MSG_RESULT(${tcl_cv_type_off64_t})
fi])