2 # ================================================================
3 # Process this file with autoconf to produce a configure script
4 # ================================================================
8 AC_INIT([Salome2 Project], [3.1.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])
26 echo ---------------------------------------------
27 echo Initialize source and build root directories
28 echo ---------------------------------------------
32 # This function return on stdout the absolute path of the filename in
34 # $ filename="../KERNEL_SRC/configure
35 # $ absfilename=`absolute_path $filename`
36 function absolute_path {
39 apath=`dirname $filename`
46 # Build directory, where the configure script is executed.
48 # Source directory, where the configure script is located.
49 ROOT_SRCDIR=`absolute_path $0`
52 AC_SUBST(ROOT_BUILDDIR)
55 echo Source root directory : $ROOT_SRCDIR
56 echo Build root directory : $ROOT_BUILDDIR
58 # ----------------------------------------------------------------------------
61 AC_ARG_ENABLE(corba_gen,
62 [AC_HELP_STRING([--enable-corba-gen],[Generate CORBA stuff [default=yes]])],
63 [case "${enableval}" in
64 yes) corba_gen=true ;;
65 no) corba_gen=false ;;
66 *) AC_MSG_ERROR(bad value ${enableval} for --enable-corba-gen) ;;
67 esac],[corba_gen=true])
68 AM_CONDITIONAL(CORBA_GEN, test x$corba_gen = xtrue)
70 # ----------------------------------------------------------------------------
74 echo ============================================================
75 echo testing general mandatory products - for all configurations
76 echo ============================================================
79 dnl Modification B. Secher portage sur osf
80 AC_CHECK_PROG(SHELL,sh)
83 if test -z "$AR"; then
84 AC_CHECK_PROGS(AR,ar xar,:,$PATH)
89 echo ---------------------------------------------
91 echo ---------------------------------------------
97 echo ---------------------------------------------
98 echo Configuring production
99 echo ---------------------------------------------
103 AC_DISABLE_PRODUCTION
106 echo ---------------------------------------------
108 echo ---------------------------------------------
111 dnl first, we set static to no!
112 dnl if we want it, use --enable-static
118 echo ---------------------------------------------
120 echo ---------------------------------------------
127 AC_CXX_TEMPLATE_OPTIONS
129 # AC_CC_WARNINGS([ansi])
133 AC_CHECK_LIB(dl,dlopen)
135 dnl Library librt : for alpha/osf
136 AC_CHECK_LIB(rt,nanosleep)
138 dnl add library libm :
141 # _CS_gbo We should add all dependent libraries
143 AC_CXX_USE_STD_IOSTREAM
151 echo ---------------------------------------------
153 echo ---------------------------------------------
159 echo ---------------------------------------------
161 echo ---------------------------------------------
167 echo ---------------------------------------------
169 echo ---------------------------------------------
172 dnl _CS_gbo We should use here a variable given from the CHECK_PYTHON
177 echo ---------------------------------------------
179 echo ---------------------------------------------
185 echo ---------------------------------------------
186 echo Testing OpenCascade
187 echo ---------------------------------------------
192 # ----------------------------------------------------------------------------
195 if test x$corba_gen = xtrue; then
198 echo ============================================================
199 echo testing mandatory products for CORBA configurations
200 echo ============================================================
204 dnl ---------------------------------------------
206 dnl ---------------------------------------------
212 echo ---------------------------------------------
213 echo Configuration of the ORB
214 echo ---------------------------------------------
217 echo Testing OMNIORB ...
220 echo Selecting the default ORB
222 echo DEFAULT_ORB : $DEFAULT_ORB
225 CORBA=salome_adm/unix/make_$ORB
229 # The CORBA variable defines the file name that
230 # implements the building rules to be included by Makefile to process
231 # idl files and CORBA specific dependencies (ex: the file
232 # salome_adm/unix/make_omniorb is the default for SALOME). The value
233 # of ORB is defined by CHECK_CORBA.
235 # Note that this checking process is no longer relevant for SALOME
236 # because the possibility of changing the ORB as a plugin is probably
237 # deprecated. The software configuration is clearly omniorb for CORBA
238 # communication. This could be simplify in a near futur.
241 echo ---------------------------------------------
243 echo ---------------------------------------------
245 # Qt must be kept because kernel makes use of qxml and some other
246 # non-graphical stuff.
250 echo ---------------------------------------------
252 echo ---------------------------------------------
259 # ----------------------------------------------------------------------------
262 echo ============================================================
263 echo testing optionnal products
264 echo ============================================================
268 echo ---------------------------------------------
269 echo checking if MPI is requested by user
270 echo ---------------------------------------------
276 echo ---------------------------------------------
278 echo ---------------------------------------------
281 dnl Several batch systems (OpenPBS, LSF, ...) can be operated using
282 dnl the Batch classes library integrated in the KERNEL module. The
283 dnl checking process tests here the presence of underlying batch
284 dnl softwares. If none is detected, the KERNEL is declared to be
291 dnl openpbs_ok is set to yes by CHECK_OPENPBS
297 dnl lsf_ok is set to yes by CHECK_LSF
300 echo testing Local batch system
301 echo --------------------------
304 dnl localbatch_ok is set to yes by CHECK_LOCAL
307 test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes
309 AM_CONDITIONAL(WITH_BATCH, [test x"$WITH_BATCH" = xyes])
312 echo ----------------------------------------------
313 echo testing CPPUNIT only required for unit testing
314 echo ----------------------------------------------
319 echo ============================================================
320 echo testing products required only for documentation generation
321 echo ============================================================
325 echo ---------------------------------------------
326 echo Testing html generators
327 echo ---------------------------------------------
330 CHECK_HTML_GENERATORS
333 echo ============================================================
335 echo ============================================================
338 # This function displays the values of each variable given in arguments
341 for var in $variables
344 if test x$toto != "x"; then
345 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
351 # --------------------------------------
353 function check_fatal_error {
355 for var in $variables
358 if test x$toto != "xyes"; then
359 echo "FATAL ERROR: some mandatory products are missing."
360 echo "Installing the missing products is required before running the configure script".
366 # --------------------------------------
368 basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok occ_ok"
369 echo --- General mandatory products - Light configuration:
370 summary $basic_mandatory_products
371 check_fatal_error $basic_mandatory_products
374 corba_mandatory_products="omniORB_ok qt_ok boost_ok"
375 if test x$corba_gen = xtrue; then
376 echo --- CORBA mandatory products - default configuration:
377 summary $corba_mandatory_products
378 check_fatal_error $corba_mandatory_products
380 echo --- CORBA products not required - option --disable-corba-gen
384 if test x$MPIREQUESTED = xyes; then
385 requested_products="mpi_ok"
386 echo --- products requested by user
387 summary $requested_products
388 check_fatal_error $requested_products
392 optional_products="cppunit_ok openpbs_ok lsf_ok"
393 echo --- Optional products:
394 echo [" These products are optional because the KERNEL functions"]
395 echo [" using them are built only if the products are detected."]
396 summary $optional_products
399 htmldoc_products="doxygen_ok graphviz_ok rst2html_ok"
401 echo --- Html documentation products: only required for doc production
402 summary $htmldoc_products
406 echo "Default ORB : $DEFAULT_ORB"
409 dnl generals files which could be included in every makefile
411 AC_SUBST_FILE(COMMENCE) COMMENCE=salome_adm/unix/make_commence
412 AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude
413 AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
416 AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
418 dnl We don t need to say when we re entering directories if we re using
419 dnl GNU make becuase make does it for us.
420 if test "X$GMAKE" = "Xyes"; then
421 AC_SUBST(SETX) SETX=":"
423 AC_SUBST(SETX) SETX="set -x"
427 echo ---------------------------------------------
428 echo copying resource files, shell scripts, and
430 echo ---------------------------------------------
436 for i in `find $ROOT_SRCDIR/bin`
438 local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR/bin,.,"`
441 . | */CVS | */CVS/* | ./salome) ;;
442 ./appliskel |./appliskel/env.d) $INSTALL -d $local_bin ; echo $local_bin ;;
443 *) $INSTALL $i $local_bin; echo $local_bin ;;
449 echo ---------------------------------------------
450 echo generating Makefiles and configure files
451 echo ---------------------------------------------
454 AC_OUTPUT_COMMANDS([ \
456 chmod +x ./bin/salome/* \
459 # This list is initiated using autoscan and must be updated manually
460 # when adding a new file <filename>.in to manage. When you execute
461 # autoscan, the Makefile list is generated in the output file configure.scan.
462 # This could be helpfull to update de configuration.
464 ./salome_adm/unix/SALOMEconfig.h \
465 ./salome_adm/Makefile \
466 ./salome_adm/unix/Makefile \
467 ./salome_adm/unix/config_files/Makefile \
472 ./doc/salome/Makefile \
473 ./doc/salome/DevelopersGuide/DevelopersGuide.tex \
474 ./doc/salome/DevelopersGuide/Makefile \
475 ./doc/salome/gui/Makefile \
476 ./doc/salome/tui/Makefile \
478 ./resources/Makefile \
480 ./src/Basics/Makefile \
481 ./src/Basics/Test/Makefile \
482 ./src/Batch/Makefile \
483 ./src/Batch_SWIG/Makefile \
484 ./src/CASCatch/Makefile \
485 ./src/Communication/Makefile \
486 ./src/Communication_SWIG/Makefile \
487 ./src/Container/Makefile \
488 ./src/DataTypeCatalog/Makefile \
489 ./src/GenericObj/Makefile \
490 ./src/HDFPersist/Makefile \
491 ./src/KERNEL_PY/Makefile \
492 ./src/LifeCycleCORBA/Makefile \
493 ./src/LifeCycleCORBA/Test/Makefile \
494 ./src/LifeCycleCORBA_SWIG/Makefile \
495 ./src/Logger/Makefile \
496 ./src/Logger/Test/Makefile \
497 ./src/ModuleCatalog/Makefile \
498 ./src/ModuleGenerator/Makefile \
499 ./src/ModuleGenerator/testIDLparser \
500 ./src/MPIContainer/Makefile \
501 ./src/NamingService/Makefile \
502 ./src/NamingService/Test/Makefile \
503 ./src/Notification/Makefile \
504 ./src/NOTIFICATION_SWIG/Makefile \
505 ./src/Registry/Makefile \
506 ./src/ResourcesManager/Makefile \
507 ./src/RessourcesCatalog/Makefile \
508 ./src/SALOMEDS/Makefile \
509 ./src/SALOMEDS/Test/Makefile \
510 ./src/SALOMEDSClient/Makefile \
511 ./src/SALOMEDSImpl/Makefile \
512 ./src/SALOMEDSImpl/Test/Makefile \
513 ./src/SALOMELocalTrace/Makefile \
514 ./src/SALOMELocalTrace/Test/Makefile \
515 ./src/SALOMETraceCollector/Makefile \
516 ./src/SALOMETraceCollector/Test/Makefile \
517 ./src/TestContainer/Makefile \
518 ./src/TestMPIContainer/Makefile \
519 ./src/TOOLSDS/Makefile \
520 ./src/UnitTests/Makefile \
521 ./src/Utils/Makefile \
522 ./src/Utils/Test/Makefile \