From 8e2b455e885541a76f814da386dcb59eb5b379da Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 22 Jan 2007 05:54:12 +0000 Subject: [PATCH] Detect whether -library=... works. git-svn-id: https://svn.dealii.org/trunk@14360 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 27 ++++++++++++--- deal.II/configure | 82 ++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 90 insertions(+), 19 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index e8fd24508b..e1cf03edb0 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -9,7 +9,7 @@ dnl In doc/Makefile some information on the kind of documentation dnl is stored. dnl dnl -dnl Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors +dnl Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors dnl dnl $Id$ @@ -689,14 +689,31 @@ AC_DEFUN(DEAL_II_SET_CXX_FLAGS, dnl ;; sun_workshop | sun_forte) + CXXFLAGSG="$CXXFLAGS -DDEBUG -w" CXXFLAGSO="$CXXFLAGS -w" CXXFLAGSPIC="-KPIC" LDFLAGSPIC="-G" - AC_MSG_ERROR([deal.II is known not to work with SUN Compilers! - If you intend to port it, please remove this message - from aclocal.m4 and call autoconf and configure.]) - ;; + + dnl See if the flag -library=stlport4 is available, and if so use it + CXXFLAGS="$CXXFLAGSG -library=stlport4" + AC_MSG_CHECKING(whether -library=stlport4 works) + AC_TRY_COMPILE( + [ +# include + ], + [ + std::cout << std::endl; + ], + [ + AC_MSG_RESULT(no) + ], + [ + AC_MSG_RESULT(yes) + CXXFLAGSG="$CXXFLAGSG -library=stlport4" + CXXFLAGSO="$CXXFLAGSO -library=stlport4" + ]) + ;; portland_group) dnl Suppress warnings: diff --git a/deal.II/configure b/deal.II/configure index 27420506b5..3deebc86f9 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 14184 . +# From configure.in Revision: 14318 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for deal.II 5.3.pre. # @@ -3135,8 +3135,9 @@ echo "${ECHO_T}C++ compiler is Compaq-cxx" >&6 GXX_VERSION_DETAILED=$GXX_VERSION else - is_sun_cc="`($CXX -V 2>&1) | grep 'Sun WorkShop'`" - if test "x$is_sun_cc" != "x" ; then + is_sun_cc_1="`($CXX -V 2>&1) | grep 'Sun WorkShop'`" + is_sun_cc_2="`($CXX -V 2>&1) | grep 'Sun C++'`" + if test "x$is_sun_cc_1$is_sun_cc_2" != "x" ; then echo "$as_me:$LINENO: result: C++ compiler is Sun Workshop compiler" >&5 echo "${ECHO_T}C++ compiler is Sun Workshop compiler" >&6 GXX_VERSION=sun_workshop @@ -3559,20 +3560,73 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ;; sun_workshop | sun_forte) + CXXFLAGSG="$CXXFLAGS -DDEBUG -w" CXXFLAGSO="$CXXFLAGS -w" CXXFLAGSPIC="-KPIC" LDFLAGSPIC="-G" - { { echo "$as_me:$LINENO: error: Attention! deal.II is not known to work with SUN Compilers! - If you intend to port it" >&5 -echo "$as_me: error: Attention! deal.II is not known to work with SUN Compilers! - If you intend to port it" >&2;} - { (exit please remove this message - from aclocal.m4 and call autoconf and configure. If you do not understand - this); exit please remove this message - from aclocal.m4 and call autoconf and configure. If you do not understand - this; }; } - ;; + + CXXFLAGS="$CXXFLAGSG -library=stlport4" + echo "$as_me:$LINENO: checking whether -library=stlport4 works" >&5 +echo $ECHO_N "checking whether -library=stlport4 works... $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. */ + +# include + +int +main () +{ + + std::cout << std::endl; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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: no" >&5 +echo "${ECHO_T}no" >&6 + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + CXXFLAGSG="$CXXFLAGSG -library=stlport4" + CXXFLAGSO="$CXXFLAGSO -library=stlport4" + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ;; portland_group) CXXFLAGSG="$CXXFLAGS -DDEBUG -g --display_error_number --diag_suppress 111 --diag_suppress 177 --diag_suppress 175 --diag_suppress 284" @@ -14007,7 +14061,7 @@ if test "x$darwin_shared_lib" = "xyes" ; then echo " WARNING: The installed compiler version seems to be " echo " WARNING: the Apple gcc3.3, build 1666, which does not" echo " WARNING: work properly for building dynamics libs" - echo " WARNING: Please install Apples november 2004 patch" + echo " WARNING: Please install Apples November 2004 patch" echo " WARNING: for the gcc, which can be found on:" echo " WARNING: http://www.apple.com/developer" fi -- 2.39.5