2 # ================================================================
3 # Process this file with autoconf to produce a configure script
4 # ================================================================
8 AC_INIT([Salome2 Project], [3.2.0], [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])
27 echo ---------------------------------------------
28 echo Initialize source and build root directories
29 echo ---------------------------------------------
33 # This function return on stdout the absolute path of the filename in
35 # $ filename="../KERNEL_SRC/configure
36 # $ absfilename=`absolute_path $filename`
37 function absolute_path {
40 apath=`dirname $filename`
47 # Build directory, where the configure script is executed.
49 # Source directory, where the configure script is located.
50 ROOT_SRCDIR=`absolute_path $0`
53 AC_SUBST(ROOT_BUILDDIR)
56 echo Source root directory : $ROOT_SRCDIR
57 echo Build root directory : $ROOT_BUILDDIR
59 # ----------------------------------------------------------------------------
62 AC_ARG_ENABLE(corba_gen,
63 [AC_HELP_STRING([--enable-corba-gen],[Generate CORBA stuff [default=yes]])],
64 [case "${enableval}" in
65 yes) corba_gen=true ;;
66 no) corba_gen=false ;;
67 *) AC_MSG_ERROR(bad value ${enableval} for --enable-corba-gen) ;;
68 esac],[corba_gen=true])
69 AM_CONDITIONAL(CORBA_GEN, test x$corba_gen = xtrue)
71 # ----------------------------------------------------------------------------
75 echo ============================================================
76 echo testing general mandatory products - for all configurations
77 echo ============================================================
80 dnl Modification B. Secher portage sur osf
81 AC_CHECK_PROG(SHELL,sh)
84 if test -z "$AR"; then
85 AC_CHECK_PROGS(AR,ar xar,:,$PATH)
90 echo ---------------------------------------------
92 echo ---------------------------------------------
98 echo ---------------------------------------------
99 echo Configuring production
100 echo ---------------------------------------------
104 AC_DISABLE_PRODUCTION
107 echo ---------------------------------------------
109 echo ---------------------------------------------
112 dnl first, we set static to no!
113 dnl if we want it, use --enable-static
119 echo ---------------------------------------------
121 echo ---------------------------------------------
128 AC_CXX_TEMPLATE_OPTIONS
130 # AC_CC_WARNINGS([ansi])
134 AC_CHECK_LIB(dl,dlopen)
136 dnl Library librt : for alpha/osf
137 AC_CHECK_LIB(rt,nanosleep)
139 dnl add library libm :
142 # _CS_gbo We should add all dependent libraries
144 AC_CXX_USE_STD_IOSTREAM
152 echo ---------------------------------------------
154 echo ---------------------------------------------
160 echo ---------------------------------------------
162 echo ---------------------------------------------
168 echo ---------------------------------------------
170 echo ---------------------------------------------
173 dnl _CS_gbo We should use here a variable given from the CHECK_PYTHON
178 echo ---------------------------------------------
180 echo ---------------------------------------------
186 echo ---------------------------------------------
187 echo Testing OpenCascade
188 echo ---------------------------------------------
193 # ----------------------------------------------------------------------------
196 if test x$corba_gen = xtrue; then
199 echo ============================================================
200 echo testing mandatory products for CORBA configurations
201 echo ============================================================
205 dnl ---------------------------------------------
207 dnl ---------------------------------------------
213 echo ---------------------------------------------
214 echo Configuration of the ORB
215 echo ---------------------------------------------
218 echo Testing OMNIORB ...
221 echo Selecting the default ORB
223 echo DEFAULT_ORB : $DEFAULT_ORB
226 CORBA=salome_adm/unix/make_$ORB
230 # The CORBA variable defines the file name that
231 # implements the building rules to be included by Makefile to process
232 # idl files and CORBA specific dependencies (ex: the file
233 # salome_adm/unix/make_omniorb is the default for SALOME). The value
234 # of ORB is defined by CHECK_CORBA.
236 # Note that this checking process is no longer relevant for SALOME
237 # because the possibility of changing the ORB as a plugin is probably
238 # deprecated. The software configuration is clearly omniorb for CORBA
239 # communication. This could be simplify in a near futur.
242 echo ---------------------------------------------
244 echo ---------------------------------------------
246 # Qt must be kept because kernel makes use of qxml and some other
247 # non-graphical stuff.
251 echo ---------------------------------------------
253 echo ---------------------------------------------
260 # ----------------------------------------------------------------------------
263 echo ============================================================
264 echo testing optionnal products
265 echo ============================================================
269 echo ---------------------------------------------
270 echo checking if MPI is requested by user
271 echo ---------------------------------------------
277 echo ---------------------------------------------
279 echo ---------------------------------------------
282 dnl Several batch systems (OpenPBS, LSF, ...) can be operated using
283 dnl the Batch classes library integrated in the KERNEL module. The
284 dnl checking process tests here the presence of underlying batch
285 dnl softwares. If none is detected, the KERNEL is declared to be
292 dnl openpbs_ok is set to yes by CHECK_OPENPBS
298 dnl lsf_ok is set to yes by CHECK_LSF
301 echo testing Local batch system
302 echo --------------------------
305 dnl localbatch_ok is set to yes by CHECK_LOCAL
308 test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes
311 [AC_HELP_STRING([--enable-batch],[Batch [default=yes]])],
312 [case "${enableval}" in
313 yes) test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes;;
315 *) AC_MSG_ERROR(bad value ${enableval} for --enable-batch) ;;
316 esac],[test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes])
318 echo Batch mode = $WITH_BATCH
321 AM_CONDITIONAL(WITH_BATCH, [test x"$WITH_BATCH" = xyes])
324 echo ----------------------------------------------
325 echo testing CPPUNIT only required for unit testing
326 echo ----------------------------------------------
331 echo ============================================================
332 echo testing products required only for documentation generation
333 echo ============================================================
337 echo ---------------------------------------------
338 echo Testing html generators
339 echo ---------------------------------------------
342 CHECK_HTML_GENERATORS
345 echo ============================================================
347 echo ============================================================
350 # This function displays the values of each variable given in arguments
353 for var in $variables
356 if test x$toto != "x"; then
357 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
363 # --------------------------------------
365 function check_fatal_error {
367 for var in $variables
370 if test x$toto != "xyes"; then
371 echo "FATAL ERROR: some mandatory products are missing."
372 echo "Installing the missing products is required before running the configure script".
378 # --------------------------------------
380 if test x$corba_gen = xtrue; then
381 basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok occ_ok"
383 basic_mandatory_products="cc_ok threads_ok hdf5_ok occ_ok"
386 echo --- General mandatory products - Light configuration:
387 summary $basic_mandatory_products
388 check_fatal_error $basic_mandatory_products
391 corba_mandatory_products="omniORB_ok qt_ok boost_ok"
392 if test x$corba_gen = xtrue; then
393 echo --- CORBA mandatory products - default configuration:
394 summary $corba_mandatory_products
395 check_fatal_error $corba_mandatory_products
397 echo --- CORBA products not required - option --disable-corba-gen
398 if test x"$WITH_BATCH" = xyes; then
399 echo --- BATCH mode mandatory products - default configuration:
401 check_fatal_error "python_ok"
403 echo --- Python not required - option --enable-batch=no
408 if test x$MPIREQUESTED = xyes; then
409 requested_products="mpi_ok"
410 echo --- products requested by user
411 summary $requested_products
412 check_fatal_error $requested_products
416 optional_products="cppunit_ok openpbs_ok lsf_ok"
417 echo --- Optional products:
418 echo [" These products are optional because the KERNEL functions"]
419 echo [" using them are built only if the products are detected."]
420 summary $optional_products
423 htmldoc_products="doxygen_ok graphviz_ok rst2html_ok"
425 echo --- Html documentation products: only required for doc production
426 summary $htmldoc_products
430 echo "Default ORB : $DEFAULT_ORB"
433 dnl generals files which could be included in every makefile
435 AC_SUBST_FILE(COMMENCE) COMMENCE=salome_adm/unix/make_commence
436 AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude
437 AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
440 AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
442 dnl We don t need to say when we re entering directories if we re using
443 dnl GNU make becuase make does it for us.
444 if test "X$GMAKE" = "Xyes"; then
445 AC_SUBST(SETX) SETX=":"
447 AC_SUBST(SETX) SETX="set -x"
451 echo ---------------------------------------------
452 echo copying resource files, shell scripts, and
454 echo ---------------------------------------------
460 for i in `find $ROOT_SRCDIR/bin`
462 local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR/bin,.,"`
465 . | */CVS | */CVS/* | ./salome) ;;
466 ./appliskel |./appliskel/env.d) $INSTALL -d $local_bin ; echo $local_bin ;;
467 *) $INSTALL $i $local_bin; echo $local_bin ;;
473 echo ---------------------------------------------
474 echo generating Makefiles and configure files
475 echo ---------------------------------------------
478 AC_OUTPUT_COMMANDS([ \
480 chmod +x ./bin/salome/* \
483 # This list is initiated using autoscan and must be updated manually
484 # when adding a new file <filename>.in to manage. When you execute
485 # autoscan, the Makefile list is generated in the output file configure.scan.
486 # This could be helpfull to update de configuration.
489 ./salome_adm/unix/SALOMEconfig.ref \
490 ./salome_adm/Makefile \
491 ./salome_adm/unix/Makefile \
492 ./salome_adm/unix/config_files/Makefile \
498 ./doc/salome/Makefile \
499 ./doc/salome/tui/Makefile \
500 ./doc/salome/tui/INPUT/doxyuser:./doc/salome/tui/KERNEL/doxyuser.in \
501 ./doc/salome/tui/INPUT/doxydev:./doc/salome/tui/KERNEL/doxydev.in \
502 ./doc/salome/tui/INPUT/sources/static/tree.js:./doc/salome/tui/KERNEL/sources/static/tree.js.in \
504 ./resources/Makefile \
505 ./resources/KERNELCatalog.xml \
506 ./resources/CatalogResources.xml \
507 ./resources/DEPRECATED/Plugin \
509 ./src/Basics/Makefile \
510 ./src/Basics/Test/Makefile \
511 ./src/Batch/Makefile \
512 ./src/Batch_SWIG/Makefile \
513 ./src/CASCatch/Makefile \
514 ./src/Communication/Makefile \
515 ./src/Communication_SWIG/Makefile \
516 ./src/Container/Makefile \
517 ./src/GenericObj/Makefile \
518 ./src/HDFPersist/Makefile \
519 ./src/KERNEL_PY/Makefile \
520 ./src/LifeCycleCORBA/Makefile \
521 ./src/LifeCycleCORBA/Test/Makefile \
522 ./src/LifeCycleCORBA_SWIG/Makefile \
523 ./src/LifeCycleCORBA_SWIG/Test/Makefile \
524 ./src/Logger/Makefile \
525 ./src/Logger/Test/Makefile \
526 ./src/ModuleCatalog/Makefile \
527 ./src/ModuleGenerator/Makefile \
528 ./src/ModuleGenerator/testIDLparser \
529 ./src/MPIContainer/Makefile \
530 ./src/NamingService/Makefile \
531 ./src/NamingService/Test/Makefile \
532 ./src/Notification/Makefile \
533 ./src/NOTIFICATION_SWIG/Makefile \
534 ./src/Registry/Makefile \
535 ./src/ResourcesManager/Makefile \
536 ./src/SALOMEDS/Makefile \
537 ./src/SALOMEDS/Test/Makefile \
538 ./src/SALOMEDSClient/Makefile \
539 ./src/SALOMEDSImpl/Makefile \
540 ./src/SALOMEDSImpl/Test/Makefile \
541 ./src/SALOMELocalTrace/Makefile \
542 ./src/SALOMELocalTrace/Test/Makefile \
543 ./src/SALOMETraceCollector/Makefile \
544 ./src/SALOMETraceCollector/Test/Makefile \
545 ./src/TestContainer/Makefile \
546 ./src/TestMPIContainer/Makefile \
547 ./src/TOOLSDS/Makefile \
548 ./src/UnitTests/Makefile \
549 ./src/Utils/Makefile \
550 ./src/Utils/Test/Makefile \