]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cross-compile: Add BUILDCXX and BUILDCXXFLAGS configure options
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 4 Jun 2014 15:30:16 +0000 (08:30 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 4 Jun 2014 15:30:16 +0000 (08:30 -0700)
We have provided HOSTCXX for some time. However in the official cross
compilation terminology HOST is the output architecture. Renames to
BUILD to align with the official terminology of which machine the tools
it builds are run on.

Also, add a flags variable and document these as important variables in
./configure --help output

configure.ac
doc/release-notes/release-3.5.sgml
src/Makefile.am

index 3dfa4cb162e622f243f9800866e9ceafa90a7248..51054f950304c66a3342bdac8f68cc2364aa6774 100644 (file)
@@ -53,17 +53,19 @@ if test "x${enable_arch_native}" != "xno"; then
 fi
 
 # might be cross-compiling.
-if test "x$HOSTCXX" = "x"; then
-  HOSTCXX="$CXX"
+# NP: BUILDCXXFLAGS defined at the end of configure after CXXFLAGS fully known.
+AC_ARG_VAR([BUILDCXX],[path to compiler for building compile-time tools. e.g. cf_gen])
+if test "x$HOSTCXX" != "x" -a "x$BUILDCXX" = "x"; then
+  AC_MSG_WARN([Cross-compiling with HOSTCXX is deprecated. Uses BUILDCXX instead.])
+  BUILDCXX="$HOSTCXX"
+fi
+if test "x$BUILDCXX" = "x"; then
+  BUILDCXX="$CXX"
   if test "x$squid_cv_check_marchnative" = "xyes"; then
     CXXFLAGS="$CXXFLAGS -march=native"
   fi
 fi
-if test "x$squid_cv_check_marchnative" = "xyes"; then
-  # always valid for the Host compiler.
-  HOSTCXX="$HOSTCXX -march=native"
-fi
-AC_SUBST(HOSTCXX)
+AC_SUBST(BUILDCXX)
 
 AC_MSG_CHECKING([simplified host os])
 simple_host_os=`echo $host_os|sed 's/[0-9].*//g;s/-.*//g'`
@@ -3417,6 +3419,18 @@ AC_SUBST(XTRA_LIBS)
 AC_SUBST(SQUID_CFLAGS)
 AC_SUBST(SQUID_CXXFLAGS)
 
+AC_ARG_VAR([BUILDCXXFLAGS],[C++ compiler flags for building compile-time tools. e.g. cf_gen])
+if test "x$BUILDCXXFLAGS" = "x"; then
+  # if we are NOT cross-compiling, use the default build flags for cf_gen and friends
+  # otherwise rely on the user-provided value
+  if test "x$squid_cv_check_marchnative" = "xyes"; then
+    # always valid for the Build compiler.
+    BUILDCXXFLAGS="-march-native"
+  fi
+  BUILDCXXFLAGS="$BUILDCXXFLAGS $CXXFLAGS"
+fi
+AC_SUBST(BUILDCXXFLAGS)
+
 AC_MSG_NOTICE([BUILD LIBRARIES: $LIBS])
 AC_MSG_NOTICE([BUILD EXTRA LIBRARIES: $XTRA_LIBS])
 AC_MSG_NOTICE([BUILD OBJECTS: $OBJS])
@@ -3425,6 +3439,7 @@ AC_MSG_NOTICE([BUILD C FLAGS: $CFLAGS])
 AC_MSG_NOTICE([BUILD EXTRA C FLAGS: $SQUID_CFLAGS])
 AC_MSG_NOTICE([BUILD C++ FLAGS: $CXXFLAGS])
 AC_MSG_NOTICE([BUILD EXTRA C++ FLAGS: $SQUID_CXXFLAGS])
+AC_MSG_NOTICE([BUILD Tools C++ FLAGS: $BUILDCXXFLAGS])
 
 dnl Clean up after OSF/1 core dump bug
 rm -f core 
index 0b34d788c4af558d82a4e00f75b45790776ddcfe..c7b7d6e914314aa20a00c6807c76ccd1392bca58 100644 (file)
@@ -332,6 +332,16 @@ This section gives an account of those changes in three categories:
 <descrip>
        <p><em>There are no new ./configure options in Squid-3.5.</em>
 
+       <tag>BUILDCXX=</tag>
+       <p>Used when cross-compiling Squid.
+       <p>The path and name of a compiler for building cf_gen and related
+          tools used in the compile process.
+
+       <tag>BUILDCXXFLAGS=</tag>
+       <p>Used when cross-compiling Squid.
+       <p>C++ compiler flags used for building cf_gen and related
+          tools used in the compile process.
+
        <tag>--without-gnutls</tag>
        <p>New option to explicitly disable use of GnuTLS encryption library.
           Use of this library is auto-enabled if v3.1.5 or later is available.
index fb57de2c2c1c4516a5c6cd136337d5c4c87b9c56..d2ebb1f65ecf460a90ee45ef6d2a2521310cc516 100644 (file)
@@ -970,7 +970,7 @@ cache_cf.o: cf_parser.cci
 
 # cf_gen builds the configuration files.
 cf_gen$(EXEEXT): $(cf_gen_SOURCES) $(cf_gen_DEPENDENCIES) cf_gen_defines.cci
-       $(HOSTCXX) -o $@ $(srcdir)/cf_gen.cc -I$(srcdir) -I$(top_builddir)/include/ -I$(top_builddir)/src
+       $(BUILDCXX) $(BUILDCXXFLAGS) -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