]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Check for that nasty quad-define on CygWin, and disable it.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 25 Sep 2002 22:44:28 +0000 (22:44 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 25 Sep 2002 22:44:28 +0000 (22:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@6520 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 9b7b3a17e52f615306025c720835015aaa56d907..892fb08f38d0f031d04aacc0022545c92bf3d2e6 100644 (file)
@@ -2439,6 +2439,51 @@ void f (const std::ostream &out);
 ])
 
 
+
+dnl -------------------------------------------------------------
+dnl On some Cygwin systems, a system header file includes this
+dnl preprocessor define:
+dnl   #define quad quad_t
+dnl This is of course silly, but beyond that it also hurts as
+dnl since we have member functions and variables with that name
+dnl and we get compile errors depending or not we have this
+dnl particular header file included. 
+dnl
+dnl Fortunately, the define is only active is _POSIX_SOURCE is
+dnl not set, so check for this define, and if necessary set
+dnl this flag. We check on all systems, since maybe there are 
+dnl other such systems elsewhere...
+dnl
+dnl Usage: DEAL_II_CHECK_QUAD_DEFINE
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_CHECK_QUAD_DEFINE, dnl
+[
+  AC_MSG_CHECKING(for quad vs. quad_t define)
+  AC_LANG(C++)
+  CXXFLAGS="$CXXFLAGSG"
+  AC_TRY_COMPILE(
+    [
+#include <sys/types>
+#if defined(quad)
+    no good system;
+#endif
+    ],
+    [
+    ],
+    [
+      AC_MSG_RESULT(yes, working around)
+      CXXFLAGSG="$CXXFLAGSG -D_POSIX_SOURCE"
+      CXXFLAGSO="$CXXFLAGSO -D_POSIX_SOURCE"
+    ],
+    [
+      AC_MSG_RESULT(no)
+    ])
+])
+
+
+
+
 dnl ------------------------------------------------------------
 dnl Check whether some of the HSL functions have been dropped
 dnl into their respective place in the contrib subdir.
index 52ac087fed80f36a34fbf48cedf7ec59a5bc8619..1fbe5a301403080cac2cded35fb988689963ccb8 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.120 .
+# From configure.in Revision: 1.121 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.53a.
 #
@@ -5682,6 +5682,68 @@ cat conftest.$ac_ext >&5
 echo "${ECHO_T}no" >&6
 
 
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+
+  echo "$as_me:$LINENO: checking for quad vs. quad_t define" >&5
+echo $ECHO_N "checking for quad vs. quad_t define... $ECHO_C" >&6
+  ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+  CXXFLAGS="$CXXFLAGSG"
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#include <sys/types>
+#if defined(quad)
+    no good system;
+#endif
+
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+      echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+      CXXFLAGSG="$CXXFLAGSG -D_POSIX_SOURCE"
+      CXXFLAGSO="$CXXFLAGSO -D_POSIX_SOURCE"
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+      echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
index 7fb5765ed7adb1cce2a741d514f349f309fe21a3..8ebb41cfa82245851745026877980dc4a4e76399 100644 (file)
@@ -184,6 +184,7 @@ DEAL_II_HAVE_BUILTIN_EXPECT
 DEAL_II_CHECK_GETRUSAGE
 DEAL_II_CHECK_ISNAN
 DEAL_II_CHECK_RAND_R
+DEAL_II_CHECK_QUAD_DEFINE
 AC_CHECK_FUNCS(gethostname)
 
 

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.