From 698fbb7ba9652a4939e41e2b8d3ad01a9416fb4d Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Sat, 27 Aug 2011 00:48:42 -0600 Subject: [PATCH] Bug 2662: cf_gen failure when cross compiling Adds support for "./configure HOSTCXX=foo" to specify a host compiler to build cf_gen with. If none is specified the normal build compiler will be used. --- configure.ac | 6 ++++++ src/Makefile.am | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/configure.ac b/configure.ac index a6a465cfb7..5cea422cb9 100644 --- a/configure.ac +++ b/configure.ac @@ -27,6 +27,12 @@ AC_PROG_CXX AC_LANG([C++]) AC_CANONICAL_HOST +# might be cross-compiling +if test "x$HOSTCXX" = "x"; then + HOSTCXX="$CXX" +fi +AC_SUBST(HOSTCXX) + AC_MSG_CHECKING([simplified host os]) simple_host_os=`echo $host_os|sed 's/[0-9].*//g;s/-.*//g'` squid_host_os_version=`echo $host_os|tr -d "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"` diff --git a/src/Makefile.am b/src/Makefile.am index 90d3426bb7..136a5cd36c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -754,6 +754,10 @@ test_cache_digest: test_cache_digest.o CacheDigest.o debug.o globals.o store_key ## If autodependency works well this is not needed anymore cache_cf.o: cf_parser.cci +# cf_gen builds the configuration files. +cf_gen$(EXEEXT): $(cf_gen_SOURCES) $(cf_gen_DEPENDENCIES) + $(HOSTCXX) -o $@ $(srcdir)/cf_gen.cc -I$(srcdir) -I$(top_builddir)/include/ -I$(top_builddir)/src + # squid.conf.default is built by cf_gen when making cf_parser.cci squid.conf.default squid.conf.documented: cf_parser.cci true -- 2.47.2