summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authormdejong <mdejong>2005-08-23 18:25:33 (GMT)
committermdejong <mdejong>2005-08-23 18:25:33 (GMT)
commit7c9e8ad4d37025b7a45e2c9cdb46b5a65a5ef4f4 (patch)
treec59af7d24b600d7bcd3d9bbfb76f2d99b309fdab /unix
parent6c3967704d759e1cf47471002f6e0a8d574f22e5 (diff)
downloadtk-7c9e8ad4d37025b7a45e2c9cdb46b5a65a5ef4f4.zip
tk-7c9e8ad4d37025b7a45e2c9cdb46b5a65a5ef4f4.tar.gz
tk-7c9e8ad4d37025b7a45e2c9cdb46b5a65a5ef4f4.tar.bz2
* unix/Makefile.in: Subst BUILD_TCLSH and TCL_EXE.
* unix/configure: Regen. * unix/configure.in: Update minimum autoconf version to 2.59. Invoke SC_PROG_TCLSH and SC_BUILD_TCLSH. * unix/tcl.m4 (SC_PROG_TCLSH, SC_BUILD_TCLSH): * win/Makefile.in: Subst BUILD_TCLSH and TCL_EXE. * win/configure: Regen. * win/configure.in: Update minimum autoconf version to 2.59. Invoke SC_BUILD_TCLSH. * win/tcl.m4 (SC_PROG_TCLSH, SC_BUILD_TCLSH): Split confused search for tclsh on PATH and build and install locations into two macros. SC_PROG_TCLSH searches just the PATH. SC_BUILD_TCLSH determines the name of the tclsh executable in the Tcl build directory. [Tcl bug 1160114] [Tcl patch 1244153]
Diffstat (limited to 'unix')
-rw-r--r--unix/Makefile.in35
-rwxr-xr-xunix/configure574
-rw-r--r--unix/configure.in7
-rw-r--r--unix/tcl.m4317
4 files changed, 230 insertions, 703 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 18cb549..1348949 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.106 2005/07/05 20:56:50 dgp Exp $
+# RCS: @(#) $Id: Makefile.in,v 1.107 2005/08/23 18:25:34 mdejong Exp $
# Current Tk version; used in various names.
@@ -187,6 +187,21 @@ NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED
# determine which shell to use for executing commands:
SHELL = /bin/sh
+# BUILD_TCLSH is the fully qualified path name of the tclsh shell
+# in the Tcl build directory. Test that need to be run in the
+# version of tclsh that we are building against should use this
+# path. Targets that need an installed tclsh should not depend
+# on this variable.
+
+BUILD_TCLSH = @BUILD_TCLSH@
+
+# TCL_EXE is the name of a tclsh executable that is available *BEFORE*
+# running make for the first time. Certain build targets (make genstubs)
+# need it to be available on the PATH. This executable should *NOT* be
+# required just to do a normal build although it can be required to run
+# make dist. This variable is set to "" if no tclsh is available.
+TCL_EXE = @TCLSH_PROG@
+
# Tk used to let the configure script choose which program to use
# for installing, but there are just too many different versions of
# "install" around; better to use the install-sh script that comes
@@ -200,13 +215,6 @@ INSTALL_PROGRAM = ${INSTALL}
INSTALL_LIBRARY = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
-# TCL_EXE is the name of a tclsh executable that is available *BEFORE*
-# running make for the first time. Certain build targets (make genstubs)
-# need it to be available on the PATH. This executable should *NOT* be
-# required just to do a normal build although it can be required to run
-# make dist.
-TCL_EXE = tclsh
-
# The symbol below provides support for dynamic loading and shared
# libraries. See configure.in for a description of what it means.
# The value of the symbol is normally set by the configure script.
@@ -1473,13 +1481,10 @@ html-tk:
@EXTRA_BUILD_HTML@
BUILD_HTML = \
- @if test -f $(TCL_BIN_DIR)/tclsh; then \
- @LD_LIBRARY_PATH_VAR@=$(TCL_BIN_DIR):$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \
- TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \
- TCLSH="$(TCL_BIN_DIR)/tclsh"; else \
- TCLSH="$(TCL_EXE)"; fi ;\
- $${TCLSH} $(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) \
- --srcdir=$(TOP_DIR)/..
+ @if test -f "$(TCL_EXE)"; then \
+ $(TCL_EXE) $(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) \
+ --srcdir=$(TOP_DIR)/.. ; \
+ fi
#
# Targets to build Solaris package of the distribution for the current
diff --git a/unix/configure b/unix/configure
index 8d46a61..2ae379d 100755
--- a/unix/configure
+++ b/unix/configure
@@ -308,7 +308,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT XFT_CFLAGS XFT_LIBS UNIX_FONT_OBJS TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_YEAR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_INCLUDE_SPEC TK_BUILD_STUB_LIB_SPEC TK_BUILD_STUB_LIB_PATH TK_SRC_DIR TK_SHARED_BUILD LD_LIBRARY_PATH_VAR TK_BUILD_LIB_SPEC TK_BUILD_EXP_FILE TK_EXP_FILE TCL_STUB_FLAGS XINCLUDES XLIBSW LOCALES TK_WINDOWINGSYSTEM TK_PKG_DIR TK_LIBRARY PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_WISH_LIBS TK_RSRC_FILE WISH_RSRC_FILE LIB_RSRC_FILE APP_RSRC_FILE REZ REZ_FLAGS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCLSH_PROG BUILD_TCLSH MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT XFT_CFLAGS XFT_LIBS UNIX_FONT_OBJS TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_YEAR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_INCLUDE_SPEC TK_BUILD_STUB_LIB_SPEC TK_BUILD_STUB_LIB_PATH TK_SRC_DIR TK_SHARED_BUILD LD_LIBRARY_PATH_VAR TK_BUILD_LIB_SPEC TK_BUILD_EXP_FILE TK_EXP_FILE TCL_STUB_FLAGS XINCLUDES XLIBSW LOCALES TK_WINDOWINGSYSTEM TK_PKG_DIR TK_LIBRARY PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_WISH_LIBS TK_RSRC_FILE WISH_RSRC_FILE LIB_RSRC_FILE APP_RSRC_FILE REZ REZ_FLAGS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -1506,6 +1506,51 @@ echo "${ECHO_T}file not found" >&6
+
+ echo "$as_me:$LINENO: checking for tclsh" >&5
+echo $ECHO_N "checking for tclsh... $ECHO_C" >&6
+
+ if test "${ac_cv_path_tclsh+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ search_path=`echo ${PATH} | sed -e 's/:/ /g'`
+ for dir in $search_path ; do
+ for j in `ls -r $dir/tclsh[8-9]* 2> /dev/null` \
+ `ls -r $dir/tclsh* 2> /dev/null` ; do
+ if test x"$ac_cv_path_tclsh" = x ; then
+ if test -f "$j" ; then
+ ac_cv_path_tclsh=$j
+ break
+ fi
+ fi
+ done
+ done
+
+fi
+
+
+ if test -f "$ac_cv_path_tclsh" ; then
+ TCLSH_PROG="$ac_cv_path_tclsh"
+ echo "$as_me:$LINENO: result: $TCLSH_PROG" >&5
+echo "${ECHO_T}$TCLSH_PROG" >&6
+ else
+ # It is not an error if an installed version of Tcl can't be located.
+ TCLSH_PROG=""
+ echo "$as_me:$LINENO: result: No tclsh found on PATH" >&5
+echo "${ECHO_T}No tclsh found on PATH" >&6
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for tclsh in Tcl build directory" >&5
+echo $ECHO_N "checking for tclsh in Tcl build directory... $ECHO_C" >&6
+ BUILD_TCLSH=${TCL_BIN_DIR}/tclsh
+ echo "$as_me:$LINENO: result: $BUILD_TCLSH" >&5
+echo "${ECHO_T}$BUILD_TCLSH" >&6
+
+
+
if test "${TCL_VERSION}" != "${TK_VERSION}"; then
{ { echo "$as_me:$LINENO: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}.
@@ -3275,13 +3320,6 @@ cat >>confdefs.h <<\_ACEOF
#define USE_THREAD_ALLOC 1
_ACEOF
- # USE_THREAD_STORAGE tells us to use the new generic thread
- # storage subsystem.
-
-cat >>confdefs.h <<\_ACEOF
-#define USE_THREAD_STORAGE 1
-_ACEOF
-
cat >>confdefs.h <<\_ACEOF
#define _REENTRANT 1
@@ -4899,18 +4937,6 @@ fi
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}.a'
- ;;
IRIX-5.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -shared -rdata_shared"
@@ -5347,158 +5373,18 @@ fi
LD_SEARCH_FLAGS=""
;;
NetBSD-*|FreeBSD-[1-2].*)
- # Not available on all versions: check for include file.
- if test "${ac_cv_header_dlfcn_h+set}" = set; then
- echo "$as_me:$LINENO: checking for dlfcn.h" >&5
-echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6
-if test "${ac_cv_header_dlfcn_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
-echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking dlfcn.h usability" >&5
-echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <dlfcn.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking dlfcn.h presence" >&5
-echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <dlfcn.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------- ##
-## Report this to the tk lists. ##
-## ----------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for dlfcn.h" >&5
-echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6
-if test "${ac_cv_header_dlfcn_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_dlfcn_h=$ac_header_preproc
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
-echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6
-
-fi
-if test $ac_cv_header_dlfcn_h = yes; then
-
- # 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 "$as_me:$LINENO: checking for ELF" >&5
+ # 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 "$as_me:$LINENO: checking for ELF" >&5
echo $ECHO_N "checking for ELF... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -5514,70 +5400,40 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "yes" >/dev/null 2>&1; then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
fi
rm -f conftest*
-else
-
- 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}.a'
-
-fi
-
-
-
- # FreeBSD doesn't handle version numbers with dots.
+ # Ancient FreeBSD doesn't handle version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.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}.a'
- ;;
+ # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do.
+ case `machine` in
+ sparc|sparc64)
+ SHLIB_CFLAGS="-fPIC";;
*)
- # 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}.so.1.0'
- echo "$as_me:$LINENO: checking for ELF" >&5
+ 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}.so.1.0'
+ echo "$as_me:$LINENO: checking for ELF" >&5
echo $ECHO_N "checking for ELF... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -5593,17 +5449,15 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "yes" >/dev/null 2>&1; then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
- LDFLAGS=-Wl,-export-dynamic
+ LDFLAGS=-Wl,-export-dynamic
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
- LDFLAGS=""
+ LDFLAGS=""
fi
rm -f conftest*
- ;;
- esac
# OpenBSD doesn't do version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
@@ -6316,17 +6170,6 @@ _ACEOF
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
@@ -6493,20 +6336,6 @@ echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;}
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"
@@ -6586,234 +6415,7 @@ _ACEOF
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 "$as_me:$LINENO: checking sys/exec.h" >&5
-echo $ECHO_N "checking sys/exec.h... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/exec.h>
-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;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- tcl_ok=usable
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-tcl_ok=unusable
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $tcl_ok" >&5
-echo "${ECHO_T}$tcl_ok" >&6
- if test $tcl_ok = usable; then
-
-cat >>confdefs.h <<\_ACEOF
-#define USE_SYS_EXEC_H 1
-_ACEOF
-
- else
- echo "$as_me:$LINENO: checking a.out.h" >&5
-echo $ECHO_N "checking a.out.h... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <a.out.h>
-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;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- tcl_ok=usable
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-tcl_ok=unusable
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $tcl_ok" >&5
-echo "${ECHO_T}$tcl_ok" >&6
- if test $tcl_ok = usable; then
-
-cat >>confdefs.h <<\_ACEOF
-#define USE_A_OUT_H 1
-_ACEOF
-
- else
- echo "$as_me:$LINENO: checking sys/exec_aout.h" >&5
-echo $ECHO_N "checking sys/exec_aout.h... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/exec_aout.h>
-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;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- tcl_ok=usable
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-tcl_ok=unusable
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:$LINENO: result: $tcl_ok" >&5
-echo "${ECHO_T}$tcl_ok" >&6
- if test $tcl_ok = usable; then
-
-cat >>confdefs.h <<\_ACEOF
-#define USE_SYS_EXEC_AOUT_H 1
-_ACEOF
-
- else
- DL_OBJS=""
- fi
- fi
- fi
- fi
-
- # Step 5: disable dynamic loading if requested via a command-line switch.
+ # Step 4: 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
@@ -6987,6 +6589,7 @@ echo "${ECHO_T}yes (standard debugging)" >&6
fi
+ ### FIXME: Surely TCL_CFG_DEBUG should be set to whether we're debugging?
cat >>confdefs.h <<\_ACEOF
#define TCL_CFG_DEBUG 1
@@ -7001,23 +6604,12 @@ _ACEOF
fi
- if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define TCL_COMPILE_DEBUG 1
-_ACEOF
-cat >>confdefs.h <<\_ACEOF
-#define TCL_COMPILE_STATS 1
-_ACEOF
-
- fi
-
if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
if test "$tcl_ok" = "all"; then
- echo "$as_me:$LINENO: result: enabled symbols mem compile debugging" >&5
-echo "${ECHO_T}enabled symbols mem compile debugging" >&6
+ echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5
+echo "${ECHO_T}enabled symbols mem debugging" >&6
else
echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5
echo "${ECHO_T}enabled $tcl_ok debugging" >&6
@@ -10816,6 +10408,8 @@ s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t
s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t
s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t
s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t
+s,@TCLSH_PROG@,$TCLSH_PROG,;t t
+s,@BUILD_TCLSH@,$BUILD_TCLSH,;t t
s,@MAN_FLAGS@,$MAN_FLAGS,;t t
s,@CC@,$CC,;t t
s,@CFLAGS@,$CFLAGS,;t t
diff --git a/unix/configure.in b/unix/configure.in
index a44de8d..cc7996a 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -3,10 +3,10 @@ dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tk installation
dnl to configure the system for the local environment.
#
-# RCS: @(#) $Id: configure.in,v 1.109 2005/06/07 14:20:18 dkf Exp $
+# RCS: @(#) $Id: configure.in,v 1.110 2005/08/23 18:25:34 mdejong Exp $
AC_INIT([tk],[8.5])
-AC_PREREQ(2.57)
+AC_PREREQ(2.59)
dnl AC_CONFIG_HEADERS([tkConfig.h])
dnl AC_CONFIG_COMMANDS_PRE([DEFS="-DHAVE_TK_CONFIG_H -imacros tkConfig.h"])
@@ -28,6 +28,9 @@ LOCALES="cs de el en en_gb es fr it nl ru"
SC_PATH_TCLCONFIG
SC_LOAD_TCLCONFIG
+SC_PROG_TCLSH
+SC_BUILD_TCLSH
+
if test "${TCL_VERSION}" != "${TK_VERSION}"; then
AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}.
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 74c181b..cc5f284 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -328,6 +328,79 @@ AC_DEFUN(SC_LOAD_TKCONFIG, [
])
#------------------------------------------------------------------------
+# SC_PROG_TCLSH
+# Locate a tclsh shell installed on the system path. This macro
+# will only find a Tcl shell that already exists on the system.
+# It will not find a Tcl shell in the Tcl build directory or
+# a Tcl shell that has been installed from the Tcl build directory.
+# If a Tcl shell can't be located on the PATH, then TCLSH_PROG will
+# be set to "". Extensions should take care not to create Makefile
+# rules that are run by default and depend on TCLSH_PROG. An
+# extension can't assume that an executable Tcl shell exists at
+# build time.
+#
+# Arguments
+# none
+#
+# Results
+# Subst's the following values:
+# TCLSH_PROG
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_PROG_TCLSH, [
+ AC_MSG_CHECKING([for tclsh])
+
+ AC_CACHE_VAL(ac_cv_path_tclsh, [
+ search_path=`echo ${PATH} | sed -e 's/:/ /g'`
+ for dir in $search_path ; do
+ for j in `ls -r $dir/tclsh[[8-9]]* 2> /dev/null` \
+ `ls -r $dir/tclsh* 2> /dev/null` ; do
+ if test x"$ac_cv_path_tclsh" = x ; then
+ if test -f "$j" ; then
+ ac_cv_path_tclsh=$j
+ break
+ fi
+ fi
+ done
+ done
+ ])
+
+ if test -f "$ac_cv_path_tclsh" ; then
+ TCLSH_PROG="$ac_cv_path_tclsh"
+ AC_MSG_RESULT($TCLSH_PROG)
+ else
+ # It is not an error if an installed version of Tcl can't be located.
+ TCLSH_PROG=""
+ AC_MSG_RESULT([No tclsh found on PATH])
+ fi
+ AC_SUBST(TCLSH_PROG)
+])
+
+#------------------------------------------------------------------------
+# SC_BUILD_TCLSH
+# Determine the fully qualified path name of the tclsh executable
+# in the Tcl build directory. This macro will correctly determine
+# the name of the tclsh executable even if tclsh has not yet
+# been built in the build directory. The build tclsh must be used
+# when running tests from an extension build directory. It is not
+# correct to use the TCLSH_PROG in cases like this.
+#
+# Arguments
+# none
+#
+# Results
+# Subst's the following values:
+# BUILD_TCLSH
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_BUILD_TCLSH, [
+ AC_MSG_CHECKING([for tclsh in Tcl build directory])
+ BUILD_TCLSH=${TCL_BIN_DIR}/tclsh
+ AC_MSG_RESULT($BUILD_TCLSH)
+ AC_SUBST(BUILD_TCLSH)
+])
+
+#------------------------------------------------------------------------
# SC_ENABLE_SHARED --
#
# Allows the building of shared libraries
@@ -462,10 +535,6 @@ AC_DEFUN(SC_ENABLE_THREADS, [
# allocator that significantly reduces lock contention
AC_DEFINE(USE_THREAD_ALLOC, 1,
[Do we want to use the threaded memory allocator?])
- # USE_THREAD_STORAGE tells us to use the new generic thread
- # storage subsystem.
- AC_DEFINE(USE_THREAD_STORAGE, 1,
- [Use the generic thread storage subsystem?])
AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
if test "`uname -s`" = "SunOS" ; then
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
@@ -603,20 +672,22 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [
fi
AC_SUBST(CFLAGS_DEFAULT)
AC_SUBST(LDFLAGS_DEFAULT)
+ ### FIXME: Surely TCL_CFG_DEBUG should be set to whether we're debugging?
AC_DEFINE(TCL_CFG_DEBUG, 1, [Is debugging enabled?])
if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?])
fi
- if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then
- AC_DEFINE(TCL_COMPILE_DEBUG, 1, [Is bytecode debugging enabled?])
- AC_DEFINE(TCL_COMPILE_STATS, 1, [Are bytecode statistics enabled?])
- fi
+ ifelse($1,bccdebug,dnl Only enable 'compile' for the Tcl core itself
+ if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then
+ AC_DEFINE(TCL_COMPILE_DEBUG, 1, [Is bytecode debugging enabled?])
+ AC_DEFINE(TCL_COMPILE_STATS, 1, [Are bytecode statistics enabled?])
+ fi)
if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
if test "$tcl_ok" = "all"; then
- AC_MSG_RESULT([enabled symbols mem compile debugging])
+ AC_MSG_RESULT([enabled symbols mem ]ifelse($1,bccdebug,[compile ])[debugging])
else
AC_MSG_RESULT([enabled $tcl_ok debugging])
fi
@@ -1133,18 +1204,6 @@ dnl AC_CHECK_TOOL(AR, ar)
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}.a'
- ;;
IRIX-5.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -shared -rdata_shared"
@@ -1294,88 +1353,59 @@ dnl AC_CHECK_TOOL(AR, ar)
LD_SEARCH_FLAGS=""
;;
NetBSD-*|FreeBSD-[[1-2]].*)
- # Not available on all versions: check for include file.
- AC_CHECK_HEADER(dlfcn.h, [
- # 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}'
- AC_MSG_CHECKING(for ELF)
- AC_EGREP_CPP(yes, [
+ # 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}'
+ AC_MSG_CHECKING(for ELF)
+ AC_EGREP_CPP(yes, [
#ifdef __ELF__
yes
#endif
- ],
- AC_MSG_RESULT(yes)
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so',
- AC_MSG_RESULT(no)
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
- )
- ], [
- 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}.a'
- ])
+ ],
+ AC_MSG_RESULT(yes)
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so',
+ AC_MSG_RESULT(no)
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
+ )
- # FreeBSD doesn't handle version numbers with dots.
+ # Ancient FreeBSD doesn't handle version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.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}.a'
- ;;
+ # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do.
+ case `machine` in
+ sparc|sparc64)
+ SHLIB_CFLAGS="-fPIC";;
*)
- # 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}.so.1.0'
- AC_MSG_CHECKING(for ELF)
- AC_EGREP_CPP(yes, [
+ 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}.so.1.0'
+ AC_MSG_CHECKING(for ELF)
+ AC_EGREP_CPP(yes, [
#ifdef __ELF__
yes
#endif
- ],
- AC_MSG_RESULT(yes)
- [ LDFLAGS=-Wl,-export-dynamic ],
- AC_MSG_RESULT(no)
- LDFLAGS=""
- )
- ;;
- esac
+ ],
+ AC_MSG_RESULT(yes)
+ [ LDFLAGS=-Wl,-export-dynamic ],
+ AC_MSG_RESULT(no)
+ LDFLAGS=""
+ )
# OpenBSD doesn't do version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
@@ -1561,17 +1591,6 @@ dnl AC_CHECK_TOOL(AR, ar)
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
@@ -1721,20 +1740,6 @@ dnl AC_CHECK_TOOL(AR, ar)
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"
@@ -1763,87 +1768,7 @@ dnl AC_CHECK_TOOL(AR, ar)
AC_DEFINE(TCL_CFG_DO64BIT, 1, [Is this a 64-bit build?])
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
- AC_MSG_CHECKING(sys/exec.h)
- AC_TRY_COMPILE([#include <sys/exec.h>],[
- 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;
- ], tcl_ok=usable, tcl_ok=unusable)
- AC_MSG_RESULT($tcl_ok)
- if test $tcl_ok = usable; then
- AC_DEFINE(USE_SYS_EXEC_H, 1,
- [Should we use <sys/exec.h> when doing dynamic loading?])
- else
- AC_MSG_CHECKING(a.out.h)
- AC_TRY_COMPILE([#include <a.out.h>],[
- 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;
- ], tcl_ok=usable, tcl_ok=unusable)
- AC_MSG_RESULT($tcl_ok)
- if test $tcl_ok = usable; then
- AC_DEFINE(USE_A_OUT_H, 1,
- [Should we use <a.out.h> when doing dynamic loading?])
- else
- AC_MSG_CHECKING(sys/exec_aout.h)
- AC_TRY_COMPILE([#include <sys/exec_aout.h>],[
- 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;
- ], tcl_ok=usable, tcl_ok=unusable)
- AC_MSG_RESULT($tcl_ok)
- if test $tcl_ok = usable; then
- AC_DEFINE(USE_SYS_EXEC_AOUT_H, 1,
- [Should we use <sys/exec_aout.h> when doing dynamic loading?])
- else
- DL_OBJS=""
- fi
- fi
- fi
- fi
-
- # Step 5: disable dynamic loading if requested via a command-line switch.
+ # Step 4: disable dynamic loading if requested via a command-line switch.
AC_ARG_ENABLE(load,
AC_HELP_STRING([--disable-load],