CC = @CC@
CXX = @CXX@
GXX-VERSION = @GXX_VERSION@
-OS = @OS@
PERL = @PERL@
enable-multithreading= @enablemultithreading@
with-multithreading = @withmultithreading@
$(include-path-deal2))
# compiler flags for debug and optimized mode
-
-CXXFLAGS.g = @DEFS@ @shared_libs@ \
- -DDEBUG -ggdb -Wall -W -Wconversion \
- -Winline -Woverloaded-virtual\
- -ftemplate-depth-32\
- $(INCLUDE) \
- $(LIBPATH)
-CXXFLAGS.o = @DEFS@ @shared_libs@ @throw_opt@ \
- -O2 -Wuninitialized \
- -felide-constructors -fnonnull-objects \
- -ftemplate-depth-32 \
- $(INCLUDE) \
- $(LIBPATH)
-
-
-# if not egcs-1.1 we can use additional flags for which that compiler
-# had quirks
-ifneq ($(GXX-VERSION),egcs1.1)
- CXXFLAGS.o += -funroll-loops -funroll-all-loops
-endif
-
-
-# if not on Linux and we use egcs-1.1: enable -fno-vtable-thunks,
-# since vtable-thunks are broken and yield incorrect code. in fact,
-# they are also broken on Linux, but we can't link programs compiled
-# with -fno-vtable-thunks unless the whole compiler is recompiled,
-# which we don't want to force on the users
-ifneq ($(OS),Linux)
- ifeq ($(GXX-VERSION),egcs1.1)
- CXXFLAGS.g += -fno-vtable-thunks
- CXXFLAGS.o += -fno-vtable-thunks
- endif
-endif
-
-
-
-# after egcs1.1, the optimization flag -fstrict-aliasing was
-# introduced, which enables better optimizations for well-written C++
-# code. we believe that deal.II falls into that category and thus
-# enable the flag
-ifneq ($(GXX-Version),egcs1.1)
- CXXFLAGS.o += -fstrict-aliasing
-endif
-
-
-
-# if --enable-multithreading was given, then set the compiler flags
-# accordingly. note that this only sets the flags to generate programs
-# which use thread-safe allocation functions, include the right files,
-# etc, but the library won't use its multithread code. for this you
-# have to specify another flag.
-ifeq ($(enable-multithreading),yes)
- CXXFLAGS.g += -threads -D__USE_MALLOC
- CXXFLAGS.o += -threads -D__USE_MALLOC
-endif
+CXXFLAGS.g = @CXXFLAGSG@ $(INCLUDE) $(LIBPATH)
+CXXFLAGS.o = @CXXFLAGSO@ $(INCLUDE) $(LIBPATH)
# if multithread support in the library is requested, then set the
lib-ACE = $(ACE_ROOT)/ace/libACE.so
- CXXFLAGS.g += -DDEAL_II_USE_MT
- CXXFLAGS.o += -DDEAL_II_USE_MT
-
vpath %.a $(ACE_ROOT)
endif
+
+
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:659: checking for $ac_word" >&5
+echo "configure:661: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:689: checking for $ac_word" >&5
+echo "configure:691: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:740: checking for $ac_word" >&5
+echo "configure:742: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:772: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:774: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cat > conftest.$ac_ext << EOF
-#line 783 "configure"
+#line 785 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:814: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:816: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:819: checking whether we are using GNU C" >&5
+echo "configure:821: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:830: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:847: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:849: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$CC", so it can be a program name with args.
set dummy $CC; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:881: checking for $ac_word" >&5
+echo "configure:883: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:920: checking for $ac_word" >&5
+echo "configure:922: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:952: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:954: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cat > conftest.$ac_ext << EOF
-#line 963 "configure"
+#line 965 "configure"
#include "confdefs.h"
int main(){return(0);}
EOF
-if { (eval echo configure:968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cxx_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:994: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:996: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:999: checking whether we are using GNU C++" >&5
+echo "configure:1001: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gxx=yes
else
ac_cv_prog_gxx=no
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:1027: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1029: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$CXX", so it can be a program name with args.
set dummy $CXX; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1061: checking for $ac_word" >&5
+echo "configure:1063: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1120: checking for $ac_word" >&5
+echo "configure:1122: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
+if test $GXX = yes ; then
+ CXXFLAGSO="-O2 -Wuninitialized -felide-constructors -fnonnull-objects -ftemplate-depth-32"
+ CXXFLAGSG="-DDEBUG -ggdb -Wall -W -Wconversion -Winline -Woverloaded-virtual -ftemplate-depth-32"
+
+
+ case "$GXXVERSION" in
+ egcs1.1)
+ case "$target" in
+ *linux*)
+ ;;
+
+ *)
+ CXXFLAGSG = "$CXXFLAGSG -fno-vtable-thunks"
+ CXXFLAGSO = "$CXXFLAGSO -fno-vtable-thunks"
+ ;;
+ esac
+ ;;
+
+ *)
+ CXXFLAGSO="$CXXFLAGSO -funroll-loops -funroll-all-loops -fstrict-aliasing"
+ ;;
+ esac
+else
+ { echo "configure: error: No compiler options for this C++ compiler
+ specified at present" 1>&2; exit 1; }
+ exit 1
+fi
+
+
+
+
+
+
+
+
# Check whether --enable-multithreading or --disable-multithreading was given.
if test "${enable_multithreading+set}" = set; then
enableval="$enable_multithreading"
+if test $enablemultithreading = yes ; then
+
+ echo $ac_n "checking for platform specific thread flags""... $ac_c" 1>&6
+echo "configure:1207: checking for platform specific thread flags" >&5
+
+ for i in threads mt pthread pthreads mthreads Kthread kthread; do
+ CXXFLAGS="$CXXFLAGSG -$i"
+ cat > conftest.$ac_ext <<EOF
+#line 1212 "configure"
+#include "confdefs.h"
+
+int main() {
+;
+; return 0; }
+EOF
+if { (eval echo configure:1219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+
+ thread_flag=$i
+ CXXFLAGSG="$CXXFLAGSG -$i"
+ CXXFLAGSO="$CXXFLAGSO -$i"
+
+ break
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ done
+ echo "$ac_t"""$thread_flag"" 1>&6
+
+
+ echo $ac_n "checking for platform specific multi-threading defines""... $ac_c" 1>&6
+echo "configure:1238: checking for platform specific multi-threading defines" >&5
+
+ cat > conftest.$ac_ext <<EOF
+#line 1241 "configure"
+#include "confdefs.h"
+
+#if !defined (_REENTRANT) && !defined (_THREAD_SAFE)
+#error Neither _REENTRANT nor _THREAD_SAFE were defined.
+nonsense
+#endif
+
+int main() {
+
+ ;
+
+; return 0; }
+EOF
+if { (eval echo configure:1255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+
+ echo "$ac_t"""not necessary"" 1>&6
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+
+ echo "$ac_t"""-D_REENTRANT -D_THREAD_SAFE"" 1>&6
+ CXXFLAGSG="$CXXFLAGSG -D_REENTRANT -D_THREAD_SAFE"
+ CXXFLAGSO="$CXXFLAGSO -D_REENTRANT -D_THREAD_SAFE"
+
+fi
+rm -f conftest*
+
+
+ CXXFLAGSG="$CXXFLAGSG -D__USE_MALLOC"
+ CXXFLAGSO="$CXXFLAGSO -D__USE_MALLOC"
+fi
+
+
+
# Check whether --with-multithreading or --without-multithreading was given.
if test "${with_multithreading+set}" = set; then
withval="$with_multithreading"
if test $withmultithreading != no ; then
echo $ac_n "checking for ACE""... $ac_c" 1>&6
-echo "configure:1177: checking for ACE" >&5
+echo "configure:1289: checking for ACE" >&5
if test -d $withmultithreading ; then
echo "$ac_t""found" 1>&6
else
echo "$ac_t""not found" 1>&6
{ echo "configure: error: Invalid ACE path" 1>&2; exit 1; }
fi
+
+ CXXFLAGSG="$CXXFLAGSG -DDEAL_II_USE_MT"
+ CXXFLAGSO="$CXXFLAGSO -DDEAL_II_USE_MT"
fi
fi
+case "$target" in
+ *-aix* | alpha*-linux* )
+ echo "configure: warning: Shared libraries not supported on $target. Using static libs instead" 1>&2
+ enableshared=no
+ ;;
+esac
+
+
+if test $enableshared = yes ; then
+ echo "$ac_t""Configuring for shared libraries" 1>&6
+ CXXFLAGSG="$CXXFLAGSG -fPIC"
+ CXXFLAGSO="$CXXFLAGSO -fPIC"
+
+ lib_suffix=.so;
+else
+ echo "$ac_t""Configuring for static libraries" 1>&6
+
+ lib_suffix=.a;
+fi
+
+
+
+
+
+
+
+
# Check whether --enable-multigrid or --disable-multigrid was given.
if test "${enable_multigrid+set}" = set; then
if test $enablemultigrid = yes ; then
echo "$ac_t""Configuring multigrid" 1>&6
+ cat >> confdefs.h <<\EOF
+#define ENABLE_MULTIGRID 1
+EOF
+
fi
fi
echo $ac_n "checking for kdoc""... $ac_c" 1>&6
-echo "configure:1229: checking for kdoc" >&5
+echo "configure:1375: checking for kdoc" >&5
if test -r $kdocdir/kdoc ; then
echo "$ac_t""found" 1>&6
else
# Extract the first word of ""doc++"", so it can be a program name with args.
set dummy "doc++"; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1258: checking for $ac_word" >&5
+echo "configure:1404: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_docxx'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
else
echo $ac_n "checking for doc++""... $ac_c" 1>&6
-echo "configure:1292: checking for doc++" >&5
+echo "configure:1438: checking for doc++" >&5
if test -x "$docxx" ; then
echo "$ac_t""yes" 1>&6
else
-case "$target" in
-
-
- *-linux*) OS=Linux;;
-
- *-aix*) enableshared=no ;;
-esac
case "$target" in
- alpha*-linux*) throw_opt=-DNO_THROW enableshared=no ;;
+ alpha*-linux*)
+ CXXFLAGSG="$CXXFLAGSG -DNO_THROW"
+ CXXFLAGSO="$CXXFLAGSO -DNO_THROW"
+ ;;
esac
-if test $enableshared = yes ; then
- echo "$ac_t""Configuring shared libraries" 1>&6
- shared_libs=-fPIC;
- lib_suffix=.so;
+
+
+
+
+
+echo $ac_n "checking for consistency of CXXFLAGSG flags""... $ac_c" 1>&6
+echo "configure:1466: checking for consistency of CXXFLAGSG flags" >&5
+CXXFLAGS="$CXXFLAGSG"
+cat > conftest.$ac_ext <<EOF
+#line 1469 "configure"
+#include "confdefs.h"
+
+int main() {
+;
+; return 0; }
+EOF
+if { (eval echo configure:1476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+
+ echo "$ac_t""yes" 1>&6
+
else
- echo "$ac_t""Configuring static libraries" 1>&6
- shared_libs='';
- lib_suffix=.a;
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+
+ { echo "configure: error: invalid combination of flags!" 1>&2; exit 1; }
+ exit 1;
+
+fi
+rm -f conftest*
+
+echo $ac_n "checking for consistency of CXXFLAGSO flags""... $ac_c" 1>&6
+echo "configure:1493: checking for consistency of CXXFLAGSO flags" >&5
+CXXFLAGS="$CXXFLAGSO"
+cat > conftest.$ac_ext <<EOF
+#line 1496 "configure"
+#include "confdefs.h"
+
+int main() {
+;
+; return 0; }
+EOF
+if { (eval echo configure:1503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+
+ echo "$ac_t""yes" 1>&6
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+
+ { echo "configure: error: invalid combination of flags!" 1>&2; exit 1; }
+ exit 1;
+
fi
+rm -f conftest*
s%@CXX@%$CXX%g
s%@GXX_VERSION@%$GXX_VERSION%g
s%@PERL@%$PERL%g
+s%@CXXFLAGSG@%$CXXFLAGSG%g
+s%@CXXFLAGSO@%$CXXFLAGSO%g
s%@enablemultithreading@%$enablemultithreading%g
s%@withmultithreading@%$withmultithreading%g
+s%@enableshared@%$enableshared%g
+s%@lib_suffix@%$lib_suffix%g
s%@enablemultigrid@%$enablemultigrid%g
s%@kdocdir@%$kdocdir%g
s%@kdocversion@%$kdocversion%g
s%@docxx@%$docxx%g
-s%@OS@%$OS%g
-s%@enableshared@%$enableshared%g
-s%@shared_libs@%$shared_libs%g
-s%@lib_suffix@%$lib_suffix%g
-s%@throw_opt@%$throw_opt%g
s%@subdirs@%$subdirs%g
CEOF
dnl $Id$
dnl
dnl This is the input for the ./configure script of the deal.II
-dnl libraries. The file is common/Make.global_options
-dnl where all options and paths are stored.
+dnl libraries. All options and paths are stored in
+dnl the file common/Make.global_options.
dnl
dnl In doc/Makefile some information on the kind of documentation
dnl is stored.
+
+
dnl -------------------------------------------------------------
dnl Find external programs
dnl -------------------------------------------------------------
+dnl -------------------------------------------------------------
+dnl Set compiler flags to their default values. They will be
+dnl modified according to other options further down below
+dnl
+dnl CXXFLAGSO are the flags for optimized mode
+dnl CXXFLAGSG are the flags for debug mode
+dnl -------------------------------------------------------------
+
+if test $GXX = yes ; then
+ CXXFLAGSO="-O2 -Wuninitialized -felide-constructors -fnonnull-objects -ftemplate-depth-32"
+ CXXFLAGSG="-DDEBUG -ggdb -Wall -W -Wconversion -Winline -Woverloaded-virtual -ftemplate-depth-32"
+
+ dnl set some flags that are specific to some versions of the
+ dnl compiler:
+ dnl - egcs1.1 yielded incorrect code with some loop unrolling
+ dnl - after egcs1.1, the optimization flag -fstrict-aliasing was
+ dnl introduced, which enables better optimizations for
+ dnl well-written C++ code. we believe that deal.II falls into that
+ dnl category and thus enable the flag
+ dnl - egcs1.1 yielded incorrect code with vtable-thunks. thus disable
+ dnl them for egcs1.1. however, if on Linux, disabling them
+ dnl prevents programs from being linked, so take the risk of broken
+ dnl thunks on this platform
+
+ case "$GXXVERSION" in
+ egcs1.1)
+ case "$target" in
+ *linux*)
+ ;;
+
+ *)
+ CXXFLAGSG = "$CXXFLAGSG -fno-vtable-thunks"
+ CXXFLAGSO = "$CXXFLAGSO -fno-vtable-thunks"
+ ;;
+ esac
+ ;;
+
+ dnl All other gcc versions
+ *)
+ CXXFLAGSO="$CXXFLAGSO -funroll-loops -funroll-all-loops -fstrict-aliasing"
+ ;;
+ esac
+else
+ dnl Other compiler
+ AC_MSG_ERROR(No compiler options for this C++ compiler
+ specified at present)
+ exit 1
+fi
+
+AC_SUBST(CXXFLAGSG)
+AC_SUBST(CXXFLAGSO)
+
+
+
+
dnl -------------------------------------------------------------
dnl Multithreading
dnl -------------------------------------------------------------
AC_SUBST(enablemultithreading)
+dnl Adjust compiler parameters if multithreading is desired:
+dnl - Use the right -threads/-pthread/-mthread option
+dnl - Set preprocessor directives if necessary
+dnl - __USE_MALLOC tells gcc to use thread safe STL allocators
+if test $enablemultithreading = yes ; then
+ DEAL_II_GET_THREAD_FLAGS
+ DEAL_II_THREAD_CPPFLAGS
+
+ CXXFLAGSG="$CXXFLAGSG -D__USE_MALLOC"
+ CXXFLAGSO="$CXXFLAGSO -D__USE_MALLOC"
+fi
+
+
+
dnl Test whether the user wants the multithread code in the
dnl library to be used
AC_ARG_WITH(multithreading,
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Invalid ACE path)
fi
+
+ CXXFLAGSG="$CXXFLAGSG -DDEAL_II_USE_MT"
+ CXXFLAGSO="$CXXFLAGSO -DDEAL_II_USE_MT"
fi
AC_SUBST(withmultithreading)
enableshared=$enableval,
enableshared=yes)
+dnl On AIX and alpha, shared libs don't work for us at present, so
+dnl disable them (we should probably use libtool there)
+case "$target" in
+ *-aix* | alpha*-linux* )
+ AC_MSG_WARN(Shared libraries not supported on $target. Using static libs instead)
+ enableshared=no
+ ;;
+esac
+
+
+dnl Set compile flags accordingly
+if test $enableshared = yes ; then
+ AC_MSG_RESULT(Configuring for shared libraries)
+ CXXFLAGSG="$CXXFLAGSG -fPIC"
+ CXXFLAGSO="$CXXFLAGSO -fPIC"
+
+ lib_suffix=.so;
+else
+ AC_MSG_RESULT(Configuring for static libraries)
+
+ lib_suffix=.a;
+fi
+
+
+AC_SUBST(enableshared)
+AC_SUBST(lib_suffix)
+
+
+
+
dnl -------------------------------------------------------------
dnl Multigrid
dnl -------------------------------------------------------------
dnl Test if multigrid should be enabled
dnl default is no
+dnl
+dnl ??Is this still the present state??
+dnl
AC_ARG_ENABLE(multigrid,
[ --enable-multigrid Include multigrid code in library],
enablemultigrid=$enableval,
fi
AC_SUBST(docxx)
+
+
+
dnl -------------------------------------------------------------
-dnl Check for operating system
+dnl Check for specific machine types
dnl -------------------------------------------------------------
case "$target" in
+ dnl On Alpha, there was an internal compiler error in exceptions.h.
+ dnl Disable "throw" for this platform
+ alpha*-linux*)
+ CXXFLAGSG="$CXXFLAGSG -DNO_THROW"
+ CXXFLAGSO="$CXXFLAGSO -DNO_THROW"
+ ;;
+esac
- dnl This line should be replaced by proper handling of conditions in configure
- dnl Right now Make.global_options needs this definition.
- *-linux*) OS=Linux;;
- dnl AIX does not allow shared libraries
- *-aix*) enableshared=no ;;
-esac
-dnl -------------------------------------------------------------
-dnl Check for specific machine types
-dnl -------------------------------------------------------------
-case "$target" in
- alpha*-linux*) throw_opt=-DNO_THROW enableshared=no ;;
-esac
dnl -------------------------------------------------------------
-dnl Adjust option settings for OS / machine
+dnl Last check: test whether CXXFLAGS are ok
dnl -------------------------------------------------------------
+AC_MSG_CHECKING(for consistency of CXXFLAGSG flags)
+CXXFLAGS="$CXXFLAGSG"
+AC_TRY_COMPILE(
+ [],
+ [;],
+ [
+ AC_MSG_RESULT(yes)
+ ],
+ [
+ AC_MSG_ERROR(invalid combination of flags!)
+ exit 1;
+ ])
+
+AC_MSG_CHECKING(for consistency of CXXFLAGSO flags)
+CXXFLAGS="$CXXFLAGSO"
+AC_TRY_COMPILE(
+ [],
+ [;],
+ [
+ AC_MSG_RESULT(yes)
+ ],
+ [
+ AC_MSG_ERROR(invalid combination of flags!)
+ exit 1;
+ ])
+
+
+
+
-if test $enableshared = yes ; then
- AC_MSG_RESULT(Configuring shared libraries)
- shared_libs=-fPIC;
- lib_suffix=.so;
-else
- AC_MSG_RESULT(Configuring static libraries)
- shared_libs='';
- lib_suffix=.a;
-fi
-AC_SUBST(OS)
-AC_SUBST(enableshared)
-AC_SUBST(shared_libs)
-AC_SUBST(lib_suffix)
-AC_SUBST(throw_opt)
dnl -------------------------------------------------------------
dnl Configure other packages