]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
From Squid-2:
authorhno <>
Thu, 3 Nov 2005 06:14:41 +0000 (06:14 +0000)
committerhno <>
Thu, 3 Nov 2005 06:14:41 +0000 (06:14 +0000)
Generalisation of the build environment to have cf_gen built more like
the other binaries. Primary reason is to allow the use of defines
inherited from squid.h or system headers in cf.data.pre conditions.

src/Makefile.am
src/cf_gen.cc

index 23ade4125ede517ce6d613f8bde51561a4cd327f..5e90136c1eebaa563f0522cdb1b19af5f32ca28e 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.am,v 1.113 2005/10/23 11:55:31 hno Exp $
+#  $Id: Makefile.am,v 1.114 2005/11/02 23:14:41 hno Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -191,7 +191,8 @@ libexec_PROGRAMS = \
        $(UNLINKD) \
        cachemgr$(CGIEXT)
 
-cf_gen_SOURCES = cf_gen.cc defines.h
+cf_gen_SOURCES = cf_gen.cc defines.h debug.c
+nodist_cf_gen_SOURCES = globals.cc
 nodist_cf_gen_HEADER = cf_gen_defines.h
 cf_gen.$(OBJEXT): cf_gen_defines.h
 squidclient_SOURCES = client.cc
index db95eaf843816bcb5f26121d636cc0b91f5fa045..2169b2459751d29177463eb0ff5f65a616242d41 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cf_gen.cc,v 1.55 2005/09/17 03:42:20 wessels Exp $
+ * $Id: cf_gen.cc,v 1.56 2005/11/02 23:14:42 hno Exp $
  *
  * DEBUG: none          Generate squid.conf.default and cf_parser.h
  * AUTHOR: Max Okumoto
  *                      administrator.
  *****************************************************************************/
 
-#include "config.h"
+#include "squid.h"
 #include "cf_gen_defines.h"
 
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
-#ifdef _SQUID_WIN32_
-#include <io.h>
-#endif
-#if HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#include "util.h"
-
 #define MAX_LINE       1024    /* longest configuration line */
 #define _PATH_PARSER           "cf_parser.h"
 #define _PATH_SQUID_CONF       "squid.conf.default"
@@ -760,13 +736,13 @@ gen_conf(Entry * head, FILE * fp)
         }
 
         if (entry->default_value && strcmp(entry->default_value, "none") != 0) {
-            sprintf(buf, "%s %s", entry->name, entry->default_value);
+            snprintf(buf, sizeof(buf), "%s %s", entry->name, entry->default_value);
             lineAdd(&def, buf);
         }
 
         if (entry->default_if_none) {
             for (line = entry->default_if_none; line; line = line->next) {
-                sprintf(buf, "%s %s", entry->name, line->data);
+                snprintf(buf, sizeof(buf), "%s %s", entry->name, line->data);
                 lineAdd(&def, buf);
             }
         }