From: Francesco Chemolli Date: Thu, 19 Aug 2010 12:50:13 +0000 (+0200) Subject: configure.in fix: properly pass default hosts_file option around during build. X-Git-Tag: take1~363 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75eaac6c6bc1ae92b91f05ad4de0807138eda71f;p=thirdparty%2Fsquid.git configure.in fix: properly pass default hosts_file option around during build. --- diff --git a/configure.in b/configure.in index d05efe5f1b..4658189370 100644 --- a/configure.in +++ b/configure.in @@ -1417,20 +1417,19 @@ dnl Select Default hosts file location AC_ARG_ENABLE(default-hostsfile, AS_HELP_STRING([--enable-default-hostsfile=path], [Select default location for hosts file. - See hosts_file directive in squid.conf for details]), -[ - if test "x$enableval" != "xnone" -a "x$enableval" != "xno" ; then - if test -f "$enableval"; then - OPT_DEFAULT_HOSTS=$enableval - else - AC_MSG_WARN([Unable to find $enableval]) - fi - else - OPT_DEFAULT_HOSTS="none" + See hosts_file directive in squid.conf for details]), [ +if test "x$enableval" != "xnone" -a "x$enableval" != "xno" ; then + if test \! -f "$enableval"; then + AC_MSG_WARN([Unable to find file $enableval. I hope you know what you are doing.]) fi - AC_MSG_NOTICE([Default hosts file set to: $enableval]) -],[OPT_DEFAULT_HOSTS="/etc/hosts"]) -AC_SUBST(OPT_DEFAULT_HOSTS) + squid_opt_default_hosts=$enableval +else + squid_opt_default_hosts="none" +fi +]) +AC_MSG_NOTICE([Default hosts file set to: ${squid_opt_default_hosts:=/etc/hosts}]) +DEFAULT_HOSTS=$squid_opt_default_hosts +AC_SUBST(DEFAULT_HOSTS) # Select auth schemes modules to build AC_ARG_ENABLE(auth, diff --git a/src/Makefile.am b/src/Makefile.am index 54483d6128..f687676ab8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -746,7 +746,7 @@ DEFAULT_LOGFILED = $(libexecdir)/`echo log_file_daemon | sed '$(transform);s/$$/ DEFAULT_DISKD = $(libexecdir)/`echo diskd | sed '$(transform);s/$$/$(EXEEXT)/'` DEFAULT_ICON_DIR = $(datadir)/icons DEFAULT_ERROR_DIR = $(datadir)/errors -DEFAULT_HOSTS = $(OPT_DEFAULT_HOSTS) +DEFAULT_HOSTS = @DEFAULT_HOSTS@ # Make location configure settings available to the code DEFS += -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" -DDEFAULT_SQUID_DATA_DIR=\"$(datadir)\" -DDEFAULT_SQUID_CONFIG_DIR=\"$(sysconfdir)\" @@ -817,7 +817,7 @@ cf.data: cf.data.pre Makefile -e "s%[@]DEFAULT_ICON_DIR[@]%$(DEFAULT_ICON_DIR)%g" \ -e "s%[@]DEFAULT_CONFIG_DIR[@]%$(DEFAULT_CONFIG_DIR)%g" \ -e "s%[@]DEFAULT_PREFIX[@]%$(DEFAULT_PREFIX)%g" \ - -e "s%[@]DEFAULT_HOSTS[@]%$(OPT_DEFAULT_HOSTS)%g" \ + -e "s%[@]DEFAULT_HOSTS[@]%$(DEFAULT_HOSTS)%g" \ -e "s%[@]SQUID[@]%SQUID\ $(VERSION)%g" \ < $(srcdir)/cf.data.pre >$@