CACHE_HTTP_PORT and CACHE_ICP_PORT

From: Robert Collins <robert.collins@dont-contact.us>
Date: 04 Sep 2001 13:30:30 +1000

We current AC_SUBST CACHE_HTTP_PORT and CACHE_ICP_PORt in configure.in,
then use those SUBST's in include/config.h.in -> include/config.h

The attached patch (with the additional change of moving config.h.in to
config.h, and deleting the #ifndef CACHE_HTTP_PORT etc lines) changes
this to use AC_DEFINE instead of AC_SUBST.

The SUBSTS where not used anywhere other than config.h.in.

This patch gives the same behaviour - it defines CACHE_HTTP_PORT and
CACHE_ICP_PORT only if they are not already defined. (ie
CFLAGS="-DCACHE_HTTP_PORT=8080" make is still honoured). The advantage
this patch gives is that include/config.h is no longer a generated file,
and therefore less files are recompiled after a configure change.

So, unless there are objections within a week, I'll check this in.

Rob

Index: configure.in
===================================================================
RCS file: /server/cvs-server/squid/squid/configure.in,v
retrieving revision 1.232
diff -u -p -r1.232 configure.in
--- configure.in 2001/09/04 01:02:49 1.232
+++ configure.in 2001/09/04 03:31:10
@@ -67,10 +67,10 @@ if test -z "$CACHE_ICP_PORT"; then
 fi
 
 dnl Subsitutions
-AC_SUBST(CACHE_HTTP_PORT)
-AC_SUBST(CACHE_ICP_PORT)
+AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT)
+AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT)
 
-AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host")
+AC_DEFINE(CONFIG_HOST_TYPE, "$host")
 
 
 dnl Gerben Wierda <Gerben_Wierda@RnA.nl>
@@ -1016,7 +1016,6 @@ AC_CHECK_HEADERS( \
         arpa/nameser.h \
         assert.h \
         bstring.h \
- config.h \
         crypt.h \
         ctype.h \
         errno.h \
@@ -2017,7 +2016,6 @@ dnl src/repl/lru/Makefile \
 AC_OUTPUT([\
         Makefile \
         lib/Makefile \
- include/config.h \
         scripts/Makefile \
         scripts/RunCache \
         scripts/RunAccel \
Index: Makefile.am
===================================================================
RCS file: /server/cvs-server/squid/squid/Makefile.am,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile.am
--- Makefile.am 2001/09/02 12:16:54 1.2
+++ Makefile.am 2001/09/04 03:31:10
@@ -7,7 +7,6 @@ AUTOMAKE_OPTIONS = dist-bzip2 subdir-obj
 DIST_SUBDIRS = lib snmplib scripts src icons errors contrib
 SUBDIRS = lib @makesnmplib@ scripts src icons errors
 
-EXTRA_DIST = include/config.h.in
 DISTCLEANFILES = include/stamp-h include/stamp-h[0-9]*
 
 dist-hook:
Index: acconfig.h
===================================================================
RCS file: /server/cvs-server/squid/squid/acconfig.h,v
retrieving revision 1.58
diff -u -p -r1.58 acconfig.h
--- acconfig.h 2001/08/24 14:29:32 1.58
+++ acconfig.h 2001/09/04 03:31:10
@@ -34,6 +34,20 @@
  */
 #undef CACHEMGR_HOSTNAME
 
+/*
+ * What default TCP port to use for HTTP listening?
+ */
+#ifndef CACHE_HTTP_PORT
+#undef CACHE_HTTP_PORT
+#endif
+
+/*
+ * What default UDP port to use for ICP listening?
+ */
+#ifndef CACHE_ICP_PORT
+#undef CACHE_ICP_PORT
+#endif
+
 /* Define to do simple malloc debugging */
 #undef XMALLOC_DEBUG
Received on Mon Sep 03 2001 - 21:34:00 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:20 MST