From: robertc <> Date: Tue, 19 Aug 2003 06:15:01 +0000 (+0000) Subject: Summary: Test for -fhuge-objects in configure. (Bug #744) X-Git-Tag: SQUID_3_0_PRE4~1244 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d7c59e3796a605a0bb4c0ef2ecb77bf469fb803f;p=thirdparty%2Fsquid.git Summary: Test for -fhuge-objects in configure. (Bug #744) Keywords: Test for -fhuge-objects in configure. (Resolves bug $744) --- diff --git a/acinclude.m4 b/acinclude.m4 index f705f071e4..9b0c809d56 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -52,3 +52,35 @@ SQUID_DEFAULT_INCLUDES #include #endif ]) + +dnl +dnl thanks to autogen, for the template.. +dnl +dnl @synopsis AC_TEST_CHECKFORHUGEOBJECTS +dnl +dnl Test whether -fhuge-objects is available with this c++ compiler. gcc-29.5 series compilers need this on some platform with large objects. +dnl +AC_DEFUN([AC_TEST_CHECKFORHUGEOBJECTS],[ + AC_MSG_CHECKING([whether compiler accepts -fhuge-objects]) + AC_CACHE_VAL([ac_cv_test_checkforhugeobjects],[ + ac_cv_test_checkforhugeobjects=`echo "int foo;" > conftest.cc +${CXX} -Werror -fhuge-objects -c conftest.cc 2>/dev/null +res=$? +rm -f conftest.* +echo yes +exit $res` 2> /dev/null + if [[ $? -ne 0 ]] + then ac_cv_test_checkforhugeobjects=no + else if [[ -z "$ac_cv_test_checkforhugeobjects" ]] + then ac_cv_test_checkforhugeobjects=yes + fi ; fi + ]) # end of CACHE_VAL + AC_MSG_RESULT([${ac_cv_test_checkforhugeobjects}]) + + if test "X${ac_cv_test_checkforhugeobjects}" != Xno + then + HUGE_OBJECT_FLAG="-fhuge-objects" + else + HUGE_OBJECT_FLAG="" + fi +]) # end of AC_DEFUN of AC_TEST_CHECKFORHUGEOBJECTS diff --git a/configure.in b/configure.in index 5aa3e5866f..22d807eec7 100644 --- a/configure.in +++ b/configure.in @@ -3,7 +3,7 @@ dnl Configuration input file for Squid dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.346 2003/08/16 01:03:09 robertc Exp $ +dnl $Id: configure.in,v 1.347 2003/08/19 00:15:01 robertc Exp $ dnl dnl dnl @@ -13,7 +13,7 @@ AC_CONFIG_SRCDIR([src/main.cc]) AC_CONFIG_AUX_DIR(cfgaux) AM_INIT_AUTOMAKE(squid, 3.0-PRE3-CVS) AM_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.346 $)dnl +AC_REVISION($Revision: 1.347 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -133,6 +133,9 @@ fi AC_SUBST(SQUID_CFLAGS) AC_SUBST(SQUID_CXXFLAGS) +AC_TEST_CHECKFORHUGEOBJECTS +SQUID_CXXFLAGS="$SQUID_CXXFLAGS $HUGE_OBJECT_FLAG" + dnl Set LDFLAGS if test -z "$PRESET_LDFLAGS"; then if test "$GCC" = "yes"; then diff --git a/lib/libTrie/acinclude.m4 b/lib/libTrie/acinclude.m4 new file mode 100644 index 0000000000..848b6be992 --- /dev/null +++ b/lib/libTrie/acinclude.m4 @@ -0,0 +1,31 @@ +dnl +dnl thanks to autogen, for the template.. +dnl +dnl @synopsis AC_TEST_CHECKFORHUGEOBJECTS +dnl +dnl Test whether -fhuge-objects is available with this c++ compiler. gcc-29.5 series compilers need this on some platform with large objects. +dnl +AC_DEFUN([AC_TEST_CHECKFORHUGEOBJECTS],[ + AC_MSG_CHECKING([whether compiler accepts -fhuge-objects]) + AC_CACHE_VAL([ac_cv_test_checkforhugeobjects],[ + ac_cv_test_checkforhugeobjects=`echo "int foo;" > conftest.cc +${CXX} -Werror -fhuge-objects -c conftest.cc 2>/dev/null +res=$? +rm -f conftest.* +echo yes +exit $res` 2> /dev/null + if [[ $? -ne 0 ]] + then ac_cv_test_checkforhugeobjects=no + else if [[ -z "$ac_cv_test_checkforhugeobjects" ]] + then ac_cv_test_checkforhugeobjects=yes + fi ; fi + ]) # end of CACHE_VAL + AC_MSG_RESULT([${ac_cv_test_checkforhugeobjects}]) + + if test "X${ac_cv_test_checkforhugeobjects}" != Xno + then + HUGE_OBJECT_FLAG="-fhuge-objects" + else + HUGE_OBJECT_FLAG="" + fi +]) # end of AC_DEFUN of AC_TEST_CHECKFORHUGEOBJECTS diff --git a/lib/libTrie/configure.in b/lib/libTrie/configure.in index 80ce90bd25..052d7551c7 100644 --- a/lib/libTrie/configure.in +++ b/lib/libTrie/configure.in @@ -4,7 +4,7 @@ AC_CONFIG_SRCDIR([src/Trie.cc]) AM_CONFIG_HEADER([config.h]) SquidInline="yes" - AC_ARG_ENABLE(inline, +AC_ARG_ENABLE(inline, [ --disable-inline Don't compile trivial methods as inline. Squid is coded with much of the code able to be inlined.< Inlining is good for production builds, but not good for development. During development, use @@ -13,50 +13,54 @@ SquidInline="yes" production builds, or load tests, use --enable-inline to have squid make all trivial methods inlinable by the compiler.], - [ if test "$enableval" = "no" ; then - SquidInline="no" - fi - ]) - - if test "$SquidInline" = "yes" ; then - AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods]) - AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file]) - else - AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods]) - fi + [ if test "$enableval" = "no" ; then + SquidInline="no" + fi + ]) + +if test "$SquidInline" = "yes" ; then + AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods]) + AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file]) +else + AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods]) +fi # Checks for programs. - AC_PROG_CXX - AC_PROG_CC - AC_PROG_MAKE_SET +AC_PROG_CXX +AC_PROG_CC +AC_PROG_MAKE_SET # for old automakes - like squid-cache.orgs! - AM_INIT_AUTOMAKE(libTrie, 0.1) - AM_MAINTAINER_MODE - AC_PROG_RANLIB - - dnl set useful flags - if test "$GCC" = "yes"; then - TRIE_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments" - TRIE_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wcomments" - else - TRIE_CFLAGS= - TRIE_CXXFLAGS= - fi - AC_SUBST(TRIE_CFLAGS) - AC_SUBST(TRIE_CXXFLAGS) +AM_INIT_AUTOMAKE(libTrie, 0.1) +AM_MAINTAINER_MODE +AC_PROG_RANLIB + +dnl set useful flags +if test "$GCC" = "yes"; then + TRIE_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments" + TRIE_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wcomments" +else + TRIE_CFLAGS= + TRIE_CXXFLAGS= +fi + +AC_TEST_CHECKFORHUGEOBJECTS +TRIE_CXXFLAGS="$TRIE_CXXFLAGS $HUGE_OBJECT_FLAG" + +AC_SUBST(TRIE_CFLAGS) +AC_SUBST(TRIE_CXXFLAGS) # Checks for libraries. # Checks for header files. # Checks for typedefs, structures, and compiler characteristics. - AC_C_CONST - AC_TYPE_SIZE_T +AC_C_CONST +AC_TYPE_SIZE_T # Checks for library functions. - AC_CONFIG_FILES([Makefile - include/Makefile - src/Makefile - test/Makefile]) - AC_OUTPUT +AC_CONFIG_FILES([Makefile + include/Makefile + src/Makefile + test/Makefile]) +AC_OUTPUT