diff options
author | das <das> | 2005-12-05 13:03:16 (GMT) |
---|---|---|
committer | das <das> | 2005-12-05 13:03:16 (GMT) |
commit | 72a72bdbda1a618c81ce21298d38a7b66024cf95 (patch) | |
tree | de184beb12392b5d5382cd6ff21227041743df82 /unix/configure | |
parent | 403f07fad3a34a8d96e855e42124439774d1b8d3 (diff) | |
download | tcl-72a72bdbda1a618c81ce21298d38a7b66024cf95.zip tcl-72a72bdbda1a618c81ce21298d38a7b66024cf95.tar.gz tcl-72a72bdbda1a618c81ce21298d38a7b66024cf95.tar.bz2 |
* unix/configure.in: move check for fts API to configure.in and run it
* unix/tcl.m4: on all platforms, since Linux glibc2 and *BSDs also
have this; using fts is more efficient than recursive opendir/readdir.
* unix/tclUnixFCmd.c (TraverseUnixTree): add support to fts code for
platforms with stat64.
* unix/configure:
* unix/tclConfig.h.in: regen.
Diffstat (limited to 'unix/configure')
-rwxr-xr-x | unix/configure | 137 |
1 files changed, 71 insertions, 66 deletions
diff --git a/unix/configure b/unix/configure index 43d1a82..d906f7b 100755 --- a/unix/configure +++ b/unix/configure @@ -7897,72 +7897,6 @@ _ACEOF fi done - echo "$as_me:$LINENO: checking for fts" >&5 -echo $ECHO_N "checking for fts... $ECHO_C" >&6 -if test "${tcl_cv_api_fts+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/param.h> - #include <sys/stat.h> - #include <fts.h> -int -main () -{ -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); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 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_exeext' - { (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_api_fts=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_api_fts=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $tcl_cv_api_fts" >&5 -echo "${ECHO_T}$tcl_cv_api_fts" >&6 - if test $tcl_cv_api_fts = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_FTS 1 -_ACEOF - - fi cat >>confdefs.h <<\_ACEOF #define MAC_OSX_TCL 1 @@ -14504,6 +14438,77 @@ done #-------------------------------------------------------------------- +# Check for support of fts functions (readdir replacement) +#-------------------------------------------------------------------- + +echo "$as_me:$LINENO: checking for fts" >&5 +echo $ECHO_N "checking for fts... $ECHO_C" >&6 +if test "${tcl_cv_api_fts+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/param.h> + #include <sys/stat.h> + #include <fts.h> +int +main () +{ +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); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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_exeext' + { (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_api_fts=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_api_fts=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_api_fts" >&5 +echo "${ECHO_T}$tcl_cv_api_fts" >&6 +if test $tcl_cv_api_fts = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_FTS 1 +_ACEOF + +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 |