From ba70aa95d3d6bd4d0fd9fdd2292fdf970a08c1ae Mon Sep 17 00:00:00 2001 From: das Date: Sun, 27 Nov 2005 02:34:41 +0000 Subject: * 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. --- ChangeLog | 76 +- generic/rege_dfa.c | 2 +- generic/regexec.c | 2 +- generic/regguts.h | 2 + generic/tcl.h | 20 +- generic/tclCompExpr.c | 5 +- generic/tclIOUtil.c | 4 +- generic/tclInt.h | 6 +- generic/tclRegexp.c | 4 +- generic/tclVar.c | 8 +- macosx/Makefile | 14 +- macosx/README | 142 +- macosx/Tcl.pbproj/default.pbxuser | 173 + macosx/Tcl.pbproj/jingham.pbxuser | 154 +- macosx/Tcl.pbproj/project.pbxproj | 354 +- macosx/tclMacOSXBundle.c | 4 +- macosx/tclMacOSXNotify.c | 519 +-- unix/Makefile.in | 30 +- unix/configure | 6646 +++++++++++++++++++------------------ unix/configure.in | 47 +- unix/tcl.m4 | 129 +- unix/tclLoadDyld.c | 67 +- unix/tclUnixChan.c | 4 +- unix/tclUnixFCmd.c | 8 +- unix/tclUnixNotfy.c | 6 +- unix/tclUnixPort.h | 35 +- 26 files changed, 4646 insertions(+), 3815 deletions(-) create mode 100644 macosx/Tcl.pbproj/default.pbxuser diff --git a/ChangeLog b/ChangeLog index 0c5ff97..654d986 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,77 @@ +2005-11-27 Daniel Steffen + + * 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. + 2005-11-20 Joe English * generic/tclStubLib.c: Don't set tclStubsPtr to 0 when @@ -69,7 +143,7 @@ that file times will appear different in Tcl from the way they do in Windows Explorer or a 'dir' listing, because the Microsoft tools get the DST state wrong in the listings. - + 2005-11-09 Kevin B. Kenny * generic/tclTimer.c: Changed [after] so that it behaves correctly diff --git a/generic/rege_dfa.c b/generic/rege_dfa.c index 313892c..bc391fd 100644 --- a/generic/rege_dfa.c +++ b/generic/rege_dfa.c @@ -561,7 +561,7 @@ chr *start; struct sset *ss; struct sset *p; struct arcp ap; - struct arcp lastap; + struct arcp lastap = {NULL, 0}; /* silence gcc 4 warning */ color co; ss = pickss(v, d, cp, start); diff --git a/generic/regexec.c b/generic/regexec.c index 41d49bd..3eb73d1 100644 --- a/generic/regexec.c +++ b/generic/regexec.c @@ -349,7 +349,7 @@ struct colormap *cm; { struct dfa *s; struct dfa *d; - chr *cold; + chr *cold = NULL; /* silence gcc 4 warning */ int ret; s = newdfa(v, &v->g->search, cm, &v->dfa1); diff --git a/generic/regguts.h b/generic/regguts.h index 36e5092..b6152f4 100644 --- a/generic/regguts.h +++ b/generic/regguts.h @@ -55,8 +55,10 @@ /* assertions */ #ifndef assert # ifndef REG_DEBUG +# ifndef NDEBUG # define NDEBUG /* no assertions */ # endif +# endif #include #endif diff --git a/generic/tcl.h b/generic/tcl.h index 51dba46..4c2d7ed 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tcl.h,v 1.153.2.20 2005/11/16 22:05:26 dgp Exp $ + * RCS: @(#) $Id: tcl.h,v 1.153.2.21 2005/11/27 02:34:41 das Exp $ */ #ifndef _TCL @@ -46,7 +46,8 @@ extern "C" { * win/makefile.vc (not patchlevel) 2 LOC * README (sections 0 and 2) * mac/README (2 LOC, not patchlevel) - * macosx/Tcl.pbproj/project.pbxproj (not patchlevel) 2 LOC + * macosx/Tcl.pbproj/project.pbxproj (not patchlevel) 1 LOC + * macosx/Tcl.pbproj/default.pbxuser (not patchlevel) 1 LOC * win/README.binary (sections 0-4) * win/README (not patchlevel) (sections 0 and 2) * unix/tcl.spec (2 LOC Major/Minor, 1 LOC patch) @@ -328,6 +329,21 @@ typedef long LONG; #endif /* + * Darwin specifc configure overrides (to support fat compiles, where + * configure runs only once for multiple architectures): + */ + +#ifdef __APPLE__ +# ifdef __LP64__ +# undef TCL_WIDE_INT_TYPE +# define TCL_WIDE_INT_IS_LONG 1 +# else /* !__LP64__ */ +# define TCL_WIDE_INT_TYPE long long +# undef TCL_WIDE_INT_IS_LONG +# endif /* __LP64__ */ +#endif /* __APPLE__ */ + +/* * Define Tcl_WideInt to be a type that is (at least) 64-bits wide, * and define Tcl_WideUInt to be the unsigned variant of that type * (assuming that where we have one, we can have the other.) diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 68e1e11..bedf35d 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompExpr.c,v 1.13.2.1 2005/08/03 22:23:35 dgp Exp $ + * RCS: @(#) $Id: tclCompExpr.c,v 1.13.2.2 2005/11/27 02:34:41 das Exp $ */ #include "tclInt.h" @@ -338,7 +338,8 @@ CompileSubExpr(exprTokenPtr, infoPtr, envPtr) CompileEnv *envPtr; /* Holds resulting instructions. */ { Tcl_Interp *interp = infoPtr->interp; - Tcl_Token *tokenPtr, *endPtr, *afterSubexprPtr; + Tcl_Token *tokenPtr, *endPtr = NULL; /* silence gcc 4 warning */ + Tcl_Token *afterSubexprPtr; OperatorDesc *opDescPtr; Tcl_HashEntry *hPtr; CONST char *operator; diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 50882ec..73f824d 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -17,7 +17,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.22 2005/10/05 04:27:38 hobbs Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.23 2005/11/27 02:34:41 das Exp $ */ #include "tclInt.h" @@ -4592,7 +4592,7 @@ static int FindSplitPos _ANSI_ARGS_((char *path, char *separator)); * Define the 'path' object type, which Tcl uses to represent * file paths internally. */ -Tcl_ObjType tclFsPathType = { +static Tcl_ObjType tclFsPathType = { "path", /* name */ FreeFsPathInternalRep, /* freeIntRepProc */ DupFsPathInternalRep, /* dupIntRepProc */ diff --git a/generic/tclInt.h b/generic/tclInt.h index 014ba06..64a6bbe 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.118.2.20 2005/11/18 23:07:27 msofer Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.118.2.21 2005/11/27 02:34:41 das Exp $ */ #ifndef _TCLINT @@ -53,8 +53,8 @@ /* * Ensure WORDS_BIGENDIAN is defined correcly: - * Needs to happen here in addition to configure to work with - * fat compiles on Darwin (i.e. ppc and i386 at the same time). + * Needs to happen here in addition to configure to work with fat compiles on + * Darwin (where configure runs only once for multiple architectures). */ #ifdef HAVE_SYS_TYPES_H diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c index 3722278..276ea55 100644 --- a/generic/tclRegexp.c +++ b/generic/tclRegexp.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclRegexp.c,v 1.14 2002/01/17 03:03:12 dgp Exp $ + * RCS: @(#) $Id: tclRegexp.c,v 1.14.4.1 2005/11/27 02:34:41 das Exp $ */ #include "tclInt.h" @@ -105,7 +105,7 @@ static int SetRegexpFromAny _ANSI_ARGS_((Tcl_Interp *interp, * of the compiled form of the regular expression. */ -Tcl_ObjType tclRegexpType = { +static Tcl_ObjType tclRegexpType = { "regexp", /* name */ FreeRegexpInternalRep, /* freeIntRepProc */ DupRegexpInternalRep, /* dupIntRepProc */ diff --git a/generic/tclVar.c b/generic/tclVar.c index 5945bfb..c926e4e 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclVar.c,v 1.69.2.10 2005/11/04 01:15:20 msofer Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.69.2.11 2005/11/27 02:34:41 das Exp $ */ #include "tclInt.h" @@ -111,17 +111,17 @@ static Tcl_UpdateStringProc UpdateParsedVarName; * it is a scalar variable */ -Tcl_ObjType tclLocalVarNameType = { +static Tcl_ObjType tclLocalVarNameType = { "localVarName", FreeLocalVarName, DupLocalVarName, UpdateLocalVarName, NULL }; -Tcl_ObjType tclNsVarNameType = { +static Tcl_ObjType tclNsVarNameType = { "namespaceVarName", FreeNsVarName, DupNsVarName, NULL, NULL }; -Tcl_ObjType tclParsedVarNameType = { +static Tcl_ObjType tclParsedVarNameType = { "parsedVarName", FreeParsedVarName, DupParsedVarName, UpdateParsedVarName, NULL }; diff --git a/macosx/Makefile b/macosx/Makefile index 105ac08..39779db 100644 --- a/macosx/Makefile +++ b/macosx/Makefile @@ -4,7 +4,7 @@ # uses the standard unix build system in tcl/unix (which can be used directly instead of this # if you are not using the tk/macosx projects). # -# RCS: @(#) $Id: Makefile,v 1.5.2.13 2005/06/03 08:53:12 das Exp $ +# RCS: @(#) $Id: Makefile,v 1.5.2.14 2005/11/27 02:34:41 das Exp $ # ######################################################################################################## @@ -89,7 +89,7 @@ UNIX_DIR := ${CURDIR}/../unix VERSION := $(shell awk -F= '/^TCL_VERSION/ {print $$2; nextfile}' ${UNIX_DIR}/configure.in) TCLSH := tclsh${VERSION} -BUILD_TARGET := tclsh tcltest +BUILD_TARGET := all tcltest INSTALL_TARGET := install export CPPROG := cp -p @@ -108,7 +108,7 @@ endif MAKE_VARS := INSTALL_ROOT INSTALL_TARGETS VERSION GENERIC_FLAGS MAKE_ARGS_V = $(foreach v,${MAKE_VARS},$v='${$v}') -build-${PROJECT}: target = ${TARGET} +build-${PROJECT}: target = ${BUILD_TARGET} install-${PROJECT}: target = ${INSTALL_TARGET} clean-${PROJECT} distclean-${PROJECT} test-${PROJECT}: \ target = $* @@ -121,11 +121,13 @@ DO_MAKE = +${MAKE} -C ${OBJ_DIR} ${target} ${MAKE_ARGS_V} ${MAKE_ARGS} ${EXTRA ${PROJECT}: ${MAKE} install-${PROJECT} INSTALL_ROOT=${OBJ_DIR}/ -${OBJ_DIR}/Makefile: ${UNIX_DIR}/Makefile.in ${UNIX_DIR}/configure - mkdir -p ${OBJ_DIR} && cd ${OBJ_DIR} && ${UNIX_DIR}/configure \ +${OBJ_DIR}/Makefile: ${UNIX_DIR}/Makefile.in ${UNIX_DIR}/configure \ + ${UNIX_DIR}/tclConfig.sh.in Tcl-Info.plist.in + mkdir -p ${OBJ_DIR} && cd ${OBJ_DIR} && \ + if [ ${UNIX_DIR}/configure -nt config.status ]; then ${UNIX_DIR}/configure \ --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} \ --mandir=${MANDIR} --enable-threads --enable-framework \ - ${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} + ${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS}; else ./config.status; fi build-${PROJECT}: ${OBJ_DIR}/Makefile ${DO_MAKE} diff --git a/macosx/README b/macosx/README index 7c0d4ee..46469cb 100644 --- a/macosx/README +++ b/macosx/README @@ -1,107 +1,123 @@ -Tcl MacOSX README +Tcl Mac OS X README ----------------- -RCS: @(#) $Id: README,v 1.1.2.3 2005/05/24 04:20:08 das Exp $ +RCS: @(#) $Id: README,v 1.1.2.4 2005/11/27 02:34:41 das Exp $ -This is the README file for the Mac OS X native version of Tcl (framework build). +This is the README file for the Mac OS X/Darwin version of Tcl. -1. General ----------- +1. Where to go for support +-------------------------- -- The tcl-mac mailing list on sourceforge is the canonical place for questions +- The tcl-mac mailing list on sourceforge is the best place to ask questions specific to Tcl & Tk on Mac OS X: http://lists.sourceforge.net/lists/listinfo/tcl-mac (this page also has a link to searchable archives of the list, please check them before asking on the list, many questions have already been answered). -- For general tcl/tk questions, the newsgroup comp.lang.tcl is your best bet, -but also check the Tcl'ers Wiki for a wealth of information: - http://wiki.tcl.tk/ +- For general Tcl/Tk questions, the newsgroup comp.lang.tcl is your best bet: + http://groups.google.com/group/comp.lang.tcl/ -- The wiki has a page listing known bugs in Mac OS X Tcl/Tk (and other tips) - http://wiki.tcl.tk/MacOS%20X -as well as a page with info on building Tcl/Tk on Mac OS X - http://wiki.tcl.tk/Steps%20to%20build%20Tcl/Tk%208.4.0%20on%20MacOS%20X +- The Tcl'ers Wiki also has many pages dealing with Tcl & Tk on Mac OS X, see + http://wiki.tcl.tk/references/3753! + http://wiki.tcl.tk/references/8361! -- You should report bugs to the sourceforge bug trackers as usual: - Tcl: https://sourceforge.net/tracker/?func=add&group_id=10894&atid=110894 - Tk: https://sourceforge.net/tracker/?func=add&group_id=12997&atid=112997 -please make sure that your report Tk specific bugs to the tktoolkit bug -tracker and not the tcl one. +- Please report bugs with Tcl or Tk on Mac OS X to the sourceforge bug trackers: + Tcl: http://sf.net/tracker/?func=add&group_id=10894&atid=110894 + Tk: http://sf.net/tracker/?func=add&group_id=12997&atid=112997 +please make sure that your report Tk specific bugs to the tktoolkit project bug +tracker rather than the tcl project bug tracker. +Mac OS X specific bugs should usually be assigned to 'das' or 'wolfsuit'. -2. Using Tcl on MacOSX ----------------------- +2. Using Tcl on Mac OS X +------------------------ -- Mac OS X 10.2 (or higher) is required to run Tcl on MacOSX. +- At a minimum, Mac OS X 10.1 is required to run Tcl, but OS X 10.3 or higher is +recommended (certain [file] operations behave incorrectly on earlier releases). -- Tcl built on Mac OS X 10.3 or higher will not run on 10.2 due to missing -symbols in libSystem, however Tcl built on 10.2 will run on 10.3 (but without -prebinding and other optimizations). +- Tcl built on Mac OS X 10.x will not run on 10.y for y < x, on the other hand +Tcl built on 10.y will run on 10.x for y < x (but without any of the fixes and +optimizations that would be available in a binary built on 10.x). -- Tcl extensions will be found in any of: +- Tcl extensions can be installed in any of: $HOME/Library/Tcl /Library/Tcl /Network/Library/Tcl /System/Library/Tcl $HOME/Library/Frameworks /Library/Frameworks /Network/Library/Frameworks /System/Library/Frameworks (searched in that order). Given a potential package directory $pkg, Tcl on OSX checks for the file $pkg/Resources/Scripts/pkgIndex.tcl as well as the usual $pkg/pkgIndex.tcl. -This allows building extensions as frameworks with all script files contained -in the Resources/Scripts directory of the framework. +This allows building extensions as frameworks with all script files contained in +the Resources/Scripts directory of the framework. -- The Tcl framework contains documentation in html format in the -standard location for frameworks: +- [load]able binary extensions can linked as either ordinary shared libraries +(.dylib) or as MachO bundles (since 8.4.10/8.5a3); only bundles can be unloaded, +and bundles are also loaded more efficiently from VFS (no temporary copy to the +native filesystem required). + +- The 'deploy' target of macosx/Makefile installs the html manpages into the +standard documentation location in the Tcl framework: Tcl.framework/Resources/Documentation/Reference/Tcl -No manpages are installed by default. +No nroff manpages are installed by default by the Makefile. -- the framework Tcl.framework can be placed in any of the system's standard +- The Tcl framework can be installed in any of the system's standard framework directories: $HOME/Library/Frameworks /Library/Frameworks /Network/Library/Frameworks /System/Library/Frameworks -and /usr/bin/tclsh will work. - -- the format of binary extensions expected by [load] is that of ordinary shared -libraries (.dylib) and not MachO bundles, at present loading of MachO bundles is -not supported. -3. Building Tcl.framework -------------------------- +3. Building Tcl on Mac OS X +--------------------------- -- Mac OS X 10.2 (or higher) is required to build Tcl on MacOSX. - -- Apple's Developer Tools CD needs to be installed (the most recent version -matching your OS release, but no earlier than December 2002). This CD should -have come with Mac OS X retail or should be present as a disk image on new macs -that came with OSX preinstalled. It can also be downloaded from +- At least Mac OS X 10.1 is required to build Tcl, and Apple's Developer Tools +need to be installed (only the most recent version matching your OS release is +supported). The Developer Tools installer is available on Mac OS X retail disks +or is present in /Applications/Installers on Macs that came with OS X +preinstalled. The most recent version can be downloaded from the ADC website http://connect.apple.com (after you register for free ADC membership). -- Tcl is built as a Mac OS X framework via the Makefile in tcl/macosx, but can -but can also be built directly with the standard unix configure and make -buildsystem in tcl/unix. - -- It is still possible to build with Apple's Xcode IDE using the Tcl.pbproj -project but this is not recommended anymore (currently Tcl.pbproj calls through -to the tcl/macosx/Makefile so there should be no build differences). +- Tcl is most easily built as a Mac OS X framework via Makefile in tcl/macosx +(see below for details), but can also be built with the standard unix configure +and make buildsystem in tcl/unix as on any other unix platform (indeed, the +Makefile is just a wrapper around the unix buildsystem). +The Mac OS X specifc configure flags are --enable-framework and +--disable-corefoundation (which disables CF and notably reverts to the standard +select based notifier, you will only need this if your require use of naked fork +(i.e. not followed by execve) in an unthreaded core). + +- It is also possible to build with Apple's IDE via the tcl/macosx/Tcl.pbproj +project, this simply calls through to the tcl/macosx/GNUMakefile. + +- To build universal binaires, set CFLAGS as follows: + export CFLAGS="-arch ppc -arch ppc64 -arch i386 \ + -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" +This requires Mac OS X 10.4 and Xcode 2.2 (_not_ Xcode 2.1) and will work on any +of the architectures (on i386 DTKs, the -isysroot is not required). Note that it +is not possible to configure correctly if the current architecture is not +present in CFLAGS (i.e. -arch `arch` must always be there). Universal builds of +Tcl TEA extensions are also possible with CFLAGS set as above, they will be +[load]able by universal as well as thin binaries of Tcl. + +Detailed Instructions for building with macosx/Makefile +------------------------------------------------------- - Unpack the tcl source release archive. -- The following instructions assume the tcl source tree is named "tcl${ver}", -where ${ver} is a shell variable containing the tcl version number (for -example '8.4.2'). +- The following instructions assume the tcl source tree is named "tcl${ver}", +where ${ver} is a shell variable containing the tcl version number (for example +'8.4.12'). Setup the shell variable as follows: - set ver="8.4.2" ;: if your shell is csh - ver="8.4.2" ;: if your shell is sh + set ver="8.4.12" ;: if your shell is csh + ver="8.4.12" ;: if your shell is sh The source tree will be named this way only if you are building from a release archive, if you are building from CVS, the version numbers will be missing; so set ${ver} to the empty string instead: - set ver="" ;: if your shell is csh - ver="" ;: if your shell is sh + set ver="" ;: if your shell is csh + ver="" ;: if your shell is sh -- The following steps will build Tcl from the Terminal, assuming you are -located in the directory containing the tcl source tree: +- The following steps will build Tcl from the Terminal, assuming you are located +in the directory containing the tcl source tree: make -C tcl${ver}/macosx -and the following will then install Tcl onto the root volume (admin password +and the following will then install Tcl onto the root volume (admin password required): sudo make -C tcl${ver}/macosx install if you don't have the admin password, you can install into your home directory, @@ -109,8 +125,8 @@ instead by passing an INSTALL_ROOT argument to make: make -C tcl${ver}/macosx install INSTALL_ROOT="${HOME}/" - The default Makefile targets will build _both_ debug and optimized versions of -the Tcl framework with the standard convention of naming the debug -library Tcl.framework/Tcl_debug. +the Tcl framework with the standard convention of naming the debug library +Tcl.framework/Tcl_debug. This allows you to dynamically link to the debug libraries at runtime by setting setenv DYLD_IMAGE_SUFFIX _debug (c.f. man dyld for more details) diff --git a/macosx/Tcl.pbproj/default.pbxuser b/macosx/Tcl.pbproj/default.pbxuser new file mode 100644 index 0000000..22035d0 --- /dev/null +++ b/macosx/Tcl.pbproj/default.pbxuser @@ -0,0 +1,173 @@ +// !$*UTF8*$! +{ + 00E2F845016E82EB0ACA28DC = { + activeBuildStyle = 00E2F847016E82EB0ACA28DC; + activeExecutable = F594E5F1030774B1016F146B; + activeTarget = 00E2F84C016E8B780ACA28DC; + addToTargets = ( + ); + codeSenseManager = F9D167E40610239A0027C147; + executables = ( + F53ACC52031D9AFE016F146B, + F594E5F1030774B1016F146B, + ); + sourceControlManager = F9D167E30610239A0027C147; + userBuildSettings = { + SYMROOT = "${SRCROOT}/../../build/tcl"; + }; + }; + 00E2F84C016E8B780ACA28DC = { + activeExec = 0; + }; + F53ACC52031D9AFE016F146B = { + activeArgIndex = 2147483647; + activeArgIndices = ( + NO, + NO, + ); + argumentStrings = ( + "${SRCROOT}/../../tcl/tests/all.tcl", + "-verbose \"\"", + ); + configStateDict = { + "PBXLSLaunchAction-0" = { + PBXLSLaunchAction = 0; + PBXLSLaunchStartAction = 1; + PBXLSLaunchStdioStyle = 2; + PBXLSLaunchStyle = 0; + class = PBXLSRunLaunchConfig; + displayName = "Executable Runner"; + identifier = com.apple.Xcode.launch.runConfig; + remoteHostInfo = ""; + startActionInfo = ""; + }; + "PBXLSLaunchAction-1" = { + PBXLSLaunchAction = 1; + PBXLSLaunchStartAction = 1; + PBXLSLaunchStdioStyle = 2; + PBXLSLaunchStyle = 0; + class = PBXGDB_LaunchConfig; + displayName = GDB; + identifier = com.apple.Xcode.launch.GDBMI_Config; + remoteHostInfo = ""; + startActionInfo = ""; + }; + }; + cppStopOnCatchEnabled = 0; + cppStopOnThrowEnabled = 0; + customDataFormattersEnabled = 1; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + dylibVariantSuffix = _debug; + enableDebugStr = 0; + environmentEntries = ( + { + active = YES; + name = TCL_LIBRARY; + value = "${SRCROOT}/../../tcl/library"; + }, + { + active = NO; + name = DYLD_PRINT_LIBRARIES; + }, + ); + isa = PBXExecutable; + launchableReference = F5C37CF303D5BEDF016F146B; + libgmallocEnabled = 0; + name = tcltest; + shlibInfoDictList = ( + ); + sourceDirectories = ( + ); + startupPath = "<>"; + }; + F594E5F1030774B1016F146B = { + activeArgIndex = 2147483647; + activeArgIndices = ( + ); + argumentStrings = ( + ); + configStateDict = { + "PBXLSLaunchAction-0" = { + PBXLSLaunchAction = 0; + PBXLSLaunchStartAction = 1; + PBXLSLaunchStdioStyle = 2; + PBXLSLaunchStyle = 0; + class = PBXLSRunLaunchConfig; + displayName = "Executable Runner"; + identifier = com.apple.Xcode.launch.runConfig; + remoteHostInfo = ""; + startActionInfo = ""; + }; + "PBXLSLaunchAction-1" = { + PBXLSLaunchAction = 1; + PBXLSLaunchStartAction = 1; + PBXLSLaunchStdioStyle = 2; + PBXLSLaunchStyle = 0; + class = PBXGDB_LaunchConfig; + displayName = GDB; + identifier = com.apple.Xcode.launch.GDBMI_Config; + remoteHostInfo = ""; + startActionInfo = ""; + }; + }; + cppStopOnCatchEnabled = 0; + cppStopOnThrowEnabled = 0; + customDataFormattersEnabled = 1; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + dylibVariantSuffix = _debug; + enableDebugStr = 0; + environmentEntries = ( + { + active = NO; + name = DYLD_PRINT_LIBRARIES; + }, + ); + isa = PBXExecutable; + launchableReference = F98F02E608E7EF9A00D0320A; + libgmallocEnabled = 0; + name = tclsh; + shlibInfoDictList = ( + ); + sourceDirectories = ( + ); + startupPath = "<>"; + }; + F5C37CF303D5BEDF016F146B = { + isa = PBXFileReference; + lastKnownFileType = "compiled.mach-o.executable"; + path = tcltest; + refType = 3; + sourceTree = BUILT_PRODUCTS_DIR; + }; + F98F02E608E7EF9A00D0320A = { + isa = PBXFileReference; + lastKnownFileType = "compiled.mach-o.executable"; + path = tclsh8.4; + refType = 3; + sourceTree = BUILT_PRODUCTS_DIR; + }; + F9D167E30610239A0027C147 = { + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + isa = PBXSourceControlManager; + scmConfiguration = { + }; + scmType = scm.cvs; + }; + F9D167E40610239A0027C147 = { + indexTemplatePath = ""; + isa = PBXCodeSenseManager; + usesDefaults = 1; + wantsCodeCompletion = 1; + wantsCodeCompletionAutoSuggestions = 1; + wantsCodeCompletionCaseSensitivity = 1; + wantsCodeCompletionListAlways = 1; + wantsCodeCompletionOnlyMatchingItems = 1; + wantsCodeCompletionParametersIncluded = 1; + wantsCodeCompletionPlaceholdersInserted = 1; + wantsCodeCompletionTabCompletes = 1; + wantsIndex = 1; + }; +} diff --git a/macosx/Tcl.pbproj/jingham.pbxuser b/macosx/Tcl.pbproj/jingham.pbxuser index 10f0b57..22035d0 100644 --- a/macosx/Tcl.pbproj/jingham.pbxuser +++ b/macosx/Tcl.pbproj/jingham.pbxuser @@ -2,78 +2,172 @@ { 00E2F845016E82EB0ACA28DC = { activeBuildStyle = 00E2F847016E82EB0ACA28DC; - activeExecutable = F9A61CCE04C2B5A8006F5A0B; + activeExecutable = F594E5F1030774B1016F146B; activeTarget = 00E2F84C016E8B780ACA28DC; - breakpoints = ( + addToTargets = ( ); + codeSenseManager = F9D167E40610239A0027C147; executables = ( - F9A61CCE04C2B5A8006F5A0B, - F973FC3204852E75006F146B, + F53ACC52031D9AFE016F146B, + F594E5F1030774B1016F146B, ); - perUserDictionary = { - PBXPerProjectTemplateStateSaveDate = 79872121; - }; - projectwideBuildSettings = { + sourceControlManager = F9D167E30610239A0027C147; + userBuildSettings = { SYMROOT = "${SRCROOT}/../../build/tcl"; }; - wantsIndex = 1; - wantsSCM = -1; }; 00E2F84C016E8B780ACA28DC = { activeExec = 0; }; - F973FC3204852E75006F146B = { + F53ACC52031D9AFE016F146B = { activeArgIndex = 2147483647; activeArgIndices = ( + NO, + NO, ); argumentStrings = ( + "${SRCROOT}/../../tcl/tests/all.tcl", + "-verbose \"\"", ); configStateDict = { + "PBXLSLaunchAction-0" = { + PBXLSLaunchAction = 0; + PBXLSLaunchStartAction = 1; + PBXLSLaunchStdioStyle = 2; + PBXLSLaunchStyle = 0; + class = PBXLSRunLaunchConfig; + displayName = "Executable Runner"; + identifier = com.apple.Xcode.launch.runConfig; + remoteHostInfo = ""; + startActionInfo = ""; + }; + "PBXLSLaunchAction-1" = { + PBXLSLaunchAction = 1; + PBXLSLaunchStartAction = 1; + PBXLSLaunchStdioStyle = 2; + PBXLSLaunchStyle = 0; + class = PBXGDB_LaunchConfig; + displayName = GDB; + identifier = com.apple.Xcode.launch.GDBMI_Config; + remoteHostInfo = ""; + startActionInfo = ""; + }; }; + cppStopOnCatchEnabled = 0; + cppStopOnThrowEnabled = 0; + customDataFormattersEnabled = 1; debuggerPlugin = GDBDebugging; - dylibVariantSuffix = ""; - enableDebugStr = 1; + disassemblyDisplayState = 0; + dylibVariantSuffix = _debug; + enableDebugStr = 0; environmentEntries = ( + { + active = YES; + name = TCL_LIBRARY; + value = "${SRCROOT}/../../tcl/library"; + }, + { + active = NO; + name = DYLD_PRINT_LIBRARIES; + }, ); isa = PBXExecutable; - launchableReference = F9A61CCD04C2B5A5006F5A0B; - name = tclsh8.4; + launchableReference = F5C37CF303D5BEDF016F146B; + libgmallocEnabled = 0; + name = tcltest; shlibInfoDictList = ( ); sourceDirectories = ( ); + startupPath = "<>"; }; - F9A61CCD04C2B5A5006F5A0B = { - isa = PBXFileReference; - name = tclsh8.4; - path = ../../build/tcl/tclsh8.4; - refType = 4; - }; - F9A61CCE04C2B5A8006F5A0B = { + F594E5F1030774B1016F146B = { activeArgIndex = 2147483647; activeArgIndices = ( ); argumentStrings = ( ); configStateDict = { + "PBXLSLaunchAction-0" = { + PBXLSLaunchAction = 0; + PBXLSLaunchStartAction = 1; + PBXLSLaunchStdioStyle = 2; + PBXLSLaunchStyle = 0; + class = PBXLSRunLaunchConfig; + displayName = "Executable Runner"; + identifier = com.apple.Xcode.launch.runConfig; + remoteHostInfo = ""; + startActionInfo = ""; + }; + "PBXLSLaunchAction-1" = { + PBXLSLaunchAction = 1; + PBXLSLaunchStartAction = 1; + PBXLSLaunchStdioStyle = 2; + PBXLSLaunchStyle = 0; + class = PBXGDB_LaunchConfig; + displayName = GDB; + identifier = com.apple.Xcode.launch.GDBMI_Config; + remoteHostInfo = ""; + startActionInfo = ""; + }; }; + cppStopOnCatchEnabled = 0; + cppStopOnThrowEnabled = 0; + customDataFormattersEnabled = 1; debuggerPlugin = GDBDebugging; - dylibVariantSuffix = ""; - enableDebugStr = 1; + disassemblyDisplayState = 0; + dylibVariantSuffix = _debug; + enableDebugStr = 0; environmentEntries = ( + { + active = NO; + name = DYLD_PRINT_LIBRARIES; + }, ); isa = PBXExecutable; - launchableReference = F9A61CD104C2B5B4006F5A0B; - name = tcltest; + launchableReference = F98F02E608E7EF9A00D0320A; + libgmallocEnabled = 0; + name = tclsh; shlibInfoDictList = ( ); sourceDirectories = ( ); + startupPath = "<>"; }; - F9A61CD104C2B5B4006F5A0B = { + F5C37CF303D5BEDF016F146B = { isa = PBXFileReference; - name = tcltest; - path = ../../build/tcl/tcltest; - refType = 4; + lastKnownFileType = "compiled.mach-o.executable"; + path = tcltest; + refType = 3; + sourceTree = BUILT_PRODUCTS_DIR; + }; + F98F02E608E7EF9A00D0320A = { + isa = PBXFileReference; + lastKnownFileType = "compiled.mach-o.executable"; + path = tclsh8.4; + refType = 3; + sourceTree = BUILT_PRODUCTS_DIR; + }; + F9D167E30610239A0027C147 = { + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + isa = PBXSourceControlManager; + scmConfiguration = { + }; + scmType = scm.cvs; + }; + F9D167E40610239A0027C147 = { + indexTemplatePath = ""; + isa = PBXCodeSenseManager; + usesDefaults = 1; + wantsCodeCompletion = 1; + wantsCodeCompletionAutoSuggestions = 1; + wantsCodeCompletionCaseSensitivity = 1; + wantsCodeCompletionListAlways = 1; + wantsCodeCompletionOnlyMatchingItems = 1; + wantsCodeCompletionParametersIncluded = 1; + wantsCodeCompletionPlaceholdersInserted = 1; + wantsCodeCompletionTabCompletes = 1; + wantsIndex = 1; }; } diff --git a/macosx/Tcl.pbproj/project.pbxproj b/macosx/Tcl.pbproj/project.pbxproj index 4d2b2ca..7949108 100644 --- a/macosx/Tcl.pbproj/project.pbxproj +++ b/macosx/Tcl.pbproj/project.pbxproj @@ -3,9 +3,11 @@ archiveVersion = 1; classes = { }; - objectVersion = 38; + objectVersion = 39; objects = { 00E2F845016E82EB0ACA28DC = { + buildSettings = { + }; buildStyles = ( 00E2F847016E82EB0ACA28DC, 00E2F848016E82EB0ACA28DC, @@ -32,10 +34,9 @@ ); isa = PBXGroup; refType = 4; + sourceTree = ""; }; 00E2F847016E82EB0ACA28DC = { - buildRules = ( - ); buildSettings = { MAKE_TARGET = develop; }; @@ -43,8 +44,6 @@ name = Development; }; 00E2F848016E82EB0ACA28DC = { - buildRules = ( - ); buildSettings = { MAKE_TARGET = deploy; }; @@ -53,38 +52,36 @@ }; 00E2F84A016E8A830ACA28DC = { children = ( - F9A61C9D04C2B4E3006F5A0B, - F53ACC5C031D9D11016F146B, F53ACC73031DA405016F146B, + F53ACC5C031D9D11016F146B, + F9A61C9D04C2B4E3006F5A0B, ); isa = PBXGroup; name = Products; refType = 4; + sourceTree = ""; }; 00E2F84C016E8B780ACA28DC = { - buildArgumentsString = "-c \"if [ \\\"${ACTION}\\\" != \\\"clean\\\" ]; then if [ \\\"${ACTION}\\\" = \\\"install\\\" ]; then MAKE_ACTION=\"install-\"; fi; else MAKE_ACTION=\"distclean-\"; fi; gnumake \\${MAKE_ACTION:-}${MAKE_TARGET}"; + buildArgumentsString = "-c \"cd \\\"${TCL_SRCROOT}/macosx\\\" && ACTION=${ACTION} && gnumake \\${ACTION:+\\${ACTION/clean/distclean}-}${MAKE_TARGET} INSTALL_ROOT=\\\"${DSTROOT}\\\" INSTALL_PATH=\\\"${INSTALL_PATH}\\\" PREFIX=\\\"${PREFIX}\\\" BINDIR=\\\"${BINDIR}\\\" MANDIR=\\\"${MANDIR}\\\" \\${EXTRA_MAKE_FLAGS} ${ALL_SETTINGS}\""; buildPhases = ( ); buildSettings = { - EXTRA_CONFIGURE_ARGS = ""; - EXTRA_MAKE_ARGS = ""; + BINDIR = "${PREFIX}/bin"; INSTALL_PATH = /Library/Frameworks; - INSTALL_ROOT = "${DSTROOT}"; - PREFIX = /usr; + MANDIR = "${PREFIX}/man"; + PREFIX = /usr/local; PRODUCT_NAME = Tcl; - SYMROOT = "${SRCROOT}/../../build/tcl"; + TCL_SRCROOT = "${SRCROOT}/../../tcl"; + TEMP_DIR = "${PROJECT_TEMP_DIR}"; }; - buildToolPath = /bin/sh; + buildToolPath = /bin/bash; buildWorkingDirectory = "${SRCROOT}"; dependencies = ( ); isa = PBXLegacyTarget; name = Tcl; - passBuildSettingsInEnvironment = 1; + passBuildSettingsInEnvironment = 0; productName = Tcl; - settingsToExpand = 6; - settingsToPassInEnvironment = 287; - settingsToPassOnCommandLine = 280; }; 00E2F854016E922C0ACA28DC = { children = ( @@ -168,6 +165,7 @@ name = Sources; path = ""; refType = 4; + sourceTree = ""; }; 00E2F855016E922C0ACA28DC = { children = ( @@ -177,6 +175,7 @@ isa = PBXGroup; name = generic; refType = 4; + sourceTree = ""; }; 00E2F856016E92B00ACA28DC = { children = ( @@ -200,6 +199,7 @@ isa = PBXGroup; name = Headers; refType = 4; + sourceTree = ""; }; 00E2F857016E92B00ACA28DC = { children = ( @@ -209,6 +209,7 @@ isa = PBXGroup; name = macosx; refType = 4; + sourceTree = ""; }; 00E2F858016E92B00ACA28DC = { children = ( @@ -216,6 +217,7 @@ isa = PBXGroup; name = Headers; refType = 4; + sourceTree = ""; }; 00E2F859016E92B00ACA28DC = { children = ( @@ -224,6 +226,7 @@ isa = PBXGroup; name = Sources; refType = 4; + sourceTree = ""; }; 00E2F85A016E92B00ACA28DC = { children = ( @@ -233,6 +236,7 @@ isa = PBXGroup; name = unix; refType = 4; + sourceTree = ""; }; 00E2F85B016E92B00ACA28DC = { children = ( @@ -242,6 +246,7 @@ isa = PBXGroup; name = Headers; refType = 4; + sourceTree = ""; }; 00E2F85C016E92B00ACA28DC = { children = ( @@ -264,6 +269,7 @@ isa = PBXGroup; name = Sources; refType = 4; + sourceTree = ""; }; //000 //001 @@ -284,51 +290,64 @@ isa = PBXGroup; name = "Build System"; refType = 4; + sourceTree = ""; }; F5306CA003CAC9AE016F146B = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = text; name = ChangeLog; path = ../ChangeLog; refType = 2; + sourceTree = SOURCE_ROOT; }; F5306CA103CAC9DE016F146B = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = text.script.sh; name = configure.in; path = ../unix/configure.in; refType = 2; + sourceTree = SOURCE_ROOT; }; F5306CA203CAC9DE016F146B = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = text; name = Makefile.in; path = ../unix/Makefile.in; refType = 2; + sourceTree = SOURCE_ROOT; }; F5306CA303CAC9DE016F146B = { isa = PBXFileReference; + lastKnownFileType = text; name = tcl.m4; path = ../unix/tcl.m4; refType = 2; + sourceTree = SOURCE_ROOT; }; F53ACC5C031D9D11016F146B = { - isa = PBXExecutableFileReference; - name = tclsh8.4; - path = ../../build/tcl/tclsh8.4; - refType = 2; + isa = PBXFileReference; + lastKnownFileType = "compiled.mach-o.executable"; + path = tclsh8.4; + refType = 3; + sourceTree = BUILT_PRODUCTS_DIR; }; F53ACC73031DA405016F146B = { - isa = PBXExecutableFileReference; - name = tcltest; - path = ../../build/tcl/tcltest; - refType = 2; + isa = PBXFileReference; + lastKnownFileType = "compiled.mach-o.executable"; + path = tcltest; + refType = 3; + sourceTree = BUILT_PRODUCTS_DIR; }; F5A1836F018242A501DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; path = tclMacOSXBundle.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5C88655017D604601DC9062 = { children = ( @@ -339,780 +358,1003 @@ isa = PBXGroup; name = "Header Tools"; refType = 4; + sourceTree = ""; }; F5C88656017D604601DC9062 = { isa = PBXFileReference; + lastKnownFileType = text; name = genStubs.tcl; path = ../tools/genStubs.tcl; refType = 2; + sourceTree = SOURCE_ROOT; }; F5C88657017D60C901DC9062 = { isa = PBXFileReference; + lastKnownFileType = text; name = tcl.decls; path = ../generic/tcl.decls; refType = 2; + sourceTree = SOURCE_ROOT; }; F5C88658017D60C901DC9062 = { isa = PBXFileReference; + lastKnownFileType = text; name = tclInt.decls; path = ../generic/tclInt.decls; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F6B016ECAA401DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = regcustom.h; path = ../generic/regcustom.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F6C016ECAA401DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = regerrs.h; path = ../generic/regerrs.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F6D016ECAA401DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = regguts.h; path = ../generic/regguts.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F6E016ECAA401DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = tcl.h; path = ../generic/tcl.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F6F016ECAA401DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = tclCompile.h; path = ../generic/tclCompile.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F70016ECAA401DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = tclDecls.h; path = ../generic/tclDecls.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F71016ECAA401DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = tclInitScript.h; path = ../generic/tclInitScript.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F72016ECAA401DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = tclInt.h; path = ../generic/tclInt.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F73016ECAA401DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = tclIntDecls.h; path = ../generic/tclIntDecls.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F74016ECAA401DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = tclIntPlatDecls.h; path = ../generic/tclIntPlatDecls.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F75016ECAA401DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = tclIO.h; path = ../generic/tclIO.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F76016ECAA401DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = tclMath.h; path = ../generic/tclMath.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F77016ECAA401DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = tclPlatDecls.h; path = ../generic/tclPlatDecls.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F78016ECAA401DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = tclRegexp.h; path = ../generic/tclRegexp.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F87016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = regc_color.c; path = ../generic/regc_color.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F88016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = regc_cvec.c; path = ../generic/regc_cvec.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F89016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = regc_lex.c; path = ../generic/regc_lex.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F8A016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = regc_locale.c; path = ../generic/regc_locale.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F8B016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = regc_nfa.c; path = ../generic/regc_nfa.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F8C016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = regcomp.c; path = ../generic/regcomp.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F8D016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = rege_dfa.c; path = ../generic/rege_dfa.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F8E016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = regerror.c; path = ../generic/regerror.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F8F016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = regexec.c; path = ../generic/regexec.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F90016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = regfree.c; path = ../generic/regfree.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F91016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = regfronts.c; path = ../generic/regfronts.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F92016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclAlloc.c; path = ../generic/tclAlloc.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F93016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclAsync.c; path = ../generic/tclAsync.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F94016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclBasic.c; path = ../generic/tclBasic.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F95016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclBinary.c; path = ../generic/tclBinary.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F96016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclCkalloc.c; path = ../generic/tclCkalloc.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F97016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclClock.c; path = ../generic/tclClock.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F98016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclCmdAH.c; path = ../generic/tclCmdAH.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F99016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclCmdIL.c; path = ../generic/tclCmdIL.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F9A016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclCmdMZ.c; path = ../generic/tclCmdMZ.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F9B016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclCompCmds.c; path = ../generic/tclCompCmds.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F9C016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclCompExpr.c; path = ../generic/tclCompExpr.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F9D016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclCompile.c; path = ../generic/tclCompile.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F9E016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclDate.c; path = ../generic/tclDate.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24F9F016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclEncoding.c; path = ../generic/tclEncoding.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FA0016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclEnv.c; path = ../generic/tclEnv.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FA1016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclEvent.c; path = ../generic/tclEvent.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FA2016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclExecute.c; path = ../generic/tclExecute.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FA3016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclFCmd.c; path = ../generic/tclFCmd.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FA4016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclFileName.c; path = ../generic/tclFileName.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FA5016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclGet.c; path = ../generic/tclGet.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FA6016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclHash.c; path = ../generic/tclHash.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FA7016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclHistory.c; path = ../generic/tclHistory.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FA8016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclIndexObj.c; path = ../generic/tclIndexObj.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FA9016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclInterp.c; path = ../generic/tclInterp.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FAA016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclIO.c; path = ../generic/tclIO.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FAB016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclIOCmd.c; path = ../generic/tclIOCmd.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FAC016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclIOGT.c; path = ../generic/tclIOGT.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FAD016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclIOSock.c; path = ../generic/tclIOSock.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FAE016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclIOUtil.c; path = ../generic/tclIOUtil.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FAF016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclLink.c; path = ../generic/tclLink.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FB0016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclListObj.c; path = ../generic/tclListObj.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FB1016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclLiteral.c; path = ../generic/tclLiteral.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FB2016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclLoad.c; path = ../generic/tclLoad.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FB3016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclLoadNone.c; path = ../generic/tclLoadNone.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FB4016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclMain.c; path = ../generic/tclMain.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FB5016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclNamesp.c; path = ../generic/tclNamesp.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FB6016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclNotify.c; path = ../generic/tclNotify.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FB7016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclObj.c; path = ../generic/tclObj.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FB8016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclPanic.c; path = ../generic/tclPanic.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FB9016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclParse.c; path = ../generic/tclParse.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FBA016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclParseExpr.c; path = ../generic/tclParseExpr.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FBB016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclPipe.c; path = ../generic/tclPipe.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FBC016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclPosixStr.c; path = ../generic/tclPosixStr.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FBD016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclPreserve.c; path = ../generic/tclPreserve.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FBE016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclProc.c; path = ../generic/tclProc.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FBF016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclRegexp.c; path = ../generic/tclRegexp.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FC0016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclResolve.c; path = ../generic/tclResolve.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FC1016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclResult.c; path = ../generic/tclResult.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FC2016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclScan.c; path = ../generic/tclScan.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FC3016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclStringObj.c; path = ../generic/tclStringObj.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FC4016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclStubInit.c; path = ../generic/tclStubInit.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FC5016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclStubLib.c; path = ../generic/tclStubLib.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FC6016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclTest.c; path = ../generic/tclTest.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FC7016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclTestObj.c; path = ../generic/tclTestObj.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FC8016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclTestProcBodyObj.c; path = ../generic/tclTestProcBodyObj.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FC9016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclThread.c; path = ../generic/tclThread.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FCA016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclThreadJoin.c; path = ../generic/tclThreadJoin.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FCB016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclThreadTest.c; path = ../generic/tclThreadTest.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FCC016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclTimer.c; path = ../generic/tclTimer.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FCD016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclUniData.c; path = ../generic/tclUniData.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FCE016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclUtf.c; path = ../generic/tclUtf.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FCF016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclUtil.c; path = ../generic/tclUtil.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FD0016ECAFC01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclVar.c; path = ../generic/tclVar.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FD1016ECB1E01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = regex.h; path = ../generic/regex.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FD2016ECB1E01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = tclPort.h; path = ../generic/tclPort.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FD3016ECB4901DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclPkg.c; path = ../generic/tclPkg.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FD6016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = tclUnixPort.h; path = ../unix/tclUnixPort.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FD7016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = tclUnixThrd.h; path = ../unix/tclUnixThrd.h; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FD8016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclAppInit.c; path = ../unix/tclAppInit.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FD9016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclLoadDyld.c; path = ../unix/tclLoadDyld.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FDB016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclUnixChan.c; path = ../unix/tclUnixChan.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FDC016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclUnixEvent.c; path = ../unix/tclUnixEvent.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FDD016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclUnixFCmd.c; path = ../unix/tclUnixFCmd.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FDE016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclUnixFile.c; path = ../unix/tclUnixFile.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FDF016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclUnixInit.c; path = ../unix/tclUnixInit.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FE0016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclUnixNotfy.c; path = ../unix/tclUnixNotfy.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FE1016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclUnixPipe.c; path = ../unix/tclUnixPipe.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FE2016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclUnixSock.c; path = ../unix/tclUnixSock.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FE3016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclUnixTest.c; path = ../unix/tclUnixTest.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FE4016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclUnixThrd.c; path = ../unix/tclUnixThrd.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FE5016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclUnixTime.c; path = ../unix/tclUnixTime.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FE6016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclXtNotify.c; path = ../unix/tclXtNotify.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FE7016ECC0F01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = tclXtTest.c; path = ../unix/tclXtTest.c; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FEE016ED0DF01DC9062 = { children = ( @@ -1137,117 +1379,152 @@ isa = PBXGroup; name = Scripts; refType = 4; + sourceTree = ""; }; F5F24FEF016ED0DF01DC9062 = { isa = PBXFileReference; + lastKnownFileType = text; name = auto.tcl; path = ../library/auto.tcl; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FF0016ED0DF01DC9062 = { includeInIndex = 0; - isa = PBXFolderReference; + isa = PBXFileReference; + lastKnownFileType = folder; name = dde; path = ../library/dde; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FF3016ED0DF01DC9062 = { includeInIndex = 0; - isa = PBXFolderReference; + isa = PBXFileReference; + lastKnownFileType = folder; name = encoding; path = ../library/encoding; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FF4016ED0DF01DC9062 = { isa = PBXFileReference; + lastKnownFileType = text; name = history.tcl; path = ../library/history.tcl; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FF5016ED0DF01DC9062 = { includeInIndex = 0; - isa = PBXFolderReference; + isa = PBXFileReference; + lastKnownFileType = folder; name = http; path = ../library/http; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FF6016ED0DF01DC9062 = { includeInIndex = 0; - isa = PBXFolderReference; + isa = PBXFileReference; + lastKnownFileType = folder; name = http1.0; path = ../library/http1.0; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FFA016ED0DF01DC9062 = { isa = PBXFileReference; + lastKnownFileType = text; name = init.tcl; path = ../library/init.tcl; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FFB016ED0DF01DC9062 = { isa = PBXFileReference; + lastKnownFileType = text; name = ldAout.tcl; path = ../library/ldAout.tcl; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FFC016ED0DF01DC9062 = { includeInIndex = 0; - isa = PBXFolderReference; + isa = PBXFileReference; + lastKnownFileType = folder; name = msgcat; path = ../library/msgcat; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F24FFE016ED0DF01DC9062 = { includeInIndex = 0; - isa = PBXFolderReference; + isa = PBXFileReference; + lastKnownFileType = folder; name = opt; path = ../library/opt; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F25001016ED0DF01DC9062 = { isa = PBXFileReference; + lastKnownFileType = text; name = package.tcl; path = ../library/package.tcl; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F25002016ED0DF01DC9062 = { isa = PBXFileReference; + lastKnownFileType = text; name = parray.tcl; path = ../library/parray.tcl; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F25003016ED0DF01DC9062 = { includeInIndex = 0; - isa = PBXFolderReference; + isa = PBXFileReference; + lastKnownFileType = folder; name = reg; path = ../library/reg; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F25005016ED0DF01DC9062 = { isa = PBXFileReference; + lastKnownFileType = text; name = safe.tcl; path = ../library/safe.tcl; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F25007016ED0DF01DC9062 = { fileEncoding = 5; isa = PBXFileReference; + lastKnownFileType = text; name = tclIndex; path = ../library/tclIndex; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F25008016ED0DF01DC9062 = { includeInIndex = 0; - isa = PBXFolderReference; + isa = PBXFileReference; + lastKnownFileType = folder; name = tcltest; path = ../library/tcltest; refType = 2; + sourceTree = SOURCE_ROOT; }; F5F2500A016ED0DF01DC9062 = { isa = PBXFileReference; + lastKnownFileType = text; name = word.tcl; path = ../library/word.tcl; refType = 2; + sourceTree = SOURCE_ROOT; }; //F50 //F51 @@ -1260,10 +1537,11 @@ //F93 //F94 F9A61C9D04C2B4E3006F5A0B = { - isa = PBXFrameworkReference; - name = Tcl.framework; - path = ../../build/tcl/Tcl.framework; - refType = 2; + explicitFileType = wrapper.framework; + isa = PBXFileReference; + path = Tcl.framework; + refType = 3; + sourceTree = BUILT_PRODUCTS_DIR; }; }; rootObject = 00E2F845016E82EB0ACA28DC; diff --git a/macosx/tclMacOSXBundle.c b/macosx/tclMacOSXBundle.c index 75b871c..28e4977 100644 --- a/macosx/tclMacOSXBundle.c +++ b/macosx/tclMacOSXBundle.c @@ -51,13 +51,13 @@ * license. */ +#include "tclPort.h" + #ifdef HAVE_COREFOUNDATION #include #include #endif /* HAVE_COREFOUNDATION */ -#include "tcl.h" - /* *---------------------------------------------------------------------- * diff --git a/macosx/tclMacOSXNotify.c b/macosx/tclMacOSXNotify.c index 898d075..cd09ccf 100644 --- a/macosx/tclMacOSXNotify.c +++ b/macosx/tclMacOSXNotify.c @@ -1,25 +1,25 @@ /* * tclMacOSXNotify.c -- * - * This file contains the implementation of a merged - * CFRunLoop/select-based notifier, which is the lowest-level part - * of the Tcl event loop. This file works together with - * generic/tclNotify.c. + * This file contains the implementation of a merged CFRunLoop/select() + * based notifier, which is the lowest-level part of the Tcl event loop. + * This file works together with generic/tclNotify.c. * * Copyright (c) 1995-1997 Sun Microsystems, Inc. * Copyright 2001, Apple Computer, Inc. - * Copyright 2005, Tcl Core Team. + * Copyright (c) 2005 Tcl Core Team. + * Copyright (c) 2005 Daniel A. Steffen * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacOSXNotify.c,v 1.1.2.4 2005/05/20 02:50:36 das Exp $ + * RCS: @(#) $Id: tclMacOSXNotify.c,v 1.1.2.5 2005/11/27 02:34:41 das Exp $ */ -#ifdef HAVE_COREFOUNDATION /* Traditional unix select-based notifier - * is in tclUnixNotfy.c */ #include "tclInt.h" #include "tclPort.h" +#ifdef HAVE_COREFOUNDATION /* Traditional unix select-based notifier is + * in tclUnixNotfy.c */ #include #include @@ -27,42 +27,41 @@ extern TclStubs tclStubs; extern Tcl_NotifierProcs tclOriginalNotifier; /* - * This structure is used to keep track of the notifier info for a - * a registered file. + * This structure is used to keep track of the notifier info for a registered + * file. */ typedef struct FileHandler { int fd; int mask; /* Mask of desired events: TCL_READABLE, * etc. */ - int readyMask; /* Mask of events that have been seen since the - * last time file handlers were invoked for - * this file. */ - Tcl_FileProc *proc; /* Procedure to call, in the style of + int readyMask; /* Mask of events that have been seen since + * the last time file handlers were invoked + * for this file. */ + Tcl_FileProc *proc; /* Function to call, in the style of * Tcl_CreateFileHandler. */ ClientData clientData; /* Argument to pass to proc. */ struct FileHandler *nextPtr;/* Next in list of all files we care about. */ } FileHandler; /* - * The following structure is what is added to the Tcl event queue when - * file handlers are ready to fire. + * The following structure is what is added to the Tcl event queue when file + * handlers are ready to fire. */ typedef struct FileHandlerEvent { - Tcl_Event header; /* Information that is standard for - * all events. */ - int fd; /* File descriptor that is ready. Used - * to find the FileHandler structure for - * the file (can't point directly to the - * FileHandler structure because it could - * go away while the event is queued). */ + Tcl_Event header; /* Information that is standard for all + * events. */ + int fd; /* File descriptor that is ready. Used to find + * the FileHandler structure for the file + * (can't point directly to the FileHandler + * structure because it could go away while + * the event is queued). */ } FileHandlerEvent; /* - * - * The following structure contains a set of select() masks to track - * readable, writable, and exceptional conditions. + * The following structure contains a set of select() masks to track readable, + * writable, and exceptional conditions. */ typedef struct SelectMasks { @@ -73,49 +72,50 @@ typedef struct SelectMasks { /* * The following static structure contains the state information for the - * select based implementation of the Tcl notifier. One of these structures - * is created for each thread that is using the notifier. + * select based implementation of the Tcl notifier. One of these structures is + * created for each thread that is using the notifier. */ typedef struct ThreadSpecificData { FileHandler *firstFileHandlerPtr; /* Pointer to head of file handler list. */ - - SelectMasks checkMasks; /* This structure is used to build up the masks - * to be used in the next call to select. - * Bits are set in response to calls to - * Tcl_CreateFileHandler. */ + SelectMasks checkMasks; /* This structure is used to build up the + * masks to be used in the next call to + * select. Bits are set in response to calls + * to Tcl_CreateFileHandler. */ SelectMasks readyMasks; /* This array reflects the readable/writable * conditions that were found to exist by the * last call to select. */ - int numFdBits; /* Number of valid bits in checkMasks - * (one more than highest fd for which + int numFdBits; /* Number of valid bits in checkMasks (one + * more than highest fd for which * Tcl_WatchFile has been called). */ int onList; /* True if it is in this list */ - unsigned int pollState; /* pollState is used to implement a polling + unsigned int pollState; /* pollState is used to implement a polling * handshake between each thread and the * notifier thread. Bits defined below. */ struct ThreadSpecificData *nextPtr, *prevPtr; - /* All threads that are currently waiting on + /* All threads that are currently waiting on * an event have their ThreadSpecificData * structure on a doubly-linked listed formed - * from these pointers. You must hold the + * from these pointers. You must hold the * notifierLock before accessing these * fields. */ CFRunLoopSourceRef runLoopSource; - /* Any other thread alerts a notifier - * that an event is ready to be processed - * by signaling this CFRunLoopSource. */ - CFRunLoopRef runLoop; /* This thread's CFRunLoop, needs to be woken - * up whenever the runLoopSource is signaled. */ - int eventReady; /* True if an event is ready to be processed. */ + /* Any other thread alerts a notifier that an + * event is ready to be processed by signaling + * this CFRunLoopSource. */ + CFRunLoopRef runLoop; /* This thread's CFRunLoop, needs to be woken + * up whenever the runLoopSource is + * signaled. */ + int eventReady; /* True if an event is ready to be + * processed. */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* - * The following static indicates the number of threads that have - * initialized notifiers. + * The following static indicates the number of threads that have initialized + * notifiers. * * You must hold the notifierInitLock before accessing this variable. */ @@ -123,9 +123,9 @@ static Tcl_ThreadDataKey dataKey; static int notifierCount = 0; /* - * The following variable points to the head of a doubly-linked list of - * of ThreadSpecificData structures for all threads that are currently - * waiting on an event. + * The following variable points to the head of a doubly-linked list of + * ThreadSpecificData structures for all threads that are currently waiting on + * an event. * * You must hold the notifierLock before accessing this list. */ @@ -133,16 +133,15 @@ static int notifierCount = 0; static ThreadSpecificData *waitingListPtr = NULL; /* - * The notifier thread spends all its time in select() waiting for a - * file descriptor associated with one of the threads on the waitingListPtr - * list to do something interesting. But if the contents of the - * waitingListPtr list ever changes, we need to wake up and restart - * the select() system call. You can wake up the notifier thread by - * writing a single byte to the file descriptor defined below. This - * file descriptor is the input-end of a pipe and the notifier thread is - * listening for data on the output-end of the same pipe. Hence writing - * to this file descriptor will cause the select() system call to return - * and wake up the notifier thread. + * The notifier thread spends all its time in select() waiting for a file + * descriptor associated with one of the threads on the waitingListPtr list to + * do something interesting. But if the contents of the waitingListPtr list + * ever changes, we need to wake up and restart the select() system call. You + * can wake up the notifier thread by writing a single byte to the file + * descriptor defined below. This file descriptor is the input-end of a pipe + * and the notifier thread is listening for data on the output-end of the same + * pipe. Hence writing to this file descriptor will cause the select() system + * call to return and wake up the notifier thread. * * You must hold the notifierLock lock before writing to the pipe. */ @@ -152,55 +151,64 @@ static int receivePipe = -1; /* Output end of triggerPipe */ /* * We use Darwin-native spinlocks instead of pthread mutexes for notifier - * locking: this radically simplifies the implementation and lowers - * overhead. Note that these are not pure spinlocks, they employ various - * strategies to back off, making them immune to most priority-inversion - * livelocks (c.f. man 3 OSSpinLockLock). + * locking: this radically simplifies the implementation and lowers overhead. + * Note that these are not pure spinlocks, they employ various strategies to + * back off, making them immune to most priority-inversion livelocks (c.f. man + * 3 OSSpinLockLock). */ #if defined(HAVE_LIBKERN_OSATOMIC_H) && defined(HAVE_OSSPINLOCKLOCK) -/* Use OSSpinLock API where available (Tiger or later) */ +/* + * Use OSSpinLock API where available (Tiger or later). + */ + #include + #else -/* Otherwise, use commpage spinlock SPI directly */ +/* + * Otherwise, use commpage spinlock SPI directly. + */ + typedef uint32_t OSSpinLock; -extern void _spin_lock(OSSpinLock *lock); -extern void _spin_unlock(OSSpinLock *lock); -#define OSSpinLockLock(p) _spin_lock(p) -#define OSSpinLockUnlock(p) _spin_unlock(p) -#endif +extern void _spin_lock(OSSpinLock *lock); +extern void _spin_unlock(OSSpinLock *lock); +#define OSSpinLockLock(p) _spin_lock(p) +#define OSSpinLockUnlock(p) _spin_unlock(p) + +#endif /* HAVE_LIBKERN_OSATOMIC_H && HAVE_OSSPINLOCKLOCK */ /* - * These spinlocks lock access to the global notifier state. + * These spinlocks lock access to the global notifier state. */ static OSSpinLock notifierInitLock = 0; static OSSpinLock notifierLock = 0; -/* +/* * Macros abstracting notifier locking/unlocking */ -#define LOCK_NOTIFIER_INIT OSSpinLockLock(¬ifierInitLock) -#define UNLOCK_NOTIFIER_INIT OSSpinLockUnlock(¬ifierInitLock) -#define LOCK_NOTIFIER OSSpinLockLock(¬ifierLock) -#define UNLOCK_NOTIFIER OSSpinLockUnlock(¬ifierLock) +#define LOCK_NOTIFIER_INIT OSSpinLockLock(¬ifierInitLock) +#define UNLOCK_NOTIFIER_INIT OSSpinLockUnlock(¬ifierInitLock) +#define LOCK_NOTIFIER OSSpinLockLock(¬ifierLock) +#define UNLOCK_NOTIFIER OSSpinLockUnlock(¬ifierLock) /* * The pollState bits * POLL_WANT is set by each thread before it waits on its condition - * variable. It is checked by the notifier before it does - * select. - * POLL_DONE is set by the notifier if it goes into select after - * seeing POLL_WANT. The idea is to ensure it tries a select - * with the same bits the initial thread had set. + * variable. It is checked by the notifier before it does select. + * POLL_DONE is set by the notifier if it goes into select after seeing + * POLL_WANT. The idea is to ensure it tries a select with the + * same bits the initial thread had set. */ + #define POLL_WANT 0x1 #define POLL_DONE 0x2 /* * This is the thread ID of the notifier thread that does select. */ + static pthread_t notifierThread; /* @@ -227,30 +235,30 @@ static int FileHandlerEventProc(Tcl_Event *evPtr, int flags); */ ClientData -Tcl_InitNotifier() +Tcl_InitNotifier(void) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); tsdPtr->eventReady = 0; - - /* + + /* * Initialize CFRunLoopSource and add it to CFRunLoop of this thread */ - + if (!tsdPtr->runLoop) { - CFRunLoopRef runLoop = CFRunLoopGetCurrent(); - CFRunLoopSourceRef runLoopSource; - CFRunLoopSourceContext runLoopSourceContext; - - bzero(&runLoopSourceContext, sizeof(CFRunLoopSourceContext)); - runLoopSourceContext.info = tsdPtr; - runLoopSource = CFRunLoopSourceCreate(NULL, 0, &runLoopSourceContext); - if (!runLoopSource) { - Tcl_Panic("Tcl_InitNotifier: could not create CFRunLoopSource."); - } - CFRunLoopAddSource(runLoop, runLoopSource, kCFRunLoopCommonModes); - tsdPtr->runLoopSource = runLoopSource; - tsdPtr->runLoop = runLoop; + CFRunLoopRef runLoop = CFRunLoopGetCurrent(); + CFRunLoopSourceRef runLoopSource; + CFRunLoopSourceContext runLoopSourceContext; + + bzero(&runLoopSourceContext, sizeof(CFRunLoopSourceContext)); + runLoopSourceContext.info = tsdPtr; + runLoopSource = CFRunLoopSourceCreate(NULL, 0, &runLoopSourceContext); + if (!runLoopSource) { + Tcl_Panic("Tcl_InitNotifier: could not create CFRunLoopSource."); + } + CFRunLoopAddSource(runLoop, runLoopSource, kCFRunLoopCommonModes); + tsdPtr->runLoopSource = runLoopSource; + tsdPtr->runLoop = runLoop; } /* @@ -259,40 +267,41 @@ Tcl_InitNotifier() LOCK_NOTIFIER_INIT; if (notifierCount == 0) { - int fds[2], status, result; - pthread_attr_t attr; - - if (pipe(fds) != 0) { - Tcl_Panic("Tcl_InitNotifier: could not create trigger pipe."); - } - - status = fcntl(fds[0], F_GETFL); - status |= O_NONBLOCK; - if (fcntl(fds[0], F_SETFL, status) < 0) { - Tcl_Panic("Tcl_InitNotifier: could not make receive pipe non blocking."); - } - status = fcntl(fds[1], F_GETFL); - status |= O_NONBLOCK; - if (fcntl(fds[1], F_SETFL, status) < 0) { - Tcl_Panic("Tcl_InitNotifier: could not make trigger pipe non blocking."); - } - - receivePipe = fds[0]; - triggerPipe = fds[1]; - - pthread_attr_init(&attr); - pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); - pthread_attr_setstacksize(&attr, 60 * 1024); - result = pthread_create(¬ifierThread, &attr, (void * (*)(void *))NotifierThreadProc, NULL); - pthread_attr_destroy(&attr); + int fds[2], status, result; + pthread_attr_t attr; + + if (pipe(fds) != 0) { + Tcl_Panic("Tcl_InitNotifier: could not create trigger pipe."); + } + + status = fcntl(fds[0], F_GETFL); + status |= O_NONBLOCK; + if (fcntl(fds[0], F_SETFL, status) < 0) { + Tcl_Panic("Tcl_InitNotifier: could not make receive pipe non blocking."); + } + status = fcntl(fds[1], F_GETFL); + status |= O_NONBLOCK; + if (fcntl(fds[1], F_SETFL, status) < 0) { + Tcl_Panic("Tcl_InitNotifier: could not make trigger pipe non blocking."); + } + + receivePipe = fds[0]; + triggerPipe = fds[1]; + + pthread_attr_init(&attr); + pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); + pthread_attr_setstacksize(&attr, 60 * 1024); + result = pthread_create(¬ifierThread, &attr, + (void * (*)(void *))NotifierThreadProc, NULL); + pthread_attr_destroy(&attr); if (result) { Tcl_Panic("Tcl_InitNotifier: unable to start notifier thread."); } } notifierCount++; UNLOCK_NOTIFIER_INIT; - + return (ClientData) tsdPtr; } @@ -301,15 +310,15 @@ Tcl_InitNotifier() * * Tcl_FinalizeNotifier -- * - * This function is called to cleanup the notifier state before - * a thread is terminated. + * This function is called to cleanup the notifier state before a thread + * is terminated. * * Results: * None. * * Side effects: - * May terminate the background notifier thread if this is the - * last notifier instance. + * May terminate the background notifier thread if this is the last + * notifier instance. * *---------------------------------------------------------------------- */ @@ -324,47 +333,52 @@ Tcl_FinalizeNotifier(clientData) notifierCount--; /* - * If this is the last thread to use the notifier, close the notifier - * pipe and wait for the background thread to terminate. + * If this is the last thread to use the notifier, close the notifier pipe + * and wait for the background thread to terminate. */ if (notifierCount == 0) { - int result; - + int result; + if (triggerPipe < 0) { Tcl_Panic("Tcl_FinalizeNotifier: notifier pipe not initialized."); } /* - * Send "q" message to the notifier thread so that it will - * terminate. The notifier will return from its call to select() - * and notice that a "q" message has arrived, it will then close - * its side of the pipe and terminate its thread. Note the we can - * not just close the pipe and check for EOF in the notifier - * thread because if a background child process was created with - * exec, select() would not register the EOF on the pipe until the - * child processes had terminated. [Bug: 4139] + * Send "q" message to the notifier thread so that it will terminate. + * The notifier will return from its call to select() and notice that + * a "q" message has arrived, it will then close its side of the pipe + * and terminate its thread. Note the we can not just close the pipe + * and check for EOF in the notifier thread because if a background + * child process was created with exec, select() would not register + * the EOF on the pipe until the child processes had terminated. [Bug: + * 4139] [Bug: 1222872] */ + write(triggerPipe, "q", 1); close(triggerPipe); - result = pthread_join(notifierThread, NULL); + result = pthread_join(notifierThread, NULL); if (result) { Tcl_Panic("Tcl_FinalizeNotifier: unable to join notifier thread."); } - + close(receivePipe); - triggerPipe = -1; + triggerPipe = -1; } UNLOCK_NOTIFIER_INIT; - - LOCK_NOTIFIER; /* for concurrency with Tcl_AlertNotifier */ + + LOCK_NOTIFIER; /* for concurrency with Tcl_AlertNotifier */ if (tsdPtr->runLoop) { - tsdPtr->runLoop = NULL; - /* Remove runLoopSource from all CFRunLoops and release it */ - CFRunLoopSourceInvalidate(tsdPtr->runLoopSource); - CFRelease(tsdPtr->runLoopSource); - tsdPtr->runLoopSource = NULL; + tsdPtr->runLoop = NULL; + + /* + * Remove runLoopSource from all CFRunLoops and release it. + */ + + CFRunLoopSourceInvalidate(tsdPtr->runLoopSource); + CFRelease(tsdPtr->runLoopSource); + tsdPtr->runLoopSource = NULL; } UNLOCK_NOTIFIER; } @@ -374,18 +388,16 @@ Tcl_FinalizeNotifier(clientData) * * Tcl_AlertNotifier -- * - * Wake up the specified notifier from any thread. This routine - * is called by the platform independent notifier code whenever - * the Tcl_ThreadAlert routine is called. This routine is - * guaranteed not to be called on a given notifier after - * Tcl_FinalizeNotifier is called for that notifier. + * Wake up the specified notifier from any thread. This routine is called + * by the platform independent notifier code whenever the Tcl_ThreadAlert + * routine is called. This routine is guaranteed not to be called on a + * given notifier after Tcl_FinalizeNotifier is called for that notifier. * * Results: * None. * * Side effects: - * Signals the notifier condition variable for the specified - * notifier. + * Signals the notifier condition variable for the specified notifier. * *---------------------------------------------------------------------- */ @@ -395,11 +407,12 @@ Tcl_AlertNotifier(clientData) ClientData clientData; { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData; + LOCK_NOTIFIER; if (tsdPtr->runLoop) { - tsdPtr->eventReady = 1; - CFRunLoopSourceSignal(tsdPtr->runLoopSource); - CFRunLoopWakeUp(tsdPtr->runLoop); + tsdPtr->eventReady = 1; + CFRunLoopSourceSignal(tsdPtr->runLoopSource); + CFRunLoopWakeUp(tsdPtr->runLoop); } UNLOCK_NOTIFIER; } @@ -409,9 +422,9 @@ Tcl_AlertNotifier(clientData) * * Tcl_SetTimer -- * - * This procedure sets the current notifier timer value. This - * interface is not implemented in this notifier because we are - * always running inside of Tcl_DoOneEvent. + * This function sets the current notifier timer value. This interface is + * not implemented in this notifier because we are always running inside + * of Tcl_DoOneEvent. * * Results: * None. @@ -427,9 +440,9 @@ Tcl_SetTimer(timePtr) Tcl_Time *timePtr; /* Timeout value, may be NULL. */ { /* - * The interval timer doesn't do anything in this implementation, - * because the only event loop is via Tcl_DoOneEvent, which passes - * timeout values to Tcl_WaitForEvent. + * The interval timer doesn't do anything in this implementation, because + * the only event loop is via Tcl_DoOneEvent, which passes timeout values + * to Tcl_WaitForEvent. */ if (tclStubs.tcl_SetTimer != tclOriginalNotifier.setTimerProc) { @@ -465,7 +478,7 @@ Tcl_ServiceModeHook(mode) * * Tcl_CreateFileHandler -- * - * This procedure registers a file handler with the select notifier. + * This function registers a file handler with the select notifier. * * Results: * None. @@ -480,17 +493,18 @@ void Tcl_CreateFileHandler(fd, mask, proc, clientData) int fd; /* Handle of stream to watch. */ int mask; /* OR'ed combination of TCL_READABLE, - * TCL_WRITABLE, and TCL_EXCEPTION: - * indicates conditions under which - * proc should be called. */ - Tcl_FileProc *proc; /* Procedure to call for each - * selected event. */ + * TCL_WRITABLE, and TCL_EXCEPTION: indicates + * conditions under which proc should be + * called. */ + Tcl_FileProc *proc; /* Function to call for each selected + * event. */ ClientData clientData; /* Arbitrary data to pass to proc. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); FileHandler *filePtr; - if (tclStubs.tcl_CreateFileHandler != tclOriginalNotifier.createFileHandlerProc) { + if (tclStubs.tcl_CreateFileHandler != + tclOriginalNotifier.createFileHandlerProc) { tclStubs.tcl_CreateFileHandler(fd, mask, proc, clientData); return; } @@ -541,8 +555,7 @@ Tcl_CreateFileHandler(fd, mask, proc, clientData) * * Tcl_DeleteFileHandler -- * - * Cancel a previously-arranged callback arrangement for - * a file. + * Cancel a previously-arranged callback arrangement for a file. * * Results: * None. @@ -555,13 +568,15 @@ Tcl_CreateFileHandler(fd, mask, proc, clientData) void Tcl_DeleteFileHandler(fd) - int fd; /* Stream id for which to remove callback procedure. */ + int fd; /* Stream id for which to remove callback + * function. */ { FileHandler *filePtr, *prevPtr; int i; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - if (tclStubs.tcl_DeleteFileHandler != tclOriginalNotifier.deleteFileHandlerProc) { + if (tclStubs.tcl_DeleteFileHandler != + tclOriginalNotifier.deleteFileHandlerProc) { tclStubs.tcl_DeleteFileHandler(fd); return; } @@ -627,19 +642,19 @@ Tcl_DeleteFileHandler(fd) * * FileHandlerEventProc -- * - * This procedure is called by Tcl_ServiceEvent when a file event - * reaches the front of the event queue. This procedure is - * responsible for actually handling the event by invoking the - * callback for the file handler. + * This function is called by Tcl_ServiceEvent when a file event reaches + * the front of the event queue. This function is responsible for + * actually handling the event by invoking the callback for the file + * handler. * * Results: - * Returns 1 if the event was handled, meaning it should be removed - * from the queue. Returns 0 if the event was not handled, meaning - * it should stay on the queue. The only time the event isn't - * handled is if the TCL_FILE_EVENTS flag bit isn't set. + * Returns 1 if the event was handled, meaning it should be removed from + * the queue. Returns 0 if the event was not handled, meaning it should + * stay on the queue. The only time the event isn't handled is if the + * TCL_FILE_EVENTS flag bit isn't set. * * Side effects: - * Whatever the file handler's callback procedure does. + * Whatever the file handler's callback function does. * *---------------------------------------------------------------------- */ @@ -647,8 +662,8 @@ Tcl_DeleteFileHandler(fd) static int FileHandlerEventProc(evPtr, flags) Tcl_Event *evPtr; /* Event to service. */ - int flags; /* Flags that indicate what events to - * handle, such as TCL_FILE_EVENTS. */ + int flags; /* Flags that indicate what events to handle, + * such as TCL_FILE_EVENTS. */ { int mask; FileHandler *filePtr; @@ -661,9 +676,9 @@ FileHandlerEventProc(evPtr, flags) /* * Search through the file handlers to find the one whose handle matches - * the event. We do this rather than keeping a pointer to the file - * handler directly in the event, so that the handler can be deleted - * while the event is queued without leaving a dangling pointer. + * the event. We do this rather than keeping a pointer to the file handler + * directly in the event, so that the handler can be deleted while the + * event is queued without leaving a dangling pointer. */ tsdPtr = TCL_TSD_INIT(&dataKey); @@ -675,14 +690,14 @@ FileHandlerEventProc(evPtr, flags) /* * The code is tricky for two reasons: - * 1. The file handler's desired events could have changed - * since the time when the event was queued, so AND the - * ready mask with the desired mask. - * 2. The file could have been closed and re-opened since - * the time when the event was queued. This is why the - * ready mask is stored in the file handler rather than - * the queued event: it will be zeroed when a new - * file handler is created for the newly opened file. + * 1. The file handler's desired events could have changed since the + * time when the event was queued, so AND the ready mask with the + * desired mask. + * 2. The file could have been closed and re-opened since the time + * when the event was queued. This is why the ready mask is stored + * in the file handler rather than the queued event: it will be + * zeroed when a new file handler is created for the newly opened + * file. */ mask = filePtr->readyMask & filePtr->mask; @@ -700,13 +715,12 @@ FileHandlerEventProc(evPtr, flags) * * Tcl_WaitForEvent -- * - * This function is called by Tcl_DoOneEvent to wait for new - * events on the message queue. If the block time is 0, then - * Tcl_WaitForEvent just polls without blocking. + * This function is called by Tcl_DoOneEvent to wait for new events on + * the message queue. If the block time is 0, then Tcl_WaitForEvent just + * polls without blocking. * * Results: - * Returns -1 if the select would block forever, otherwise - * returns 0. + * Returns -1 if the select would block forever, otherwise returns 0. * * Side effects: * Queues file events that are detected by the select. @@ -739,10 +753,10 @@ Tcl_WaitForEvent(timePtr) if (timePtr != NULL && timePtr->sec == 0 && timePtr->usec == 0) { /* * Cannot emulate a polling select with a polling condition variable. - * Instead, pretend to wait for files and tell the notifier - * thread what we are doing. The notifier thread makes sure - * it goes through select with its select mask in the same state - * as ours currently is. We block until that happens. + * Instead, pretend to wait for files and tell the notifier thread + * what we are doing. The notifier thread makes sure it goes through + * select with its select mask in the same state as ours currently is. + * We block until that happens. */ waitForFiles = 1; @@ -754,9 +768,9 @@ Tcl_WaitForEvent(timePtr) if (waitForFiles) { /* - * Add the ThreadSpecificData structure of this thread to the list - * of ThreadSpecificData structures of all threads that are waiting - * on file events. + * Add the ThreadSpecificData structure of this thread to the list of + * ThreadSpecificData structures of all threads that are waiting on + * file events. */ tsdPtr->nextPtr = waitingListPtr; @@ -775,23 +789,23 @@ Tcl_WaitForEvent(timePtr) FD_ZERO(&(tsdPtr->readyMasks.exceptional)); if (!tsdPtr->eventReady) { - CFTimeInterval waitTime; - - if (timePtr == NULL) { - waitTime = 1.0e10; /* Wait forever, as per CFRunLoop.c */ - } else { - waitTime = timePtr->sec + 1.0e-6 * timePtr->usec; - } - UNLOCK_NOTIFIER; - CFRunLoopRunInMode(kCFRunLoopDefaultMode, waitTime, TRUE); - LOCK_NOTIFIER; + CFTimeInterval waitTime; + + if (timePtr == NULL) { + waitTime = 1.0e10; /* Wait forever, as per CFRunLoop.c */ + } else { + waitTime = timePtr->sec + 1.0e-6 * timePtr->usec; + } + UNLOCK_NOTIFIER; + CFRunLoopRunInMode(kCFRunLoopDefaultMode, waitTime, TRUE); + LOCK_NOTIFIER; } tsdPtr->eventReady = 0; if (waitForFiles && tsdPtr->onList) { /* * Remove the ThreadSpecificData structure of this thread from the - * waiting list. Alert the notifier thread to recompute its select + * waiting list. Alert the notifier thread to recompute its select * masks - skipping this caused a hang when trying to close a pipe * which the notifier thread was still doing a select on. */ @@ -809,7 +823,6 @@ Tcl_WaitForEvent(timePtr) write(triggerPipe, "", 1); } - /* * Queue all detected file events before returning. */ @@ -833,8 +846,8 @@ Tcl_WaitForEvent(timePtr) } /* - * Don't bother to queue an event if the mask was previously - * non-zero since an event must still be on the queue. + * Don't bother to queue an event if the mask was previously non-zero + * since an event must still be on the queue. */ if (filePtr->readyMask == 0) { @@ -855,21 +868,20 @@ Tcl_WaitForEvent(timePtr) * NotifierThreadProc -- * * This routine is the initial (and only) function executed by the - * special notifier thread. Its job is to wait for file descriptors - * to become readable or writable or to have an exception condition - * and then to notify other threads who are interested in this - * information by signalling a condition variable. Other threads - * can signal this notifier thread of a change in their interests - * by writing a single byte to a special pipe that the notifier - * thread is monitoring. + * special notifier thread. Its job is to wait for file descriptors to + * become readable or writable or to have an exception condition and then + * to notify other threads who are interested in this information by + * signalling a condition variable. Other threads can signal this + * notifier thread of a change in their interests by writing a single + * byte to a special pipe that the notifier thread is monitoring. * * Result: - * None. Once started, this routine never exits. It dies with - * the overall process. + * None. Once started, this routine never exits. It dies with the overall + * process. * * Side effects: - * The trigger pipe used to signal the notifier thread is created - * when the notifier thread first starts. + * The trigger pipe used to signal the notifier thread is created when + * the notifier thread first starts. * *---------------------------------------------------------------------- */ @@ -897,8 +909,8 @@ NotifierThreadProc(clientData) FD_ZERO(&exceptionalMask); /* - * Compute the logical OR of the select masks from all the - * waiting notifiers. + * Compute the logical OR of the select masks from all the waiting + * notifiers. */ LOCK_NOTIFIER; @@ -920,8 +932,8 @@ NotifierThreadProc(clientData) } if (tsdPtr->pollState & POLL_WANT) { /* - * Here we make sure we go through select() with the same - * mask bits that were present when the thread tried to poll. + * Here we make sure we go through select() with the same mask + * bits that were present when the thread tried to poll. */ tsdPtr->pollState |= POLL_DONE; @@ -978,10 +990,10 @@ NotifierThreadProc(clientData) tsdPtr->eventReady = 1; if (tsdPtr->onList) { /* - * Remove the ThreadSpecificData structure of this - * thread from the waiting list. This prevents us from - * continuously spining on select until the other - * threads runs and services the file event. + * Remove the ThreadSpecificData structure of this thread + * from the waiting list. This prevents us from + * continuously spining on select until the other threads + * runs and services the file event. */ if (tsdPtr->prevPtr) { @@ -1006,8 +1018,8 @@ NotifierThreadProc(clientData) /* * Consume the next byte from the notifier pipe if the pipe was - * readable. Note that there may be multiple bytes pending, but - * to avoid a race condition we only read one at a time. + * readable. Note that there may be multiple bytes pending, but to + * avoid a race condition we only read one at a time. */ if (FD_ISSET(receivePipe, &readableMask)) { @@ -1015,9 +1027,9 @@ NotifierThreadProc(clientData) if ((i == 0) || ((i == 1) && (buf[0] == 'q'))) { /* - * Someone closed the write end of the pipe or sent us a - * Quit message [Bug: 4139] and then closed the write end - * of the pipe so we need to shut down the notifier thread. + * Someone closed the write end of the pipe or sent us a Quit + * message [Bug: 4139] and then closed the write end of the + * pipe so we need to shut down the notifier thread. */ break; @@ -1026,5 +1038,4 @@ NotifierThreadProc(clientData) } pthread_exit (0); } - #endif /* HAVE_COREFOUNDATION */ diff --git a/unix/Makefile.in b/unix/Makefile.in index fce9f09..0f816e7 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -5,7 +5,7 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.121.2.15 2005/06/23 05:59:51 das Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.121.2.16 2005/11/27 02:34:41 das Exp $ VERSION = @TCL_VERSION@ MAJOR_VERSION = @TCL_MAJOR_VERSION@ @@ -490,7 +490,7 @@ objs: ${OBJS} tclsh: ${TCLSH_OBJS} ${TCL_LIB_FILE} - ${CC} ${LDFLAGS} ${TCLSH_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} \ + ${CC} ${CFLAGS} ${LDFLAGS} ${TCLSH_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} \ ${CC_SEARCH_FLAGS} -o tclsh # Resetting the LIB_RUNTIME_DIR below is required so that @@ -502,7 +502,7 @@ tcltest: ${TCLTEST_OBJS} ${TCL_LIB_FILE} ${BUILD_DLTEST} $(MAKE) tcltest-real LIB_RUNTIME_DIR=`pwd` tcltest-real: - ${CC} ${LDFLAGS} ${TCLTEST_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} \ + ${CC} ${CFLAGS} ${LDFLAGS} ${TCLTEST_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} \ ${CC_SEARCH_FLAGS} -o tcltest # Note, in the target below TCL_LIBRARY needs to be set or else @@ -771,8 +771,12 @@ depend: # complicated because they are compiled from tclAppInit.c. Can't use # the "-o" option because this doesn't work on some strange compilers # (e.g. UnixWare). +# To enable concurrent parallel make of tclsh and tcltest resp xttest, these +# targets have to depend on tclsh, this ensures that linking of tclsh with +# tclAppInit.o does not execute concurrently with the renaming and recompiling +# of that same object file in the targets below. -tclTestInit.o: $(UNIX_DIR)/tclAppInit.c +tclTestInit.o: $(UNIX_DIR)/tclAppInit.c tclsh @if test -f tclAppInit.o ; then \ rm -f tclAppInit.sav; \ mv tclAppInit.o tclAppInit.sav; \ @@ -786,7 +790,7 @@ tclTestInit.o: $(UNIX_DIR)/tclAppInit.c mv tclAppInit.sav tclAppInit.o; \ fi; -xtTestInit.o: $(UNIX_DIR)/tclAppInit.c +xtTestInit.o: $(UNIX_DIR)/tclAppInit.c tclsh @if test -f tclAppInit.o ; then \ rm -f tclAppInit.sav; \ mv tclAppInit.o tclAppInit.sav; \ @@ -1166,12 +1170,13 @@ genstubs: # tables. # -checkstubs: - -@for i in `nm -p $(TCL_LIB_FILE) | awk '$$2 ~ /T/ { print $$3 }' \ +checkstubs: $(TCL_LIB_FILE) + -@for i in `nm -p $(TCL_LIB_FILE) \ + | awk '$$2 ~ /^[TDBCS]$$/ { sub("^_", "", $$3); print $$3 }' \ | sort -n`; do \ match=0; \ for j in $(TCL_DECLS); do \ - if [ `grep -c $$i $$j` -gt 0 ]; then \ + if [ `grep -c "$$i *(" $$j` -gt 0 ]; then \ match=1; \ fi; \ done; \ @@ -1184,7 +1189,7 @@ checkstubs: # manpages. # -checkdoc: +checkdoc: $(TCL_LIB_FILE) -@for i in `nm -p $(TCL_LIB_FILE) | awk '$$3 ~ /Tcl_/ { print $$3 }' \ | grep -v 'Cmd$$' | sort -n`; do \ match=0; \ @@ -1209,7 +1214,9 @@ checkuchar: # checkexports: $(TCL_LIB_FILE) - -nm -p $(TCL_LIB_FILE) | awk '$$2 ~ /[TDB]/ { print $$3 }' | sort -n | grep -v '^[Tt]cl' + -@nm -p $(TCL_LIB_FILE) \ + | awk '$$2 ~ /^[TDBCS]$$/ { sub("^_", "", $$3); print $$3 }' \ + | sort -n | grep -E -v '^[Tt]cl' || true # # Target to create a Tcl RPM for Linux. Requires that you be on a Linux @@ -1314,12 +1321,11 @@ dist: cp -p $(TOP_DIR)/mac/*.doc $(TOP_DIR)/mac/*.html $(DISTDIR)/mac cp -p $(TOP_DIR)/license.terms $(DISTDIR)/mac mkdir $(DISTDIR)/macosx - cp -p $(TOP_DIR)/macosx/Makefile \ + cp -p $(TOP_DIR)/macosx/Makefile $(TOP_DIR)/macosx/README \ $(TOP_DIR)/macosx/*.c $(TOP_DIR)/macosx/*.in \ $(DISTDIR)/macosx mkdir $(DISTDIR)/macosx/Tcl.pbproj cp -p $(TOP_DIR)/macosx/Tcl.pbproj/*.pbx* $(DISTDIR)/macosx/Tcl.pbproj - cp -p $(TOP_DIR)/macosx/README $(DISTDIR)/macosx mkdir $(DISTDIR)/unix/dltest cp -p $(UNIX_DIR)/dltest/*.c $(UNIX_DIR)/dltest/Makefile.in \ $(UNIX_DIR)/dltest/README \ diff --git a/unix/configure b/unix/configure index 111e53e..16bcd62 100755 --- a/unix/configure +++ b/unix/configure @@ -15,11 +15,11 @@ ac_help="$ac_help --enable-man-symlinks use symlinks for the manpages" ac_help="$ac_help --enable-man-compression=PROG - compress the manpages with PROG" + compress the manpages with PROG" ac_help="$ac_help --enable-man-suffix=STRING - use STRING as a suffix to manpage file names - (default: tcl)" + use STRING as a suffix to manpage file names + (default: tcl)" ac_help="$ac_help --enable-threads build with threads" ac_help="$ac_help @@ -567,16 +567,17 @@ fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi +# Make sure srcdir is fully qualified! +srcdir=`cd $srcdir ; pwd` TCL_SRC_DIR=`cd $srcdir/..; pwd` #------------------------------------------------------------------------ # Compress and/or soft link the manpages? #------------------------------------------------------------------------ - - echo $ac_n "checking whether to use symlinks for manpages""... $ac_c" 1>&6 -echo "configure:579: checking whether to use symlinks for manpages" >&5 - # Check whether --enable-man-symlinks or --disable-man-symlinks was given. + echo $ac_n "checking whether to use symlinks for manpages""... $ac_c" 1>&6 +echo "configure:580: checking whether to use symlinks for manpages" >&5 + # Check whether --enable-man-symlinks or --disable-man-symlinks was given. if test "${enable_man_symlinks+set}" = set; then enableval="$enable_man_symlinks" test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks" @@ -584,45 +585,45 @@ else enableval="no" fi - echo "$ac_t""$enableval" 1>&6 + echo "$ac_t""$enableval" 1>&6 - echo $ac_n "checking whether to compress the manpages""... $ac_c" 1>&6 -echo "configure:591: checking whether to compress the manpages" >&5 - # Check whether --enable-man-compression or --disable-man-compression was given. + echo $ac_n "checking whether to compress the manpages""... $ac_c" 1>&6 +echo "configure:592: checking whether to compress the manpages" >&5 + # Check whether --enable-man-compression or --disable-man-compression was given. if test "${enable_man_compression+set}" = set; then enableval="$enable_man_compression" test "$enableval" = "yes" && { echo "configure: error: missing argument to --enable-man-compression" 1>&2; exit 1; } - test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --compress $enableval" + test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --compress $enableval" else enableval="no" fi - echo "$ac_t""$enableval" 1>&6 - if test "$enableval" != "no"; then - echo $ac_n "checking for compressed file suffix""... $ac_c" 1>&6 -echo "configure:604: checking for compressed file suffix" >&5 - touch TeST - $enableval TeST - Z=`ls TeST* | sed 's/^....//'` - rm -f TeST* - MAN_FLAGS="$MAN_FLAGS --extension $Z" - echo "$ac_t""$Z" 1>&6 - fi + echo "$ac_t""$enableval" 1>&6 + if test "$enableval" != "no"; then + echo $ac_n "checking for compressed file suffix""... $ac_c" 1>&6 +echo "configure:605: checking for compressed file suffix" >&5 + touch TeST + $enableval TeST + Z=`ls TeST* | sed 's/^....//'` + rm -f TeST* + MAN_FLAGS="$MAN_FLAGS --extension $Z" + echo "$ac_t""$Z" 1>&6 + fi - echo $ac_n "checking whether to add a package name suffix for the manpages""... $ac_c" 1>&6 -echo "configure:614: checking whether to add a package name suffix for the manpages" >&5 - # Check whether --enable-man-suffix or --disable-man-suffix was given. + echo $ac_n "checking whether to add a package name suffix for the manpages""... $ac_c" 1>&6 +echo "configure:615: checking whether to add a package name suffix for the manpages" >&5 + # Check whether --enable-man-suffix or --disable-man-suffix was given. if test "${enable_man_suffix+set}" = set; then enableval="$enable_man_suffix" test "$enableval" = "yes" && enableval="tcl" - test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --suffix $enableval" + test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --suffix $enableval" else enableval="no" fi - echo "$ac_t""$enableval" 1>&6 + echo "$ac_t""$enableval" 1>&6 - + #------------------------------------------------------------------------ @@ -638,7 +639,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:642: checking for $ac_word" >&5 +echo "configure:643: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -668,7 +669,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:672: checking for $ac_word" >&5 +echo "configure:673: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -719,7 +720,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:723: checking for $ac_word" >&5 +echo "configure:724: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -751,7 +752,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:755: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:756: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -762,12 +763,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 766 "configure" +#line 767 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -793,12 +794,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:797: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:798: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:802: checking whether we are using GNU C" >&5 +echo "configure:803: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -807,7 +808,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -826,7 +827,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:830: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:831: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -858,674 +859,547 @@ else fi -#------------------------------------------------------------------------ -# Threads support -#------------------------------------------------------------------------ - +#-------------------------------------------------------------------- +# Supply substitutes for missing POSIX header files. Special +# notes: +# - stdlib.h doesn't define strtol, strtoul, or +# strtod insome versions of SunOS +# - some versions of string.h don't declare procedures such +# as strstr +# Do this early, otherwise an autoconf bug throws errors on configure +#-------------------------------------------------------------------- - echo $ac_n "checking for building with threads""... $ac_c" 1>&6 -echo "configure:868: checking for building with threads" >&5 - # Check whether --enable-threads or --disable-threads was given. -if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval -else - tcl_ok=no +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:874: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= fi - - - if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then - if test "${TCL_THREADS}" = 1; then - echo "$ac_t""yes (threaded core)" 1>&6 - else - echo "$ac_t""yes" 1>&6 - fi - TCL_THREADS=1 - cat >> confdefs.h <<\EOF -#define TCL_THREADS 1 -EOF - - # USE_THREAD_ALLOC tells us to try the special thread-based - # allocator that significantly reduces lock contention - cat >> confdefs.h <<\EOF -#define USE_THREAD_ALLOC 1 -EOF - - cat >> confdefs.h <<\EOF -#define _REENTRANT 1 -EOF - - if test "`uname -s`" = "SunOS" ; then - cat >> confdefs.h <<\EOF -#define _POSIX_PTHREAD_SEMANTICS 1 -EOF - - fi - cat >> confdefs.h <<\EOF -#define _THREAD_SAFE 1 -EOF - - echo $ac_n "checking for pthread_mutex_init in -lpthread""... $ac_c" 1>&6 -echo "configure:910: checking for pthread_mutex_init in -lpthread" >&5 -ac_lib_var=`echo pthread'_'pthread_mutex_init | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lpthread $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < +Syntax Error EOF -if { (eval echo configure:929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:895: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - tcl_ok=yes +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" else - echo "$ac_t""no" 1>&6 -tcl_ok=no + ac_cv_prog_CPP="$CPP" fi +echo "$ac_t""$CPP" 1>&6 - if test "$tcl_ok" = "no"; then - # Check a little harder for __pthread_mutex_init in the same - # library, as some systems hide it there until pthread.h is - # defined. We could alternatively do an AC_TRY_COMPILE with - # pthread.h, but that will work with libpthread really doesn't - # exist, like AIX 4.2. [Bug: 4359] - echo $ac_n "checking for __pthread_mutex_init in -lpthread""... $ac_c" 1>&6 -echo "configure:957: checking for __pthread_mutex_init in -lpthread" >&5 -ac_lib_var=`echo pthread'_'__pthread_mutex_init | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + + echo $ac_n "checking dirent.h""... $ac_c" 1>&6 +echo "configure:955: checking dirent.h" >&5 + if eval "test \"`echo '$''{'tcl_cv_dirent_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lpthread $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < +#include int main() { -__pthread_mutex_init() + +#ifndef _POSIX_SOURCE +# ifdef __Lynx__ + /* + * Generate compilation error to make the test fail: Lynx headers + * are only valid if really in the POSIX environment. + */ + + missing_procedure(); +# endif +#endif +DIR *d; +struct dirent *entryPtr; +char *p; +d = opendir("foobar"); +entryPtr = readdir(d); +p = entryPtr->d_name; +closedir(d); + ; return 0; } EOF -if { (eval echo configure:976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + tcl_cv_dirent_h=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + tcl_cv_dirent_h=no fi rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - tcl_ok=yes -else - echo "$ac_t""no" 1>&6 -tcl_ok=no fi - fi - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthread" - else - echo $ac_n "checking for pthread_mutex_init in -lpthreads""... $ac_c" 1>&6 -echo "configure:1004: checking for pthread_mutex_init in -lpthreads" >&5 -ac_lib_var=`echo pthreads'_'pthread_mutex_init | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + if test $tcl_cv_dirent_h = no; then + cat >> confdefs.h <<\EOF +#define NO_DIRENT_H 1 +EOF + + fi + + echo "$ac_t""$tcl_ok" 1>&6 + ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for errno.h""... $ac_c" 1>&6 +echo "configure:1009: checking for errno.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lpthreads $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < EOF -if { (eval echo configure:1023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - tcl_ok=yes + : else echo "$ac_t""no" 1>&6 -tcl_ok=no +cat >> confdefs.h <<\EOF +#define NO_ERRNO_H 1 +EOF + fi - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthreads" - else - echo $ac_n "checking for pthread_mutex_init in -lc""... $ac_c" 1>&6 -echo "configure:1049: checking for pthread_mutex_init in -lc" >&5 -ac_lib_var=`echo c'_'pthread_mutex_init | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + ac_safe=`echo "float.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for float.h""... $ac_c" 1>&6 +echo "configure:1046: checking for float.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lc $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < EOF -if { (eval echo configure:1068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1056: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - tcl_ok=yes + : else echo "$ac_t""no" 1>&6 -tcl_ok=no +cat >> confdefs.h <<\EOF +#define NO_FLOAT_H 1 +EOF + fi - if test "$tcl_ok" = "no"; then - echo $ac_n "checking for pthread_mutex_init in -lc_r""... $ac_c" 1>&6 -echo "configure:1091: checking for pthread_mutex_init in -lc_r" >&5 -ac_lib_var=`echo c_r'_'pthread_mutex_init | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + ac_safe=`echo "values.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for values.h""... $ac_c" 1>&6 +echo "configure:1083: checking for values.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lc_r $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < EOF -if { (eval echo configure:1110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - tcl_ok=yes + : else echo "$ac_t""no" 1>&6 -tcl_ok=no -fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -pthread" - else - TCL_THREADS=0 - echo "configure: warning: "Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..."" 1>&2 - fi - fi - fi - fi +cat >> confdefs.h <<\EOF +#define NO_VALUES_H 1 +EOF - # Does the pthread-implementation provide - # 'pthread_attr_setstacksize' ? +fi - ac_saved_libs=$LIBS - LIBS="$LIBS $THREADS_LIBS" - for ac_func in pthread_attr_setstacksize -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1150: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + ac_safe=`echo "limits.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for limits.h""... $ac_c" 1>&6 +echo "configure:1120: checking for limits.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* 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(); - -int main() { - -/* 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 -$ac_func(); -#endif - -; return 0; } +#include EOF -if { (eval echo configure:1178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <> confdefs.h <<\EOF +#define HAVE_LIMITS_H 1 EOF - + else echo "$ac_t""no" 1>&6 +cat >> confdefs.h <<\EOF +#define NO_LIMITS_H 1 +EOF + fi -done - for ac_func in pthread_atfork -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1205: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + ac_safe=`echo "stdlib.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for stdlib.h""... $ac_c" 1>&6 +echo "configure:1160: checking for stdlib.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* 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(); - -int main() { - -/* 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 -$ac_func(); -#endif - -; return 0; } +#include EOF -if { (eval echo configure:1233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 +tcl_ok=0 fi -done - - LIBS=$ac_saved_libs - else - TCL_THREADS=0 - echo "$ac_t""no (default)" 1>&6 - fi - - - -#------------------------------------------------------------------------ -# If we're using GCC, see if the compiler understands -pipe. If so, use it. -# It makes compiling go faster. (This is only a performance feature.) -#------------------------------------------------------------------------ -if test -z "$no_pipe"; then -if test -n "$GCC"; then - echo $ac_n "checking if the compiler understands -pipe""... $ac_c" 1>&6 -echo "configure:1273: checking if the compiler understands -pipe" >&5 - OLDCC="$CC" - CC="$CC -pipe" - cat > conftest.$ac_ext < conftest.$ac_ext < EOF -if { (eval echo configure:1284: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - echo "$ac_t""yes" 1>&6 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "strtol" >/dev/null 2>&1; then + : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* - CC="$OLDCC" - echo "$ac_t""no" 1>&6 + tcl_ok=0 fi rm -f conftest* -fi -fi - -#-------------------------------------------------------------------- -# Look for libraries that we will need when compiling the Tcl shell -#-------------------------------------------------------------------- -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1303: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < conftest.$ac_ext < -Syntax Error +#include EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "strtoul" >/dev/null 2>&1; then : else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error + tcl_ok=0 +fi +rm -f conftest* + + cat > conftest.$ac_ext < EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "strtod" >/dev/null 2>&1; then : else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* - CPP="${CC-cc} -nologo -E" + tcl_ok=0 +fi +rm -f conftest* + + if test $tcl_ok = 0; then + cat >> confdefs.h <<\EOF +#define NO_STDLIB_H 1 +EOF + + fi + ac_safe=`echo "string.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for string.h""... $ac_c" 1>&6 +echo "configure:1242: checking for string.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else cat > conftest.$ac_ext < -Syntax Error +#include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1358: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then - : + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* - ac_cv_prog_CPP="$CPP" fi - CPP="$ac_cv_prog_CPP" +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + tcl_ok=1 else - ac_cv_prog_CPP="$CPP" + echo "$ac_t""no" 1>&6 +tcl_ok=0 fi -echo "$ac_t""$CPP" 1>&6 - - - #-------------------------------------------------------------------- - # On a few very rare systems, all of the libm.a stuff is - # already in libc.a. Set compiler flags accordingly. - # Also, Linux requires the "ieee" library for math to work - # right (and it must appear before "-lm"). - #-------------------------------------------------------------------- - echo $ac_n "checking for sin""... $ac_c" 1>&6 -echo "configure:1391: checking for sin" >&5 -if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char sin(); - -int main() { - -/* 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_sin) || defined (__stub___sin) -choke me -#else -sin(); -#endif - -; return 0; } +#include EOF -if { (eval echo configure:1419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_sin=yes" +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "strstr" >/dev/null 2>&1; then + : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_sin=no" + tcl_ok=0 fi rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then - echo "$ac_t""yes" 1>&6 - MATH_LIBS="" + cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "strerror" >/dev/null 2>&1; then + : else - echo "$ac_t""no" 1>&6 -MATH_LIBS="-lm" + rm -rf conftest* + tcl_ok=0 fi +rm -f conftest* - echo $ac_n "checking for main in -lieee""... $ac_c" 1>&6 -echo "configure:1440: checking for main in -lieee" >&5 -ac_lib_var=`echo ieee'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + + # See also memmove check below for a place where NO_STRING_H can be + # set and why. + + if test $tcl_ok = 0; then + cat >> confdefs.h <<\EOF +#define NO_STRING_H 1 +EOF + + fi + + ac_safe=`echo "sys/wait.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for sys/wait.h""... $ac_c" 1>&6 +echo "configure:1315: checking for sys/wait.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lieee $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < EOF -if { (eval echo configure:1455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - MATH_LIBS="-lieee $MATH_LIBS" + : else echo "$ac_t""no" 1>&6 -fi - +cat >> confdefs.h <<\EOF +#define NO_SYS_WAIT_H 1 +EOF - #-------------------------------------------------------------------- - # Interactive UNIX requires -linet instead of -lsocket, plus it - # needs net/errno.h to define the socket-related error codes. - #-------------------------------------------------------------------- +fi - echo $ac_n "checking for main in -linet""... $ac_c" 1>&6 -echo "configure:1482: checking for main in -linet" >&5 -ac_lib_var=`echo inet'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 +echo "configure:1352: checking for dlfcn.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-linet $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < EOF -if { (eval echo configure:1497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -linet" + : else echo "$ac_t""no" 1>&6 +cat >> confdefs.h <<\EOF +#define NO_DLFCN_H 1 +EOF + fi - ac_safe=`echo "net/errno.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for net/errno.h""... $ac_c" 1>&6 -echo "configure:1519: checking for net/errno.h" >&5 + + # OS/390 lacks sys/param.h (and doesn't need it, by chance). + for ac_hdr in unistd.h sys/param.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1393: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +#include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1529: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1541,151 +1415,166 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_NET_ERRNO_H 1 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 fi +done - #-------------------------------------------------------------------- - # Check for the existence of the -lsocket and -lnsl libraries. - # The order here is important, so that they end up in the right - # order in the command line generated by make. Here are some - # special considerations: - # 1. Use "connect" and "accept" to check for -lsocket, and - # "gethostbyname" to check for -lnsl. - # 2. Use each function name only once: can't redo a check because - # autoconf caches the results of the last check and won't redo it. - # 3. Use -lnsl and -lsocket only if they supply procedures that - # aren't already present in the normal libraries. This is because - # IRIX 5.2 has libraries, but they aren't needed and they're - # bogus: they goof up name resolution if used. - # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. - # To get around this problem, check for both libraries together - # if -lsocket doesn't work by itself. - #-------------------------------------------------------------------- - tcl_checkBoth=0 - echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:1574: checking for connect" >&5 -if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else +#------------------------------------------------------------------------ +# If we're using GCC, see if the compiler understands -pipe. If so, use it. +# It makes compiling go faster. (This is only a performance feature.) +#------------------------------------------------------------------------ + +if test -z "$no_pipe"; then +if test -n "$GCC"; then + echo $ac_n "checking if the compiler understands -pipe""... $ac_c" 1>&6 +echo "configure:1439: checking if the compiler understands -pipe" >&5 + OLDCC="$CC" + CC="$CC -pipe" cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char connect(); int main() { -/* 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_connect) || defined (__stub___connect) -choke me -#else -connect(); -#endif - ; return 0; } EOF -if { (eval echo configure:1602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_func_connect=yes" + echo "$ac_t""yes" 1>&6 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_connect=no" + CC="$OLDCC" + echo "$ac_t""no" 1>&6 fi rm -f conftest* +fi fi -if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then - echo "$ac_t""yes" 1>&6 - tcl_checkSocket=0 +#------------------------------------------------------------------------ +# Threads support +#------------------------------------------------------------------------ + + + echo $ac_n "checking for building with threads""... $ac_c" 1>&6 +echo "configure:1470: checking for building with threads" >&5 + # Check whether --enable-threads or --disable-threads was given. +if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval else - echo "$ac_t""no" 1>&6 -tcl_checkSocket=1 + tcl_ok=no fi - if test "$tcl_checkSocket" = 1; then - echo $ac_n "checking for setsockopt""... $ac_c" 1>&6 -echo "configure:1624: checking for setsockopt" >&5 -if eval "test \"`echo '$''{'ac_cv_func_setsockopt'+set}'`\" = set"; then + + if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then + if test "${TCL_THREADS}" = 1; then + echo "$ac_t""yes (threaded core)" 1>&6 + else + echo "$ac_t""yes" 1>&6 + fi + TCL_THREADS=1 + cat >> confdefs.h <<\EOF +#define TCL_THREADS 1 +EOF + + # USE_THREAD_ALLOC tells us to try the special thread-based + # allocator that significantly reduces lock contention + cat >> confdefs.h <<\EOF +#define USE_THREAD_ALLOC 1 +EOF + + cat >> confdefs.h <<\EOF +#define _REENTRANT 1 +EOF + + if test "`uname -s`" = "SunOS" ; then + cat >> confdefs.h <<\EOF +#define _POSIX_PTHREAD_SEMANTICS 1 +EOF + + fi + cat >> confdefs.h <<\EOF +#define _THREAD_SAFE 1 +EOF + + echo $ac_n "checking for pthread_mutex_init in -lpthread""... $ac_c" 1>&6 +echo "configure:1512: checking for pthread_mutex_init in -lpthread" >&5 +ac_lib_var=`echo pthread'_'pthread_mutex_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char setsockopt(); +char pthread_mutex_init(); int main() { - -/* 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_setsockopt) || defined (__stub___setsockopt) -choke me -#else -setsockopt(); -#endif - +pthread_mutex_init() ; return 0; } EOF -if { (eval echo configure:1652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_func_setsockopt=yes" + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_setsockopt=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -fi +LIBS="$ac_save_LIBS" -if eval "test \"`echo '$ac_cv_func_'setsockopt`\" = yes"; then +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - : + tcl_ok=yes else echo "$ac_t""no" 1>&6 -echo $ac_n "checking for setsockopt in -lsocket""... $ac_c" 1>&6 -echo "configure:1670: checking for setsockopt in -lsocket" >&5 -ac_lib_var=`echo socket'_'setsockopt | sed 'y%./+-%__p_%'` +tcl_ok=no +fi + + if test "$tcl_ok" = "no"; then + # Check a little harder for __pthread_mutex_init in the same + # library, as some systems hide it there until pthread.h is + # defined. We could alternatively do an AC_TRY_COMPILE with + # pthread.h, but that will work with libpthread really doesn't + # exist, like AIX 4.2. [Bug: 4359] + echo $ac_n "checking for __pthread_mutex_init in -lpthread""... $ac_c" 1>&6 +echo "configure:1559: checking for __pthread_mutex_init in -lpthread" >&5 +ac_lib_var=`echo pthread'_'__pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lsocket $LIBS" +LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1700,135 +1589,126 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lsocket" + tcl_ok=yes else echo "$ac_t""no" 1>&6 -tcl_checkBoth=1 +tcl_ok=no fi -fi + fi - fi - if test "$tcl_checkBoth" = 1; then - tk_oldLibs=$LIBS - LIBS="$LIBS -lsocket -lnsl" - echo $ac_n "checking for accept""... $ac_c" 1>&6 -echo "configure:1717: checking for accept" >&5 -if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthread" + else + echo $ac_n "checking for pthread_mutex_init in -lpthreads""... $ac_c" 1>&6 +echo "configure:1606: checking for pthread_mutex_init in -lpthreads" >&5 +ac_lib_var=`echo pthreads'_'pthread_mutex_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char accept(); +char pthread_mutex_init(); int main() { - -/* 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_accept) || defined (__stub___accept) -choke me -#else -accept(); -#endif - +pthread_mutex_init() ; return 0; } EOF -if { (eval echo configure:1745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_func_accept=yes" + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_accept=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -fi +LIBS="$ac_save_LIBS" -if eval "test \"`echo '$ac_cv_func_'accept`\" = yes"; then +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - tcl_checkNsl=0 + tcl_ok=yes else echo "$ac_t""no" 1>&6 -LIBS=$tk_oldLibs +tcl_ok=no fi - fi - echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1767: checking for gethostbyname" >&5 -if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthreads" + else + echo $ac_n "checking for pthread_mutex_init in -lc""... $ac_c" 1>&6 +echo "configure:1651: checking for pthread_mutex_init in -lc" >&5 +ac_lib_var=`echo c'_'pthread_mutex_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char gethostbyname(); +char pthread_mutex_init(); int main() { - -/* 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_gethostbyname) || defined (__stub___gethostbyname) -choke me -#else -gethostbyname(); -#endif - +pthread_mutex_init() ; return 0; } EOF -if { (eval echo configure:1795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_func_gethostbyname=yes" + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_gethostbyname=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -fi +LIBS="$ac_save_LIBS" -if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - : + tcl_ok=yes else echo "$ac_t""no" 1>&6 -echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1813: checking for gethostbyname in -lnsl" >&5 -ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` +tcl_ok=no +fi + + if test "$tcl_ok" = "no"; then + echo $ac_n "checking for pthread_mutex_init in -lc_r""... $ac_c" 1>&6 +echo "configure:1693: checking for pthread_mutex_init in -lc_r" >&5 +ac_lib_var=`echo c_r'_'pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lnsl $LIBS" +LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1843,370 +1723,224 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lnsl" + tcl_ok=yes else echo "$ac_t""no" 1>&6 +tcl_ok=no fi -fi - - - # Don't perform the eval of the libraries here because DL_LIBS - # won't be set until we call SC_CONFIG_CFLAGS - - TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' - - - - -# Add the threads support libraries -LIBS="$LIBS$THREADS_LIBS" + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -pthread" + else + TCL_THREADS=0 + echo "configure: warning: "Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..."" 1>&2 + fi + fi + fi + fi + # Does the pthread-implementation provide + # 'pthread_attr_setstacksize' ? - echo $ac_n "checking how to build libraries""... $ac_c" 1>&6 -echo "configure:1868: checking how to build libraries" >&5 - # Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval -else - tcl_ok=yes -fi + ac_saved_libs=$LIBS + LIBS="$LIBS $THREADS_LIBS" + for ac_func in pthread_attr_setstacksize +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1752: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); +int main() { - if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval - else - tcl_ok=yes - fi +/* 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 +$ac_func(); +#endif - if test "$tcl_ok" = "yes" ; then - echo "$ac_t""shared" 1>&6 - SHARED_BUILD=1 - else - echo "$ac_t""static" 1>&6 - SHARED_BUILD=0 - cat >> confdefs.h <<\EOF -#define STATIC_BUILD 1 +; return 0; } EOF - - fi - - -#-------------------------------------------------------------------- -# The statements below define a collection of compile flags. This -# macro depends on the value of SHARED_BUILD, and should be called -# after SC_ENABLE_SHARED checks the configure switches. -#-------------------------------------------------------------------- - -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1907: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +if { (eval echo configure:1780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" fi +rm -f conftest* fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 fi +done + for ac_func in pthread_atfork +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1807: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); +int main() { - # Step 0.a: Enable 64 bit support? +/* 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 +$ac_func(); +#endif - echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6 -echo "configure:1939: checking if 64bit support is requested" >&5 - # Check whether --enable-64bit or --disable-64bit was given. -if test "${enable_64bit+set}" = set; then - enableval="$enable_64bit" - : +; return 0; } +EOF +if { (eval echo configure:1835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" else - enableval="no" + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* fi - - if test "$enableval" = "yes"; then - do64bit=yes - else - do64bit=no - fi - echo "$ac_t""$do64bit" 1>&6 - - # Step 0.b: Enable Solaris 64 bit VIS support? - - echo $ac_n "checking if 64bit Sparc VIS support is requested""... $ac_c" 1>&6 -echo "configure:1959: checking if 64bit Sparc VIS support is requested" >&5 - # Check whether --enable-64bit-vis or --disable-64bit-vis was given. -if test "${enable_64bit_vis+set}" = set; then - enableval="$enable_64bit_vis" - : +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 fi +done - - if test "$enableval" = "yes"; then - # Force 64bit on with VIS - do64bit=yes - do64bitVIS=yes + LIBS=$ac_saved_libs else - do64bitVIS=no + TCL_THREADS=0 + echo "$ac_t""no (default)" 1>&6 fi - echo "$ac_t""$do64bitVIS" 1>&6 + - # Step 1: set the variable "system" to hold the name and version number - # for the system. This can usually be done via the "uname" command, but - # there are a few systems, like Next, where this doesn't work. - echo $ac_n "checking system version (for dynamic loading)""... $ac_c" 1>&6 -echo "configure:1983: checking system version (for dynamic loading)" >&5 - if test -f /usr/lib/NextStep/software_version; then - system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` - else - system=`uname -s`-`uname -r` - if test "$?" -ne 0 ; then - echo "$ac_t""unknown (can't find uname command)" 1>&6 - system=unknown - else - # Special check for weird MP-RAS system (uname returns weird - # results, and the version is kept in special file). - - if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then - system=MP-RAS-`awk '{print }' /etc/.relid'` - fi - if test "`uname -s`" = "AIX" ; then - system=AIX-`uname -v`.`uname -r` - fi - echo "$ac_t""$system" 1>&6 - fi - fi +#-------------------------------------------------------------------- +# Look for libraries that we will need when compiling the Tcl shell +#-------------------------------------------------------------------- - # Step 2: check for existence of -ldl library. This is needed because - # Linux can use either -ldl or -ldld for dynamic loading. - echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2009: checking for dlopen in -ldl" >&5 -ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + #-------------------------------------------------------------------- + # On a few very rare systems, all of the libm.a stuff is + # already in libc.a. Set compiler flags accordingly. + # Also, Linux requires the "ieee" library for math to work + # right (and it must appear before "-lm"). + #-------------------------------------------------------------------- + + echo $ac_n "checking for sin""... $ac_c" 1>&6 +echo "configure:1880: checking for sin" >&5 +if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-ldl $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char dlopen(); +char sin(); int main() { -dlopen() + +/* 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_sin) || defined (__stub___sin) +choke me +#else +sin(); +#endif + ; return 0; } EOF -if { (eval echo configure:2028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_func_sin=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_func_sin=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then echo "$ac_t""yes" 1>&6 - have_dl=yes + MATH_LIBS="" else echo "$ac_t""no" 1>&6 -have_dl=no +MATH_LIBS="-lm" fi - - # Require ranlib early so we can override it in special cases below. - - - - # Step 3: set configuration options based on system name and version. - - do64bit_ok=no - LDFLAGS_ORIG="$LDFLAGS" - TCL_EXPORT_FILE_SUFFIX="" - UNSHARED_LIB_SUFFIX="" - TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`' - ECHO_VERSION='`echo ${VERSION}`' - TCL_LIB_VERSIONS_OK=ok - CFLAGS_DEBUG=-g - CFLAGS_OPTIMIZE=-O - if test "$GCC" = "yes" ; then - CFLAGS_WARNING="-Wall -Wno-implicit-int -fno-strict-aliasing" - else - CFLAGS_WARNING="" - fi - TCL_NEEDS_EXP_FILE=0 - TCL_BUILD_EXP_FILE="" - TCL_EXP_FILE="" - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2076: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AR="ar" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -AR="$ac_cv_prog_AR" -if test -n "$AR"; then - echo "$ac_t""$AR" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test "${AR}" = "" ; then - { echo "configure: error: Required archive tool 'ar' not found on PATH." 1>&2; exit 1; } - fi - STLIB_LD='${AR} cr' - LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" - PLAT_OBJS="" - PLAT_SRCS="" - case $system in - AIX-*) - if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then - # AIX requires the _r compiler when gcc isn't being used - case "${CC}" in - *_r) - # ok ... - ;; - *) - CC=${CC}_r - ;; - esac - echo "$ac_t""Using $CC for compiling with threads" 1>&6 - fi - LIBS="$LIBS -lc" - SHLIB_CFLAGS="" - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - DL_OBJS="tclLoadDl.o" - LD_LIBRARY_PATH_VAR="LIBPATH" - - # Check to enable 64-bit flags for compiler/linker on AIX 4+ - if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then - if test "$GCC" = "yes" ; then - echo "configure: warning: 64bit mode not supported with GCC on $system" 1>&2 - else - do64bit_ok=yes - CFLAGS="$CFLAGS -q64" - LDFLAGS="$LDFLAGS -q64" - RANLIB="${RANLIB} -X64" - AR="${AR} -X64" - SHLIB_LD_FLAGS="-b64" - fi - fi - - if test "`uname -m`" = "ia64" ; then - # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - # AIX-5 has dl* in libc.so - DL_LIBS="" - if test "$GCC" = "yes" ; then - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - else - CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' - fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - else - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - else - SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" - fi - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' - fi - - # AIX v<=4.1 has some different flags than 4.2+ - if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then - LIBOBJS="$LIBOBJS tclLoadAix.o" - DL_LIBS="-lld" - fi - - # On AIX <=v4 systems, libbsd.a has to be linked in to support - # non-blocking file IO. This library has to be linked in after - # the MATH_LIBS or it breaks the pow() function. The way to - # insure proper sequencing, is to add it to the tail of MATH_LIBS. - # This library also supplies gettimeofday. - # - # AIX does not have a timezone field in struct tm. When the AIX - # bsd library is used, the timezone global and the gettimeofday - # methods are to be avoided for timezone deduction instead, we - # deduce the timezone by comparing the localtime result on a - # known GMT value. - - echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6 -echo "configure:2191: checking for gettimeofday in -lbsd" >&5 -ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lbsd $LIBS" -cat > conftest.$ac_ext <&6 +echo "configure:1929: checking for main in -lieee" >&5 +ac_lib_var=`echo ieee'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lieee $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2221,54 +1955,34 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - libbsd=yes + MATH_LIBS="-lieee $MATH_LIBS" else echo "$ac_t""no" 1>&6 -libbsd=no fi - if test $libbsd = yes; then - MATH_LIBS="$MATH_LIBS -lbsd" - cat >> confdefs.h <<\EOF -#define USE_DELTA_FOR_TZ 1 -EOF - fi - ;; - BeOS*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="${CC} -nostart" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" + #-------------------------------------------------------------------- + # Interactive UNIX requires -linet instead of -lsocket, plus it + # needs net/errno.h to define the socket-related error codes. + #-------------------------------------------------------------------- - #----------------------------------------------------------- - # Check for inet_ntoa in -lbind, for BeOS (which also needs - # -lsocket, even if the network functions are in -lnet which - # is always linked to, for compatibility. - #----------------------------------------------------------- - echo $ac_n "checking for inet_ntoa in -lbind""... $ac_c" 1>&6 -echo "configure:2253: checking for inet_ntoa in -lbind" >&5 -ac_lib_var=`echo bind'_'inet_ntoa | sed 'y%./+-%__p_%'` + echo $ac_n "checking for main in -linet""... $ac_c" 1>&6 +echo "configure:1971: checking for main in -linet" >&5 +ac_lib_var=`echo inet'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lbind $LIBS" +LIBS="-linet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2283,1848 +1997,1672 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lbind -lsocket" + LIBS="$LIBS -linet" else echo "$ac_t""no" 1>&6 fi - ;; - BSD/OS-2.1*|BSD/OS-3*) - SHLIB_CFLAGS="" - SHLIB_LD="shlicc -r" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - BSD/OS-4.*) - SHLIB_CFLAGS="-export-dynamic -fPIC" - SHLIB_LD="cc -shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - dgux*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - HP-UX-*.11.*) - # Use updated header definitions where possible - cat >> confdefs.h <<\EOF -#define _XOPEN_SOURCE 1 -EOF - # Use the XOPEN network library - cat >> confdefs.h <<\EOF -#define _XOPEN_SOURCE_EXTENDED 1 -EOF - # Use the XOPEN network library - LIBS="$LIBS -lxnet" # Use the XOPEN network library - - SHLIB_SUFFIX=".sl" - echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:2338: checking for shl_load in -ldld" >&5 -ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + ac_safe=`echo "net/errno.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for net/errno.h""... $ac_c" 1>&6 +echo "configure:2008: checking for net/errno.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-ldld $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < EOF -if { (eval echo configure:2357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2018: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - tcl_ok=yes + cat >> confdefs.h <<\EOF +#define HAVE_NET_ERRNO_H 1 +EOF + else echo "$ac_t""no" 1>&6 -tcl_ok=no fi - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS='${LIBS}' - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - SHLIB_LD_LIBS='${LIBS}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc - #CFLAGS="$CFLAGS +DAportable" + #-------------------------------------------------------------------- + # Check for the existence of the -lsocket and -lnsl libraries. + # The order here is important, so that they end up in the right + # order in the command line generated by make. Here are some + # special considerations: + # 1. Use "connect" and "accept" to check for -lsocket, and + # "gethostbyname" to check for -lnsl. + # 2. Use each function name only once: can't redo a check because + # autoconf caches the results of the last check and won't redo it. + # 3. Use -lnsl and -lsocket only if they supply procedures that + # aren't already present in the normal libraries. This is because + # IRIX 5.2 has libraries, but they aren't needed and they're + # bogus: they goof up name resolution if used. + # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. + # To get around this problem, check for both libraries together + # if -lsocket doesn't work by itself. + #-------------------------------------------------------------------- - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - hpux_arch=`gcc -dumpmachine` - case $hpux_arch in - hppa64*) - # 64-bit gcc in use. Fix flags for GNU ld. - do64bit_ok=yes - SHLIB_LD="gcc -shared" - SHLIB_LD_LIBS='${LIBS}' - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ;; - *) - echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2 - ;; - esac - else - do64bit_ok=yes - CFLAGS="$CFLAGS +DD64" - LDFLAGS="$LDFLAGS +DD64" - fi - fi - ;; - HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) - SHLIB_SUFFIX=".sl" - echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:2425: checking for shl_load in -ldld" >&5 -ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + tcl_checkBoth=0 + echo $ac_n "checking for connect""... $ac_c" 1>&6 +echo "configure:2063: checking for connect" >&5 +if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-ldld $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char shl_load(); +char connect(); int main() { -shl_load() + +/* 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_connect) || defined (__stub___connect) +choke me +#else +connect(); +#endif + ; return 0; } EOF -if { (eval echo configure:2444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_func_connect=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_func_connect=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then echo "$ac_t""yes" 1>&6 - tcl_ok=yes + tcl_checkSocket=0 else echo "$ac_t""no" 1>&6 -tcl_ok=no +tcl_checkSocket=1 fi - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS="" - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - ;; - IRIX-4.*) - SHLIB_CFLAGS="-G 0" - SHLIB_SUFFIX=".a" - SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" - SHLIB_LD_LIBS='${LIBS}' - DL_OBJS="tclLoadAout.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS -Wl,-D,08000000" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' - ;; - IRIX-5.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - ;; - IRIX-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mabi=n32" - LDFLAGS="$LDFLAGS -mabi=n32" - else - case $system in - IRIX-6.3) - # Use to build 6.2 compatible binaries on 6.3. - CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" - ;; - *) - CFLAGS="$CFLAGS -n32" - ;; - esac - LDFLAGS="$LDFLAGS -n32" - fi - ;; - IRIX64-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - - # Check to enable 64-bit flags for compiler/linker - - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - echo "configure: warning: 64bit mode not supported by gcc" 1>&2 - else - do64bit_ok=yes - SHLIB_LD="ld -64 -shared -rdata_shared" - CFLAGS="$CFLAGS -64" - LDFLAGS="$LDFLAGS -64" - fi - fi - ;; - Linux*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - CFLAGS_OPTIMIZE=-O2 - # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings - # when you inline the string and math operations. Turn this off to - # get rid of the warnings. - #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" - - if test "$have_dl" = yes; then - SHLIB_LD="${CC} -shared" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - else - ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for dld.h""... $ac_c" 1>&6 -echo "configure:2568: checking for dld.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + if test "$tcl_checkSocket" = 1; then + echo $ac_n "checking for setsockopt""... $ac_c" 1>&6 +echo "configure:2113: checking for setsockopt" >&5 +if eval "test \"`echo '$''{'ac_cv_func_setsockopt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char setsockopt(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setsockopt(); + +int main() { + +/* 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_setsockopt) || defined (__stub___setsockopt) +choke me +#else +setsockopt(); +#endif + +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if { (eval echo configure:2141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_func_setsockopt=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "ac_cv_func_setsockopt=no" fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'setsockopt`\" = yes"; then echo "$ac_t""yes" 1>&6 - - SHLIB_LD="ld -shared" - DL_OBJS="tclLoadDld.o" - DL_LIBS="-ldld" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" + : else echo "$ac_t""no" 1>&6 -fi - - fi - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - - # The combo of gcc + glibc has a bug related - # to inlining of functions like strtod(). The - # -fno-builtin flag should address this problem - # but it does not work. The -fno-inline flag - # is kind of overkill but it works. - # Disable inlining only when one of the - # files in compat/*.c is being linked in. - if test x"${LIBOBJS}" != x ; then - CFLAGS="$CFLAGS -fno-inline" - fi +echo $ac_n "checking for setsockopt in -lsocket""... $ac_c" 1>&6 +echo "configure:2159: checking for setsockopt in -lsocket" >&5 +ac_lib_var=`echo socket'_'setsockopt | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsocket $LIBS" +cat > conftest.$ac_ext <> confdefs.h <<\EOF -#define PEEK_XCLOSEIM 1 +int main() { +setsockopt() +; return 0; } EOF +if { (eval echo configure:2178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lsocket" +else + echo "$ac_t""no" 1>&6 +tcl_checkBoth=1 +fi - ;; - GNU*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" +fi - if test "$have_dl" = yes; then - SHLIB_LD="${CC} -shared" - DL_OBJS="" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - else - ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for dld.h""... $ac_c" 1>&6 -echo "configure:2642: checking for dld.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + fi + if test "$tcl_checkBoth" = 1; then + tk_oldLibs=$LIBS + LIBS="$LIBS -lsocket -lnsl" + echo $ac_n "checking for accept""... $ac_c" 1>&6 +echo "configure:2206: checking for accept" >&5 +if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char accept(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char accept(); + +int main() { + +/* 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_accept) || defined (__stub___accept) +choke me +#else +accept(); +#endif + +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if { (eval echo configure:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_func_accept=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "ac_cv_func_accept=no" fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'accept`\" = yes"; then echo "$ac_t""yes" 1>&6 - - SHLIB_LD="ld -shared" - DL_OBJS="" - DL_LIBS="-ldld" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" + tcl_checkNsl=0 else echo "$ac_t""no" 1>&6 +LIBS=$tk_oldLibs fi - fi - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - ;; - Lynx*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - CFLAGS_OPTIMIZE=-02 - SHLIB_LD="${CC} -shared " - DL_OBJS="tclLoadDl.o" - DL_LIBS="-mshared -ldl" - LD_FLAGS="-Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - ;; - MP-RAS-02*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - MP-RAS-*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,-Bexport" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - NetBSD-*|FreeBSD-[1-2].*) - # Not available on all versions: check for include file. - ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:2720: checking for dlfcn.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + fi + echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 +echo "configure:2256: checking for gethostbyname" >&5 +if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname(); + +int main() { + +/* 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_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +gethostbyname(); +#endif + +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if { (eval echo configure:2284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_func_gethostbyname=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "ac_cv_func_gethostbyname=no" fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then echo "$ac_t""yes" 1>&6 - - # NetBSD/SPARC needs -fPIC, -fpic will not do. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - echo $ac_n "checking for ELF""... $ac_c" 1>&6 -echo "configure:2757: checking for ELF" >&5 - cat > conftest.$ac_ext <&6 +echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 +echo "configure:2302: checking for gethostbyname in -lnsl" >&5 +ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnsl $LIBS" +cat > conftest.$ac_ext <&5 | - egrep "yes" >/dev/null 2>&1; then +if { (eval echo configure:2321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - echo "$ac_t""yes" 1>&6 - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* - echo "$ac_t""no" 1>&6 - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' - + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* +LIBS="$ac_save_LIBS" - +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lnsl" else echo "$ac_t""no" 1>&6 +fi - SHLIB_CFLAGS="" - SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".a" - DL_OBJS="tclLoadAout.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' - fi + + # Don't perform the eval of the libraries here because DL_LIBS + # won't be set until we call SC_CONFIG_CFLAGS - # FreeBSD doesn't handle version numbers with dots. + TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' + + - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - OpenBSD-*) - case `arch -s` in - m88k|vax) - SHLIB_CFLAGS="" - SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".a" - DL_OBJS="tclLoadAout.o" - DL_LIBS="" - LDFLAGS="" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' - ;; - *) - # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. - case `machine` in - sparc|sparc64) - SHLIB_CFLAGS="-fPIC";; - *) - SHLIB_CFLAGS="-fpic";; - esac - SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' - echo $ac_n "checking for ELF""... $ac_c" 1>&6 -echo "configure:2833: checking for ELF" >&5 - cat > conftest.$ac_ext <&6 +echo "configure:2357: checking how to build libraries" >&5 + # Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval +else + tcl_ok=yes +fi + + + if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" ; then + echo "$ac_t""shared" 1>&6 + SHARED_BUILD=1 + else + echo "$ac_t""static" 1>&6 + SHARED_BUILD=0 + cat >> confdefs.h <<\EOF +#define STATIC_BUILD 1 EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "yes" >/dev/null 2>&1; then - rm -rf conftest* - echo "$ac_t""yes" 1>&6 - LDFLAGS=-Wl,-export-dynamic + + fi + + +#-------------------------------------------------------------------- +# The statements below define a collection of compile flags. This +# macro depends on the value of SHARED_BUILD, and should be called +# after SC_ENABLE_SHARED checks the configure switches. +#-------------------------------------------------------------------- + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2396: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 else - rm -rf conftest* echo "$ac_t""no" 1>&6 - LDFLAGS="" - fi -rm -f conftest* - ;; - esac - # OpenBSD doesn't do version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - FreeBSD-*) - # FreeBSD 3.* and greater have ELF. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "${TCL_THREADS}" = "1" ; then - # The -pthread needs to go in the CFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" + + # Step 0.a: Enable 64 bit support? + + echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6 +echo "configure:2428: checking if 64bit support is requested" >&5 + # Check whether --enable-64bit or --disable-64bit was given. +if test "${enable_64bit+set}" = set; then + enableval="$enable_64bit" + : +else + enableval="no" +fi + + + if test "$enableval" = "yes"; then + do64bit=yes + else + do64bit=no + fi + echo "$ac_t""$do64bit" 1>&6 + + # Step 0.b: Enable Solaris 64 bit VIS support? + + echo $ac_n "checking if 64bit Sparc VIS support is requested""... $ac_c" 1>&6 +echo "configure:2448: checking if 64bit Sparc VIS support is requested" >&5 + # Check whether --enable-64bit-vis or --disable-64bit-vis was given. +if test "${enable_64bit_vis+set}" = set; then + enableval="$enable_64bit_vis" + : +else + enableval="no" +fi + + + if test "$enableval" = "yes"; then + # Force 64bit on with VIS + do64bit=yes + do64bitVIS=yes + else + do64bitVIS=no + fi + echo "$ac_t""$do64bitVIS" 1>&6 + + # Step 1: set the variable "system" to hold the name and version number + # for the system. This can usually be done via the "uname" command, but + # there are a few systems, like Next, where this doesn't work. + + echo $ac_n "checking system version (for dynamic loading)""... $ac_c" 1>&6 +echo "configure:2472: checking system version (for dynamic loading)" >&5 + if test -f /usr/lib/NextStep/software_version; then + system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` + else + system=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + echo "$ac_t""unknown (can't find uname command)" 1>&6 + system=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + system=MP-RAS-`awk '{print }' /etc/.relid'` fi - case $system in - FreeBSD-3.*) - # FreeBSD-3 doesn't handle version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' - TCL_LIB_VERSIONS_OK=nodots - ;; - esac - ;; - Darwin-*) - CFLAGS_OPTIMIZE="-Os" - SHLIB_CFLAGS="-fno-common" - SHLIB_LD="cc -dynamiclib \${LDFLAGS}" - echo $ac_n "checking if ld accepts -single_module flag""... $ac_c" 1>&6 -echo "configure:2894: checking if ld accepts -single_module flag" >&5 -if eval "test \"`echo '$''{'tcl_cv_ld_single_module'+set}'`\" = set"; then + if test "`uname -s`" = "AIX" ; then + system=AIX-`uname -v`.`uname -r` + fi + echo "$ac_t""$system" 1>&6 + fi + fi + + # Step 2: check for existence of -ldl library. This is needed because + # Linux can use either -ldl or -ldld for dynamic loading. + + echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 +echo "configure:2498: checking for dlopen in -ldl" >&5 +ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" - cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - tcl_cv_ld_single_module=yes + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - tcl_cv_ld_single_module=no + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* - LDFLAGS=$hold_ldflags +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_dl=yes +else + echo "$ac_t""no" 1>&6 +have_dl=no fi -echo "$ac_t""$tcl_cv_ld_single_module" 1>&6 - if test $tcl_cv_ld_single_module = yes; then - SHLIB_LD="${SHLIB_LD} -Wl,-single_module" + + # Require ranlib early so we can override it in special cases below. + + + + # Step 3: set configuration options based on system name and version. + + do64bit_ok=no + LDFLAGS_ORIG="$LDFLAGS" + TCL_EXPORT_FILE_SUFFIX="" + UNSHARED_LIB_SUFFIX="" + TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`' + ECHO_VERSION='`echo ${VERSION}`' + TCL_LIB_VERSIONS_OK=ok + CFLAGS_DEBUG=-g + CFLAGS_OPTIMIZE=-O + if test "$GCC" = "yes" ; then + CFLAGS_WARNING="-Wall -Wno-implicit-int -fno-strict-aliasing" + else + CFLAGS_WARNING="" + fi + TCL_NEEDS_EXP_FILE=0 + TCL_BUILD_EXP_FILE="" + TCL_EXP_FILE="" + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2565: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="ar" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test "${AR}" = "" ; then + { echo "configure: error: Required archive tool 'ar' not found on PATH." 1>&2; exit 1; } + fi + STLIB_LD='${AR} cr' + LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" + PLAT_OBJS="" + PLAT_SRCS="" + case $system in + AIX-*) + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then + # AIX requires the _r compiler when gcc isn't being used + case "${CC}" in + *_r) + # ok ... + ;; + *) + CC=${CC}_r + ;; + esac + echo "$ac_t""Using $CC for compiling with threads" 1>&6 fi + LIBS="$LIBS -lc" + SHLIB_CFLAGS="" + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dylib" - DL_OBJS="tclLoadDyld.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS -prebind -headerpad_max_install_names" - echo $ac_n "checking if ld accepts -search_paths_first flag""... $ac_c" 1>&6 -echo "configure:2932: checking if ld accepts -search_paths_first flag" >&5 -if eval "test \"`echo '$''{'tcl_cv_ld_search_paths_first'+set}'`\" = set"; then + SHLIB_SUFFIX=".so" + + DL_OBJS="tclLoadDl.o" + LD_LIBRARY_PATH_VAR="LIBPATH" + + # Check to enable 64-bit flags for compiler/linker on AIX 4+ + if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then + if test "$GCC" = "yes" ; then + echo "configure: warning: 64bit mode not supported with GCC on $system" 1>&2 + else + do64bit_ok=yes + CFLAGS="$CFLAGS -q64" + LDFLAGS="$LDFLAGS -q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + fi + fi + + if test "`uname -m`" = "ia64" ; then + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = "yes" ; then + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + else + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + else + SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + fi + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' + fi + + # AIX v<=4.1 has some different flags than 4.2+ + if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then + LIBOBJS="$LIBOBJS tclLoadAix.o" + DL_LIBS="-lld" + fi + + # On AIX <=v4 systems, libbsd.a has to be linked in to support + # non-blocking file IO. This library has to be linked in after + # the MATH_LIBS or it breaks the pow() function. The way to + # insure proper sequencing, is to add it to the tail of MATH_LIBS. + # This library also supplies gettimeofday. + # + # AIX does not have a timezone field in struct tm. When the AIX + # bsd library is used, the timezone global and the gettimeofday + # methods are to be avoided for timezone deduction instead, we + # deduce the timezone by comparing the localtime result on a + # known GMT value. + + echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6 +echo "configure:2680: checking for gettimeofday in -lbsd" >&5 +ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - tcl_cv_ld_search_paths_first=yes + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - tcl_cv_ld_search_paths_first=no + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* - LDFLAGS=$hold_ldflags -fi +LIBS="$ac_save_LIBS" -echo "$ac_t""$tcl_cv_ld_search_paths_first" 1>&6 - if test $tcl_cv_ld_search_paths_first = yes; then - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" - PLAT_OBJS=\$\(MAC\_OSX_OBJS\) - PLAT_SRCS=\$\(MAC\_OSX_SRCS\) - echo $ac_n "checking whether to use CoreFoundation""... $ac_c" 1>&6 -echo "configure:2970: checking whether to use CoreFoundation" >&5 - # Check whether --enable-corefoundation or --disable-corefoundation was given. -if test "${enable_corefoundation+set}" = set; then - enableval="$enable_corefoundation" - tcl_corefoundation=$enableval +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + libbsd=yes else - tcl_corefoundation=yes + echo "$ac_t""no" 1>&6 +libbsd=no fi - echo "$ac_t""$tcl_corefoundation" 1>&6 - if test $tcl_corefoundation = yes; then - echo $ac_n "checking for CoreFoundation.framework""... $ac_c" 1>&6 -echo "configure:2982: checking for CoreFoundation.framework" >&5 -if eval "test \"`echo '$''{'tcl_cv_lib_corefoundation'+set}'`\" = set"; then + if test $libbsd = yes; then + MATH_LIBS="$MATH_LIBS -lbsd" + cat >> confdefs.h <<\EOF +#define USE_DELTA_FOR_TZ 1 +EOF + + fi + ;; + BeOS*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="${CC} -nostart" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + + #----------------------------------------------------------- + # Check for inet_ntoa in -lbind, for BeOS (which also needs + # -lsocket, even if the network functions are in -lnet which + # is always linked to, for compatibility. + #----------------------------------------------------------- + echo $ac_n "checking for inet_ntoa in -lbind""... $ac_c" 1>&6 +echo "configure:2742: checking for inet_ntoa in -lbind" >&5 +ac_lib_var=`echo bind'_'inet_ntoa | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - - hold_libs=$LIBS - LIBS="$LIBS -framework CoreFoundation" - cat > conftest.$ac_ext < conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char inet_ntoa(); + int main() { -CFBundleRef b = CFBundleGetMainBundle(); +inet_ntoa() ; return 0; } EOF -if { (eval echo configure:2997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - tcl_cv_lib_corefoundation=yes + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - tcl_cv_lib_corefoundation=no + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* - LIBS=$hold_libs +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lbind -lsocket" +else + echo "$ac_t""no" 1>&6 fi -echo "$ac_t""$tcl_cv_lib_corefoundation" 1>&6 - if test $tcl_cv_lib_corefoundation = yes; then - LIBS="$LIBS -framework CoreFoundation" - cat >> confdefs.h <<\EOF -#define HAVE_COREFOUNDATION 1 -EOF - - fi - fi - for ac_hdr in libkern/OSAtomic.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3023: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < + ;; + BSD/OS-2.1*|BSD/OS-3*) + SHLIB_CFLAGS="" + SHLIB_LD="shlicc -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + BSD/OS-4.*) + SHLIB_CFLAGS="-export-dynamic -fPIC" + SHLIB_LD="cc -shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + dgux*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + HP-UX-*.11.*) + # Use updated header definitions where possible + cat >> confdefs.h <<\EOF +#define _XOPEN_SOURCE 1 EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <> confdefs.h <<\EOF +#define _XOPEN_SOURCE_EXTENDED 1 EOF - -else - echo "$ac_t""no" 1>&6 -fi -done + # Use the XOPEN network library + LIBS="$LIBS -lxnet" # Use the XOPEN network library - for ac_func in OSSpinLockLock -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3062: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + SHLIB_SUFFIX=".sl" + echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 +echo "configure:2827: checking for shl_load in -ldld" >&5 +ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* 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(); +char shl_load(); int main() { - -/* 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 -$ac_func(); -#endif - +shl_load() ; return 0; } EOF -if { (eval echo configure:3090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -fi +LIBS="$ac_save_LIBS" -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 +tcl_ok=no fi -done - cat >> confdefs.h <<\EOF -#define MAC_OSX_TCL 1 -EOF - - cat >> confdefs.h <<\EOF -#define USE_VFORK 1 -EOF - - cat >> confdefs.h <<\EOF -#define TCL_DEFAULT_ENCODING "utf-8" -EOF + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS='${LIBS}' + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + SHLIB_LD_LIBS='${LIBS}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi - cat >> confdefs.h <<\EOF -#define TCL_LOAD_FROM_MEMORY 1 -EOF + # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc + #CFLAGS="$CFLAGS +DAportable" - # prior to Darwin 7, realpath is not threadsafe, so don't - # use it when threads are enabled, c.f. bug # 711232: - echo $ac_n "checking for realpath""... $ac_c" 1>&6 -echo "configure:3133: checking for realpath" >&5 -if eval "test \"`echo '$''{'ac_cv_func_realpath'+set}'`\" = set"; then + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + hpux_arch=`gcc -dumpmachine` + case $hpux_arch in + hppa64*) + # 64-bit gcc in use. Fix flags for GNU ld. + do64bit_ok=yes + SHLIB_LD="gcc -shared" + SHLIB_LD_LIBS='${LIBS}' + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ;; + *) + echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2 + ;; + esac + else + do64bit_ok=yes + CFLAGS="$CFLAGS +DD64" + LDFLAGS="$LDFLAGS +DD64" + fi + fi + ;; + HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) + SHLIB_SUFFIX=".sl" + echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 +echo "configure:2914: checking for shl_load in -ldld" >&5 +ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char realpath(); +char shl_load(); int main() { - -/* 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_realpath) || defined (__stub___realpath) -choke me -#else -realpath(); -#endif - +shl_load() ; return 0; } EOF -if { (eval echo configure:3161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_func_realpath=yes" + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_realpath=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -fi +LIBS="$ac_save_LIBS" -if eval "test \"`echo '$ac_cv_func_'realpath`\" = yes"; then +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - : + tcl_ok=yes else echo "$ac_t""no" 1>&6 +tcl_ok=no fi - 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 + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS="" + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi ;; - NEXTSTEP-*) - SHLIB_CFLAGS="" - SHLIB_LD="cc -nostdlib -r" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadNext.o" + IRIX-4.*) + SHLIB_CFLAGS="-G 0" + SHLIB_SUFFIX=".a" + SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" + SHLIB_LD_LIBS='${LIBS}' + DL_OBJS="tclLoadAout.o" DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" + LDFLAGS="$LDFLAGS -Wl,-D,08000000" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' ;; - OS/390-*) - CFLAGS_OPTIMIZE="" # Optimizer is buggy - cat >> confdefs.h <<\EOF -#define _OE_SOCKETS 1 -EOF - # needed in sys/socket.h - ;; - OSF1-1.0|OSF1-1.1|OSF1-1.2) - # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 + IRIX-5.*) SHLIB_CFLAGS="" - # Hack: make package name same as library name - SHLIB_LD='ld -R -export :' - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadOSF.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-1.*) - # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 - SHLIB_CFLAGS="-fPIC" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD="ld -shared" - else - SHLIB_LD="ld -non_shared" - fi - SHLIB_LD_LIBS="" + SHLIB_LD="ld -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' ;; - OSF1-V*) - # Digital OSF/1 + IRIX-6.*) SHLIB_CFLAGS="" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD='ld -shared -expect_unresolved "*"' - else - SHLIB_LD='ld -non_shared -expect_unresolved "*"' - fi - SHLIB_LD_LIBS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mieee" - else - CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" - fi - # see pthread_intro(3) for pthread support on osf1, k.furukawa - if test "${TCL_THREADS}" = "1" ; then - CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" - CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" - LIBS=`echo $LIBS | sed s/-lpthreads//` - if test "$GCC" = "yes" ; then - LIBS="$LIBS -lpthread -lmach -lexc" - else - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi + CFLAGS="$CFLAGS -mabi=n32" + LDFLAGS="$LDFLAGS -mabi=n32" + else + case $system in + IRIX-6.3) + # Use to build 6.2 compatible binaries on 6.3. + CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" + ;; + *) + CFLAGS="$CFLAGS -n32" + ;; + esac + LDFLAGS="$LDFLAGS -n32" fi - - ;; - QNX-6*) - # QNX RTP - # This may work for all QNX, but it was only reported for v6. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - # dlopen is in -lc on QNX - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" ;; - RISCos-*) - SHLIB_CFLAGS="-G 0" - SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" + IRIX64-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".a" - DL_OBJS="tclLoadAout.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS -Wl,-D,08000000" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ;; - SCO_SV-3.2*) - # Note, dlopen is available only on SCO 3.2.5 and greater. However, - # this test works, since "uname -s" was non-standard in 3.2.4 and - # below. - if test "$GCC" = "yes" ; then - SHLIB_CFLAGS="-fPIC -melf" - LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" - else - SHLIB_CFLAGS="-Kpic -belf" - LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" - fi - SHLIB_LD="ld -G" - SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SINIX*5.4*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SunOS-4*) - SHLIB_CFLAGS="-PIC" - SHLIB_LD="ld" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - # SunOS can't handle version numbers with dots in them in library - # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it - # requires an extra version number at the end of .so file names. - # So, the library has to have a name like libtcl75.so.1.0 + # Check to enable 64-bit flags for compiler/linker - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' - TCL_LIB_VERSIONS_OK=nodots + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + echo "configure: warning: 64bit mode not supported by gcc" 1>&2 + else + do64bit_ok=yes + SHLIB_LD="ld -64 -shared -rdata_shared" + CFLAGS="$CFLAGS -64" + LDFLAGS="$LDFLAGS -64" + fi + fi ;; - SunOS-5.[0-6]) - # Careful to not let 5.10+ fall into this case - - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - cat >> confdefs.h <<\EOF -#define _REENTRANT 1 -EOF - - cat >> confdefs.h <<\EOF -#define _POSIX_PTHREAD_SEMANTICS 1 -EOF - - - SHLIB_CFLAGS="-KPIC" - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - + Linux*) + SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + + CFLAGS_OPTIMIZE=-O2 + # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings + # when you inline the string and math operations. Turn this off to + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + + if test "$have_dl" = yes; then + SHLIB_LD="${CC} -shared" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for dld.h""... $ac_c" 1>&6 +echo "configure:3057: checking for dld.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3067: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + SHLIB_LD="ld -shared" + DL_OBJS="tclLoadDld.o" + DL_LIBS="-ldld" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" +else + echo "$ac_t""no" 1>&6 +fi + + fi + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" fi - ;; - SunOS-5*) - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - cat >> confdefs.h <<\EOF -#define _REENTRANT 1 -EOF + # The combo of gcc + glibc has a bug related + # to inlining of functions like strtod(). The + # -fno-builtin flag should address this problem + # but it does not work. The -fno-inline flag + # is kind of overkill but it works. + # Disable inlining only when one of the + # files in compat/*.c is being linked in. + if test x"${LIBOBJS}" != x ; then + CFLAGS="$CFLAGS -fno-inline" + fi + # XIM peeking works under XFree86. cat >> confdefs.h <<\EOF -#define _POSIX_PTHREAD_SEMANTICS 1 +#define PEEK_XCLOSEIM 1 EOF - SHLIB_CFLAGS="-KPIC" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - arch=`isainfo` - if test "$arch" = "sparcv9 sparc" ; then - if test "$GCC" = "yes" ; then - if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then - echo "configure: warning: 64bit mode not supported with GCC < 3.2 on $system" 1>&2 - else - do64bit_ok=yes - CFLAGS="$CFLAGS -m64 -mcpu=v9" - LDFLAGS="$LDFLAGS -m64 -mcpu=v9" - SHLIB_CFLAGS="-fPIC" - fi - else - do64bit_ok=yes - if test "$do64bitVIS" = "yes" ; then - CFLAGS="$CFLAGS -xarch=v9a" - LDFLAGS="$LDFLAGS -xarch=v9a" - else - CFLAGS="$CFLAGS -xarch=v9" - LDFLAGS="$LDFLAGS -xarch=v9" - fi - # Solaris 64 uses this as well - #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" - fi - elif test "$arch" = "amd64 i386" ; then - if test "$GCC" = "yes" ; then - echo "configure: warning: 64bit mode not supported with GCC on $system" 1>&2 - else - do64bit_ok=yes - CFLAGS="$CFLAGS -xarch=amd64" - LDFLAGS="$LDFLAGS -xarch=amd64" - fi - else - echo "configure: warning: 64bit mode not supported for $arch" 1>&2 - fi - fi - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - + ;; + GNU*) + SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$do64bit_ok" = "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 + + if test "$have_dl" = yes; then + SHLIB_LD="${CC} -shared" + DL_OBJS="" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for dld.h""... $ac_c" 1>&6 +echo "configure:3131: checking for dld.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + SHLIB_LD="ld -shared" + DL_OBJS="" + DL_LIBS="-ldld" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" +else + echo "$ac_t""no" 1>&6 +fi + + fi + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" fi ;; - ULTRIX-4.*) - SHLIB_CFLAGS="-G 0" - SHLIB_SUFFIX=".a" - SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" + Lynx*) + SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' - DL_OBJS="tclLoadAout.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS -Wl,-D,08000000" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$GCC" != "yes" ; then - CFLAGS="$CFLAGS -DHAVE_TZSET -std1" - fi + SHLIB_SUFFIX=".so" + CFLAGS_OPTIMIZE=-02 + SHLIB_LD="${CC} -shared " + DL_OBJS="tclLoadDl.o" + DL_LIBS="-mshared -ldl" + LD_FLAGS="-Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' ;; - UNIX_SV* | UnixWare-5*) - SHLIB_CFLAGS="-KPIC" + MP-RAS-02*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + MP-RAS-*) + SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers - # that don't grok the -Bexport option. Test that it does. - hold_ldflags=$LDFLAGS - echo $ac_n "checking for ld accepts -Bexport flag""... $ac_c" 1>&6 -echo "configure:3472: checking for ld accepts -Bexport flag" >&5 LDFLAGS="$LDFLAGS -Wl,-Bexport" - cat > conftest.$ac_ext <&6 +echo "configure:3209: checking for dlfcn.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < EOF -if { (eval echo configure:3482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - found=yes + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - LDFLAGS=$hold_ldflags found=no + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* - echo "$ac_t""$found" 1>&6 - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - esac - - if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then - echo "configure: warning: 64bit support being disabled -- don't know magic for this platform" 1>&2 - fi - - # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic - # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop, - # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need - # to determine which of several header files defines the a.out file - # format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we - # support only a file format that is more or less version-7-compatible. - # In particular, - # - a.out files must begin with `struct exec'. - # - the N_TXTOFF on the `struct exec' must compute the seek address - # of the text segment - # - The `struct exec' must contain a_magic, a_text, a_data, a_bss - # and a_entry fields. - # The following compilation should succeed if and only if either sys/exec.h - # or a.out.h is usable for the purpose. - # - # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the - # `struct exec' includes a second header that contains information that - # duplicates the v7 fields that are needed. - - if test "x$DL_OBJS" = "xtclLoadAout.o" ; then - echo $ac_n "checking sys/exec.h""... $ac_c" 1>&6 -echo "configure:3523: checking sys/exec.h" >&5 - cat > conftest.$ac_ext <&6 + + # NetBSD/SPARC needs -fPIC, -fpic will not do. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + echo $ac_n "checking for ELF""... $ac_c" 1>&6 +echo "configure:3246: checking for ELF" >&5 + cat > conftest.$ac_ext < -int main() { - struct exec foo; - unsigned long seek; - int flag; -#if defined(__mips) || defined(mips) - seek = N_TXTOFF (foo.ex_f, foo.ex_o); -#else - seek = N_TXTOFF (foo); +#ifdef __ELF__ + yes #endif - flag = (foo.a_magic == OMAGIC); - return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; - -; return 0; } + EOF -if { (eval echo configure:3543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "yes" >/dev/null 2>&1; then rm -rf conftest* - tcl_ok=usable + echo "$ac_t""yes" 1>&6 + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* - tcl_ok=unusable + echo "$ac_t""no" 1>&6 + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' + fi rm -f conftest* - echo "$ac_t""$tcl_ok" 1>&6 - if test $tcl_ok = usable; then - cat >> confdefs.h <<\EOF -#define USE_SYS_EXEC_H 1 -EOF - else - echo $ac_n "checking a.out.h""... $ac_c" 1>&6 -echo "configure:3561: checking a.out.h" >&5 - cat > conftest.$ac_ext <&6 + + SHLIB_CFLAGS="" + SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".a" + DL_OBJS="tclLoadAout.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + +fi + + + # FreeBSD doesn't handle version numbers with dots. + + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + OpenBSD-*) + case `arch -s` in + m88k|vax) + SHLIB_CFLAGS="" + SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".a" + DL_OBJS="tclLoadAout.o" + DL_LIBS="" + LDFLAGS="" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + ;; + *) + # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. + case `machine` in + sparc|sparc64) + SHLIB_CFLAGS="-fPIC";; + *) + SHLIB_CFLAGS="-fpic";; + esac + SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' + echo $ac_n "checking for ELF""... $ac_c" 1>&6 +echo "configure:3322: checking for ELF" >&5 + cat > conftest.$ac_ext < -int main() { - struct exec foo; - unsigned long seek; - int flag; -#if defined(__mips) || defined(mips) - seek = N_TXTOFF (foo.ex_f, foo.ex_o); -#else - seek = N_TXTOFF (foo); +#ifdef __ELF__ + yes #endif - flag = (foo.a_magic == OMAGIC); - return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; - + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6 + LDFLAGS=-Wl,-export-dynamic +else + rm -rf conftest* + echo "$ac_t""no" 1>&6 + LDFLAGS="" + +fi +rm -f conftest* + + ;; + esac + + # OpenBSD doesn't do version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + FreeBSD-*) + # FreeBSD 3.* and greater have ELF. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "${TCL_THREADS}" = "1" ; then + # The -pthread needs to go in the CFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + case $system in + FreeBSD-3.*) + # FreeBSD-3 doesn't handle version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + TCL_LIB_VERSIONS_OK=nodots + ;; + esac + ;; + Darwin-*) + CFLAGS_OPTIMIZE="-Os" + SHLIB_CFLAGS="-fno-common" + if test $do64bit = yes; then + do64bit_ok=yes + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + fi + SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}' + echo $ac_n "checking if ld accepts -single_module flag""... $ac_c" 1>&6 +echo "configure:3387: checking if ld accepts -single_module flag" >&5 +if eval "test \"`echo '$''{'tcl_cv_ld_single_module'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - tcl_ok=usable + tcl_cv_ld_single_module=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - tcl_ok=unusable + tcl_cv_ld_single_module=no fi rm -f conftest* - echo "$ac_t""$tcl_ok" 1>&6 - if test $tcl_ok = usable; then - cat >> confdefs.h <<\EOF -#define USE_A_OUT_H 1 -EOF + LDFLAGS=$hold_ldflags +fi - else - echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6 -echo "configure:3599: checking sys/exec_aout.h" >&5 - cat > conftest.$ac_ext <&6 + if test $tcl_cv_ld_single_module = yes; then + SHLIB_LD="${SHLIB_LD} -Wl,-single_module" + fi + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dylib" + DL_OBJS="tclLoadDyld.o" + DL_LIBS="" + # 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" + echo $ac_n "checking if ld accepts -search_paths_first flag""... $ac_c" 1>&6 +echo "configure:3430: checking if ld accepts -search_paths_first flag" >&5 +if eval "test \"`echo '$''{'tcl_cv_ld_search_paths_first'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + cat > conftest.$ac_ext < -int main() { - struct exec foo; - unsigned long seek; - int flag; -#if defined(__mips) || defined(mips) - seek = N_TXTOFF (foo.ex_f, foo.ex_o); -#else - seek = N_TXTOFF (foo); -#endif - flag = (foo.a_midmag == OMAGIC); - return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; - +int main() { +int i; ; return 0; } EOF -if { (eval echo configure:3619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - tcl_ok=usable + tcl_cv_ld_search_paths_first=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - tcl_ok=unusable + tcl_cv_ld_search_paths_first=no fi rm -f conftest* - echo "$ac_t""$tcl_ok" 1>&6 - if test $tcl_ok = usable; then - cat >> confdefs.h <<\EOF -#define USE_SYS_EXEC_AOUT_H 1 -EOF + LDFLAGS=$hold_ldflags +fi - else - DL_OBJS="" - fi +echo "$ac_t""$tcl_cv_ld_search_paths_first" 1>&6 + if test $tcl_cv_ld_search_paths_first = yes; then + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi - fi - fi - - # Step 5: disable dynamic loading if requested via a command-line switch. + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" + PLAT_OBJS=\$\(MAC\_OSX_OBJS\) + PLAT_SRCS=\$\(MAC\_OSX_SRCS\) + echo $ac_n "checking whether to use CoreFoundation""... $ac_c" 1>&6 +echo "configure:3468: checking whether to use CoreFoundation" >&5 + # Check whether --enable-corefoundation or --disable-corefoundation was given. +if test "${enable_corefoundation+set}" = set; then + enableval="$enable_corefoundation" + tcl_corefoundation=$enableval +else + tcl_corefoundation=yes +fi - # Check whether --enable-load or --disable-load was given. -if test "${enable_load+set}" = set; then - enableval="$enable_load" - tcl_ok=$enableval + echo "$ac_t""$tcl_corefoundation" 1>&6 + if test $tcl_corefoundation = yes; then + echo $ac_n "checking for CoreFoundation.framework""... $ac_c" 1>&6 +echo "configure:3480: checking for CoreFoundation.framework" >&5 +if eval "test \"`echo '$''{'tcl_cv_lib_corefoundation'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - tcl_ok=yes + + 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" + cat > conftest.$ac_ext < +int main() { +CFBundleRef b = CFBundleGetMainBundle(); +; return 0; } +EOF +if { (eval echo configure:3501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + tcl_cv_lib_corefoundation=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + tcl_cv_lib_corefoundation=no +fi +rm -f conftest* + LIBS=$hold_libs; CFLAGS=$hold_cflags fi - if test "$tcl_ok" = "no"; then - DL_OBJS="" - fi +echo "$ac_t""$tcl_cv_lib_corefoundation" 1>&6 + if test $tcl_cv_lib_corefoundation = yes; then + LIBS="$LIBS -framework CoreFoundation" + cat >> confdefs.h <<\EOF +#define HAVE_COREFOUNDATION 1 +EOF - if test "x$DL_OBJS" != "x" ; then - BUILD_DLTEST="\$(DLTEST_TARGETS)" - else - echo "Can't figure out how to do dynamic loading or shared libraries" - echo "on this system." - SHLIB_CFLAGS="" - SHLIB_LD="" - SHLIB_SUFFIX="" - DL_OBJS="tclLoadNone.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS_ORIG" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - BUILD_DLTEST="" - fi - - # 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 - # standard manufacturer compiler. - - if test "$DL_OBJS" != "tclLoadNone.o" ; then - if test "$GCC" = "yes" ; then - case $system in - AIX-*) - ;; - BSD/OS*) - ;; - IRIX*) - ;; - NetBSD-*|FreeBSD-*|OpenBSD-*) - ;; - Darwin-*) - ;; - RISCos-*) - ;; - SCO_SV-3.2*) - ;; - ULTRIX-4.*) - ;; - *) - SHLIB_CFLAGS="-fPIC" - ;; - esac - fi - fi - - if test "$SHARED_LIB_SUFFIX" = "" ; then - SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}' - fi - if test "$UNSHARED_LIB_SUFFIX" = "" ; then - UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' - fi - - if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then - LIB_SUFFIX=${SHARED_LIB_SUFFIX} - MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' - else - LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} - - if test "$RANLIB" = "" ; then - MAKE_LIB='$(STLIB_LD) $@ ${OBJS}' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' - else - MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(LIB_FILE))' - fi - - fi - - - # Stub lib does not depend on shared/static configuration - if test "$RANLIB" = "" ; then - MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}' - INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)' - else - MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@' - INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(STUB_LIB_FILE))' - fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:3770: checking for build with symbols" >&5 - # Check whether --enable-symbols or --disable-symbols was given. -if test "${enable_symbols+set}" = set; then - enableval="$enable_symbols" - tcl_ok=$enableval -else - tcl_ok=no -fi - -# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. - if test "$tcl_ok" = "no"; then - CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' - LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' - DBGX="" - echo "$ac_t""no" 1>&6 - else - CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' - LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' - DBGX=g - if test "$tcl_ok" = "yes"; then - echo "$ac_t""yes (standard debugging)" 1>&6 - fi - fi - - - - if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then - cat >> confdefs.h <<\EOF -#define TCL_MEM_DEBUG 1 -EOF - - fi - - if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then - cat >> confdefs.h <<\EOF -#define TCL_COMPILE_DEBUG 1 -EOF - - cat >> confdefs.h <<\EOF -#define TCL_COMPILE_STATS 1 -EOF - - fi - - if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then - if test "$tcl_ok" = "all"; then - echo "$ac_t""enabled symbols mem compile debugging" 1>&6 - else - echo "$ac_t""enabled $tcl_ok debugging" 1>&6 - fi - fi - - -TCL_DBGX=${DBGX} - -#-------------------------------------------------------------------- -# Detect what compiler flags to set for 64-bit support. -#-------------------------------------------------------------------- - - - echo $ac_n "checking for required early compiler flags""... $ac_c" 1>&6 -echo "configure:3831: checking for required early compiler flags" >&5 - tcl_flags="" - - if eval "test \"`echo '$''{'tcl_cv_flag__isoc99_source'+set}'`\" = set"; then + fi + fi + for ac_hdr in libkern/OSAtomic.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3527: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -int main() { -char *p = (char *)strtoll; char *q = (char *)strtoull; -; return 0; } -EOF -if { (eval echo configure:3845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - tcl_cv_flag__isoc99_source=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cat > conftest.$ac_ext < -int main() { -char *p = (char *)strtoll; char *q = (char *)strtoull; -; return 0; } +#include <$ac_hdr> EOF -if { (eval echo configure:3861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - tcl_cv_flag__isoc99_source=yes + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - tcl_cv_flag__isoc99_source=no -fi -rm -f conftest* + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi - - if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then - cat >> confdefs.h <<\EOF -#define _ISOC99_SOURCE 1 +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done - tcl_flags="$tcl_flags _ISOC99_SOURCE" - fi - - if eval "test \"`echo '$''{'tcl_cv_flag__largefile64_source'+set}'`\" = set"; then + for ac_func in OSSpinLockLock +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3566: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); + int main() { -struct stat64 buf; int i = stat64("/", &buf); + +/* 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 +$ac_func(); +#endif + ; return 0; } EOF -if { (eval echo configure:3894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - tcl_cv_flag__largefile64_source=no + eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - cat > conftest.$ac_ext < -int main() { -struct stat64 buf; int i = stat64("/", &buf); -; return 0; } -EOF -if { (eval echo configure:3910: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - tcl_cv_flag__largefile64_source=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - tcl_cv_flag__largefile64_source=no -fi -rm -f conftest* -fi -rm -f conftest* -fi - - if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then - cat >> confdefs.h <<\EOF -#define _LARGEFILE64_SOURCE 1 -EOF - - tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" - fi - - if eval "test \"`echo '$''{'tcl_cv_flag__largefile_source64'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -int main() { -char *p = (char *)open64; -; return 0; } -EOF -if { (eval echo configure:3943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - tcl_cv_flag__largefile_source64=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cat > conftest.$ac_ext < -int main() { -char *p = (char *)open64; -; return 0; } -EOF -if { (eval echo configure:3959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - tcl_cv_flag__largefile_source64=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - tcl_cv_flag__largefile_source64=no -fi -rm -f conftest* + eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi - if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then - cat >> confdefs.h <<\EOF -#define _LARGEFILE_SOURCE64 1 -EOF - - tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" - fi - if test "x${tcl_flags}" = "x" ; then - echo "$ac_t""none" 1>&6 - else - echo "$ac_t""${tcl_flags}" 1>&6 - fi - - - echo $ac_n "checking for 64-bit integer type""... $ac_c" 1>&6 -echo "configure:3988: checking for 64-bit integer type" >&5 - if eval "test \"`echo '$''{'tcl_cv_type_64bit'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - tcl_cv_type_64bit=none - # See if the compiler knows natively about __int64 - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - tcl_type_64bit=__int64 -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - tcl_type_64bit="long long" -fi -rm -f conftest* - # See if we should use long anyway Note that we substitute in the - # type that is our current guess for a 64-bit type inside this check - # program, so it should be modified only carefully... - cat > conftest.$ac_ext <&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - tcl_cv_type_64bit=${tcl_type_64bit} + else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* + echo "$ac_t""no" 1>&6 fi +done - if test "${tcl_cv_type_64bit}" = none ; then - cat >> confdefs.h <<\EOF -#define TCL_WIDE_INT_IS_LONG 1 -EOF - - echo "$ac_t""using long" 1>&6 - else - cat >> confdefs.h <&6 - - # Now check for auxiliary declarations - echo $ac_n "checking for struct dirent64""... $ac_c" 1>&6 -echo "configure:4051: checking for struct dirent64" >&5 - if eval "test \"`echo '$''{'tcl_cv_struct_dirent64'+set}'`\" = set"; then + for ac_hdr in copyfile.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3622: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - - cat > conftest.$ac_ext < conftest.$ac_ext < -#include -int main() { -struct dirent64 p; -; return 0; } +#include <$ac_hdr> EOF -if { (eval echo configure:4065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3632: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - tcl_cv_struct_dirent64=yes + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - tcl_cv_struct_dirent64=no + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi - - if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then - cat >> confdefs.h <<\EOF -#define HAVE_STRUCT_DIRENT64 1 -EOF - - fi - echo "$ac_t""${tcl_cv_struct_dirent64}" 1>&6 - - echo $ac_n "checking for struct stat64""... $ac_c" 1>&6 -echo "configure:4086: checking for struct stat64" >&5 - if eval "test \"`echo '$''{'tcl_cv_struct_stat64'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - cat > conftest.$ac_ext < -int main() { -struct stat64 p; - -; return 0; } +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - tcl_cv_struct_stat64=yes + else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - tcl_cv_struct_stat64=no -fi -rm -f conftest* + echo "$ac_t""no" 1>&6 fi +done - if test "x${tcl_cv_struct_stat64}" = "xyes" ; then - cat >> confdefs.h <<\EOF -#define HAVE_STRUCT_STAT64 1 -EOF - - fi - echo "$ac_t""${tcl_cv_struct_stat64}" 1>&6 - - for ac_func in open64 lseek64 + for ac_func in copyfile do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4123: checking for $ac_func" >&5 +echo "configure:3661: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4171,1073 +3709,1591 @@ else fi done - echo $ac_n "checking for off64_t""... $ac_c" 1>&6 -echo "configure:4176: checking for off64_t" >&5 - if eval "test \"`echo '$''{'tcl_cv_type_off64_t'+set}'`\" = set"; then + cat >> confdefs.h <<\EOF +#define MAC_OSX_TCL 1 +EOF + + cat >> confdefs.h <<\EOF +#define USE_VFORK 1 +EOF + + cat >> confdefs.h <<\EOF +#define TCL_DEFAULT_ENCODING "utf-8" +EOF + + cat >> confdefs.h <<\EOF +#define TCL_LOAD_FROM_MEMORY 1 +EOF + + cat >> confdefs.h <<\EOF +#define TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING 1 +EOF + + # prior to Darwin 7, realpath is not threadsafe, so don't + # use it when threads are enabled, c.f. bug # 711232: + echo $ac_n "checking for realpath""... $ac_c" 1>&6 +echo "configure:3736: checking for realpath" >&5 +if eval "test \"`echo '$''{'ac_cv_func_realpath'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - - cat > conftest.$ac_ext < conftest.$ac_ext < +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char realpath(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char realpath(); + int main() { -off64_t offset; + +/* 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_realpath) || defined (__stub___realpath) +choke me +#else +realpath(); +#endif ; return 0; } EOF -if { (eval echo configure:4190: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - tcl_cv_type_off64_t=yes + eval "ac_cv_func_realpath=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - tcl_cv_type_off64_t=no + eval "ac_cv_func_realpath=no" fi rm -f conftest* fi - if test "x${tcl_cv_type_off64_t}" = "xyes" && \ - test "x${ac_cv_func_lseek64}" = "xyes" && \ - test "x${ac_cv_func_open64}" = "xyes" ; then +if eval "test \"`echo '$ac_cv_func_'realpath`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + 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 + ;; + NEXTSTEP-*) + SHLIB_CFLAGS="" + SHLIB_LD="cc -nostdlib -r" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadNext.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OS/390-*) + CFLAGS_OPTIMIZE="" # Optimizer is buggy cat >> confdefs.h <<\EOF -#define HAVE_TYPE_OFF64_T 1 +#define _OE_SOCKETS 1 EOF + # needed in sys/socket.h + ;; + OSF1-1.0|OSF1-1.1|OSF1-1.2) + # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 + SHLIB_CFLAGS="" + # Hack: make package name same as library name + SHLIB_LD='ld -R -export :' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadOSF.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-1.*) + # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 + SHLIB_CFLAGS="-fPIC" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD="ld -shared" + else + SHLIB_LD="ld -non_shared" + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-V*) + # Digital OSF/1 + SHLIB_CFLAGS="" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD='ld -shared -expect_unresolved "*"' + else + SHLIB_LD='ld -non_shared -expect_unresolved "*"' + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mieee" + else + CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" + fi + # see pthread_intro(3) for pthread support on osf1, k.furukawa + if test "${TCL_THREADS}" = "1" ; then + CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" + CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" + LIBS=`echo $LIBS | sed s/-lpthreads//` + if test "$GCC" = "yes" ; then + LIBS="$LIBS -lpthread -lmach -lexc" + else + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + fi - echo "$ac_t""yes" 1>&6 - else - echo "$ac_t""no" 1>&6 - fi + ;; + QNX-6*) + # QNX RTP + # This may work for all QNX, but it was only reported for v6. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + # dlopen is in -lc on QNX + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + RISCos-*) + SHLIB_CFLAGS="-G 0" + SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".a" + DL_OBJS="tclLoadAout.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS -Wl,-D,08000000" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ;; + SCO_SV-3.2*) + # Note, dlopen is available only on SCO 3.2.5 and greater. However, + # this test works, since "uname -s" was non-standard in 3.2.4 and + # below. + if test "$GCC" = "yes" ; then + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" + else + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" + fi + SHLIB_LD="ld -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SINIX*5.4*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SunOS-4*) + SHLIB_CFLAGS="-PIC" + SHLIB_LD="ld" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + + # SunOS can't handle version numbers with dots in them in library + # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it + # requires an extra version number at the end of .so file names. + # So, the library has to have a name like libtcl75.so.1.0 + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + SunOS-5.[0-6]) + # Careful to not let 5.10+ fall into this case + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + cat >> confdefs.h <<\EOF +#define _REENTRANT 1 +EOF + + cat >> confdefs.h <<\EOF +#define _POSIX_PTHREAD_SEMANTICS 1 +EOF + + + SHLIB_CFLAGS="-KPIC" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + ;; + SunOS-5*) + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + cat >> confdefs.h <<\EOF +#define _REENTRANT 1 +EOF + + cat >> confdefs.h <<\EOF +#define _POSIX_PTHREAD_SEMANTICS 1 +EOF + + + SHLIB_CFLAGS="-KPIC" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + arch=`isainfo` + if test "$arch" = "sparcv9 sparc" ; then + if test "$GCC" = "yes" ; then + if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then + echo "configure: warning: 64bit mode not supported with GCC < 3.2 on $system" 1>&2 + else + do64bit_ok=yes + CFLAGS="$CFLAGS -m64 -mcpu=v9" + LDFLAGS="$LDFLAGS -m64 -mcpu=v9" + SHLIB_CFLAGS="-fPIC" + fi + else + do64bit_ok=yes + if test "$do64bitVIS" = "yes" ; then + CFLAGS="$CFLAGS -xarch=v9a" + LDFLAGS="$LDFLAGS -xarch=v9a" + else + CFLAGS="$CFLAGS -xarch=v9" + LDFLAGS="$LDFLAGS -xarch=v9" + fi + # Solaris 64 uses this as well + #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" + fi + elif test "$arch" = "amd64 i386" ; then + if test "$GCC" = "yes" ; then + echo "configure: warning: 64bit mode not supported with GCC on $system" 1>&2 + else + do64bit_ok=yes + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64" + fi + else + echo "configure: warning: 64bit mode not supported for $arch" 1>&2 + fi + fi + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "$do64bit_ok" = "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}' + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + fi + ;; + ULTRIX-4.*) + SHLIB_CFLAGS="-G 0" + SHLIB_SUFFIX=".a" + SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" + SHLIB_LD_LIBS='${LIBS}' + DL_OBJS="tclLoadAout.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS -Wl,-D,08000000" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "$GCC" != "yes" ; then + CFLAGS="$CFLAGS -DHAVE_TZSET -std1" + fi + ;; + UNIX_SV* | UnixWare-5*) + SHLIB_CFLAGS="-KPIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers + # that don't grok the -Bexport option. Test that it does. + hold_ldflags=$LDFLAGS + echo $ac_n "checking for ld accepts -Bexport flag""... $ac_c" 1>&6 +echo "configure:4075: checking for ld accepts -Bexport flag" >&5 + LDFLAGS="$LDFLAGS -Wl,-Bexport" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + found=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + LDFLAGS=$hold_ldflags found=no +fi +rm -f conftest* + echo "$ac_t""$found" 1>&6 + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + esac + + if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then + echo "configure: warning: 64bit support being disabled -- don't know magic for this platform" 1>&2 fi -#-------------------------------------------------------------------- -# Check endianness because we can optimize comparisons of -# Tcl_UniChar strings to memcmp on big-endian systems. -#-------------------------------------------------------------------- + # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic + # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop, + # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need + # to determine which of several header files defines the a.out file + # format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we + # support only a file format that is more or less version-7-compatible. + # In particular, + # - a.out files must begin with `struct exec'. + # - the N_TXTOFF on the `struct exec' must compute the seek address + # of the text segment + # - The `struct exec' must contain a_magic, a_text, a_data, a_bss + # and a_entry fields. + # The following compilation should succeed if and only if either sys/exec.h + # or a.out.h is usable for the purpose. + # + # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the + # `struct exec' includes a second header that contains information that + # duplicates the v7 fields that are needed. -echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:4221: checking whether byte ordering is bigendian" >&5 -if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + if test "x$DL_OBJS" = "xtclLoadAout.o" ; then + echo $ac_n "checking sys/exec.h""... $ac_c" 1>&6 +echo "configure:4126: checking sys/exec.h" >&5 + cat > conftest.$ac_ext < +int main() { + + struct exec foo; + unsigned long seek; + int flag; +#if defined(__mips) || defined(mips) + seek = N_TXTOFF (foo.ex_f, foo.ex_o); +#else + seek = N_TXTOFF (foo); +#endif + flag = (foo.a_magic == OMAGIC); + return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; + +; return 0; } +EOF +if { (eval echo configure:4146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + tcl_ok=usable else - ac_cv_c_bigendian=unknown -# See if sys/param.h defines the BYTE_ORDER macro. -cat > conftest.$ac_ext <&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + tcl_ok=unusable +fi +rm -f conftest* + echo "$ac_t""$tcl_ok" 1>&6 + if test $tcl_ok = usable; then + cat >> confdefs.h <<\EOF +#define USE_SYS_EXEC_H 1 +EOF + + else + echo $ac_n "checking a.out.h""... $ac_c" 1>&6 +echo "configure:4164: checking a.out.h" >&5 + cat > conftest.$ac_ext < -#include +#include int main() { -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros + struct exec foo; + unsigned long seek; + int flag; +#if defined(__mips) || defined(mips) + seek = N_TXTOFF (foo.ex_f, foo.ex_o); +#else + seek = N_TXTOFF (foo); #endif + flag = (foo.a_magic == OMAGIC); + return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; + ; return 0; } EOF -if { (eval echo configure:4239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4184: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - # It does; now see whether it defined to BIG_ENDIAN or not. -cat > conftest.$ac_ext <&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + tcl_ok=unusable +fi +rm -f conftest* + echo "$ac_t""$tcl_ok" 1>&6 + if test $tcl_ok = usable; then + cat >> confdefs.h <<\EOF +#define USE_A_OUT_H 1 +EOF + + else + echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6 +echo "configure:4202: checking sys/exec_aout.h" >&5 + cat > conftest.$ac_ext < -#include +#include int main() { -#if BYTE_ORDER != BIG_ENDIAN - not big endian + struct exec foo; + unsigned long seek; + int flag; +#if defined(__mips) || defined(mips) + seek = N_TXTOFF (foo.ex_f, foo.ex_o); +#else + seek = N_TXTOFF (foo); #endif + flag = (foo.a_midmag == OMAGIC); + return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; + ; return 0; } EOF -if { (eval echo configure:4254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - ac_cv_c_bigendian=yes + tcl_ok=usable else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - ac_cv_c_bigendian=no -fi -rm -f conftest* -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + tcl_ok=unusable fi rm -f conftest* -if test $ac_cv_c_bigendian = unknown; then -if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } -else - cat > conftest.$ac_ext <&6 + if test $tcl_ok = usable; then + cat >> confdefs.h <<\EOF +#define USE_SYS_EXEC_AOUT_H 1 EOF -if { (eval echo configure:4287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_c_bigendian=no + + else + DL_OBJS="" + fi + fi + fi + fi + + # Step 5: disable dynamic loading if requested via a command-line switch. + + # Check whether --enable-load or --disable-load was given. +if test "${enable_load+set}" = set; then + enableval="$enable_load" + tcl_ok=$enableval else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_c_bigendian=yes -fi -rm -fr conftest* + tcl_ok=yes fi -fi + if test "$tcl_ok" = "no"; then + DL_OBJS="" + fi + + if test "x$DL_OBJS" != "x" ; then + BUILD_DLTEST="\$(DLTEST_TARGETS)" + else + echo "Can't figure out how to do dynamic loading or shared libraries" + echo "on this system." + SHLIB_CFLAGS="" + SHLIB_LD="" + SHLIB_SUFFIX="" + DL_OBJS="tclLoadNone.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS_ORIG" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + BUILD_DLTEST="" + fi + + # 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 + # standard manufacturer compiler. + + if test "$DL_OBJS" != "tclLoadNone.o" ; then + if test "$GCC" = "yes" ; then + case $system in + AIX-*) + ;; + BSD/OS*) + ;; + IRIX*) + ;; + NetBSD-*|FreeBSD-*|OpenBSD-*) + ;; + Darwin-*) + ;; + RISCos-*) + ;; + SCO_SV-3.2*) + ;; + ULTRIX-4.*) + ;; + *) + SHLIB_CFLAGS="-fPIC" + ;; + esac + fi + fi + + if test "$SHARED_LIB_SUFFIX" = "" ; then + SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}' + fi + if test "$UNSHARED_LIB_SUFFIX" = "" ; then + UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' + fi + + if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then + LIB_SUFFIX=${SHARED_LIB_SUFFIX} + MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' + else + LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} + + if test "$RANLIB" = "" ; then + MAKE_LIB='$(STLIB_LD) $@ ${OBJS}' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' + else + MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(LIB_FILE))' + fi + + fi + + + # Stub lib does not depend on shared/static configuration + if test "$RANLIB" = "" ; then + MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}' + INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)' + else + MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@' + INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(STUB_LIB_FILE))' + fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 +echo "configure:4373: checking for build with symbols" >&5 + # Check whether --enable-symbols or --disable-symbols was given. +if test "${enable_symbols+set}" = set; then + enableval="$enable_symbols" + tcl_ok=$enableval +else + tcl_ok=no fi -echo "$ac_t""$ac_cv_c_bigendian" 1>&6 -if test $ac_cv_c_bigendian = yes; then - cat >> confdefs.h <<\EOF -#define WORDS_BIGENDIAN 1 +# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. + if test "$tcl_ok" = "no"; then + CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' + LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' + DBGX="" + echo "$ac_t""no" 1>&6 + else + CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' + LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' + DBGX=g + if test "$tcl_ok" = "yes"; then + echo "$ac_t""yes (standard debugging)" 1>&6 + fi + fi + + + + if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then + cat >> confdefs.h <<\EOF +#define TCL_MEM_DEBUG 1 +EOF + + fi + + if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then + cat >> confdefs.h <<\EOF +#define TCL_COMPILE_DEBUG 1 +EOF + + cat >> confdefs.h <<\EOF +#define TCL_COMPILE_STATS 1 EOF -fi + fi + + if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then + if test "$tcl_ok" = "all"; then + echo "$ac_t""enabled symbols mem compile debugging" 1>&6 + else + echo "$ac_t""enabled $tcl_ok debugging" 1>&6 + fi + fi + +TCL_DBGX=${DBGX} #-------------------------------------------------------------------- -# Supply substitutes for missing POSIX library procedures, or -# set flags so Tcl uses alternate procedures. +# Detect what compiler flags to set for 64-bit support. #-------------------------------------------------------------------- -# Check if Posix compliant getcwd exists, if not we'll use getwd. -for ac_func in getcwd -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4320: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + + echo $ac_n "checking for required early compiler flags""... $ac_c" 1>&6 +echo "configure:4434: checking for required early compiler flags" >&5 + tcl_flags="" + + if eval "test \"`echo '$''{'tcl_cv_flag__isoc99_source'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* 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(); - +#include int main() { - -/* 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 -$ac_func(); -#endif - +char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } EOF -if { (eval echo configure:4348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" + tcl_cv_flag__isoc99_source=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -cat >> confdefs.h <<\EOF -#define USEGETWD 1 -EOF - -fi -done - -# Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really -# define USEGETWD even if the posix getcwd exists. Add a test ? - -for ac_func in opendir strstr -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4382: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* 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(); - +#define _ISOC99_SOURCE 1 +#include int main() { - -/* 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 -$ac_func(); -#endif - +char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } EOF -if { (eval echo configure:4410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" + tcl_cv_flag__isoc99_source=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + tcl_cv_flag__isoc99_source=no fi rm -f conftest* fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" +rm -f conftest* fi -done - + if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define _ISOC99_SOURCE 1 +EOF -for ac_func in strtol strtoll strtoull tmpnam waitpid -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4440: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + tcl_flags="$tcl_flags _ISOC99_SOURCE" + fi + + if eval "test \"`echo '$''{'tcl_cv_flag__largefile64_source'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* 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(); - +#include int main() { - -/* 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 -$ac_func(); -#endif - +struct stat64 buf; int i = stat64("/", &buf); ; return 0; } EOF -if { (eval echo configure:4468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" + tcl_cv_flag__largefile64_source=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + cat > conftest.$ac_ext < +int main() { +struct stat64 buf; int i = stat64("/", &buf); +; return 0; } +EOF +if { (eval echo configure:4513: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + tcl_cv_flag__largefile64_source=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + tcl_cv_flag__largefile64_source=no fi rm -f conftest* fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" +rm -f conftest* fi -done + if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define _LARGEFILE64_SOURCE 1 +EOF -echo $ac_n "checking for strerror""... $ac_c" 1>&6 -echo "configure:4495: checking for strerror" >&5 -if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then + tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" + fi + + if eval "test \"`echo '$''{'tcl_cv_flag__largefile_source64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char strerror(); - +#include int main() { - -/* 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_strerror) || defined (__stub___strerror) -choke me -#else -strerror(); -#endif - +char *p = (char *)open64; ; return 0; } EOF -if { (eval echo configure:4523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_func_strerror=yes" + tcl_cv_flag__largefile_source64=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_strerror=no" + cat > conftest.$ac_ext < +int main() { +char *p = (char *)open64; +; return 0; } +EOF +if { (eval echo configure:4562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + tcl_cv_flag__largefile_source64=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + tcl_cv_flag__largefile_source64=no +fi +rm -f conftest* fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_func_'strerror`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -cat >> confdefs.h <<\EOF -#define NO_STRERROR 1 + if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define _LARGEFILE_SOURCE64 1 EOF -fi + tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" + fi + if test "x${tcl_flags}" = "x" ; then + echo "$ac_t""none" 1>&6 + else + echo "$ac_t""${tcl_flags}" 1>&6 + fi -echo $ac_n "checking for getwd""... $ac_c" 1>&6 -echo "configure:4547: checking for getwd" >&5 -if eval "test \"`echo '$''{'ac_cv_func_getwd'+set}'`\" = set"; then + + echo $ac_n "checking for 64-bit integer type""... $ac_c" 1>&6 +echo "configure:4591: checking for 64-bit integer type" >&5 + if eval "test \"`echo '$''{'tcl_cv_type_64bit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + tcl_type_64bit=__int64 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + tcl_type_64bit="long long" +fi +rm -f conftest* + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char getwd(); int main() { - -/* 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_getwd) || defined (__stub___getwd) -choke me -#else -getwd(); -#endif - +switch (0) { + case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; + } ; return 0; } EOF -if { (eval echo configure:4575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_func_getwd=yes" + tcl_cv_type_64bit=${tcl_type_64bit} else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_getwd=no" fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_func_'getwd`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -cat >> confdefs.h <<\EOF -#define NO_GETWD 1 + if test "${tcl_cv_type_64bit}" = none ; then + cat >> confdefs.h <<\EOF +#define TCL_WIDE_INT_IS_LONG 1 EOF -fi + echo "$ac_t""using long" 1>&6 + else + cat >> confdefs.h <&6 -echo "configure:4599: checking for wait3" >&5 -if eval "test \"`echo '$''{'ac_cv_func_wait3'+set}'`\" = set"; then + echo "$ac_t""${tcl_cv_type_64bit}" 1>&6 + + # Now check for auxiliary declarations + echo $ac_n "checking for struct dirent64""... $ac_c" 1>&6 +echo "configure:4654: checking for struct dirent64" >&5 + if eval "test \"`echo '$''{'tcl_cv_struct_dirent64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char wait3(); - +#include +#include int main() { - -/* 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_wait3) || defined (__stub___wait3) -choke me -#else -wait3(); -#endif - +struct dirent64 p; ; return 0; } EOF -if { (eval echo configure:4627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_func_wait3=yes" + tcl_cv_struct_dirent64=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_wait3=no" + tcl_cv_struct_dirent64=no fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_func_'wait3`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -cat >> confdefs.h <<\EOF -#define NO_WAIT3 1 + if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define HAVE_STRUCT_DIRENT64 1 EOF -fi + fi + echo "$ac_t""${tcl_cv_struct_dirent64}" 1>&6 -echo $ac_n "checking for uname""... $ac_c" 1>&6 -echo "configure:4651: checking for uname" >&5 -if eval "test \"`echo '$''{'ac_cv_func_uname'+set}'`\" = set"; then + echo $ac_n "checking for struct stat64""... $ac_c" 1>&6 +echo "configure:4689: checking for struct stat64" >&5 + if eval "test \"`echo '$''{'tcl_cv_struct_stat64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char uname(); - +#include int main() { - -/* 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_uname) || defined (__stub___uname) -choke me -#else -uname(); -#endif +struct stat64 p; ; return 0; } EOF -if { (eval echo configure:4679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_func_uname=yes" + tcl_cv_struct_stat64=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_uname=no" + tcl_cv_struct_stat64=no fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_func_'uname`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -cat >> confdefs.h <<\EOF -#define NO_UNAME 1 + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define HAVE_STRUCT_STAT64 1 EOF -fi + fi + echo "$ac_t""${tcl_cv_struct_stat64}" 1>&6 -echo $ac_n "checking for realpath""... $ac_c" 1>&6 -echo "configure:4703: checking for realpath" >&5 -if eval "test \"`echo '$''{'ac_cv_func_realpath'+set}'`\" = set"; then + for ac_func in open64 lseek64 +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4726: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char realpath(); +char $ac_func(); int main() { /* 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_realpath) || defined (__stub___realpath) +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -realpath(); +$ac_func(); #endif ; return 0; } EOF -if { (eval echo configure:4731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_func_realpath=yes" + eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_realpath=no" + eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_func_'realpath`\" = yes"; then +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 - : + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 -cat >> confdefs.h <<\EOF -#define NO_REALPATH 1 -EOF - fi +done - -#-------------------------------------------------------------------- -# Supply substitutes for missing POSIX header files. Special -# notes: -# - stdlib.h doesn't define strtol, strtoul, or -# strtod insome versions of SunOS -# - some versions of string.h don't declare procedures such -# as strstr -#-------------------------------------------------------------------- - - - echo $ac_n "checking dirent.h""... $ac_c" 1>&6 -echo "configure:4766: checking dirent.h" >&5 - if eval "test \"`echo '$''{'tcl_cv_dirent_h'+set}'`\" = set"; then + echo $ac_n "checking for off64_t""... $ac_c" 1>&6 +echo "configure:4779: checking for off64_t" >&5 + if eval "test \"`echo '$''{'tcl_cv_type_off64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < -#include int main() { - -#ifndef _POSIX_SOURCE -# ifdef __Lynx__ - /* - * Generate compilation error to make the test fail: Lynx headers - * are only valid if really in the POSIX environment. - */ - - missing_procedure(); -# endif -#endif -DIR *d; -struct dirent *entryPtr; -char *p; -d = opendir("foobar"); -entryPtr = readdir(d); -p = entryPtr->d_name; -closedir(d); +off64_t offset; ; return 0; } EOF -if { (eval echo configure:4797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - tcl_cv_dirent_h=yes + tcl_cv_type_off64_t=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - tcl_cv_dirent_h=no + tcl_cv_type_off64_t=no fi rm -f conftest* fi - - if test $tcl_cv_dirent_h = no; then - cat >> confdefs.h <<\EOF -#define NO_DIRENT_H 1 -EOF - - fi - - echo "$ac_t""$tcl_ok" 1>&6 - ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for errno.h""... $ac_c" 1>&6 -echo "configure:4820: checking for errno.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4830: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -cat >> confdefs.h <<\EOF -#define NO_ERRNO_H 1 + 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 <<\EOF +#define HAVE_TYPE_OFF64_T 1 EOF -fi + echo "$ac_t""yes" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + fi - ac_safe=`echo "float.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for float.h""... $ac_c" 1>&6 -echo "configure:4857: checking for float.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +#-------------------------------------------------------------------- +# Check endianness because we can optimize comparisons of +# Tcl_UniChar strings to memcmp on big-endian systems. +#-------------------------------------------------------------------- + +echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 +echo "configure:4824: checking whether byte ordering is bigendian" >&5 +if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < +#include +#include +int main() { + +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if { (eval echo configure:4842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + # It does; now see whether it defined to BIG_ENDIAN or not. +cat > conftest.$ac_ext < +#include +int main() { + +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif +; return 0; } +EOF +if { (eval echo configure:4857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_bigendian=yes else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + ac_cv_c_bigendian=no fi rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : else - echo "$ac_t""no" 1>&6 -cat >> confdefs.h <<\EOF -#define NO_FLOAT_H 1 -EOF - + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 fi - - ac_safe=`echo "values.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for values.h""... $ac_c" 1>&6 -echo "configure:4894: checking for values.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +rm -f conftest* +if test $ac_cv_c_bigendian = unknown; then +if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < +main () { + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +if { (eval echo configure:4890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_c_bigendian=no else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + rm -fr conftest* + ac_cv_c_bigendian=yes fi -rm -f conftest* +rm -fr conftest* fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -cat >> confdefs.h <<\EOF -#define NO_VALUES_H 1 + +fi +fi + +echo "$ac_t""$ac_cv_c_bigendian" 1>&6 +if test $ac_cv_c_bigendian = yes; then + cat >> confdefs.h <<\EOF +#define WORDS_BIGENDIAN 1 EOF fi - ac_safe=`echo "limits.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for limits.h""... $ac_c" 1>&6 -echo "configure:4931: checking for limits.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + +#-------------------------------------------------------------------- +# Supply substitutes for missing POSIX library procedures, or +# set flags so Tcl uses alternate procedures. +#-------------------------------------------------------------------- + +# Check if Posix compliant getcwd exists, if not we'll use getwd. +for ac_func in getcwd +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4923: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); + +int main() { + +/* 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 +$ac_func(); +#endif + +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4941: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if { (eval echo configure:4951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_func_$ac_func=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_LIMITS_H 1 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 cat >> confdefs.h <<\EOF -#define NO_LIMITS_H 1 +#define USEGETWD 1 EOF fi +done - ac_safe=`echo "stdlib.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for stdlib.h""... $ac_c" 1>&6 -echo "configure:4971: checking for stdlib.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +# Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really +# define USEGETWD even if the posix getcwd exists. Add a test ? + +for ac_func in opendir strstr strtol strtoll strtoull tmpnam waitpid +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4985: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); + +int main() { + +/* 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 +$ac_func(); +#endif + +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if { (eval echo configure:5013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_func_$ac_func=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - tcl_ok=1 -else - echo "$ac_t""no" 1>&6 -tcl_ok=0 -fi - - cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "strtol" >/dev/null 2>&1; then - : -else - rm -rf conftest* - tcl_ok=0 + eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - - cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "strtoul" >/dev/null 2>&1; then - : -else - rm -rf conftest* - tcl_ok=0 fi -rm -f conftest* - cat > conftest.$ac_ext < +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&5 | - egrep "strtod" >/dev/null 2>&1; then - : + else - rm -rf conftest* - tcl_ok=0 + echo "$ac_t""no" 1>&6 +LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" fi -rm -f conftest* +done - if test $tcl_ok = 0; then - cat >> confdefs.h <<\EOF -#define NO_STDLIB_H 1 -EOF - fi - ac_safe=`echo "string.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for string.h""... $ac_c" 1>&6 -echo "configure:5053: checking for string.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo $ac_n "checking for strerror""... $ac_c" 1>&6 +echo "configure:5040: checking for strerror" >&5 +if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char strerror(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror(); + +int main() { + +/* 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_strerror) || defined (__stub___strerror) +choke me +#else +strerror(); +#endif + +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if { (eval echo configure:5068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_func_strerror=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "ac_cv_func_strerror=no" fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'strerror`\" = yes"; then echo "$ac_t""yes" 1>&6 - tcl_ok=1 + : else echo "$ac_t""no" 1>&6 -tcl_ok=0 +cat >> confdefs.h <<\EOF +#define NO_STRERROR 1 +EOF + fi - cat > conftest.$ac_ext <&6 +echo "configure:5092: checking for getwd" >&5 +if eval "test \"`echo '$''{'ac_cv_func_getwd'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char getwd(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char getwd(); + +int main() { + +/* 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_getwd) || defined (__stub___getwd) +choke me +#else +getwd(); +#endif + +; return 0; } EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "strstr" >/dev/null 2>&1; then - : +if { (eval echo configure:5120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_getwd=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* - tcl_ok=0 + eval "ac_cv_func_getwd=no" fi rm -f conftest* +fi - cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "strerror" >/dev/null 2>&1; then +if eval "test \"`echo '$ac_cv_func_'getwd`\" = yes"; then + echo "$ac_t""yes" 1>&6 : else - rm -rf conftest* - tcl_ok=0 -fi -rm -f conftest* - - - # See also memmove check below for a place where NO_STRING_H can be - # set and why. - - if test $tcl_ok = 0; then - cat >> confdefs.h <<\EOF -#define NO_STRING_H 1 + echo "$ac_t""no" 1>&6 +cat >> confdefs.h <<\EOF +#define NO_GETWD 1 EOF - fi +fi - ac_safe=`echo "sys/wait.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for sys/wait.h""... $ac_c" 1>&6 -echo "configure:5126: checking for sys/wait.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo $ac_n "checking for wait3""... $ac_c" 1>&6 +echo "configure:5144: checking for wait3" >&5 +if eval "test \"`echo '$''{'ac_cv_func_wait3'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char wait3(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char wait3(); + +int main() { + +/* 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_wait3) || defined (__stub___wait3) +choke me +#else +wait3(); +#endif + +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5136: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if { (eval echo configure:5172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_func_wait3=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "ac_cv_func_wait3=no" fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'wait3`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 cat >> confdefs.h <<\EOF -#define NO_SYS_WAIT_H 1 +#define NO_WAIT3 1 EOF fi - ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:5163: checking for dlfcn.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo $ac_n "checking for uname""... $ac_c" 1>&6 +echo "configure:5196: checking for uname" >&5 +if eval "test \"`echo '$''{'ac_cv_func_uname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char uname(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char uname(); + +int main() { + +/* 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_uname) || defined (__stub___uname) +choke me +#else +uname(); +#endif + +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if { (eval echo configure:5224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_func_uname=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "ac_cv_func_uname=no" fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'uname`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 cat >> confdefs.h <<\EOF -#define NO_DLFCN_H 1 +#define NO_UNAME 1 EOF fi - - # OS/390 lacks sys/param.h (and doesn't need it, by chance). - - for ac_hdr in unistd.h sys/param.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5205: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo $ac_n "checking for realpath""... $ac_c" 1>&6 +echo "configure:5248: checking for realpath" >&5 +if eval "test \"`echo '$''{'ac_cv_func_realpath'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char realpath(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char realpath(); + +int main() { + +/* 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_realpath) || defined (__stub___realpath) +choke me +#else +realpath(); +#endif + +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if { (eval echo configure:5276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_func_realpath=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "ac_cv_func_realpath=no" fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'realpath`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - +cat >> confdefs.h <<\EOF +#define NO_REALPATH 1 +EOF +fi #--------------------------------------------------------------------------- @@ -5251,17 +5307,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5255: checking for $ac_hdr" >&5 +echo "configure:5311: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5288,7 +5344,7 @@ fi done echo $ac_n "checking termios vs. termio vs. sgtty""... $ac_c" 1>&6 -echo "configure:5292: checking termios vs. termio vs. sgtty" >&5 +echo "configure:5348: checking termios vs. termio vs. sgtty" >&5 if eval "test \"`echo '$''{'tcl_cv_api_serial'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5297,7 +5353,7 @@ else tcl_cv_api_serial=no else cat > conftest.$ac_ext < @@ -5312,7 +5368,7 @@ int main() { return 1; } EOF -if { (eval echo configure:5316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_api_serial=termios else @@ -5329,7 +5385,7 @@ fi tcl_cv_api_serial=no else cat > conftest.$ac_ext < @@ -5343,7 +5399,7 @@ int main() { return 1; } EOF -if { (eval echo configure:5347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_api_serial=termio else @@ -5361,7 +5417,7 @@ fi tcl_cv_api_serial=no else cat > conftest.$ac_ext < @@ -5376,7 +5432,7 @@ int main() { return 1; } EOF -if { (eval echo configure:5380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_api_serial=sgtty else @@ -5394,7 +5450,7 @@ fi tcl_cv_api_serial=no else cat > conftest.$ac_ext < @@ -5411,7 +5467,7 @@ int main() { return 1; } EOF -if { (eval echo configure:5415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_api_serial=termios else @@ -5429,7 +5485,7 @@ fi tcl_cv_api_serial=no else cat > conftest.$ac_ext < @@ -5445,7 +5501,7 @@ int main() { return 1; } EOF -if { (eval echo configure:5449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_api_serial=termio else @@ -5463,7 +5519,7 @@ fi tcl_cv_api_serial=none else cat > conftest.$ac_ext < @@ -5480,7 +5536,7 @@ int main() { return 1; } EOF -if { (eval echo configure:5484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_api_serial=sgtty else @@ -5523,19 +5579,19 @@ EOF #-------------------------------------------------------------------- echo $ac_n "checking for fd_set in sys/types""... $ac_c" 1>&6 -echo "configure:5527: checking for fd_set in sys/types" >&5 +echo "configure:5583: checking for fd_set in sys/types" >&5 if eval "test \"`echo '$''{'tcl_cv_type_fd_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { fd_set readMask, writeMask; ; return 0; } EOF -if { (eval echo configure:5539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_type_fd_set=yes else @@ -5548,15 +5604,15 @@ rm -f conftest* fi echo "$ac_t""$tcl_cv_type_fd_set" 1>&6 -tk_ok=$tcl_cv_type_fd_set +tcl_ok=$tcl_cv_type_fd_set if test $tcl_cv_type_fd_set = no; then echo $ac_n "checking for fd_mask in sys/select""... $ac_c" 1>&6 -echo "configure:5555: checking for fd_mask in sys/select" >&5 +echo "configure:5611: checking for fd_mask in sys/select" >&5 if eval "test \"`echo '$''{'tcl_cv_grep_fd_mask'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -5578,10 +5634,10 @@ fi #define HAVE_SYS_SELECT_H 1 EOF - tk_ok=yes + tcl_ok=yes fi fi -if test $tk_ok = no; then +if test $tcl_ok = no; then cat >> confdefs.h <<\EOF #define NO_FD_SET 1 EOF @@ -5593,12 +5649,12 @@ fi #------------------------------------------------------------------------------ echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:5597: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:5653: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5606,7 +5662,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:5610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -5631,17 +5687,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5635: checking for $ac_hdr" >&5 +echo "configure:5691: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5668,12 +5724,12 @@ fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:5672: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:5728: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5682,7 +5738,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:5686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5742: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -5703,12 +5759,12 @@ EOF fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:5707: checking for tm_zone in struct tm" >&5 +echo "configure:5763: checking for tm_zone in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -5716,7 +5772,7 @@ int main() { struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:5720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -5736,12 +5792,12 @@ EOF else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:5740: checking for tzname" >&5 +echo "configure:5796: checking for tzname" >&5 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -5751,7 +5807,7 @@ int main() { atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:5755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -5776,12 +5832,12 @@ fi for ac_func in gmtime_r localtime_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5780: checking for $ac_func" >&5 +echo "configure:5836: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5830,19 +5886,19 @@ done echo $ac_n "checking tm_tzadj in struct tm""... $ac_c" 1>&6 -echo "configure:5834: checking tm_tzadj in struct tm" >&5 +echo "configure:5890: checking tm_tzadj in struct tm" >&5 if eval "test \"`echo '$''{'tcl_cv_member_tm_tzadj'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct tm tm; tm.tm_tzadj; ; return 0; } EOF -if { (eval echo configure:5846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_member_tm_tzadj=yes else @@ -5863,19 +5919,19 @@ EOF fi echo $ac_n "checking tm_gmtoff in struct tm""... $ac_c" 1>&6 -echo "configure:5867: checking tm_gmtoff in struct tm" >&5 +echo "configure:5923: checking tm_gmtoff in struct tm" >&5 if eval "test \"`echo '$''{'tcl_cv_member_tm_gmtoff'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct tm tm; tm.tm_gmtoff; ; return 0; } EOF -if { (eval echo configure:5879: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_member_tm_gmtoff=yes else @@ -5900,12 +5956,12 @@ EOF # (like convex) have timezone functions, etc. # echo $ac_n "checking long timezone variable""... $ac_c" 1>&6 -echo "configure:5904: checking long timezone variable" >&5 - if eval "test \"`echo '$''{'tcl_cv_var_timezone'+set}'`\" = set"; then +echo "configure:5960: checking long timezone variable" >&5 + if eval "test \"`echo '$''{'tcl_cv_timezone_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -5914,7 +5970,7 @@ extern long timezone; exit (0); ; return 0; } EOF -if { (eval echo configure:5918: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_timezone_long=yes else @@ -5937,12 +5993,12 @@ EOF # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # echo $ac_n "checking time_t timezone variable""... $ac_c" 1>&6 -echo "configure:5941: checking time_t timezone variable" >&5 +echo "configure:5997: checking time_t timezone variable" >&5 if eval "test \"`echo '$''{'tcl_cv_timezone_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -5951,7 +6007,7 @@ extern time_t timezone; exit (0); ; return 0; } EOF -if { (eval echo configure:5955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_timezone_time=yes else @@ -5978,12 +6034,12 @@ EOF # in struct stat. But we might be able to use fstatfs instead. #-------------------------------------------------------------------- echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:5982: checking for st_blksize in struct stat" >&5 +echo "configure:6038: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5991,7 +6047,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:5995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -6012,12 +6068,12 @@ EOF fi echo $ac_n "checking for fstatfs""... $ac_c" 1>&6 -echo "configure:6016: checking for fstatfs" >&5 +echo "configure:6072: checking for fstatfs" >&5 if eval "test \"`echo '$''{'ac_cv_func_fstatfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_fstatfs=yes" else @@ -6069,7 +6125,7 @@ fi # data, this checks it and add memcmp.o to LIBOBJS if needed #-------------------------------------------------------------------- echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:6073: checking for 8-bit clean memcmp" >&5 +echo "configure:6129: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6077,7 +6133,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -6111,12 +6167,12 @@ test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" # {The replacement define is in compat/string.h} #-------------------------------------------------------------------- echo $ac_n "checking for memmove""... $ac_c" 1>&6 -echo "configure:6115: checking for memmove" >&5 +echo "configure:6171: checking for memmove" >&5 if eval "test \"`echo '$''{'ac_cv_func_memmove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_memmove=yes" else @@ -6172,12 +6228,12 @@ fi #-------------------------------------------------------------------- if test "x${ac_cv_func_strstr}" = "xyes"; then echo $ac_n "checking proper strstr implementation""... $ac_c" 1>&6 -echo "configure:6176: checking proper strstr implementation" >&5 +echo "configure:6232: checking proper strstr implementation" >&5 if test "$cross_compiling" = yes; then tcl_ok=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_ok=yes else @@ -6214,12 +6270,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for strtoul""... $ac_c" 1>&6 -echo "configure:6218: checking for strtoul" >&5 +echo "configure:6274: checking for strtoul" >&5 if eval "test \"`echo '$''{'ac_cv_func_strtoul'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strtoul=yes" else @@ -6266,7 +6322,7 @@ if test "$cross_compiling" = yes; then tcl_ok=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -6305,12 +6361,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for strtod""... $ac_c" 1>&6 -echo "configure:6309: checking for strtod" >&5 +echo "configure:6365: checking for strtod" >&5 if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strtod=yes" else @@ -6357,7 +6413,7 @@ if test "$cross_compiling" = yes; then tcl_ok=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -6399,12 +6455,12 @@ fi echo $ac_n "checking for strtod""... $ac_c" 1>&6 -echo "configure:6403: checking for strtod" >&5 +echo "configure:6459: checking for strtod" >&5 if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strtod=yes" else @@ -6449,7 +6505,7 @@ fi if test "$tcl_strtod" = 1; then echo $ac_n "checking for Solaris2.4/Tru64 strtod bugs""... $ac_c" 1>&6 -echo "configure:6453: checking for Solaris2.4/Tru64 strtod bugs" >&5 +echo "configure:6509: checking for Solaris2.4/Tru64 strtod bugs" >&5 if eval "test \"`echo '$''{'tcl_cv_strtod_buggy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6458,7 +6514,7 @@ else tcl_cv_strtod_buggy=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_strtod_buggy=1 else @@ -6514,12 +6570,12 @@ EOF #-------------------------------------------------------------------- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:6518: checking for ANSI C header files" >&5 +echo "configure:6574: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6527,7 +6583,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6531: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6544,7 +6600,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -6562,7 +6618,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -6583,7 +6639,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -6594,7 +6650,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:6598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -6618,12 +6674,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:6622: checking for mode_t" >&5 +echo "configure:6678: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6651,12 +6707,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:6655: checking for pid_t" >&5 +echo "configure:6711: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6684,12 +6740,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:6688: checking for size_t" >&5 +echo "configure:6744: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6717,12 +6773,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:6721: checking for uid_t in sys/types.h" >&5 +echo "configure:6777: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -6752,12 +6808,12 @@ fi echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:6756: checking for socklen_t" >&5 +echo "configure:6812: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -6796,12 +6852,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for opendir""... $ac_c" 1>&6 -echo "configure:6800: checking for opendir" >&5 +echo "configure:6856: checking for opendir" >&5 if eval "test \"`echo '$''{'ac_cv_func_opendir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_opendir=yes" else @@ -6857,12 +6913,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking union wait""... $ac_c" 1>&6 -echo "configure:6861: checking union wait" >&5 +echo "configure:6917: checking union wait" >&5 if eval "test \"`echo '$''{'tcl_cv_union_wait'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6874,7 +6930,7 @@ WIFEXITED(x); /* Generates compiler error if WIFEXITED ; return 0; } EOF -if { (eval echo configure:6878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_union_wait=yes else @@ -6901,12 +6957,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for strncasecmp""... $ac_c" 1>&6 -echo "configure:6905: checking for strncasecmp" >&5 +echo "configure:6961: checking for strncasecmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_strncasecmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strncasecmp=yes" else @@ -6951,7 +7007,7 @@ fi if test "$tcl_ok" = 0; then echo $ac_n "checking for strncasecmp in -lsocket""... $ac_c" 1>&6 -echo "configure:6955: checking for strncasecmp in -lsocket" >&5 +echo "configure:7011: checking for strncasecmp in -lsocket" >&5 ac_lib_var=`echo socket'_'strncasecmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6959,7 +7015,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6994,7 +7050,7 @@ fi fi if test "$tcl_ok" = 0; then echo $ac_n "checking for strncasecmp in -linet""... $ac_c" 1>&6 -echo "configure:6998: checking for strncasecmp in -linet" >&5 +echo "configure:7054: checking for strncasecmp in -linet" >&5 ac_lib_var=`echo inet'_'strncasecmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7002,7 +7058,7 @@ else ac_save_LIBS="$LIBS" LIBS="-linet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7051,12 +7107,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for BSDgettimeofday""... $ac_c" 1>&6 -echo "configure:7055: checking for BSDgettimeofday" >&5 +echo "configure:7111: checking for BSDgettimeofday" >&5 if eval "test \"`echo '$''{'ac_cv_func_BSDgettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_BSDgettimeofday=yes" else @@ -7101,12 +7157,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6 -echo "configure:7105: checking for gettimeofday" >&5 +echo "configure:7161: checking for gettimeofday" >&5 if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gettimeofday=yes" else @@ -7156,12 +7212,12 @@ fi fi echo $ac_n "checking for gettimeofday declaration""... $ac_c" 1>&6 -echo "configure:7160: checking for gettimeofday declaration" >&5 +echo "configure:7216: checking for gettimeofday declaration" >&5 if eval "test \"`echo '$''{'tcl_cv_grep_gettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -7192,14 +7248,14 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 -echo "configure:7196: checking whether char is unsigned" >&5 +echo "configure:7252: checking whether char is unsigned" >&5 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$GCC" = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext <&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_char_unsigned=yes else @@ -7255,12 +7311,12 @@ EOF fi echo $ac_n "checking signed char declarations""... $ac_c" 1>&6 -echo "configure:7259: checking signed char declarations" >&5 +echo "configure:7315: checking signed char declarations" >&5 if eval "test \"`echo '$''{'tcl_cv_char_signed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_char_signed=yes else @@ -7295,7 +7351,7 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for a putenv() that copies the buffer""... $ac_c" 1>&6 -echo "configure:7299: checking for a putenv() that copies the buffer" >&5 +echo "configure:7355: checking for a putenv() that copies the buffer" >&5 if eval "test \"`echo '$''{'tcl_cv_putenv_copy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7303,7 +7359,7 @@ else tcl_cv_putenv_copy=no else cat > conftest.$ac_ext < @@ -7325,7 +7381,7 @@ else } EOF -if { (eval echo configure:7329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_putenv_copy=no else @@ -7364,20 +7420,19 @@ fi HAVE_LANGINFO=0 if test "$langinfo_ok" = "yes"; then - if test "$langinfo_ok" = "yes"; then - ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'` + ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6 -echo "configure:7371: checking for langinfo.h" >&5 +echo "configure:7426: checking for langinfo.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7381: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7436: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7399,40 +7454,43 @@ else langinfo_ok=no fi - fi fi echo $ac_n "checking whether to use nl_langinfo""... $ac_c" 1>&6 -echo "configure:7406: checking whether to use nl_langinfo" >&5 +echo "configure:7460: checking whether to use nl_langinfo" >&5 if test "$langinfo_ok" = "yes"; then - cat > conftest.$ac_ext <&6 +else + cat > conftest.$ac_ext < int main() { nl_langinfo(CODESET); ; return 0; } EOF -if { (eval echo configure:7416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - langinfo_ok=yes + tcl_cv_langinfo_h=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - langinfo_ok=no + tcl_cv_langinfo_h=no fi rm -f conftest* - if test "$langinfo_ok" = "no"; then - langinfo_ok="no (could not compile with nl_langinfo)"; - fi - if test "$langinfo_ok" = "yes"; then +fi + + echo "$ac_t""$tcl_cv_langinfo_h" 1>&6 + if test $tcl_cv_langinfo_h = yes; then cat >> confdefs.h <<\EOF #define HAVE_LANGINFO 1 EOF fi + else + echo "$ac_t""$langinfo_ok" 1>&6 fi - echo "$ac_t""$langinfo_ok" 1>&6 #-------------------------------------------------------------------- @@ -7447,17 +7505,17 @@ EOF do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7451: checking for $ac_hdr" >&5 +echo "configure:7509: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7519: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7487,17 +7545,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7491: checking for $ac_hdr" >&5 +echo "configure:7549: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7501: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7559: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7524,7 +7582,7 @@ fi done echo $ac_n "checking FIONBIO vs. O_NONBLOCK for nonblocking I/O""... $ac_c" 1>&6 -echo "configure:7528: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5 +echo "configure:7586: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5 if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else @@ -7604,7 +7662,7 @@ HTML_DIR='$(DISTDIR)/html' if test "`uname -s`" = "Darwin" ; then echo $ac_n "checking how to package libraries""... $ac_c" 1>&6 -echo "configure:7608: checking how to package libraries" >&5 +echo "configure:7666: checking how to package libraries" >&5 # Check whether --enable-framework or --disable-framework was given. if test "${enable_framework+set}" = set; then enableval="$enable_framework" @@ -7956,8 +8014,8 @@ s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@MAN_FLAGS@%$MAN_FLAGS%g s%@CC@%$CC%g -s%@TCL_THREADS@%$TCL_THREADS%g s%@CPP@%$CPP%g +s%@TCL_THREADS@%$TCL_THREADS%g s%@TCL_LIBS@%$TCL_LIBS%g s%@MATH_LIBS@%$MATH_LIBS%g s%@RANLIB@%$RANLIB%g diff --git a/unix/configure.in b/unix/configure.in index b781697..791497f 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.20 2005/11/16 22:05:28 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.106.2.21 2005/11/27 02:34:42 das Exp $ AC_INIT(../generic/tcl.h) AC_PREREQ(2.13) @@ -24,6 +24,8 @@ fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi +# Make sure srcdir is fully qualified! +srcdir=`cd $srcdir ; pwd` TCL_SRC_DIR=`cd $srcdir/..; pwd` #------------------------------------------------------------------------ @@ -43,11 +45,17 @@ fi AC_PROG_CC -#------------------------------------------------------------------------ -# Threads support -#------------------------------------------------------------------------ +#-------------------------------------------------------------------- +# Supply substitutes for missing POSIX header files. Special +# notes: +# - stdlib.h doesn't define strtol, strtoul, or +# strtod insome versions of SunOS +# - some versions of string.h don't declare procedures such +# as strstr +# Do this early, otherwise an autoconf bug throws errors on configure +#-------------------------------------------------------------------- -SC_ENABLE_THREADS +SC_MISSING_POSIX_HEADERS #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. @@ -66,6 +74,12 @@ if test -n "$GCC"; then fi fi +#------------------------------------------------------------------------ +# Threads support +#------------------------------------------------------------------------ + +SC_ENABLE_THREADS + #-------------------------------------------------------------------- # Look for libraries that we will need when compiling the Tcl shell #-------------------------------------------------------------------- @@ -114,26 +128,13 @@ AC_CHECK_FUNCS(getcwd, , [AC_DEFINE(USEGETWD)]) # Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really # define USEGETWD even if the posix getcwd exists. Add a test ? -AC_REPLACE_FUNCS(opendir strstr) - -AC_REPLACE_FUNCS(strtol strtoll strtoull tmpnam waitpid) +AC_REPLACE_FUNCS(opendir strstr strtol strtoll strtoull tmpnam waitpid) 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)]) AC_CHECK_FUNC(realpath, , [AC_DEFINE(NO_REALPATH)]) -#-------------------------------------------------------------------- -# Supply substitutes for missing POSIX header files. Special -# notes: -# - stdlib.h doesn't define strtol, strtoul, or -# strtod insome versions of SunOS -# - some versions of string.h don't declare procedures such -# as strstr -#-------------------------------------------------------------------- - -SC_MISSING_POSIX_HEADERS - #--------------------------------------------------------------------------- # Determine which interface to use to talk to the serial port. # Note that #include lines must begin in leftmost column for @@ -157,19 +158,19 @@ AC_CACHE_VAL(tcl_cv_type_fd_set, AC_TRY_COMPILE([#include ],[fd_set readMask, writeMask;], tcl_cv_type_fd_set=yes, tcl_cv_type_fd_set=no)) AC_MSG_RESULT($tcl_cv_type_fd_set) -tk_ok=$tcl_cv_type_fd_set +tcl_ok=$tcl_cv_type_fd_set if test $tcl_cv_type_fd_set = no; then AC_MSG_CHECKING([for fd_mask in sys/select]) AC_CACHE_VAL(tcl_cv_grep_fd_mask, - AC_HEADER_EGREP(fd_mask, sys/select.h, + AC_EGREP_HEADER(fd_mask, sys/select.h, tcl_cv_grep_fd_mask=present, tcl_cv_grep_fd_mask=missing)) AC_MSG_RESULT($tcl_cv_grep_fd_mask) if test $tcl_cv_grep_fd_mask = present; then AC_DEFINE(HAVE_SYS_SELECT_H) - tk_ok=yes + tcl_ok=yes fi fi -if test $tk_ok = no; then +if test $tcl_ok = no; then AC_DEFINE(NO_FD_SET) fi 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 ], - [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 ], [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 ], [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 ], [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 ?]) + AC_DEFINE(HAVE_TYPE_OFF64_T) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c index 1796307..3e05bf3 100644 --- a/unix/tclLoadDyld.c +++ b/unix/tclLoadDyld.c @@ -12,12 +12,15 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclLoadDyld.c,v 1.14.2.4 2005/07/30 07:58:16 das Exp $ + * RCS: @(#) $Id: tclLoadDyld.c,v 1.14.2.5 2005/11/27 02:34:42 das Exp $ */ #include "tclInt.h" #include "tclPort.h" #include +#include +#include +#include #undef panic #include @@ -120,8 +123,7 @@ TclpDlopen(interp, pathPtr, loadHandle, unloadProcPtr) */ native = Tcl_FSGetNativePath(pathPtr); - dyldLibHeader = NSAddImage(native, NSADDIMAGE_OPTION_WITH_SEARCHING | - NSADDIMAGE_OPTION_RETURN_ON_ERROR); + dyldLibHeader = NSAddImage(native, NSADDIMAGE_OPTION_RETURN_ON_ERROR); if (!dyldLibHeader) { NSLinkEditErrors editError; @@ -148,7 +150,8 @@ TclpDlopen(interp, pathPtr, loadHandle, unloadProcPtr) if (!dyldLibHeader) { NSLinkEditError(&editError, &errorNumber, &name, &msg); } - } else if ((editError==NSLinkEditFileFormatError && errorNumber==EBADMACHO) + } else if ((editError == NSLinkEditFileFormatError + && errorNumber == EBADMACHO) || editError == NSLinkEditOtherError){ /* * The requested file was found but was not of type MH_DYLIB, @@ -232,7 +235,7 @@ TclpFindSymbol(interp, loadHandle, symbol) NSSymbol nsSymbol; CONST char *native; Tcl_DString newName, ds; - Tcl_PackageInitProc* proc = NULL; + Tcl_PackageInitProc *proc = NULL; Tcl_DyldLoadHandle *dyldLoadHandle = (Tcl_DyldLoadHandle *) loadHandle; /* @@ -464,15 +467,57 @@ TclpLoadMemory(interp, buffer, size, codeSize, loadHandle, unloadProcPtr) if (codeSize >= 0) { NSObjectFileImageReturnCode err = NSObjectFileImageSuccess; - + CONST struct fat_header *fh = buffer; + uint32_t ms = 0; #ifndef __LP64__ - struct mach_header *mh = buffer; - if (codeSize < sizeof(struct mach_header) || mh->magic != MH_MAGIC + CONST struct mach_header *mh = NULL; + #define mh_magic OSSwapHostToBigInt32(MH_MAGIC) + #define mh_size sizeof(struct mach_header) #else - struct mach_header_64 *mh = buffer; - if (codeSize < sizeof(struct mach_header_64) || mh->magic != MH_MAGIC_64 + CONST struct mach_header_64 *mh = NULL; + #define mh_magic OSSwapHostToBigInt32(MH_MAGIC_64) + #define mh_size sizeof(struct mach_header_64) #endif - || mh->filetype != MH_BUNDLE) { + + if (codeSize >= sizeof(struct fat_header) + && fh->magic == OSSwapHostToBigInt32(FAT_MAGIC)) { + /* + * Fat binary, try to find mach_header for our architecture + */ + uint32_t fh_nfat_arch = OSSwapBigToHostInt32(fh->nfat_arch); + + if (codeSize >= sizeof(struct fat_header) + + fh_nfat_arch * sizeof(struct fat_arch)) { + void *fatarchs = buffer + sizeof(struct fat_header); + CONST NXArchInfo *arch = NXGetLocalArchInfo(); + struct fat_arch *fa; + + if (fh->magic != FAT_MAGIC) { + swap_fat_arch(fatarchs, fh_nfat_arch, arch->byteorder); + } + fa = NXFindBestFatArch(arch->cputype, arch->cpusubtype, + fatarchs, fh_nfat_arch); + if (fa) { + mh = buffer + fa->offset; + ms = fa->size; + } else { + err = NSObjectFileImageInappropriateFile; + } + if (fh->magic != FAT_MAGIC) { + swap_fat_arch(fatarchs, fh_nfat_arch, arch->byteorder); + } + } else { + err = NSObjectFileImageInappropriateFile; + } + } else { + /* + * Thin binary + */ + mh = buffer; + ms = codeSize; + } + if (ms && !(ms >= mh_size && mh->magic == mh_magic && + mh->filetype == OSSwapHostToBigInt32(MH_BUNDLE))) { err = NSObjectFileImageInappropriateFile; } if (err == NSObjectFileImageSuccess) { diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index b25d23f..1508b39 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixChan.c,v 1.42.2.5 2005/01/27 22:53:35 andreas_kupries Exp $ + * RCS: @(#) $Id: tclUnixChan.c,v 1.42.2.6 2005/11/27 02:34:42 das Exp $ */ #include "tclInt.h" /* Internal definitions for Tcl. */ @@ -3183,7 +3183,7 @@ TclUnixWaitForFile(fd, mask, timeout) * wait at all, and a value of -1 means * wait forever. */ { - Tcl_Time abortTime, now; + Tcl_Time abortTime = {0, 0}, now; /* silence gcc 4 warning */ struct timeval blockTime, *timeoutPtr; int index, bit, numFound, result = 0; fd_mask readyMasks[3*MASK_SIZE]; diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index e9d60ab..f5555b7 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixFCmd.c,v 1.28.2.6 2005/11/09 00:53:06 hobbs Exp $ + * RCS: @(#) $Id: tclUnixFCmd.c,v 1.28.2.7 2005/11/27 02:34:42 das Exp $ * * Portions of this code were derived from NetBSD source code which has * the following copyright notice: @@ -397,6 +397,9 @@ DoCopyFile(src, dst) if (symlink(link, dst) < 0) { /* INTL: Native. */ return TCL_ERROR; } +#ifdef HAVE_COPYFILE + copyfile(src, dst, NULL, COPYFILE_XATTR|COPYFILE_NOFOLLOW_SRC); +#endif break; } #endif @@ -1118,6 +1121,9 @@ CopyFileAtts(src, dst, statBufPtr) if (utime(dst, &tval)) { /* INTL: Native. */ return TCL_ERROR; } +#ifdef HAVE_COPYFILE + copyfile(src, dst, NULL, COPYFILE_XATTR|COPYFILE_ACL); +#endif return TCL_OK; } diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 24d552f..7488cf1 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -11,13 +11,13 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixNotfy.c,v 1.11.2.13 2005/07/01 10:57:59 vasiljevic Exp $ + * RCS: @(#) $Id: tclUnixNotfy.c,v 1.11.2.14 2005/11/27 02:34:42 das Exp $ */ -#ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier - * is in tclMacOSXNotify.c */ #include "tclInt.h" #include "tclPort.h" +#ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier + * is in tclMacOSXNotify.c */ #include extern TclStubs tclStubs; diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index 10e1659..ef8156f 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -19,7 +19,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixPort.h,v 1.27.2.6 2005/07/08 01:06:13 hobbs Exp $ + * RCS: @(#) $Id: tclUnixPort.h,v 1.27.2.7 2005/11/27 02:34:42 das Exp $ */ #ifndef _TCLUNIXPORT @@ -505,6 +505,39 @@ extern double strtod(); #define TclpPanic ((Tcl_PanicProc *) NULL) /* + * Darwin specifc configure overrides (to support fat compiles, where + * configure runs only once for multiple architectures): + */ + +#ifdef __APPLE__ +# ifdef __LP64__ +# undef HAVE_COREFOUNDATION +# endif /* __LP64__ */ +# ifdef __DARWIN_UNIX03 +# define USE_TERMIOS 1 +# undef HAVE_PUTENV_THAT_COPIES +# else /* !__DARWIN_UNIX03 */ +# undef USE_TERMIOS +# define HAVE_PUTENV_THAT_COPIES 1 +# endif /* __DARWIN_UNIX03 */ +#endif /* __APPLE__ */ + +/* + * Darwin 8 copyfile API + */ + +#ifdef HAVE_COPYFILE +#ifdef HAVE_COPYFILE_H +#include +#else +int copyfile(const char *from, const char *to, void *state, uint32_t flags); +#define COPYFILE_ACL (1<<0) +#define COPYFILE_XATTR (1<<2) +#define COPYFILE_NOFOLLOW_SRC (1<<18) +#endif +#endif + +/* *--------------------------------------------------------------------------- * The following macros and declarations represent the interface between * generic and unix-specific parts of Tcl. Some of the macros may override -- cgit v0.12