From: hno <> Date: Thu, 3 Nov 2005 06:14:41 +0000 (+0000) Subject: From Squid-2: X-Git-Tag: SQUID_3_0_PRE4~555 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3db24c0f77d447150c312b4a3f78d4c7f9ab1066;p=thirdparty%2Fsquid.git From Squid-2: 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. --- diff --git a/src/Makefile.am b/src/Makefile.am index 23ade4125e..5e90136c1e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 diff --git a/src/cf_gen.cc b/src/cf_gen.cc index db95eaf843..2169b24597 100644 --- a/src/cf_gen.cc +++ b/src/cf_gen.cc @@ -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 @@ -48,33 +48,9 @@ * administrator. *****************************************************************************/ -#include "config.h" +#include "squid.h" #include "cf_gen_defines.h" -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STRING_H -#include -#endif -#if HAVE_STDLIB_H -#include -#endif -#if HAVE_CTYPE_H -#include -#endif -#if HAVE_ASSERT_H -#include -#endif -#ifdef _SQUID_WIN32_ -#include -#endif -#if HAVE_FCNTL_H -#include -#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); } }