]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Improved handling of --enable-strict-error-checking
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 7 Aug 2010 14:15:50 +0000 (16:15 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 7 Aug 2010 14:15:50 +0000 (16:15 +0200)
Moved unhandled default definition of HTTP and ICP ports to config.h
Improved documentation of --with-logdir
Fixed documentation of --disable-optimizations
Bundled types detection closer to each other
Made resolver library checks depend on --disable-internal-dns

configure.in
include/config.h

index 9173592c463f2f8bfa5a68565dd7c3df9008cf15..a4ced1ca03eef852ff80117f5d88d9e9ea5a5ac7 100644 (file)
@@ -73,16 +73,14 @@ AC_PATH_PROG(AR, ar, $FALSE)
 AR_R="$AR r"
 AC_SUBST(AR_R)
 
-squid_opt_enable_werror="yes"
 AC_ARG_ENABLE(strict-error-checking,
   AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled
                  with all possible static compiler error-checks enabled.
-                 This flag disables the behavior]), [ 
-  if test "x${enableval}" = "xno"
-  then
-    squid_opt_enable_werror="no"
-  fi
+                 This flag disables the behavior]), [
+  SQUID_YESNO([$enableval],
+    [Unrecognized argument to --disable-strict-error-checking: $enableval])
 ])
+AC_MSG_NOTICE([strict error checking enabled: ${enable_strict_error_checking:=yes}])
 
 AC_MSG_CHECKING(whether to use loadable modules)
 AC_ARG_ENABLE(loadable-modules,
@@ -155,21 +153,7 @@ if test "x$squid_host_os" = "xmingw"; then
   AC_SUBST(MINGW_LIBS)
 fi
 
-if test "x$CACHE_HTTP_PORT" = "x"; then
-  CACHE_HTTP_PORT="3128"
-fi
-if test "x$CACHE_ICP_PORT" = "x"; then
-  CACHE_ICP_PORT="3130"
-fi
-
 dnl Substitutions
-AC_DEFINE_UNQUOTED(CACHE_HTTP_PORT, $CACHE_HTTP_PORT,
-                   [What default TCP port to use for HTTP listening?])
-AC_SUBST(CACHE_HTTP_PORT)
-AC_DEFINE_UNQUOTED(CACHE_ICP_PORT, $CACHE_ICP_PORT,
-                   [What default UDP port to use for ICP listening?])
-AC_SUBST(CACHE_ICP_PORT)
-
 AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure])
 
 AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", 
@@ -185,7 +169,7 @@ AC_SUBST(CACHE_EFFECTIVE_USER)
 DEFAULT_LOG_DIR="$localstatedir/logs"
 AC_ARG_WITH(logdir,
   AS_HELP_STRING([--with-logdir=PATH],
-    [Default location for squid logs. default: $DEFAULT_LOG_DIR]), [
+    [Default location for squid logs. default: PREFIX/var/logs]), [
 case $withval in
   yes|no)
     AC_MSG_ERROR( --with-logdir requires a directory PATH. --with-logdir=PATH )
@@ -201,7 +185,7 @@ AC_SUBST(DEFAULT_LOG_DIR)
 DEFAULT_PIDFILE="$localstatedir/run/squid.pid"
 AC_ARG_WITH(pidfile,
   AS_HELP_STRING([--with-pidfile=PATH],
-    [Default location for squid PID file. default: PREFIX/var/run/squid.pid]), [
+    [Default location for squid pid file. Default: PREFIX/var/run/squid.pid]), [
 case $withval in
  yes|no)
    AC_MSG_ERROR( --with-pidfile requires a file PATH. --with-pidfile=PATH )
@@ -283,7 +267,7 @@ else
   SQUID_CXXFLAGS=
 fi
 
-if test "x$squid_opt_enable_werror" != "xno"; then
+if test "x$enable_strict_error_checking" != "xno"; then
   SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_option_werror"
   SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_option_werror"
 fi
@@ -306,8 +290,8 @@ AC_ARG_ENABLE(optimizations,
                   Optimization is good for production builds, but not
                   good for debugging. During development, use
                   --disable-optimizations to reduce compilation times
-                  and allow easier debugging. This option implicitly
-                  also enabled --disable-inline]), [
+                  and allow easier debugging. This option implies
+                  --disable-inline]), [
 if test "x$enableval" = "xno" ; then
   AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)])
   CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
