Salome HOME
0020354: EDF 1031 OTHER warnings with automake 1.10
[modules/kernel.git] / configure.ac
1 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 #  This library is free software; you can redistribute it and/or
7 #  modify it under the terms of the GNU Lesser General Public
8 #  License as published by the Free Software Foundation; either
9 #  version 2.1 of the License.
10 #
11 #  This library is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 #  Lesser General Public License for more details.
15 #
16 #  You should have received a copy of the GNU Lesser General Public
17 #  License along with this library; if not, write to the Free Software
18 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22 # ================================================================
23 # Process this file with autoconf to produce a configure script
24 # ================================================================
25 #AC_PREREQ(2.59)
26 #
27 AC_INIT([Salome2 Project], [5.1.2ax], [paul.rascle@edf.fr], [SalomeKERNEL])
28
29 # AC_CONFIG_AUX_DIR defines an alternative directory where to find the auxiliary
30 # scripts such as config.guess, install-sh, ...
31 AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
32 AC_CANONICAL_HOST
33 AC_CANONICAL_TARGET
34 AM_INIT_AUTOMAKE([tar-pax -Wno-portability])
35 #AC_CONFIG_HEADER([config.h])
36
37 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
38 AC_SUBST(XVERSION)
39
40 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
41 MODULE_NAME=kernel
42 AC_SUBST(MODULE_NAME)
43
44 echo
45 echo ---------------------------------------------
46 echo Initialize source and build root directories
47 echo ---------------------------------------------
48 echo
49
50 #
51 # This function return on stdout the absolute path of the filename in
52 # argument. Exemple:
53 # $ filename="../KERNEL_SRC/configure
54 # $ absfilename=`absolute_path $filename`
55 function absolute_path {
56     filename=$1
57     here=`pwd`
58     apath=`dirname $filename`
59     cd $apath
60     apath=`pwd`
61     cd $here
62     echo $apath
63 }
64
65 # Build directory, where the configure script is executed.
66 ROOT_BUILDDIR=`pwd`
67 # Source directory, where the configure script is located.
68 ROOT_SRCDIR=`absolute_path $0`
69
70 AC_SUBST(ROOT_SRCDIR)
71 AC_SUBST(ROOT_BUILDDIR)
72
73 echo
74 echo Source root directory : $ROOT_SRCDIR
75 echo Build  root directory : $ROOT_BUILDDIR
76
77 # ----------------------------------------------------------------------------
78 # --- test options
79
80 AC_ARG_ENABLE(corba_gen,
81   [AC_HELP_STRING([--enable-corba-gen],[Generate CORBA stuff [default=yes]])],
82   [case "${enableval}" in
83      yes) corba_gen=true ;;
84      no)  corba_gen=false ;;
85      *) AC_MSG_ERROR(bad value ${enableval} for --enable-corba-gen) ;;
86   esac],[corba_gen=true])
87 AM_CONDITIONAL(CORBA_GEN, test x$corba_gen = xtrue)
88
89 # ---- option to build only launcher, resources manager and batch classes
90 AC_ARG_WITH(onlylauncher,
91         [AC_HELP_STRING([--with-onlylauncher],[Build only launcher, resources manager and batch classes [default=no]])],
92         [],
93         [with_onlylauncher="no"])
94 AM_CONDITIONAL(WITHONLYLAUNCHER, test x$with_onlylauncher = xyes)
95
96 # ----------------------------------------------------------------------------
97
98 echo
99 echo
100 echo ============================================================
101 echo testing general mandatory products - for all configurations
102 echo ============================================================
103 echo
104
105 dnl Modification B. Secher portage sur osf
106 AC_CHECK_PROG(SHELL,sh)
107 AC_SUBST(SHELL)
108
109 if test -z "$AR"; then
110    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
111 fi
112 AC_SUBST(AR)
113
114 echo
115 echo ---------------------------------------------
116 echo testing make
117 echo ---------------------------------------------
118 echo
119 AC_PROG_MAKE_SET
120 AC_PROG_INSTALL
121
122 echo
123 echo ---------------------------------------------
124 echo Configuring production
125 echo ---------------------------------------------
126 echo
127 # production.m4
128 AC_ENABLE_DEBUG(no)
129 AC_ENABLE_PRODUCTION(no)
130 AC_ENABLE_MPI_SEQ_CONTAINER(no)
131
132 echo
133 echo ---------------------------------------------
134 echo testing libtool
135 echo ---------------------------------------------
136 echo
137
138 dnl first, we set static to no!
139 dnl if we want it, use --enable-static
140 AC_ENABLE_STATIC(no)
141 AC_LIBTOOL_DLOPEN
142 AC_PROG_LIBTOOL
143
144 echo
145 echo ---------------------------------------------
146 echo testing C/C++
147 echo ---------------------------------------------
148 echo
149
150 cc_ok=no
151 AC_PROG_CC
152 AC_PROG_CXX
153 AC_CXX_WARNINGS
154 AC_CXX_TEMPLATE_OPTIONS
155 AC_DEPEND_FLAG
156 # AC_CC_WARNINGS([ansi])
157 cc_ok=yes
158
159 dnl Library libdl :
160 AC_CHECK_LIB(dl,dlopen)
161
162 dnl Library librt : for alpha/osf
163 AC_CHECK_LIB(rt,nanosleep)
164
165 dnl add library libm :
166 AC_CHECK_LIB(m,ceil)
167
168 # _CS_gbo We should add all dependent libraries
169
170 AC_CXX_USE_STD_IOSTREAM
171
172 AC_CXX_HAVE_SSTREAM
173
174 # Testing linker
175 AC_LINKER_OPTIONS
176
177 echo
178 echo ---------------------------------------------
179 echo testing Fortran INTEGER size for CALCIUM 
180 echo ---------------------------------------------
181 echo
182
183 CHECK_CALCIUM
184
185 echo
186 echo ---------------------------------------------
187 echo testing threads
188 echo ---------------------------------------------
189 echo
190
191 ENABLE_PTHREADS
192
193 echo
194 echo ---------------------------------------------
195 echo testing python
196 echo ---------------------------------------------
197 echo
198
199 CHECK_PYTHON
200
201 echo
202 echo ---------------------------------------------
203 echo testing swig
204 echo ---------------------------------------------
205 echo
206
207 dnl _CS_gbo We should use here a variable given from the CHECK_PYTHON
208 AM_PATH_PYTHON(2.3)
209 CHECK_SWIG
210
211 echo
212 echo ---------------------------------------------
213 echo Testing libxml2
214 echo ---------------------------------------------
215 echo
216
217 CHECK_LIBXML
218
219 if test x$with_onlylauncher = xno; then
220 echo
221 echo ---------------------------------------------
222 echo testing HDF5
223 echo ---------------------------------------------
224 echo
225
226 CHECK_HDF5
227
228 # ----------------------------------------------------------------------------
229 # --- test corba
230
231 if test x$corba_gen = xtrue; then
232
233 echo
234 echo ============================================================
235 echo testing mandatory products for CORBA configurations
236 echo ============================================================
237 echo
238
239 dnl
240 dnl ---------------------------------------------
241 dnl testing sockets
242 dnl ---------------------------------------------
243 dnl
244
245 CHECK_SOCKETS
246
247 echo
248 echo ---------------------------------------------
249 echo Configuration of the ORB
250 echo ---------------------------------------------
251 echo
252
253 echo Testing OMNIORB ...
254 CHECK_OMNIORB
255
256 echo Selecting the default ORB
257 DEFAULT_ORB=omniORB
258 echo DEFAULT_ORB : $DEFAULT_ORB
259 CHECK_CORBA
260
261 CORBA=salome_adm/unix/make_$ORB
262 AC_SUBST_FILE(CORBA)
263
264 # _CS_gbo:
265 # The CORBA variable defines the file name that
266 # implements the building rules to be included by Makefile to process
267 # idl files and CORBA specific dependencies (ex: the file
268 # salome_adm/unix/make_omniorb is the default for SALOME). The value
269 # of ORB is defined by CHECK_CORBA.
270
271 # Note that this checking process is no longer relevant for SALOME
272 # because the possibility of changing the ORB as a plugin is probably
273 # deprecated. The software configuration is clearly omniorb for CORBA
274 # communication. This could be simplify in a near futur.
275
276 echo
277 echo ---------------------------------------------
278 echo BOOST Library
279 echo ---------------------------------------------
280 echo
281
282 CHECK_BOOST
283
284 fi 
285 # --- end test corba
286 # ----------------------------------------------------------------------------
287
288 fi 
289 # --- end test ONLYLAUNCHER
290 # ----------------------------------------------------------------------------
291
292 echo
293 echo ============================================================
294 echo testing parallel products
295 echo ============================================================
296 echo
297
298 echo
299 echo ---------------------------------------------
300 echo checking if MPI is requested by user
301 echo ---------------------------------------------
302 echo
303
304 CHECK_MPI
305
306 echo
307 echo ---------------------------------------------
308 echo checking if PaCO++ is requested by user
309 echo ---------------------------------------------
310 echo
311
312 CHECK_PACO
313
314 echo
315 echo ------------------------------------------------------------
316 echo checking if parallel kernel extensions are requested by user
317 echo ------------------------------------------------------------
318 echo
319
320 AC_MSG_CHECKING(whether to enable parallel kernel extension)
321 AC_ARG_ENABLE(parallel_extension, 
322               AC_HELP_STRING([--enable-parallel_extension], [parallel kernel extension = [no/yes] (default is no)]),
323               parallel_extension_ok=$enableval,                
324               parallel_extension_ok=no)
325 if test "x$parallel_extension_ok" = "xyes"
326 then
327   if test "x$PaCO_ok" = "xno"
328   then
329     parallel_extension_ok=no
330   fi
331 fi
332
333 if test "x$parallel_extension_ok" = "xyes"
334 then
335   AC_MSG_RESULT([yes])
336 else
337   AC_MSG_RESULT([no])
338 fi
339
340 AM_CONDITIONAL([WITH_PACO_PARALLEL], [test "x$parallel_extension_ok" = "xyes"])
341
342 echo
343 echo ============================================================
344 echo testing optionnal products
345 echo ============================================================
346 echo
347
348 echo
349 echo ---------------------------------------------
350 echo Testing Batch
351 echo ---------------------------------------------
352 echo
353
354 dnl Several batch systems (OpenPBS, LSF, ...) can be operated using
355 dnl the Batch classes library integrated in the KERNEL module. The
356 dnl checking process tests here the presence of underlying batch
357 dnl softwares. If none is detected, the KERNEL is declared to be
358 dnl "without batch". 
359
360 echo testing OpenPBS
361 echo ---------------
362 openpbs_ok=no
363 CHECK_OPENPBS
364 dnl openpbs_ok is set to yes by CHECK_OPENPBS
365
366 echo testing LSF
367 echo -----------
368 lsf_ok=no
369 CHECK_LSF
370 dnl lsf_ok is set to yes by CHECK_LSF
371 echo lsf = $lsf_ok
372
373 echo testing Local batch system
374 echo --------------------------
375 localbatch_ok=no
376 CHECK_LOCAL
377 dnl localbatch_ok is set to yes by CHECK_LOCAL
378
379 WITH_BATCH=no
380 test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes
381
382 AC_ARG_ENABLE(batch,
383   [AC_HELP_STRING([--enable-batch],[Batch [default=yes]])],
384   [case "${enableval}" in
385      yes) test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes;;
386      no)  WITH_BATCH=no ;;
387      *) AC_MSG_ERROR(bad value ${enableval} for --enable-batch) ;;
388   esac],[test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes])
389
390 echo Batch mode = $WITH_BATCH
391
392 AC_SUBST(WITH_BATCH)
393 AM_CONDITIONAL(WITH_BATCH, [test x"$WITH_BATCH" = xyes])
394
395 echo
396 echo ----------------------------------------------
397 echo testing CPPUNIT only required for unit testing
398 echo ----------------------------------------------
399 echo
400 CHECK_CPPUNIT
401
402 echo
403 echo ============================================================
404 echo testing products required only for documentation generation
405 echo ============================================================
406 echo
407
408 echo
409 echo ---------------------------------------------
410 echo Testing html generators
411 echo ---------------------------------------------
412 echo
413
414 CHECK_HTML_GENERATORS
415
416 # Additional conditional to avoid compilation of non-portable code
417 AM_CONDITIONAL(WINDOWS, [ test ])
418
419 echo
420 echo ============================================================
421 echo Summary
422 echo ============================================================
423 echo
424
425 # This function displays the values of each variable given in arguments 
426 function summary {
427   variables=$*
428   for var in $variables
429   do
430     eval toto=\$$var
431     if test x$toto != "x"; then
432       printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
433       eval echo \$$var
434     fi
435   done
436 }
437
438 # --------------------------------------
439
440 function check_fatal_error {
441   variables=$*
442   for var in $variables
443   do
444     eval toto=\$$var
445     if test x$toto != "xyes"; then
446         echo "FATAL ERROR: some mandatory products are missing."
447         echo "Installing the missing products is required before running the configure script".
448         exit 1
449     fi
450   done  
451 }
452
453 # --------------------------------------
454
455 if test x$with_onlylauncher = xno; then
456   if test x$corba_gen = xtrue; then
457     basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok libxml_ok"
458   else
459     basic_mandatory_products="cc_ok threads_ok hdf5_ok libxml_ok"
460   fi
461 else
462   basic_mandatory_products="cc_ok threads_ok libxml_ok"
463 fi
464
465 echo --- General mandatory products - Light configuration:
466 summary $basic_mandatory_products
467 check_fatal_error $basic_mandatory_products
468 echo
469
470 if test x$with_onlylauncher = xno; then
471   corba_mandatory_products="omniORB_ok omniORBpy_ok boost_ok"
472   if test x$corba_gen = xtrue; then
473     echo --- CORBA mandatory products - default configuration:
474     summary $corba_mandatory_products
475     check_fatal_error $corba_mandatory_products
476   else
477     echo --- CORBA products not required - option --disable-corba-gen
478     if test x"$WITH_BATCH" = xyes; then
479       echo --- BATCH mode mandatory products - default configuration:
480       summary "python_ok"
481       check_fatal_error "python_ok"
482     else 
483     echo --- Python not required - option --enable-batch=no
484     fi
485   fi
486 fi
487 echo
488
489 parallel_products="mpi_ok PaCO_ok parallel_extension_ok"
490 echo --- Kernel parallel extensions:
491 summary $parallel_products
492 echo
493
494 optional_products="cppunit_ok openpbs_ok lsf_ok numpy_ok"
495 echo --- Optional products:
496 echo ["    These products are optional because the KERNEL functions"]
497 echo ["    using them are built only if the products are detected."]
498 summary $optional_products
499 echo
500
501 htmldoc_products="doxygen_ok graphviz_ok rst2html_ok"
502
503 echo --- Html documentation products: only required for doc production
504 summary $htmldoc_products
505 echo
506
507 if test x$with_onlylauncher = xno; then
508 echo
509 echo "Default ORB   : $DEFAULT_ORB"
510 echo
511 fi
512
513 dnl generals files which could be included in every makefile
514
515 AC_SUBST_FILE(COMMENCE) COMMENCE=salome_adm/unix/make_commence
516 AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude
517 AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
518
519 dnl les dependences
520 AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
521
522 dnl We don t need to say when we re entering directories if we re using
523 dnl GNU make becuase make does it for us.
524 if test "X$GMAKE" = "Xyes"; then
525    AC_SUBST(SETX) SETX=":"
526 else
527    AC_SUBST(SETX) SETX="set -x"
528 fi
529
530 echo
531 echo ---------------------------------------------
532 echo generating Makefiles and configure files
533 echo ---------------------------------------------
534 echo
535
536 # This list is initiated using autoscan and must be updated manually
537 # when adding a new file <filename>.in to manage. When you execute
538 # autoscan, the Makefile list is generated in the output file configure.scan.
539 # This could be helpfull to update de configuration.
540 AC_OUTPUT([ \
541   KERNEL_version.h \
542   salome_adm/unix/SALOMEconfig.ref \
543   salome_adm/Makefile \
544   salome_adm/cmake_files/Makefile \
545   salome_adm/unix/Makefile \
546   salome_adm/unix/config_files/Makefile \
547   Makefile \
548   bin/Makefile \
549   bin/VERSION \
550   doc/Makefile \
551   doc/salome/Makefile \
552   doc/salome/tui/Makefile \
553   doc/salome/tui/doxyfile \
554   doc/salome/gui/Makefile \
555   doc/salome/gui/doxyfile \
556   idl/Makefile \
557   idl/Calcium_Ports.idl \
558   resources/Makefile \
559   resources/KERNELCatalog.xml \
560   resources/CatalogResources.xml \
561   src/Makefile \
562   src/Basics/Makefile \
563   src/Basics/Test/Makefile \
564   src/Batch/Makefile \
565   src/Batch_SWIG/Makefile \
566   src/Communication/Makefile \
567   src/Communication_SWIG/Makefile \
568   src/Container/Makefile \
569   src/ParallelContainer/Makefile \
570   src/DF/Makefile \
571   src/DSC/Makefile \
572   src/DSC/DSC_Basic/Makefile \
573   src/DSC/DSC_User/Makefile \
574   src/DSC/DSC_User/Basic/Makefile \
575   src/DSC/DSC_User/Datastream/Makefile \
576   src/DSC/DSC_User/Datastream/Palm/Makefile \
577   src/DSC/DSC_User/Datastream/Calcium/Makefile \
578   src/DSC/DSC_User/Datastream/Calcium/calcium_integer_port_uses.hxx \
579   src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.hxx \
580   src/DSC/DSC_User/Datastream/Calcium/CalciumFortranInt.h \
581   src/DSC/ParallelDSC/Makefile \
582   src/DSC/DSC_Python/Makefile \
583   src/GenericObj/Makefile \
584   src/HDFPersist/Makefile \
585   src/KERNEL_PY/Makefile \
586   src/Launcher/Makefile \
587   src/LifeCycleCORBA/Makefile \
588   src/LifeCycleCORBA/Test/Makefile \
589   src/LifeCycleCORBA_SWIG/Makefile \
590   src/LifeCycleCORBA_SWIG/Test/Makefile \
591   src/Logger/Makefile \
592   src/Logger/Test/Makefile \
593   src/ModuleCatalog/Makefile \
594   src/ModuleGenerator/Makefile \
595   src/ModuleGenerator/testIDLparser \
596   src/MPIContainer/Makefile \
597   src/NamingService/Makefile \
598   src/NamingService/Test/Makefile \
599   src/Notification/Makefile \
600   src/NOTIFICATION_SWIG/Makefile \
601   src/Registry/Makefile \
602   src/ResourcesManager/Makefile \
603   src/SALOMEDS/Makefile \
604   src/SALOMEDS/Test/Makefile \
605   src/SALOMEDSClient/Makefile \
606   src/SALOMEDSImpl/Makefile \
607   src/SALOMEDSImpl/Test/Makefile \
608   src/SALOMELocalTrace/Makefile \
609   src/SALOMELocalTrace/Test/Makefile \
610   src/SALOMETraceCollector/Makefile \
611   src/SALOMETraceCollector/Test/Makefile \
612   src/TestContainer/Makefile \
613   src/TestMPIContainer/Makefile \
614   src/TOOLSDS/Makefile \
615   src/UnitTests/Makefile \
616   src/Utils/Makefile \
617   src/Utils/Test/Makefile \
618 ])
619