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 ---------------------------------------------
190 echo ---------------------------------------------
191 echo Testing OpenCascade
192 echo ---------------------------------------------
197 # ----------------------------------------------------------------------------
200 if test x$corba_gen = xtrue; then
203 echo ============================================================
204 echo testing mandatory products for CORBA configurations
205 echo ============================================================
209 dnl ---------------------------------------------
211 dnl ---------------------------------------------
217 echo ---------------------------------------------
218 echo Configuration of the ORB
219 echo ---------------------------------------------
222 echo Testing OMNIORB ...
225 echo Selecting the default ORB
227 echo DEFAULT_ORB : $DEFAULT_ORB
230 CORBA=salome_adm/unix/make_$ORB
234 # The CORBA variable defines the file name that
235 # implements the building rules to be included by Makefile to process
236 # idl files and CORBA specific dependencies (ex: the file
237 # salome_adm/unix/make_omniorb is the default for SALOME). The value
238 # of ORB is defined by CHECK_CORBA.
240 # Note that this checking process is no longer relevant for SALOME
241 # because the possibility of changing the ORB as a plugin is probably
242 # deprecated. The software configuration is clearly omniorb for CORBA
243 # communication. This could be simplify in a near futur.
246 echo ---------------------------------------------
248 echo ---------------------------------------------
254 echo ---------------------------------------------
256 echo ---------------------------------------------
264 # ----------------------------------------------------------------------------
267 echo ============================================================
268 echo testing parallel products
269 echo ============================================================
273 echo ---------------------------------------------
274 echo checking if MPI is requested by user
275 echo ---------------------------------------------
281 echo ---------------------------------------------
282 echo checking if PaCO++ is requested by user
283 echo ---------------------------------------------
289 echo ------------------------------------------------------------
290 echo checking if parallel kernel extensions are requested by user
291 echo ------------------------------------------------------------
294 AC_MSG_CHECKING(whether to enable parallel kernel extension)
295 AC_ARG_ENABLE(parallel_extension,
296 AC_HELP_STRING([--enable-parallel_extension], [parallel kernel extension = [no/yes] (default is no)]),
297 parallel_extension_ok=$enableval,
298 parallel_extension_ok=no)
299 if test "x$parallel_extension_ok" = "xyes"
301 if test "x$PaCO_ok" = "xno"
303 parallel_extension_ok=no
307 if test "x$parallel_extension_ok" = "xyes"
314 AM_CONDITIONAL([WITH_PACO_PARALLEL], [test "x$parallel_extension_ok" = "xyes"])
317 echo ============================================================
318 echo testing optionnal products
319 echo ============================================================
323 echo ---------------------------------------------
325 echo ---------------------------------------------
328 dnl Several batch systems (OpenPBS, LSF, ...) can be operated using
329 dnl the Batch classes library integrated in the KERNEL module. The
330 dnl checking process tests here the presence of underlying batch
331 dnl softwares. If none is detected, the KERNEL is declared to be
338 dnl openpbs_ok is set to yes by CHECK_OPENPBS
344 dnl lsf_ok is set to yes by CHECK_LSF
347 echo testing Local batch system
348 echo --------------------------
351 dnl localbatch_ok is set to yes by CHECK_LOCAL
354 test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes
357 [AC_HELP_STRING([--enable-batch],[Batch [default=yes]])],
358 [case "${enableval}" in
359 yes) test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes;;
361 *) AC_MSG_ERROR(bad value ${enableval} for --enable-batch) ;;
362 esac],[test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes])
364 echo Batch mode = $WITH_BATCH
367 AM_CONDITIONAL(WITH_BATCH, [test x"$WITH_BATCH" = xyes])
370 echo ----------------------------------------------
371 echo testing CPPUNIT only required for unit testing
372 echo ----------------------------------------------
377 echo ============================================================
378 echo testing products required only for documentation generation
379 echo ============================================================
383 echo ---------------------------------------------
384 echo Testing html generators
385 echo ---------------------------------------------
388 CHECK_HTML_GENERATORS
391 echo ============================================================
393 echo ============================================================
396 # This function displays the values of each variable given in arguments
399 for var in $variables
402 if test x$toto != "x"; then
403 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
409 # --------------------------------------
411 function check_fatal_error {
413 for var in $variables
416 if test x$toto != "xyes"; then
417 echo "FATAL ERROR: some mandatory products are missing."
418 echo "Installing the missing products is required before running the configure script".
424 # --------------------------------------
426 if test x$corba_gen = xtrue; then
427 basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok occ_ok"
429 basic_mandatory_products="cc_ok threads_ok hdf5_ok occ_ok"
432 echo --- General mandatory products - Light configuration:
433 summary $basic_mandatory_products
434 check_fatal_error $basic_mandatory_products
437 corba_mandatory_products="omniORB_ok boost_ok"
438 if test x$corba_gen = xtrue; then
439 echo --- CORBA mandatory products - default configuration:
440 summary $corba_mandatory_products
441 check_fatal_error $corba_mandatory_products
443 echo --- CORBA products not required - option --disable-corba-gen
444 if test x"$WITH_BATCH" = xyes; then
445 echo --- BATCH mode mandatory products - default configuration:
447 check_fatal_error "python_ok"
449 echo --- Python not required - option --enable-batch=no
454 parallel_products="mpi_ok PaCO_ok parallel_extension_ok"
455 echo --- Kernel parallel extensions:
456 summary $parallel_products
459 optional_products="cppunit_ok openpbs_ok lsf_ok"
460 echo --- Optional products:
461 echo [" These products are optional because the KERNEL functions"]
462 echo [" using them are built only if the products are detected."]
463 summary $optional_products
466 htmldoc_products="doxygen_ok graphviz_ok rst2html_ok"
468 echo --- Html documentation products: only required for doc production
469 summary $htmldoc_products
473 echo "Default ORB : $DEFAULT_ORB"
476 dnl generals files which could be included in every makefile
478 AC_SUBST_FILE(COMMENCE) COMMENCE=salome_adm/unix/make_commence
479 AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude
480 AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
483 AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
485 dnl We don t need to say when we re entering directories if we re using
486 dnl GNU make becuase make does it for us.
487 if test "X$GMAKE" = "Xyes"; then
488 AC_SUBST(SETX) SETX=":"
490 AC_SUBST(SETX) SETX="set -x"
494 echo ---------------------------------------------
495 echo copying resource files, shell scripts, and
497 echo ---------------------------------------------
503 for i in `find $ROOT_SRCDIR/bin`
505 local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR/bin,.,"`
508 . | */CVS | */CVS/* | ./salome) ;;
509 ./appliskel |./appliskel/env.d) $INSTALL -d $local_bin ; echo $local_bin ;;
510 *) $INSTALL $i $local_bin; echo $local_bin ;;
516 echo ---------------------------------------------
517 echo generating Makefiles and configure files
518 echo ---------------------------------------------
521 AC_OUTPUT_COMMANDS([ \
523 chmod +x ./bin/salome/* \
526 # This list is initiated using autoscan and must be updated manually
527 # when adding a new file <filename>.in to manage. When you execute
528 # autoscan, the Makefile list is generated in the output file configure.scan.
529 # This could be helpfull to update de configuration.
532 ./salome_adm/unix/SALOMEconfig.ref \
533 ./salome_adm/Makefile \
534 ./salome_adm/unix/Makefile \
535 ./salome_adm/unix/config_files/Makefile \
541 ./doc/salome/Makefile \
542 ./doc/salome/tui/Makefile \
543 ./doc/salome/tui/INPUT/doxyuser:./doc/salome/tui/KERNEL/doxyuser.in \
544 ./doc/salome/tui/INPUT/doxydev:./doc/salome/tui/KERNEL/doxydev.in \
545 ./doc/salome/tui/INPUT/sources/static/tree.js:./doc/salome/tui/KERNEL/sources/static/tree.js.in \
547 ./resources/Makefile \
548 ./resources/KERNELCatalog.xml \
549 ./resources/CatalogResources.xml \
550 ./resources/DEPRECATED/Plugin \
552 ./src/Basics/Makefile \
553 ./src/Basics/Test/Makefile \
554 ./src/Batch/Makefile \
555 ./src/Batch_SWIG/Makefile \
556 ./src/CASCatch/Makefile \
557 ./src/Communication/Makefile \
558 ./src/Communication_SWIG/Makefile \
559 ./src/Container/Makefile \
560 ./src/ParallelContainer/Makefile \
563 ./src/DSC/DSC_Basic/Makefile \
564 ./src/DSC/DSC_User/Makefile \
565 ./src/DSC/DSC_User/Basic/Makefile \
566 ./src/DSC/DSC_User/Datastream/Makefile \
567 ./src/DSC/DSC_User/Datastream/Palm/Makefile \
568 ./src/DSC/DSC_User/Datastream/Calcium/Makefile \
569 ./src/DSC/ParallelDSC/Makefile \
570 ./src/DSC/DSC_Python/Makefile \
571 ./src/GenericObj/Makefile \
572 ./src/HDFPersist/Makefile \
573 ./src/KERNEL_PY/Makefile \
574 ./src/Launcher/Makefile \
575 ./src/LifeCycleCORBA/Makefile \
576 ./src/LifeCycleCORBA/Test/Makefile \
577 ./src/LifeCycleCORBA_SWIG/Makefile \
578 ./src/LifeCycleCORBA_SWIG/Test/Makefile \
579 ./src/Logger/Makefile \
580 ./src/Logger/Test/Makefile \
581 ./src/ModuleCatalog/Makefile \
582 ./src/ModuleGenerator/Makefile \
583 ./src/ModuleGenerator/testIDLparser \
584 ./src/MPIContainer/Makefile \
585 ./src/NamingService/Makefile \
586 ./src/NamingService/Test/Makefile \
587 ./src/Notification/Makefile \
588 ./src/NOTIFICATION_SWIG/Makefile \
589 ./src/Registry/Makefile \
590 ./src/ResourcesManager/Makefile \
591 ./src/SALOMEDS/Makefile \
592 ./src/SALOMEDS/Test/Makefile \
593 ./src/SALOMEDSClient/Makefile \
594 ./src/SALOMEDSImpl/Makefile \
595 ./src/SALOMEDSImpl/Test/Makefile \
596 ./src/SALOMELocalTrace/Makefile \
597 ./src/SALOMELocalTrace/Test/Makefile \
598 ./src/SALOMETraceCollector/Makefile \
599 ./src/SALOMETraceCollector/Test/Makefile \
600 ./src/TestContainer/Makefile \
601 ./src/TestMPIContainer/Makefile \
602 ./src/TOOLSDS/Makefile \
603 ./src/UnitTests/Makefile \
604 ./src/Utils/Makefile \
605 ./src/Utils/Test/Makefile \