summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
Diffstat (limited to 'unix')
-rwxr-xr-xunix/configure250
-rw-r--r--unix/tcl.m4110
2 files changed, 340 insertions, 20 deletions
diff --git a/unix/configure b/unix/configure
index 63f35d3..dfd7cc2 100755
--- a/unix/configure
+++ b/unix/configure
@@ -3139,6 +3139,13 @@ cat >>confdefs.h <<\_ACEOF
#define _REENTRANT 1
_ACEOF
+ if test "`uname -s`" = "SunOS" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_PTHREAD_SEMANTICS 1
+_ACEOF
+
+ fi
cat >>confdefs.h <<\_ACEOF
#define _THREAD_SAFE 1
@@ -3886,6 +3893,129 @@ _ACEOF
fi
done
+ if test "x$ac_cv_func_readdir_r" = "xyes"; then
+ echo "$as_me:$LINENO: checking how many args readdir_r takes" >&5
+echo $ECHO_N "checking how many args readdir_r takes... $ECHO_C" >&6
+ # IRIX 5.3 has a 2 arg version of readdir_r
+ # while other systems have a 3 arg version.
+ if test "${tcl_cv_two_arg_readdir_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#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
+
+int
+main ()
+{
+readdir_r(NULL, NULL);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_two_arg_readdir_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_two_arg_readdir_r=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "${tcl_cv_three_arg_readdir_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#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
+
+int
+main ()
+{
+readdir_r(NULL, NULL, NULL);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_three_arg_readdir_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_three_arg_readdir_r=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "x$tcl_cv_two_arg_readdir_r" = "xyes" ; then
+ echo "$as_me:$LINENO: result: 2" >&5
+echo "${ECHO_T}2" >&6
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_TWO_ARG_READDIR_R 1
+_ACEOF
+
+ elif test "x$tcl_cv_three_arg_readdir_r" = "xyes" ; then
+ echo "$as_me:$LINENO: result: 3" >&5
+echo "${ECHO_T}3" >&6
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_THREE_ARG_READDIR_R 1
+_ACEOF
+
+ else
+ { { echo "$as_me:$LINENO: error: unknown number of args for readdir_r" >&5
+echo "$as_me: error: unknown number of args for readdir_r" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
else
TCL_THREADS=0
echo "$as_me:$LINENO: result: no (default)" >&5
@@ -4160,6 +4290,10 @@ fi
do64bit_ok=no
LDFLAGS_ORIG="$LDFLAGS"
+ # When ld needs options to work in 64-bit mode, put them in
+ # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
+ # is disabled by the user. [Bug 1016796]
+ LDFLAGS_ARCH=""
TCL_EXPORT_FILE_SUFFIX=""
UNSHARED_LIB_SUFFIX=""
TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`'
@@ -4168,7 +4302,7 @@ fi
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE=-O
if test "$GCC" = "yes" ; then
- CFLAGS_WARNING="-Wall -Wno-implicit-int -fno-strict-aliasing"
+ CFLAGS_WARNING="-Wall -Wno-implicit-int"
else
CFLAGS_WARNING=""
fi
@@ -4248,7 +4382,7 @@ echo "$as_me: WARNING: \"64bit mode not supported with GCC on $system\"" >&2;}
else
do64bit_ok=yes
CFLAGS="$CFLAGS -q64"
- LDFLAGS="$LDFLAGS -q64"
+ LDFLAGS_ARCH="-q64"
RANLIB="${RANLIB} -X64"
AR="${AR} -X64"
SHLIB_LD_FLAGS="-b64"
@@ -4310,7 +4444,7 @@ echo "$as_me: WARNING: \"64bit mode not supported with GCC on $system\"" >&2;}
else
do64bit_ok=yes
CFLAGS="$CFLAGS -q64"
- LDFLAGS="$LDFLAGS -q64"
+ LDFLAGS_ARCH="-q64"
RANLIB="${RANLIB} -X64"
AR="${AR} -X64"
SHLIB_LD_FLAGS="-b64"
@@ -4619,7 +4753,7 @@ echo "$as_me: WARNING: \"64bit mode not supported with GCC on $system\"" >&2;}
else
do64bit_ok=yes
CFLAGS="$CFLAGS +DD64"
- LDFLAGS="$LDFLAGS +DD64"
+ LDFLAGS_ARCH="+DD64"
fi
fi
;;
@@ -4764,7 +4898,7 @@ echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;}
do64bit_ok=yes
SHLIB_LD="ld -64 -shared -rdata_shared"
CFLAGS="$CFLAGS -64"
- LDFLAGS="$LDFLAGS -64"
+ LDFLAGS_ARCH="-64"
fi
fi
;;
@@ -5638,10 +5772,10 @@ echo "$as_me: WARNING: \"64bit mode not supported with GCC on $system\"" >&2;}
do64bit_ok=yes
if test "$do64bitVIS" = "yes" ; then
CFLAGS="$CFLAGS -xarch=v9a"
- LDFLAGS="$LDFLAGS -xarch=v9a"
+ LDFLAGS_ARCH="-xarch=v9a"
else
CFLAGS="$CFLAGS -xarch=v9"
- LDFLAGS="$LDFLAGS -xarch=v9"
+ LDFLAGS_ARCH="-xarch=v9"
fi
fi
else
@@ -5978,6 +6112,7 @@ fi;
LD_SEARCH_FLAGS=""
BUILD_DLTEST=""
fi
+ LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
# If we're running gcc, then change the C flags for compiling shared
# libraries to the right flags for gcc, instead of those for the
@@ -6079,6 +6214,11 @@ fi;
+cat >>confdefs.h <<_ACEOF
+#define TCL_SHLIB_EXT "${SHLIB_SUFFIX}"
+_ACEOF
+
+
@@ -6562,6 +6702,91 @@ _ACEOF
echo "$as_me:$LINENO: result: ${tcl_cv_struct_stat64}" >&5
echo "${ECHO_T}${tcl_cv_struct_stat64}" >&6
+
+
+for ac_func in open64 lseek64
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
echo "$as_me:$LINENO: checking for off64_t" >&5
echo $ECHO_N "checking for off64_t... $ECHO_C" >&6
if test "${tcl_cv_type_off64_t+set}" = set; then
@@ -6607,15 +6832,20 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
- if test "x${tcl_cv_type_off64_t}" = "xyes" ; then
+ if test "x${tcl_cv_type_off64_t}" = "xyes" && \
+ test "x${ac_cv_func_lseek64}" = "xyes" && \
+ test "x${ac_cv_func_open64}" = "xyes" ; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_TYPE_OFF64_T 1
_ACEOF
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- echo "$as_me:$LINENO: result: ${tcl_cv_type_off64_t}" >&5
-echo "${ECHO_T}${tcl_cv_type_off64_t}" >&6
fi
#------------------------------------------------------------------------
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 2554acc..3346500 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -438,6 +438,10 @@ AC_DEFUN(SC_ENABLE_THREADS, [
AC_DEFINE(USE_THREAD_STORAGE, 1,
[Use the generic thread storage subsystem?])
AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
+ if test "`uname -s`" = "SunOS" ; then
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
+ [Do we really want to follow the standard? Yes we do!])
+ fi
AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
if test "$tcl_ok" = "no"; then
@@ -511,6 +515,42 @@ AC_DEFUN(SC_ENABLE_THREADS, [
fi
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)])
@@ -865,6 +905,10 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
do64bit_ok=no
LDFLAGS_ORIG="$LDFLAGS"
+ # When ld needs options to work in 64-bit mode, put them in
+ # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
+ # is disabled by the user. [Bug 1016796]
+ LDFLAGS_ARCH=""
TCL_EXPORT_FILE_SUFFIX=""
UNSHARED_LIB_SUFFIX=""
TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`'
@@ -873,7 +917,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE=-O
if test "$GCC" = "yes" ; then
- CFLAGS_WARNING="-Wall -Wno-implicit-int -fno-strict-aliasing"
+ CFLAGS_WARNING="-Wall -Wno-implicit-int"
else
CFLAGS_WARNING=""
fi
@@ -917,7 +961,7 @@ dnl AC_CHECK_TOOL(AR, ar)
else
do64bit_ok=yes
CFLAGS="$CFLAGS -q64"
- LDFLAGS="$LDFLAGS -q64"
+ LDFLAGS_ARCH="-q64"
RANLIB="${RANLIB} -X64"
AR="${AR} -X64"
SHLIB_LD_FLAGS="-b64"
@@ -977,7 +1021,7 @@ dnl AC_CHECK_TOOL(AR, ar)
else
do64bit_ok=yes
CFLAGS="$CFLAGS -q64"
- LDFLAGS="$LDFLAGS -q64"
+ LDFLAGS_ARCH="-q64"
RANLIB="${RANLIB} -X64"
AR="${AR} -X64"
SHLIB_LD_FLAGS="-b64"
@@ -1098,7 +1142,7 @@ dnl AC_CHECK_TOOL(AR, ar)
else
do64bit_ok=yes
CFLAGS="$CFLAGS +DD64"
- LDFLAGS="$LDFLAGS +DD64"
+ LDFLAGS_ARCH="+DD64"
fi
fi
;;
@@ -1183,7 +1227,7 @@ dnl AC_CHECK_TOOL(AR, ar)
do64bit_ok=yes
SHLIB_LD="ld -64 -shared -rdata_shared"
CFLAGS="$CFLAGS -64"
- LDFLAGS="$LDFLAGS -64"
+ LDFLAGS_ARCH="-64"
fi
fi
;;
@@ -1585,10 +1629,10 @@ dnl AC_CHECK_TOOL(AR, ar)
do64bit_ok=yes
if test "$do64bitVIS" = "yes" ; then
CFLAGS="$CFLAGS -xarch=v9a"
- LDFLAGS="$LDFLAGS -xarch=v9a"
+ LDFLAGS_ARCH="-xarch=v9a"
else
CFLAGS="$CFLAGS -xarch=v9"
- LDFLAGS="$LDFLAGS -xarch=v9"
+ LDFLAGS_ARCH="-xarch=v9"
fi
fi
else
@@ -1758,6 +1802,7 @@ dnl AC_CHECK_TOOL(AR, ar)
LD_SEARCH_FLAGS=""
BUILD_DLTEST=""
fi
+ LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
# If we're running gcc, then change the C flags for compiling shared
# libraries to the right flags for gcc, instead of those for the
@@ -1871,6 +1916,8 @@ dnl esac
AC_SUBST(SHLIB_LD_LIBS)
AC_SUBST(SHLIB_CFLAGS)
AC_SUBST(SHLIB_SUFFIX)
+ AC_DEFINE_UNQUOTED(TCL_SHLIB_EXT,"${SHLIB_SUFFIX}",
+ [What is the default extension for shared libraries?])
AC_SUBST(MAKE_LIB)
AC_SUBST(MAKE_STUB_LIB)
@@ -2264,7 +2311,7 @@ AC_DEFUN(SC_TIME_HANDLER, [
AC_HEADER_TIME
AC_STRUCT_TIMEZONE
- AC_CHECK_FUNCS(gmtime_r localtime_r)
+ AC_CHECK_FUNCS(gmtime_r localtime_r mktime)
AC_MSG_CHECKING([tm_tzadj in struct tm])
AC_CACHE_VAL(tcl_cv_member_tm_tzadj,
@@ -2549,15 +2596,22 @@ AC_DEFUN(SC_TCL_64BIT_FLAGS, [
fi
AC_MSG_RESULT(${tcl_cv_struct_stat64})
+ AC_CHECK_FUNCS(open64 lseek64)
AC_MSG_CHECKING([for off64_t])
AC_CACHE_VAL(tcl_cv_type_off64_t,[
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
+ 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])
#--------------------------------------------------------------------
@@ -2588,6 +2642,42 @@ AC_DEFUN(SC_TCL_CFG_ENCODING, [
[What encoding should be used for embedded configuration info?])
fi])
+#--------------------------------------------------------------------
+# SC_TCL_CHECK_BROKEN_FUNC
+#
+# Declare the encoding to use for embedded configuration information.
+#
+# Arguments:
+# funcName - function to test for
+# advancedTest - the advanced test to run if the function is present
+#
+# Results:
+# Might cause compatability versions of the function to be used.
+# Might affect the following vars:
+# USE_COMPAT (implicit)
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN(SC_TCL_CHECK_BROKEN_FUNC,[
+ AC_CHECK_FUNC($1, tcl_ok=1, tcl_ok=0)
+ if test ["$tcl_ok"] = 1; then
+ AC_MSG_CHECKING([proper ]$1[ implementation])
+ AC_CACHE_VAL([tcl_cv_]$1[_unbroken],
+ AC_TRY_RUN([[int main() {]$2[}]],[tcl_cv_]$1[_unbroken]=ok,
+ [tcl_cv_]$1[_unbroken]=broken,[tcl_cv_]$1[_unbroken]=unknown))
+ AC_MSG_RESULT([$tcl_cv_]$1[_unbroken])
+ if test ["$tcl_cv_]$1[_unbroken"] = "ok"; then
+ tcl_ok=1
+ else
+ tcl_ok=0
+ fi
+ fi
+ if test ["$tcl_ok"] = 0; then
+ AC_LIBOBJ($1)
+ USE_COMPAT=1
+ fi])
+
+
# Local Variables:
# mode: autoconf
# End: