]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
add configure checks for SYSLOG
authorwessels <>
Wed, 27 Mar 1996 12:12:36 +0000 (12:12 +0000)
committerwessels <>
Wed, 27 Mar 1996 12:12:36 +0000 (12:12 +0000)
configure
configure.in
include/autoconf.h.in
src/debug.cc
src/squid.h
src/store.cc
src/tools.cc

index aa608025020a032e91f9db9023bd835a1179d16e..118cb81baf92e522dff8df5a26b0932c98533e52 100755 (executable)
--- a/configure
+++ b/configure
@@ -517,7 +517,7 @@ fi
 
 
 
-# From configure.in Revision: 1.9 
+# From configure.in Revision: 1.10 
 ac_aux_dir=
 for ac_dir in aux $srcdir/aux; do
   if test -f $ac_dir/install-sh; then
@@ -1236,10 +1236,27 @@ EOF
 
 fi
 
-for ac_hdr in config.h fcntl.h memory.h stdlib.h string.h unistd.h \
-                 syslog.h sys/file.h sys/types.h sys/syslog.h sys/time.h \
-                 regex.h netinet/in.h arpa/inet.h crypt.h alloca.h \
-                bstring.h sys/select.h
+
+for ac_hdr in \
+       alloca.h \
+       arpa/inet.h \
+       bstring.h \
+       config.h \
+       crypt.h \
+       fcntl.h \
+       memory.h \
+       netinet/in.h \
+       stdlib.h \
+       string.h \
+       strings.h \
+       sys/file.h \
+       sys/select.h\
+       sys/time.h \
+       sys/types.h \
+       unistd.h \
+       regex.h \
+       syslog.h \
+
 do
 ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -1247,7 +1264,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1251 "configure"
+#line 1268 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
@@ -1275,8 +1292,9 @@ else
 fi
 done
 
+
 cat > conftest.$ac_ext <<EOF
-#line 1280 "configure"
+#line 1298 "configure"
 #include "confdefs.h"
 #include <malloc.h>
 EOF
@@ -1299,7 +1317,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
 cat > conftest.$ac_ext <<EOF
-#line 1303 "configure"
+#line 1321 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1333,7 +1351,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
 cat > conftest.$ac_ext <<EOF
-#line 1337 "configure"
+#line 1355 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1367,7 +1385,7 @@ if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1371 "configure"
+#line 1389 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() { return 0; }
@@ -1399,7 +1417,7 @@ if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1403 "configure"
+#line 1421 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -1458,7 +1476,7 @@ if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1462 "configure"
+#line 1480 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -1487,7 +1505,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1491 "configure"
+#line 1509 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1541,7 +1559,7 @@ else
   ac_cv_c_stack_direction=0
 else
 cat > conftest.$ac_ext <<EOF
-#line 1545 "configure"
+#line 1563 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -1587,6 +1605,7 @@ for ac_func in \
        strdup \
        strerror \
        sysconf \
+       syslog \
        timegm\
 
 do
@@ -1595,7 +1614,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1599 "configure"
+#line 1618 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1648,7 +1667,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1652 "configure"
+#line 1671 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1682,7 +1701,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmalloc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1686 "configure"
+#line 1705 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1716,7 +1735,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1720 "configure"
+#line 1739 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1750,7 +1769,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1754 "configure"
+#line 1773 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1784,7 +1803,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbsd  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1788 "configure"
+#line 1807 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1819,7 +1838,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l44bsd  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1823 "configure"
+#line 1842 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1853,7 +1872,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1857 "configure"
+#line 1876 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1888,7 +1907,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1892 "configure"
+#line 1911 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
index 4e6bc9d10721c917754dc6af6a7d122271356d1b..4d2b1d26c5b77aa86daa13f66ef00c707859be0e 100644 (file)
@@ -3,13 +3,13 @@ dnl  Configuration input file for Squid
 dnl
 dnl  Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.7)
 dnl
-dnl  $Id: configure.in,v 1.10 1996/03/26 05:13:46 wessels Exp $
+dnl  $Id: configure.in,v 1.11 1996/03/27 05:12:37 wessels Exp $
 dnl
 dnl
 dnl
 AC_INIT(include/config.h)
 AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.10 $)dnl
