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
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*)