summaryrefslogtreecommitdiffstats
path: root/unix/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'unix/configure.in')
-rw-r--r--unix/configure.in96
1 files changed, 70 insertions, 26 deletions
diff --git a/unix/configure.in b/unix/configure.in
index 1f082dc..3ffccf3 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tcl installation
dnl to configure the system for the local environment.
#
-# RCS: @(#) $Id: configure.in,v 1.142 2006/05/04 14:01:27 dgp Exp $
+# RCS: @(#) $Id: configure.in,v 1.143 2006/07/20 06:18:38 das Exp $
AC_INIT([tcl],[8.5])
AC_PREREQ(2.59)
@@ -153,6 +153,13 @@ AC_CHECK_FUNC(strerror, , [AC_DEFINE(NO_STRERROR, 1, [Do we have strerror()])])
AC_CHECK_FUNC(getwd, , [AC_DEFINE(NO_GETWD, 1, [Do we have getwd()])])
AC_CHECK_FUNC(wait3, , [AC_DEFINE(NO_WAIT3, 1, [Do we have wait3()])])
AC_CHECK_FUNC(uname, , [AC_DEFINE(NO_UNAME, 1, [Do we have uname()])])
+
+if test "`uname -s`" = "Darwin" && test "${TCL_THREADS}" = 1 && \
+ test "`uname -r | awk -F. '{print [$]1}'`" -lt 7; then
+ # prior to Darwin 7, realpath is not threadsafe, so don't
+ # use it when threads are enabled, c.f. bug # 711232
+ ac_cv_func_realpath=no
+fi
AC_CHECK_FUNC(realpath, , [AC_DEFINE(NO_REALPATH, 1, [Do we have realpath()])])
#---------------------------------------------------------------------------
@@ -173,14 +180,14 @@ SC_SERIAL_PORT
# special flag.
#--------------------------------------------------------------------
-AC_CACHE_CHECK([for fd_set in sys/types], tcl_cv_type_fd_set,
+AC_CACHE_CHECK([for fd_set in sys/types], tcl_cv_type_fd_set, [
AC_TRY_COMPILE([#include <sys/types.h>],[fd_set readMask, writeMask;],
- tcl_cv_type_fd_set=yes, tcl_cv_type_fd_set=no))
+ tcl_cv_type_fd_set=yes, tcl_cv_type_fd_set=no)])
tcl_ok=$tcl_cv_type_fd_set
if test $tcl_ok = no; then
- AC_CACHE_CHECK([for fd_mask in sys/select], tcl_cv_grep_fd_mask,
+ AC_CACHE_CHECK([for fd_mask in sys/select], tcl_cv_grep_fd_mask, [
AC_EGREP_HEADER(fd_mask, sys/select.h,
- tcl_cv_grep_fd_mask=present, tcl_cv_grep_fd_mask=missing))
+ tcl_cv_grep_fd_mask=present, tcl_cv_grep_fd_mask=missing)])
if test $tcl_cv_grep_fd_mask = present; then
AC_DEFINE(HAVE_SYS_SELECT_H, 1, [Should we include <sys/select.h>?])
tcl_ok=yes
@@ -270,8 +277,8 @@ AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UID_T
-AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
- [AC_EGREP_CPP(changequote(<<,>>)dnl
+AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, [
+ AC_EGREP_CPP(changequote(<<,>>)dnl
<<(^|[^a-zA-Z_0-9])socklen_t[^a-zA-Z_0-9]>>dnl
changequote([,]),[
#include <sys/types.h>
@@ -302,13 +309,13 @@ AC_CHECK_FUNC(opendir, , [AC_DEFINE(USE_DIRENT2_H, 1, [May we include <dirent2.h
# the trick.
#--------------------------------------------------------------------
-AC_CACHE_CHECK([union wait], tcl_cv_union_wait,
+AC_CACHE_CHECK([union wait], tcl_cv_union_wait, [
AC_TRY_LINK([#include <sys/types.h>
#include <sys/wait.h>], [
union wait x;
WIFEXITED(x); /* Generates compiler error if WIFEXITED
* uses an int. */
- ], tcl_cv_union_wait=yes, tcl_cv_union_wait=no))
+ ], tcl_cv_union_wait=yes, tcl_cv_union_wait=no)])
if test $tcl_cv_union_wait = no; then
AC_DEFINE(NO_UNION_WAIT, 1, [Do we have a usable 'union wait'?])
fi
@@ -346,9 +353,9 @@ AC_CHECK_FUNC(BSDgettimeofday,
[AC_DEFINE(HAVE_BSDGETTIMEOFDAY, 1, [Do we have BSDgettimeofday()?])], [
AC_CHECK_FUNC(gettimeofday, , [AC_DEFINE(NO_GETTOD, 1, [Do we have gettimeofday()?])])
])
-AC_CACHE_CHECK([for gettimeofday declaration], tcl_cv_grep_gettimeofday,
+AC_CACHE_CHECK([for gettimeofday declaration], tcl_cv_grep_gettimeofday, [
AC_EGREP_HEADER(gettimeofday, sys/time.h,
- tcl_cv_grep_gettimeofday=present, tcl_cv_grep_gettimeofday=missing))
+ tcl_cv_grep_gettimeofday=present, tcl_cv_grep_gettimeofday=missing)])
if test $tcl_cv_grep_gettimeofday = missing ; then
AC_DEFINE(GETTOD_NOT_DECLARED, 1, [Is gettimeofday() actually declared in <sys/time.h>?])
fi
@@ -360,11 +367,11 @@ fi
#--------------------------------------------------------------------
AC_C_CHAR_UNSIGNED
-AC_CACHE_CHECK([signed char declarations], tcl_cv_char_signed,
+AC_CACHE_CHECK([signed char declarations], tcl_cv_char_signed, [
AC_TRY_COMPILE(, [
signed char *p;
p = 0;
- ], tcl_cv_char_signed=yes, tcl_cv_char_signed=no))
+ ], tcl_cv_char_signed=yes, tcl_cv_char_signed=no)])
if test $tcl_cv_char_signed = yes; then
AC_DEFINE(HAVE_SIGNED_CHAR, 1, [Are characters signed?])
fi
@@ -373,7 +380,7 @@ fi
# Does putenv() copy or not? We need to know to avoid memory leaks.
#--------------------------------------------------------------------
-AC_CACHE_CHECK([for a putenv() that copies the buffer], tcl_cv_putenv_copy,
+AC_CACHE_CHECK([for a putenv() that copies the buffer], tcl_cv_putenv_copy, [
AC_TRY_RUN([
#include <stdlib.h>
#define OURVAR "havecopy=yes"
@@ -395,8 +402,7 @@ AC_CACHE_CHECK([for a putenv() that copies the buffer], tcl_cv_putenv_copy,
],
tcl_cv_putenv_copy=no,
tcl_cv_putenv_copy=yes,
- tcl_cv_putenv_copy=no)
-)
+ tcl_cv_putenv_copy=no)])
if test $tcl_cv_putenv_copy = yes; then
AC_DEFINE(HAVE_PUTENV_THAT_COPIES, 1,
[Does putenv() copy strings or incorporate them by reference?])
@@ -415,23 +421,59 @@ SC_ENABLE_LANGINFO
AC_CHECK_FUNCS(chflags)
#--------------------------------------------------------------------
-# Check for support of getattrlist function (Darwin, HFS+)
+# Darwin specific API checks and defines
#--------------------------------------------------------------------
-AC_CHECK_FUNCS(getattrlist)
+if test "`uname -s`" = "Darwin" ; then
+ AC_CHECK_FUNCS(getattrlist)
+ AC_CHECK_HEADERS(copyfile.h)
+ AC_CHECK_FUNCS(copyfile)
+ if test $tcl_corefoundation = yes; then
+ AC_CHECK_HEADERS(libkern/OSAtomic.h)
+ AC_CHECK_FUNCS(OSSpinLockLock)
+ AC_CHECK_FUNCS(pthread_atfork)
+ fi
+ AC_DEFINE(USE_VFORK, 1, [Should we use vfork() instead of fork()?])
+ AC_DEFINE(TCL_DEFAULT_ENCODING, "utf-8",
+ [Are we to override what our default encoding is?])
+ AC_DEFINE(TCL_LOAD_FROM_MEMORY, 1,
+ [Can this platform load code from memory?])
+ AC_CHECK_HEADERS(AvailabilityMacros.h)
+ if test "$ac_cv_header_AvailabilityMacros_h" = yes; then
+ AC_CACHE_CHECK([if weak import is available], tcl_cv_cc_weak_import, [
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
+ AC_TRY_LINK([
+ #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+ #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020
+ #error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020
+ #endif
+ #elif MAC_OS_X_VERSION_MIN_REQUIRED < 1020
+ #error MAC_OS_X_VERSION_MIN_REQUIRED < 1020
+ #endif
+ int rand(void) __attribute__((weak_import));
+ ], [rand();],
+ tcl_cv_cc_weak_import=yes, tcl_cv_cc_weak_import=no)
+ CFLAGS=$hold_cflags])
+ if test $tcl_cv_cc_weak_import = yes; then
+ AC_DEFINE(HAVE_WEAK_IMPORT, 1, [Is weak import available?])
+ fi
+ fi
+fi
#--------------------------------------------------------------------
# Check for support of fts functions (readdir replacement)
#--------------------------------------------------------------------
AC_CACHE_CHECK([for fts], tcl_cv_api_fts, [
- AC_TRY_LINK([#include <sys/param.h>
- #include <sys/stat.h>
- #include <fts.h>],
- [char*const p[2] = {"/", NULL};
- FTS *f = fts_open(p, FTS_PHYSICAL|FTS_NOCHDIR|FTS_NOSTAT, NULL);
- FTSENT *e = fts_read(f); fts_close(f);],
- tcl_cv_api_fts=yes, tcl_cv_api_fts=no)])
+ AC_TRY_LINK([
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <fts.h>
+ ], [
+ char*const p[2] = {"/", NULL};
+ FTS *f = fts_open(p, FTS_PHYSICAL|FTS_NOCHDIR|FTS_NOSTAT, NULL);
+ FTSENT *e = fts_read(f); fts_close(f);
+ ], tcl_cv_api_fts=yes, tcl_cv_api_fts=no)])
if test $tcl_cv_api_fts = yes; then
AC_DEFINE(HAVE_FTS, 1, [Do we have fts functions?])
fi
@@ -447,13 +489,15 @@ SC_BLOCKING_STYLE
#------------------------------------------------------------------------
+AC_MSG_CHECKING([whether to use dll unloading])
AC_ARG_ENABLE(dll-unloading,
AC_HELP_STRING([--enable-dll-unloading],
- [turn on the 'unload' command (default: on)]),
+ [enable the 'unload' command (default: on)]),
[tcl_ok=$enableval], [tcl_ok=yes])
if test $tcl_ok = yes; then
AC_DEFINE(TCL_UNLOAD_DLLS, 1, [Do we allow unloading of shared libraries?])
fi
+AC_MSG_RESULT([$tcl_ok])
#--------------------------------------------------------------------
# The statements below define a collection of symbols related to