2 # ================================================================
3 # Process this file with autoconf to produce a configure script
4 # ================================================================
8 AC_INIT([Salome2 Project], [3.2.2], [gboulant@CS], [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)
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_DISABLE_PRODUCTION
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 ---------------------------------------------
250 # Qt must be kept because kernel makes use of qxml and some other
251 # non-graphical stuff.
255 echo ---------------------------------------------
257 echo ---------------------------------------------
264 # ----------------------------------------------------------------------------
267 echo ============================================================
268 echo testing optionnal products
269 echo ============================================================
273 echo ---------------------------------------------
274 echo checking if MPI is requested by user
275 echo ---------------------------------------------
281 echo ---------------------------------------------
283 echo ---------------------------------------------
286 dnl Several batch systems (OpenPBS, LSF, ...) can be operated using
287 dnl the Batch classes library integrated in the KERNEL module. The
288 dnl checking process tests here the presence of underlying batch
289 dnl softwares. If none is detected, the KERNEL is declared to be
296 dnl openpbs_ok is set to yes by CHECK_OPENPBS
302 dnl lsf_ok is set to yes by CHECK_LSF
305 echo testing Local batch system
306 echo --------------------------
309 dnl localbatch_ok is set to yes by CHECK_LOCAL
312 test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes
315 [AC_HELP_STRING([--enable-batch],[Batch [default=yes]])],
316 [case "${enableval}" in
317 yes) test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes;;
319 *) AC_MSG_ERROR(bad value ${enableval} for --enable-batch) ;;
320 esac],[test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes])
322 echo Batch mode = $WITH_BATCH
325 AM_CONDITIONAL(WITH_BATCH, [test x"$WITH_BATCH" = xyes])
328 echo ----------------------------------------------
329 echo testing CPPUNIT only required for unit testing
330 echo ----------------------------------------------
335 echo ============================================================
336 echo testing products required only for documentation generation
337 echo ============================================================
341 echo ---------------------------------------------
342 echo Testing html generators
343 echo ---------------------------------------------
346 CHECK_HTML_GENERATORS
349 echo ============================================================
351 echo ============================================================
354 # This function displays the values of each variable given in arguments
357 for var in $variables
360 if test x$toto != "x"; then
361 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
367 # --------------------------------------
369 function check_fatal_error {
371 for var in $variables
374 if test x$toto != "xyes"; then
375 echo "FATAL ERROR: some mandatory products are missing."
376 echo "Installing the missing products is required before running the configure script".
382 # --------------------------------------
384 if test x$corba_gen = xtrue; then
385 basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok occ_ok"
387 basic_mandatory_products="cc_ok threads_ok hdf5_ok occ_ok"
390 echo --- General mandatory products - Light configuration:
391 summary $basic_mandatory_products
392 check_fatal_error $basic_mandatory_products
395 corba_mandatory_products="omniORB_ok qt_ok boost_ok"
396 if test x$corba_gen = xtrue; then
397 echo --- CORBA mandatory products - default configuration:
398 summary $corba_mandatory_products
399 check_fatal_error $corba_mandatory_products
401 echo --- CORBA products not required - option --disable-corba-gen
402 if test x"$WITH_BATCH" = xyes; then
403 echo --- BATCH mode mandatory products - default configuration:
405 check_fatal_error "python_ok"
407 echo --- Python not required - option --enable-batch=no
412 if test x$MPIREQUESTED = xyes; then
413 requested_products="mpi_ok"
414 echo --- products requested by user
415 summary $requested_products
416 check_fatal_error $requested_products
420 optional_products="cppunit_ok openpbs_ok lsf_ok"
421 echo --- Optional products:
422 echo [" These products are optional because the KERNEL functions"]
423 echo [" using them are built only if the products are detected."]
424 summary $optional_products
427 htmldoc_products="doxygen_ok graphviz_ok rst2html_ok"
429 echo --- Html documentation products: only required for doc production
430 summary $htmldoc_products
434 echo "Default ORB : $DEFAULT_ORB"
437 dnl generals files which could be included in every makefile
439 AC_SUBST_FILE(COMMENCE) COMMENCE=salome_adm/unix/make_commence
440 AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude
441 AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
444 AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
446 dnl We don t need to say when we re entering directories if we re using
447 dnl GNU make becuase make does it for us.
448 if test "X$GMAKE" = "Xyes"; then
449 AC_SUBST(SETX) SETX=":"
451 AC_SUBST(SETX) SETX="set -x"
455 echo ---------------------------------------------
456 echo copying resource files, shell scripts, and
458 echo ---------------------------------------------
464 for i in `find $ROOT_SRCDIR/bin`
466 local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR/bin,.,"`
469 . | */CVS | */CVS/* | ./salome) ;;
470 ./appliskel |./appliskel/env.d) $INSTALL -d $local_bin ; echo $local_bin ;;
471 *) $INSTALL $i $local_bin; echo $local_bin ;;
477 echo ---------------------------------------------
478 echo generating Makefiles and configure files
479 echo ---------------------------------------------
482 AC_OUTPUT_COMMANDS([ \
484 chmod +x ./bin/salome/* \
487 # This list is initiated using autoscan and must be updated manually
488 # when adding a new file <filename>.in to manage. When you execute
489 # autoscan, the Makefile list is generated in the output file configure.scan.
490 # This could be helpfull to update de configuration.
493 ./salome_adm/unix/SALOMEconfig.ref \
494 ./salome_adm/Makefile \
495 ./salome_adm/unix/Makefile \
496 ./salome_adm/unix/config_files/Makefile \
502 ./doc/salome/Makefile \
503 ./doc/salome/tui/Makefile \
504 ./doc/salome/tui/INPUT/doxyuser:./doc/salome/tui/KERNEL/doxyuser.in \
505 ./doc/salome/tui/INPUT/doxydev:./doc/salome/tui/KERNEL/doxydev.in \
506 ./doc/salome/tui/INPUT/sources/static/tree.js:./doc/salome/tui/KERNEL/sources/static/tree.js.in \
508 ./resources/Makefile \
509 ./resources/KERNELCatalog.xml \
510 ./resources/CatalogResources.xml \
511 ./resources/DEPRECATED/Plugin \
513 ./src/Basics/Makefile \
514 ./src/Basics/Test/Makefile \
515 ./src/Batch/Makefile \
516 ./src/Batch_SWIG/Makefile \
517 ./src/CASCatch/Makefile \
518 ./src/Communication/Makefile \
519 ./src/Communication_SWIG/Makefile \
520 ./src/Container/Makefile \
522 ./src/DSC/DSC_Basic/Makefile \
523 ./src/DSC/DSC_User/Makefile \
524 ./src/GenericObj/Makefile \
525 ./src/HDFPersist/Makefile \
526 ./src/KERNEL_PY/Makefile \
527 ./src/LifeCycleCORBA/Makefile \
528 ./src/LifeCycleCORBA/Test/Makefile \
529 ./src/LifeCycleCORBA_SWIG/Makefile \
530 ./src/LifeCycleCORBA_SWIG/Test/Makefile \
531 ./src/Logger/Makefile \
532 ./src/Logger/Test/Makefile \
533 ./src/ModuleCatalog/Makefile \
534 ./src/ModuleGenerator/Makefile \
535 ./src/ModuleGenerator/testIDLparser \
536 ./src/MPIContainer/Makefile \
537 ./src/NamingService/Makefile \
538 ./src/NamingService/Test/Makefile \
539 ./src/Notification/Makefile \
540 ./src/NOTIFICATION_SWIG/Makefile \
541 ./src/Registry/Makefile \
542 ./src/ResourcesManager/Makefile \
543 ./src/SALOMEDS/Makefile \
544 ./src/SALOMEDS/Test/Makefile \
545 ./src/SALOMEDSClient/Makefile \
546 ./src/SALOMEDSImpl/Makefile \
547 ./src/SALOMEDSImpl/Test/Makefile \
548 ./src/SALOMELocalTrace/Makefile \
549 ./src/SALOMELocalTrace/Test/Makefile \
550 ./src/SALOMETraceCollector/Makefile \
551 ./src/SALOMETraceCollector/Test/Makefile \
552 ./src/TestContainer/Makefile \
553 ./src/TestMPIContainer/Makefile \
554 ./src/TOOLSDS/Makefile \
555 ./src/UnitTests/Makefile \
556 ./src/Utils/Makefile \
557 ./src/Utils/Test/Makefile \