summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorsergey.brester <sergey.brester>2019-02-12 18:41:24 (GMT)
committersergey.brester <sergey.brester>2019-02-12 18:41:24 (GMT)
commit9a62e42dd654c613c75092b53a0d18e06a319692 (patch)
tree76d8881fe627b15359a646751531f9a780133ea7 /unix
parentccbd8395f4a51f5b769998058006ed3d36823ace (diff)
parent1dec12d61848ab939bde91eb6e3a095222cf4236 (diff)
downloadtcl-9a62e42dd654c613c75092b53a0d18e06a319692.zip
tcl-9a62e42dd654c613c75092b53a0d18e06a319692.tar.gz
tcl-9a62e42dd654c613c75092b53a0d18e06a319692.tar.bz2
merge 8.5 (note: to avoid too many conflicts, merged using `fossil merge --baseline 0055a16a8b core-8-5-branch`)
Diffstat (limited to 'unix')
-rw-r--r--unix/Makefile.in4
-rwxr-xr-xunix/configure68
-rw-r--r--unix/tcl.m421
-rw-r--r--unix/tclConfig.h.in3
-rw-r--r--unix/tclUnixFCmd.c18
-rw-r--r--unix/tclUnixFile.c6
-rw-r--r--unix/tclUnixPort.h15
-rw-r--r--unix/tclUnixThrd.c2
8 files changed, 115 insertions, 22 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 50f4bb3..7e8e4a3 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -785,8 +785,8 @@ install-libraries: libraries $(INSTALL_TZDATA) install-msgs
done;
@echo "Installing package msgcat 1.5.2 as a Tcl Module";
@$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/msgcat-1.5.2.tm;
- @echo "Installing package tcltest 2.3.8 as a Tcl Module";
- @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.3.8.tm;
+ @echo "Installing package tcltest 2.5.0 as a Tcl Module";
+ @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.5.0.tm;
@echo "Installing package platform 1.0.14 as a Tcl Module";
@$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.14.tm;
diff --git a/unix/configure b/unix/configure
index 7ff9f72..1e15a25 100755
--- a/unix/configure
+++ b/unix/configure
@@ -7646,7 +7646,7 @@ fi
fi
;;
- FreeBSD-*)
+ DragonFly-*|FreeBSD-*)
# This configuration from FreeBSD Ports.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="${CC} -shared"
@@ -8854,7 +8854,7 @@ fi
BSD/OS*) ;;
CYGWIN_*|MINGW32_*) ;;
IRIX*) ;;
- NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
+ NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;;
Darwin-*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;
@@ -9643,6 +9643,70 @@ _ACEOF
fi
+ echo "$as_me:$LINENO: checking for DIR64" >&5
+echo $ECHO_N "checking for DIR64... $ECHO_C" >&6
+if test "${tcl_cv_DIR64+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <dirent.h>
+int
+main ()
+{
+struct dirent64 *p; DIR64 d = opendir64(".");
+ p = readdir64(d); rewinddir64(d); closedir64(d);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_DIR64=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_DIR64=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_DIR64" >&5
+echo "${ECHO_T}$tcl_cv_DIR64" >&6
+ if test "x${tcl_cv_DIR64}" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DIR64 1
+_ACEOF
+
+ fi
+
echo "$as_me:$LINENO: checking for struct stat64" >&5
echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6
if test "${tcl_cv_struct_stat64+set}" = set; then
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 6b6d373..38f1377 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -93,8 +93,11 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
`ls -d ${prefix}/lib 2>/dev/null` \
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/pkg/lib 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
+ `ls -d /usr/local/lib/tcl8.5 2>/dev/null` \
+ `ls -d /usr/local/lib/tcl/tcl8.5 2>/dev/null` \
; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig="`(cd $i; pwd)`"
@@ -223,8 +226,11 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
`ls -d ${prefix}/lib 2>/dev/null` \
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/pkg/lib 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
+ `ls -d /usr/local/lib/tk8.5 2>/dev/null` \
+ `ls -d /usr/local/lib/tcl/tk8.5 2>/dev/null` \
; do
if test -f "$i/tkConfig.sh" ; then
ac_cv_c_tkconfig="`(cd $i; pwd)`"
@@ -1557,7 +1563,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
LDFLAGS="$LDFLAGS -pthread"
])
;;
- FreeBSD-*)
+ DragonFly-*|FreeBSD-*)
# This configuration from FreeBSD Ports.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="${CC} -shared"
@@ -2053,7 +2059,7 @@ dnl # preprocessing tests use only CPPFLAGS.
BSD/OS*) ;;
CYGWIN_*|MINGW32_*) ;;
IRIX*) ;;
- NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
+ NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;;
Darwin-*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;
@@ -2749,7 +2755,7 @@ AC_DEFUN([SC_TCL_EARLY_FLAGS],[
# Might define the following vars:
# TCL_WIDE_INT_IS_LONG
# TCL_WIDE_INT_TYPE
-# HAVE_STRUCT_DIRENT64
+# HAVE_STRUCT_DIRENT64, HAVE_DIR64
# HAVE_STRUCT_STAT64
# HAVE_TYPE_OFF64_T
#
@@ -2785,6 +2791,15 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [
AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in <sys/types.h>?])
fi
+ AC_CACHE_CHECK([for DIR64], tcl_cv_DIR64,[
+ AC_TRY_COMPILE([#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)])
+ if test "x${tcl_cv_DIR64}" = "xyes" ; then
+ AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in <sys/types.h>?])
+ fi
+
AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
],
diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in
index 9774ce9..0879c7a 100644
--- a/unix/tclConfig.h.in
+++ b/unix/tclConfig.h.in
@@ -193,6 +193,9 @@
/* Is 'struct dirent64' in <sys/types.h>? */
#undef HAVE_STRUCT_DIRENT64
+/* Is 'DIR64' in <sys/types.h>? */
+#undef HAVE_DIR64
+
/* Is 'struct stat64' in <sys/stat.h>? */
#undef HAVE_STRUCT_STAT64
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index b5450b1..7360c32 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -327,13 +327,13 @@ DoRenameFile(
if (errno == EINVAL && haveRealpath) {
char srcPath[MAXPATHLEN], dstPath[MAXPATHLEN];
- DIR *dirPtr;
+ TclDIR *dirPtr;
Tcl_DirEntry *dirEntPtr;
if ((Realpath((char *) src, srcPath) != NULL) /* INTL: Native. */
&& (Realpath((char *) dst, dstPath) != NULL) /* INTL: Native */
&& (strncmp(srcPath, dstPath, strlen(srcPath)) != 0)) {
- dirPtr = opendir(dst); /* INTL: Native. */
+ dirPtr = TclOSopendir(dst); /* INTL: Native. */
if (dirPtr != NULL) {
while (1) {
dirEntPtr = TclOSreaddir(dirPtr); /* INTL: Native. */
@@ -343,11 +343,11 @@ DoRenameFile(
if ((strcmp(dirEntPtr->d_name, ".") != 0) &&
(strcmp(dirEntPtr->d_name, "..") != 0)) {
errno = EEXIST;
- closedir(dirPtr);
+ TclOSclosedir(dirPtr);
return TCL_ERROR;
}
}
- closedir(dirPtr);
+ TclOSclosedir(dirPtr);
}
}
errno = EINVAL;
@@ -920,7 +920,7 @@ TraverseUnixTree(
#ifndef HAVE_FTS
int numProcessed = 0;
Tcl_DirEntry *dirEntPtr;
- DIR *dirPtr;
+ TclDIR *dirPtr;
#else
CONST char *paths[2] = {NULL, NULL};
FTS *fts = NULL;
@@ -945,7 +945,7 @@ TraverseUnixTree(
errorPtr);
}
#ifndef HAVE_FTS
- dirPtr = opendir(source); /* INTL: Native. */
+ dirPtr = TclOSopendir(source); /* INTL: Native. */
if (dirPtr == NULL) {
/*
* Can't read directory
@@ -957,7 +957,7 @@ TraverseUnixTree(
result = (*traverseProc)(sourcePtr, targetPtr, &statBuf, DOTREE_PRED,
errorPtr);
if (result != TCL_OK) {
- closedir(dirPtr);
+ TclOSclosedir(dirPtr);
return result;
}
@@ -1007,11 +1007,11 @@ TraverseUnixTree(
* NULL-return that may a symptom of a buggy readdir.
*/
- rewinddir(dirPtr);
+ TclOSrewinddir(dirPtr);
numProcessed = 0;
}
}
- closedir(dirPtr);
+ TclOSclosedir(dirPtr);
/*
* Strip off the trailing slash we added
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index 0a2099c..65e144d 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -259,7 +259,7 @@ TclpMatchInDirectory(
Tcl_DecrRefCount(tailPtr);
Tcl_DecrRefCount(fileNamePtr);
} else {
- DIR *d;
+ TclDIR *d;
Tcl_DirEntry *entryPtr;
CONST char *dirName;
int dirLength;
@@ -310,7 +310,7 @@ TclpMatchInDirectory(
return TCL_OK;
}
- d = opendir(native); /* INTL: Native. */
+ d = TclOSopendir(native); /* INTL: Native. */
if (d == NULL) {
Tcl_DStringFree(&ds);
if (interp != NULL) {
@@ -383,7 +383,7 @@ TclpMatchInDirectory(
}
}
- closedir(d);
+ TclOSclosedir(d);
Tcl_DStringFree(&ds);
Tcl_DStringFree(&dsOrig);
Tcl_DecrRefCount(fileNamePtr);
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h
index 965014e..9a923ef 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -58,12 +58,23 @@
*/
#ifdef HAVE_STRUCT_DIRENT64
-typedef struct dirent64 Tcl_DirEntry;
+typedef struct dirent64 Tcl_DirEntry;
# define TclOSreaddir readdir64
#else
-typedef struct dirent Tcl_DirEntry;
+typedef struct dirent Tcl_DirEntry;
# define TclOSreaddir readdir
#endif
+#ifdef HAVE_DIR64
+typedef DIR64 TclDIR;
+# define TclOSopendir opendir64
+# define TclOSrewinddir rewinddir64
+# define TclOSclosedir closedir64
+#else
+typedef DIR TclDIR;
+# define TclOSopendir opendir
+# define TclOSrewinddir rewinddir
+# define TclOSclosedir closedir
+#endif
#ifdef HAVE_TYPE_OFF64_T
typedef off64_t Tcl_SeekOffset;
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index 1841242..15d9d52 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -742,7 +742,7 @@ TclpFinalizeCondition(
Tcl_DirEntry *
TclpReaddir(
- DIR * dir)
+ TclDIR * dir)
{
return TclOSreaddir(dir);
}