]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability: support customization of --prefix= via compat/autoconf.h
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 10 Oct 2012 01:36:31 +0000 (19:36 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 10 Oct 2012 01:36:31 +0000 (19:36 -0600)
Rather than defining DEFAULT_PREFIX on the compiler command line this
builds its value into autoconf.h for use whenever needed. Avoiding
potential issues with buggy Makefile.am coding.

Also allows the --prefix value to be sourced from the autoconf internal
default settings instead of requiring a manual --prefix parameter for
SNMP module to build and link properly.

configure.ac
src/snmp/Makefile.am

index 99eaab554ff92890dd0fc3f294e65f37708c5833..072f58a25d793c88d1b5d87f230c67651f295b15 100644 (file)
@@ -104,6 +104,14 @@ fi
 AR_R="$AR r"
 AC_SUBST(AR_R)
 
+# pre-define DEFAULT_PREFIX, some modules need it.
+if test "${prefix}" = "NONE" ; then
+  squid_prefix=$ac_default_prefix
+else
+  squid_prefix=$prefix
+fi
+AC_DEFINE_UNQUOTED(DEFAULT_PREFIX,[$squid_prefix],[The install prefix])
+
 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.
index 39d6036c2665430b432e5218fa1c65977de3f221..3100a4e8898ca1810fc5017704525fed3b1ff32a 100644 (file)
@@ -20,5 +20,3 @@ libsnmp_la_SOURCES = \
        Session.h \
        Var.cc \
        Var.h
-
-DEFS += -DDEFAULT_PREFIX=\"$(prefix)\"