Skip to content

Commit a54562e

Browse files
author
Yvan Fournier
committed
libPLE: use same FLAGS as parent Code_Saturne build.
This helps ensure subconfigure is consistent. Bootstrapping also inherits prior cleaning stage from that of parent. Also, dependencies on MPI are handled in the standard Automake manner when building libPLE (this means building a dynamic libPLE on top of a static MPI may no longer be possible). This implies changing at least the patch release number for PLE. git-svn-id: https://svn.isais.edf.fr/mfee/saturne/trunk@3480 e44c5d27-f830-0410-8ce8-974f7a764be6
1 parent 472d644 commit a54562e

File tree

5 files changed

+75
-96
lines changed

5 files changed

+75
-96
lines changed

config/ple_auto_flags.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Shell script
22

3-
# Copyright (C) 2005-2010 EDF
3+
# Copyright (C) 2005-2012 EDF
44

55
# This file is part of the PLE software package. For license
66
# information, see the COPYING file in the top level directory of the
@@ -242,9 +242,6 @@ if test "x$ple_compiler_known" != "xyes" ; then
242242
ldflags_default_dbg="-g"
243243
ldflags_default_prf="-pg"
244244

245-
# Disable shared libraries in all cases
246-
ple_disable_shared=yes
247-
248245
# Adjust options for IBM Blue Gene cross-compiler
249246

250247
grep 'Blue Gene' $outfile > /dev/null
@@ -257,12 +254,14 @@ if test "x$ple_compiler_known" != "xyes" ; then
257254
cflags_default_opt="-O2"
258255
cflags_default_dbg=""
259256
ldflags_default="-L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts -lmsglayer.rts -lrts.rts -ldevices.rts -lnss_files -lnss_dns -lresolv"
257+
ple_disable_shared=yes # Disable shared libraries
260258
elif test "$ple_ibm_bg_type" = "P" ; then
261259
cppflags_default="-I/bgsys/drivers/ppcfloor/comm/include"
262260
cflags_default="-g -qmaxmem=-1 -qarch=450d -qtune=450"
263261
cflags_default_opt="-O1"
264262
cflags_default_dbg=""
265263
ldflags_default=""
264+
ple_disable_shared=yes # Disable shared libraries
266265
else
267266
ple_ibm_bg_type="Q"
268267
cppflags_default=""

configure.ac

Lines changed: 55 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -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

5050
m4_define([ple_major_version], [1])
5151
m4_define([ple_minor_version], [0])
52-
m4_define([ple_release_version], [0])
52+
m4_define([ple_release_version], [1])
5353
m4_define([ple_version_extra], [])
5454
m4_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

