summaryrefslogtreecommitdiffstats
path: root/unix/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'unix/configure.in')
-rw-r--r--unix/configure.in93
1 files changed, 69 insertions, 24 deletions
diff --git a/unix/configure.in b/unix/configure.in
index 13bc03e..c4dc1b3 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.106.2.27 2006/05/04 13:09:19 dgp Exp $
+# RCS: @(#) $Id: configure.in,v 1.106.2.28 2006/07/20 06:21:45 das Exp $
AC_INIT(../generic/tcl.h)
AC_PREREQ(2.13)
@@ -133,6 +133,13 @@ AC_CHECK_FUNC(strerror, , [AC_DEFINE(NO_STRERROR)])
AC_CHECK_FUNC(getwd, , [AC_DEFINE(NO_GETWD)])
AC_CHECK_FUNC(wait3, , [AC_DEFINE(NO_WAIT3)])
AC_CHECK_FUNC(uname, , [AC_DEFINE(NO_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)])
#---------------------------------------------------------------------------
@@ -153,14 +160,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)
tcl_ok=yes
@@ -295,8 +302,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>
@@ -327,13 +334,13 @@ AC_CHECK_FUNC(opendir, , [AC_DEFINE(USE_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)
fi
@@ -370,9 +377,9 @@ AC_CHECK_FUNC(BSDgettimeofday,
[AC_DEFINE(HAVE_BSDGETTIMEOFDAY)], [
AC_CHECK_FUNC(gettimeofday, , [AC_DEFINE(NO_GETTOD)])
])
-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)
fi
@@ -384,11 +391,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)
fi
@@ -397,7 +404,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"
@@ -419,8 +426,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)
fi
@@ -432,19 +438,58 @@ fi
SC_ENABLE_LANGINFO
#--------------------------------------------------------------------
+# Darwin specific API checks and defines
+#--------------------------------------------------------------------
+
+if test "`uname -s`" = "Darwin" ; then
+ 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)
+ AC_DEFINE(TCL_DEFAULT_ENCODING, "utf-8")
+ AC_DEFINE(TCL_LOAD_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)
+ 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?])
+ AC_DEFINE(HAVE_FTS)
fi
#--------------------------------------------------------------------