1 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # ================================================================
23 # Process this file with autoconf to produce a configure script
24 # ================================================================
27 AC_INIT([Salome2 Project], [5.1.1], [paul.rascle@edf.fr], [SalomeKERNEL])
29 # AC_CONFIG_AUX_DIR defines an alternative directory where to find the auxiliary
30 # scripts such as config.guess, install-sh, ...
31 AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
34 AM_INIT_AUTOMAKE([tar-pax])
35 #AC_CONFIG_HEADER([config.h])
37 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
40 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
45 echo ---------------------------------------------
46 echo Initialize source and build root directories
47 echo ---------------------------------------------
51 # This function return on stdout the absolute path of the filename in
53 # $ filename="../KERNEL_SRC/configure
54 # $ absfilename=`absolute_path $filename`
55 function absolute_path {
58 apath=`dirname $filename`
65 # Build directory, where the configure script is executed.
67 # Source directory, where the configure script is located.
68 ROOT_SRCDIR=`absolute_path $0`
71 AC_SUBST(ROOT_BUILDDIR)
74 echo Source root directory : $ROOT_SRCDIR
75 echo Build root directory : $ROOT_BUILDDIR
77 # ----------------------------------------------------------------------------
80 AC_ARG_ENABLE(corba_gen,
81 [AC_HELP_STRING([--enable-corba-gen],[Generate CORBA stuff [default=yes]])],
82 [case "${enableval}" in
83 yes) corba_gen=true ;;
84 no) corba_gen=false ;;
85 *) AC_MSG_ERROR(bad value ${enableval} for --enable-corba-gen) ;;
86 esac],[corba_gen=true])
87 AM_CONDITIONAL(CORBA_GEN, test x$corba_gen = xtrue)
89 # ---- option to build only launcher, resources manager and batch classes
90 AC_ARG_WITH(onlylauncher,
91 [AC_HELP_STRING([--with-onlylauncher],[Build only launcher, resources manager and batch classes [default=no]])],
93 [with_onlylauncher="no"])
94 AM_CONDITIONAL(WITHONLYLAUNCHER, test x$with_onlylauncher = xyes)
96 # ----------------------------------------------------------------------------
100 echo ============================================================
101 echo testing general mandatory products - for all configurations
102 echo ============================================================
105 dnl Modification B. Secher portage sur osf
106 AC_CHECK_PROG(SHELL,sh)
109 if test -z "$AR"; then
110 AC_CHECK_PROGS(AR,ar xar,:,$PATH)
115 echo ---------------------------------------------
117 echo ---------------------------------------------
123 echo ---------------------------------------------
124 echo Configuring production
125 echo ---------------------------------------------
129 AC_ENABLE_PRODUCTION(no)
130 AC_ENABLE_MPI_SEQ_CONTAINER(no)
133 echo ---------------------------------------------
135 echo ---------------------------------------------
138 dnl first, we set static to no!
139 dnl if we want it, use --enable-static
145 echo ---------------------------------------------
147 echo ---------------------------------------------
154 AC_CXX_TEMPLATE_OPTIONS
156 # AC_CC_WARNINGS([ansi])
160 AC_CHECK_LIB(dl,dlopen)
162 dnl Library librt : for alpha/osf
163 AC_CHECK_LIB(rt,nanosleep)
165 dnl add library libm :
168 # _CS_gbo We should add all dependent libraries
170 AC_CXX_USE_STD_IOSTREAM
178 echo ---------------------------------------------
180 echo ---------------------------------------------
186 echo ---------------------------------------------
188 echo ---------------------------------------------
194 echo ---------------------------------------------
196 echo ---------------------------------------------
199 dnl _CS_gbo We should use here a variable given from the CHECK_PYTHON
204 echo ---------------------------------------------
206 echo ---------------------------------------------
211 if test x$with_onlylauncher = xno; then
213 echo ---------------------------------------------
215 echo ---------------------------------------------
220 # ----------------------------------------------------------------------------
223 if test x$corba_gen = xtrue; then
226 echo ============================================================
227 echo testing mandatory products for CORBA configurations
228 echo ============================================================
232 dnl ---------------------------------------------
234 dnl ---------------------------------------------
240 echo ---------------------------------------------
241 echo Configuration of the ORB
242 echo ---------------------------------------------
245 echo Testing OMNIORB ...
248 echo Selecting the default ORB
250 echo DEFAULT_ORB : $DEFAULT_ORB
253 CORBA=salome_adm/unix/make_$ORB
257 # The CORBA variable defines the file name that
258 # implements the building rules to be included by Makefile to process
259 # idl files and CORBA specific dependencies (ex: the file
260 # salome_adm/unix/make_omniorb is the default for SALOME). The value
261 # of ORB is defined by CHECK_CORBA.
263 # Note that this checking process is no longer relevant for SALOME
264 # because the possibility of changing the ORB as a plugin is probably
265 # deprecated. The software configuration is clearly omniorb for CORBA
266 # communication. This could be simplify in a near futur.
269 echo ---------------------------------------------
271 echo ---------------------------------------------
278 # ----------------------------------------------------------------------------
281 # --- end test ONLYLAUNCHER
282 # ----------------------------------------------------------------------------
285 echo ============================================================
286 echo testing parallel products
287 echo ============================================================
291 echo ---------------------------------------------
292 echo checking if MPI is requested by user
293 echo ---------------------------------------------
299 echo ---------------------------------------------
300 echo checking if PaCO++ is requested by user
301 echo ---------------------------------------------
307 echo ------------------------------------------------------------
308 echo checking if parallel kernel extensions are requested by user
309 echo ------------------------------------------------------------
312 AC_MSG_CHECKING(whether to enable parallel kernel extension)
313 AC_ARG_ENABLE(parallel_extension,
314 AC_HELP_STRING([--enable-parallel_extension], [parallel kernel extension = [no/yes] (default is no)]),
315 parallel_extension_ok=$enableval,
316 parallel_extension_ok=no)
317 if test "x$parallel_extension_ok" = "xyes"
319 if test "x$PaCO_ok" = "xno"
321 parallel_extension_ok=no
325 if test "x$parallel_extension_ok" = "xyes"
332 AM_CONDITIONAL([WITH_PACO_PARALLEL], [test "x$parallel_extension_ok" = "xyes"])
335 echo ============================================================
336 echo testing optionnal products
337 echo ============================================================
341 echo ---------------------------------------------
343 echo ---------------------------------------------
346 dnl Several batch systems (OpenPBS, LSF, ...) can be operated using
347 dnl the Batch classes library integrated in the KERNEL module. The
348 dnl checking process tests here the presence of underlying batch
349 dnl softwares. If none is detected, the KERNEL is declared to be
356 dnl openpbs_ok is set to yes by CHECK_OPENPBS
362 dnl lsf_ok is set to yes by CHECK_LSF
365 echo testing Local batch system
366 echo --------------------------
369 dnl localbatch_ok is set to yes by CHECK_LOCAL
372 test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes
375 [AC_HELP_STRING([--enable-batch],[Batch [default=yes]])],
376 [case "${enableval}" in
377 yes) test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes;;
379 *) AC_MSG_ERROR(bad value ${enableval} for --enable-batch) ;;
380 esac],[test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes])
382 echo Batch mode = $WITH_BATCH
385 AM_CONDITIONAL(WITH_BATCH, [test x"$WITH_BATCH" = xyes])
388 echo ----------------------------------------------
389 echo testing CPPUNIT only required for unit testing
390 echo ----------------------------------------------
395 echo ============================================================
396 echo testing products required only for documentation generation
397 echo ============================================================
401 echo ---------------------------------------------
402 echo Testing html generators
403 echo ---------------------------------------------
406 CHECK_HTML_GENERATORS
408 # Additional conditional to avoid compilation of non-portable code
409 AM_CONDITIONAL(WINDOWS, 0)
412 echo ============================================================
414 echo ============================================================
417 # This function displays the values of each variable given in arguments
420 for var in $variables
423 if test x$toto != "x"; then
424 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
430 # --------------------------------------
432 function check_fatal_error {
434 for var in $variables
437 if test x$toto != "xyes"; then
438 echo "FATAL ERROR: some mandatory products are missing."
439 echo "Installing the missing products is required before running the configure script".
445 # --------------------------------------
447 if test x$with_onlylauncher = xno; then
448 if test x$corba_gen = xtrue; then
449 basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok libxml_ok"
451 basic_mandatory_products="cc_ok threads_ok hdf5_ok libxml_ok"
454 basic_mandatory_products="cc_ok threads_ok libxml_ok"
457 echo --- General mandatory products - Light configuration:
458 summary $basic_mandatory_products
459 check_fatal_error $basic_mandatory_products
462 if test x$with_onlylauncher = xno; then
463 corba_mandatory_products="omniORB_ok omniORBpy_ok boost_ok"
464 if test x$corba_gen = xtrue; then
465 echo --- CORBA mandatory products - default configuration:
466 summary $corba_mandatory_products
467 check_fatal_error $corba_mandatory_products
469 echo --- CORBA products not required - option --disable-corba-gen
470 if test x"$WITH_BATCH" = xyes; then
471 echo --- BATCH mode mandatory products - default configuration:
473 check_fatal_error "python_ok"
475 echo --- Python not required - option --enable-batch=no
481 parallel_products="mpi_ok PaCO_ok parallel_extension_ok"
482 echo --- Kernel parallel extensions:
483 summary $parallel_products
486 optional_products="cppunit_ok openpbs_ok lsf_ok numpy_ok"
487 echo --- Optional products:
488 echo [" These products are optional because the KERNEL functions"]
489 echo [" using them are built only if the products are detected."]
490 summary $optional_products
493 htmldoc_products="doxygen_ok graphviz_ok rst2html_ok"
495 echo --- Html documentation products: only required for doc production
496 summary $htmldoc_products
499 if test x$with_onlylauncher = xno; then
501 echo "Default ORB : $DEFAULT_ORB"
505 dnl generals files which could be included in every makefile
507 AC_SUBST_FILE(COMMENCE) COMMENCE=salome_adm/unix/make_commence
508 AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude
509 AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
512 AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
514 dnl We don t need to say when we re entering directories if we re using
515 dnl GNU make becuase make does it for us.
516 if test "X$GMAKE" = "Xyes"; then
517 AC_SUBST(SETX) SETX=":"
519 AC_SUBST(SETX) SETX="set -x"
523 echo ---------------------------------------------
524 echo generating Makefiles and configure files
525 echo ---------------------------------------------
528 # This list is initiated using autoscan and must be updated manually
529 # when adding a new file <filename>.in to manage. When you execute
530 # autoscan, the Makefile list is generated in the output file configure.scan.
531 # This could be helpfull to update de configuration.
534 ./salome_adm/unix/SALOMEconfig.ref \
535 ./salome_adm/Makefile \
536 ./salome_adm/cmake_files/Makefile \
537 ./salome_adm/unix/Makefile \
538 ./salome_adm/unix/config_files/Makefile \
543 ./doc/salome/Makefile \
544 ./doc/salome/tui/Makefile \
545 ./doc/salome/tui/doxyfile \
546 ./doc/salome/gui/Makefile \
547 ./doc/salome/gui/doxyfile \
549 ./resources/Makefile \
550 ./resources/KERNELCatalog.xml \
551 ./resources/CatalogResources.xml \
553 ./src/Basics/Makefile \
554 ./src/Basics/Test/Makefile \
555 ./src/Batch/Makefile \
556 ./src/Batch_SWIG/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 \