diff options
author | stanton <stanton> | 1999-03-10 05:52:45 (GMT) |
---|---|---|
committer | stanton <stanton> | 1999-03-10 05:52:45 (GMT) |
commit | 0b4be24161f5971f3181adec27a32becf7cb8870 (patch) | |
tree | 92131df26a09a5f7b28f854fb7c0a62ba26cb8ac /unix | |
parent | a5bface5b6607af37870fc5f5ee5019f6d5fb3f1 (diff) | |
download | tcl-0b4be24161f5971f3181adec27a32becf7cb8870.zip tcl-0b4be24161f5971f3181adec27a32becf7cb8870.tar.gz tcl-0b4be24161f5971f3181adec27a32becf7cb8870.tar.bz2 |
Merged stubs changes into mainline for 8.0
Diffstat (limited to 'unix')
-rw-r--r-- | unix/Makefile.in | 148 | ||||
-rw-r--r-- | unix/configure.in | 111 | ||||
-rwxr-xr-x | unix/ldAix | 14 | ||||
-rw-r--r-- | unix/mkLinks | 4 | ||||
-rw-r--r-- | unix/tclConfig.sh.in | 34 | ||||
-rw-r--r-- | unix/tclUnixFile.c | 52 | ||||
-rw-r--r-- | unix/tclUnixInit.c | 29 | ||||
-rw-r--r-- | unix/tclUnixPort.h | 37 | ||||
-rw-r--r-- | unix/tclUnixSock.c | 25 | ||||
-rw-r--r-- | unix/tclUnixTime.c | 60 |
10 files changed, 428 insertions, 86 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in index b0c688c..d9f05ee 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.17 1999/02/02 23:00:07 stanton Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.18 1999/03/10 05:52:52 stanton Exp $ # Current Tcl version; used in various names. @@ -131,6 +131,15 @@ NOTIFY_OBJS = tclUnixNotfy.o MEM_DEBUG_FLAGS = #MEM_DEBUG_FLAGS = -DTCL_MEM_DEBUG +# To enable support for stubs in Tcl. +STUB_LIB_FILE = @STUB_LIB_FILE@ + +TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ +#TCL_STUB_LIB_FILE = libtclstub.a + +TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ +#TCL_STUB_LIB_FLAG = -ltclstub + # To enable compilation debugging reverse the comment characters on # one of the following lines. COMPILE_DEBUG_FLAGS = @@ -164,6 +173,7 @@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ # these definitions by hand. SHLIB_LD = @SHLIB_LD@ +SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_SUFFIX = @SHLIB_SUFFIX@ #SHLIB_SUFFIX = @@ -184,6 +194,9 @@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ #TCL_LIB_FLAG = -ltcl +TCL_EXP_FILE = @TCL_EXP_FILE@ +TCL_BUILD_EXP_FILE = @TCL_BUILD_EXP_FILE@ + #---------------------------------------------------------------- # The information below is modified by the configure script when # Makefile is generated from Makefile.in. You shouldn't normally @@ -215,12 +228,17 @@ CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${TCL_SHLIB_CFLAGS} \ ${AC_FLAGS} ${MATH_FLAGS} ${GENERIC_FLAGS} ${PROTO_FLAGS} ${MEM_DEBUG_FLAGS} \ ${COMPILE_DEBUG_FLAGS} ${ENV_FLAGS} -DTCL_SHLIB_EXT=\"${SHLIB_SUFFIX}\" +STUB_CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ +-I${GENERIC_DIR} -I${SRC_DIR} \ +${AC_FLAGS} ${MATH_FLAGS} ${GENERIC_FLAGS} ${PROTO_FLAGS} ${MEM_DEBUG_FLAGS} \ +${COMPILE_DEBUG_FLAGS} ${ENV_FLAGS} -DTCL_SHLIB_EXT=\"${SHLIB_SUFFIX}\" + LIBS = @DL_LIBS@ @LIBS@ $(MATH_LIBS) -lc DEPEND_SWITCHES = ${CFLAGS} -I${GENERIC_DIR} -I${SRC_DIR} \ ${AC_FLAGS} ${MATH_FLAGS} \ ${GENERIC_FLAGS} ${PROTO_FLAGS} ${MEM_DEBUG_FLAGS} \ --DTCL_SHLIB_EXT=\"${SHLIB_SUFFIX}\" +-DTCL_SHLIB_EXT=\"${SHLIB_SUFFIX}\" $(STUB_FLAGS) TCLSH_OBJS = tclAppInit.o @@ -230,27 +248,41 @@ TCLTEST_OBJS = tclTestInit.o tclTest.o tclTestObj.o tclTestProcBodyObj.o \ XTTEST_OBJS = tclTest.o tclTestObj.o tclUnixTest.o tclXtNotify.o \ tclXtTest.o xtTestInit.o -GENERIC_OBJS = panic.o regexp.o tclAsync.o tclBasic.o tclBinary.o tclCkalloc.o \ +GENERIC_OBJS = regexp.o tclAlloc.o tclAsync.o tclBasic.o tclBinary.o \ + tclCkalloc.o \ tclClock.o tclCmdAH.o tclCmdIL.o tclCmdMZ.o tclCompExpr.o \ tclCompile.o tclDate.o tclEnv.o tclEvent.o tclExecute.o \ tclFCmd.o tclFileName.o tclGet.o tclHash.o tclHistory.o \ tclIndexObj.o tclInterp.o tclIO.o tclIOCmd.o tclIOSock.o \ tclIOUtil.o tclLink.o tclListObj.o tclLoad.o tclMain.o tclNamesp.o \ - tclNotify.o tclObj.o tclParse.o tclPipe.o tclPkg.o tclPosixStr.o \ - tclPreserve.o tclProc.o tclStringObj.o tclTimer.o tclUtil.o tclVar.o \ - tclResolve.o + tclNotify.o tclObj.o tclPanic.o tclParse.o tclPipe.o tclPkg.o \ + tclPosixStr.o tclPreserve.o tclProc.o tclResolve.o tclStringObj.o \ + tclStubInit.o tclTimer.o tclUtil.o tclVar.o + +STUB_LIB_OBJS = tclIntPlatStubs.o tclIntStubs.o tclPlatStubs.o tclStubLib.o \ + tclStubs.o -OBJS = ${GENERIC_OBJS} ${UNIX_OBJS} ${NOTIFY_OBJS} ${COMPAT_OBJS} @DL_OBJS@ +OBJS = ${GENERIC_OBJS} ${UNIX_OBJS} ${NOTIFY_OBJS} ${COMPAT_OBJS} \ + @DL_OBJS@ + +TCL_DECLS = \ + $(GENERIC_DIR)/tcl.decls \ + $(GENERIC_DIR)/tclInt.decls GENERIC_HDRS = \ - $(GENERIC_DIR)/tclRegexp.h \ $(GENERIC_DIR)/tcl.h \ + $(GENERIC_DIR)/tclDecls.h \ $(GENERIC_DIR)/tclInt.h \ + $(GENERIC_DIR)/tclIntDecls.h \ + $(GENERIC_DIR)/tclIntPlatDecls.h \ + $(GENERIC_DIR)/tclPatch.h \ + $(GENERIC_DIR)/tclPlatDecls.h \ $(GENERIC_DIR)/tclPort.h \ - $(GENERIC_DIR)/tclPatch.h + $(GENERIC_DIR)/tclRegexp.h GENERIC_SRCS = \ $(GENERIC_DIR)/regexp.c \ + $(GENERIC_DIR)/tclAlloc.c \ $(GENERIC_DIR)/tclAsync.c \ $(GENERIC_DIR)/tclBasic.c \ $(GENERIC_DIR)/tclBinary.c \ @@ -290,6 +322,7 @@ GENERIC_SRCS = \ $(GENERIC_DIR)/tclPreserve.c \ $(GENERIC_DIR)/tclProc.c \ $(GENERIC_DIR)/tclResolve.c \ + $(GENERIC_DIR)/tclStubInit.c \ $(GENERIC_DIR)/tclStringObj.c \ $(GENERIC_DIR)/tclTest.c \ $(GENERIC_DIR)/tclTestObj.c \ @@ -298,6 +331,13 @@ GENERIC_SRCS = \ $(GENERIC_DIR)/tclUtil.c \ $(GENERIC_DIR)/tclVar.c +STUB_SRCS = \ + $(GENERIC_DIR)/tclIntPlatStubs.c \ + $(GENERIC_DIR)/tclIntStubs.c \ + $(GENERIC_DIR)/tclPlatStubs.c \ + $(GENERIC_DIR)/tclStubLib.c \ + $(GENERIC_DIR)/tclStubs.c + UNIX_HDRS = \ $(UNIX_DIR)/tclUnixPort.h @@ -329,9 +369,9 @@ DL_SRCS = \ # compile on the current machine, and they will cause problems for # things like "make depend". -SRCS = $(GENERIC_SRCS) $(UNIX_SRCS) +SRCS = $(GENERIC_SRCS) $(UNIX_SRCS) $(STUB_SRCS) -all: ${TCL_LIB_FILE} tclsh +all: ${TCL_LIB_FILE} $(TCL_STUB_LIB_FILE) tclsh # The following target is configured by autoconf to generate either # a shared library or non-shared library for Tcl. @@ -340,6 +380,11 @@ ${TCL_LIB_FILE}: ${OBJS} @MAKE_LIB@ $(RANLIB) ${TCL_LIB_FILE} +${STUB_LIB_FILE}: ${STUB_LIB_OBJS} + rm -f ${STUB_LIB_FILE} + @MAKE_STUB_LIB@ + $(RANLIB) ${STUB_LIB_FILE} + # Make target which outputs the list of the .o contained in the Tcl lib # usefull to build a single big shared library containing Tcl and other # extensions. used for the Tcl Plugin. -- dl @@ -403,7 +448,7 @@ topDirName: gendate: yacc -l $(GENERIC_DIR)/tclGetDate.y sed -e 's/yy/TclDate/g' -e '/^#include <values.h>/d' \ - -e 's/SCCSID/RCS: @(#) $Id: Makefile.in,v 1.17 1999/02/02 23:00:07 stanton Exp $' + -e 's/SCCSID/RCS: @(#) \$Id\$' -e '/#ifdef __STDC__/,/#endif/d' -e '/TclDateerrlab:/d' \ -e '/TclDatenewstate:/d' -e '/#pragma/d' \ <y.tab.c >$(GENERIC_DIR)/tclDate.c @@ -433,7 +478,8 @@ install: install-binaries install-libraries install-man # some ranlibs write to current directory, and this might not always be # possible (e.g. if installing as root). -install-binaries: $(TCL_LIB_FILE) tclsh +install-binaries: $(TCL_LIB_FILE) $(TCL_STUB_LIB_FILE) $(TCL_BUILD_EXP_FILE) \ + tclsh @for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \ do \ if [ ! -d $$i ] ; then \ @@ -447,10 +493,20 @@ install-binaries: $(TCL_LIB_FILE) tclsh @$(INSTALL_DATA) $(TCL_LIB_FILE) $(LIB_INSTALL_DIR)/$(TCL_LIB_FILE) @(cd $(LIB_INSTALL_DIR); $(RANLIB) $(TCL_LIB_FILE)) @chmod 555 $(LIB_INSTALL_DIR)/$(TCL_LIB_FILE) + @if test "$(TCL_BUILD_EXP_FILE)" != ""; then \ + echo "Installing $(TCL_EXP_FILE)"; \ + $(INSTALL_DATA) $(TCL_BUILD_EXP_FILE) \ + $(LIB_INSTALL_DIR)/$(TCL_EXP_FILE); \ + fi @echo "Installing tclsh" @$(INSTALL_PROGRAM) tclsh $(BIN_INSTALL_DIR)/tclsh$(VERSION) @echo "Installing tclConfig.sh" @$(INSTALL_DATA) tclConfig.sh $(LIB_INSTALL_DIR)/tclConfig.sh + @if test "$(TCL_STUB_LIB_FILE)" != "" ; then \ + echo "Installing $(TCL_STUB_LIB_FILE)"; \ + $(INSTALL_DATA) $(STUB_LIB_FILE) \ + $(LIB_INSTALL_DIR)/$(TCL_STUB_LIB_FILE); \ + fi install-libraries: @for i in $(INSTALL_ROOT)$(prefix)/lib $(INCLUDE_INSTALL_DIR) \ @@ -472,8 +528,11 @@ install-libraries: else true; \ fi; \ done; - @echo "Installing tcl.h" - @$(INSTALL_DATA) $(GENERIC_DIR)/tcl.h $(INCLUDE_INSTALL_DIR)/tcl.h + @for i in $(GENERIC_DIR)/tcl.h $(GENERIC_DIR)/tclDecls.h ; \ + do \ + echo "Installing $$i"; \ + $(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR); \ + done; @for i in $(TOP_DIR)/library/*.tcl $(TOP_DIR)/library/tclIndex $(UNIX_DIR)/tclAppInit.c $(UNIX_DIR)/ldAix; \ do \ echo "Installing $$i"; \ @@ -577,15 +636,18 @@ xtTestInit.o: $(UNIX_DIR)/tclAppInit.c # Object files used on all Unix systems: -panic.o: $(GENERIC_DIR)/panic.c - $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/panic.c - regexp.o: $(GENERIC_DIR)/regexp.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/regexp.c tclAppInit.o: $(UNIX_DIR)/tclAppInit.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclAppInit.c +# On unix we want to use the normal malloc/free implementation, so we +# specifically set the USE_NATIVE_MALLOC flag. + +tclAlloc.o: $(GENERIC_DIR)/tclAlloc.c + $(CC) -c $(CC_SWITCHES) -DUSE_NATIVE_MALLOC $(GENERIC_DIR)/tclAlloc.c + tclAsync.o: $(GENERIC_DIR)/tclAsync.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclAsync.c @@ -712,6 +774,9 @@ tclNotify.o: $(GENERIC_DIR)/tclNotify.c tclParse.o: $(GENERIC_DIR)/tclParse.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclParse.c +tclPanic.o: $(GENERIC_DIR)/tclPanic.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPanic.c + tclPipe.o: $(GENERIC_DIR)/tclPipe.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPipe.c @@ -733,6 +798,9 @@ tclResolve.o: $(GENERIC_DIR)/tclResolve.c tclStringObj.o: $(GENERIC_DIR)/tclStringObj.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclStringObj.c +tclStubInit.o: $(GENERIC_DIR)/tclStubInit.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclStubInit.c + tclUtil.o: $(GENERIC_DIR)/tclUtil.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclUtil.c @@ -815,10 +883,54 @@ tmpnam.o: $(COMPAT_DIR)/tmpnam.c waitpid.o: $(COMPAT_DIR)/waitpid.c $(CC) -c $(CC_SWITCHES) $(COMPAT_DIR)/waitpid.c + +# Stub library binaries, these must be compiled for use in a shared library +# even though they will be placed in a static archive + +tclIntPlatStubs.o: $(GENERIC_DIR)/tclIntPlatStubs.c + $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclIntPlatStubs.c + +tclIntStubs.o: $(GENERIC_DIR)/tclIntStubs.c + $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclIntStubs.c + +tclPlatStubs.o: $(GENERIC_DIR)/tclPlatStubs.c + $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclPlatStubs.c + +tclStubLib.o: $(GENERIC_DIR)/tclStubLib.c + $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclStubLib.c + +tclStubs.o: $(GENERIC_DIR)/tclStubs.c + $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclStubs.c + .c.o: $(CC) -c $(CC_SWITCHES) $< # +# Target to regenerate header files and stub files from the *.decls tables. +# + +genstubs: + tclsh $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \ + $(GENERIC_DIR)/tcl.decls $(GENERIC_DIR)/tclInt.decls + +# +# Target to check that all exported functions have an entry in the stubs +# tables. +# + +checkstubs: + -@for i in `nm -p $(TCL_LIB_FILE) | awk '$$2 ~ /T/ { print $$3 }' \ + | sort -n`; do \ + match=0; \ + for j in $(TCL_DECLS); do \ + if [ `grep -c $$i $$j` -gt 0 ]; then \ + match=1; \ + fi; \ + done; \ + if [ $$match -eq 0 ]; then echo $$i; fi \ + done + +# # Target to check for proper usage of UCHAR macro. # diff --git a/unix/configure.in b/unix/configure.in index 67b3f6e..12561b9 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -2,7 +2,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. AC_INIT(../generic/tcl.h) -# RCS: @(#) $Id: configure.in,v 1.28 1999/02/03 18:37:42 stanton Exp $ +# RCS: @(#) $Id: configure.in,v 1.29 1999/03/10 05:52:52 stanton Exp $ TCL_VERSION=8.0 TCL_MAJOR_VERSION=8 @@ -641,6 +641,17 @@ AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])) # 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. #-------------------------------------------------------------------- # Step 1: set the variable "system" to hold the name and version number @@ -678,12 +689,16 @@ AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) fullSrcDir=`cd $srcdir; pwd` EXTRA_CFLAGS="" +TCL_EXPORT_FILE_SUFFIX="" TCL_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 +TCL_NEEDS_EXP_FILE=0 +TCL_BUILD_EXP_FILE="" +TCL_EXP_FILE="" case $system in AIX-4.[[2-9]]) SHLIB_CFLAGS="" @@ -694,8 +709,8 @@ case $system in DL_LIBS="-ldl" LD_FLAGS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - AIX=yes - TCL_SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' ;; AIX-*) SHLIB_CFLAGS="" @@ -706,7 +721,8 @@ case $system in DL_LIBS="-lld" LD_FLAGS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - TCL_SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' ;; BSD/OS-2.1*|BSD/OS-3*|BSD/OS-4*) SHLIB_CFLAGS="" @@ -728,7 +744,7 @@ case $system in LD_FLAGS="" LD_SEARCH_FLAGS="" ;; - HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) + HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*|HP-UX-*.11.*) SHLIB_SUFFIX=".sl" AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = yes; then @@ -778,8 +794,8 @@ case $system in ;; IRIX64-6.*) SHLIB_CFLAGS="" - SHLIB_LD="ld -32 -shared -rdata_shared -rpath /usr/local/lib" - SHLIB_LD_LIBS="" + SHLIB_LD="ld -32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" @@ -795,7 +811,7 @@ case $system in DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_FLAGS="-rdynamic" - LD_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="-Wl,-rpath,${LIB_RUNTIME_DIR}" else AC_CHECK_HEADER(dld.h, [ SHLIB_LD="ld -shared" @@ -962,7 +978,7 @@ case $system in DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_FLAGS="" - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' ;; ULTRIX-4.*) SHLIB_CFLAGS="-G 0" @@ -1227,34 +1243,47 @@ else ;; esac TCL_SHLIB_CFLAGS="" - TCL_LD_SEARCH_FLAGS="" + TCL_LD_SEARCH_FLAGS="${LD_SEARCH_FLAGS}" eval "TCL_LIB_FILE=libtcl${TCL_UNSHARED_LIB_SUFFIX}" MAKE_LIB="ar cr \${TCL_LIB_FILE} \${OBJS}" fi +# tclConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed +# so that the backslashes quoting the DBX braces are dropped. + +# Trick to replace DBGX with TCL_DBGX +DBGX='${TCL_DBGX}' +eval "TCL_LIB_FILE=${TCL_LIB_FILE}" + # Note: in the following variable, it's important to use the absolute # path name of the Tcl directory rather than "..": this is because # AIX remembers this path and will attempt to use it at run-time to look # up the Tcl library. -if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then - TCL_LIB_FLAG="-ltcl${TCL_VERSION}\${TCL_DBGX}" +if test $TCL_SHARED_BUILD = 0 -o $TCL_NEEDS_EXP_FILE = 0; then + if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then + TCL_LIB_FLAG="-ltcl${TCL_VERSION}\${TCL_DBGX}" + else + TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`\${TCL_DBGX}" + fi + TCL_BUILD_LIB_SPEC="-L`pwd` ${TCL_LIB_FLAG}" + TCL_LIB_SPEC="-L${exec_prefix}/lib ${TCL_LIB_FLAG}" else - TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`\${TCL_DBGX}" -fi -TCL_BUILD_LIB_SPEC="-L`pwd` ${TCL_LIB_FLAG}" -TCL_LIB_SPEC="-L${exec_prefix}/lib ${TCL_LIB_FLAG}" + TCL_BUILD_EXP_FILE="lib.exp" + eval "TCL_EXP_FILE=libtcl${TCL_EXPORT_FILE_SUFFIX}" -# tclConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed -# so that the backslashes quoting the DBX braces are dropped. - -# Trick to replace DBGX with TCL_DBGX -DBGX='${TCL_DBGX}' -eval "TCL_LIB_FILE=${TCL_LIB_FILE}" + # Replace DBGX with TCL_DBGX + eval "TCL_EXP_FILE=\"${TCL_EXP_FILE}\"" + + TCL_BUILD_LIB_SPEC="-bI:`pwd`/${TCL_BUILD_EXP_FILE}" + TCL_LIB_SPEC="-bI:${exec_prefix}/lib/${TCL_EXP_FILE}" +fi VERSION='${VERSION}' eval "CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" eval "CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" +eval "CFG_TCL_EXPORT_FILE_SUFFIX=${TCL_EXPORT_FILE_SUFFIX}" +VERSION=${TCL_VERSION} #-------------------------------------------------------------------- # The statements below define the symbol TCL_PACKAGE_PATH, which @@ -1269,6 +1298,40 @@ else TCL_PACKAGE_PATH="${prefix}/lib" fi +#-------------------------------------------------------------------- +# The statements below define various symbols relating to Tcl +# stub support. +#-------------------------------------------------------------------- +# Replace ${VERSION} with contents of ${TCL_VERSION} +eval "STUB_LIB_FILE=libtclstub${TCL_UNSHARED_LIB_SUFFIX}" +# Replace DBGX with TCL_DBGX +eval "STUB_LIB_FILE=\"${STUB_LIB_FILE}\"" + +MAKE_STUB_LIB="ar cr \${STUB_LIB_FILE} \${STUB_LIB_OBJS}" + +TCL_STUB_LIB_FILE=${STUB_LIB_FILE} + +if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then + TCL_STUB_LIB_FLAG="-ltclstub${TCL_VERSION}\${TCL_DBGX}" +else + TCL_STUB_LIB_FLAG="-ltclstub`echo ${TCL_VERSION} | tr -d .`\${TCL_DBGX}" +fi + +TCL_BUILD_STUB_LIB_SPEC="-L`pwd` ${TCL_STUB_LIB_FLAG}" +TCL_STUB_LIB_SPEC="-L${exec_prefix}/lib ${TCL_STUB_LIB_FLAG}" +TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}" +TCL_STUB_LIB_PATH="${exec_prefix}/lib/${TCL_STUB_LIB_FILE}" + +AC_SUBST(STUB_LIB_FILE) + +AC_SUBST(TCL_STUB_LIB_FILE) +AC_SUBST(TCL_STUB_LIB_FLAG) +AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) +AC_SUBST(TCL_STUB_LIB_SPEC) +AC_SUBST(TCL_BUILD_STUB_LIB_PATH) +AC_SUBST(TCL_STUB_LIB_PATH) +AC_SUBST(MAKE_STUB_LIB) + AC_SUBST(BUILD_DLTEST) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_DEFAULT) @@ -1276,6 +1339,7 @@ AC_SUBST(CFLAGS_OPTIMIZE) AC_SUBST(CFLAGS_WARNING) AC_SUBST(CFG_TCL_SHARED_LIB_SUFFIX) AC_SUBST(CFG_TCL_UNSHARED_LIB_SUFFIX) +AC_SUBST(CFG_TCL_EXPORT_FILE_SUFFIX) AC_SUBST(TCL_DBGX) AC_SUBST(DL_LIBS) AC_SUBST(DL_OBJS) @@ -1291,6 +1355,9 @@ AC_SUBST(TCL_BUILD_LIB_SPEC) AC_SUBST(TCL_LD_SEARCH_FLAGS) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) +AC_SUBST(TCL_NEEDS_EXP_FILE) +AC_SUBST(TCL_BUILD_EXP_FILE) +AC_SUBST(TCL_EXP_FILE) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_LIB_VERSIONS_OK) AC_SUBST(TCL_MAJOR_VERSION) @@ -10,7 +10,7 @@ # symbols exported by those files, and then invokes "ldCmd" to # perform the real link. # -# RCS: @(#) $Id: ldAix,v 1.2 1998/09/14 18:40:16 stanton Exp $ +# RCS: @(#) $Id: ldAix,v 1.3 1999/03/10 05:52:52 stanton Exp $ # Extract from the arguments the names of all of the object files. @@ -23,6 +23,9 @@ for i do fi done +# Extract the name of the object file that we're linking. +outputFile=`echo $args | sed -e 's/.*-o \([^ ]*\).*/\1/'` + # Create the export file from all of the object files, using nm followed # by sed editing. Here are some tricky aspects of this: # @@ -49,13 +52,12 @@ if test $osver -eq 3; then nmopts="-e" fi rm -f lib.exp -echo "#! " >lib.exp +echo "#! $outputFile" >lib.exp /usr/ccs/bin/nm $nmopts -h $ofiles | sed -e '/:$/d' -e '/ U /d' -e '/[ ]0|extern/d' -e '/unamex/d' -e 's/^\.//' -e 's/[ |].*//' | sort | uniq >>lib.exp -# Extract the name of the object file that we're linking. If it's a .a -# file, then link all the objects together into a single file "shr.o" -# and then put that into the archive. Otherwise link the object files -# directly into the .a file. +# If we're linking a .a file, then link all the objects together into a +# single file "shr.o" and then put that into the archive. Otherwise link +# the object files directly into the .a file. outputFile=`echo $args | sed -e 's/.*-o \([^ ]*\).*/\1/'` noDotA=`echo $outputFile | sed -e '/\.a$/d'` diff --git a/unix/mkLinks b/unix/mkLinks index b4da360..0b1b75e 100644 --- a/unix/mkLinks +++ b/unix/mkLinks @@ -728,6 +728,10 @@ if test -r PkgRequire.3; then ln PkgRequire.3 Tcl_PkgRequire.3 fi if test -r AddErrInfo.3; then + rm -f Tcl_SetErrorCodeVA.3 + ln AddErrInfo.3 Tcl_SetErrorCodeVA.3 +fi +if test -r AddErrInfo.3; then rm -f Tcl_PosixError.3 ln AddErrInfo.3 Tcl_PosixError.3 fi diff --git a/unix/tclConfig.sh.in b/unix/tclConfig.sh.in index 4936f52..ae7c03c 100644 --- a/unix/tclConfig.sh.in +++ b/unix/tclConfig.sh.in @@ -9,7 +9,7 @@ # # The information in this file is specific to a single platform. # -# RCS: @(#) $Id: tclConfig.sh.in,v 1.8 1998/10/20 20:01:23 rjohnson Exp $ +# RCS: @(#) $Id: tclConfig.sh.in,v 1.9 1999/03/10 05:52:52 stanton Exp $ # Tcl's version number. TCL_VERSION='@TCL_VERSION@' @@ -37,6 +37,15 @@ TCL_SHARED_BUILD=@TCL_SHARED_BUILD@ # The name of the Tcl library (may be either a .a file or a shared library): TCL_LIB_FILE='@TCL_LIB_FILE@' +# Flag to indicate whether shared libraries need export files. +TCL_NEEDS_EXP_FILE=@TCL_NEEDS_EXP_FILE@ + +# String that can be evaluated to generate the part of the export file +# name that comes after the "libxxx" (includes version number, if any, +# extension, and anything else needed). May depend on the variables +# VERSION. On most UNIX systems this is ${VERSION}.exp. +TCL_EXPORT_FILE_SUFFIX='@CFG_TCL_EXPORT_FILE_SUFFIX@' + # Additional libraries to use when linking Tcl. TCL_LIBS='@DL_LIBS@ @LIBS@ @MATH_LIBS@' @@ -128,3 +137,26 @@ TCL_SRC_DIR='@TCL_SRC_DIR@' # "package require" commands. Contains the "prefix" directory plus also # the "exec_prefix" directory, if it is different. TCL_PACKAGE_PATH='@TCL_PACKAGE_PATH@' + +# Tcl supports stub. +TCL_SUPPORTS_STUBS=@TCL_SUPPORTS_STUBS@ + +# The name of the Tcl stub library (.a): +TCL_STUB_LIB_FILE='@TCL_STUB_LIB_FILE@' + +# -l flag to pass to the linker to pick up the Tcl stub library +TCL_STUB_LIB_FLAG='@TCL_STUB_LIB_FLAG@' + +# String to pass to linker to pick up the Tcl stub library from its +# build directory. +TCL_BUILD_STUB_LIB_SPEC='@TCL_BUILD_STUB_LIB_SPEC@' + +# String to pass to linker to pick up the Tcl stub library from its +# installed directory. +TCL_STUB_LIB_SPEC='@TCL_STUB_LIB_SPEC@' + +# Path to the Tcl stub library in the build directory. +TCL_BUILD_STUB_LIB_PATH='@TCL_BUILD_STUB_LIB_PATH@' + +# Path to the Tcl stub library in the install directory. +TCL_STUB_LIB_PATH='@TCL_STUB_LIB_PATH@' diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index f554e68..ace9c3e 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixFile.c,v 1.4 1998/09/14 18:40:17 stanton Exp $ + * RCS: @(#) $Id: tclUnixFile.c,v 1.5 1999/03/10 05:52:52 stanton Exp $ */ #include "tclInt.h" @@ -37,7 +37,6 @@ extern pid_t waitpid _ANSI_ARGS_((pid_t pid, int *stat_loc, int options)); * Static routines for this file: */ -static void FreeCurrentDir _ANSI_ARGS_((ClientData clientData)); static void FreeExecutableName _ANSI_ARGS_((ClientData clientData)); /* @@ -535,3 +534,52 @@ TclMatchFiles(interp, separators, dirPtr, pattern, tail) closedir(d); return result; } + +/* + *--------------------------------------------------------------------------- + * + * TclpAccess -- + * + * This function replaces the library version of access(). + * + * Results: + * See access() documentation. + * + * Side effects: + * See access() documentation. + * + *--------------------------------------------------------------------------- + */ + +int +TclpAccess(path, mode) + CONST char *path; /* Path of file to access. */ + int mode; /* Permission setting. */ +{ + return access(path, mode); +} + +/* + *---------------------------------------------------------------------- + * + * TclpStat -- + * + * This function replaces the library version of stat(). + * + * Results: + * See stat() documentation. + * + * Side effects: + * See stat() documentation. + * + *---------------------------------------------------------------------- + */ + +int +TclpStat(path, bufPtr) + CONST char *path; /* Path of file to stat. */ + struct stat *bufPtr; /* Filled with results of stat call. */ +{ + return stat(path, bufPtr); +} + diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index ded700b..30259ae 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixInit.c,v 1.11 1998/09/14 18:40:17 stanton Exp $ + * RCS: @(#) $Id: tclUnixInit.c,v 1.12 1999/03/10 05:52:52 stanton Exp $ */ #include "tclInt.h" @@ -280,3 +280,30 @@ Tcl_SourceRCFile(interp) Tcl_DStringFree(&temp); } } + +/* + *---------------------------------------------------------------------- + * + * TclpCheckStackSpace -- + * + * Detect if we are about to blow the stack. Called before an + * evaluation can happen when nesting depth is checked. + * + * Results: + * 1 if there is enough stack space to continue; 0 if not. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +TclpCheckStackSpace() +{ + /* + * This function is unimplemented on Unix platforms. + */ + + return 1; +} diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index ca8c815..da64295 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -19,7 +19,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixPort.h,v 1.8 1998/09/29 18:22:39 rjohnson Exp $ + * RCS: @(#) $Id: tclUnixPort.h,v 1.9 1999/03/10 05:52:52 stanton Exp $ */ #ifndef _TCLUNIXPORT @@ -148,16 +148,6 @@ #endif /* - * The following defines denote malloc and free as the system calls - * used to allocate new memory. These defines are only used in the - * file tclCkalloc.c. - */ - -#define TclpAlloc(size) malloc(size) -#define TclpFree(ptr) free(ptr) -#define TclpRealloc(ptr, size) realloc(ptr, size) - -/* * The default platform eol translation on Unix is TCL_TRANSLATE_LF: */ @@ -300,15 +290,6 @@ EXTERN int gettimeofday _ANSI_ARGS_((struct timeval *tp, #endif /* - * On UNIX, there's no platform specific implementation of "TclpStat(...)" - * or "TclpAccess(...)". Simply call "stat(...)' and "access(...)" - * respectively. - */ - -#define TclpStat stat -#define TclpAccess access - -/* * On systems without symbolic links (i.e. S_IFLNK isn't defined) * define "lstat" to use "stat" instead. */ @@ -443,12 +424,6 @@ EXTERN int gettimeofday _ANSI_ARGS_((struct timeval *tp, #define TclPlatformExit(status) exit(status) /* - * The following functions always succeeds under Unix. - */ - -#define TclHasSockets(interp) (TCL_OK) - -/* * Variables provided by the C library: */ @@ -472,8 +447,6 @@ extern double strtod(); * standard Unix routines. */ -#define TclpGetDate(t,u) ((u) ? gmtime((t)) : localtime((t))) -#define TclStrftime(s,m,f,t) (strftime((s),(m),(f),(t))) #define TclpGetPid(pid) ((unsigned long) (pid)) #define TclpReleaseFile(file) @@ -484,11 +457,7 @@ extern double strtod(); #define TclpFinalize() -/* - * The following routine is only exported for testing purposes. - */ - -EXTERN int TclUnixWaitForFile _ANSI_ARGS_((int fd, int mask, - int timeout)); +#include "tclPlatDecls.h" +#include "tclIntPlatDecls.h" #endif /* _TCLUNIXPORT */ diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index 7a479b2..2013e8f 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixSock.c,v 1.2 1998/09/14 18:40:17 stanton Exp $ + * RCS: @(#) $Id: tclUnixSock.c,v 1.3 1999/03/10 05:52:52 stanton Exp $ */ #include "tcl.h" @@ -98,3 +98,26 @@ Tcl_GetHostName() hostname[0] = 0; return hostname; } + +/* + *---------------------------------------------------------------------- + * + * TclHasSockets -- + * + * Detect if sockets are available on this platform. + * + * Results: + * Returns TCL_OK. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +TclHasSockets(interp) + Tcl_Interp *interp; /* Not used. */ +{ + return TCL_OK; +} diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index b330d84..02a1570 100644 --- a/unix/tclUnixTime.c +++ b/unix/tclUnixTime.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixTime.c,v 1.2 1998/09/14 18:40:18 stanton Exp $ + * RCS: @(#) $Id: tclUnixTime.c,v 1.3 1999/03/10 05:52:53 stanton Exp $ */ #include "tclInt.h" @@ -234,3 +234,61 @@ TclpGetTime(timePtr) timePtr->sec = tv.tv_sec; timePtr->usec = tv.tv_usec; } + +/* + *---------------------------------------------------------------------- + * + * TclpGetDate -- + * + * This function converts between seconds and struct tm. If + * useGMT is true, then the returned date will be in Greenwich + * Mean Time (GMT). Otherwise, it will be in the local time zone. + * + * Results: + * Returns a static tm structure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +struct tm * +TclpGetDate(time, useGMT) + TclpTime_t time; + int useGMT; +{ + const time_t *tp = (const time_t *)time; + + if (useGMT) { + return gmtime(tp); + } else { + return localtime(tp); + } +} + +/* + *---------------------------------------------------------------------- + * + * TclStrftime -- + * + * On Unix, we can safely call the native strftime implementation. + * + * Results: + * The normal strftime result. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +size_t +TclStrftime(s, maxsize, format, t) + char *s; + size_t maxsize; + const char *format; + const struct tm *t; +{ + return strftime(s, maxsize, format, t); +} |