diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-04-15 06:41:08 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-04-15 06:41:08 -0700 |
commit | bc9ba2ccd70756b9c2c006bf8a357b38d198aee2 (patch) | |
tree | 6f7373910fe0aee7575f274d4ba0c9759f630b98 /configure | |
parent | b1e62b22783b3fb3b32ccfae2f41c08433190538 (diff) | |
download | txr-bc9ba2ccd70756b9c2c006bf8a357b38d198aee2.tar.gz txr-bc9ba2ccd70756b9c2c006bf8a357b38d198aee2.tar.bz2 txr-bc9ba2ccd70756b9c2c006bf8a357b38d198aee2.zip |
Adding ftw function.
* Makefile (ftw.o): Add to OBJS-y conditionally.
* configure (have_ftw): New variable. New configure test
for nftw.
(gen_config_make): Set up have_ftw make variable.
* ftw.c, ftw.h: New files.
* lib.c (init): Call ftw_init, if compiled in.
* txr.1: Documented.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -125,6 +125,7 @@ have_unistd= have_sys_time= have_syslog= have_glob= +have_ftw= have_windows_h= have_windres= have_posix_sigs= @@ -660,6 +661,9 @@ have_syslog := $have_syslog # do we compile in glob support? have_glob := $have_glob +# do we compile in ftwsupport? +have_ftw := $have_ftw + # do we modern posix signal handling? have_posix_sigs := $have_posix_sigs @@ -2096,6 +2100,41 @@ else printf "no\n" fi +printf "Checking for nftw ... " + +cat > conftest.c <<! +#include <ftw.h> +#include <stdlib.h> + +static int callback(const char *fpath, const struct stat *sb, + int tflag, struct FTW *ftwbuf) +{ + switch (tflag) { + case FTW_D: + case FTW_DP: + case FTW_NS: + case FTW_SLN: + break; + } + return 0; +} + +int main(int argc, char *argv[]) +{ + int flags = FTW_DEPTH | FTW_PHYS; + int res = nftw(argv[1], callback, 20, flags); + return (res == -1) ? EXIT_FAILURE : 0; +} +! + +if conftest ; then + printf "yes\n" + printf "#define HAVE_FTW 1\n" >> $config_h + have_ftw=y +else + printf "no\n" +fi + printf "Checking for windres ... " if output=$(windres -V 2> /dev/null) ; then |