------------------------------------------------------------ revno: 13441 revision-id: squid3@treenet.co.nz-20140604153016-xsix6wy08ixmvjtj parent: squid3@treenet.co.nz-20140603110036-ey5fo6qgnhal7lxx committer: Amos Jeffries branch nick: trunk timestamp: Wed 2014-06-04 08:30:16 -0700 message: 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 ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20140604153016-xsix6wy08ixmvjtj # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: b20d42149a372cfe0a1be3ec8fd4323ed3644c6c # timestamp: 2014-06-04 15:54:31 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20140603110036-\ # ey5fo6qgnhal7lxx # # Begin patch === modified file 'configure.ac' --- configure.ac 2014-05-27 08:23:05 +0000 +++ configure.ac 2014-06-04 15:30:16 +0000 @@ -53,17 +53,19 @@ 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(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 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 === modified file 'doc/release-notes/release-3.5.sgml' --- doc/release-notes/release-3.5.sgml 2014-05-07 10:10:42 +0000 +++ doc/release-notes/release-3.5.sgml 2014-06-04 15:30:16 +0000 @@ -332,6 +332,16 @@

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. === modified file 'src/Makefile.am' --- src/Makefile.am 2014-05-27 08:23:05 +0000 +++ src/Makefile.am 2014-06-04 15:30:16 +0000 @@ -970,7 +970,7 @@ # 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