]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Refactored mempools option handling
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 3 Apr 2010 19:15:08 +0000 (21:15 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 3 Apr 2010 19:15:08 +0000 (21:15 +0200)
configure.in

index 1e0f5213ce35b77b96b47a223f83826205c27aa9..1ab80f2d573acc8a7711915a68502560c76154b5 100644 (file)
@@ -2000,24 +2000,27 @@ AC_ARG_WITH(valgrind-debug,
 
 dnl Disable "memPools" code
 AC_ARG_ENABLE(mempools,
-  AS_HELP_STRING([--disable-mempools],[Disable memPools. Note that this option now simply sets the
-                             default behaviour. Specific classes can override this at runtime, and
-                             only lib/MemPool.c needs to be altered to change the squid-wide 
-                             default for all classes.]),
-[ if test "$enableval" = "no" ; then
-    AC_MSG_NOTICE([memPools disabled])
-    AC_DEFINE(DISABLE_POOLS, 1, [Define if you have problems with memPools and want to disable Pools])
-  else
-    AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
-  fi
-],
-[ AC_DEFINE(DISABLE_POOLS, 0, [Define if you have problems with memPools and want to disable Pools.])
-])
+  AS_HELP_STRING([--disable-mempools],
+                 [Disable memPools. Note that this option now simply sets the
+                  default behaviour. Specific classes can override this at runtime, and
+                  only lib/MemPool.c needs to be altered to change the squid-wide 
+                  default for all classes.]),
+[ squid_opt_enable_mempools=$enableval ] )
+SQUID_YESNO([$squid_opt_enable_mempools],[--disable-mempools option takes no arguments])
+# transform positive to negative value.
+AC_MSG_NOTICE([MemPools enabled: $squid_opt_enable_mempools])
+if test "$squid_opt_enable_mempools" = "yes" ; then
+  squid_opt_enable_mempools=no
+else
+  squid_opt_enable_mempools=yes
+fi
+SQUID_DEFINE_UNQUOTED(DISABLE_POOLS,$squid_opt_enable_mempools,
+   [Disable Memory Pools support and fall back to system malloc])
 
 dnl Enable WIN32 Service compile mode
 AC_ARG_ENABLE(win32-service,
-  AS_HELP_STRING([--enable-win32-service],[Compile Squid as a WIN32 Service.
-                  Works only on MS-Windows platforms (NT and up).]),
+  AS_HELP_STRING([--enable-win32-service],
+                 [Compile Squid as a WIN32 Service. Works only on MS-Windows platforms]),
 [ if test "$enableval" = "yes" ; then
     AC_MSG_NOTICE([Enabling WIN32 run service mode])
     AC_DEFINE(USE_WIN32_SERVICE,1,[Define Windows NT & Windows 2000 run service mode])