@@ -30,7 +30,7 @@ m4_define([ple_licence_c_comment],
3030 This file is part of the "Parallel Location and Exchange" library,
3131 intended to provide mesh or particle-based code coupling services.
3232
33- Copyright (C) 2005-2010 EDF
33+ Copyright (C) 2005-2012 EDF
3434
3535 This library is free software; you can redistribute it and/or
3636 modify it under the terms of the GNU Lesser General Public
@@ -49,7 +49,7 @@ m4_define([ple_licence_c_comment],
4949
5050m4_define ( [ ple_major_version] , [ 1] )
5151m4_define ( [ ple_minor_version] , [ 0] )
52- m4_define ( [ ple_release_version] , [ 0 ] )
52+ m4_define ( [ ple_release_version] , [ 1 ] )
5353m4_define ( [ ple_version_extra] , [ ] )
5454m4_define ( [ ple_version_string] ,
5555 [ ple_major_version.ple_minor_version.ple_release_version@&t@ ple_version_extra] )
@@ -70,8 +70,8 @@ AH_TOP([#ifndef __PLE_CONFIG_PRIV_H__
7070#define __PLE_CONFIG_PRIV_H__
7171
7272/*
73- This file is part of the "Finite Volume Mesh " library, intended to provide
74- finite volume mesh and associated fields I/O and manipulation services.
73+ This file is part of the "Parallel Location and Exchange " library,
74+ intended to provide mesh or particle-based code coupling services.
7575*/] )
7676
7777AH_BOTTOM ( [ #endif /* __PLE_CONFIG_PRIV_H__ */] )
@@ -108,6 +108,7 @@ PLE_AC_CONFIG_PUBL_DEFINE(PLE_RELEASE_VERSION, ple_release_version,
108108user_CPPFLAGS=$CPPFLAGS
109109user_CFLAGS=$CFLAGS
110110user_LDFLAGS=$LDFLAGS
111+ user_LIBS=$LIBS
111112
112113AC_PROG_CC
113114AC_PROG_INSTALL
@@ -118,37 +119,51 @@ AM_PROG_CC_C_O
118119# Debug or production compilation mode (debug by default) ?
119120
120121AC_ARG_ENABLE ( debug ,
121- [ --enable-debug enable debugging (reduces optimization)] ,
122+ [ AS_HELP_STRING ( [ --enable-debug] , [ enable debugging (reduces optimization) ] ) ] ,
122123 [
123124 case "${enableval}" in
124- yes) debug=true ;;
125- no) debug=false ;;
125+ yes) debug=yes ;;
126+ no) debug=no ;;
126127 *) AC_MSG_ERROR ( [ bad value ${enableval} for --enable-debug] ) ;;
127128 esac
128129 ] ,
129- [ debug=false ]
130+ [ debug=no ]
130131)
131- AM_CONDITIONAL(DEBUG, test x$ debug = xtrue )
132+ AC_SUBST ( debug )
132133
133134# Optionally deactivate automatic determination of flags on known systems
134135
135136AC_ARG_ENABLE ( auto-flags ,
136- [ --disable-auto-flags do not define *FLAGS on known systems] ,
137+ [ AS_HELP_STRING ( [ --disable-auto-flags] , [ do not define *FLAGS on known systems] ) ] ,
137138 [
138139 case "${enableval}" in
139- yes) auto_flags=true ;;
140- no) auto_flags=false ;;
140+ yes) auto_flags=yes ;;
141+ no) auto_flags=no ;;
141142 *) AC_MSG_ERROR ( [ bad value ${enableval} for --enable-auto-flags] ) ;;
142143 esac
143144 ] ,
144- [ auto_flags=true ]
145+ [ auto_flags=yes ]
146+ )
147+
148+ AC_ARG_ENABLE ( enable_static_libs ,
149+ [ AS_HELP_STRING ( [ --enable-static-libs] , [ allow use of static external libraries] ) ] ,
150+ [
151+ case "${enableval}" in
152+ yes) enable_static_libs=yes ;;
153+ no) enable_static_libs=no ;;
154+ *) AC_MSG_ERROR ( [ bad value ${enableval} for --enable-static-libs] ) ;;
155+ esac
156+ ] ,
157+ [ relocatable=no ]
145158)
159+ AC_SUBST ( enable_static_libs )
160+ AM_CONDITIONAL(HAVE_RELOCATABLE, [ test "${enable_static_libs}" = yes] )
146161
147162# Default compiler options (may be modified
148163# by defining CFLAGS in the environment)
149164# ------------------------------------------
150165
151- if test "x$auto_flags" = "xtrue " ; then
166+ if test "x$auto_flags" = "xyes " ; then
152167
153168 # Source associated recommended compiler options
154169
@@ -159,72 +174,42 @@ if test "x$auto_flags" = "xtrue" ; then
159174 AC_MSG_WARN ( [ config/ple_auto_flags.sh default configuration file not found] )
160175 fi
161176
162- if test "x$user_CPPFLAGS" = "x"; then
163- CPPFLAGS="$cppflags_default"
177+ # Default flags
178+ CPPFLAGS="$cppflags_default $user_CPPFLAGS"
179+ CFLAGS="$cflags_default $user_CFLAGS"
180+ LDFLAGS="$ldflags_default $user_LDFLAGS"
181+ LIBS="$libs_default $user_LIBS"
182+ LDRPATH="$ldflags_rpath"
183+
184+ if test "x$debug" = xyes; then
185+ # Debug flags
186+ CFLAGS_DBG="$cflags_default_dbg"
187+ # Add debug flags for linker
188+ LDFLAGS="$LDFLAGS $ldflags_default_dbg"
164189 else
165- AC_MSG_NOTICE ( [ default CPPFLAGS overridden by user definition] )
166- fi
167-
168- if test "x$user_CFLAGS" = "x"; then
169-
170- CFLAGS="$cflags_default"
171-
172- if test "x$debug" = xtrue; then
173- CFLAGS="${CFLAGS} $cflags_default_dbg"
174- else
175- CFLAGS="${CFLAGS} $cflags_default_opt"
176- fi
177-
178- else
179-
180- AC_MSG_NOTICE ( [ default CFLAGS overridden by user definition] )
181-
190+ # Normal optimization flags
191+ CFLAGS_OPT="$cflags_default_opt"
192+ # Add optimization flags for linker
193+ LDFLAGS="$LDFLAGS $ldflags_default_opt"
182194 fi
183195
184- if test "x$user_LDFLAGS" = "x"; then
185-
186- LDFLAGS="$ldflags_default"
187-
188- if test "x$debug" = xtrue; then
189- LDFLAGS="${LDFLAGS} $ldflags_default_dbg"
190- else
191- LDFLAGS="${LDFLAGS} $ldflags_default_opt"
192- fi
193-
194- else
195-
196- AC_MSG_NOTICE ( [ default LDFLAGS overridden by user definition] )
196+ AC_SUBST ( CFLAGS_DBG )
197+ AC_SUBST ( CFLAGS_OPT )
197198
198- fi
199+ AC_SUBST ( LDRPATH )
199200
200201fi
201202
202203LIBS="${LIBS} -lm"
203204
204- # Optional additional user flags
205- # -------------------------------
206-
207- AC_ARG_VAR ( CPP_ADD , [ Additional user C preprocessor flags] )
208- AC_ARG_VAR ( CC_ADD , [ Additional user C compiler flags] )
209- AC_ARG_VAR ( LD_ADD , [ Additional user linker flags, e.g. -L<libdir>] )
210- AC_ARG_VAR ( LIBS_ADD , [ Additional user librairies, e.g. -l<lib>] )
205+ # Preprocessor flags for debugging purposes
211206
212- if test "x$CPP_ADD" != x ; then
213- CPPFLAGS="${CPPFLAGS} $CPP_ADD"
207+ if test "x$debug" = "xyes"; then
208+ CPPFLAGS="${CPPFLAGS} -DDEBUG"
209+ else
210+ CPPFLAGS="${CPPFLAGS} -DNDEBUG"
214211fi
215-
216- if test "x$CC_ADD" != x ; then
217- CFLAGS="${CFLAGS} $CC_ADD"
218- fi
219-
220- if test "x$LD_ADD" != x ; then
221- LDFLAGS="${LDFLAGS} $LD_ADD"
222- fi
223-
224- if test "x$LIBS_ADD" != x ; then
225- LIBS="${LIBS} $LIBS_ADD"
226- fi
227-
212+
228213# ------------------------------------------------------------------------------
229214
230215# We may only turn on processing for libtool now that the basic compiler
239224if test "x$ple_disable_shared" = "xyes" ; then
240225 enable_shared=no
241226fi
227+ AC_SUBST ( enable_shared )
242228
243229LT_INIT
244230
0 commit comments