From c154b22014461e8585aa2bd30c730a68ca52b1f6 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 5 Jul 2001 07:53:04 +0000 Subject: [PATCH] Fix some more issues about flags for the cxx compiler. git-svn-id: https://svn.dealii.org/trunk@4818 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/configure | 143 ++++++++++++++++++++++--------------------- deal.II/configure.in | 19 +++++- 2 files changed, 89 insertions(+), 73 deletions(-) diff --git a/deal.II/configure b/deal.II/configure index 550c6cf290..ceb36888a6 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.78 +# From configure.in Revision: 1.79 @@ -1315,16 +1315,19 @@ else else if test "x$GXX_VERSION" = "xcompaq_cxx" ; then - - - CXXFLAGSG="$CXXFLAGS -model ansi -std strict_ansi -w1 -msg_display_number -DDEBUG" - CXXFLAGSO="$CXXFLAGS -model ansi -std strict_ansi -w2 -msg_display_number -fast" + + CXXFLAGSG="$CXXFLAGS -model ansi -std strict_ansi -w1 -msg_display_number -timplicit_local -DDEBUG" + CXXFLAGSO="$CXXFLAGS -model ansi -std strict_ansi -w2 -msg_display_number -timplicit_local -fast" for i in 175 236 237 381 487 1136 1156 111 1182 265 ; do CXXFLAGSG="$CXXFLAGSG -msg_disable $i" CXXFLAGSO="$CXXFLAGSO -msg_disable $i" done + LDFLAGS="$LDFLAGS -model ansi" + + LDFLAGS="$LDFLAGS -lm" + else { echo "configure: error: No compiler options for this C++ compiler @@ -1345,12 +1348,12 @@ fi for ac_func in gethostname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1349: checking for $ac_func" >&5 +echo "configure:1352: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1405,12 +1408,12 @@ done if test "$GXX" = yes ; then echo $ac_n "checking whether -ggdb works for long symbols""... $ac_c" 1>&6 -echo "configure:1409: checking whether -ggdb works for long symbols" >&5 +echo "configure:1412: checking whether -ggdb works for long symbols" >&5 case "$target" in alpha*-osf*) CXXFLAGS="-ggdb $CXXFLAGSG" cat > conftest.$ac_ext < @@ -1431,7 +1434,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1438: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* CXXFLAGSG="-ggdb $CXXFLAGSG" @@ -1516,7 +1519,7 @@ if test "$enablemultithreading" = yes ; then if test "$GXX" = yes ; then echo $ac_n "checking for platform specific thread flags""... $ac_c" 1>&6 -echo "configure:1520: checking for platform specific thread flags" >&5 +echo "configure:1523: checking for platform specific thread flags" >&5 for i in threads mt pthread pthreads mthreads Kthread kthread invalid_last_entry; do CXXFLAGS="$CXXFLAGSG -$i" @@ -1552,7 +1555,7 @@ echo "configure:1520: checking for platform specific thread flags" >&5 echo $ac_n "checking for platform specific multi-threading defines""... $ac_c" 1>&6 -echo "configure:1556: checking for platform specific multi-threading defines" >&5 +echo "configure:1559: checking for platform specific multi-threading defines" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' @@ -1561,7 +1564,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""not necessary"" 1>&6 @@ -1626,7 +1629,7 @@ fi if test "$withmultithreading" != no ; then echo $ac_n "checking for ACE""... $ac_c" 1>&6 -echo "configure:1630: checking for ACE" >&5 +echo "configure:1633: checking for ACE" >&5 if test -d "$withmultithreading" ; then echo "$ac_t""found" 1>&6 else @@ -1647,7 +1650,7 @@ fi if test "$enablemultithreading" = yes ; then if test "$GXX" = yes ; then echo $ac_n "checking whether compilation with ACE disallows flags""... $ac_c" 1>&6 -echo "configure:1651: checking whether compilation with ACE disallows flags" >&5 +echo "configure:1654: checking whether compilation with ACE disallows flags" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' @@ -1657,7 +1660,7 @@ cross_compiling=$ac_cv_prog_cxx_cross CXXFLAGS="-ansi -I$withmultithreading" cat > conftest.$ac_ext < @@ -1667,7 +1670,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* deal_II_ace_remove_ansi="no" @@ -1683,7 +1686,7 @@ fi rm -f conftest* CXXFLAGS="-pedantic -Werror -I$withmultithreading" cat > conftest.$ac_ext < @@ -1693,7 +1696,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* deal_II_ace_remove_pedantic="no" @@ -1775,7 +1778,7 @@ done echo $ac_n "checking whether AssertThrow works with debug flags""... $ac_c" 1>&6 -echo "configure:1779: checking whether AssertThrow works with debug flags" >&5 +echo "configure:1782: checking whether AssertThrow works with debug flags" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' @@ -1785,7 +1788,7 @@ cross_compiling=$ac_cv_prog_cxx_cross CXXFLAGS=$CXXFLAGSG cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -1813,7 +1816,7 @@ fi rm -f conftest* echo $ac_n "checking whether AssertThrow works with optimized flags""... $ac_c" 1>&6 -echo "configure:1817: checking whether AssertThrow works with optimized flags" >&5 +echo "configure:1820: checking whether AssertThrow works with optimized flags" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' @@ -1823,7 +1826,7 @@ cross_compiling=$ac_cv_prog_cxx_cross CXXFLAGS=$CXXFLAGSO cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -1852,7 +1855,7 @@ rm -f conftest* echo $ac_n "checking for std::vector bug""... $ac_c" 1>&6 -echo "configure:1856: checking for std::vector bug" >&5 +echo "configure:1859: checking for std::vector bug" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' @@ -1862,7 +1865,7 @@ cross_compiling=$ac_cv_prog_cxx_cross CXXFLAGS="$CXXFLAGSG" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""no" 1>&6 @@ -1903,7 +1906,7 @@ rm -f conftest* echo $ac_n "checking for std::iterator class""... $ac_c" 1>&6 -echo "configure:1907: checking for std::iterator class" >&5 +echo "configure:1910: checking for std::iterator class" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' @@ -1913,7 +1916,7 @@ cross_compiling=$ac_cv_prog_cxx_cross CXXFLAGS="$CXXFLAGSG" cat > conftest.$ac_ext < @@ -1924,7 +1927,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1931: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -1945,7 +1948,7 @@ rm -f conftest* echo $ac_n "checking whether lrand48 needs to be declared with -ansi""... $ac_c" 1>&6 -echo "configure:1949: checking whether lrand48 needs to be declared with -ansi" >&5 +echo "configure:1952: checking whether lrand48 needs to be declared with -ansi" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' @@ -1955,7 +1958,7 @@ cross_compiling=$ac_cv_prog_cxx_cross CXXFLAGS="$CXXFLAGSG" cat > conftest.$ac_ext < @@ -1971,7 +1974,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""no" 1>&6 @@ -1992,7 +1995,7 @@ rm -f conftest* echo $ac_n "checking whether getrusage is properly declared""... $ac_c" 1>&6 -echo "configure:1996: checking whether getrusage is properly declared" >&5 +echo "configure:1999: checking whether getrusage is properly declared" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' @@ -2001,7 +2004,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < @@ -2013,7 +2016,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -2032,7 +2035,7 @@ rm -f conftest* echo $ac_n "checking whether isnan is declared with debug flags""... $ac_c" 1>&6 -echo "configure:2036: checking whether isnan is declared with debug flags" >&5 +echo "configure:2039: checking whether isnan is declared with debug flags" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' @@ -2043,7 +2046,7 @@ cross_compiling=$ac_cv_prog_cxx_cross CXXFLAGS=$CXXFLAGSG deal_II_isnan_flag="" cat > conftest.$ac_ext < @@ -2055,7 +2058,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -2071,7 +2074,7 @@ rm -f conftest* if test "x$deal_II_isnan_flag" = "x" ; then cat > conftest.$ac_ext < @@ -2083,7 +2086,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2090: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -2103,7 +2106,7 @@ rm -f conftest* for testflag in -D_ISOC99_SOURCE -D__EXTENSIONS__ ; do CXXFLAGS="$CXXFLAGSG $testflag" cat > conftest.$ac_ext < @@ -2115,7 +2118,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* deal_II_isnan_flag="-DHAVE_ISNAN $testflag" @@ -2128,7 +2131,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < @@ -2140,7 +2143,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* deal_II_isnan_flag="-DHAVE_UNDERSCORE_ISNAN $testflag" @@ -2162,7 +2165,7 @@ rm -f conftest* fi echo $ac_n "checking whether isnan is declared with optimized flags""... $ac_c" 1>&6 -echo "configure:2166: checking whether isnan is declared with optimized flags" >&5 +echo "configure:2169: checking whether isnan is declared with optimized flags" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' @@ -2173,7 +2176,7 @@ cross_compiling=$ac_cv_prog_cxx_cross CXXFLAGS=$CXXFLAGSO deal_II_isnan_flag="" cat > conftest.$ac_ext < @@ -2185,7 +2188,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2192: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -2201,7 +2204,7 @@ rm -f conftest* if test "x$deal_II_isnan_flag" = "x" ; then cat > conftest.$ac_ext < @@ -2213,7 +2216,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -2233,7 +2236,7 @@ rm -f conftest* for testflag in -D_ISOC99_SOURCE -D__EXTENSIONS__ ; do CXXFLAGS="$CXXFLAGSO $testflag" cat > conftest.$ac_ext < @@ -2245,7 +2248,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* deal_II_isnan_flag="-DHAVE_ISNAN $testflag" @@ -2258,7 +2261,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < @@ -2270,7 +2273,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* deal_II_isnan_flag="-DHAVE_UNDERSCORE_ISNAN $testflag" @@ -2300,7 +2303,7 @@ rm -f conftest* # Extract the first word of "f77", so it can be a program name with args. set dummy f77; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2304: checking for $ac_word" >&5 +echo "configure:2307: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_F77'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2336,7 +2339,7 @@ if test "x$F77" = "x" ; then # Extract the first word of "g77", so it can be a program name with args. set dummy g77; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2340: checking for $ac_word" >&5 +echo "configure:2343: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_F77'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2482,7 +2485,7 @@ fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2486: checking for $ac_word" >&5 +echo "configure:2489: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2520,7 +2523,7 @@ fi echo $ac_n "checking for HSL subroutines""... $ac_c" 1>&6 -echo "configure:2524: checking for HSL subroutines" >&5 +echo "configure:2527: checking for HSL subroutines" >&5 hsl_subroutines="" if test -r contrib/hsl/source/ma27.f ; then hsl_subroutines="$hsl_subroutines MA27" @@ -2585,7 +2588,7 @@ else fi echo $ac_n "checking for kdoc""... $ac_c" 1>&6 -echo "configure:2589: checking for kdoc" >&5 +echo "configure:2592: checking for kdoc" >&5 if test "$kdocdir" != ${DEAL2_DIR}/contrib/kdoc/bin ; then if test -r $kdocdir/kdoc ; then echo "$ac_t""found" 1>&6 @@ -2621,7 +2624,7 @@ if test "$docxx" = to-be-determined ; then # Extract the first word of ""doc++"", so it can be a program name with args. set dummy "doc++"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2625: checking for $ac_word" >&5 +echo "configure:2628: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_docxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2655,7 +2658,7 @@ fi else echo $ac_n "checking for doc++""... $ac_c" 1>&6 -echo "configure:2659: checking for doc++" >&5 +echo "configure:2662: checking for doc++" >&5 if test -x "$docxx" ; then echo "$ac_t""yes" 1>&6 else @@ -2678,16 +2681,16 @@ cross_compiling=$ac_cv_prog_cxx_cross CXXFLAGS="$CXXFLAGSG" echo $ac_n "checking for consistency of CXXFLAGSG flags""... $ac_c" 1>&6 -echo "configure:2682: checking for consistency of CXXFLAGSG flags" >&5 +echo "configure:2685: checking for consistency of CXXFLAGSG flags" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2694: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -2705,16 +2708,16 @@ rm -f conftest* CXXFLAGS="$CXXFLAGSO" echo $ac_n "checking for consistency of CXXFLAGSO flags""... $ac_c" 1>&6 -echo "configure:2709: checking for consistency of CXXFLAGSO flags" >&5 +echo "configure:2712: checking for consistency of CXXFLAGSO flags" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 diff --git a/deal.II/configure.in b/deal.II/configure.in index b2328a245f..2fff13b64a 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -308,16 +308,29 @@ else dnl of the same class if the latter is not public and therefore not dnl accessible at global scope in general. I nevertheless think that dnl this is valid.) + dnl + dnl Besides this, choose the most standard conforming mode of the compiler, + dnl i.e. -model ansi and -std strict_ansi. Unfortunately, we have to + dnl also add the flag -implicit_local (generating implicit instantiations of + dnl template with the `weak' link flag) since otherwise not all templates + dnl are instantiated (also some from the standards library are missing). - - CXXFLAGSG="$CXXFLAGS -model ansi -std strict_ansi -w1 -msg_display_number -DDEBUG" - CXXFLAGSO="$CXXFLAGS -model ansi -std strict_ansi -w2 -msg_display_number -fast" + CXXFLAGSG="$CXXFLAGS -model ansi -std strict_ansi -w1 -msg_display_number -timplicit_local -DDEBUG" + CXXFLAGSO="$CXXFLAGS -model ansi -std strict_ansi -w2 -msg_display_number -timplicit_local -fast" for i in 175 236 237 381 487 1136 1156 111 1182 265 ; do CXXFLAGSG="$CXXFLAGSG -msg_disable $i" CXXFLAGSO="$CXXFLAGSO -msg_disable $i" done + dnl If we use -model ansi to compile the files, we also have to specify + dnl it for linking + LDFLAGS="$LDFLAGS -model ansi" + + dnl For some reason, cxx also forgets to add the math lib to the linker + dnl line, so we do that ourselves + LDFLAGS="$LDFLAGS -lm" + dnl if necessary: -shared, -pthread dnl Should one use -compress? -distinguish_nested_enums? -nousing_std? dnl -pch? -noimplicit_include? -- 2.39.5