7777
AH_BOTTOM([#endif /* __PLE_CONFIG_PRIV_H__ */])
@@ -108,6 +108,7 @@ PLE_AC_CONFIG_PUBL_DEFINE(PLE_RELEASE_VERSION, ple_release_version,
108108
user_CPPFLAGS=$CPPFLAGS
109109
user_CFLAGS=$CFLAGS
110110
user_LDFLAGS=$LDFLAGS
111+
user_LIBS=$LIBS
111112

112113
AC_PROG_CC
113114
AC_PROG_INSTALL
@@ -118,37 +119,51 @@ AM_PROG_CC_C_O
118119
# Debug or production compilation mode (debug by default) ?
119120

120121
AC_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

135136
AC_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

200201
fi
201202

202203
LIBS="${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"
214211
fi
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
@@ -239,6 +224,7 @@ fi
239224
if test "x$ple_disable_shared" = "xyes" ; then
240225
enable_shared=no
241226
fi
227+
AC_SUBST(enable_shared)
242228

243229
LT_INIT
244230

sbin/bootstrap

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ if [ ! -d sbin ]; then
55
exit 1
66
fi
77

8+
# Remove unversioned files added by previous bootstrap
9+
10+
rm -rf build-aux/* m4/codeset.m4 m4/fcntl-o.m4 m4/gettext.m4 m4/glibc2.m4 \
11+
m4/glibc21.m4 m4/iconv.m4 m4/intdiv0.m4 m4/intl.m4 m4/intldir.m4 \
12+
m4/intlmacosx.m4 m4/intmax.m4 m4/inttypes-pri.m4 m4/inttypes_h.m4 \
13+
m4/lcmessage.m4 m4/lock.m4 m4/longlong.m4 m4/lib-ld.m4 m4/lib-link.m4 \
14+
m4/lib-prefix.m4 m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 \
15+
m4/ltsugar.m4 m4/ltversion.m4 m4/nls.m4 m4/printf-posix.m4 m4/po.m4 \
16+
m4/progtest.m4 m4/size_max.m4 m4/stdint_h.m4 m4/threadlib.m4 \
17+
m4/uintmax_t.m4 m4/visibility.m4 m4/wchar_t.m4 m4/wint_t.m4 m4/xsize.m4
18+
819
# Simply run autoreconf
920
autoreconf -vi $@
1021

src/Makefile.am

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This file is part of the "Parallel Location and Exchange" library,
33
# intended to provide mesh or particle-based code coupling services.
44
#
5-
# Copyright (C) 2005-2010 EDF
5+
# Copyright (C) 2005-2012 EDF
66
#
77
# This library is free software; you can redistribute it and/or
88
# modify it under the terms of the GNU Lesser General Public
@@ -19,17 +19,9 @@
1919
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2020
#-------------------------------------------------------------------------------
2121

22-
# Add any debug flags
23-
24-
if DEBUG
25-
DEBUG_CPPFLAGS = -DDEBUG
26-
else
27-
DEBUG_CPPFLAGS = -DNDEBUG
28-
endif
29-
3022
# Main part
3123

32-
AM_CPPFLAGS = $(DEBUG_CPPFLAGS) $(MPI_CPPFLAGS)
24+
AM_CPPFLAGS = $(MPI_CPPFLAGS)
3325
AM_CFLAGS =
3426
AM_LDFLAGS = $(MPI_LDFLAGS)
3527

@@ -48,12 +40,11 @@ ple_config_defs.h
4840

4941
lib_LTLIBRARIES = libple.la
5042
noinst_LTLIBRARIES =
51-
libple_la_LIBADD =
43+
libple_la_LIBADD = $(MPI_LIBS) -lm
5244
libple_la_SOURCES = ple_defs.c ple_locator.c
5345

5446
if HAVE_MPI
5547
libple_la_SOURCES += ple_coupling.c
5648
endif
5749

58-
libple_la_LDFLAGS = -no-undefined -version-info 0:0:0
59-
50+
libple_la_LDFLAGS = $(MPI_LDFLAGS) -no-undefined -version-info 0:0:0

tests/Makefile.am

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,9 @@
1919
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2020
#-------------------------------------------------------------------------------
2121

22-
# Add any debug flags
23-
24-
if DEBUG
25-
DEBUG_CPPFLAGS = -DDEBUG
26-
else
27-
DEBUG_CPPFLAGS = -DNDEBUG
28-
endif
29-
3022
# Main part
3123

32-
AM_CPPFLAGS = $(DEBUG_CPPFLAGS) -I$(top_srcdir)/src $(MPI_CPPFLAGS)
24+
AM_CPPFLAGS = -I$(top_srcdir)/src $(MPI_CPPFLAGS)
3325
AM_CFLAGS =
3426
AM_LDFLAGS = $(MPI_LDFLAGS)
3527
LDADD = $(top_builddir)/src/libple.la $(MPI_LIBS)
@@ -39,7 +31,7 @@ check_PROGRAMS =
3931
if HAVE_MPI
4032
check_PROGRAMS += ple_coupling_test
4133
ple_coupling_test_SOURCES = ple_coupling_test.c
42-
ple_coupling_test_CPPFLAGS = $(DEBUG_CPPFLAGS) -I$(top_srcdir)/src $(MPI_CPPFLAGS)
34+
ple_coupling_test_CPPFLAGS = -I$(top_srcdir)/src $(MPI_CPPFLAGS)
4335
ple_coupling_test_LDFLAGS = $(MPI_LDFLAGS)
4436
ple_coupling_test_LDADD = $(top_builddir)/src/libple.la $(MPI_LIBS) -lm
4537
endif

0 commit comments

Comments
 (0)