summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authordas <das>2005-04-26 00:49:49 (GMT)
committerdas <das>2005-04-26 00:49:49 (GMT)
commit65b0befd37a990632c03983541a806bc3e9eb1e9 (patch)
tree7b37a45ef8605a80fcf752b180cda52033f800ff /unix/tcl.m4
parentbe6d9e33bed687b9fe2a04d816dd5f932a5764d1 (diff)
downloadtk-65b0befd37a990632c03983541a806bc3e9eb1e9.zip
tk-65b0befd37a990632c03983541a806bc3e9eb1e9.tar.gz
tk-65b0befd37a990632c03983541a806bc3e9eb1e9.tar.bz2
* macosx/tkMacOSXNotify.c: syncd with tclUnixNotfy.c changes since
2004-06-22, added compile time check for threaded tcl core, removed unthreaded code paths as they are never used anyway, fixed TkMacOSXAlertNotifier() implementation. * unix/Makefile.in: added TCL_STUB_LIB_FILE, needed for unexporting of symbols from libtclstub to avoid duplicate symbol warnings. * unix/tcl.m4 (Darwin): added configure checks for recently added linker flags -single_module and -search_paths_first to allow building with older tools (and on Mac OS X 10.1), use -single_module in SHLIB_LD and not just T{CL,K}_SHLIB_LD_EXTRAS, added unexporting from Tk of symbols from libtclstub to avoid duplicate symbol warnings, added PLAT_SRCS definition for Mac OS X. (SC_MISSING_POSIX_HEADERS): added caching of dirent.h check. (SC_TCL_64BIT_FLAGS): fixed 'checking for off64_t' message output. * unix/configure: autoconf-2.13
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m438
1 files changed, 29 insertions, 9 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index ccd9946..5eb6c72 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -887,6 +887,7 @@ dnl AC_CHECK_TOOL(AR, ar)
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
@@ -1357,25 +1358,42 @@ dnl AC_CHECK_TOOL(AR, ar)
esac
;;
Darwin-*)
+ CFLAGS_OPTIMIZE="-Os"
SHLIB_CFLAGS="-fno-common"
SHLIB_LD="cc -dynamiclib \${LDFLAGS}"
- TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version \${VERSION} -install_name \${DYLIB_INSTALL_DIR}/\${TCL_LIB_FILE} -prebind -seg1addr 0xa000000 -Wl,-single_module"
- TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version \${VERSION} -install_name \${DYLIB_INSTALL_DIR}/\${TK_LIB_FILE} -prebind -seg1addr 0xb000000 -Wl,-single_module"
+ AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no)
+ LDFLAGS=$hold_ldflags])
+ 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"
- PLAT_OBJS=\$\(MAC\_OSX_OBJS\)
DL_LIBS=""
- LDFLAGS="$LDFLAGS -prebind -Wl,-search_paths_first"
+ LDFLAGS="$LDFLAGS -prebind"
+ 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"
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no)
+ LDFLAGS=$hold_ldflags])
+ if test $tcl_cv_ld_search_paths_first = yes; then
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+ fi
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
- CFLAGS_OPTIMIZE="-Os"
LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
+ PLAT_OBJS=\$\(MAC\_OSX_OBJS\)
+ PLAT_SRCS=\$\(MAC\_OSX_SRCS\)
+ TCL_SHLIB_LD_EXTRAS='-compatibility_version ${VERSION} -current_version ${VERSION} -install_name ${DYLIB_INSTALL_DIR}/${TCL_LIB_FILE} -seg1addr 0xa000000'
+ TK_SHLIB_LD_EXTRAS=' -compatibility_version ${VERSION} -current_version ${VERSION} -install_name ${DYLIB_INSTALL_DIR}/${TK_LIB_FILE} -seg1addr 0xb000000 -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp $(TCL_BIN_DIR)/$(TCL_STUB_LIB_FILE) | tail +3 > $$f && echo $$f)'
+ LIBS="$LIBS -framework CoreFoundation"
AC_DEFINE(MAC_OSX_TCL)
AC_DEFINE(HAVE_CFBUNDLE)
AC_DEFINE(USE_VFORK)
AC_DEFINE(TCL_DEFAULT_ENCODING,"utf-8")
- LIBS="$LIBS -framework CoreFoundation"
;;
NEXTSTEP-*)
SHLIB_CFLAGS=""
@@ -1837,6 +1855,7 @@ dnl esac
AC_SUBST(DL_OBJS)
AC_SUBST(PLAT_OBJS)
+ AC_SUBST(PLAT_SRCS)
AC_SUBST(CFLAGS)
AC_SUBST(CFLAGS_DEBUG)
AC_SUBST(CFLAGS_OPTIMIZE)
@@ -2016,6 +2035,7 @@ int main() {
AC_DEFUN(SC_MISSING_POSIX_HEADERS, [
AC_MSG_CHECKING(dirent.h)
+ AC_CACHE_VAL(tcl_cv_dirent_h,
AC_TRY_LINK([#include <sys/types.h>
#include <dirent.h>], [
#ifndef _POSIX_SOURCE
@@ -2035,9 +2055,9 @@ d = opendir("foobar");
entryPtr = readdir(d);
p = entryPtr->d_name;
closedir(d);
-], tcl_ok=yes, tcl_ok=no)
+], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no))
- if test $tcl_ok = no; then
+ if test $tcl_cv_dirent_h = no; then
AC_DEFINE(NO_DIRENT_H)
fi
@@ -2545,12 +2565,12 @@ AC_DEFUN(SC_TCL_64BIT_FLAGS, [
fi
AC_MSG_RESULT(${tcl_cv_struct_stat64})
+ AC_CHECK_FUNCS(open64 lseek64)
AC_MSG_CHECKING([for off64_t])
AC_CACHE_VAL(tcl_cv_type_off64_t,[
AC_TRY_COMPILE([#include <sys/types.h>],[off64_t offset;
],
tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)])
- AC_CHECK_FUNCS(open64 lseek64)
dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the
dnl functions lseek64 and open64 are defined.
if test "x${tcl_cv_type_off64_t}" = "xyes" && \