summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
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)