@@ -2177,7 +2161,7 @@ SQUID_DEFAULT_INCLUDES
 #endif
 )
 
-dnl *BSD dont include the depenencies for all their net/ and netinet/ files
+dnl *BSD dont include the dependencies for all their net/ and netinet/ files
 dnl We must include a few basic type headers for them to work.
 AC_CHECK_HEADERS( \
   net/if.h \
@@ -2284,9 +2268,6 @@ AC_CHECK_TYPE(upad128_t,
 AC_CHECK_TYPE(mode_t, AC_DEFINE(HAVE_MODE_T,1,[mode_t is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
 AC_CHECK_TYPE(fd_mask,  AC_DEFINE(HAVE_FD_MASK,1,[fd_mask is defined by the system headers]),,SQUID_DEFAULT_INCLUDES)
 
-dnl Check for special functions
-AC_FUNC_ALLOCA
-
 AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the system headers]),,[
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -2295,6 +2276,15 @@ AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the
 #include <stddef.h>
 #endif])
 
+AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,
+   [mtyp_t is defined by the system headers]),,[#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/msg.h>])
+
+dnl Check for special functions
+AC_FUNC_ALLOCA
+
+
 dnl Check for libcap header (assume its not broken unless 
 AC_ARG_WITH(libcap, AS_HELP_STRING([--without-libcap],
        [disable usage of Linux capabilities library to control privileges]), [
@@ -2332,11 +2322,6 @@ SQUID_DEFINE_BOOL(LIBCAP_BROKEN,${squid_cv_sys_capability_works:=no},
 AC_MSG_NOTICE([libcap2 headers are ok: $squid_cv_sys_capability_works])
 
 
-AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,
-   [mtyp_t is defined by the system headers]),,[#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>])
-
 dnl Check for needed libraries
 AC_SEARCH_LIBS([gethostbyname],[nsl resolv bind])
 AC_SEARCH_LIBS([res_init],[resolv])
@@ -2371,8 +2356,8 @@ else
       #used later. FIXME
       AC_CHECK_LIB(malloc, main)
       ;;
-   esac
-  fi
+  esac
+fi
 
 case "$host_os" in
 mingw|mingw32)
@@ -2849,7 +2834,7 @@ AC_ARG_ENABLE(gnuregex,
                  library built in.]), [
 SQUID_YESNO([$enableval],[unrecognized argument to --enable-gnuregex: $enableval])
 ])
-# force-enbable on old solaris and nextstep
+# force-enable on old solaris and nextstep
 if test "x${enable_gnuregex:=auto}" = "xauto" ; then
     case "$host" in
     *-sun-solaris2.[[0-4]])
@@ -2891,8 +2876,10 @@ SQUID_DETECT_TCP_RECV_BUFSIZE
 SQUID_CHECK_NEED_SYS_ERRLIST
 SQUID_CHECK_MAXPATHLEN
 
-SQUID_CHECK_LIBRESOLV_DNS_TTL_HACK
-SQUID_CHECK_RESOLVER_FIELDS
+if test "x$squid_opt_use_dnsserver" = "xyes"; then
+  SQUID_CHECK_LIBRESOLV_DNS_TTL_HACK
+  SQUID_CHECK_RESOLVER_FIELDS
+fi
 
 if test "x$ac_cv_header_sys_statvfs_h" = "xyes" ; then
   SQUID_CHECK_WORKING_STATVFS
index 90ad4a2ca3f532ead009fcf8285a3bb33b61449c..4ae2da08ffcd6e566d6427b115c37b4319ccddde 100644 (file)
 
 #endif
 
+/* default values for listen ports. Usually specified in squid.conf really */
+#define CACHE_HTTP_PORT 3128
+#define CACHE_ICP_PORT 3130
+
 /* To keep API definitions clear */
 #ifdef __cplusplus
 #define SQUIDCEXTERN extern "C"