From: Amos Jeffries Date: Thu, 23 Apr 2009 09:52:10 +0000 (-0600) Subject: Detach automke system from using -I. X-Git-Tag: SQUID_3_2_0_1~1049 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=189f1e66b9cd5216f9d7d46954bea170660e5ce3;p=thirdparty%2Fsquid.git Detach automke system from using -I. That path include allows unsafe header collisions on case-insensitive file systems. Uses src/Common.am in all makefiles now to provide build paths and flags correctly to all parts of Squid. TODO: fix several code warnings now present due to CFLAGS being used on some helper code which had omitted to use them previously. check that libTrie and squid_kerb_auth are not affected as well. --- diff --git a/compat/Makefile.am b/compat/Makefile.am index 80ed9929a3..4e0eac8ba5 100644 --- a/compat/Makefile.am +++ b/compat/Makefile.am @@ -13,6 +13,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/src \ -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ -I$(top_builddir)/lib \ @SQUID_CPPUNIT_INC@ diff --git a/configure.in b/configure.in index bb0ae5ba51..e291df894f 100644 --- a/configure.in +++ b/configure.in @@ -9,7 +9,7 @@ AC_PREREQ(2.52) AM_CONFIG_HEADER(include/autoconf.h) AC_CONFIG_AUX_DIR(cfgaux) AC_CONFIG_SRCDIR([src/main.cc]) -AM_INIT_AUTOMAKE([tar-ustar]) +AM_INIT_AUTOMAKE([tar-ustar nostdinc]) AC_REVISION($Revision: 1.497 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE diff --git a/helpers/basic_auth/LDAP/Makefile.am b/helpers/basic_auth/LDAP/Makefile.am index 5c5d19ab67..11af8a29af 100644 --- a/helpers/basic_auth/LDAP/Makefile.am +++ b/helpers/basic_auth/LDAP/Makefile.am @@ -6,6 +6,8 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + libexec_PROGRAMS = squid_ldap_auth man_MANS = squid_ldap_auth.8 EXTRA_DIST = squid_ldap_auth.8 @@ -18,6 +20,5 @@ LDADD = \ $(LIB_LBER) \ $(XTRA_LIBS) -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/include +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) diff --git a/helpers/basic_auth/MSNT/Makefile.am b/helpers/basic_auth/MSNT/Makefile.am index 1deb9b56ac..c8d7901638 100644 --- a/helpers/basic_auth/MSNT/Makefile.am +++ b/helpers/basic_auth/MSNT/Makefile.am @@ -6,6 +6,8 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + MSNTAUTH_CONF = $(sysconfdir)/msntauth.conf libexec_PROGRAMS = msnt_auth @@ -30,10 +32,8 @@ sysconf_DATA = \ LDADD = -L$(top_builddir)/lib -lmiscutil $(XTRA_LIBS) $(top_builddir)/compat/libcompat.la -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) confload.o: confload.c $(COMPILE) -DSYSCONFDIR=\"$(sysconfdir)\" -c $(srcdir)/confload.c -o $@ diff --git a/helpers/basic_auth/NCSA/Makefile.am b/helpers/basic_auth/NCSA/Makefile.am index 5d0cc2de7b..08ef3d72de 100644 --- a/helpers/basic_auth/NCSA/Makefile.am +++ b/helpers/basic_auth/NCSA/Makefile.am @@ -6,6 +6,8 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + libexec_PROGRAMS = ncsa_auth ncsa_auth_SOURCES = ncsa_auth.c crypt_md5.c crypt_md5.h man_MANS = ncsa_auth.8 @@ -17,7 +19,5 @@ LDADD = \ $(XTRA_LIBS) \ $(SSLLIB) -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) diff --git a/helpers/basic_auth/PAM/Makefile.am b/helpers/basic_auth/PAM/Makefile.am index b33262002e..c6a65aec56 100644 --- a/helpers/basic_auth/PAM/Makefile.am +++ b/helpers/basic_auth/PAM/Makefile.am @@ -6,13 +6,14 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + man_MANS = pam_auth.8 EXTRA_DIST = pam_auth.8 libexec_PROGRAMS = pam_auth -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/include +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) LDADD = \ $(top_builddir)/compat/libcompat.la \ diff --git a/helpers/basic_auth/SASL/Makefile.am b/helpers/basic_auth/SASL/Makefile.am index b2bed770e3..d30bf67182 100644 --- a/helpers/basic_auth/SASL/Makefile.am +++ b/helpers/basic_auth/SASL/Makefile.am @@ -6,11 +6,12 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + libexec_PROGRAMS = sasl_auth -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/include +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) LDADD = \ $(top_builddir)/compat/libcompat.la \ diff --git a/helpers/basic_auth/SMB/Makefile.am b/helpers/basic_auth/SMB/Makefile.am index 89eabe400c..82aa4b42ea 100644 --- a/helpers/basic_auth/SMB/Makefile.am +++ b/helpers/basic_auth/SMB/Makefile.am @@ -6,6 +6,8 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + # SAMBAPREFIX must point to the directory where Samba has been installed. # By default, Samba is installed in /usr/local/samba. If you changed this # by using the --prefix option when configuring Samba, you need to change @@ -22,9 +24,8 @@ libexec_PROGRAMS = smb_auth smb_auth_CFLAGS = -DSAMBAPREFIX=\"$(SAMBAPREFIX)\" -DHELPERSCRIPT=\"$(SMB_AUTH_HELPER_PATH)\" EXTRA_DIST = smb_auth.sh COPYING-2.0 -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/include +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) LDADD = \ $(top_builddir)/compat/libcompat.la \ diff --git a/helpers/basic_auth/YP/Makefile.am b/helpers/basic_auth/YP/Makefile.am index 37b111ba2d..79f5561a69 100644 --- a/helpers/basic_auth/YP/Makefile.am +++ b/helpers/basic_auth/YP/Makefile.am @@ -5,12 +5,13 @@ # # +include $(top_srcdir)/src/Common.am + libexec_PROGRAMS = yp_auth yp_auth_SOURCES = yp_auth.c nis_support.h nis_support.c -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/include +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) LDADD = \ $(top_builddir)/compat/libcompat.la \ diff --git a/helpers/basic_auth/getpwnam/Makefile.am b/helpers/basic_auth/getpwnam/Makefile.am index 4685071f06..c733abd628 100644 --- a/helpers/basic_auth/getpwnam/Makefile.am +++ b/helpers/basic_auth/getpwnam/Makefile.am @@ -6,15 +6,14 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am libexec_PROGRAMS = getpwname_auth getpwname_auth_SOURCES = getpwnam_auth.c -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) LDADD = \ $(top_builddir)/compat/libcompat.la \ diff --git a/helpers/basic_auth/mswin_sspi/Makefile.am b/helpers/basic_auth/mswin_sspi/Makefile.am index f404b7deb3..4d915d5449 100644 --- a/helpers/basic_auth/mswin_sspi/Makefile.am +++ b/helpers/basic_auth/mswin_sspi/Makefile.am @@ -6,6 +6,7 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am libexec_PROGRAMS = mswin_auth @@ -17,9 +18,7 @@ LDADD = \ -lnetapi32 -ladvapi32 -lsspwin32 \ $(XTRA_LIBS) -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) EXTRA_DIST = readme.txt diff --git a/helpers/basic_auth/squid_radius_auth/Makefile.am b/helpers/basic_auth/squid_radius_auth/Makefile.am index 73990f66e6..34be3078ad 100644 --- a/helpers/basic_auth/squid_radius_auth/Makefile.am +++ b/helpers/basic_auth/squid_radius_auth/Makefile.am @@ -6,6 +6,8 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + libexec_PROGRAMS = squid_radius_auth man_MANS = squid_radius_auth.8 EXTRA_DIST = squid_radius_auth.8 @@ -15,9 +17,8 @@ squid_radius_auth_SOURCES = \ radius-util.c \ radius-util.h -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/include +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) LDADD = \ $(top_builddir)/compat/libcompat.la \ diff --git a/helpers/digest_auth/eDirectory/Makefile.am b/helpers/digest_auth/eDirectory/Makefile.am index 5c3e095c1b..82af4fe443 100644 --- a/helpers/digest_auth/eDirectory/Makefile.am +++ b/helpers/digest_auth/eDirectory/Makefile.am @@ -6,6 +6,12 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + + libexec_PROGRAMS = digest_edir_auth digest_edir_auth_SOURCES = digest_pw_auth.c \ digest_common.h \ @@ -14,12 +20,6 @@ digest_edir_auth_SOURCES = digest_pw_auth.c \ edir_ldapext.c \ edir_ldapext.h -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - LDADD = \ $(top_builddir)/compat/libcompat.la \ -L$(top_builddir)/lib -lmiscutil \ diff --git a/helpers/digest_auth/ldap/Makefile.am b/helpers/digest_auth/ldap/Makefile.am index a96bcbc7e0..7d57e771dd 100644 --- a/helpers/digest_auth/ldap/Makefile.am +++ b/helpers/digest_auth/ldap/Makefile.am @@ -6,18 +6,18 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + + libexec_PROGRAMS = digest_ldap_auth digest_ldap_auth_SOURCES = digest_pw_auth.c \ digest_common.h \ ldap_backend.c \ ldap_backend.h -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - LDADD = \ $(top_builddir)/compat/libcompat.la \ -L$(top_builddir)/lib -lmiscutil \ diff --git a/helpers/digest_auth/password/Makefile.am b/helpers/digest_auth/password/Makefile.am index 83ea631335..a2312086a0 100644 --- a/helpers/digest_auth/password/Makefile.am +++ b/helpers/digest_auth/password/Makefile.am @@ -6,18 +6,18 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + + libexec_PROGRAMS = digest_pw_auth digest_pw_auth_SOURCES = digest_pw_auth.c \ digest_common.h \ text_backend.c \ text_backend.h -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - LDADD = \ $(top_builddir)/compat/libcompat.la \ -L$(top_builddir)/lib -lmiscutil \ diff --git a/helpers/external_acl/ip_user/Makefile.am b/helpers/external_acl/ip_user/Makefile.am index 870b3a163c..7361cb4aaa 100644 --- a/helpers/external_acl/ip_user/Makefile.am +++ b/helpers/external_acl/ip_user/Makefile.am @@ -6,6 +6,11 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + libexec_PROGRAMS = ip_user_check @@ -21,14 +26,6 @@ EXTRA_DIST = \ license \ README -# sysconf_DATA = - -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - LDADD = \ $(top_builddir)/compat/libcompat.la \ -L$(top_builddir)/lib -lmiscutil \ diff --git a/helpers/external_acl/ldap_group/Makefile.am b/helpers/external_acl/ldap_group/Makefile.am index ea6e25a1e8..8ce92a39ce 100644 --- a/helpers/external_acl/ldap_group/Makefile.am +++ b/helpers/external_acl/ldap_group/Makefile.am @@ -6,17 +6,17 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + + libexec_PROGRAMS = squid_ldap_group man_MANS = squid_ldap_group.8 EXTRA_DIST = squid_ldap_group.8 squid_ldap_group_SOURCES = squid_ldap_group.c -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - LDADD = \ $(top_builddir)/compat/libcompat.la \ -L$(top_builddir)/lib -lmiscutil \ diff --git a/helpers/external_acl/session/Makefile.am b/helpers/external_acl/session/Makefile.am index 9bc99ab18c..2a1aea0c12 100644 --- a/helpers/external_acl/session/Makefile.am +++ b/helpers/external_acl/session/Makefile.am @@ -6,17 +6,17 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + + libexec_PROGRAMS = squid_session man_MANS = squid_session.8 EXTRA_DIST = squid_session.8 squid_session_SOURCES = squid_session.c -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - LDADD = \ $(top_builddir)/compat/libcompat.la \ @LIB_DB@ diff --git a/helpers/external_acl/unix_group/Makefile.am b/helpers/external_acl/unix_group/Makefile.am index a5625eaf80..bbecef2ffe 100644 --- a/helpers/external_acl/unix_group/Makefile.am +++ b/helpers/external_acl/unix_group/Makefile.am @@ -6,17 +6,17 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + + libexec_PROGRAMS = squid_unix_group man_MANS = squid_unix_group.8 EXTRA_DIST = squid_unix_group.8 squid_unix_group_SOURCES = check_group.c -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include - LDADD = \ $(top_builddir)/compat/libcompat.la \ -L$(top_builddir)/lib -lmiscutil \ diff --git a/helpers/negotiate_auth/mswin_sspi/Makefile.am b/helpers/negotiate_auth/mswin_sspi/Makefile.am index 487aff495c..e0025761c4 100644 --- a/helpers/negotiate_auth/mswin_sspi/Makefile.am +++ b/helpers/negotiate_auth/mswin_sspi/Makefile.am @@ -4,12 +4,16 @@ # $Id$ # +include $(top_srcdir)/src/Common.am + +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + + libexec_PROGRAMS = mswin_negotiate_auth mswin_negotiate_auth_SOURCES = libnegotiatessp.c negotiate_auth.c negotiate.h -INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)/src - LDADD = -L$(top_builddir)/lib -lsspwin32 -ladvapi32 -lmiscutil $(XTRA_LIBS) EXTRA_DIST = readme.txt diff --git a/helpers/ntlm_auth/fakeauth/Makefile.am b/helpers/ntlm_auth/fakeauth/Makefile.am index d62ac772ec..8e8f102949 100644 --- a/helpers/ntlm_auth/fakeauth/Makefile.am +++ b/helpers/ntlm_auth/fakeauth/Makefile.am @@ -6,14 +6,13 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am + libexec_PROGRAMS = fakeauth_auth fakeauth_auth_SOURCES = fakeauth_auth.c ntlm.h -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) LDADD = \ $(top_builddir)/compat/libcompat.la \ diff --git a/helpers/ntlm_auth/mswin_sspi/Makefile.am b/helpers/ntlm_auth/mswin_sspi/Makefile.am index a757c5d9b6..0e5b9e6013 100644 --- a/helpers/ntlm_auth/mswin_sspi/Makefile.am +++ b/helpers/ntlm_auth/mswin_sspi/Makefile.am @@ -4,15 +4,14 @@ # $Id$ # +include $(top_srcdir)/src/Common.am + libexec_PROGRAMS = mswin_ntlm_auth mswin_ntlm_auth_SOURCES = libntlmssp.c ntlm_auth.c ntlm.h -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) LDADD = \ $(top_builddir)/compat/libcompat.la \ diff --git a/helpers/ntlm_auth/smb_lm/Makefile.am b/helpers/ntlm_auth/smb_lm/Makefile.am index b898adc5db..afeb4932c7 100644 --- a/helpers/ntlm_auth/smb_lm/Makefile.am +++ b/helpers/ntlm_auth/smb_lm/Makefile.am @@ -2,17 +2,16 @@ # Makefile for the Squid Object Cache server # +include $(top_srcdir)/src/Common.am + SUBDIRS = smbval libexec_PROGRAMS = ntlm_smb_lm_auth ntlm_smb_lm_auth_SOURCES = libntlmssp.c ntlm_smb_lm_auth.c ntlm_smb_lm_auth.h -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src \ +## we need our local files too (but avoid -I. at all costs) +INCLUDES += \ + -I$(srcdir) \ -I$(srcdir)/smbval LDADD = \ diff --git a/helpers/ntlm_auth/smb_lm/smbval/Makefile.am b/helpers/ntlm_auth/smb_lm/smbval/Makefile.am index bad9fc9c1d..d1144cc126 100644 --- a/helpers/ntlm_auth/smb_lm/smbval/Makefile.am +++ b/helpers/ntlm_auth/smb_lm/smbval/Makefile.am @@ -1,10 +1,10 @@ # makefile for smblib -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include +include $(top_srcdir)/src/Common.am + +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + noinst_LIBRARIES = libsmbvalid.a diff --git a/lib/tests/testRFC1035.cc b/lib/tests/testRFC1035.cc index b181c2329d..1f56bae478 100644 --- a/lib/tests/testRFC1035.cc +++ b/lib/tests/testRFC1035.cc @@ -7,7 +7,7 @@ #include "testRFC1035.h" /* Being a C library code it is best bodily included and tested with C++ type-safe techniques. */ -#include "rfc1035.c" +#include "lib/rfc1035.c" CPPUNIT_TEST_SUITE_REGISTRATION( testRFC1035 ); diff --git a/src/Makefile.am b/src/Makefile.am index 378b36b348..d2d756f5f5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,6 +4,7 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am AUTOMAKE_OPTIONS = subdir-objects if USE_DNSSERVER @@ -29,9 +30,6 @@ LOADABLE_MODULES_SOURCES = \ LoadableModules.h \ LoadableModules.cc -TESTS=$(check_PROGRAMS) -check_PROGRAMS= - SUBDIRS = base acl fs repl auth ip icmp if USE_ADAPTATION @@ -152,9 +150,6 @@ else IDENT_SOURCE = endif -AM_CFLAGS = @SQUID_CFLAGS@ -AM_CXXFLAGS = @SQUID_CXXFLAGS@ - EXTRA_LIBRARIES = libAIO.a libBlocking.a libDiskDaemon.a libDiskThreads.a noinst_LIBRARIES = @DISK_LIBS@ noinst_LTLIBRARIES = libsquid.la @@ -171,14 +166,8 @@ COMMON_LIBS = \ ip/libip.la \ fs/libfs.la -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/lib \ - -I$(top_srcdir)/lib \ - @SQUID_CPPUNIT_INC@ +## Loadable Modules needs lib/libLtdl stuff +INCLUDES += -I$(top_srcdir)/lib EXTRA_PROGRAMS = \ DiskIO/DiskDaemon/diskd \ @@ -217,6 +206,9 @@ cf_gen_LDADD= \ @MINGW_LIBS@ cf_gen.$(OBJEXT): cf_gen_defines.h +## cf_gen.cc needs src/cf_gen_defines.h +INCLUDES += -I$(top_builddir)/src + ACL_REGISTRATION_SOURCES = AclRegs.cc AuthReg.cc @@ -719,9 +711,7 @@ DEFAULT_MIB_PATH = $(datadir)/mib.txt DEFAULT_HOSTS = @OPT_DEFAULT_HOSTS@ # Make location configure settings available to the code -DEFS = @DEFS@ -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" -DDEFAULT_SQUID_DATA_DIR=\"$(datadir)\" -DDEFAULT_SQUID_CONFIG_DIR=\"$(sysconfdir)\" - -$(OBJS): $(top_srcdir)/include/version.h ../include/autoconf.h +DEFS += -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" -DDEFAULT_SQUID_DATA_DIR=\"$(datadir)\" -DDEFAULT_SQUID_CONFIG_DIR=\"$(sysconfdir)\" snmp_core.o snmp_agent.o: ../snmplib/libsnmp.a $(top_srcdir)/include/cache_snmp.h @@ -807,7 +797,7 @@ uninstall-local: @$(SHELL) $(top_srcdir)/scripts/remove-cfg.sh $(RM) $(DESTDIR)$(DEFAULT_MIME_TABLE) @$(SHELL) $(top_srcdir)/scripts/remove-cfg.sh $(RM) $(DESTDIR)$(DEFAULT_CONFIG_FILE) -CLEANFILES = cf_gen_defines.h cf.data cf_parser.h squid.conf.default squid.conf.documented \ +CLEANFILES += cf_gen_defines.h cf.data cf_parser.h squid.conf.default squid.conf.documented \ globals.cc string_arrays.c repl_modules.cc DiskIO/DiskIOModules_gen.cc \ test_tools.cc *.a diff --git a/src/auth/Makefile.am b/src/auth/Makefile.am index 982585ce45..59a350c3ec 100644 --- a/src/auth/Makefile.am +++ b/src/auth/Makefile.am @@ -1,5 +1,8 @@ include $(top_srcdir)/src/Common.am +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + noinst_LTLIBRARIES = libauth.la libacls.la @AUTH_LIBS_TO_BUILD@ EXTRA_LTLIBRARIES = libbasic.la libdigest.la libntlm.la libnegotiate.la @@ -55,9 +58,6 @@ libnegotiate_la_SOURCES = \ negotiate/auth_negotiate.cc \ negotiate/auth_negotiate.h -# TODO: fix #include statements so that this is not needed -INCLUDES += -I. - check_PROGRAMS += testHeaders @@ -70,7 +70,5 @@ testHeaders: $(top_srcdir)/src/auth/*.h $(top_srcdir)/src/auth/basic/*.h $(top_s $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" "$(top_srcdir)/src/auth/ntlm" || exit 1 $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" "$(top_srcdir)/src/auth/negotiate" || exit 1 -## No such file... -testHeaders.c: - touch testHeaders.c CLEANFILES += testHeaders.c +.PHONY: testHeaders diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am index 47d98a8f9d..664a866002 100644 --- a/src/fs/Makefile.am +++ b/src/fs/Makefile.am @@ -35,8 +35,8 @@ libfs_la_DEPENDENCIES = @STORE_LIBS_TO_BUILD@ EXTRA_DIST = \ coss/coss-notes.txt -# TODO: fix #include statements so that this is not needed -INCLUDES += -I. +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) check_PROGRAMS += testHeaders diff --git a/src/icmp/Makefile.am b/src/icmp/Makefile.am index c2912c5ce4..73c8c232a0 100644 --- a/src/icmp/Makefile.am +++ b/src/icmp/Makefile.am @@ -1,22 +1,6 @@ -# -# Makefile for the Squid ICMP and Network Measurement API -# - -# Housekeeping, shared by all Squid Makefiles. -# TODO: make this set by configure? -AM_CFLAGS = @SQUID_CFLAGS@ -AM_CXXFLAGS = @SQUID_CXXFLAGS@ -DEFS = @DEFS@ -CLEANFILES = - -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/lib \ - @SQUID_CPPUNIT_INC@ - -$(OBJS): $(top_srcdir)/include/version.h $(top_srcdir)/include/autoconf.h + +include $(top_srcdir)/src/Common.am +include $(top_srcdir)/src/TestHeaders.am # TODO: get rid of this when config filename is no longer a global constant. # its only here so the testIcmp will link . @@ -67,11 +51,11 @@ pinger_SOURCES = \ # depends on these but install/dist is done elsewhere. # TODO: remove when these are cleaned up in their own way. nodist_pinger_SOURCES = \ - ../debug.cc \ - ../globals.cc \ - ../time.cc \ - ../SquidConfig.cc \ - ../SquidNew.cc + $(top_srcdir)/src/debug.cc \ + $(top_builddir)/src/globals.cc \ + $(top_srcdir)/src/time.cc \ + $(top_srcdir)/src/SquidConfig.cc \ + $(top_srcdir)/src/SquidNew.cc pinger_LDFLAGS = $(LIBADD_DL) pinger_LDADD=\ @@ -98,19 +82,8 @@ pinger_DEPENDENCIES= \ ## fi -check_PROGRAMS= testIcmp testHeaders -TESTS= $(check_PROGRAMS) - -## Special Universal .h dependency test script -## aborts if error encountered -testHeaders: $(top_srcdir)/src/icmp/*.h - $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" "$(top_srcdir)/src/icmp/" || exit 1 - -## No such file... -testHeaders.c: - touch testHeaders.c -CLEANFILES += testHeaders.c - +check_PROGRAMS += testIcmp +TESTS += testIcmp ## Tests of the ICMP base module. # Its used by pinger so SHOULD NOT require more dependancies! :-( @@ -119,11 +92,11 @@ testIcmp_SOURCES = \ testIcmp.h \ testIcmp.cc nodist_testIcmp_SOURCES = \ - ../tests/testMain.cc \ - ../SquidTime.h \ - ../time.cc \ - ../../test-suite/test_tools.cc \ - ../globals.cc + $(top_srcdir)/src/tests/testMain.cc \ + $(top_srcdir)/src/SquidTime.h \ + $(top_srcdir)/src/time.cc \ + $(top_srcdir)/test-suite/test_tools.cc \ + $(top_builddir)/src/globals.cc testIcmp_LDFLAGS = $(LIBADD_DL) testIcmp_LDADD=\ @SQUID_CPPUNIT_LIBS@ \ diff --git a/src/ip/Makefile.am b/src/ip/Makefile.am index 4961985eab..dfbebd1634 100644 --- a/src/ip/Makefile.am +++ b/src/ip/Makefile.am @@ -1,25 +1,5 @@ -# -# Makefile for the Squid IP layer API -# - -# Housekeeping, shared by all Squid Makefiles. -# TODO: make this set by configure? -AM_CFLAGS = @SQUID_CFLAGS@ -AM_CXXFLAGS = @SQUID_CXXFLAGS@ -DEFS = @DEFS@ -CLEANFILES = - -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/lib \ - -I$(top_srcdir)/src \ - @SQUID_CPPUNIT_INC@ - -$(OBJS): $(top_srcdir)/include/version.h $(top_srcdir)/include/autoconf.h - - -# IP Specific Configurations +include $(top_srcdir)/src/Common.am +include $(top_srcdir)/src/TestHeaders.am noinst_LTLIBRARIES = libip.la @@ -32,19 +12,8 @@ libip_la_SOURCES = \ QosConfig.cc -check_PROGRAMS= testHeaders testIpAddress -TESTS= $(check_PROGRAMS) - -## Special Universal .h dependency test script -## aborts if error encountered -testHeaders: $(top_srcdir)/src/ip/*.h - $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" "$(top_srcdir)/src/ip/" || exit 1 - -## No such file... -testHeaders.c: - touch testHeaders.c -CLEANFILES += testHeaders.c - +check_PROGRAMS += testIpAddress +TESTS += testIpAddress testIpAddress_SOURCES= \ testIpAddress.cc \ diff --git a/src/repl/Makefile.am b/src/repl/Makefile.am index 22a6bb6e65..1799a0663e 100644 --- a/src/repl/Makefile.am +++ b/src/repl/Makefile.am @@ -3,10 +3,12 @@ # $Id$ # +include $(top_srcdir)/src/Common.am + +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + AUTOMAKE_OPTIONS = subdir-objects -AM_CFLAGS = @SQUID_CFLAGS@ -AM_CXXFLAGS = @SQUID_CXXFLAGS@ -CLEANFILES = # No recursion is needed for the subdirs, we build from here. // @REPL_POLICIES@ @@ -16,14 +18,8 @@ noinst_LIBRARIES = @REPL_LIBS@ liblru_a_SOURCES = lru/store_repl_lru.cc libheap_a_SOURCES = heap/store_heap_replacement.h heap/store_heap_replacement.cc heap/store_repl_heap.cc -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src - -check_PROGRAMS= testHeaders +## Until such time as we have a makefile in src/repl/heap etc. +check_PROGRAMS += testHeaders ## Special Universal .h dependency test script ## aborts if error encountered @@ -32,7 +28,5 @@ testHeaders: $(top_srcdir)/src/repl/heap/*.h ## ./ has no .h files. ## ./lru/ has no .h files. -## No such file... -testHeaders.c: - touch testHeaders.c -CLEANFILES += testHeaders.c +CLEANFILES += testHeaders +.PHONY: testHeaders diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am index 2718487481..469bf7d22a 100644 --- a/test-suite/Makefile.am +++ b/test-suite/Makefile.am @@ -4,17 +4,12 @@ # $Id$ # -AUTOMAKE_OPTIONS = subdir-objects +include $(top_srcdir)/src/Common.am -AM_CFLAGS = @SQUID_CFLAGS@ -AM_CXXFLAGS = @SQUID_CXXFLAGS@ +AUTOMAKE_OPTIONS = subdir-objects -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) LDADD = \ $(top_builddir)/compat/libcompat.la \ @@ -36,7 +31,7 @@ else endif ## Sort by dependencies - test lowest layers first -TESTS = debug \ +TESTS += debug \ syntheticoperators \ VirtualDeleteOperator \ StackTest \ @@ -49,7 +44,7 @@ TESTS = debug \ $(ESI_TESTS) ## Sort by alpha - any build failures are significant. -check_PROGRAMS= debug \ +check_PROGRAMS += debug \ $(ESI_TESTS) \ MemPoolTest\ mem_node_test\ diff --git a/tools/Makefile.am b/tools/Makefile.am index 9b8dda7cd1..b158011e8f 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -4,30 +4,13 @@ # Uncomment and customize the following to suit your needs: # +include $(top_srcdir)/src/Common.am AUTOMAKE_OPTIONS = subdir-objects -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src \ - @SQUID_CPPUNIT_INC@ -# -I$(top_srcdir)/lib/libTrie/include -# -I$(srcdir) - -TESTS=$(check_PROGRAMS) -#check_PROGRAMS= testHeaders - -### Special Universal .h dependency test script -#testHeaders: *.h -# ./ has no .h files -# -## No Such file... -#testHeaders.c: -# touch testHeaders.c -#CLEANFILES += testHeaders.c +## we need our local files too (but avoid -I. at all costs) +INCLUDES += -I$(srcdir) + SUBDIRS =