From: wolf Date: Wed, 25 Sep 2002 22:44:28 +0000 (+0000) Subject: Check for that nasty quad-define on CygWin, and disable it. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a0696673b448d680e1269a5435e4da97bfe62cc;p=dealii-svn.git Check for that nasty quad-define on CygWin, and disable it. git-svn-id: https://svn.dealii.org/trunk@6520 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 9b7b3a17e5..892fb08f38 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -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 +#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. diff --git a/deal.II/configure b/deal.II/configure index 52ac087fed..1fbe5a3014 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -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 +#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 diff --git a/deal.II/configure.in b/deal.II/configure.in index 7fb5765ed7..8ebb41cfa8 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -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)