From 58d31239da28572a5de112c0792a6e071066fddc Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 8 Jun 2012 13:00:01 +0000 Subject: 3530533 Centralize #include in the tclUnixPort.h header so that old unix systems that need inclusion in all compilation units are supported. --- ChangeLog | 6 ++++++ unix/tclUnixPort.h | 2 +- unix/tclUnixThrd.c | 2 -- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1fee643..fc826e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-06-08 Don Porter + + * unix/tclUnixPort.h: [Bug 3530533] Centralize #include + * unix/tclUnixThrd.c: in the tclUnixPort.h header so that old unix + systems that need inclusion in all compilation units are supported. + 2012-06-06 Jan Nijtmans * unix/tclUnixInit.c: On Cygwin, use win32 API in stead of uname() diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index 8684757..6ff13eb 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -626,6 +626,7 @@ typedef int socklen_t; #define TclpExit exit #ifdef TCL_THREADS +# include EXTERN struct tm *TclpLocaltime(CONST time_t *); EXTERN struct tm *TclpGmtime(CONST time_t *); /* #define localtime(x) TclpLocaltime(x) @@ -639,7 +640,6 @@ EXTERN struct tm *TclpGmtime(CONST time_t *); * Assume it is in pthread_np.h if it isn't in pthread.h. [Bug 1064882] * We might need to revisit this in the future. :^( */ -# include # include # endif # else diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index fd2cd8f..ad36242 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -14,8 +14,6 @@ #ifdef TCL_THREADS -#include "pthread.h" - typedef struct ThreadSpecificData { char nabuf[16]; } ThreadSpecificData; -- cgit v0.12 From 9ea2ab76f4646c44e090b45ba151a94d38b085f1 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 8 Jun 2012 13:04:58 +0000 Subject: Update autogoo for gettimeofday(). Thanks Joe English. --- ChangeLog | 6 ++ unix/configure | 220 ++++++++++++++++++++++------------------------------- unix/configure.in | 9 +-- unix/tclUnixPort.h | 4 - 4 files changed, 100 insertions(+), 139 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0bb1715..6b9c072 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-06-08 Don Porter + + * unix/configure.in: Update autogoo for gettimeofday(). + * unix/tclUnixPort.h: Thanks Joe English. + * unix/configure: autoconf 2.13 + 2012-06-06 Jan Nijtmans * unix/tclUnixInit.c: On Cygwin, use win32 API in stead of uname() diff --git a/unix/configure b/unix/configure index 5b8621f..8e3f47d 100755 --- a/unix/configure +++ b/unix/configure @@ -8266,70 +8266,18 @@ fi # The code below deals with several issues related to gettimeofday: # 1. Some systems don't provide a gettimeofday function at all # (set NO_GETTOD if this is the case). -# 2. SGI systems don't use the BSD form of the gettimeofday function, -# but they have a BSDgettimeofday function that can be used instead. -# 3. See if gettimeofday is declared in the header file. +# 2. See if gettimeofday is declared in the header file. # if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can # declare it. #-------------------------------------------------------------------- -echo $ac_n "checking for BSDgettimeofday""... $ac_c" 1>&6 -echo "configure:8278: checking for BSDgettimeofday" >&5 -if eval "test \"`echo '$''{'ac_cv_func_BSDgettimeofday'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char BSDgettimeofday(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_BSDgettimeofday) || defined (__stub___BSDgettimeofday) -choke me -#else -BSDgettimeofday(); -#endif - -; return 0; } -EOF -if { (eval echo configure:8306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_BSDgettimeofday=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_BSDgettimeofday=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'BSDgettimeofday`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_BSDGETTIMEOFDAY 1 -EOF - -else - echo "$ac_t""no" 1>&6 - - echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6 -echo "configure:8328: checking for gettimeofday" >&5 +echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6 +echo "configure:8276: checking for gettimeofday" >&5 if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gettimeofday=yes" else @@ -8375,17 +8323,14 @@ EOF fi - -fi - echo $ac_n "checking for gettimeofday declaration""... $ac_c" 1>&6 -echo "configure:8383: checking for gettimeofday declaration" >&5 +echo "configure:8328: checking for gettimeofday declaration" >&5 if eval "test \"`echo '$''{'tcl_cv_grep_gettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -8416,14 +8361,14 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 -echo "configure:8420: checking whether char is unsigned" >&5 +echo "configure:8365: checking whether char is unsigned" >&5 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 <&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_char_unsigned=yes else @@ -8479,13 +8424,13 @@ EOF fi echo $ac_n "checking signed char declarations""... $ac_c" 1>&6 -echo "configure:8483: checking signed char declarations" >&5 +echo "configure:8428: checking signed char declarations" >&5 if eval "test \"`echo '$''{'tcl_cv_char_signed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_char_signed=yes else @@ -8520,7 +8465,7 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for a putenv() that copies the buffer""... $ac_c" 1>&6 -echo "configure:8524: checking for a putenv() that copies the buffer" >&5 +echo "configure:8469: checking for a putenv() that copies the buffer" >&5 if eval "test \"`echo '$''{'tcl_cv_putenv_copy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8529,7 +8474,7 @@ else tcl_cv_putenv_copy=no else cat > conftest.$ac_ext < @@ -8551,7 +8496,7 @@ else } EOF -if { (eval echo configure:8555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_putenv_copy=no else @@ -8591,17 +8536,17 @@ fi if test "$langinfo_ok" = "yes"; then ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6 -echo "configure:8595: checking for langinfo.h" >&5 +echo "configure:8540: checking for langinfo.h" >&5 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8625,21 +8570,21 @@ fi fi echo $ac_n "checking whether to use nl_langinfo""... $ac_c" 1>&6 -echo "configure:8629: checking whether to use nl_langinfo" >&5 +echo "configure:8574: checking whether to use nl_langinfo" >&5 if test "$langinfo_ok" = "yes"; then if eval "test \"`echo '$''{'tcl_cv_langinfo_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { nl_langinfo(CODESET); ; return 0; } EOF -if { (eval echo configure:8643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_langinfo_h=yes else @@ -8672,17 +8617,17 @@ if test "`uname -s`" = "Darwin" ; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8676: checking for $ac_hdr" >&5 +echo "configure:8621: checking for $ac_hdr" >&5 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8631: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8711,12 +8656,12 @@ done for ac_func in copyfile do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8715: checking for $ac_func" >&5 +echo "configure:8660: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8768,17 +8713,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8772: checking for $ac_hdr" >&5 +echo "configure:8717: checking for $ac_hdr" >&5 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8727: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8807,12 +8752,12 @@ done for ac_func in OSSpinLockLock do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8811: checking for $ac_func" >&5 +echo "configure:8756: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8862,12 +8807,12 @@ done for ac_func in pthread_atfork do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8866: checking for $ac_func" >&5 +echo "configure:8811: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8931,17 +8876,17 @@ EOF do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8935: checking for $ac_hdr" >&5 +echo "configure:8880: checking for $ac_hdr" >&5 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8969,14 +8914,14 @@ done if test "$ac_cv_header_AvailabilityMacros_h" = yes; then echo $ac_n "checking if weak import is available""... $ac_c" 1>&6 -echo "configure:8973: checking if weak import is available" >&5 +echo "configure:8918: checking if weak import is available" >&5 if eval "test \"`echo '$''{'tcl_cv_cc_weak_import'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_cc_weak_import=yes else @@ -9020,13 +8965,13 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for fts""... $ac_c" 1>&6 -echo "configure:9024: checking for fts" >&5 +echo "configure:8969: checking for fts" >&5 if eval "test \"`echo '$''{'tcl_cv_api_fts'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -9041,7 +8986,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:9045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_api_fts=yes else @@ -9073,17 +9018,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:9077: checking for $ac_hdr" >&5 +echo "configure:9022: checking for $ac_hdr" >&5 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9087: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9113,17 +9058,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:9117: checking for $ac_hdr" >&5 +echo "configure:9062: checking for $ac_hdr" >&5 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9127: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9151,7 +9096,7 @@ done echo $ac_n "checking system version""... $ac_c" 1>&6 -echo "configure:9155: checking system version" >&5 +echo "configure:9100: checking system version" >&5 if eval "test \"`echo '$''{'tcl_cv_sys_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9182,7 +9127,7 @@ echo "$ac_t""$tcl_cv_sys_version" 1>&6 system=$tcl_cv_sys_version echo $ac_n "checking FIONBIO vs. O_NONBLOCK for nonblocking I/O""... $ac_c" 1>&6 -echo "configure:9186: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5 +echo "configure:9131: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5 case $system in OSF*) cat >> confdefs.h <<\EOF @@ -9226,17 +9171,17 @@ fi if test $tcl_ok = yes; then ac_safe=`echo "sys/sdt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/sdt.h""... $ac_c" 1>&6 -echo "configure:9230: checking for sys/sdt.h" >&5 +echo "configure:9175: checking for sys/sdt.h" >&5 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9263,7 +9208,7 @@ if test $tcl_ok = yes; then # Extract the first word of "dtrace", so it can be a program name with args. set dummy dtrace; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:9267: checking for $ac_word" >&5 +echo "configure:9212: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_DTRACE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9298,7 +9243,7 @@ fi test -z "$ac_cv_path_DTRACE" && tcl_ok=no fi echo $ac_n "checking whether to enable DTrace support""... $ac_c" 1>&6 -echo "configure:9302: checking whether to enable DTrace support" >&5 +echo "configure:9247: checking whether to enable DTrace support" >&5 MAKEFILE_SHELL='/bin/sh' if test $tcl_ok = yes; then cat >> confdefs.h <<\EOF @@ -9328,13 +9273,13 @@ echo "$ac_t""$tcl_ok" 1>&6 #-------------------------------------------------------------------- echo $ac_n "checking whether the cpuid instruction is usable""... $ac_c" 1>&6 -echo "configure:9332: checking whether the cpuid instruction is usable" >&5 +echo "configure:9277: checking whether the cpuid instruction is usable" >&5 if eval "test \"`echo '$''{'tcl_cv_cpuid'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_cpuid=yes else @@ -9398,7 +9343,7 @@ if test "`uname -s`" = "Darwin" ; then if test "`uname -s`" = "Darwin" ; then echo $ac_n "checking how to package libraries""... $ac_c" 1>&6 -echo "configure:9402: checking how to package libraries" >&5 +echo "configure:9347: checking how to package libraries" >&5 # Check whether --enable-framework or --disable-framework was given. if test "${enable_framework+set}" = set; then enableval="$enable_framework" @@ -9678,15 +9623,34 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed # Without the "./", some shells look in PATH for config.status. diff --git a/unix/configure.in b/unix/configure.in index 63d7170..55c305e 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -394,17 +394,12 @@ fi # The code below deals with several issues related to gettimeofday: # 1. Some systems don't provide a gettimeofday function at all # (set NO_GETTOD if this is the case). -# 2. SGI systems don't use the BSD form of the gettimeofday function, -# but they have a BSDgettimeofday function that can be used instead. -# 3. See if gettimeofday is declared in the header file. +# 2. See if gettimeofday is declared in the header file. # if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can # declare it. #-------------------------------------------------------------------- -AC_CHECK_FUNC(BSDgettimeofday, - [AC_DEFINE(HAVE_BSDGETTIMEOFDAY)], [ - AC_CHECK_FUNC(gettimeofday, , [AC_DEFINE(NO_GETTOD)]) -]) +AC_CHECK_FUNC(gettimeofday, , [AC_DEFINE(NO_GETTOD)]) AC_CACHE_CHECK([for gettimeofday declaration], tcl_cv_grep_gettimeofday, [ AC_EGREP_HEADER(gettimeofday, sys/time.h, tcl_cv_grep_gettimeofday=present, tcl_cv_grep_gettimeofday=missing)]) diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index 9a76301..7f913ca 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -305,10 +305,6 @@ EXTERN Tcl_WideUInt strtoull _ANSI_ARGS_((CONST char *string, # define CLK_TCK 60 # endif # endif -#else -# ifdef HAVE_BSDGETTIMEOFDAY -# define gettimeofday BSDgettimeofday -# endif #endif #ifdef GETTOD_NOT_DECLARED -- cgit v0.12