]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Add check for glob() and glob.h availability
authorserassio <>
Sun, 17 Feb 2008 16:24:48 +0000 (16:24 +0000)
committerserassio <>
Sun, 17 Feb 2008 16:24:48 +0000 (16:24 +0000)
glob() and glob.h are not available on all platforms.

configure
configure.in
include/autoconf.h.in
src/cache_cf.cc

index cb1eee2a0c2ff58499fe22745c4c07b41cb052cb..5882d38c414077797a5721a51bf7f83271f182d8 100755 (executable)
--- 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\
index fbeb6ecc0914057150001d4c32982b9d438684ca..25af2c5085c6424dae0ec6f11be0c58cc7e0012c 100644 (file)
@@ -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\
index d7a83d3ee0dfbc857338122261dc0e20eae768c2..712aa4a35a43a096688f94be20912f44c73448f4 100644 (file)
 /* Define to 1 if you have the <glib.h> 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 <glob.h> header file. */
+#undef HAVE_GLOB_H
+
 /* Define to 1 if you have the <gnumalloc.h> header file. */
 #undef HAVE_GNUMALLOC_H
 
index 32cabd3ac7f7610061626e11de9be84cf4f8afd2..959e2d5f17d844dab14d0a937ee6413b9022ba0a 100644 (file)
@@ -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 <glob.h>
+#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;
 }