]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2662: cf_gen failure when cross compiling
authorBertrand Jacquin <beber@meleeweb.net>
Sat, 27 Aug 2011 06:48:42 +0000 (00:48 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 27 Aug 2011 06:48:42 +0000 (00:48 -0600)
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
src/Makefile.am

index a6a465cfb78c696c88d4a20ddb155fcb5f9116cb..5cea422cb9634c6989081228c0b500a4136e0503 100644 (file)
@@ -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-"`
index 90d3426bb7ecc9c8d6ab3df4babfe4ec0bd5bb9a..136a5cd36c4f18e6b649df60da9cd5456c153e10 100644 (file)
@@ -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