From: Amos Jeffries Date: Wed, 4 Jun 2014 15:30:16 +0000 (-0700) Subject: Cross-compile: Add BUILDCXX and BUILDCXXFLAGS configure options X-Git-Tag: SQUID_3_5_0_1~204 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b2f0a3759b34fd2300dbc97b13df1ae2661aa773;p=thirdparty%2Fsquid.git Cross-compile: Add BUILDCXX and BUILDCXXFLAGS configure options 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 --- diff --git a/configure.ac b/configure.ac index 3dfa4cb162..51054f9503 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/doc/release-notes/release-3.5.sgml b/doc/release-notes/release-3.5.sgml index 0b34d788c4..c7b7d6e914 100644 --- a/doc/release-notes/release-3.5.sgml +++ b/doc/release-notes/release-3.5.sgml @@ -332,6 +332,16 @@ This section gives an account of those changes in three categories:

There are no new ./configure options in Squid-3.5. + BUILDCXX= +

Used when cross-compiling Squid. +

The path and name of a compiler for building cf_gen and related + tools used in the compile process. + + BUILDCXXFLAGS= +

Used when cross-compiling Squid. +

C++ compiler flags used for building cf_gen and related + tools used in the compile process. + --without-gnutls

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. diff --git a/src/Makefile.am b/src/Makefile.am index fb57de2c2c..d2ebb1f65e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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