summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authordas <das>2005-11-27 02:34:41 (GMT)
committerdas <das>2005-11-27 02:34:41 (GMT)
commitba70aa95d3d6bd4d0fd9fdd2292fdf970a08c1ae (patch)
tree50da2d930b34642a460752f68a389c77baa00323 /unix/tcl.m4
parent6ac7a57e2334ef01629b511af9388158bb0d1034 (diff)
downloadtcl-ba70aa95d3d6bd4d0fd9fdd2292fdf970a08c1ae.zip
tcl-ba70aa95d3d6bd4d0fd9fdd2292fdf970a08c1ae.tar.gz
tcl-ba70aa95d3d6bd4d0fd9fdd2292fdf970a08c1ae.tar.bz2
* unix/tcl.m4 (Darwin): add 64bit support, check for Tiger copyfile(),
add CFLAGS to SHLIB_LD to support passing -isysroot in env(CFLAGS) to configure (flag can't be present twice, so can't be in both CFLAGS and LDFLAGS during configure), don't use -prebind when deploying on 10.4, define TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING (rdar://3171542). (SC_ENABLE_LANGINFO, SC_TIME_HANDLER): add/fix caching, fix obsolete autoconf macros. Sync with tk/unix/tcl.m4, sync whitespace with HEAD. * unix/configure.in: fix obsolete autoconf macros, sync gratuitous formatting/ordering differences with tk/unix/configure.in. * unix/Makefile.in: add CFLAGS to tclsh/tcltest link to make executable linking the same as during configure (needed to avoid loosing any linker relevant flags in CFLAGS, in particular flags that can't be in LDFLAGS). Avoid concurrent linking of tclsh and compiling of tclTestInit.o or xtTestInit.o during parallel make. (checkstubs, checkdoc, checkexports): dependency and Darwin fixes * unix/tclLoadDyld.c (TclpDlopen): use NSADDIMAGE_OPTION_WITH_SEARCHING on second NSAddImage only. [Bug 1204237] (TclGuessPackageName): should not be MODULE_SCOPE. (TclpLoadMemory): ppc64 and endian (i386) fixes, add support for loading universal (fat) bundles from memory. * unix/tclUnixPort.h: * unix/tclUnixFCmd.c: add support for new Tiger copyfile() API to enable copying of xattrs & ACLs by [file copy]. * generic/tcl.h: add Darwin specifc configure overrides for TCL_WIDE defines to support fat compiles of ppc and ppc64 at the same time, (replaces Darwin CVS fix by emoy, rdar://3693001). add/correct location of version numbers in macosx files. * generic/tclInt.h: clarify fat compile comment. * unix/tclUnixPort.h: add Darwin specifc configure overrides to support fat compiles, where configure runs only once for multiple architectures (replaces Darwin CVS fix by emoy, rdar://3693001). * macosx/tclMacOSXBundle.c: * macosx/tclMacOSXNotify.c: * unix/tclUnixNotfy.c: * unix/tclUnixPort.h: fix #include order to support compile time override of HAVE_COREFOUNDATION in tclUnixPort.h when building for ppc64 * macosx/Tcl.pbproj/default.pbxuser (new file): * macosx/Tcl.pbproj/jingham.pbxuser: * macosx/Tcl.pbproj/project.pbxproj: sync with HEAD. * macosx/README: clarification/cleanup, sync with HEAD, document universal (fat) builds via CFLAGS (i.e. all of ppc ppc64 i386 at once). * macosx/Makefile: add support for reusing configure cache, build target fixes, remove GENERIC_FLAGS override now handled by tcl.m4. * generic/tclIOUtil.c: * generic/tclRegexp.c: * generic/tclVar.c: declare globals used only in own file as static (sync with HEAD). * generic/rege_dfa.c (getvacant): * generic/regexec.c (cfind): * generic/tclCompExpr.c (CompileSubExpr): * unix/tclUnixChan.c (TclUnixWaitForFile): initialise variables to silence gcc 4 warnings. * generic/regguts.h: only #define NDEBUG if not already #defined. * macosx/tclMacOSXNotify.c: sync whitespace & comments with HEAD * unix/configure: regen.
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m4129
1 files changed, 72 insertions, 57 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index fc87dcb..e8e5dc2 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -659,22 +659,20 @@ AC_DEFUN(SC_ENABLE_LANGINFO, [
HAVE_LANGINFO=0
if test "$langinfo_ok" = "yes"; then
- if test "$langinfo_ok" = "yes"; then
- AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
- fi
+ AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
fi
AC_MSG_CHECKING([whether to use nl_langinfo])
if test "$langinfo_ok" = "yes"; then
- AC_TRY_COMPILE([#include <langinfo.h>],
- [nl_langinfo(CODESET);],[langinfo_ok=yes],[langinfo_ok=no])
- if test "$langinfo_ok" = "no"; then
- langinfo_ok="no (could not compile with nl_langinfo)";
- fi
- if test "$langinfo_ok" = "yes"; then
+ AC_CACHE_VAL(tcl_cv_langinfo_h,
+ AC_TRY_COMPILE([#include <langinfo.h>], [nl_langinfo(CODESET);],
+ [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no]))
+ AC_MSG_RESULT($tcl_cv_langinfo_h)
+ if test $tcl_cv_langinfo_h = yes; then
AC_DEFINE(HAVE_LANGINFO)
fi
+ else
+ AC_MSG_RESULT([$langinfo_ok])
fi
- AC_MSG_RESULT([$langinfo_ok])
])
#--------------------------------------------------------------------
@@ -703,44 +701,44 @@ AC_DEFUN(SC_ENABLE_LANGINFO, [
# according to the user's selection.
#
#--------------------------------------------------------------------
-AC_DEFUN(SC_CONFIG_MANPAGES, [
- AC_MSG_CHECKING([whether to use symlinks for manpages])
- AC_ARG_ENABLE(man-symlinks,
- [ --enable-man-symlinks use symlinks for the manpages],
- test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks",
- enableval="no")
- AC_MSG_RESULT([$enableval])
-
- AC_MSG_CHECKING([whether to compress the manpages])
- AC_ARG_ENABLE(man-compression,
- [ --enable-man-compression=PROG
- compress the manpages with PROG],
- test "$enableval" = "yes" && AC_MSG_ERROR([missing argument to --enable-man-compression])
- test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --compress $enableval",
- enableval="no")
- AC_MSG_RESULT([$enableval])
- if test "$enableval" != "no"; then
- AC_MSG_CHECKING([for compressed file suffix])
- touch TeST
- $enableval TeST
- Z=`ls TeST* | sed 's/^....//'`
- rm -f TeST*
- MAN_FLAGS="$MAN_FLAGS --extension $Z"
- AC_MSG_RESULT([$Z])
- fi
+AC_DEFUN(SC_CONFIG_MANPAGES, [
+ AC_MSG_CHECKING([whether to use symlinks for manpages])
+ AC_ARG_ENABLE(man-symlinks,
+ [ --enable-man-symlinks use symlinks for the manpages],
+ test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks",
+ enableval="no")
+ AC_MSG_RESULT([$enableval])
+
+ AC_MSG_CHECKING([whether to compress the manpages])
+ AC_ARG_ENABLE(man-compression,
+ [ --enable-man-compression=PROG
+ compress the manpages with PROG],
+ test "$enableval" = "yes" && AC_MSG_ERROR([missing argument to --enable-man-compression])
+ test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --compress $enableval",
+ enableval="no")
+ AC_MSG_RESULT([$enableval])
+ if test "$enableval" != "no"; then
+ AC_MSG_CHECKING([for compressed file suffix])
+ touch TeST
+ $enableval TeST
+ Z=`ls TeST* | sed 's/^....//'`
+ rm -f TeST*
+ MAN_FLAGS="$MAN_FLAGS --extension $Z"
+ AC_MSG_RESULT([$Z])
+ fi
- AC_MSG_CHECKING([whether to add a package name suffix for the manpages])
- AC_ARG_ENABLE(man-suffix,
- [ --enable-man-suffix=STRING
- use STRING as a suffix to manpage file names
- (default: $1)],
- test "$enableval" = "yes" && enableval="$1"
- test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --suffix $enableval",
- enableval="no")
- AC_MSG_RESULT([$enableval])
-
- AC_SUBST(MAN_FLAGS)
+ AC_MSG_CHECKING([whether to add a package name suffix for the manpages])
+ AC_ARG_ENABLE(man-suffix,
+ [ --enable-man-suffix=STRING
+ use STRING as a suffix to manpage file names
+ (default: $1)],
+ test "$enableval" = "yes" && enableval="$1"
+ test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --suffix $enableval",
+ enableval="no")
+ AC_MSG_RESULT([$enableval])
+
+ AC_SUBST(MAN_FLAGS)
])
#--------------------------------------------------------------------
@@ -956,7 +954,7 @@ dnl AC_CHECK_TOOL(AR, ar)
if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then
if test "$GCC" = "yes" ; then
AC_MSG_WARN([64bit mode not supported with GCC on $system])
- else
+ else
do64bit_ok=yes
CFLAGS="$CFLAGS -q64"
LDFLAGS="$LDFLAGS -q64"
@@ -1363,7 +1361,7 @@ dnl AC_CHECK_TOOL(AR, ar)
SHLIB_CFLAGS="-fpic";;
esac
SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}"
- SHLIB_LD_LIBS=""
+ SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -1417,7 +1415,11 @@ dnl AC_CHECK_TOOL(AR, ar)
Darwin-*)
CFLAGS_OPTIMIZE="-Os"
SHLIB_CFLAGS="-fno-common"
- SHLIB_LD="cc -dynamiclib \${LDFLAGS}"
+ if test $do64bit = yes; then
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ fi
+ SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}'
AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
@@ -1430,7 +1432,12 @@ dnl AC_CHECK_TOOL(AR, ar)
SHLIB_SUFFIX=".dylib"
DL_OBJS="tclLoadDyld.o"
DL_LIBS=""
- LDFLAGS="$LDFLAGS -prebind -headerpad_max_install_names"
+ # Don't use -prebind when building for Mac OS X 10.4 or later only:
+ if test -z "${MACOSX_DEPLOYMENT_TARGET}" -o \
+ `echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F. '{print [$]2}'` -lt 4; then
+ LDFLAGS="$LDFLAGS -prebind"
+ fi
+ LDFLAGS="$LDFLAGS -headerpad_max_install_names"
AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
@@ -1450,12 +1457,18 @@ dnl AC_CHECK_TOOL(AR, ar)
AC_MSG_RESULT([$tcl_corefoundation])
if test $tcl_corefoundation = yes; then
AC_CACHE_CHECK([for CoreFoundation.framework], tcl_cv_lib_corefoundation, [
- hold_libs=$LIBS
+ hold_libs=$LIBS; hold_cflags=$CFLAGS
+ if test $do64bit_ok = no ; then
+ # remove -arch ppc64 from CFLAGS while testing presence
+ # of CF, otherwise all archs will have CF disabled.
+ # CF for ppc64 is disabled in tclUnixPort.h instead.
+ CFLAGS="`echo "$CFLAGS" | sed -e 's/-arch ppc64/-arch ppc/'`"
+ fi
LIBS="$LIBS -framework CoreFoundation"
AC_TRY_LINK([#include <CoreFoundation/CoreFoundation.h>],
[CFBundleRef b = CFBundleGetMainBundle();],
tcl_cv_lib_corefoundation=yes, tcl_cv_lib_corefoundation=no)
- LIBS=$hold_libs])
+ LIBS=$hold_libs; CFLAGS=$hold_cflags])
if test $tcl_cv_lib_corefoundation = yes; then
LIBS="$LIBS -framework CoreFoundation"
AC_DEFINE(HAVE_COREFOUNDATION)
@@ -1463,14 +1476,17 @@ dnl AC_CHECK_TOOL(AR, ar)
fi
AC_CHECK_HEADERS(libkern/OSAtomic.h)
AC_CHECK_FUNCS(OSSpinLockLock)
+ AC_CHECK_HEADERS(copyfile.h)
+ AC_CHECK_FUNCS(copyfile)
AC_DEFINE(MAC_OSX_TCL)
AC_DEFINE(USE_VFORK)
AC_DEFINE(TCL_DEFAULT_ENCODING,"utf-8")
AC_DEFINE(TCL_LOAD_FROM_MEMORY)
+ AC_DEFINE(TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING)
# prior to Darwin 7, realpath is not threadsafe, so don't
# use it when threads are enabled, c.f. bug # 711232:
AC_CHECK_FUNC(realpath)
- if test "$ac_cv_func_realpath" = yes -a "${TCL_THREADS}" = 1 \
+ if test $ac_cv_func_realpath = yes -a "${TCL_THREADS}" = 1 \
-a `uname -r | awk -F. '{print [$]1}'` -lt 7 ; then
ac_cv_func_realpath=no
fi
@@ -2177,9 +2193,7 @@ closedir(d);
AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H)])
# OS/390 lacks sys/param.h (and doesn't need it, by chance).
-
AC_HAVE_HEADERS(unistd.h sys/param.h)
-
])
#--------------------------------------------------------------------
@@ -2267,6 +2281,7 @@ AC_DEFUN(SC_PATH_X, [
XLIBSW=-lX11
fi
])
+
#--------------------------------------------------------------------
# SC_BLOCKING_STYLE
#
@@ -2383,7 +2398,7 @@ AC_DEFUN(SC_TIME_HANDLER, [
# (like convex) have timezone functions, etc.
#
AC_MSG_CHECKING([long timezone variable])
- AC_CACHE_VAL(tcl_cv_var_timezone,
+ AC_CACHE_VAL(tcl_cv_timezone_long,
AC_TRY_COMPILE([#include <time.h>],
[extern long timezone;
timezone += 1;
@@ -2667,7 +2682,7 @@ AC_DEFUN(SC_TCL_64BIT_FLAGS, [
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_DEFINE(HAVE_TYPE_OFF64_T)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)