From: serassio <> Date: Sun, 17 Feb 2008 16:24:48 +0000 (+0000) Subject: Add check for glob() and glob.h availability X-Git-Tag: BASIC_TPROXY4~79 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=52303a3d6e33efe320ab5e4c5587a0cde07fa90b;p=thirdparty%2Fsquid.git Add check for glob() and glob.h availability glob() and glob.h are not available on all platforms. --- diff --git a/configure b/configure index cb1eee2a0c..5882d38c41 100755 --- a/configure +++ b/configure @@ -24482,6 +24482,7 @@ for ac_header in \ fcntl.h \ fnmatch.h \ getopt.h \ + glob.h \ gnumalloc.h \ grp.h \ ip_compat.h \ @@ -42624,6 +42625,7 @@ for ac_func in \ getrusage \ getspnam \ gettimeofday \ + glob \ htobe16 \ htole16 \ kqueue\ diff --git a/configure.in b/configure.in index fbeb6ecc09..25af2c5085 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl Configuration input file for Squid dnl -dnl $Id: configure.in,v 1.496 2008/01/22 15:34:27 hno Exp $ +dnl $Id: configure.in,v 1.497 2008/02/17 09:24:49 serassio Exp $ dnl dnl dnl @@ -11,7 +11,7 @@ AM_CONFIG_HEADER(include/autoconf.h) AC_CONFIG_AUX_DIR(cfgaux) AC_CONFIG_SRCDIR([src/main.cc]) AM_INIT_AUTOMAKE([tar-ustar]) -AC_REVISION($Revision: 1.496 $)dnl +AC_REVISION($Revision: 1.497 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -1914,6 +1914,7 @@ AC_CHECK_HEADERS( \ fcntl.h \ fnmatch.h \ getopt.h \ + glob.h \ gnumalloc.h \ grp.h \ ip_compat.h \ @@ -2563,6 +2564,7 @@ AC_CHECK_FUNCS(\ getrusage \ getspnam \ gettimeofday \ + glob \ htobe16 \ htole16 \ kqueue\ diff --git a/include/autoconf.h.in b/include/autoconf.h.in index d7a83d3ee0..712aa4a35a 100644 --- a/include/autoconf.h.in +++ b/include/autoconf.h.in @@ -179,6 +179,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_GLIB_H +/* Define to 1 if you have the `glob' function. */ +#undef HAVE_GLOB + +/* Define to 1 if you have the header file. */ +#undef HAVE_GLOB_H + /* Define to 1 if you have the header file. */ #undef HAVE_GNUMALLOC_H diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 32cabd3ac7..959e2d5f17 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.541 2008/02/11 22:26:59 rousskov Exp $ + * $Id: cache_cf.cc,v 1.542 2008/02/17 09:24:50 serassio Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -47,7 +47,9 @@ #include "Parsing.h" #include "MemBuf.h" #include "wordlist.h" +#if HAVE_GLOB_H #include +#endif #if SQUID_SNMP #include "snmp.h" @@ -212,6 +214,7 @@ parseManyConfigFiles(char* files, int depth) { int error_count = 0; char* saveptr = NULL; +#if HAVE_GLOB char *path; glob_t globbuf; int i; @@ -226,6 +229,13 @@ parseManyConfigFiles(char* files, int depth) error_count += parseOneConfigFile(globbuf.gl_pathv[i], depth); } globfree(&globbuf); +#else + char* file = strwordtok(files, &saveptr); + while (file != NULL) { + error_count += parseOneConfigFile(file, depth); + file = strwordtok(NULL, &saveptr); + } +#endif /* HAVE_GLOB */ return error_count; }