summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2021-01-15 18:22:53 (GMT)
committerdgp <dgp@users.sourceforge.net>2021-01-15 18:22:53 (GMT)
commitb3877e5fef6cb8855887a6cfa8c36202b0412076 (patch)
tree94d3a2457756c00e5213dfe504e8ff05aaf47af5 /unix
parent80907ca89f7fc5f2ffcbd473f9d94ca108fc081f (diff)
parent8229cd730444707ecef238b9678a5c8d779554f0 (diff)
downloadtcl-b3877e5fef6cb8855887a6cfa8c36202b0412076.zip
tcl-b3877e5fef6cb8855887a6cfa8c36202b0412076.tar.gz
tcl-b3877e5fef6cb8855887a6cfa8c36202b0412076.tar.bz2
Merge pre-TIP 481 commits from trunk
Diffstat (limited to 'unix')
-rw-r--r--unix/Makefile.in8
-rwxr-xr-xunix/configure43
-rw-r--r--unix/configure.ac59
-rw-r--r--unix/tcl.m494
-rw-r--r--unix/tclConfig.h.in20
-rw-r--r--unix/tclUnixChan.c14
-rw-r--r--unix/tclUnixInit.c9
-rw-r--r--unix/tclUnixPort.h8
-rw-r--r--unix/tclUnixTime.c14
9 files changed, 103 insertions, 166 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in
index fa5ac81..ac16293 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -1050,12 +1050,12 @@ install-libraries: libraries
@echo "Installing package msgcat 1.7.1 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl \
"$(MODULE_INSTALL_DIR)/9.0/msgcat-1.7.1.tm"
- @echo "Installing package tcltest 2.5.3 as a Tcl Module"
+ @echo "Installing package tcltest 2.5.4 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl \
- "$(MODULE_INSTALL_DIR)/9.0/tcltest-2.5.3.tm"
- @echo "Installing package platform 1.0.15 as a Tcl Module"
+ "$(MODULE_INSTALL_DIR)/9.0/tcltest-2.5.4.tm"
+ @echo "Installing package platform 1.0.16 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl \
- "$(MODULE_INSTALL_DIR)/9.0/platform-1.0.15.tm"
+ "$(MODULE_INSTALL_DIR)/9.0/platform-1.0.16.tm"
@echo "Installing package platform::shell 1.1.4 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl \
"$(MODULE_INSTALL_DIR)/9.0/platform/shell-1.1.4.tm"
diff --git a/unix/configure b/unix/configure
index e80d4cd..ada75a6 100755
--- a/unix/configure
+++ b/unix/configure
@@ -5585,7 +5585,7 @@ then :
*++|*++-*)
;;
*)
- CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers -Wdeclaration-after-statement"
+ CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers"
;;
esac
@@ -7206,7 +7206,7 @@ then :
Darwin-*) ;;
IRIX*) ;;
Linux*|GNU*) ;;
- NetBSD-*|OpenBSD-*) ;;
+ NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;;
OSF1-V*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;
@@ -7621,25 +7621,6 @@ then :
else $as_nop
tcl_cv_type_64bit=none
- # See if the compiler knows natively about __int64
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main (void)
-{
-__int64 value = (__int64) 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- tcl_type_64bit=__int64
-else $as_nop
- tcl_type_64bit="long long"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
# See if we could use long anyway Note that we substitute in the
# type that is our current guess for a 64-bit type inside this check
# program, so it should be modified only carefully...
@@ -7650,7 +7631,7 @@ int
main (void)
{
switch (0) {
- case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ;
+ case 1: case (sizeof(long long)==sizeof(long)): ;
}
;
return 0;
@@ -7658,7 +7639,7 @@ switch (0) {
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
- tcl_cv_type_64bit=${tcl_type_64bit}
+ tcl_cv_type_64bit="long long"
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
@@ -7670,12 +7651,6 @@ printf "%s\n" "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
-
-printf "%s\n" "#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit}" >>confdefs.h
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${tcl_cv_type_64bit}" >&5
-printf "%s\n" "${tcl_cv_type_64bit}" >&6; }
-
# Now check for auxiliary declarations
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5
printf %s "checking for struct dirent64... " >&6; }
@@ -9244,14 +9219,6 @@ then :
fi
-# Obsolete code to be removed.
-if test $ac_cv_header_sys_time_h = yes; then
-
-printf "%s\n" "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
-
-fi
-# End of obsolete code.
-
ac_fn_c_check_func "$LINENO" "gmtime_r" "ac_cv_func_gmtime_r"
if test "x$ac_cv_func_gmtime_r" = xyes
@@ -9286,7 +9253,7 @@ else $as_nop
int
main (void)
{
-struct tm tm; tm.tm_tzadj;
+struct tm tm; (void)tm.tm_tzadj;
;
return 0;
}
diff --git a/unix/configure.ac b/unix/configure.ac
index bcb161a..b51a9c5 100644
--- a/unix/configure.ac
+++ b/unix/configure.ac
@@ -17,8 +17,9 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [
/* Undef unused package specific autoheader defines so that we can
* include both tclConfig.h and tkConfig.h at the same time: */
/* override */ #undef PACKAGE_NAME
- /* override */ #undef PACKAGE_STRING
/* override */ #undef PACKAGE_TARNAME
+ /* override */ #undef PACKAGE_VERSION
+ /* override */ #undef PACKAGE_STRING
#endif /* _TCLCONFIG */])
])
@@ -113,7 +114,7 @@ if test -z "$no_pipe" && test -n "$GCC"; then
AC_CACHE_CHECK([if the compiler understands -pipe],
tcl_cv_cc_pipe, [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
- AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_pipe=yes],[tcl_cv_cc_pipe=no])
CFLAGS=$hold_cflags])
if test $tcl_cv_cc_pipe = yes; then
CFLAGS="$CFLAGS -pipe"
@@ -301,8 +302,8 @@ AC_CHECK_HEADERS(sys/modem.h)
#--------------------------------------------------------------------
AC_CACHE_CHECK([for fd_set in sys/types], tcl_cv_type_fd_set, [
- AC_TRY_COMPILE([#include <sys/types.h>],[fd_set readMask, writeMask;],
- tcl_cv_type_fd_set=yes, tcl_cv_type_fd_set=no)])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]], [[fd_set readMask, writeMask;]])],
+ [tcl_cv_type_fd_set=yes],[tcl_cv_type_fd_set=no])])
tcl_ok=$tcl_cv_type_fd_set
if test $tcl_ok = no; then
AC_CACHE_CHECK([for fd_mask in sys/select], tcl_cv_grep_fd_mask, [
@@ -413,12 +414,12 @@ AC_TYPE_SIZE_T
AC_TYPE_UID_T
AC_CACHE_CHECK([for socklen_t], tcl_cv_type_socklen_t, [
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
- ],[
+ ]], [[
socklen_t foo;
- ],[tcl_cv_type_socklen_t=yes],[tcl_cv_type_socklen_t=no])])
+ ]])],[tcl_cv_type_socklen_t=yes],[tcl_cv_type_socklen_t=no])])
if test $tcl_cv_type_socklen_t = no; then
AC_DEFINE(socklen_t, int, [Define as int if socklen_t is not available])
fi
@@ -445,12 +446,12 @@ AC_CHECK_FUNC(opendir, , [AC_DEFINE(USE_DIRENT2_H, 1, [May we include <dirent2.h
#--------------------------------------------------------------------
AC_CACHE_CHECK([union wait], tcl_cv_union_wait, [
- AC_TRY_LINK([#include <sys/types.h>
-#include <sys/wait.h>], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/wait.h>]], [[
union wait x;
WIFEXITED(x); /* Generates compiler error if WIFEXITED
* uses an int. */
- ], tcl_cv_union_wait=yes, tcl_cv_union_wait=no)])
+ ]])],[tcl_cv_union_wait=yes],[tcl_cv_union_wait=no])])
if test $tcl_cv_union_wait = no; then
AC_DEFINE(NO_UNION_WAIT, 1, [Do we have a usable 'union wait'?])
fi
@@ -500,10 +501,10 @@ fi
AC_C_CHAR_UNSIGNED
AC_CACHE_CHECK([signed char declarations], tcl_cv_char_signed, [
- AC_TRY_COMPILE(, [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
signed char *p;
p = 0;
- ], tcl_cv_char_signed=yes, tcl_cv_char_signed=no)])
+ ]])],[tcl_cv_char_signed=yes],[tcl_cv_char_signed=no])])
if test $tcl_cv_char_signed = yes; then
AC_DEFINE(HAVE_SIGNED_CHAR, 1, [Are characters signed?])
fi
@@ -513,7 +514,7 @@ fi
#--------------------------------------------------------------------
AC_CACHE_CHECK([for a putenv() that copies the buffer], tcl_cv_putenv_copy, [
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdlib.h>
#include <string.h>
#define OURVAR "havecopy=yes"
@@ -532,10 +533,10 @@ AC_CACHE_CHECK([for a putenv() that copies the buffer], tcl_cv_putenv_copy, [
return 1;
}
}
- ],
- tcl_cv_putenv_copy=no,
- tcl_cv_putenv_copy=yes,
- tcl_cv_putenv_copy=no)])
+ ]])],
+ [tcl_cv_putenv_copy=no],
+ [tcl_cv_putenv_copy=yes],
+ [tcl_cv_putenv_copy=no])])
if test $tcl_cv_putenv_copy = yes; then
AC_DEFINE(HAVE_PUTENV_THAT_COPIES, 1,
[Does putenv() copy strings or incorporate them by reference?])
@@ -558,9 +559,9 @@ AC_CHECK_FUNCS(cfmakeraw chflags mkstemps)
#--------------------------------------------------------------------
AC_CACHE_CHECK([isnan], tcl_cv_isnan, [
- AC_TRY_LINK([#include <math.h>], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
isnan(0.0); /* Generates an error if isnan is missing */
-], tcl_cv_isnan=yes, tcl_cv_isnan=no)])
+]])],[tcl_cv_isnan=yes],[tcl_cv_isnan=no])])
if test $tcl_cv_isnan = no; then
AC_DEFINE(NO_ISNAN, 1, [Do we have a usable 'isnan'?])
fi
@@ -586,7 +587,7 @@ if test "`uname -s`" = "Darwin" ; then
if test "$ac_cv_header_AvailabilityMacros_h" = yes; then
AC_CACHE_CHECK([if weak import is available], tcl_cv_cc_weak_import, [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020
#error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020
@@ -595,8 +596,8 @@ if test "`uname -s`" = "Darwin" ; then
#error MAC_OS_X_VERSION_MIN_REQUIRED < 1020
#endif
int rand(void) __attribute__((weak_import));
- ], [rand();],
- tcl_cv_cc_weak_import=yes, tcl_cv_cc_weak_import=no)
+ ]], [[rand();]])],
+ [tcl_cv_cc_weak_import=yes],[tcl_cv_cc_weak_import=no])
CFLAGS=$hold_cflags])
if test $tcl_cv_cc_weak_import = yes; then
AC_DEFINE(HAVE_WEAK_IMPORT, 1, [Is weak import available?])
@@ -604,7 +605,7 @@ if test "`uname -s`" = "Darwin" ; then
AC_CACHE_CHECK([if Darwin SUSv3 extensions are available],
tcl_cv_cc_darwin_c_source, [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
#error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
@@ -614,7 +615,7 @@ if test "`uname -s`" = "Darwin" ; then
#endif
#define _DARWIN_C_SOURCE 1
#include <sys/cdefs.h>
- ],,tcl_cv_cc_darwin_c_source=yes, tcl_cv_cc_darwin_c_source=no)
+ ]], [[]])],[tcl_cv_cc_darwin_c_source=yes],[tcl_cv_cc_darwin_c_source=no])
CFLAGS=$hold_cflags])
if test $tcl_cv_cc_darwin_c_source = yes; then
AC_DEFINE(_DARWIN_C_SOURCE, 1,
@@ -634,15 +635,15 @@ fi
#--------------------------------------------------------------------
AC_CACHE_CHECK([for fts], tcl_cv_api_fts, [
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/param.h>
#include <sys/stat.h>
#include <fts.h>
- ], [
+ ]], [[
char*const p[2] = {"/", NULL};
FTS *f = fts_open(p, FTS_PHYSICAL|FTS_NOCHDIR|FTS_NOSTAT, NULL);
FTSENT *e = fts_read(f); fts_close(f);
- ], tcl_cv_api_fts=yes, tcl_cv_api_fts=no)])
+ ]])],[tcl_cv_api_fts=yes],[tcl_cv_api_fts=no])])
if test $tcl_cv_api_fts = yes; then
AC_DEFINE(HAVE_FTS, 1, [Do we have fts functions?])
fi
@@ -806,7 +807,7 @@ AC_SUBST(INSTALL_MSGS)
#--------------------------------------------------------------------
AC_CACHE_CHECK([whether the cpuid instruction is usable], tcl_cv_cpuid, [
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
int index,regsPtr[4];
__asm__ __volatile__("mov %%ebx, %%edi \n\t"
"cpuid \n\t"
@@ -814,7 +815,7 @@ AC_CACHE_CHECK([whether the cpuid instruction is usable], tcl_cv_cpuid, [
"mov %%edi, %%ebx \n\t"
: "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3])
: "a"(index) : "edi");
- ], tcl_cv_cpuid=yes, tcl_cv_cpuid=no)])
+ ]])],[tcl_cv_cpuid=yes],[tcl_cv_cpuid=no])])
if test $tcl_cv_cpuid = yes; then
AC_DEFINE(HAVE_CPUID, 1, [Is the cpuid instruction usable?])
fi
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index cd8265e..5472e54 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -672,7 +672,7 @@ AC_DEFUN([SC_ENABLE_LANGINFO], [
if test "$langinfo_ok" = "yes"; then
AC_CACHE_VAL(tcl_cv_langinfo_h, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo(CODESET);]])],
- [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])])
+ [tcl_cv_langinfo_h=yes], [tcl_cv_langinfo_h=no])])
AC_MSG_RESULT([$tcl_cv_langinfo_h])
if test $tcl_cv_langinfo_h = yes; then
AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?])
@@ -768,6 +768,7 @@ AC_DEFUN([SC_CONFIG_MANPAGES], [
# Defines the following var:
#
# system - System/platform/version identification code.
+#
#--------------------------------------------------------------------
AC_DEFUN([SC_CONFIG_SYSTEM], [
@@ -908,7 +909,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
extern __attribute__((__visibility__("hidden"))) void f(void);
- void f(void) {}]], [[f();]])],[tcl_cv_cc_visibility_hidden=yes],
+ void f(void) {}]], [[f();]])],
+ [tcl_cv_cc_visibility_hidden=yes],
[tcl_cv_cc_visibility_hidden=no])
CFLAGS=$hold_cflags])
AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
@@ -963,7 +965,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
*++|*++-*)
;;
*)
- CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers -Wdeclaration-after-statement"
+ CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers"
;;
esac
@@ -1397,7 +1399,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
tcl_cv_cc_arch_ppc64, [
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_arch_ppc64=yes],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+ [tcl_cv_cc_arch_ppc64=yes],
[tcl_cv_cc_arch_ppc64=no])
CFLAGS=$hold_cflags])
AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [
@@ -1409,7 +1412,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
tcl_cv_cc_arch_x86_64, [
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -arch x86_64"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_arch_x86_64=yes],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+ [tcl_cv_cc_arch_x86_64=yes],
[tcl_cv_cc_arch_x86_64=no])
CFLAGS=$hold_cflags])
AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [
@@ -1429,7 +1433,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])],[tcl_cv_ld_single_module=yes],[tcl_cv_ld_single_module=no])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])],[tcl_cv_ld_single_module=yes],
+ [tcl_cv_ld_single_module=no])
LDFLAGS=$hold_ldflags])
AS_IF([test $tcl_cv_ld_single_module = yes], [
SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
@@ -1442,8 +1447,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
tcl_cv_ld_search_paths_first, [
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])],[tcl_cv_ld_search_paths_first=yes],
- [tcl_cv_ld_search_paths_first=no])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])],
+ [tcl_cv_ld_search_paths_first=yes],
+ [tcl_cv_ld_search_paths_first=no])
LDFLAGS=$hold_ldflags])
AS_IF([test $tcl_cv_ld_search_paths_first = yes], [
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
@@ -1499,9 +1505,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
done
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <CoreFoundation/CoreFoundation.h>]],
- [[CFBundleRef b = CFBundleGetMainBundle();]])],
- [tcl_cv_lib_corefoundation_64=yes],
- [tcl_cv_lib_corefoundation_64=no])
+ [[CFBundleRef b = CFBundleGetMainBundle();]])],
+ [tcl_cv_lib_corefoundation_64=yes],
+ [tcl_cv_lib_corefoundation_64=no])
for v in CFLAGS CPPFLAGS LDFLAGS; do
eval $v'="$hold_'$v'"'
done])
@@ -1780,7 +1786,7 @@ dnl # preprocessing tests use only CPPFLAGS.
Darwin-*) ;;
IRIX*) ;;
Linux*|GNU*) ;;
- NetBSD-*|OpenBSD-*) ;;
+ NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;;
OSF1-V*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;
@@ -2111,33 +2117,22 @@ AC_DEFUN([SC_BLOCKING_STYLE], [
AC_DEFUN([SC_TIME_HANDLER], [
AC_CHECK_HEADERS(sys/time.h)
- m4_warn([obsolete],
-[Update your code to rely only on HAVE_SYS_TIME_H,
-then remove this warning and the obsolete code below it.
-All current systems provide time.h; it need not be checked for.
-Not all systems provide sys/time.h, but those that do, all allow
-you to include it and time.h simultaneously.])dnl
-AC_CHECK_HEADERS_ONCE([sys/time.h])
-# Obsolete code to be removed.
-if test $ac_cv_header_sys_time_h = yes; then
- AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both <sys/time.h>
- and <time.h>. This macro is obsolete.])
-fi
-# End of obsolete code.
-
+ AC_CHECK_HEADERS_ONCE([sys/time.h])
AC_CHECK_FUNCS(gmtime_r localtime_r mktime)
AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm tm; tm.tm_tzadj;]])],
- [tcl_cv_member_tm_tzadj=yes],[tcl_cv_member_tm_tzadj=no])])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm tm; (void)tm.tm_tzadj;]])],
+ [tcl_cv_member_tm_tzadj=yes],
+ [tcl_cv_member_tm_tzadj=no])])
if test $tcl_cv_member_tm_tzadj = yes ; then
AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?])
fi
AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm tm; (void)tm.tm_gmtoff;]])],
- [tcl_cv_member_tm_gmtoff=yes],[tcl_cv_member_tm_gmtoff=no])])
+ [tcl_cv_member_tm_gmtoff=yes],
+ [tcl_cv_member_tm_gmtoff=no])])
if test $tcl_cv_member_tm_gmtoff = yes ; then
AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?])
fi
@@ -2148,10 +2143,10 @@ fi
#
AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],
- [[extern long timezone;
+ [[extern long timezone;
timezone += 1;
exit (0);]])],
- [tcl_cv_timezone_long=yes],[tcl_cv_timezone_long=no])])
+ [tcl_cv_timezone_long=yes], [tcl_cv_timezone_long=no])])
if test $tcl_cv_timezone_long = yes ; then
AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
else
@@ -2160,10 +2155,10 @@ fi
#
AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],
- [[extern time_t timezone;
+ [[extern time_t timezone;
timezone += 1;
exit (0);]])],
- [tcl_cv_timezone_time=yes],[tcl_cv_timezone_time=no])])
+ [tcl_cv_timezone_time=yes], [tcl_cv_timezone_time=no])])
if test $tcl_cv_timezone_time = yes ; then
AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
fi
@@ -2174,8 +2169,9 @@ fi
# SC_TCL_LINK_LIBS
#
# Search for the libraries needed to link the Tcl shell.
-# Things like the math library (-lm) and socket stuff (-lsocket vs.
-# -lnsl) or thread library (-lpthread) are dealt with here.
+# Things like the math library (-lm), socket stuff (-lsocket vs.
+# -lnsl), zlib (-lz) and libtommath (-ltommath) or thread library
+# (-lpthread) are dealt with here.
#
# Arguments:
# None.
@@ -2317,11 +2313,11 @@ AC_DEFUN([SC_TCL_LINK_LIBS], [
AC_DEFUN([SC_TCL_EARLY_FLAG],[
AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
- AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
- AC_TRY_COMPILE([[#define ]$1[ 1
-]$2], $3,
- [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
- [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)))
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])],
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,[AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[[#define ]$1[ 1
+]$2]], [[$3]]),
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)]))
if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
AC_DEFINE($1, 1, [Add the ]$1[ flag when building])
tcl_flags="$tcl_flags $1"
@@ -2356,7 +2352,6 @@ AC_DEFUN([SC_TCL_EARLY_FLAGS],[
#
# Might define the following vars:
# TCL_WIDE_INT_IS_LONG
-# TCL_WIDE_INT_TYPE
# HAVE_STRUCT_DIRENT64, HAVE_DIR64
# HAVE_STRUCT_STAT64
# HAVE_TYPE_OFF64_T
@@ -2367,23 +2362,16 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [
AC_MSG_CHECKING([for 64-bit integer type])
AC_CACHE_VAL(tcl_cv_type_64bit,[
tcl_cv_type_64bit=none
- # See if the compiler knows natively about __int64
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[__int64 value = (__int64) 0;]])],
- [tcl_type_64bit=__int64],[tcl_type_64bit="long long"])
# See if we could use long anyway Note that we substitute in the
# type that is our current guess for a 64-bit type inside this check
# program, so it should be modified only carefully...
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[switch (0) {
- case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ;
- }]])],[tcl_cv_type_64bit=${tcl_type_64bit}],[])])
+ case 1: case (sizeof(long long)==sizeof(long)): ;
+ }]])],[tcl_cv_type_64bit="long long"],[])])
if test "${tcl_cv_type_64bit}" = none ; then
AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Do 'long' and 'long long' have the same size (64-bit)?])
AC_MSG_RESULT([yes])
else
- AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit},
- [What type should be used to define wide integers?])
- AC_MSG_RESULT([${tcl_cv_type_64bit}])
-
# Now check for auxiliary declarations
AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
@@ -2397,7 +2385,7 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <dirent.h>]], [[struct dirent64 *p; DIR64 d = opendir64(".");
p = readdir64(d); rewinddir64(d); closedir64(d);]])],
- [tcl_cv_DIR64=yes],[tcl_cv_DIR64=no])])
+ [tcl_cv_DIR64=yes], [tcl_cv_DIR64=no])])
if test "x${tcl_cv_DIR64}" = "xyes" ; then
AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in <sys/types.h>?])
fi
@@ -2405,7 +2393,7 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [
AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[struct stat64 p;
]])],
- [tcl_cv_struct_stat64=yes],[tcl_cv_struct_stat64=no])])
+ [tcl_cv_struct_stat64=yes], [tcl_cv_struct_stat64=no])])
if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in <sys/stat.h>?])
fi
@@ -2415,7 +2403,7 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [
AC_CACHE_VAL(tcl_cv_type_off64_t,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]], [[off64_t offset;
]])],
- [tcl_cv_type_off64_t=yes],[tcl_cv_type_off64_t=no])])
+ [tcl_cv_type_off64_t=yes], [tcl_cv_type_off64_t=no])])
dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the
dnl functions lseek64 and open64 are defined.
if test "x${tcl_cv_type_off64_t}" = "xyes" && \
diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in
index 117cf66..6a61bd0 100644
--- a/unix/tclConfig.h.in
+++ b/unix/tclConfig.h.in
@@ -139,7 +139,7 @@
/* Compiler support for module scope symbols */
#undef HAVE_HIDDEN
-/* Do we have the intptr_t type? */
+/* Define to 1 if the system has the type `intptr_t'. */
#undef HAVE_INTPTR_T
/* Define to 1 if you have the <inttypes.h> header file. */
@@ -289,7 +289,7 @@
/* Is off64_t in <sys/types.h>? */
#undef HAVE_TYPE_OFF64_T
-/* Do we have the uintptr_t type? */
+/* Define to 1 if the system has the type `uintptr_t'. */
#undef HAVE_UINTPTR_T
/* Define to 1 if you have the <unistd.h> header file. */
@@ -438,16 +438,9 @@
/* Do 'long' and 'long long' have the same size (64-bit)? */
#undef TCL_WIDE_INT_IS_LONG
-/* What type should be used to define wide integers? */
-#undef TCL_WIDE_INT_TYPE
-
/* Tcl with external libtommath */
#undef TCL_WITH_EXTERNAL_TOMMATH
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. This
- macro is obsolete. */
-#undef TIME_WITH_SYS_TIME
-
/* Is getcwd Posix-compliant? */
#undef USEGETWD
@@ -523,9 +516,6 @@
#undef inline
#endif
-/* Signed integer type wide enough to hold a pointer. */
-#undef intptr_t
-
/* Define to `int' if <sys/types.h> does not define. */
#undef mode_t
@@ -541,13 +531,11 @@
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
-/* Unsigned integer type wide enough to hold a pointer. */
-#undef uintptr_t
-
/* Undef unused package specific autoheader defines so that we can
* include both tclConfig.h and tkConfig.h at the same time: */
/* override */ #undef PACKAGE_NAME
- /* override */ #undef PACKAGE_STRING
/* override */ #undef PACKAGE_TARNAME
+ /* override */ #undef PACKAGE_VERSION
+ /* override */ #undef PACKAGE_STRING
#endif /* _TCLCONFIG */
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index 03e9f2d..f7b6b2b 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -129,9 +129,9 @@ static int FileInputProc(void *instanceData, char *buf,
static int FileOutputProc(void *instanceData,
const char *buf, int toWrite, int *errorCode);
static int FileTruncateProc(void *instanceData,
- Tcl_WideInt length);
-static Tcl_WideInt FileWideSeekProc(void *instanceData,
- Tcl_WideInt offset, int mode, int *errorCode);
+ long long length);
+static long long FileWideSeekProc(void *instanceData,
+ long long offset, int mode, int *errorCode);
static void FileWatchProc(void *instanceData, int mask);
#ifdef SUPPORTS_TTY
static int TtyCloseProc(void *instanceData,
@@ -440,16 +440,16 @@ TtyCloseProc(
*----------------------------------------------------------------------
*/
-static Tcl_WideInt
+static long long
FileWideSeekProc(
void *instanceData, /* File state. */
- Tcl_WideInt offset, /* Offset to seek to. */
+ long long offset, /* Offset to seek to. */
int mode, /* Relative to where should we seek? Can be
* one of SEEK_START, SEEK_CUR or SEEK_END. */
int *errorCodePtr) /* To store error code. */
{
FileState *fsPtr = (FileState *)instanceData;
- Tcl_WideInt newLoc;
+ long long newLoc;
newLoc = TclOSseek(fsPtr->fd, (Tcl_SeekOffset) offset, mode);
@@ -1973,7 +1973,7 @@ Tcl_GetOpenFile(
static int
FileTruncateProc(
void *instanceData,
- Tcl_WideInt length)
+ long long length)
{
FileState *fsPtr = (FileState *)instanceData;
int result;
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index 424e69b..ed03f69 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -46,10 +46,10 @@ DLLIMPORT extern __stdcall void GetSystemInfo(void *);
}
#endif
-#define NUMPROCESSORS 11
+#define NUMPROCESSORS 15
static const char *const processors[NUMPROCESSORS] = {
- "intel", "mips", "alpha", "ppc", "shx", "arm", "ia64", "alpha64", "msil",
- "amd64", "ia32_on_win64"
+ "i686", "mips", "alpha", "ppc", "shx", "arm", "ia64", "alpha64", "msil",
+ "x86_64", "ia32_on_win64", "neutral", "arm64", "arm32_on_win64", "ia32_on_arm64"
};
typedef struct {
@@ -885,8 +885,7 @@ TclpSetVariables(
GetSystemInfo(&sysInfo);
- Tcl_SetVar2(interp, "tcl_platform", "os",
- "Windows NT", TCL_GLOBAL_ONLY);
+ Tcl_SetVar2(interp, "tcl_platform", "os", "Windows NT", TCL_GLOBAL_ONLY);
sprintf(buffer, "%d.%d", osInfo.dwMajorVersion, osInfo.dwMinorVersion);
Tcl_SetVar2(interp, "tcl_platform", "osVersion", buffer, TCL_GLOBAL_ONLY);
if (sysInfo.wProcessorArchitecture < NUMPROCESSORS) {
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h
index 77426c8..cefe603 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -139,16 +139,10 @@ extern "C" {
# include <sys/select.h>
#endif
#include <sys/stat.h>
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
-#else
-# include <time.h>
-#endif
#endif
+#include <time.h>
#ifndef NO_SYS_WAIT_H
# include <sys/wait.h>
#endif
diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c
index 9d56709..dc48a32 100644
--- a/unix/tclUnixTime.c
+++ b/unix/tclUnixTime.c
@@ -72,13 +72,13 @@ TclpGetSeconds(void)
*----------------------------------------------------------------------
*/
-Tcl_WideInt
+long long
TclpGetMicroseconds(void)
{
Tcl_Time time;
tclGetTimeProcPtr(&time, tclTimeClientData);
- return ((Tcl_WideInt)time.sec)*1000000 + time.usec;
+ return ((long long)time.sec)*1000000 + time.usec;
}
/*
@@ -149,19 +149,19 @@ TclpGetClicks(void)
*----------------------------------------------------------------------
*/
-Tcl_WideInt
+long long
TclpGetWideClicks(void)
{
- Tcl_WideInt now;
+ long long now;
if (tclGetTimeProcPtr != NativeGetTime) {
Tcl_Time time;
tclGetTimeProcPtr(&time, tclTimeClientData);
- now = ((Tcl_WideInt)time.sec)*1000000 + time.usec;
+ now = ((long long)time.sec)*1000000 + time.usec;
} else {
#ifdef MAC_OSX_TCL
- now = (Tcl_WideInt) (mach_absolute_time() & INT64_MAX);
+ now = (long long) (mach_absolute_time() & INT64_MAX);
#else
#error Wide high-resolution clicks not implemented on this platform
#endif
@@ -189,7 +189,7 @@ TclpGetWideClicks(void)
double
TclpWideClicksToNanoseconds(
- Tcl_WideInt clicks)
+ long long clicks)
{
double nsec;