summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authordas <das>2002-08-31 06:09:45 (GMT)
committerdas <das>2002-08-31 06:09:45 (GMT)
commit9ac61d2a0122062c25c3ad97defae9cbaa59b57f (patch)
treea04dce9b4970c608d3bd9a81f627bd20b9081064 /unix/tcl.m4
parent6f97e75f52281eb769d51f15d7e07c3cd935a4d3 (diff)
downloadtcl-9ac61d2a0122062c25c3ad97defae9cbaa59b57f.zip
tcl-9ac61d2a0122062c25c3ad97defae9cbaa59b57f.tar.gz
tcl-9ac61d2a0122062c25c3ad97defae9cbaa59b57f.tar.bz2
*** macosx-8-4-branch merged into the mainline [tcl patch #602770] ***macosx_8_4_merge_2002_08_31_trunk
* generic/tcl.decls: added new macosx specific entry to stubs table. * tools/genStubs.tcl: added generation of platform guards for macosx. This is a little more complex than it seems, because MacOS X IS "unix" plus a little bit, for the purposes of Tcl. BUT unfortunately, Tk uses "unix" to mean X11. So added platform keys for macosx (the little added to "unix"), "aqua" and "x11" to distinguish these for Tk. * generic/tcl.h: added a #ifnded RESOURCE_INCLUDED so that tcl.h can be passed to the resource compiler. * generic/tcl.h: * generic/tclNotify.c: added a few Notifier procs, to be able to modify more bits of the Tcl notifier dynamically. Required to get Mac OS X Tk to live on top of the Tcl Unix threaded notifier. Changes the size of the Tcl_NotifierProcs structure, but doesn't move any elements around. * unix/tclUnixNotfy.c: moved the call to Tcl_ConditionNotify till AFTER we are done mucking with the pointer swap. Fixes cases where the thread waiting on the condition wakes & accesses the waitingListPtr before it gets reset, causing a hang. * library/auto.tcl (tcl_findLibrary): added checking the directories in the tcl_pkgPath for library files on macosx to enable support of the standard Mac OSX library locations * unix/Makefile.in: * unix/configure.in: * unix/tcl.m4: added MAC_OSX_DIR. Added PLAT_OBJS to the OBJS: there are some MacOS X specific files now for Tcl, and when I get he resource & applescript stuff ported over, and restore support for FindFiles, etc, there will be a few more. Added LD_LIBRARY_PATH_VAR configure variable to avoid having to set all possible LD_LIBRARY_PATH analogues on all platforms. LD_LIBRARY_PATH_VAR is "LD_LIBRARY_PATH" by default, "LIBPATH" on AIX, "SHLIB_PATH" on HPUX and "DYLD_LIBRARY_PATH" on Mac OSX. Added configure option to package Tcl as a framework on Mac OSX. * macosx/tclMacOSXBundle.c (new): support for finding Tcl extension packaged as 'bundles' in the standard Mac OSX library locations. * unix/tclUnixInit.c: added support for findig the tcl script library inside Tcl packaged as a framework on Mac OSX. * macosx/Tcl.pbproj/jingham.pbxuser (new): * macosx/Tcl.pbproj/project.pbxproj (new): project for Apple's ProjectBuilder IDE. * macosx/Makefile (new): simple makefile for building the project from the command line via the ProjectBuilder tool 'pbxbuild'. * unix/configure: * generic/tclStubInit.c: * generic/tclPlatDecls.h: regen
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m472
1 files changed, 68 insertions, 4 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index d386101..08e2edb 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -334,6 +334,49 @@ AC_DEFUN(SC_ENABLE_SHARED, [
])
#------------------------------------------------------------------------
+# SC_ENABLE_FRAMEWORK --
+#
+# Allows the building of shared libraries into frameworks
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-framework=yes|no
+#
+# Sets the following vars:
+# FRAMEWORK_BUILD Value of 1 or 0
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_ENABLE_FRAMEWORK, [
+ AC_MSG_CHECKING([how to package libraries])
+ AC_ARG_ENABLE(framework,
+ [ --enable-framework package shared libraries in frameworks [--disable-framework]],
+ [tcl_ok=$enableval], [tcl_ok=no])
+
+ if test "${enable_framework+set}" = set; then
+ enableval="$enable_framework"
+ tcl_ok=$enableval
+ else
+ tcl_ok=no
+ fi
+
+ if test "$tcl_ok" = "yes" ; then
+ AC_MSG_RESULT([framework])
+ FRAMEWORK_BUILD=1
+ if test "${SHARED_BUILD}" = "0" ; then
+ AC_MSG_WARN("Frameworks can only be built if --enable-shared is yes")
+ FRAMEWORK_BUILD=0
+ fi
+ else
+ AC_MSG_RESULT([standard shared library])
+ FRAMEWORK_BUILD=0
+ fi
+])
+
+#------------------------------------------------------------------------
# SC_ENABLE_THREADS --
#
# Specify if thread support should be enabled
@@ -646,6 +689,13 @@ AC_DEFUN(SC_ENABLE_MEMDEBUG, [
# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
# extensions. An empty string means we don't know how
# to use shared libraries on this platform.
+# TCL_SHLIB_LD_EXTRAS - Additional element which are added to SHLIB_LD_LIBS
+# for the build of TCL, but not recorded in the
+# tclConfig.sh, since they are only used for the build
+# of Tcl.
+# Examples: MacOS X records the library version and
+# compatibility version in the shared library. But
+# of course the Tcl version of this is only used for Tcl.
# LIB_SUFFIX - Specifies everything that comes after the "libfoo"
# in a static or shared library name, using the $VERSION variable
# to put the version in the right place. This is used
@@ -756,6 +806,8 @@ dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixe
dnl AC_CHECK_TOOL(AR, ar, :)
AC_CHECK_PROG(AR, ar, ar)
STLIB_LD='${AR} cr'
+ LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
+ PLAT_OBJS=""
case $system in
AIX-5.*)
if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
@@ -786,6 +838,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
fi
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ LD_LIBRARY_PATH_VAR="LIBPATH"
# Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
@@ -816,6 +869,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
LDFLAGS=""
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ LD_LIBRARY_PATH_VAR="LIBPATH"
TCL_NEEDS_EXP_FILE=1
TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
@@ -902,6 +956,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
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
# Check to enable 64-bit flags for compiler/linker
@@ -927,6 +982,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
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.*)
@@ -1162,16 +1218,21 @@ dnl AC_CHECK_TOOL(AR, ar, :)
Rhapsody-*|Darwin-*)
SHLIB_CFLAGS="-fno-common"
SHLIB_LD="cc -dynamiclib \${LDFLAGS}"
- SHLIB_LD_FLAGS="-compatibility_version \${MAJOR_VERSION} -current_version \${VERSION} -install_name \${LIB_RUNTIME_DIR}/\${LIB_FILE} -prebind -seg1addr a000000"
+ TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version \${VERSION} -install_name \${LIB_RUNTIME_DIR}/\${TCL_LIB_FILE} -prebind -seg1addr 0xa000000"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".dylib"
DL_OBJS="tclLoadDyld.o"
+ PLAT_OBJS="tclMacOSXBundle.o"
DL_LIBS=""
LDFLAGS="-prebind"
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
- CFLAGS_OPTIMIZE="-O2"
- EXTRA_CFLAGS='-DTCL_DEFAULT_ENCODING=\"utf-8\"'
+ CFLAGS_OPTIMIZE="-Os"
+ LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
+ # for compatibility with autoconf vers 2.13 :
+ HACK=""
+ EXTRA_CFLAGS="-DMA${HACK}C_OSX_TCL -DHAVE_CFBUNDLE -DTCL_DEFAULT_ENCODING=\\\"utf-8\\\""
+ LIBS="$LIBS -framework CoreFoundation"
;;
NEXTSTEP-*)
SHLIB_CFLAGS=""
@@ -1586,7 +1647,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then
LIB_SUFFIX=${SHARED_LIB_SUFFIX}
- MAKE_LIB='${SHLIB_LD} -o [$]@ ${SHLIB_LD_FLAGS} ${OBJS} ${SHLIB_LD_LIBS} ${LD_SEARCH_FLAGS}'
+ MAKE_LIB='${SHLIB_LD} -o [$]@ ${SHLIB_LD_FLAGS} ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
else
LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
@@ -1627,6 +1688,8 @@ dnl esac
AC_SUBST(DL_LIBS)
+ AC_SUBST(DL_OBJS)
+ AC_SUBST(PLAT_OBJS)
AC_SUBST(CFLAGS)
AC_SUBST(CFLAGS_DEBUG)
AC_SUBST(CFLAGS_OPTIMIZE)
@@ -1641,6 +1704,7 @@ dnl esac
AC_SUBST(STLIB_LD)
AC_SUBST(SHLIB_LD)
+ AC_SUBST(TCL_SHLIB_LD_EXTRAS)
AC_SUBST(SHLIB_LD_FLAGS)
AC_SUBST(SHLIB_LD_LIBS)
AC_SUBST(SHLIB_CFLAGS)