From 88cf7394be2377eefb261856894d49228a2b81c8 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Fri, 25 Jul 1997 19:49:22 +0000 Subject: [PATCH] Resolve conflicts, seems like just one of our changes didn't make it back. --- contrib/tcl/FREEBSD-upgrade | 8 + contrib/tcl/README.FreeBSD | 8 + contrib/tcl/doc/FindExec.3 | 3 +- contrib/tcl/doc/break.n | 3 +- contrib/tcl/doc/continue.n | 3 +- contrib/tcl/doc/expr.n | 92 +-- contrib/tcl/doc/unknown.n | 3 +- contrib/tcl/unix/configure | 989 +++++++++++++++++++++++++++------ contrib/tcl/unix/tclUnixTime.c | 25 +- 9 files changed, 907 insertions(+), 227 deletions(-) diff --git a/contrib/tcl/FREEBSD-upgrade b/contrib/tcl/FREEBSD-upgrade index dbd54908f2c5..e5954af27493 100644 --- a/contrib/tcl/FREEBSD-upgrade +++ b/contrib/tcl/FREEBSD-upgrade @@ -10,3 +10,11 @@ Tcl 7.5 update 1 cd tcl7.5 rm -rf win mac compat cvs import src/contrib/tcl TCL tcl7_5_p1 + +Tcl 8.0 beta 2 + Imported with the commands: + + tar zxvf tcl8.0b2.tar.gz + cd tcl8.0b2 + rm -rf win mac compat + cvs import src/contrib/tcl TCL tcl8_0_b2 diff --git a/contrib/tcl/README.FreeBSD b/contrib/tcl/README.FreeBSD index dbd54908f2c5..e5954af27493 100644 --- a/contrib/tcl/README.FreeBSD +++ b/contrib/tcl/README.FreeBSD @@ -10,3 +10,11 @@ Tcl 7.5 update 1 cd tcl7.5 rm -rf win mac compat cvs import src/contrib/tcl TCL tcl7_5_p1 + +Tcl 8.0 beta 2 + Imported with the commands: + + tar zxvf tcl8.0b2.tar.gz + cd tcl8.0b2 + rm -rf win mac compat + cvs import src/contrib/tcl TCL tcl8_0_b2 diff --git a/contrib/tcl/doc/FindExec.3 b/contrib/tcl/doc/FindExec.3 index be6e1f3cc3a0..b48b225e89c8 100644 --- a/contrib/tcl/doc/FindExec.3 +++ b/contrib/tcl/doc/FindExec.3 @@ -4,8 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" SCCS: @(#) FindExec.3 1.3 96/03/25 20:03:17 -'\" $Id$ +'\" SCCS: @(#) FindExec.3 1.4 96/10/09 08:29:29 '\" .so man.macros .TH Tcl_FindExecutable 3 7.5 Tcl "Tcl Library Procedures" diff --git a/contrib/tcl/doc/break.n b/contrib/tcl/doc/break.n index a1640a862b44..391ba910bbe9 100644 --- a/contrib/tcl/doc/break.n +++ b/contrib/tcl/doc/break.n @@ -5,8 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" SCCS: @(#) break.n 1.6 96/03/25 20:10:27 -'\" $Id$ +'\" SCCS: @(#) break.n 1.7 96/10/09 08:29:26 '\" .so man.macros .TH break n "" Tcl "Tcl Built-In Commands" diff --git a/contrib/tcl/doc/continue.n b/contrib/tcl/doc/continue.n index b5dc7af2cc2a..104b89d6ee8b 100644 --- a/contrib/tcl/doc/continue.n +++ b/contrib/tcl/doc/continue.n @@ -5,8 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" SCCS: @(#) continue.n 1.6 96/03/25 20:12:09 -'\" $Id$ +'\" SCCS: @(#) continue.n 1.7 96/10/09 08:29:27 '\" .so man.macros .TH continue n "" Tcl "Tcl Built-In Commands" diff --git a/contrib/tcl/doc/expr.n b/contrib/tcl/doc/expr.n index 9b7b60fadf6f..e7dda17681fd 100644 --- a/contrib/tcl/doc/expr.n +++ b/contrib/tcl/doc/expr.n @@ -1,15 +1,14 @@ '\" '\" Copyright (c) 1993 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. +'\" Copyright (c) 1994-1997 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" SCCS: @(#) expr.n 1.17 96/03/14 10:54:40 -'\" $Id$ +'\" SCCS: @(#) expr.n 1.25 97/04/29 10:11:52 '\" .so man.macros -.TH expr n 7.4 Tcl "Tcl Built-In Commands" +.TH expr n 8.0 Tcl "Tcl Built-In Commands" .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME @@ -20,10 +19,8 @@ expr \- Evaluate an expression .SH DESCRIPTION .PP -.VS Concatenates \fIarg\fR's (adding separator spaces between them), evaluates the result as a Tcl expression, and returns the value. -.VE The operators permitted in Tcl expressions are a subset of the operators permitted in C expressions, and they have the same meaning and precedence as the corresponding C operators. @@ -42,7 +39,7 @@ non-numeric operands and string comparisons. A Tcl expression consists of a combination of operands, operators, and parentheses. White space may be used between the operands and operators and -parentheses; it is ignored by the expression processor. +parentheses; it is ignored by the expression's instructions. Where possible, operands are interpreted as integer values. Integer values may be specified in decimal (the normal case), in octal (if the first character of the operand is \fB0\fR), or in hexadecimal (if the first @@ -51,7 +48,7 @@ If an operand does not have one of the integer formats given above, then it is treated as a floating-point number if that is possible. Floating-point numbers may be specified in any of the ways accepted by an ANSI-compliant C compiler (except that the -``f'', ``F'', ``l'', and ``L'' suffixes will not be permitted in +\fBf\fR, \fBF\fR, \fBl\fR, and \fBL\fR suffixes will not be permitted in most installations). For example, all of the following are valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16. If no numeric interpretation is possible, then an operand is left @@ -78,14 +75,12 @@ As a Tcl command enclosed in brackets. The command will be executed and its result will be used as the operand. .IP [6] -.VS As a mathematical function whose arguments have any of the above -forms for operands, such as ``\fBsin($x)\fR''. See below for a list of defined +forms for operands, such as \fBsin($x)\fR. See below for a list of defined functions. -.VE .LP Where substitutions occur above (e.g. inside quoted strings), they -are performed by the expression processor. +are performed by the expression's instructions. However, an additional layer of substitution may already have been performed by the command parser before the expression processor was called. @@ -111,9 +106,7 @@ The valid operators are listed below, grouped in decreasing order of precedence: .TP 20 \fB\-\0\0+\0\0~\0\0!\fR -.VS Unary minus, unary plus, bit-wise NOT, logical NOT. None of these operands -.VE may be applied to string operands, and bit-wise NOT may be applied only to integers. .TP 20 @@ -121,10 +114,8 @@ applied only to integers. Multiply, divide, remainder. None of these operands may be applied to string operands, and remainder may be applied only to integers. -.VS The remainder will always have the same sign as the divisor and an absolute value smaller than the divisor. -.VE .TP 20 \fB+\0\0\-\fR Add and subtract. Valid for any numeric operands. @@ -189,7 +180,6 @@ the Tcl parser will evaluate both \fB[a]\fR and \fB[b]\fR before invoking the \fBexpr\fR command. .SH "MATH FUNCTIONS" .PP -.VS Tcl supports the following mathematical functions in expressions: .DS .ta 3c 6c 9c @@ -202,7 +192,8 @@ Tcl supports the following mathematical functions in expressions: Each of these functions invokes the math library function of the same name; see the manual entries for the library functions for details on what they do. Tcl also implements the following functions for -conversion between integers and floating-point numbers: +conversion between integers and floating-point numbers and the +generation of random numbers: .TP \fBabs(\fIarg\fB)\fR Returns the absolute value of \fIarg\fR. \fIArg\fR may be either @@ -216,13 +207,23 @@ If \fIarg\fR is a floating value, returns \fIarg\fR, otherwise converts If \fIarg\fR is an integer value, returns \fIarg\fR, otherwise converts \fIarg\fR to integer by truncation and returns the converted value. .TP +\fBrand()\fR +Returns a floating point number from zero to just less than one or, +in mathematical terms, the range [0,1). The seed comes from the +internal clock of the machine or may be set manual with the srand +function. +.TP \fBround(\fIarg\fB)\fR If \fIarg\fR is an integer value, returns \fIarg\fR, otherwise converts \fIarg\fR to integer by rounding and returns the converted value. +.TP +\fBsrand(\fIarg\fB)\fR +The \fIarg\fR, which must be an integer, is used to reset the seed for +the random number generator. Returns the first random number from +that seed. Each interpreter has it's own seed. .PP In addition to these predefined functions, applications may define additional functions using \fBTcl_CreateMathFunc\fR(). -.VE .SH "TYPES, OVERFLOW, AND PRECISION" .PP All internal computations involving integers are done with the C type @@ -252,24 +253,13 @@ returns 1, while \fBexpr 5 / ( [string length "abcd"] + 0.0 )\fR .CE both return 1.25. -.VS -Floating-point values are always returned with a ``.'' -or an ``e'' so that they will not look like integer values. For +Floating-point values are always returned with a ``\fB.\fR'' +or an \fBe\fR so that they will not look like integer values. For example, .CS \fBexpr 20.0/5.0\fR .CE -returns ``4.0'', not ``4''. The global variable \fBtcl_precision\fR -determines the number of significant digits that are retained -when floating values are converted to strings (except that trailing -zeroes are omitted). If \fBtcl_precision\fR -is unset then 6 digits of precision are used. -To retain all of the significant bits of an IEEE floating-point -number set \fBtcl_precision\fR to 17; if a value is converted to -string with 17 digits of precision and then converted back to binary -for some later calculation, the resulting binary value is guaranteed -to be identical to the original one. -.VE +returns \fB4.0\fR, not \fB4\fR. .SH "STRING OPERATIONS" .PP @@ -287,14 +277,44 @@ For example, the commands .CE both return 1. The first comparison is done using integer comparison, and the second is done using string comparison after -the second operand is converted to the string ``18''. -.VS +the second operand is converted to the string \fB18\fR. Because of Tcl's tendency to treat values as numbers whenever possible, it isn't generally a good idea to use operators like \fB==\fR when you really want string comparison and the values of the operands could be arbitrary; it's better in these cases to use the \fBstring compare\fR command instead. -.VE + +.SH "PERFORMANCE CONSIDERATIONS" +.PP +Enclose expressions in braces for the best speed and the smallest +storage requirements. +This allows the Tcl bytecode compiler to generate the best code. +.PP +As mentioned above, expressions are substituted twice: +once by the Tcl parser and once by the \fBexpr\fR command. +For example, the commands +.CS +\fBset a 3\fR +\fBset b {$a + 2}\fR +\fBexpr $b*4\fR +.CE +return 11, not a multiple of 4. +This is because the Tcl parser will first substitute \fB$a + 2\fR for +the variable \fBb\fR, +then the \fBexpr\fR command will evaluate the expression \fB$a + 2*4\fR. +.PP +Most expressions do not require a second round of substitutions. +Either they are enclosed in braces or, if not, +their variable and command substitutions yield numbers or strings +that don't themselves require substitutions. +However, because a few unbraced expressions +need two rounds of substitutions, +the bytecode compiler must emit +additional instructions to handle this situation. +The most expensive code is required for +unbraced expressions that contain command substitutions. +These expressions must be implemented by generating new code +each time the expression is executed. .SH KEYWORDS arithmetic, boolean, compare, expression diff --git a/contrib/tcl/doc/unknown.n b/contrib/tcl/doc/unknown.n index 2f4ba74c7dba..a7be9421078d 100644 --- a/contrib/tcl/doc/unknown.n +++ b/contrib/tcl/doc/unknown.n @@ -5,8 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" SCCS: @(#) unknown.n 1.7 96/03/25 20:26:05 -'\" $Id$ +'\" SCCS: @(#) unknown.n 1.8 96/10/09 08:29:28 '\" .so man.macros .TH unknown n "" Tcl "Tcl Built-In Commands" diff --git a/contrib/tcl/unix/configure b/contrib/tcl/unix/configure index 82ba009c748a..d2cc5786bb82 100755 --- a/contrib/tcl/unix/configure +++ b/contrib/tcl/unix/configure @@ -404,11 +404,12 @@ else fi -# SCCS: @(#) configure.in 1.107 96/07/30 08:38:37 +# SCCS: @(#) configure.in 1.135 97/06/10 17:28:19 -TCL_VERSION=7.5 -TCL_MAJOR_VERSION=7 -TCL_MINOR_VERSION=5 +TCL_VERSION=8.0 +TCL_MAJOR_VERSION=8 +TCL_MINOR_VERSION=0 +TCL_PATCH_LEVEL=b2 VERSION=${TCL_VERSION} if test "${prefix}" = "NONE"; then @@ -417,6 +418,7 @@ fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi +TCL_SRC_DIR=`cd $srcdir/..; pwd` # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 @@ -541,7 +543,7 @@ else ac_cv_c_cross=yes else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext <&6 +if eval "test \"`echo '$''{'ac_cv_lib_bsd'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lbsd $LIBS" +cat > conftest.$ac_ext <&6 + libbsd=yes +else + echo "$ac_t""no" 1>&6 +fi + + if test $libbsd = yes; then + MATH_LIBS="$MATH_LIBS -lbsd" + fi +fi + #-------------------------------------------------------------------- # Supply substitutes for missing POSIX header files. Special # notes: @@ -951,7 +1000,7 @@ fi echo $ac_n "checking dirent.h""... $ac_c" 1>&6 cat > conftest.$ac_ext < #include @@ -1009,7 +1058,7 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error @@ -1023,7 +1072,7 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error @@ -1054,7 +1103,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1087,7 +1136,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1114,13 +1163,46 @@ EOF fi +ac_safe=`echo "values.h" | tr './\055' '___'` +echo $ac_n "checking for values.h""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +cat >> confdefs.h <<\EOF +#define NO_VALUES_H 1 +EOF + +fi + ac_safe=`echo "limits.h" | tr './\055' '___'` echo $ac_n "checking for limits.h""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1153,7 +1235,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1178,7 +1260,7 @@ tcl_ok=0 fi cat > conftest.$ac_ext < EOF @@ -1192,7 +1274,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -1206,7 +1288,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -1231,7 +1313,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1256,7 +1338,7 @@ tcl_ok=0 fi cat > conftest.$ac_ext < EOF @@ -1270,7 +1352,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -1295,7 +1377,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1322,6 +1404,39 @@ EOF fi +ac_safe=`echo "dlfcn.h" | tr './\055' '___'` +echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +cat >> confdefs.h <<\EOF +#define NO_DLFCN_H 1 +EOF + +fi + for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | tr './\055' '___'` @@ -1330,7 +1445,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1359,6 +1474,118 @@ fi done +#--------------------------------------------------------------------------- +# Determine which interface to use to talk to the serial port. +# Note that #include lines must begin in leftmost column for +# some compilers to recognize them as preprocessor directives. +#--------------------------------------------------------------------------- + +echo $ac_n "checking termios vs. termio vs. sgtty""... $ac_c" 1>&6 +if test "$cross_compiling" = yes; then + tk_ok=no +else +cat > conftest.$ac_ext < + +main() +{ + struct termios t; + if (tcgetattr(0, &t) == 0) { + cfsetospeed(&t, 0); + t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +} +EOF +eval $ac_link +if test -s conftest && (./conftest; exit) 2>/dev/null; then + tk_ok=termios +else + tk_ok=no +fi +fi +rm -fr conftest* +if test $tk_ok = termios; then + cat >> confdefs.h <<\EOF +#define USE_TERMIOS 1 +EOF + +else +if test "$cross_compiling" = yes; then + tk_ok=no +else +cat > conftest.$ac_ext < + +main() +{ + struct termio t; + if (ioctl(0, TCGETA, &t) == 0) { + t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +} +EOF +eval $ac_link +if test -s conftest && (./conftest; exit) 2>/dev/null; then + tk_ok=termio +else + tk_ok=no +fi +fi +rm -fr conftest* +if test $tk_ok = termio; then + cat >> confdefs.h <<\EOF +#define USE_TERMIO 1 +EOF + +else +if test "$cross_compiling" = yes; then + tk_ok=none +else +cat > conftest.$ac_ext < + +main() +{ + struct sgttyb t; + if (ioctl(0, TIOCGETP, &t) == 0) { + t.sg_ospeed = 0; + t.sg_flags |= ODDP | EVENP | RAW; + return 0; + } + return 1; +} +EOF +eval $ac_link +if test -s conftest && (./conftest; exit) 2>/dev/null; then + tk_ok=sgtty +else + tk_ok=none +fi +fi +rm -fr conftest* +if test $tk_ok = sgtty; then + cat >> confdefs.h <<\EOF +#define USE_SGTTY 1 +EOF + +fi +fi +fi +echo "$ac_t""$tk_ok" 1>&6 + #-------------------------------------------------------------------- # Include sys/select.h if it exists and if it supplies things # that appear to be useful and aren't already in sys/types.h. @@ -1371,7 +1598,7 @@ done echo $ac_n "checking fd_set and sys/select""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -1390,7 +1617,7 @@ rm -f conftest* if test $tk_ok = no; then cat > conftest.$ac_ext < EOF @@ -1428,7 +1655,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1461,7 +1688,7 @@ if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1494,7 +1721,7 @@ if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1526,7 +1753,7 @@ if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -1557,7 +1784,7 @@ if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -1590,7 +1817,7 @@ fi echo $ac_n "checking tm_tzadj in struct tm""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -1614,7 +1841,7 @@ rm -f conftest* echo $ac_n "checking tm_gmtoff in struct tm""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -1640,9 +1867,10 @@ rm -f conftest* # Its important to include time.h in this check, as some systems (like convex) # have timezone functions, etc. # -echo $ac_n "checking timezone variable""... $ac_c" 1>&6 +have_timezone=no +echo $ac_n "checking long timezone variable""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -1652,6 +1880,37 @@ extern long timezone; exit (0); ; return 0; } EOF +if eval $ac_compile; then + rm -rf conftest* + have_timezone=yes + cat >> confdefs.h <<\EOF +#define HAVE_TIMEZONE_VAR 1 +EOF + + echo "$ac_t""yes" 1>&6 +else + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + + +# +# On some systems (eg IRIX 6.2), timezone is a time_t and not a long. +# +if test "$have_timezone" = no; then + echo $ac_n "checking time_t timezone variable""... $ac_c" 1>&6 + cat > conftest.$ac_ext < +int main() { return 0; } +int t() { +extern time_t timezone; + timezone += 1; + exit (0); +; return 0; } +EOF if eval $ac_compile; then rm -rf conftest* cat >> confdefs.h <<\EOF @@ -1665,6 +1924,20 @@ else fi rm -f conftest* +fi + +# +# AIX does not have a timezone field in struct tm. When the AIX bsd +# library is used, the timezone global and the gettimeofday methods are +# to be avoided for timezone deduction instead, we deduce the timezone +# by comparing the localtime result on a known GMT value. +# +if test $libbsd = yes; then + cat >> confdefs.h <<\EOF +#define USE_DELTA_FOR_TZ 1 +EOF + +fi #-------------------------------------------------------------------- # On some systems strstr is broken: it returns a pointer even @@ -1676,7 +1949,7 @@ if test "$cross_compiling" = yes; then tcl_ok=no else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext </dev/null; then @@ -1971,7 +2244,7 @@ if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1993,7 +2266,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2011,7 +2284,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2032,7 +2305,7 @@ if test "$cross_compiling" = yes; then ac_cv_header_stdc=no else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2066,7 +2339,7 @@ if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2097,7 +2370,7 @@ if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2128,7 +2401,7 @@ if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2159,7 +2432,7 @@ if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -2199,7 +2472,7 @@ if eval "test \"`echo '$''{'ac_cv_func_opendir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 cat > conftest.$ac_ext < #include @@ -2290,7 +2563,7 @@ fi echo $ac_n "checking matherr support""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -2332,7 +2605,7 @@ if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < conftest.$ac_ext < - #include - #include - int gotSignal = 0; - sigProc(sig) - int sig; - { - gotSignal = 1; - } - main() - { - int pid, sts; - (void) signal(SIGCHLD, sigProc); - pid = vfork(); - if (pid < 0) { - exit(1); - } else if (pid == 0) { - (void) signal(SIGCHLD, SIG_DFL); - _exit(0); - } else { - (void) wait(&sts); - } - exit((gotSignal) ? 0 : 1); - } +#include +#include +#include +int gotSignal = 0; +sigProc(sig) + int sig; +{ + gotSignal = 1; +} +main() +{ + int pid, sts; + (void) signal(SIGCHLD, sigProc); + pid = vfork(); + if (pid < 0) { + exit(1); + } else if (pid == 0) { + (void) signal(SIGCHLD, SIG_DFL); + _exit(0); + } else { + (void) wait(&sts); + } + exit((gotSignal) ? 0 : 1); +} EOF eval $ac_link if test -s conftest && (./conftest; exit) 2>/dev/null; then @@ -2439,7 +2712,7 @@ if eval "test \"`echo '$''{'ac_cv_func_strncasecmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 cat > conftest.$ac_ext < EOF @@ -2696,7 +2969,7 @@ else ac_save_LIBS="$LIBS" LIBS="-linet $LIBS" cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < EOF @@ -2755,6 +3028,99 @@ else fi +#-------------------------------------------------------------------- +# The following code checks to see whether it is possible to get +# signed chars on this platform. This is needed in order to +# properly generate sign-extended ints from character values. +#-------------------------------------------------------------------- + +echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$GCC" = yes; then + # GCC predefines this symbol on systems where it applies. +cat > conftest.$ac_ext <&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_c_char_unsigned=yes +else + rm -rf conftest* + ac_cv_c_char_unsigned=no +fi +rm -f conftest* + +else +if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else +cat > conftest.$ac_ext </dev/null; then + ac_cv_c_char_unsigned=yes +else + ac_cv_c_char_unsigned=no +fi +fi +rm -fr conftest* +fi +fi +echo "$ac_t""$ac_cv_c_char_unsigned" 1>&6 +if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then + cat >> confdefs.h <<\EOF +#define __CHAR_UNSIGNED__ 1 +EOF + +fi + +echo $ac_n "checking signed char declarations""... $ac_c" 1>&6 +cat > conftest.$ac_ext <&6 +if test $tcl_ok = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SIGNED_CHAR 1 +EOF + +fi + #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right @@ -2779,7 +3145,7 @@ if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> confdefs.h <<\EOF -#define NO_DLFCN_H 1 -EOF - - AIX=yes TCL_SHARED_LIB_SUFFIX='${VERSION}.a' ;; - BSD/OS-2.1*) + BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" - SHLIB_LD="ld -r" - SHLIB_LD_FLAGS="" + SHLIB_LD="shlicc -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LD_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + dgux*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" @@ -3146,24 +3514,61 @@ EOF LD_SEARCH_FLAGS="" ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".sl" - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LD_FLAGS="-Wl,-E" - LD_SEARCH_FLAGS='-Wl,+b,${LIB_RUNTIME_DIR}:.' + echo $ac_n "checking for -ldld""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_lib_dld'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldld $LIBS" +cat > conftest.$ac_ext <&6 + tcl_ok=yes +else + echo "$ac_t""no" 1>&6 +tcl_ok=no +fi + + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".sl" + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LD_FLAGS="-Wl,-E" + LD_SEARCH_FLAGS='-Wl,+b,${LIB_RUNTIME_DIR}:.' + fi ;; IRIX-4.*) SHLIB_CFLAGS="-G 0" - SHLIB_SUFFIX="..o" + SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" - SHLIB_LD_LIBS="" + SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LD_FLAGS="-Wl,-D,08000000" - LD_SEARCH_FLAGS="" + LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + TCL_SHARED_LIB_SUFFIX='${VERSION}.a' ;; IRIX-5.*|IRIX-6.*) SHLIB_CFLAGS="" @@ -3202,7 +3607,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -3252,7 +3657,7 @@ fi LD_FLAGS="-Wl,-Bexport" LD_SEARCH_FLAGS="" ;; - NetBSD-*|FreeBSD-*) + NetBSD-*|FreeBSD-*|OpenBSD-*) # Not available on all versions: check for include file. ac_safe=`echo "dlfcn.h" | tr './\055' '___'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 @@ -3260,7 +3665,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -3283,30 +3688,30 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl2.o" + DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_FLAGS="" LD_SEARCH_FLAGS="" + TCL_SHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.so.1.0' else echo "$ac_t""no" 1>&6 SHLIB_CFLAGS="" - SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX="..o" + SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LD_FLAGS="" - LD_SEARCH_FLAGS="" + LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + TCL_SHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.a' fi - # FreeBSD doesn't handle version numbers with dots. Also, have to - # append a dummy version number to .so file names. + # FreeBSD doesn't handle version numbers with dots. - TCL_SHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.so.1.0' TCL_UNSHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.a' TCL_LIB_VERSIONS_OK=nodots ;; @@ -3320,7 +3725,7 @@ fi LD_FLAGS="" LD_SEARCH_FLAGS="" ;; - OSF1-1.012) + OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name @@ -3357,12 +3762,12 @@ fi RISCos-*) SHLIB_CFLAGS="-G 0" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX="..o" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LD_FLAGS="-Wl,-D,08000000" - LD_SEARCH_FLAGS="" + LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, @@ -3409,6 +3814,10 @@ fi SunOS-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="/usr/ccs/bin/ld -G -z text" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -3418,13 +3827,13 @@ fi ;; ULTRIX-4.*) SHLIB_CFLAGS="-G 0" - SHLIB_SUFFIX="..o" + SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" - SHLIB_LD_LIBS="" + SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LD_FLAGS="-Wl,-D,08000000" - LD_SEARCH_FLAGS="" + LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' ;; UNIX_SV*) SHLIB_CFLAGS="-KPIC" @@ -3433,17 +3842,47 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - LD_FLAGS="-Wl,-Bexport" + # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers + # that don't grok the -Bexport option. Test that it does. + hold_ldflags=$LDFLAGS + echo $ac_n "checking for ld accepts -Bexport flag""... $ac_c" 1>&6 + LDFLAGS="${LDFLAGS} -Wl,-Bexport" + cat > conftest.$ac_ext <&6 + if test $found = yes; then + LD_FLAGS="-Wl,-Bexport" + else + LD_FLAGS="" + fi LD_SEARCH_FLAGS="" ;; esac -# 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, +# 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 @@ -3459,7 +3898,7 @@ esac if test "x$DL_OBJS" = "xtclLoadAout.o" ; then echo $ac_n "checking sys/exec.h""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -3496,7 +3935,7 @@ EOF else echo $ac_n "checking a.out.h""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -3533,7 +3972,7 @@ EOF else echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -3574,6 +4013,20 @@ EOF fi fi +# Step 5: disable dynamic loading if requested via a command-line switch. + +# Check whether --enable-load or --disable-load was given. +enableval="$enable_load" +if test -n "$enableval"; then + tcl_ok=$enableval +else + tcl_ok=yes +fi + +if test "$tcl_ok" = "no"; then + DL_OBJS="" +fi + if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else @@ -3595,10 +4048,156 @@ fi if test "$DL_OBJS" != "tclLoadNone.o" ; then if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then - SHLIB_CFLAGS="-fPIC" + case $system in + AIX-*) + ;; + BSD/OS*) + ;; + IRIX*) + ;; + NetBSD-*|FreeBSD-*|OpenBSD-*) + ;; + RISCos-*) + ;; + ULTRIX-4.*) + ;; + *) + SHLIB_CFLAGS="-fPIC" + ;; + esac fi fi +#-------------------------------------------------------------------- +# The statements below check for systems where POSIX-style +# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. +# On these systems (mostly older ones), use the old BSD-style +# FIONBIO approach instead. +#-------------------------------------------------------------------- + +for ac_hdr in sys/ioctl.h +do +ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in sys/filio.h +do +ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + cat >> confdefs.h <&6 +fi +done + +echo $ac_n "checking FIONBIO vs. O_NONBLOCK for nonblocking I/O""... $ac_c" 1>&6 +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 + 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 + fi +fi +case $system in + # There used to be code here to use FIONBIO under AIX. However, it + # was reported that FIONBIO doesn't work under AIX 3.2.5. Since + # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO + # code (JO, 5/31/97). + + OSF*) + cat >> confdefs.h <<\EOF +#define USE_FIONBIO 1 +EOF + + echo "$ac_t""FIONBIO" 1>&6 + ;; + SunOS-4*) + cat >> confdefs.h <<\EOF +#define USE_FIONBIO 1 +EOF + + echo "$ac_t""FIONBIO" 1>&6 + ;; + ULTRIX-4.*) + cat >> confdefs.h <<\EOF +#define USE_FIONBIO 1 +EOF + + echo "$ac_t""FIONBIO" 1>&6 + ;; + *) + echo "$ac_t""O_NONBLOCK" 1>&6 + ;; +esac + #-------------------------------------------------------------------- # The statements below define a collection of symbols related to # building libtcl as a shared library instead of a static library. @@ -3619,17 +4218,28 @@ else tcl_ok=no fi -if test "$tcl_ok" = "yes" -a "${SHLIB_SUFFIX}" != "" \ - -a "${DL_OBJS}" != "tclLoadAout.o" ; then +if test "$tcl_ok" = "yes" -a "${SHLIB_SUFFIX}" != "" ; then TCL_SHLIB_CFLAGS="${SHLIB_CFLAGS}" TCL_LD_SEARCH_FLAGS="${LD_SEARCH_FLAGS}" eval "TCL_LIB_FILE=libtcl${TCL_SHARED_LIB_SUFFIX}" - MAKE_LIB="\${SHLIB_LD} -o ${TCL_LIB_FILE} \${OBJS} ${SHLIB_LD_LIBS}" - RANLIB=":" -else - if test "$AIX" = "no" ; then - SHLIB_LD_LIBS="" + if test "x$DL_OBJS" = "xtclLoadAout.o"; then + MAKE_LIB="ar cr ${TCL_LIB_FILE} \${OBJS}" + else + MAKE_LIB="\${SHLIB_LD} -o ${TCL_LIB_FILE} \${OBJS} ${SHLIB_LD_LIBS}" + RANLIB=":" fi +else + case $system in + BSD/OS*) + ;; + + AIX-*) + ;; + + *) + SHLIB_LD_LIBS="" + ;; + esac TCL_SHLIB_CFLAGS="" TCL_LD_SEARCH_FLAGS="" eval "TCL_LIB_FILE=libtcl${TCL_UNSHARED_LIB_SUFFIX}" @@ -3649,6 +4259,22 @@ else TCL_LIB_SPEC="-L${exec_prefix}/lib -ltcl`echo ${VERSION} | tr -d .`" fi +#-------------------------------------------------------------------- +# The statements below define the symbol TCL_PACKAGE_PATH, which +# gives a list of directories that may contain packages. The list +# consists of one directory for machine-dependent binaries and +# another for platform-independent scripts. +#-------------------------------------------------------------------- + +if test "$prefix" != "$exec_prefix"; then + TCL_PACKAGE_PATH="${exec_prefix}/lib ${prefix}/lib" +else + TCL_PACKAGE_PATH="${prefix}/lib" +fi + + + + @@ -3806,8 +4432,11 @@ s%@TCL_LIB_SPEC@%$TCL_LIB_SPEC%g s%@TCL_LIB_VERSIONS_OK@%$TCL_LIB_VERSIONS_OK%g s%@TCL_MAJOR_VERSION@%$TCL_MAJOR_VERSION%g s%@TCL_MINOR_VERSION@%$TCL_MINOR_VERSION%g +s%@TCL_PACKAGE_PATH@%$TCL_PACKAGE_PATH%g +s%@TCL_PATCH_LEVEL@%$TCL_PATCH_LEVEL%g s%@TCL_SHARED_LIB_SUFFIX@%$TCL_SHARED_LIB_SUFFIX%g s%@TCL_SHLIB_CFLAGS@%$TCL_SHLIB_CFLAGS%g +s%@TCL_SRC_DIR@%$TCL_SRC_DIR%g s%@TCL_UNSHARED_LIB_SUFFIX@%$TCL_UNSHARED_LIB_SUFFIX%g s%@TCL_VERSION@%$TCL_VERSION%g diff --git a/contrib/tcl/unix/tclUnixTime.c b/contrib/tcl/unix/tclUnixTime.c index 21f188534912..03a7315d6ccc 100644 --- a/contrib/tcl/unix/tclUnixTime.c +++ b/contrib/tcl/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. * - * SCCS: @(#) tclUnixTime.c 1.11 96/07/23 16:17:21 + * SCCS: @(#) tclUnixTime.c 1.12 97/01/08 17:38:15 */ #include "tclInt.h" @@ -88,7 +88,8 @@ TclpGetClicks() * this function. * * Results: - * Hours east of GMT. + * The return value is the local time zone, measured in + * minutes away from GMT (-ve for east, +ve for west). * * Side effects: * None. @@ -137,6 +138,24 @@ TclpGetTimeZone (currentTime) return timeZone; #endif +#if defined(USE_DELTA_FOR_TZ) +#define TCL_GOT_TIMEZONE 1 + /* + * This hack replaces using global var timezone or gettimeofday + * in situations where they are buggy such as on AIX when libbsd.a + * is linked in. + */ + + int timeZone; + time_t tt; + struct tm *stm; + tt = 849268800L; /* 1996-11-29 12:00:00 GMT */ + stm = localtime(&tt); /* eg 1996-11-29 6:00:00 CST6CDT */ + /* The calculation below assumes a max of +12 or -12 hours from GMT */ + timeZone = (12 - stm->tm_hour)*60 + (0 - stm->tm_min); + return timeZone; /* eg +360 for CST6CDT */ +#endif + /* * Must prefer timezone variable over gettimeofday, as gettimeofday does * not return timezone information on many systems that have moved this @@ -163,7 +182,7 @@ TclpGetTimeZone (currentTime) return timeZone; #endif -#if defined(HAVE_GETTIMEOFDAY) && !defined (TCL_GOT_TIMEZONE) +#if !defined(NO_GETTOD) && !defined (TCL_GOT_TIMEZONE) # define TCL_GOT_TIMEZONE struct timeval tv; struct timezone tz;