]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Summary: Test for -fhuge-objects in configure. (Bug #744)
authorrobertc <>
Tue, 19 Aug 2003 06:15:01 +0000 (06:15 +0000)
committerrobertc <>
Tue, 19 Aug 2003 06:15:01 +0000 (06:15 +0000)
Keywords:

Test for -fhuge-objects in configure. (Resolves bug $744)

acinclude.m4
configure.in
lib/libTrie/acinclude.m4 [new file with mode: 0644]
lib/libTrie/configure.in

index f705f071e40e20fec5772aadd16cd1ed0fad552c..9b0c809d56110f41ba8e9add4f52bd12fb61ae2d 100644 (file)
@@ -52,3 +52,35 @@ SQUID_DEFAULT_INCLUDES
 #include <sys/param.h>
 #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
index 5aa3e5866f6bfc3231b31d174c41036327e912bb..22d807eec7ddfb1ab5b672b27d1b00eab7298d4f 100644 (file)
@@ -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 (file)
index 0000000..848b6be
--- /dev/null
@@ -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
index 80ce90bd25b66af782737fd5c3d7afe96139305a..052d7551c793a3ee3b799b147df4d5840e923791 100644 (file)
@@ -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