+AC_REVISION($Revision: 1.11 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AC_CONFIG_AUX_DIR(aux)
 
@@ -80,10 +80,28 @@ AC_SUBST(PERL)
 dnl Check for headers
 AC_HEADER_DIRENT
 AC_HEADER_STDC
-AC_CHECK_HEADERS(config.h fcntl.h memory.h stdlib.h string.h unistd.h \
-                 syslog.h sys/file.h sys/types.h sys/syslog.h sys/time.h \
-                 regex.h netinet/in.h arpa/inet.h crypt.h alloca.h \
-                bstring.h sys/select.h)
+
+AC_CHECK_HEADERS( \
+       alloca.h \
+       arpa/inet.h \
+       bstring.h \
+       config.h \
+       crypt.h \
+       fcntl.h \
+       memory.h \
+       netinet/in.h \
+       stdlib.h \
+       string.h \
+       strings.h \
+       sys/file.h \
+       sys/select.h\
+       sys/time.h \
+       sys/types.h \
+       unistd.h \
+       regex.h \
+       syslog.h \
+)
+
 AC_EGREP_HEADER(mxfast, malloc.h, [XTRA_CFLAGS="$XTRA_CFLAGS -DLNG_MALLINFO"], [XTRA_CFLAGS="$XTRA_CFLAGS"])
 
 dnl Check for typedefs
@@ -103,6 +121,7 @@ AC_CHECK_FUNCS(\
        strdup \
        strerror \
        sysconf \
+       syslog \
        timegm\
 )
 
index e2b78e4f246918961b08e19a6056aabe75146783..d2d8a4a44e211c52a0fd48f3744426d272aa3092 100644 (file)
@@ -55,6 +55,9 @@
 /* Define if you have the sysconf function.  */
 #undef HAVE_SYSCONF
 
+/* Define if you have the syslog function.  */
+#undef HAVE_SYSLOG
+
 /* Define if you have the timegm function.  */
 #undef HAVE_TIMEGM
 
 /* Define if you have the <string.h> header file.  */
 #undef HAVE_STRING_H
 
+/* Define if you have the <strings.h> header file.  */
+#undef HAVE_STRINGS_H
+
 /* Define if you have the <sys/dir.h> header file.  */
 #undef HAVE_SYS_DIR_H
 
 /* Define if you have the <sys/select.h> header file.  */
 #undef HAVE_SYS_SELECT_H
 
-/* Define if you have the <sys/syslog.h> header file.  */
-#undef HAVE_SYS_SYSLOG_H
-
 /* Define if you have the <sys/time.h> header file.  */
 #undef HAVE_SYS_TIME_H
 
index 504c2a44e2db4328fdaffa7a642ca5ccaf159e63..d14d4c8de44f0af0b1c8ce3aa8e86b87a785d9a3 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: debug.cc,v 1.3 1996/03/27 01:45:58 wessels Exp $ */
+/* $Id: debug.cc,v 1.4 1996/03/27 05:12:38 wessels Exp $ */
 
 #include "squid.h"
 
@@ -67,12 +67,14 @@ void _db_print(va_alist)
            }
            sprintf(f, "[%s] %s:%d:\t %s", the_time, module, _db_line, format);
 
+#if HAVE_SYSLOG
            /* level 0 go to syslog */
            if ((level == 0) && syslog_enable) {
                tmpbuf[0] = '\0';
                vsprintf(tmpbuf, f, args);
                syslog(LOG_ERR, tmpbuf);
            }
+#endif /* HAVE_SYSLOG */
            /* write to log file */
            vfprintf(debug_log, f, args);
            if (unbuffered_logs)
@@ -127,9 +129,11 @@ void _db_init(prefix, initial_level, logfile)
        stderr_enable = 0;
     }
 
-    if (syslog_enable) {
+#if HAVE_SYSLOG
+    if (syslog_enable)
        openlog("cached", LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4);
-    }
+#endif /* HAVE_SYSLOG */
+
 }
 
 /* gack!  would be nice to use _db_init() instead */
index ecb33dd4dd6675b54d3a7e7ed85d500e93b60da7..79051d41d79f7f61e97358ef64b33a42d6f856ef 100644 (file)
@@ -1,5 +1,5 @@
 
-/* $Id: squid.h,v 1.2 1996/03/27 04:42:09 wessels Exp $ */
+/* $Id: squid.h,v 1.3 1996/03/27 05:12:39 wessels Exp $ */
 
 #include "config.h"
 #include "autoconf.h"
 #include <netdb.h>
 #include <pwd.h>
 #include <signal.h>
-#include <string.h>
-#include <strings.h>
+#include <time.h>
 #include <sys/param.h>
-#include <sys/resource.h>
-#include <sys/select.h>
+#include <sys/time.h>
+#include <sys/resource.h>      /* needs sys/time.h above it */
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <sys/stat.h>
 #include <sys/syscall.h>
-#include <sys/time.h>
 #include <sys/un.h>
 #include <sys/wait.h>
-#include <syslog.h>
-#include <time.h>
 
-#if HAVE_SYS_SELECT_H
-#include <sys/select.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
 #endif
 
 #if HAVE_BSTRING_H
 #include <crypt.h>
 #endif
 
+#ifdef HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
 #if defined(__STRICT_ANSI__)
 #include <stdarg.h>
 #else
index e15136ffd6ebdd311577a80b3b23f9e6df5f4861..f0366475a397e39a750b95cbaed9c426fbf3833e 100644 (file)
@@ -1,5 +1,5 @@
 
-/* $Id: store.cc,v 1.11 1996/03/27 04:42:09 wessels Exp $ */
+/* $Id: store.cc,v 1.12 1996/03/27 05:12:39 wessels Exp $ */
 
 /* 
  * Here is a summary of the routines which change mem_status and swap_status:
@@ -2331,8 +2331,10 @@ void storeSanityCheck()
            if (errno != ENOENT)
                continue;
            sprintf(tmpbuf, "WARNING: Cannot write to %s for storage swap area.\nForcing a *full restart* (e.g., cached -z)...", name);
+#if HAVE_SYSLOG
            if (syslog_enable)
                syslog(LOG_ALERT, tmpbuf);
+#endif
            fprintf(stderr, "cached: %s\n", tmpbuf);
            zap_disk_store = 1;
            return;
index cc4b821633a23c48fe8aaf0c9fd18f1907f95505..a65c58927b576f9d285d6355569e0115ed20cbff 100644 (file)
@@ -1,5 +1,5 @@
 
-/* $Id: tools.cc,v 1.8 1996/03/27 04:42:10 wessels Exp $ */
+/* $Id: tools.cc,v 1.9 1996/03/27 05:12:40 wessels Exp $ */
 
 #include "squid.h"
 
@@ -102,8 +102,10 @@ void shut_down(sig)
 void fatal_common(message)
      char *message;
 {
+#if HAVE_SYSLOG
     if (syslog_enable)
        syslog(LOG_ALERT, message);
+#endif
     fprintf(stderr, "FATAL: %s\n", message);
     fprintf(stderr, "Harvest Cache (Version %s): Terminated abnormally.\n",
        SQUID_VERSION);