]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2662: cf_gen failure when cross compiling
authorBertrand Jacquin <beber@meleeweb.net>
Mon, 22 Aug 2011 14:45:52 +0000 (08:45 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 22 Aug 2011 14:45:52 +0000 (08:45 -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 39b0054eee84b75d6a3d2302d5bd0079cffeb6bb..ba85cd9d7c41918e74529426d6cbd6ee3102103c 100644 (file)
@@ -40,6 +40,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 e67c68a2e97c91f32f781d669c5d424207e84249..72cfa8012dfee61e46bbcfdf626c8fb7c9c9a698 100644 (file)
@@ -872,6 +872,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$(top_builddir)/include/ -I$(srcdir) -I$(builddir)
+
 # squid.conf.default is built by cf_gen when making cf_parser.cci
 squid.conf.default squid.conf.documented: cf_parser.cci
        true