1# Process this file with autoconf to produce a configure script.
2
3## Initialize Autoconf & defined package name...
4##Lors de la sortie d'une nouvelle release mettre à jour les champs suivants
5##Mettre à jour le numéro de package
6AC_INIT([MED Fichier],4.0.0,[eric.fayolle@edf.fr],med)
7
8##Lors de la sortie d'une nouvelle release mettre à jour les champs suivants
9##Ne pas oubliez de modifier  -version-info x:y:z dans src/Makefile.am tools/medimport/Makefile.am
10##Modifiez si necessaire les numéros de versions dans la documentation
11##Ne pas oublier d'utiliser la dernière version des autotools
12##Mettre à jour le ChangeLog et le README
13##Mettre à jour la table de versionement des APIs internes (en C et en F)
14##Mettre à jour les tests de compatibilité dans MEDfileCompatibility (chgt de majeur/mineur)
15MED_NUM_MAJEUR=4
16MED_NUM_MINEUR=0
17MED_NUM_RELEASE=0
18#Mettre à jour à chaque nouvelle release de version 4 pour prendre en compte les dernières évlotions des versions med-3 (après intégration des developpements de la version 3 dans la version 4)
19MED_3_LATEST_MINOR=3
20
21AC_SUBST(MED_NUM_MAJEUR)
22AC_SUBST(MED_NUM_MINEUR)
23AC_SUBST(MED_NUM_RELEASE)
24AC_SUBST(MED_3_LATEST_MINOR)
25
26# info libtool/versioning:
27# 3. If the library source code has changed at all since the last
28#    update, then increment REVISION (`C:R:A' becomes `C:r+1:A').
29# 4. If any interfaces have been added, removed, or changed since the
30#    last update, increment CURRENT, and set REVISION to 0.
31# 5. If any interfaces have been added since the last public release,
32#    then increment AGE.
33# 6. If any interfaces have been removed or changed since the last
34#    public release, then set AGE to 0.
35#
36# A la mise à jour du mineur de la bibliothèque med, on a x+1:0:z+1 pour la version libtool
37# ce qui permet aux programmes liés à l'ancienne bibliothèque de mineur-1
38# d'utiliser la nouvelle bibliothèque pour lire/modifier les anciens fichiers
39# et en créer de nouveaux en version mineur courante.
40# Les anciennes bibliothèques refuseront de lire un fichier dont le mineur est supérieur à celui
41# de la bibliothèque
42#
43#MAJ : Changer le versionement libtool et mettre à jour celui de cmake
44MED_LIBTOOL_MAJ=11
45MED_LIBTOOL_MIN=0
46MED_LIBTOOL_REL=0
47AC_SUBST(MED_LIBTOOL_MAJ)
48AC_SUBST(MED_LIBTOOL_MIN)
49AC_SUBST(MED_LIBTOOL_REL)
50#Libtool version propose an abstraction of .so versionement whatever the unix is
51#CMake must use the numbers generated by libtool not the numbers given to libtool
52#Don't try to have the same numbers below and before this comment
53#Don't use med-fichier product number for .so numbers, this a nonsense
54#The .so numbers defined for CMake are for Linux
55MED_CMAKE_SO_MAJ=11
56MED_CMAKE_SO_MIN=0
57MED_CMAKE_SO_REL=0
58MED_CMAKE_SO_VERSION="11.0.0"
59AC_SUBST(MED_CMAKE_SO_MAJ)
60AC_SUBST(MED_CMAKE_SO_MIN)
61AC_SUBST(MED_CMAKE_SO_REL)
62AC_SUBST(MED_CMAKE_SO_VERSION)
63
64#MAJ : Changer le versionement libtool et mettre à jour celui de cmake
65MEDIMPORT_LIBTOOL_MAJ=3
66MEDIMPORT_LIBTOOL_MIN=0
67MEDIMPORT_LIBTOOL_REL=3
68AC_SUBST(MEDIMPORT_LIBTOOL_MAJ)
69AC_SUBST(MEDIMPORT_LIBTOOL_MIN)
70AC_SUBST(MEDIMPORT_LIBTOOL_REL)
71
72#Libtool version propose an abstraction of .so versionement whatever the unix is
73#CMake must use the numbers generated by libtool not the numbers given to libtool
74#Don't try to have the same numbers below and before this comment
75#Don't use med-fichier product number for .so numbers, this a nonsense
76#The .so numbers defined for CMake are for Linux
77MEDIMPORT_CMAKE_SO_MAJ=0
78MEDIMPORT_CMAKE_SO_MIN=3
79MEDIMPORT_CMAKE_SO_REL=0
80MEDIMPORT_CMAKE_SO_VERSION="0.3.0"
81AC_SUBST(MEDIMPORT_CMAKE_SO_MAJ)
82AC_SUBST(MEDIMPORT_CMAKE_SO_MIN)
83AC_SUBST(MEDIMPORT_CMAKE_SO_REL)
84AC_SUBST(MEDIMPORT_CMAKE_SO_VERSION)
85
86#Une modification de HDF_VERSION_NUM
87#demande une modification du test de version ds
88#med_check_hdf5.m4
89HDF_VERSION_REF=5-1.10.2
90HDF_VERSION_MAJOR_REF=1
91HDF_VERSION_MINOR_REF=10
92HDF_VERSION_RELEASE_REF=2
93AC_SUBST(HDF_VERSION_REF)
94AC_SUBST(HDF_VERSION_MAJOR_REF)
95AC_SUBST(HDF_VERSION_MINOR_REF)
96AC_SUBST(HDF_VERSION_RELEASE_REF)
97
98#This the swig version prefered by this version of medfichier
99#If we can't find at least this version, we will try older ones
100m4_define([M4MED_SWIG_VERSION_REF],[3.0.8])
101m4_define([M4MED_SWIG_MIN_VERSION_REF],[2.0.8])
102MED_SWIG_VERSION_REF=M4MED_SWIG_VERSION_REF
103MED_SWIG_MIN_VERSION_REF=M4MED_SWIG_MIN_VERSION_REF
104AC_SUBST(MED_SWIG_VERSION_REF)
105AC_SUBST(MED_SWIG_MIN_VERSION_REF)
106#This the python version prefered by this version of medfichier
107#If we can't find at least this version, we will try python version ref.
108m4_define([M4MED_PYTHON_VERSION_REF],[3.0])
109m4_define([M4MED_PYTHON3_VERSION_REF],[3.0])
110m4_define([M4MED_PYTHON2_VERSION_REF],[2.7])
111MED_PYTHON_VERSION_REF=M4MED_PYTHON_VERSION_REF
112MED_PYTHON3_VERSION_REF=M4MED_PYTHON3_VERSION_REF
113MED_PYTHON2_VERSION_REF=M4MED_PYTHON2_VERSION_REF
114AC_SUBST(MED_PYTHON_VERSION_REF)
115AC_SUBST(MED_PYTHON3_VERSION_REF)
116AC_SUBST(MED_PYTHON2_VERSION_REF)
117
118## Require Automake 1.7.9 or better.
119## AM_INIT_AUTOMAKE(1.7.9)
120
121## Guess we have a correct src directory by verifying we get the following file
122AC_CONFIG_SRCDIR(src/ci/MEDmeshCr.c)
123
124
125## Use the config directory for libtool stuff ...
126AC_CONFIG_AUX_DIR(config)
127AC_SUBST(ac_aux_dir)
128AC_CONFIG_MACRO_DIR([config])
129
130
131## Initialize Automake
132AM_INIT_AUTOMAKE([dist-bzip2 tar-ustar serial-tests])
133
134##
135AC_CONFIG_HEADER(include/med_config.h)
136
137dnl Ne pas activer ici (cross compiling)
138dnl AC_CHECK_SIZEOF_FORTRAN(integer)
139dnl AC_CHECK_SIZEOF_FORTRAN(integer*4)
140dnl AC_CHECK_SIZEOF_FORTRAN(integer*8)
141
142
143## Check For HDF5
144## Check if HDF5 is parallel or not before choosing the compilers to use
145## if HDF5 is parallel we try to use the frontends mpi compilers
146MED_CHECK_HDF5
147## -> MED_ENABLE_PMED
148##    --> AX_PROG_CC_MPI
149##    --> MED_CHECK_F90
150##        -->AX_PROG_FC_MPI
151
152
153## Configure le choix du compilateur Fortran 90 et active les tests correspondants
154AM_CONDITIONAL([WITHF90],[ test -n "$FC" ])
155AC_SUBST(FC)
156AC_ARG_VAR([FTLDFLAGS],[Fortran specific flags for linking fortran tests])
157AC_ARG_VAR([FTLIBS],[Fortran specific flags for linking fortran tests])
158
159
160## Check if user want to disable explicit error messages
161MED_CHECK_MESGERR
162
163## Check For MED2.x Objects Not Readable By New3.x API
164MED_ENABLE_CHECK23
165
166## Check For installing test programs or not
167MED_ENABLE_INSTALLTEST
168
169# Checks for programs.
170test "x$ac_cv_prog_cc_c99" = "xno" || AC_DEFINE(HAVE_CC_C99,[1],[The C99 capabilities of C compiler.])
171
172MED_CHECK_F77
173if test x"$enable_fortran" = xyes; then
174 AC_F77_WRAPPERS
175 AC_F77_LIBRARY_LDFLAGS
176 MED_CHECK_TYPEOF_HIDT
177fi
178
179
180## Choose default med_int type between {int,long}
181MED_CHECK_TYPEOF_MEDINT
182
183AX_PROG_CXX_MPI(test "x$mpi_wanted_test" = "xyes")
184CXX_DIRNAME=`AS_DIRNAME(["$CXX"])`
185CXX_BASENAME=`AS_BASENAME(["$CXX"])`
186AC_CHECK_PROG([CXXOK],[$CXX_BASENAME],[yes],[no],[$PATH$PATH_SEPARATOR$CXX_DIRNAME$PATH_SEPARATOR],[])
187if test "X$CXXOK" = "Xno"; then
188  AC_MSG_ERROR([Can't find a valid CXX compiler, please verify your env. var. PATH])
189fi
190dnl Il n'est pas necessaire de tester si le compilateur est en mode c++11
191dnl car depuis swig-2.0.12 les itérateurs et nvlles méthodes des containers c++11 sont gérés
192dnl et les wrappers sont gérés en 3.0.9.
193dnl Si l'utilisateur défini un autre swig, ex 2.0.8, il regénère les wrappers...
194dnl AX_CXX_COMPILE_STDCXX(11)
195
196## Provide MED2.3 API symbols
197MED_ENABLE_API23
198
199# Libtool
200AC_LIBTOOL_WIN32_DLL
201LT_INIT
202
203
204## LOOKING FOR diff program
205AC_CHECK_PROG([DIFF],[diff],[yes],[no],[],[])
206
207if test "X$DIFF" = "Xno"; then
208  AC_MSG_ERROR([Can't find diff command, please verify your env. var. PATH])
209fi
210
211## LOOKING FOR sed program
212AC_CHECK_PROG([SED],[sed],[yes],[no],[],[])
213
214if test "X$SED" = "Xno"; then
215  AC_MSG_ERROR([Can't find sed command, please verify your env. var. PATH])
216fi
217
218## LOOKING FOR awk program
219AC_PROG_AWK
220if test "X$AWK" = "X"; then
221  AC_MSG_ERROR([Can't find awk command, please verify your env. var. PATH])
222fi
223
224## Check for ln -s
225AC_PROG_LN_S
226
227## Check for cp
228AC_PATH_PROG([CP],[cp],[],[$PATH])
229
230if test "X$CP" = "X"; then
231   AC_MSG_WARN([I don't find cp command in your PATH! - You coudn't use make check ! -])
232fi
233AC_SUBST(CP)
234
235## Check for tk interpreter : we don't check version
236## (for next realese :-)
237AC_PATH_PROG([WISH],[wish],[],[$PATH])
238
239if test "X$WISH" = "X"; then
240   AC_MSG_WARN([I don't find TK interpreter in your PATH! - You coudn't use graphical dump ! -])
241fi
242AC_SUBST(WISH)
243
244
245# Checks for header files.
246AC_HEADER_STDC
247AC_HEADER_TIME
248AC_CHECK_HEADERS([malloc.h sys/time.h sys/timeb.h])
249AC_HEADER_STDBOOL
250AC_CHECK_HEADERS([sys/types.h pwd.h unistd.h])
251AC_CHECK_FUNCS([getpwuid geteuid cuserid])
252
253# Checks for typedefs, structures, and compiler characteristics.
254AC_C_CONST
255AC_TYPE_SIZE_T
256dnl AC_TYPE_INT32_T
257dnl AC_TYPE_INT64_T
258MED_CHECK_TYPEOF_INT64
259
260# Checks for library functions.
261##AC_FUNC_MALLOC
262AC_CHECK_FUNCS([ftime gettimeofday])
263
264#Check For Swig
265#Swig is not needed for users as long as they don't do
266# a <make distclean> and they don't use HDF //
267#If swig is enabled then CHECK_SWIG check for a python devel
268MED_CHECK_SWIG(MED_SWIG_VERSION_REF)
269#MED_CHECK_SWIG
270#MED_CHECK_SWIG([3.0.8],[/my_swig_path])
271
272#Activer l'utilisation de l'API python (python devel non obligatoire si swig n'est pas utilisé).
273MED_CHECK_PYTHON
274
275# Initialize Autotest
276# Transmet les inforamtions de configurations
277# aux différents groupes de tests
278# génère atconfig et atlocal à partir d'atlocal.in (on crée aussi un atconfig.in)
279# Les deux fichiers générés sont utililisés par le script testsuite généré
280AC_CONFIG_TESTDIR([tests/python])
281AC_CONFIG_TESTDIR([tests/usecases/python])
282
283## Configure Doxygen
284## TODO : Créer une macro spécifique.
285AC_SUBST_FILE(DOXYMEDFILE)
286DOXYMEDFILE=$srcdir/doc/dox/MEDfile.als
287
288AC_SUBST_FILE(DOXYMEDMESH)
289DOXYMEDMESH=$srcdir/doc/dox/MEDmesh.als
290
291AC_SUBST_FILE(DOXYMEDSUPPORTMESH)
292DOXYMEDSUPPORTMESH=$srcdir/doc/dox/MEDsupportMesh.als
293
294AC_SUBST_FILE(DOXYMEDFILTER)
295DOXYMEDFILTER=$srcdir/doc/dox/MEDfilter.als
296
297AC_SUBST_FILE(DOXYMEDLIBRARY)
298DOXYMEDLIBRARY=$srcdir/doc/dox/MEDlibrary.als
299
300AC_SUBST_FILE(DOXYMEDFIELD)
301DOXYMEDFIELD=$srcdir/doc/dox/MEDfield.als
302
303AC_SUBST_FILE(DOXYMEDFAMILY)
304DOXYMEDFAMILY=$srcdir/doc/dox/MEDfamily.als
305
306AC_SUBST_FILE(DOXYMEDEQUIVALENCE)
307DOXYMEDEQUIVALENCE=$srcdir/doc/dox/MEDequivalence.als
308
309AC_SUBST_FILE(DOXYMEDLINK)
310DOXYMEDLINK=$srcdir/doc/dox/MEDlink.als
311
312AC_SUBST_FILE(DOXYMEDJOINT)
313DOXYMEDJOINT=$srcdir/doc/dox/MEDjoint.als
314
315AC_SUBST_FILE(DOXYMEDLOCALIZATION)
316DOXYMEDLOCALIZATION=$srcdir/doc/dox/MEDlocalization.als
317
318AC_SUBST_FILE(DOXYMEDINTERP)
319DOXYMEDINTERP=$srcdir/doc/dox/MEDinterp.als
320
321AC_SUBST_FILE(DOXYMEDSTRUCTELEMENT)
322DOXYMEDSTRUCTELEMENT=$srcdir/doc/dox/MEDstructElement.als
323
324AC_SUBST_FILE(DOXYMEDPARAMETER)
325DOXYMEDPARAMETER=$srcdir/doc/dox/MEDparameter.als
326
327AC_SUBST_FILE(DOXYMEDPROFILE)
328DOXYMEDPROFILE=$srcdir/doc/dox/MEDprofile.als
329
330AC_SUBST_FILE(DOXYALIASES)
331DOXYALIASES=./doc/dox/aliases.als
332
333LT_OUTPUT
334
335## Process a configuration summary
336MED_SUMMARY
337
338AC_CONFIG_FILES([Makefile
339	   config/Makefile
340	   include/2.3.6/Makefile
341	   include/2.3.6/med.h
342	   include/2.3.6/med23v30.h
343	   include/2.3.6/med_utils.h
344	   include/Makefile
345	   include/H5public_extract.h
346	   include/med.h
347           include/med_parameter.hf
348	   include/med_utils.h
349           src/libmed3.settings
350           src/Makefile
351	   src/ci/Makefile
352           src/fi/Makefile
353	   src/cfi/Makefile
354	   src/misc/Makefile
355	   src/hdfi/Makefile
356           src/2.3.6/Makefile
357	   src/2.3.6/ci/Makefile
358           src/2.3.6/fi/Makefile
359	   src/2.3.6/cfi/Makefile
360	   src/2.3.6/misc/Makefile
361	   src/2.3.6/hdfi/Makefile
362	   tests/Makefile
363           tests/python/Makefile
364           tests/python/atlocal
365           tests/c/Makefile
366	   tests/c/dumps.ref/Makefile
367           tests/c/3.2.1/Makefile
368           tests/c/3.2.1/dumps.ref/Makefile
369           tests/c/3.1.0/Makefile
370           tests/c/3.1.0/dumps.ref/Makefile
371           tests/c/3.0.8/Makefile
372           tests/c/3.0.8/dumps.ref/Makefile
373           tests/c/2.3.1/Makefile
374	   tests/c/2.3.1/dumps.ref/Makefile
375           tests/c/2.3.2/Makefile
376	   tests/c/2.3.2/dumps.ref/Makefile
377           tests/c/2.3.6/Makefile
378           tests/c/2.3.6/dumps.ref/Makefile
379           tests/c/2.3.1v3.0/Makefile
380           tests/c/2.3.1v3.0/dumps.ref/Makefile
381           tests/c/2.3.2v3.0/Makefile
382           tests/c/2.3.2v3.0/dumps.ref/Makefile
383           tests/c/2.3v3.0/Makefile
384           tests/c/2.3v3.0/dumps.ref/Makefile
385	   tests/f/Makefile
386	   tests/f/dumps.ref/Makefile
387           tests/f/3.2.1/Makefile
388           tests/f/3.2.1/dumps.ref/Makefile
389           tests/f/3.1.0/Makefile
390           tests/f/3.1.0/dumps.ref/Makefile
391           tests/f/3.0.8/Makefile
392           tests/f/3.0.8/dumps.ref/Makefile
393           tests/f/2.3.1/Makefile
394           tests/f/2.3.1/dumps.ref/Makefile
395           tests/f/2.3.2/Makefile
396           tests/f/2.3.2/dumps.ref/Makefile
397           tests/f/2.3.6/Makefile
398           tests/f/2.3.6/dumps.ref/Makefile
399           tests/f/2.3v3.0/Makefile
400           tests/f/2.3v3.0/dumps.ref/Makefile
401           tests/f/2.3.1v3.0/Makefile
402           tests/f/2.3.1v3.0/dumps.ref/Makefile
403           tests/f/2.3.2v3.0/Makefile
404           tests/f/2.3.2v3.0/dumps.ref/Makefile
405	   tests/parallel/Makefile
406	   tests/parallel/dumps.ref/Makefile
407	   tests/parallel/f/Makefile
408	   tests/usecases/Makefile
409	   tests/usecases/c/Makefile
410	   tests/usecases/c/dumps.ref/Makefile
411	   tests/usecases/f/Makefile
412           tests/usecases/f/dumps.ref/Makefile
413	   tests/usecases/python/Makefile
414	   tests/usecases/python/atlocal
415	   tests/unittests/Makefile
416	   tests/unittests/c/Makefile
417	   tests/unittests/c/dumps.ref/Makefile
418	   tests/unittests/c/MEDinterp/Makefile
419	   tests/unittests/c/MEDinterp/dumps.ref/Makefile
420	   tests/unittests/c/MEDmesh/Makefile
421	   tests/unittests/c/MEDmesh/dumps.ref/Makefile
422	   tests/unittests/f/Makefile
423	   tests/unittests/f/dumps.ref/Makefile
424           tools/Makefile
425	   tools/mdump/Makefile
426           tools/mdump/xmdump2
427           tools/mdump/xmdump3
428           tools/medconforme/Makefile
429           tools/medimport/Makefile
430           tools/medimport/include/Makefile
431           tools/medimport/2.3.1/Makefile
432           tools/medimport/2.1.x/Makefile
433           tools/medimport/2.3.6/Makefile
434           tools/medimport/3.0.0/Makefile
435           tools/medimport/3.1.0/Makefile
436           tools/medimport/3.2.0/Makefile
437           doc/Makefile
438           doc/dox/Makefile
439           doc/dox/aliases.als
440           doc/dox/Doxyfile.cfg
441	   doc/gif/Makefile
442	   doc/html/Makefile
443	   doc/html/root.html
444	   doc/html.dox/Makefile
445	   doc/jpg/Makefile
446	   doc/png/Makefile
447	   doc/odt/Makefile
448	   python/Makefile
449	   src/CMakeLists.txt
450	   tools/medimport/CMakeLists.txt
451           CMakeLists.txt])
452
453
454AC_OUTPUT
455
456cat src/libmed3.settings
457
458
459