📄 tcl.m4
字号:
fi fi # Does the pthread-implementation provide # 'pthread_attr_setstacksize' ? ac_saved_libs=$LIBS LIBS="$LIBS $THREADS_LIBS" AC_CHECK_FUNCS(pthread_attr_setstacksize) LIBS=$ac_saved_libs AC_CHECK_FUNCS(readdir_r) else TCL_THREADS=0 AC_MSG_RESULT([no (default)]) fi AC_SUBST(TCL_THREADS)])#------------------------------------------------------------------------# SC_ENABLE_SYMBOLS --## Specify if debugging symbols should be used.# Memory (TCL_MEM_DEBUG) and compile (TCL_COMPILE_DEBUG) debugging# can also be enabled.## Arguments:# none# # Requires the following vars to be set in the Makefile:# CFLAGS_DEBUG# CFLAGS_OPTIMIZE# LDFLAGS_DEBUG# LDFLAGS_OPTIMIZE# # Results:## Adds the following arguments to configure:# --enable-symbols## Defines the following vars:# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true# Sets to $(CFLAGS_OPTIMIZE) if false# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true# Sets to $(LDFLAGS_OPTIMIZE) if false# DBGX Debug library extension##------------------------------------------------------------------------AC_DEFUN(SC_ENABLE_SYMBOLS, [ AC_MSG_CHECKING([for build with symbols]) AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no])# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' DBGX="" AC_MSG_RESULT([no]) else CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' DBGX=g if test "$tcl_ok" = "yes"; then AC_MSG_RESULT([yes (standard debugging)]) fi fi AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_MEM_DEBUG) fi if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_COMPILE_DEBUG) AC_DEFINE(TCL_COMPILE_STATS) 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]) else AC_MSG_RESULT([enabled $tcl_ok debugging]) fi fi])#------------------------------------------------------------------------# SC_ENABLE_LANGINFO --## Allows use of modern nl_langinfo check for better l10n.# This is only relevant for Unix.## Arguments:# none# # Results:## Adds the following arguments to configure:# --enable-langinfo=yes|no (default is yes)## Defines the following vars:# HAVE_LANGINFO Triggers use of nl_langinfo if defined.##------------------------------------------------------------------------AC_DEFUN(SC_ENABLE_LANGINFO, [ AC_ARG_ENABLE(langinfo, [ --enable-langinfo use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic], [langinfo_ok=$enableval], [langinfo_ok=yes]) HAVE_LANGINFO=0 if test "$langinfo_ok" = "yes"; then if test "$langinfo_ok" = "yes"; then AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) fi fi AC_MSG_CHECKING([whether to use nl_langinfo]) if test "$langinfo_ok" = "yes"; then AC_TRY_COMPILE([#include <langinfo.h>], [nl_langinfo(CODESET);],[langinfo_ok=yes],[langinfo_ok=no]) if test "$langinfo_ok" = "no"; then langinfo_ok="no (could not compile with nl_langinfo)"; fi if test "$langinfo_ok" = "yes"; then AC_DEFINE(HAVE_LANGINFO) fi fi AC_MSG_RESULT([$langinfo_ok])])#--------------------------------------------------------------------# SC_CONFIG_MANPAGES# # Decide whether to use symlinks for linking the manpages and# whether to compress the manpages after installation.## Arguments:# none## Results:## Adds the following arguments to configure:# --enable-man-symlinks# --enable-man-compression=PROG## Defines the following variable:## MKLINKS_FLAGS - The apropriate flags for mkLinks# according to the user's selection.##--------------------------------------------------------------------AC_DEFUN(SC_CONFIG_MANPAGES, [ AC_MSG_CHECKING([whether to use symlinks for manpages]) AC_ARG_ENABLE(man-symlinks, [ --enable-man-symlinks use symlinks for the manpages], test "$enableval" != "no" && MKLINKS_FLAGS="$MKLINKS_FLAGS --symlinks", enableval="no") AC_MSG_RESULT([$enableval]) AC_MSG_CHECKING([compression for manpages]) AC_ARG_ENABLE(man-compression, [ --enable-man-compression=PROG compress the manpages with PROG], test "$enableval" = "yes" && echo && AC_MSG_ERROR([missing argument to --enable-man-compression]) test "$enableval" != "no" && MKLINKS_FLAGS="$MKLINKS_FLAGS --compress $enableval", enableval="no") AC_MSG_RESULT([$enableval]) AC_SUBST(MKLINKS_FLAGS)])#--------------------------------------------------------------------# SC_CONFIG_CFLAGS## Try to determine the proper flags to pass to the compiler# for building shared libraries and other such nonsense.## Arguments:# none## Results:## Defines and substitutes the following vars:## DL_OBJS - Name of the object file that implements dynamic# loading for Tcl on this system.# DL_LIBS - Library file(s) to include in tclsh and other base# applications in order for the "load" command to work.# LDFLAGS - Flags to pass to the compiler when linking object# files into an executable application binary such# as tclsh.# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",# that tell the run-time dynamic linker where to look# for shared libraries such as libtcl.so. Depends on# the variable LIB_RUNTIME_DIR in the Makefile. Could# be the same as CC_SEARCH_FLAGS if ${CC} is used to link.# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib",# that tell the run-time dynamic linker where to look# for shared libraries such as libtcl.so. Depends on# the variable LIB_RUNTIME_DIR in the Makefile.# MAKE_LIB - Command to execute to build the a library;# differs when building shared or static.# MAKE_STUB_LIB -# Command to execute to build a stub library.# INSTALL_LIB - Command to execute to install a library;# differs when building shared or static.# INSTALL_STUB_LIB -# Command to execute to install a stub library.# STLIB_LD - Base command to use for combining object files# into a static library.# SHLIB_CFLAGS - Flags to pass to cc when compiling the components# of a shared library (may request position-independent# code, among other things).# SHLIB_LD - Base command to use for combining object files# into a shared library.# SHLIB_LD_FLAGS -Flags to pass when building a shared library. This# differes from the SHLIB_CFLAGS as it is not used# when building object files or executables.# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when# creating shared libraries. This symbol typically# goes at the end of the "ld" commands that build# shared libraries. The value of the symbol is# "${LIBS}" if all of the dependent libraries should# be specified when creating a shared library. If# dependent libraries should not be specified (as on# SunOS 4.x, where they cause the link to fail, or in# general if Tcl and Tk aren't themselves shared# libraries), then this symbol has an empty string# as its value.# 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# TK_SHLIB_LD_EXTRAS for the build of Tcl and Tk, but not recorded in the# tclConfig.sh, since they are only used for the build# of Tcl and Tk. # 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# by platforms that need non-standard library names.# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs# to have a version after the .so, and ${VERSION}.a# on AIX, since a shared library needs to have# a .a extension whereas shared objects for loadable# extensions have a .so extension. Defaults to# ${VERSION}${SHLIB_SUFFIX}.# TCL_NEEDS_EXP_FILE -# 1 means that an export file is needed to link to a# shared library.# TCL_EXP_FILE - The name of the installed export / import file which# should be used to link to the Tcl shared library.# Empty if Tcl is unshared.# TCL_BUILD_EXP_FILE -# The name of the built export / import file which# should be used to link to the Tcl shared library.# Empty if Tcl is unshared.# CFLAGS_DEBUG -# Flags used when running the compiler in debug mode# CFLAGS_OPTIMIZE -# Flags used when running the compiler in optimize mode# EXTRA_CFLAGS##--------------------------------------------------------------------AC_DEFUN(SC_CONFIG_CFLAGS, [ # Step 0.a: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is requested]) AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)],,enableval="no") if test "$enableval" = "yes"; then do64bit=yes else do64bit=no fi AC_MSG_RESULT($do64bit) # Step 0.b: Enable Solaris 64 bit VIS support? AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) AC_ARG_ENABLE(64bit-vis,[ --enable-64bit-vis enable 64bit Sparc VIS support],,enableval="no") if test "$enableval" = "yes"; then # Force 64bit on with VIS do64bit=yes do64bitVIS=yes else do64bitVIS=no fi AC_MSG_RESULT($do64bitVIS) # Step 1: set the variable "system" to hold the name and version number # for the system. This can usually be done via the "uname" command, but # there are a few systems, like Next, where this doesn't work. AC_MSG_CHECKING([system version (for dynamic loading)]) if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else system=`uname -s`-`uname -r` if test "$?" -ne 0 ; then AC_MSG_RESULT([unknown (can't find uname command)]) system=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then system=MP-RAS-`awk '{print $3}' /etc/.relid'` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` fi AC_MSG_RESULT($system) fi fi # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) # Require ranlib early so we can override it in special cases below. AC_REQUIRE([AC_PROG_RANLIB]) # Step 3: set configuration options based on system name and version. do64bit_ok=no EXTRA_CFLAGS="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`' ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O if test "$GCC" = "yes" ; then CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int" else CFLAGS_WARNING="" fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE=""dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed.dnl AC_CHECK_TOOL(AR, ar) AC_CHECK_PROG(AR, ar, ar) if test "${AR}" = "" ; then AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.]) fi 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 # AIX requires the _r compiler when gcc isn't being used if test "${CC}" != "cc_r" ; then CC=${CC}_r fi AC_MSG_RESULT(Using $CC for compiling with threads) fi LIBS="$LIBS -lc" # AIX-5 uses ELF style dynamic libraries SHLIB_CFLAGS="" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" if test "`uname -m`" = "ia64" ; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = "yes" ; then CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' fi # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. DL_OBJS="tclLoadDl.o" LDFLAGS="" LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN("64bit mode not supported with GCC on $system") else do64bit_ok=yes EXTRA_CFLAGS="-q64" LDFLAGS="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" fi fi ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then # AIX requires the _r compiler when gcc isn't being used if test "${CC}" != "cc_r" ; then CC=${CC}_r fi AC_MSG_RESULT(Using $CC for compiling with threads) fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" 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' # AIX v<=4.1 has some different flags than 4.2+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then LIBOBJS="$LIBOBJS tclLoadAix.o" DL_LIBS="-lld" fi # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -