configure.in.in 3.63 KB
Newer Older
prudhomm's avatar
prudhomm committed
1
2
# -*- autoconf -*-
# 
prudhomm's avatar
prudhomm committed
3
#
prudhomm's avatar
prudhomm committed
4
AC_INIT(life, 0.1.0, christophe.prudhomme@epfl.ch)
prudhomm's avatar
prudhomm committed
5
LIFE_PACKAGE=life
prudhomm's avatar
prudhomm committed
6
LIFE_VERSION=0.1.0
7
8
9
10

PACKAGE=$LIFE_PACKAGE
VERSION=$LIFE_VERSION

prudhomm's avatar
prudhomm committed
11
12
13
AC_SUBST(LIFE_PACKAGE)
AC_SUBST(LIFE_VERSION)

prudhomm's avatar
prudhomm committed
14
15
16
17
18
19
20
AC_CONFIG_AUX_DIR(admin)

dnl What the current system and host
AC_CANONICAL_HOST
AC_CANONICAL_SYSTEM


prudhomm's avatar
prudhomm committed
21
AM_INIT_AUTOMAKE(${LIFE_PACKAGE}, ${LIFE_VERSION} )
prudhomm's avatar
prudhomm committed
22
23
24
25
26
27
28
29
30
31
32
AM_CONFIG_HEADER(lifeconfig.h)



# check for a C compiler
AC_PROG_CC( gcc )
AC_PROG_CC_C_O
AC_PROG_CXX( g++ )
AC_PROG_F77( g77 )
AC_PROG_F77_C_O

prudhomm's avatar
prudhomm committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
dnl Check debugging mode for compilation.
AC_ARG_ENABLE(debug,
  AC_HELP_STRING([--enable-debug],[enables debugging mode (default=no)]),
  [
   if test $enableval = "no";
     then ac_use_debug_code="no"
     else ac_use_debug_code="yes"
   fi
  ], [ac_use_debug_code="no"])

AC_ARG_ENABLE(opt,
  AC_HELP_STRING([--enable-opt],[enables optimization mode (default=no)]),
  [
   if test $enableval = "no";
     then ac_use_opt_code="no"
     else ac_use_opt_code="yes"
   fi
  ], [ac_use_opt_code="no"])

if test $ac_use_debug_code = "yes" -a $ac_use_opt_code = "yes"
then
  AC_MSG_ERROR(Cannot use --enable-debug and --enable-opt at the same time!)
fi

if test $ac_use_debug_code = "yes"; then
 CXXFLAGS="-g3 -O0 -Wall"
 CFLAGS="-g3 -O0 -Wall"
else 
 if test $ac_use_opt_code = "yes"; then
  CXXFLAGS="-O2 -funroll-all-loops -fargument-noalias-global -fno-gcse -Wall"
  CFLAGS="-O2 -funroll-all-loops -fargument-noalias-global -fno-gcse -Wall"
  CPPFLAGS="-DNDEBUG"
 fi
fi

prudhomm's avatar
prudhomm committed
68
69
# check for libtool
AC_PROG_LIBTOOL
prudhomm's avatar
prudhomm committed
70
AC_ARG_WITH([aztec], 
prudhomm's avatar
prudhomm committed
71
 AC_HELP_STRING([--with-aztec],[tell where aztec resides]),
prudhomm's avatar
prudhomm committed
72
73
74
75
76
77
78
 [
  # AZTEC check
  AC_MSG_CHECKING([Aztec headers files presence])
  ac_aztec_includedirs="$REPOSITORY/$ARCH/include/Aztec_LifeV/ /usr/include /usr/local/include"
  ac_aztec_includedir="$withval/include"
  AC_MSG_RESULT([$ac_aztec_includedir])
  CXXFLAGS="-I$ac_aztec_includedir ${CXXFLAGS}"
prudhomm's avatar
prudhomm committed
79

prudhomm's avatar
prudhomm committed
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
  AC_MSG_CHECKING([Aztec libraries presence])
  ac_aztec_libdir="$withval/lib"
  LDFLAGS="${LDFLAGS} -L${ac_aztec_libdir}"
  aztec_libs="-laztec"
  AC_SUBST(aztec_libs)
  AC_MSG_RESULT([$aztec_libs])
 ],
 [
  # AZTEC check
  AC_MSG_CHECKING([Aztec headers files presence])
  ac_aztec_includedirs="$REPOSITORY/$ARCH/include/Aztec_LifeV/ /usr/include /usr/local/include"
  AC_FIND_FILE("az_aztec.h",$ac_aztec_includedirs , ac_aztec_includedir)
  AC_MSG_RESULT([$ac_aztec_includedir])
  CXXFLAGS="-I$ac_aztec_includedir ${CXXFLAGS}"

  AC_MSG_CHECKING([Aztec libraries presence])
  ac_aztec_libdirs="$REPOSITORY/$ARCH/lib$AFFIX/Aztec_LifeV/ /usr/lib /usr/local/lib"
  AC_FIND_FILE("libaztec.a", $ac_aztec_libdirs, ac_aztec_libdir)
  # echo $ac_aztec_libdir
  LDFLAGS="${LDFLAGS} -L${ac_aztec_libdir}"
  aztec_libs="-laztec"
  AC_SUBST(aztec_libs)
  AC_MSG_RESULT([$aztec_libs])
 ])
prudhomm's avatar
prudhomm committed
104

prudhomm's avatar
prudhomm committed
105
106
all_includes="-I\$(top_srcdir)/life/lifecore -I\$(top_srcdir)/life/lifearray  -I\$(top_srcdir)/life/lifemesh -I\$(top_srcdir)/life/lifealg  -I\$(top_srcdir)/life/lifefem -I\$(top_srcdir)/life/lifesolver -I\$(top_srcdir)/life/lifefilters"
AC_SUBST(all_includes)
prudhomm's avatar
prudhomm committed
107

prudhomm's avatar
prudhomm committed
108
109
110
111
CPPFLAGS="-DTHREEDIM ${CPPFLAGS}"

CXXFLAGS="-Wall ${CXXFLAGS}"

prudhomm's avatar
prudhomm committed
112

prudhomm's avatar
prudhomm committed
113
114
# life_libs="\$(top_builddir)/life/lifefilters/liblifefilters.la  \$(top_builddir)/life/lifesolver/liblifesolver.la \$(top_builddir)/life/lifefem/liblifefem.la \$(top_builddir)/life/lifealg/liblifealg.la \$(top_builddir)/life/lifemesh/liblifemesh.la \$(top_builddir)/life/lifearray/liblifearray.la \$(top_builddir)/life/lifecore/liblifecore.la"

prudhomm's avatar
prudhomm committed
115
life_libs="\$(top_builddir)/life/lifefilters/liblifefilters.la  \$(top_builddir)/life/lifefem/liblifefem.la \$(top_builddir)/life/lifealg/liblifealg.la \$(top_builddir)/life/lifemesh/liblifemesh.la \$(top_builddir)/life/lifecore/liblifecore.la"
prudhomm's avatar
prudhomm committed
116
117
118

AC_SUBST(life_libs)