summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-04-20 12:50:19 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-04-20 12:50:19 (GMT)
commit4806e12125b75776ee11538a4cb86ed521078be5 (patch)
tree1c42a1cc336734055703e602558d171311a3654d
parentef773d518ee5df3377d805762539f0da72c33f36 (diff)
parent46e63b3be5cb5ce16dd97cc9f4c17481a5c2f0c8 (diff)
downloadtcl-4806e12125b75776ee11538a4cb86ed521078be5.zip
tcl-4806e12125b75776ee11538a4cb86ed521078be5.tar.gz
tcl-4806e12125b75776ee11538a4cb86ed521078be5.tar.bz2
Merge 8.7
-rw-r--r--generic/tclIO.c41
-rw-r--r--macosx/README11
-rw-r--r--macosx/Tcl-Common.xcconfig2
-rw-r--r--macosx/Tcl-Release.xcconfig2
-rw-r--r--macosx/Tcl.xcode/project.pbxproj16
-rw-r--r--macosx/Tcl.xcodeproj/project.pbxproj20
-rwxr-xr-xunix/configure123
-rw-r--r--unix/tcl.m456
8 files changed, 59 insertions, 212 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 00bb016..57e1a66 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -2685,6 +2685,7 @@ FlushChannel(
int wroteSome = 0; /* Set to one if any data was written to the
* driver. */
+ int bufExists;
/*
* Prevent writing on a dead channel -- a channel that has been closed but
* not yet deallocated. This can occur if the exit handler for the channel
@@ -2853,8 +2854,8 @@ FlushChannel(
* queued.
*/
- DiscardOutputQueued(statePtr);
ReleaseChannelBuffer(bufPtr);
+ DiscardOutputQueued(statePtr);
break;
} else {
/*
@@ -2865,20 +2866,32 @@ FlushChannel(
wroteSome = 1;
}
- bufPtr->nextRemoved += written;
+ bufExists = bufPtr->refCount > 1;
+ ReleaseChannelBuffer(bufPtr);
+ if (bufExists) {
+ /* There is still a reference to this buffer other than the one
+ * this routine just released, meaning that final cleanup of the
+ * buffer hasn't been ordered by, e.g. by a reflected channel
+ * closing the channel from within one of its handler scripts (not
+ * something one would expecte, but it must be considered). Normal
+ * operations on the buffer can proceed.
+ */
- /*
- * If this buffer is now empty, recycle it.
- */
+ bufPtr->nextRemoved += written;
- if (IsBufferEmpty(bufPtr)) {
- statePtr->outQueueHead = bufPtr->nextPtr;
- if (statePtr->outQueueHead == NULL) {
- statePtr->outQueueTail = NULL;
+ /*
+ * If this buffer is now empty, recycle it.
+ */
+
+ if (IsBufferEmpty(bufPtr)) {
+ statePtr->outQueueHead = bufPtr->nextPtr;
+ if (statePtr->outQueueHead == NULL) {
+ statePtr->outQueueTail = NULL;
+ }
+ RecycleBuffer(statePtr, bufPtr, 0);
}
- RecycleBuffer(statePtr, bufPtr, 0);
}
- ReleaseChannelBuffer(bufPtr);
+
} /* Closes "while". */
/*
@@ -6927,15 +6940,17 @@ GetInput(
PreserveChannelBuffer(bufPtr);
nread = ChanRead(chanPtr, InsertPoint(bufPtr), toRead);
+ ReleaseChannelBuffer(bufPtr);
if (nread < 0) {
result = Tcl_GetErrno();
} else {
result = 0;
- bufPtr->nextAdded += nread;
+ if (statePtr->inQueueTail != NULL) {
+ statePtr->inQueueTail->nextAdded += nread;
+ }
}
- ReleaseChannelBuffer(bufPtr);
return result;
}
diff --git a/macosx/README b/macosx/README
index cd3071f..e9d576c 100644
--- a/macosx/README
+++ b/macosx/README
@@ -118,13 +118,10 @@ your ${USER}.pbxuser file (located inside the Tcl.xcodeproj bundle directory)
with a text editor.
- To build universal binaries outside of the Xcode IDE, set CFLAGS as follows:
- export CFLAGS="-arch i386 -arch x86_64 -arch ppc"
-This requires Mac OS X 10.4 and Xcode 2.4 (or Xcode 2.2 if -arch x86_64 is
-omitted, but _not_ Xcode 2.1) and will work on any architecture (on PowerPC
-Tiger you need to add "-isysroot /Developer/SDKs/MacOSX10.4u.sdk").
+ export CFLAGS="-arch x86_64 -arch arm64e"
+This requires Mac OS X 10.4 and Xcode 2.4 and will work on any architecture.
Note that configure requires CFLAGS to contain a least one architecture that can
-be run on the build machine (i.e. ppc on G3/G4, ppc or ppc64 on G5, ppc or i386
-on Core and ppc, i386 or x86_64 on Core2/Xeon).
+be run on the build machine (i.e. x86_64 on Core2/Xeon).
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.
@@ -141,7 +138,7 @@ If you are building from CVS, omit this step (CVS source tree names usually do
not contain a version number).
- Setup environment variables as desired, e.g. for a universal build on 10.5:
- CFLAGS="-arch i386 -arch x86_64 -arch ppc -mmacosx-version-min=10.5"
+ CFLAGS="-arch x86_64 -arch arm64e -mmacosx-version-min=10.5"
export CFLAGS
- Change to the directory containing the Tcl source tree and build:
diff --git a/macosx/Tcl-Common.xcconfig b/macosx/Tcl-Common.xcconfig
index 84c6303..7f181c0 100644
--- a/macosx/Tcl-Common.xcconfig
+++ b/macosx/Tcl-Common.xcconfig
@@ -27,8 +27,6 @@ FRAMEWORK_INSTALL_PATH = /Library/Frameworks
INCLUDEDIR = $(PREFIX)/include
LIBDIR = $(PREFIX)/lib
MANDIR = $(PREFIX)/man
-PER_ARCH_CFLAGS_ppc = -mcpu=G3 -mtune=G4 $(PER_ARCH_CFLAGS_ppc)
-PER_ARCH_CFLAGS_ppc64 = -mcpu=G5 -mpowerpc64 $(PER_ARCH_CFLAGS_ppc64)
PREFIX = /usr/local
TCL_CONFIGURE_ARGS = --enable-dtrace
TCL_LIBRARY = $(LIBDIR)/tcl$(VERSION)
diff --git a/macosx/Tcl-Release.xcconfig b/macosx/Tcl-Release.xcconfig
index d960a52..867ee78 100644
--- a/macosx/Tcl-Release.xcconfig
+++ b/macosx/Tcl-Release.xcconfig
@@ -14,7 +14,7 @@
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
DEAD_CODE_STRIPPING = YES
DEPLOYMENT_POSTPROCESSING = YES
-GCC_OPTIMIZATION_LEVEL = s
+GCC_OPTIMIZATION_LEVEL = 2
GCC_PREPROCESSOR_DEFINITIONS = NDEBUG $(TCL_DEFS) $(GCC_PREPROCESSOR_DEFINITIONS)
CONFIGURE_ARGS = --disable-symbols $(TCL_CONFIGURE_ARGS) $(CONFIGURE_ARGS)
MAKE_TARGET = deploy
diff --git a/macosx/Tcl.xcode/project.pbxproj b/macosx/Tcl.xcode/project.pbxproj
index fd75ac3..2cff4a4 100644
--- a/macosx/Tcl.xcode/project.pbxproj
+++ b/macosx/Tcl.xcode/project.pbxproj
@@ -2123,8 +2123,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tcl-Release.xcconfig */;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CFLAGS = "-arch x86_64 -arch arm64e $(CFLAGS)";
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
};
@@ -2588,8 +2588,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tcl-Release.xcconfig */;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CFLAGS = "-arch x86_64 -arch arm64e $(CFLAGS)";
GCC_VERSION = 4.0;
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
@@ -2626,8 +2626,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tcl-Release.xcconfig */;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CFLAGS = "-arch x86_64 -arch arm64e $(CFLAGS)";
DEBUG_INFORMATION_FORMAT = dwarf;
GCC = "llvm-gcc";
GCC_OPTIMIZATION_LEVEL = 4;
@@ -2780,8 +2780,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tcl-Release.xcconfig */;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CFLAGS = "-arch x86_64 -arch arm64e $(CFLAGS)";
CPPFLAGS = "-isysroot $(SDKROOT) $(CPPFLAGS)";
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
diff --git a/macosx/Tcl.xcodeproj/project.pbxproj b/macosx/Tcl.xcodeproj/project.pbxproj
index 8d67cc6..94c58d0 100644
--- a/macosx/Tcl.xcodeproj/project.pbxproj
+++ b/macosx/Tcl.xcodeproj/project.pbxproj
@@ -2121,8 +2121,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tcl-Release.xcconfig */;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CFLAGS = "-arch x86_64 -arch arm64e $(CFLAGS)";
MACOSX_DEPLOYMENT_TARGET = 10.6;
PREBINDING = NO;
};
@@ -2586,8 +2586,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tcl-Release.xcconfig */;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CFLAGS = "-arch x86_64 -arch arm64e $(CFLAGS)";
GCC_VERSION = 4.0;
MACOSX_DEPLOYMENT_TARGET = 10.6;
PREBINDING = NO;
@@ -2624,12 +2624,11 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tcl-Release.xcconfig */;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CFLAGS = "-arch x86_64 -arch arm64e $(CFLAGS)";
DEBUG_INFORMATION_FORMAT = dwarf;
GCC = "llvm-gcc";
GCC_OPTIMIZATION_LEVEL = 4;
- "GCC_OPTIMIZATION_LEVEL[arch=ppc]" = s;
GCC_VERSION = com.apple.compilers.llvmgcc42;
MACOSX_DEPLOYMENT_TARGET = 10.6;
PREBINDING = NO;
@@ -2807,9 +2806,8 @@
buildSettings = {
ARCHS = (
"$(NATIVE_ARCH_64_BIT)",
- "$(NATIVE_ARCH_32_BIT)",
);
- CFLAGS = "-arch i386 -arch x86_64 $(CFLAGS)";
+ CFLAGS = "-arch x86_64 -arch arm64e $(CFLAGS)";
DEBUG_INFORMATION_FORMAT = dwarf;
GCC = clang;
GCC_OPTIMIZATION_LEVEL = 4;
@@ -2875,8 +2873,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tcl-Release.xcconfig */;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CFLAGS = "-arch x86_64 -arch arm64e $(CFLAGS)";
CPPFLAGS = "-isysroot $(SDKROOT) $(CPPFLAGS)";
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
diff --git a/unix/configure b/unix/configure
index 1f4a098..3c604bf 100755
--- a/unix/configure
+++ b/unix/configure
@@ -6411,7 +6411,7 @@ fi
LDFLAGS="$LDFLAGS -pthread"
;;
Darwin-*)
- CFLAGS_OPTIMIZE="-Os"
+ CFLAGS_OPTIMIZE="-O2"
SHLIB_CFLAGS="-fno-common"
# To avoid discrepancies between what headers configure sees during
# preprocessing tests and compiling tests, move any -isysroot and
@@ -6426,47 +6426,7 @@ fi
then :
case `arch` in
- ppc)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5
-printf %s "checking if compiler accepts -arch ppc64 flag... " >&6; }
-if test ${tcl_cv_cc_arch_ppc64+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
-
- hold_cflags=$CFLAGS
- CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main (void)
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- tcl_cv_cc_arch_ppc64=yes
-else $as_nop
- tcl_cv_cc_arch_ppc64=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
- CFLAGS=$hold_cflags
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5
-printf "%s\n" "$tcl_cv_cc_arch_ppc64" >&6; }
- if test $tcl_cv_cc_arch_ppc64 = yes
-then :
-
- CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
- do64bit_ok=yes
-
-fi;;
- i386)
+ x86_64)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5
printf %s "checking if compiler accepts -arch x86_64 flag... " >&6; }
if test ${tcl_cv_cc_arch_x86_64+y}
@@ -6506,21 +6466,13 @@ then :
do64bit_ok=yes
fi;;
+ arm64e)
+ do64bit_ok=yes;;
*)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5
printf "%s\n" "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};;
esac
-else $as_nop
-
- # Check for combined 32-bit and 64-bit fat build
- if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
- && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '
-then :
-
- fat_32_64=yes
-fi
-
fi
SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}'
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5
@@ -6643,17 +6595,6 @@ then :
else $as_nop
hold_libs=$LIBS
- if test "$fat_32_64" = yes
-then :
-
- for v in CFLAGS CPPFLAGS LDFLAGS; do
- # On Tiger there is no 64-bit CF, so remove 64-bit
- # archs from CFLAGS et al. while testing for
- # presence of CF. 64-bit CF is disabled in
- # tclUnixPort.h if necessary.
- eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
- done
-fi
LIBS="$LIBS -framework CoreFoundation"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -6674,13 +6615,6 @@ else $as_nop
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
- if test "$fat_32_64" = yes
-then :
-
- for v in CFLAGS CPPFLAGS LDFLAGS; do
- eval $v'="$hold_'$v'"'
- done
-fi
LIBS=$hold_libs
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation" >&5
@@ -6696,55 +6630,6 @@ printf "%s\n" "#define HAVE_COREFOUNDATION 1" >>confdefs.h
else $as_nop
tcl_corefoundation=no
fi
- if test "$fat_32_64" = yes -a $tcl_corefoundation = yes
-then :
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit CoreFoundation" >&5
-printf %s "checking for 64-bit CoreFoundation... " >&6; }
-if test ${tcl_cv_lib_corefoundation_64+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
-
- for v in CFLAGS CPPFLAGS LDFLAGS; do
- eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
- done
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <CoreFoundation/CoreFoundation.h>
-int
-main (void)
-{
-CFBundleRef b = CFBundleGetMainBundle();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- tcl_cv_lib_corefoundation_64=yes
-else $as_nop
- tcl_cv_lib_corefoundation_64=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
- for v in CFLAGS CPPFLAGS LDFLAGS; do
- eval $v'="$hold_'$v'"'
- done
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation_64" >&5
-printf "%s\n" "$tcl_cv_lib_corefoundation_64" >&6; }
- if test $tcl_cv_lib_corefoundation_64 = no
-then :
-
-
-printf "%s\n" "#define NO_COREFOUNDATION_64 1" >>confdefs.h
-
- LDFLAGS="$LDFLAGS -Wl,-no_arch_warnings"
-
-fi
-
-fi
fi
;;
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 6b88e88..6a094f0 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1369,7 +1369,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
LDFLAGS="$LDFLAGS -pthread"
;;
Darwin-*)
- CFLAGS_OPTIMIZE="-Os"
+ CFLAGS_OPTIMIZE="-O2"
SHLIB_CFLAGS="-fno-common"
# To avoid discrepancies between what headers configure sees during
# preprocessing tests and compiling tests, move any -isysroot and
@@ -1382,19 +1382,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`"
AS_IF([test $do64bit = yes], [
case `arch` in
- ppc)
- AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag],
- tcl_cv_cc_arch_ppc64, [
- hold_cflags=$CFLAGS
- CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
- [tcl_cv_cc_arch_ppc64=yes],[tcl_cv_cc_arch_ppc64=no])
- CFLAGS=$hold_cflags])
- AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [
- CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
- do64bit_ok=yes
- ]);;
- i386)
+ x86_64)
AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag],
tcl_cv_cc_arch_x86_64, [
hold_cflags=$CFLAGS
@@ -1406,15 +1394,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS="$CFLAGS -arch x86_64"
do64bit_ok=yes
]);;
+ arm64e)
+ do64bit_ok=yes;;
*)
AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);;
esac
- ], [
- # Check for combined 32-bit and 64-bit fat build
- AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
- && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [
- fat_32_64=yes])
- ])
+ ], [])
SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}'
AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
hold_ldflags=$LDFLAGS
@@ -1461,48 +1446,17 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK([for CoreFoundation.framework],
tcl_cv_lib_corefoundation, [
hold_libs=$LIBS
- AS_IF([test "$fat_32_64" = yes], [
- for v in CFLAGS CPPFLAGS LDFLAGS; do
- # On Tiger there is no 64-bit CF, so remove 64-bit
- # archs from CFLAGS et al. while testing for
- # presence of CF. 64-bit CF is disabled in
- # tclUnixPort.h if necessary.
- eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
- done])
LIBS="$LIBS -framework CoreFoundation"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <CoreFoundation/CoreFoundation.h>]],
[[CFBundleRef b = CFBundleGetMainBundle();]])],
[tcl_cv_lib_corefoundation=yes],
[tcl_cv_lib_corefoundation=no])
- AS_IF([test "$fat_32_64" = yes], [
- for v in CFLAGS CPPFLAGS LDFLAGS; do
- eval $v'="$hold_'$v'"'
- done])
LIBS=$hold_libs])
AS_IF([test $tcl_cv_lib_corefoundation = yes], [
LIBS="$LIBS -framework CoreFoundation"
AC_DEFINE(HAVE_COREFOUNDATION, 1,
[Do we have access to Darwin CoreFoundation.framework?])
], [tcl_corefoundation=no])
- AS_IF([test "$fat_32_64" = yes -a $tcl_corefoundation = yes],[
- AC_CACHE_CHECK([for 64-bit CoreFoundation],
- tcl_cv_lib_corefoundation_64, [
- for v in CFLAGS CPPFLAGS LDFLAGS; do
- eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
- done
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <CoreFoundation/CoreFoundation.h>]],
- [[CFBundleRef b = CFBundleGetMainBundle();]])],
- [tcl_cv_lib_corefoundation_64=yes],
- [tcl_cv_lib_corefoundation_64=no])
- for v in CFLAGS CPPFLAGS LDFLAGS; do
- eval $v'="$hold_'$v'"'
- done])
- AS_IF([test $tcl_cv_lib_corefoundation_64 = no], [
- AC_DEFINE(NO_COREFOUNDATION_64, 1,
- [Is Darwin CoreFoundation unavailable for 64-bit?])
- LDFLAGS="$LDFLAGS -Wl,-no_arch_warnings"
- ])
- ])
])
;;
OS/390-*)