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.3], [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 -Wno-portability])
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 and resources manager
90 AC_ARG_WITH(onlylauncher,
91 [AC_HELP_STRING([--with-onlylauncher],[Build only launcher and resources manager [default=no]])],
93 [with_onlylauncher="no"])
94 AM_CONDITIONAL(WITHONLYLAUNCHER, test x$with_onlylauncher = xyes)
95 if test "$with_onlylauncher" != "yes"; then
96 AC_DEFINE([HAVE_SALOME_CONFIG], [], [True if SALOMEconfig.h file is used])
99 # ----------------------------------------------------------------------------
103 echo ============================================================
104 echo testing general mandatory products - for all configurations
105 echo ============================================================
108 dnl Modification B. Secher portage sur osf
109 AC_CHECK_PROG(SHELL,sh)
112 if test -z "$AR"; then
113 AC_CHECK_PROGS(AR,ar xar,:,$PATH)
118 echo ---------------------------------------------
120 echo ---------------------------------------------
127 echo ---------------------------------------------
128 echo Configuring production
129 echo ---------------------------------------------
133 AC_ENABLE_PRODUCTION(no)
134 AC_ENABLE_MPI_SEQ_CONTAINER(no)
137 echo ---------------------------------------------
139 echo ---------------------------------------------
142 dnl first, we set static to no!
143 dnl if we want it, use --enable-static
149 echo ---------------------------------------------
151 echo ---------------------------------------------
159 AC_CXX_TEMPLATE_OPTIONS
161 # AC_CC_WARNINGS([ansi])
165 AC_CHECK_LIB(dl,dlopen)
167 dnl Library librt : for alpha/osf
168 AC_CHECK_LIB(rt,nanosleep)
170 dnl add library libm :
173 # _CS_gbo We should add all dependent libraries
175 AC_CXX_USE_STD_IOSTREAM
183 echo ---------------------------------------------
184 echo testing Fortran INTEGER size for CALCIUM
185 echo ---------------------------------------------
191 echo ---------------------------------------------
193 echo ---------------------------------------------
199 echo ---------------------------------------------
201 echo ---------------------------------------------
207 echo ---------------------------------------------
209 echo ---------------------------------------------
212 dnl _CS_gbo We should use here a variable given from the CHECK_PYTHON
217 echo ---------------------------------------------
219 echo ---------------------------------------------
224 if test x$with_onlylauncher = xno; then
226 echo ---------------------------------------------
228 echo ---------------------------------------------
233 # ----------------------------------------------------------------------------
236 if test x$corba_gen = xtrue; then
239 echo ============================================================
240 echo testing mandatory products for CORBA configurations
241 echo ============================================================
245 dnl ---------------------------------------------
247 dnl ---------------------------------------------
253 echo ---------------------------------------------
254 echo Configuration of the ORB
255 echo ---------------------------------------------
258 echo Testing OMNIORB ...
261 echo Selecting the default ORB
263 echo DEFAULT_ORB : $DEFAULT_ORB
266 CORBA=salome_adm/unix/make_$ORB
270 # The CORBA variable defines the file name that
271 # implements the building rules to be included by Makefile to process
272 # idl files and CORBA specific dependencies (ex: the file
273 # salome_adm/unix/make_omniorb is the default for SALOME). The value
274 # of ORB is defined by CHECK_CORBA.
276 # Note that this checking process is no longer relevant for SALOME
277 # because the possibility of changing the ORB as a plugin is probably
278 # deprecated. The software configuration is clearly omniorb for CORBA
279 # communication. This could be simplify in a near futur.
282 echo ---------------------------------------------
284 echo ---------------------------------------------
291 # ----------------------------------------------------------------------------
294 # --- end test ONLYLAUNCHER
295 # ----------------------------------------------------------------------------
298 echo ============================================================
299 echo testing parallel products
300 echo ============================================================
304 echo ---------------------------------------------
305 echo checking if MPI is requested by user
306 echo ---------------------------------------------
312 echo ---------------------------------------------
313 echo checking if PaCO++ is requested by user
314 echo ---------------------------------------------
320 echo ------------------------------------------------------------
321 echo checking if parallel kernel extensions are requested by user
322 echo ------------------------------------------------------------
325 AC_MSG_CHECKING(whether to enable parallel kernel extension)
326 AC_ARG_ENABLE(parallel_extension,
327 AC_HELP_STRING([--enable-parallel_extension], [parallel kernel extension = [no/yes] (default is no)]),
328 parallel_extension_ok=$enableval,
329 parallel_extension_ok=no)
330 if test "x$parallel_extension_ok" = "xyes"
332 if test "x$PaCO_ok" = "xno"
334 parallel_extension_ok=no
338 if test "x$parallel_extension_ok" = "xyes"
345 AM_CONDITIONAL([WITH_PACO_PARALLEL], [test "x$parallel_extension_ok" = "xyes"])
348 echo ============================================================
349 echo testing optionnal products
350 echo ============================================================
354 echo ----------------------------------------------
355 echo testing CPPUNIT only required for unit testing
356 echo ----------------------------------------------
361 echo --------------------------------------------------------------
362 echo Testing libBatch only required for batch functions in Launcher
363 echo --------------------------------------------------------------
367 AM_CONDITIONAL(WITH_LIBBATCH, [test x"$libbatch_ok" = xyes])
370 echo ============================================================
371 echo testing products required only for documentation generation
372 echo ============================================================
376 echo ---------------------------------------------
377 echo Testing html generators
378 echo ---------------------------------------------
381 CHECK_HTML_GENERATORS
383 # Additional conditional to avoid compilation of non-portable code
384 AM_CONDITIONAL(WINDOWS, [ test ])
387 echo ============================================================
389 echo ============================================================
392 # This function displays the values of each variable given in arguments
395 for var in $variables
398 if test x$toto != "x"; then
399 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
405 # --------------------------------------
407 function check_fatal_error {
409 for var in $variables
412 if test x$toto != "xyes"; then
413 echo "FATAL ERROR: some mandatory products are missing."
414 echo "Installing the missing products is required before running the configure script".
420 # --------------------------------------
422 if test x$with_onlylauncher = xno; then
423 if test x$corba_gen = xtrue; then
424 basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok libxml_ok"
426 basic_mandatory_products="cc_ok threads_ok hdf5_ok libxml_ok"
429 basic_mandatory_products="cc_ok threads_ok libxml_ok"
432 echo --- General mandatory products - Light configuration:
433 summary $basic_mandatory_products
434 check_fatal_error $basic_mandatory_products
437 if test x$with_onlylauncher = xno; then
438 corba_mandatory_products="omniORB_ok omniORBpy_ok boost_ok"
439 if test x$corba_gen = xtrue; then
440 echo --- CORBA mandatory products - default configuration:
441 summary $corba_mandatory_products
442 check_fatal_error $corba_mandatory_products
444 echo --- CORBA products not required - option --disable-corba-gen
449 parallel_products="mpi_ok PaCO_ok parallel_extension_ok"
450 echo --- Kernel parallel extensions:
451 summary $parallel_products
454 optional_products="cppunit_ok numpy_ok libbatch_ok"
455 echo --- Optional products:
456 echo [" These products are optional because the KERNEL functions"]
457 echo [" using them are built only if the products are detected."]
458 summary $optional_products
460 if test x$libbatch_ok = xno; then
461 echo [" Warning: Batch functions will not be available in"]
462 echo [" Salome Launcher because they require libBatch."]
466 htmldoc_products="doxygen_ok graphviz_ok rst2html_ok"
468 echo --- Html documentation products: only required for doc production
469 summary $htmldoc_products
472 if test x$with_onlylauncher = xno; then
474 echo "Default ORB : $DEFAULT_ORB"
478 dnl generals files which could be included in every makefile
480 AC_SUBST_FILE(COMMENCE) COMMENCE=salome_adm/unix/make_commence
481 AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude
482 AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
485 AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
487 dnl We don t need to say when we re entering directories if we re using
488 dnl GNU make becuase make does it for us.
489 if test "X$GMAKE" = "Xyes"; then
490 AC_SUBST(SETX) SETX=":"
492 AC_SUBST(SETX) SETX="set -x"
496 echo ---------------------------------------------
497 echo generating Makefiles and configure files
498 echo ---------------------------------------------
501 # This list is initiated using autoscan and must be updated manually
502 # when adding a new file <filename>.in to manage. When you execute
503 # autoscan, the Makefile list is generated in the output file configure.scan.
504 # This could be helpfull to update de configuration.
507 salome_adm/unix/SALOMEconfig.ref \
508 salome_adm/Makefile \
509 salome_adm/cmake_files/Makefile \
510 salome_adm/unix/Makefile \
511 salome_adm/unix/config_files/Makefile \
516 doc/salome/Makefile \
517 doc/salome/tui/Makefile \
518 doc/salome/tui/doxyfile \
519 doc/salome/gui/Makefile \
520 doc/salome/gui/doxyfile \
522 idl/Calcium_Ports.idl \
524 resources/KERNELCatalog.xml \
525 resources/CatalogResources.xml \
527 src/Basics/Makefile \
528 src/Basics/Test/Makefile \
529 src/Communication/Makefile \
530 src/Communication_SWIG/Makefile \
531 src/Container/Makefile \
532 src/ParallelContainer/Makefile \
535 src/DSC/DSC_Basic/Makefile \
536 src/DSC/DSC_User/Makefile \
537 src/DSC/DSC_User/Basic/Makefile \
538 src/DSC/DSC_User/Datastream/Makefile \
539 src/DSC/DSC_User/Datastream/Palm/Makefile \
540 src/DSC/DSC_User/Datastream/Calcium/Makefile \
541 src/DSC/DSC_User/Datastream/Calcium/calcium_integer_port_uses.hxx \
542 src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.hxx \
543 src/DSC/DSC_User/Datastream/Calcium/CalciumFortranInt.h \
544 src/DSC/ParallelDSC/Makefile \
545 src/DSC/DSC_Python/Makefile \
546 src/GenericObj/Makefile \
547 src/HDFPersist/Makefile \
548 src/KERNEL_PY/Makefile \
549 src/Launcher/Makefile \
550 src/LifeCycleCORBA/Makefile \
551 src/LifeCycleCORBA/Test/Makefile \
552 src/LifeCycleCORBA_SWIG/Makefile \
553 src/LifeCycleCORBA_SWIG/Test/Makefile \
554 src/Logger/Makefile \
555 src/Logger/Test/Makefile \
556 src/ModuleCatalog/Makefile \
557 src/ModuleGenerator/Makefile \
558 src/ModuleGenerator/testIDLparser \
559 src/MPIContainer/Makefile \
560 src/NamingService/Makefile \
561 src/NamingService/Test/Makefile \
562 src/Notification/Makefile \
563 src/NOTIFICATION_SWIG/Makefile \
564 src/Registry/Makefile \
565 src/ResourcesManager/Makefile \
566 src/SALOMEDS/Makefile \
567 src/SALOMEDS/Test/Makefile \
568 src/SALOMEDSClient/Makefile \
569 src/SALOMEDSImpl/Makefile \
570 src/SALOMEDSImpl/Test/Makefile \
571 src/SALOMELocalTrace/Makefile \
572 src/SALOMELocalTrace/Test/Makefile \
573 src/SALOMETraceCollector/Makefile \
574 src/SALOMETraceCollector/Test/Makefile \
575 src/TestContainer/Makefile \
576 src/TestMPIContainer/Makefile \
577 src/TOOLSDS/Makefile \
578 src/UnitTests/Makefile \
580 src/Utils/Test/Makefile \