2 # ================================================================
3 # Process this file with autoconf to produce a configure script
4 # ================================================================
8 AC_INIT([Salome2 Project], [4.0.0], [paul.rascle@edf.fr], [salome])
10 # AC_CONFIG_AUX_DIR defines an alternative directory where to find the auxiliary
11 # scripts such as config.guess, install-sh, ...
12 AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
15 AM_INIT_AUTOMAKE([tar-pax])
16 #AC_CONFIG_HEADER([config.h])
26 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
31 echo ---------------------------------------------
32 echo Initialize source and build root directories
33 echo ---------------------------------------------
37 # This function return on stdout the absolute path of the filename in
39 # $ filename="../KERNEL_SRC/configure
40 # $ absfilename=`absolute_path $filename`
41 function absolute_path {
44 apath=`dirname $filename`
51 # Build directory, where the configure script is executed.
53 # Source directory, where the configure script is located.
54 ROOT_SRCDIR=`absolute_path $0`
57 AC_SUBST(ROOT_BUILDDIR)
60 echo Source root directory : $ROOT_SRCDIR
61 echo Build root directory : $ROOT_BUILDDIR
63 # ----------------------------------------------------------------------------
66 AC_ARG_ENABLE(corba_gen,
67 [AC_HELP_STRING([--enable-corba-gen],[Generate CORBA stuff [default=yes]])],
68 [case "${enableval}" in
69 yes) corba_gen=true ;;
70 no) corba_gen=false ;;
71 *) AC_MSG_ERROR(bad value ${enableval} for --enable-corba-gen) ;;
72 esac],[corba_gen=true])
73 AM_CONDITIONAL(CORBA_GEN, test x$corba_gen = xtrue)
75 # ----------------------------------------------------------------------------
79 echo ============================================================
80 echo testing general mandatory products - for all configurations
81 echo ============================================================
84 dnl Modification B. Secher portage sur osf
85 AC_CHECK_PROG(SHELL,sh)
88 if test -z "$AR"; then
89 AC_CHECK_PROGS(AR,ar xar,:,$PATH)
94 echo ---------------------------------------------
96 echo ---------------------------------------------
102 echo ---------------------------------------------
103 echo Configuring production
104 echo ---------------------------------------------
108 AC_ENABLE_PRODUCTION(no)
111 echo ---------------------------------------------
113 echo ---------------------------------------------
116 dnl first, we set static to no!
117 dnl if we want it, use --enable-static
123 echo ---------------------------------------------
125 echo ---------------------------------------------
132 AC_CXX_TEMPLATE_OPTIONS
134 # AC_CC_WARNINGS([ansi])
138 AC_CHECK_LIB(dl,dlopen)
140 dnl Library librt : for alpha/osf
141 AC_CHECK_LIB(rt,nanosleep)
143 dnl add library libm :
146 # _CS_gbo We should add all dependent libraries
148 AC_CXX_USE_STD_IOSTREAM
156 echo ---------------------------------------------
158 echo ---------------------------------------------
164 echo ---------------------------------------------
166 echo ---------------------------------------------
172 echo ---------------------------------------------
174 echo ---------------------------------------------
177 dnl _CS_gbo We should use here a variable given from the CHECK_PYTHON
182 echo ---------------------------------------------
184 echo ---------------------------------------------
189 # ----------------------------------------------------------------------------
192 if test x$corba_gen = xtrue; then
195 echo ============================================================
196 echo testing mandatory products for CORBA configurations
197 echo ============================================================
201 dnl ---------------------------------------------
203 dnl ---------------------------------------------
209 echo ---------------------------------------------
210 echo Configuration of the ORB
211 echo ---------------------------------------------
214 echo Testing OMNIORB ...
217 echo Selecting the default ORB
219 echo DEFAULT_ORB : $DEFAULT_ORB
222 CORBA=salome_adm/unix/make_$ORB
226 # The CORBA variable defines the file name that
227 # implements the building rules to be included by Makefile to process
228 # idl files and CORBA specific dependencies (ex: the file
229 # salome_adm/unix/make_omniorb is the default for SALOME). The value
230 # of ORB is defined by CHECK_CORBA.
232 # Note that this checking process is no longer relevant for SALOME
233 # because the possibility of changing the ORB as a plugin is probably
234 # deprecated. The software configuration is clearly omniorb for CORBA
235 # communication. This could be simplify in a near futur.
238 echo ---------------------------------------------
240 echo ---------------------------------------------
246 echo ---------------------------------------------
248 echo ---------------------------------------------
256 # ----------------------------------------------------------------------------
259 echo ============================================================
260 echo testing parallel products
261 echo ============================================================
265 echo ---------------------------------------------
266 echo checking if MPI is requested by user
267 echo ---------------------------------------------
273 echo ---------------------------------------------
274 echo checking if PaCO++ is requested by user
275 echo ---------------------------------------------
281 echo ------------------------------------------------------------
282 echo checking if parallel kernel extensions are requested by user
283 echo ------------------------------------------------------------
286 AC_MSG_CHECKING(whether to enable parallel kernel extension)
287 AC_ARG_ENABLE(parallel_extension,
288 AC_HELP_STRING([--enable-parallel_extension], [parallel kernel extension = [no/yes] (default is no)]),
289 parallel_extension_ok=$enableval,
290 parallel_extension_ok=no)
291 if test "x$parallel_extension_ok" = "xyes"
293 if test "x$PaCO_ok" = "xno"
295 parallel_extension_ok=no
299 if test "x$parallel_extension_ok" = "xyes"
306 AM_CONDITIONAL([WITH_PACO_PARALLEL], [test "x$parallel_extension_ok" = "xyes"])
309 echo ============================================================
310 echo testing optionnal products
311 echo ============================================================
315 echo ---------------------------------------------
317 echo ---------------------------------------------
320 dnl Several batch systems (OpenPBS, LSF, ...) can be operated using
321 dnl the Batch classes library integrated in the KERNEL module. The
322 dnl checking process tests here the presence of underlying batch
323 dnl softwares. If none is detected, the KERNEL is declared to be
330 dnl openpbs_ok is set to yes by CHECK_OPENPBS
336 dnl lsf_ok is set to yes by CHECK_LSF
339 echo testing Local batch system
340 echo --------------------------
343 dnl localbatch_ok is set to yes by CHECK_LOCAL
346 test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes
349 [AC_HELP_STRING([--enable-batch],[Batch [default=yes]])],
350 [case "${enableval}" in
351 yes) test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes;;
353 *) AC_MSG_ERROR(bad value ${enableval} for --enable-batch) ;;
354 esac],[test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes])
356 echo Batch mode = $WITH_BATCH
359 AM_CONDITIONAL(WITH_BATCH, [test x"$WITH_BATCH" = xyes])
362 echo ----------------------------------------------
363 echo testing CPPUNIT only required for unit testing
364 echo ----------------------------------------------
369 echo ============================================================
370 echo testing products required only for documentation generation
371 echo ============================================================
375 echo ---------------------------------------------
376 echo Testing html generators
377 echo ---------------------------------------------
380 CHECK_HTML_GENERATORS
383 echo ============================================================
385 echo ============================================================
388 # This function displays the values of each variable given in arguments
391 for var in $variables
394 if test x$toto != "x"; then
395 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
401 # --------------------------------------
403 function check_fatal_error {
405 for var in $variables
408 if test x$toto != "xyes"; then
409 echo "FATAL ERROR: some mandatory products are missing."
410 echo "Installing the missing products is required before running the configure script".
416 # --------------------------------------
418 if test x$corba_gen = xtrue; then
419 basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok"
421 basic_mandatory_products="cc_ok threads_ok hdf5_ok"
424 echo --- General mandatory products - Light configuration:
425 summary $basic_mandatory_products
426 check_fatal_error $basic_mandatory_products
429 corba_mandatory_products="omniORB_ok boost_ok"
430 if test x$corba_gen = xtrue; then
431 echo --- CORBA mandatory products - default configuration:
432 summary $corba_mandatory_products
433 check_fatal_error $corba_mandatory_products
435 echo --- CORBA products not required - option --disable-corba-gen
436 if test x"$WITH_BATCH" = xyes; then
437 echo --- BATCH mode mandatory products - default configuration:
439 check_fatal_error "python_ok"
441 echo --- Python not required - option --enable-batch=no
446 parallel_products="mpi_ok PaCO_ok parallel_extension_ok"
447 echo --- Kernel parallel extensions:
448 summary $parallel_products
451 optional_products="cppunit_ok openpbs_ok lsf_ok"
452 echo --- Optional products:
453 echo [" These products are optional because the KERNEL functions"]
454 echo [" using them are built only if the products are detected."]
455 summary $optional_products
458 htmldoc_products="doxygen_ok graphviz_ok rst2html_ok"
460 echo --- Html documentation products: only required for doc production
461 summary $htmldoc_products
465 echo "Default ORB : $DEFAULT_ORB"
468 dnl generals files which could be included in every makefile
470 AC_SUBST_FILE(COMMENCE) COMMENCE=salome_adm/unix/make_commence
471 AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude
472 AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
475 AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
477 dnl We don t need to say when we re entering directories if we re using
478 dnl GNU make becuase make does it for us.
479 if test "X$GMAKE" = "Xyes"; then
480 AC_SUBST(SETX) SETX=":"
482 AC_SUBST(SETX) SETX="set -x"
486 echo ---------------------------------------------
487 echo copying resource files, shell scripts, and
489 echo ---------------------------------------------
495 for i in `find $ROOT_SRCDIR/bin`
497 local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR/bin,.,"`
500 . | */CVS | */CVS/* | ./salome) ;;
501 ./appliskel |./appliskel/env.d) $INSTALL -d $local_bin ; echo $local_bin ;;
502 *) $INSTALL $i $local_bin; echo $local_bin ;;
508 echo ---------------------------------------------
509 echo generating Makefiles and configure files
510 echo ---------------------------------------------
513 AC_OUTPUT_COMMANDS([ \
515 chmod +x ./bin/salome/* \
518 # This list is initiated using autoscan and must be updated manually
519 # when adding a new file <filename>.in to manage. When you execute
520 # autoscan, the Makefile list is generated in the output file configure.scan.
521 # This could be helpfull to update de configuration.
524 ./salome_adm/unix/SALOMEconfig.ref \
525 ./salome_adm/Makefile \
526 ./salome_adm/unix/Makefile \
527 ./salome_adm/unix/config_files/Makefile \
533 ./doc/salome/Makefile \
534 ./doc/salome/tui/Makefile \
535 ./doc/salome/tui/INPUT/doxyuser:./doc/salome/tui/KERNEL/doxyuser.in \
536 ./doc/salome/tui/INPUT/doxydev:./doc/salome/tui/KERNEL/doxydev.in \
537 ./doc/salome/tui/INPUT/sources/static/tree.js:./doc/salome/tui/KERNEL/sources/static/tree.js.in \
539 ./resources/Makefile \
540 ./resources/KERNELCatalog.xml \
541 ./resources/CatalogResources.xml \
542 ./resources/DEPRECATED/Plugin \
544 ./src/Basics/Makefile \
545 ./src/Basics/Test/Makefile \
546 ./src/Batch/Makefile \
547 ./src/Batch_SWIG/Makefile \
548 ./src/Communication/Makefile \
549 ./src/Communication_SWIG/Makefile \
550 ./src/Container/Makefile \
551 ./src/ParallelContainer/Makefile \
554 ./src/DSC/DSC_Basic/Makefile \
555 ./src/DSC/DSC_User/Makefile \
556 ./src/DSC/DSC_User/Basic/Makefile \
557 ./src/DSC/DSC_User/Datastream/Makefile \
558 ./src/DSC/DSC_User/Datastream/Palm/Makefile \
559 ./src/DSC/DSC_User/Datastream/Calcium/Makefile \
560 ./src/DSC/ParallelDSC/Makefile \
561 ./src/DSC/DSC_Python/Makefile \
562 ./src/GenericObj/Makefile \
563 ./src/HDFPersist/Makefile \
564 ./src/KERNEL_PY/Makefile \
565 ./src/Launcher/Makefile \
566 ./src/LifeCycleCORBA/Makefile \
567 ./src/LifeCycleCORBA/Test/Makefile \
568 ./src/LifeCycleCORBA_SWIG/Makefile \
569 ./src/LifeCycleCORBA_SWIG/Test/Makefile \
570 ./src/Logger/Makefile \
571 ./src/Logger/Test/Makefile \
572 ./src/ModuleCatalog/Makefile \
573 ./src/ModuleGenerator/Makefile \
574 ./src/ModuleGenerator/testIDLparser \
575 ./src/MPIContainer/Makefile \
576 ./src/NamingService/Makefile \
577 ./src/NamingService/Test/Makefile \
578 ./src/Notification/Makefile \
579 ./src/NOTIFICATION_SWIG/Makefile \
580 ./src/Registry/Makefile \
581 ./src/ResourcesManager/Makefile \
582 ./src/SALOMEDS/Makefile \
583 ./src/SALOMEDS/Test/Makefile \
584 ./src/SALOMEDSClient/Makefile \
585 ./src/SALOMEDSImpl/Makefile \
586 ./src/SALOMEDSImpl/Test/Makefile \
587 ./src/SALOMELocalTrace/Makefile \
588 ./src/SALOMELocalTrace/Test/Makefile \
589 ./src/SALOMETraceCollector/Makefile \
590 ./src/SALOMETraceCollector/Test/Makefile \
591 ./src/TestContainer/Makefile \
592 ./src/TestMPIContainer/Makefile \
593 ./src/TOOLSDS/Makefile \
594 ./src/UnitTests/Makefile \
595 ./src/Utils/Makefile \
596 ./src/Utils/Test/Makefile \