]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Don't use -Wno-long-double on MAC when not available.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 3 Oct 2008 18:44:10 +0000 (18:44 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 3 Oct 2008 18:44:10 +0000 (18:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@17092 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure

index 9e3fc39d7d01bb54dcb8fba079b10b3712f7c6bd..78e63d0f448b3d26b92621f0eaae891d5d2dae6f 100644 (file)
@@ -577,10 +577,25 @@ AC_DEFUN(DEAL_II_SET_CXX_FLAGS, dnl
 
     dnl Some system specific things
     case "$target" in
-      dnl Use -Wno-long-long on Apple Darwin to avoid some unnecessary warning
+      dnl Use -Wno-long-long on Apple Darwin to avoid some unnecessary
+      dnl warnings. However, newer gccs on that platform do not have 
+      dnl this flag any more, so check whether we can indeed do this
       *apple-darwin*)
-       CXXFLAGSG="$CXXFLAGSG -Wno-long-double"
-       CXXFLAGSO="$CXXFLAGSO -Wno-long-double"
+        OLD_CXXFLAGS="$CXXFLAGS"
+        CXXFLAGS=-Wno-long-double
+
+        AC_MSG_CHECKING(whether we can use -Wno-long-double)
+        AC_TRY_COMPILE([], [;],
+          [
+            AC_MSG_RESULT(yes)
+           CXXFLAGSG="$CXXFLAGSG -Wno-long-double"
+           CXXFLAGSO="$CXXFLAGSO -Wno-long-double"
+          ],
+          [
+            AC_MSG_RESULT(no)
+          ])
+
+        CXXFLAGS="${OLD_CXXFLAGS}"
         ;;
 
       dnl On DEC OSF, including both stdio.h and unistd.h causes a warning
index 0609809f5250ab43da168d9abd97028dcee4d023..8562421d7b44238b40be1476cf105e9dec7d02ac 100755 (executable)
@@ -4012,9 +4012,63 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     fi
 
         case "$target" in
-            *apple-darwin*)
-       CXXFLAGSG="$CXXFLAGSG -Wno-long-double"
-       CXXFLAGSO="$CXXFLAGSO -Wno-long-double"
+                        *apple-darwin*)
+        OLD_CXXFLAGS="$CXXFLAGS"
+        CXXFLAGS=-Wno-long-double
+
+        { echo "$as_me:$LINENO: checking whether we can use -Wno-long-double" >&5
+echo $ECHO_N "checking whether we can use -Wno-long-double... $ECHO_C" >&6; }
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+            { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+           CXXFLAGSG="$CXXFLAGSG -Wno-long-double"
+           CXXFLAGSO="$CXXFLAGSO -Wno-long-double"
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+            { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+        CXXFLAGS="${OLD_CXXFLAGS}"
         ;;
 
                               *dec-osf*)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.