From: Amos Jeffries Date: Tue, 31 May 2016 22:47:03 +0000 (+1200) Subject: Cleanup: improve automake coding guideline adherence X-Git-Tag: SQUID_4_0_11~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8aafbbc1e6783de29790dd0d92a1d823d328bfa3;p=thirdparty%2Fsquid.git Cleanup: improve automake coding guideline adherence Several features were not following guidelines on ENABLE_* automake variable naming. As a result fix ESI unit tests which were not being run and simplify adaptation conditional creation. And remove unused HAVE_SPEGNO conditional. --- diff --git a/configure.ac b/configure.ac index 1edb09c9c5..6b95d28476 100644 --- a/configure.ac +++ b/configure.ac @@ -728,17 +728,16 @@ done AC_MSG_NOTICE([IO Modules built: $DISK_MODULES]) AC_SUBST(DISK_MODULES) AC_SUBST(DISK_LIBS) -AM_CONDITIONAL([ENABLE_DISKIO_AIO], [test "x$squid_disk_module_candidates_AIO" = "xyes"]) +AM_CONDITIONAL(ENABLE_DISKIO_AIO, test "x$squid_disk_module_candidates_AIO" = "xyes") AC_SUBST(AIOLIB) -AM_CONDITIONAL([ENABLE_WIN32_AIO], [test "x$squid_disk_module_candidates_AIO" = "xyes" -a "x$ENABLE_WIN32_AIO" = "x1"]) -AM_CONDITIONAL([ENABLE_DISKIO_BLOCKING], [test "x$squid_disk_module_candidates_Blocking" = "xyes"]) -AM_CONDITIONAL([ENABLE_DISKIO_DISKDAEMON], [test "x$squid_disk_module_candidates_DiskDaemon" = "xyes"]) -AM_CONDITIONAL([ENABLE_DISKIO_DISKTHREADS], [test "x$squid_disk_module_candidates_DiskThreads" = "xyes"]) +AM_CONDITIONAL(ENABLE_WIN32_AIO, test "x$squid_disk_module_candidates_AIO" = "xyes" -a "x$ENABLE_WIN32_AIO" = "x1") +AM_CONDITIONAL(ENABLE_DISKIO_BLOCKING, test "x$squid_disk_module_candidates_Blocking" = "xyes") +AM_CONDITIONAL(ENABLE_DISKIO_DISKDAEMON, test "x$squid_disk_module_candidates_DiskDaemon" = "xyes") +AM_CONDITIONAL(ENABLE_DISKIO_DISKTHREADS, test "x$squid_disk_module_candidates_DiskThreads" = "xyes") AC_SUBST(LIBPTHREADS) -AM_CONDITIONAL([ENABLE_WIN32_AIOPS], [test "x$squid_disk_module_candidates_DiskThreads" = "xyes" -a "x$ENABLE_WIN32_AIOPS" = "x1"]) -AM_CONDITIONAL([ENABLE_DISKIO_IPCIO], [test "x$squid_disk_module_candidates_IpcIo" = "xyes"]) -AM_CONDITIONAL([ENABLE_DISKIO_MMAPPED], [test "x$squid_disk_module_candidates_Mmapped" = "xyes"]) - +AM_CONDITIONAL(ENABLE_WIN32_AIOPS, test "x$squid_disk_module_candidates_DiskThreads" = "xyes" -a "x$ENABLE_WIN32_AIOPS" = "x1") +AM_CONDITIONAL(ENABLE_DISKIO_IPCIO, test "x$squid_disk_module_candidates_IpcIo" = "xyes") +AM_CONDITIONAL(ENABLE_DISKIO_MMAPPED, test "x$squid_disk_module_candidates_Mmapped" = "xyes") dnl Check what Storage formats are wanted. dnl This version will error out with a message saying why if a required DiskIO is missing. @@ -807,8 +806,8 @@ for fs in $squid_storeio_module_candidates none; do esac done -AM_CONDITIONAL(HAVE_FS_UFS,[test "x$squid_do_build_ufs" = "xtrue" ]) -AM_CONDITIONAL(HAVE_FS_ROCK,[test "x$squid_do_build_rock" = "xtrue" ]) +AM_CONDITIONAL(ENABLE_FS_UFS, test "x$squid_do_build_ufs" = "xtrue") +AM_CONDITIONAL(ENABLE_FS_ROCK, test "x$squid_do_build_rock" = "xtrue") dnl hack: need to define those even if not used in the build system to dnl make sure that global FS objects are linked to the squid binary. AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build") @@ -955,10 +954,10 @@ if test "x$squid_opt_use_esi" = "xyes" -a "x$with_libxml2" != "xno" ; then fi fi -AM_CONDITIONAL(USE_ESI, test "x$squid_opt_use_esi" = "xyes") -AM_CONDITIONAL(HAVE_LIBEXPAT, test "$HAVE_LIBEXPAT" = 1) +AM_CONDITIONAL(ENABLE_ESI, test "x$squid_opt_use_esi" = "xyes") +AM_CONDITIONAL(ENABLE_LIBEXPAT, test "$HAVE_LIBEXPAT" = 1) AC_SUBST(EXPATLIB) -AM_CONDITIONAL(HAVE_LIBXML2, test "$HAVE_LIBXML2" = 1) +AM_CONDITIONAL(ENABLE_LIBXML2, test "$HAVE_LIBXML2" = 1) AC_SUBST(XMLLIB) # icap argument handling @@ -967,13 +966,12 @@ AC_ARG_ENABLE(icap-client, SQUID_YESNO([$enableval],[Unrecognized argument to --disable-icap-client: $enableval]) ]) SQUID_DEFINE_BOOL(ICAP_CLIENT,${enable_icap_client:=yes}, [Enable ICAP client features in Squid]) -AM_CONDITIONAL(USE_ICAP_CLIENT, [test "x$enable_icap_client" != "xno" ]) +ICAP_LIBS="" if test "x$enable_icap_client" != "xno" ; then ICAP_LIBS="icap/libicap.la" squid_opt_use_adaptation=yes -else - ICAP_LIBS="" fi +AM_CONDITIONAL(ENABLE_ICAP_CLIENT, test "x$enable_icap_client" != "xno") AC_SUBST(ICAP_LIBS) squid_opt_use_ecap=1 @@ -1014,30 +1012,22 @@ then fi fi -AM_CONDITIONAL(USE_ECAP, test "x$squid_opt_use_ecap" = "xyes") -if test "x$squid_opt_use_ecap" = "xyes"; -then - AC_DEFINE(USE_ECAP,1,[Enable eCAP support]) +ECAP_LIBS="" +if test "x$squid_opt_use_ecap" = "xyes"; then ECAP_LIBS="ecap/libecapsquid.la" squid_opt_use_adaptation=yes -else - AC_DEFINE(USE_ECAP,0,[Disable eCAP support]) - ECAP_LIBS="" fi -dnl convenience library +SQUID_DEFINE_BOOL(USE_ECAP,${squid_opt_use_ecap:no},[Whether to use eCAP support]) +AM_CONDITIONAL(ENABLE_ECAP, test "x$squid_opt_use_ecap" = "xyes") AC_SUBST(ECAP_LIBS) - dnl enable adaptation if requested by specific adaptation mechanisms -AM_CONDITIONAL(USE_ADAPTATION, test "x$squid_opt_use_adaptation" = "xyes") -if test "x$squid_opt_use_adaptation" = "xyes" -then - AC_DEFINE(USE_ADAPTATION,1,[common adaptation support]) +ADAPTATION_LIBS="" +if test "x$squid_opt_use_adaptation" = "xyes"; then ADAPTATION_LIBS="adaptation/libadaptation.la" -else - AC_DEFINE(USE_ADAPTATION,0,[common adaptation support]) - ADAPTATION_LIBS="" fi +SQUID_DEFINE_BOOL(USE_ADAPTATION,${squid_opt_use_adaptation:=no}, [common adaptation support]) +AM_CONDITIONAL(ENABLE_ADAPTATION, test "x$squid_opt_use_adaptation" = "xyes") AC_SUBST(ADAPTATION_LIBS) test "x$squid_host_os" = "xmingw" && enable_wccp=no @@ -1154,7 +1144,7 @@ AC_SUBST(EUILIB) AC_MSG_NOTICE([EUI (MAC address) controls enabled: $enable_eui]) SQUID_DEFINE_BOOL(USE_SQUID_EUI,$enable_eui, [Define this to include code which lets you use ethernet addresses. This code uses API initially defined in 4.4-BSD.]) -AM_CONDITIONAL(USE_SQUID_EUI, [test "x$enable_eui" = "xyes" ]) +AM_CONDITIONAL(ENABLE_EUI, [test "x$enable_eui" = "xyes" ]) AC_ARG_ENABLE(htcp, @@ -1843,9 +1833,8 @@ fi AC_MSG_NOTICE([$KRB5_FLAVOUR Kerberos library support: ${with_krb5:=no} ${LIB_KRB5_PATH} ${LIB_KRB5_LIBS}]) AC_SUBST(KRB5INCS) AC_SUBST(KRB5LIBS) -AM_CONDITIONAL(HAVE_SPNEGO, test x"$squid_cv_have_spnego" = x"yes" ) -dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked +dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked dnl only with Windows LDAP libraries using -lwldap32 case "$squid_host_os" in mingw) @@ -2429,7 +2418,7 @@ AC_ARG_ENABLE(leakfinder, AC_MSG_NOTICE([Leak Finder enabled: ${enable_leakfinder:=no}]) SQUID_DEFINE_BOOL(USE_LEAKFINDER,$enable_leakfinder, [Enable code for assisting in finding memory leaks. Not for the faint of heart]) -AM_CONDITIONAL(MAKE_LEAKFINDER, [test "x$enable_leakfinder" = "xyes"]) +AM_CONDITIONAL(ENABLE_LEAKFINDER, [test "x$enable_leakfinder" = "xyes"]) AC_ARG_ENABLE(follow-x-forwarded-for, @@ -3444,12 +3433,12 @@ fi AC_MSG_NOTICE([Using ${squid_opt_io_loop_engine} for the IO loop.]) -AM_CONDITIONAL([USE_POLL], [test $squid_opt_io_loop_engine = poll]) -AM_CONDITIONAL([USE_EPOLL], [test $squid_opt_io_loop_engine = epoll]) -AM_CONDITIONAL([USE_SELECT], [test $squid_opt_io_loop_engine = select]) -AM_CONDITIONAL([USE_SELECT_WIN32], [test $squid_opt_io_loop_engine = select_win32]) -AM_CONDITIONAL([USE_KQUEUE], [test $squid_opt_io_loop_engine = kqueue]) -AM_CONDITIONAL([USE_DEVPOLL], [test $squid_opt_io_loop_engine = devpoll]) +AM_CONDITIONAL(ENABLE_POLL, test "x$squid_opt_io_loop_engine" = "xpoll") +AM_CONDITIONAL(ENABLE_EPOLL, test "x$squid_opt_io_loop_engine" = "xepoll") +AM_CONDITIONAL(ENABLE_SELECT, test "x$squid_opt_io_loop_engine" = "xselect") +AM_CONDITIONAL(ENABLE_SELECT_WIN32, test "x$squid_opt_io_loop_engine" = "xselect_win32") +AM_CONDITIONAL(ENABLE_KQUEUE, test "x$squid_opt_io_loop_engine" = "xkqueue") +AM_CONDITIONAL(ENABLE_DEVPOLL, test "x$squid_opt_io_loop_engine" = "xdevpoll") case $squid_opt_io_loop_engine in epoll) AC_DEFINE(USE_EPOLL,1,[Use epoll() for the IO loop]) ;; diff --git a/lib/Makefile.am b/lib/Makefile.am index d1ac5d0e23..14886d7d42 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -11,7 +11,7 @@ DIST_SUBDIRS = ntlmauth profiler rfcnb smblib libTrie snmplib SUBDIRS= EXTRA_DIST= -if USE_ESI +if ENABLE_ESI SUBDIRS += libTrie endif if ENABLE_SNMP diff --git a/src/Makefile.am b/src/Makefile.am index ae403eccee..d33b3a4daa 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -66,16 +66,16 @@ SNMP_SOURCE = $(SNMP_ALL_SOURCE) SUBDIRS += snmp SNMP_LIBS = snmp/libsnmp.la $(SNMPLIB) else -SNMP_SOURCE = +SNMP_SOURCE = endif DIST_SUBDIRS += snmp -if USE_ADAPTATION +if ENABLE_ADAPTATION SUBDIRS += adaptation endif DIST_SUBDIRS += adaptation -if USE_ESI +if ENABLE_ESI SUBDIRS += esi ESI_LIBS = \ esi/libesi.la \ @@ -113,27 +113,27 @@ DELAY_POOL_ALL_SOURCE = \ NullDelayId.h \ ClientDelayConfig.cc \ ClientDelayConfig.h - + if ENABLE_DELAY_POOLS DELAY_POOL_SOURCE = $(DELAY_POOL_ALL_SOURCE) else -DELAY_POOL_SOURCE = +DELAY_POOL_SOURCE = endif if ENABLE_XPROF_STATS XPROF_STATS_SOURCE = ProfStats.cc else -XPROF_STATS_SOURCE = +XPROF_STATS_SOURCE = endif if ENABLE_HTCP HTCPSOURCE = htcp.cc htcp.h endif -if MAKE_LEAKFINDER +if ENABLE_LEAKFINDER LEAKFINDERSOURCE = LeakFinder.cc else -LEAKFINDERSOURCE = +LEAKFINDERSOURCE = endif if ENABLE_UNLINKD @@ -141,7 +141,7 @@ UNLINKDSOURCE = unlinkd.h unlinkd.cc UNLINKD = unlinkd else UNLINKDSOURCE = unlinkd.h -UNLINKD = +UNLINKD = endif WIN32_ALL_SOURCE = \ @@ -181,8 +181,7 @@ noinst_PROGRAMS = \ sbin_PROGRAMS = \ squid -bin_PROGRAMS = - +bin_PROGRAMS = libexec_PROGRAMS = \ $(UNLINKD) @@ -888,10 +887,10 @@ check_PROGRAMS+=\ tests/testLookupTable \ tests/testYesNoNone -if HAVE_FS_ROCK +if ENABLE_FS_ROCK check_PROGRAMS += tests/testRock endif -if HAVE_FS_UFS +if ENABLE_FS_UFS check_PROGRAMS += tests/testUfs endif diff --git a/src/acl/Makefile.am b/src/acl/Makefile.am index de625ad742..e1b5f350f7 100644 --- a/src/acl/Makefile.am +++ b/src/acl/Makefile.am @@ -177,14 +177,14 @@ ADAPT_ACLS= \ AdaptationServiceData.h \ AdaptationServiceData.cc -if USE_ADAPTATION +if ENABLE_ADAPTATION libacls_la_SOURCES += $(ADAPT_ACLS) endif EXTRA_libacls_la_SOURCES += $(ADAPT_ACLS) ARP_ACLS = Arp.cc Arp.h Eui64.cc Eui64.h -if USE_SQUID_EUI +if ENABLE_EUI libacls_la_SOURCES += $(ARP_ACLS) endif EXTRA_libacls_la_SOURCES += $(ARP_ACLS) diff --git a/src/adaptation/Makefile.am b/src/adaptation/Makefile.am index 5ec5565f7a..0277e0470a 100644 --- a/src/adaptation/Makefile.am +++ b/src/adaptation/Makefile.am @@ -11,11 +11,11 @@ include $(top_srcdir)/src/TestHeaders.am ## make a list of directories for configured adaptation schemes SUBDIRS = -if USE_ICAP_CLIENT +if ENABLE_ICAP_CLIENT SUBDIRS += icap endif -if USE_ECAP +if ENABLE_ECAP SUBDIRS += ecap endif @@ -53,7 +53,7 @@ libadaptation_la_SOURCES = \ ServiceFilter.cc \ ServiceFilter.h \ History.cc \ - History.h + History.h # add libraries for specific adaptation schemes libadaptation_la_LIBADD = $(ECAP_LIBS) $(ICAP_LIBS) diff --git a/src/esi/Makefile.am b/src/esi/Makefile.am index e3c872acb9..68d5841b85 100644 --- a/src/esi/Makefile.am +++ b/src/esi/Makefile.am @@ -14,13 +14,13 @@ ESI_PARSER_SOURCES = \ CustomParser.cc \ CustomParser.h -if HAVE_LIBEXPAT +if ENABLE_LIBEXPAT ESI_PARSER_SOURCES += \ ExpatParser.cc \ ExpatParser.h endif -if HAVE_LIBXML2 +if ENABLE_LIBXML2 ESI_PARSER_SOURCES += \ Libxml2Parser.cc \ Libxml2Parser.h diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am index c9b2e3c499..5c74b9c378 100644 --- a/test-suite/Makefile.am +++ b/test-suite/Makefile.am @@ -27,10 +27,10 @@ EXTRA_DIST = \ ESI_ALL_TESTS = \ ESIExpressions -if USE_ESI +if ENABLE_ESI ESI_TESTS = $(ESI_ALL_TESTS) else - ESI_TESTS = + ESI_TESTS = endif ## Sort by dependencies - test lowest layers first