1 # Copyright (C) 2007-2010 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
23 # ================================================================
24 # Process this file with autoconf to produce a configure script
25 # ================================================================
28 AC_INIT([Salome2 Project], [6.2.0], [paul.rascle@edf.fr], [SalomeKERNEL])
30 # AC_CONFIG_AUX_DIR defines an alternative directory where to find the auxiliary
31 # scripts such as config.guess, install-sh, ...
32 AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
35 AM_INIT_AUTOMAKE([tar-pax -Wno-portability])
36 #AC_CONFIG_HEADER([config.h])
38 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
41 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
46 echo ---------------------------------------------
47 echo Initialize source and build root directories
48 echo ---------------------------------------------
52 # This function return on stdout the absolute path of the filename in
54 # $ filename="../KERNEL_SRC/configure
55 # $ absfilename=`absolute_path $filename`
56 function absolute_path {
59 apath=`dirname $filename`
66 # Build directory, where the configure script is executed.
68 # Source directory, where the configure script is located.
69 ROOT_SRCDIR=`absolute_path $0`
72 AC_SUBST(ROOT_BUILDDIR)
75 echo Source root directory : $ROOT_SRCDIR
76 echo Build root directory : $ROOT_BUILDDIR
78 # ----------------------------------------------------------------------------
81 AC_ARG_ENABLE(corba_gen,
82 [AC_HELP_STRING([--enable-corba-gen],[Generate CORBA stuff [default=yes]])],
83 [case "${enableval}" in
84 yes) corba_gen=true ;;
85 no) corba_gen=false ;;
86 *) AC_MSG_ERROR(bad value ${enableval} for --enable-corba-gen) ;;
87 esac],[corba_gen=true])
88 AM_CONDITIONAL(CORBA_GEN, test x$corba_gen = xtrue)
90 # ---- option to build only launcher and resources manager
91 AC_ARG_WITH(onlylauncher,
92 [AC_HELP_STRING([--with-onlylauncher],[Build only launcher and resources manager [default=no]])],
94 [with_onlylauncher="no"])
95 AM_CONDITIONAL(WITHONLYLAUNCHER, test x$with_onlylauncher = xyes)
96 if test "$with_onlylauncher" != "yes"; then
97 AC_DEFINE([HAVE_SALOME_CONFIG], [], [True if SALOMEconfig.h file is used])
100 # ----------------------------------------------------------------------------
104 echo ============================================================
105 echo testing general mandatory products - for all configurations
106 echo ============================================================
109 dnl Modification B. Secher portage sur osf
110 AC_CHECK_PROG(SHELL,sh)
113 if test -z "$AR"; then
114 AC_CHECK_PROGS(AR,ar xar,:,$PATH)
119 echo ---------------------------------------------
121 echo ---------------------------------------------
128 echo ---------------------------------------------
129 echo Configuring production
130 echo ---------------------------------------------
134 AC_ENABLE_PRODUCTION(no)
135 AC_ENABLE_MPI_SEQ_CONTAINER(no)
137 # _GBO_SALOME_PYTHON_PACKAGING_
138 if test "X$enable_debug" = "Xyes"; then
146 echo ---------------------------------------------
148 echo ---------------------------------------------
151 dnl first, we set static to no!
152 dnl if we want it, use --enable-static
158 echo ---------------------------------------------
160 echo ---------------------------------------------
168 AC_CXX_TEMPLATE_OPTIONS
170 # AC_CC_WARNINGS([ansi])
174 AC_CHECK_LIB(dl,dlopen)
176 dnl Library librt : for alpha/osf
177 AC_CHECK_LIB(rt,nanosleep)
179 dnl add library libm :
182 AC_CXX_USE_STD_IOSTREAM
190 echo ---------------------------------------------
191 echo testing Fortran INTEGER size for CALCIUM
192 echo ---------------------------------------------
198 echo ---------------------------------------------
200 echo ---------------------------------------------
206 echo ---------------------------------------------
208 echo ---------------------------------------------
214 echo ---------------------------------------------
216 echo ---------------------------------------------
219 # _GBO_ This definition is required. Without this definition, the pythondir
220 # would not be defined. The version doesn't matter.
225 echo ---------------------------------------------
227 echo ---------------------------------------------
232 if test x$with_onlylauncher = xno; then
234 echo ---------------------------------------------
236 echo ---------------------------------------------
241 # ----------------------------------------------------------------------------
244 if test x$corba_gen = xtrue; then
247 echo ============================================================
248 echo testing mandatory products for CORBA configurations
249 echo ============================================================
253 dnl ---------------------------------------------
255 dnl ---------------------------------------------
261 echo ---------------------------------------------
262 echo Configuration of the ORB
263 echo ---------------------------------------------
266 echo Testing OMNIORB ...
269 echo Selecting the default ORB
271 echo DEFAULT_ORB : $DEFAULT_ORB
274 CORBA=salome_adm/unix/make_$ORB
278 # The CORBA variable defines the file name that
279 # implements the building rules to be included by Makefile to process
280 # idl files and CORBA specific dependencies (ex: the file
281 # salome_adm/unix/make_omniorb is the default for SALOME). The value
282 # of ORB is defined by CHECK_CORBA.
284 # Note that this checking process is no longer relevant for SALOME
285 # because the possibility of changing the ORB as a plugin is probably
286 # deprecated. The software configuration is clearly omniorb for CORBA
287 # communication. This could be simplify in a near futur.
290 echo ---------------------------------------------
292 echo ---------------------------------------------
299 # ----------------------------------------------------------------------------
302 # --- end test ONLYLAUNCHER
303 # ----------------------------------------------------------------------------
306 echo ============================================================
307 echo testing parallel products
308 echo ============================================================
312 echo ---------------------------------------------
313 echo checking if MPI is requested by user
314 echo ---------------------------------------------
320 echo ---------------------------------------------
321 echo checking if PaCO++ is requested by user
322 echo ---------------------------------------------
328 echo ------------------------------------------------------------
329 echo checking if parallel kernel extensions are requested by user
330 echo ------------------------------------------------------------
333 AC_MSG_CHECKING(whether to enable parallel kernel extension)
334 AC_ARG_ENABLE(parallel_extension,
335 AC_HELP_STRING([--enable-parallel_extension], [parallel kernel extension = [no/yes] (default is no)]),
336 parallel_extension_ok=$enableval,
337 parallel_extension_ok=no)
338 if test "x$parallel_extension_ok" = "xyes"
340 if test "x$PaCO_ok" = "xno"
342 parallel_extension_ok=no
346 if test "x$parallel_extension_ok" = "xyes"
353 AM_CONDITIONAL([WITH_PACO_PARALLEL], [test "x$parallel_extension_ok" = "xyes"])
356 echo ============================================================
357 echo testing optionnal products
358 echo ============================================================
362 echo ----------------------------------------------
363 echo testing CPPUNIT only required for unit testing
364 echo ----------------------------------------------
369 echo --------------------------------------------------------------
370 echo Testing libBatch only required for batch functions in Launcher
371 echo --------------------------------------------------------------
375 AM_CONDITIONAL(WITH_LIBBATCH, [test x"$libbatch_ok" = xyes])
378 echo ============================================================
379 echo testing products required only for documentation generation
380 echo ============================================================
384 echo ---------------------------------------------
385 echo Testing html generators
386 echo ---------------------------------------------
389 CHECK_HTML_GENERATORS
391 # Additional conditional to avoid compilation of non-portable code
392 AM_CONDITIONAL(WINDOWS, [ test ])
395 echo ---------------------------------------------
397 echo ---------------------------------------------
402 echo ============================================================
404 echo ============================================================
407 # This function displays the values of each variable given in arguments
410 for var in $variables
413 if test x$toto != "x"; then
414 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
420 # --------------------------------------
422 function check_fatal_error {
424 for var in $variables
427 if test x$toto != "xyes"; then
428 echo "FATAL ERROR: some mandatory products are missing."
429 echo "Installing the missing products is required before running the configure script".
435 # --------------------------------------
437 if test x$with_onlylauncher = xno; then
438 if test x$corba_gen = xtrue; then
439 basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok libxml_ok"
441 basic_mandatory_products="cc_ok threads_ok hdf5_ok libxml_ok"
444 basic_mandatory_products="cc_ok threads_ok libxml_ok"
447 echo --- General mandatory products - Light configuration:
448 summary $basic_mandatory_products
449 check_fatal_error $basic_mandatory_products
452 if test x$with_onlylauncher = xno; then
453 corba_mandatory_products="omniORB_ok omniORBpy_ok boost_ok"
454 if test x$corba_gen = xtrue; then
455 echo --- CORBA mandatory products - default configuration:
456 summary $corba_mandatory_products
457 check_fatal_error $corba_mandatory_products
459 echo --- CORBA products not required - option --disable-corba-gen
464 parallel_products="mpi_ok PaCO_ok parallel_extension_ok"
465 echo --- Kernel parallel extensions:
466 summary $parallel_products
469 optional_products="cppunit_ok numpy_ok libbatch_ok"
470 echo --- Optional products:
471 echo [" These products are optional because the KERNEL functions"]
472 echo [" using them are built only if the products are detected."]
473 summary $optional_products
475 if test x$libbatch_ok = xno; then
476 echo [" Warning: Batch functions will not be available in"]
477 echo [" Salome Launcher because they require libBatch."]
481 htmldoc_products="doxygen_ok graphviz_ok rst2html_ok sphinx_ok"
483 echo --- Html documentation products: only required for doc production
484 summary $htmldoc_products
487 if test x$with_onlylauncher = xno; then
489 echo "Default ORB : $DEFAULT_ORB"
493 dnl generals files which could be included in every makefile
495 AC_SUBST_FILE(COMMENCE) COMMENCE=salome_adm/unix/make_commence
496 AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude
497 AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
500 AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
502 dnl We don t need to say when we re entering directories if we re using
503 dnl GNU make becuase make does it for us.
504 if test "X$GMAKE" = "Xyes"; then
505 AC_SUBST(SETX) SETX=":"
507 AC_SUBST(SETX) SETX="set -x"
511 echo ---------------------------------------------
512 echo generating Makefiles and configure files
513 echo ---------------------------------------------
517 AC_CONFIG_COMMANDS([hack_libtool],[
518 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
519 $(pwd)/hack_libtool \1 \"\$[@]\" \n\
521 CC=\"hack_libtool\"%g" libtool
522 sed -i "s%\(\s*\)for searchdir in \$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path; do%\1searchdirs=\"\$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path\"\n\1for searchdir in \$searchdirs; do%g" libtool
523 sed -i "s%\(\s*\)searchdirs=\"\$newlib_search_path \$lib_search_path \(.*\)\"%\1searchdirs=\"\$newlib_search_path \$lib_search_path\"\n\1sss_beg=\"\"\n\1sss_end=\"\2\"%g" libtool
524 sed -i "s%\(\s*\)\(for searchdir in \$searchdirs; do\)%\1for sss in \$searchdirs; do\n\1 if ! test -d \$sss; then continue; fi\n\1 ssss=\$(cd \$sss; pwd)\n\1 if test \"\$ssss\" != \"\" \&\& test -d \$ssss; then\n\1 case \$ssss in\n\1 /usr/lib | /usr/lib64 ) ;;\n\1 * ) sss_beg=\"\$sss_beg \$ssss\" ;;\n\1 esac\n\1 fi\n\1done\n\1searchdirs=\"\$sss_beg \$sss_end\"\n\1\2%g" libtool
527 # This list is initiated using autoscan and must be updated manually
528 # when adding a new file <filename>.in to manage. When you execute
529 # autoscan, the Makefile list is generated in the output file configure.scan.
530 # This could be helpfull to update de configuration.
533 salome_adm/unix/SALOMEconfig.ref \
534 salome_adm/Makefile \
535 salome_adm/cmake_files/Makefile \
536 salome_adm/unix/Makefile \
537 salome_adm/unix/config_files/Makefile \
542 doc/docutils/conf.py \
543 doc/salome/Makefile \
544 doc/salome/tui/Makefile \
545 doc/salome/tui/doxyfile \
546 doc/salome/tui/static/header.html \
547 doc/salome/gui/Makefile \
548 doc/salome/gui/doxyfile \
549 doc/salome/gui/static/header.html \
550 doc/docutils/Makefile \
552 idl/Calcium_Ports.idl \
554 resources/KERNELCatalog.xml \
555 resources/CatalogResources.xml \
557 src/Basics/Makefile \
558 src/Basics/Test/Makefile \
559 src/Communication/Makefile \
560 src/Communication_SWIG/Makefile \
561 src/Container/Makefile \
562 src/ParallelContainer/Makefile \
565 src/DSC/DSC_Basic/Makefile \
566 src/DSC/DSC_User/Makefile \
567 src/DSC/DSC_User/Basic/Makefile \
568 src/DSC/DSC_User/Datastream/Makefile \
569 src/DSC/DSC_User/Datastream/Palm/Makefile \
570 src/DSC/DSC_User/Datastream/Calcium/Makefile \
571 src/DSC/DSC_User/Datastream/Calcium/calcium_integer_port_uses.hxx \
572 src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.hxx \
573 src/DSC/DSC_User/Datastream/Calcium/CalciumFortranInt.h \
574 src/DSC/ParallelDSC/Makefile \
575 src/DSC/DSC_Python/Makefile \
576 src/GenericObj/Makefile \
577 src/HDFPersist/Makefile \
578 src/KERNEL_PY/Makefile \
579 src/KERNEL_PY/kernel/Makefile \
580 src/KERNEL_PY/kernel/logconfig.py \
581 src/Launcher/Makefile \
582 src/LifeCycleCORBA/Makefile \
583 src/LifeCycleCORBA/Test/Makefile \
584 src/LifeCycleCORBA_SWIG/Makefile \
585 src/LifeCycleCORBA_SWIG/Test/Makefile \
586 src/Logger/Makefile \
587 src/Logger/Test/Makefile \
588 src/ModuleCatalog/Makefile \
589 src/ModuleGenerator/Makefile \
590 src/ModuleGenerator/testIDLparser \
591 src/MPIContainer/Makefile \
592 src/NamingService/Makefile \
593 src/NamingService/Test/Makefile \
594 src/Notification/Makefile \
595 src/NOTIFICATION_SWIG/Makefile \
596 src/Registry/Makefile \
597 src/ResourcesManager/Makefile \
598 src/SALOMEDS/Makefile \
599 src/SALOMEDS/Test/Makefile \
600 src/SALOMEDSClient/Makefile \
601 src/SALOMEDSImpl/Makefile \
602 src/SALOMEDSImpl/Test/Makefile \
603 src/SALOMELocalTrace/Makefile \
604 src/SALOMELocalTrace/Test/Makefile \
605 src/SALOMETraceCollector/Makefile \
606 src/SALOMETraceCollector/Test/Makefile \
607 src/TestContainer/Makefile \
608 src/TestMPIContainer/Makefile \
609 src/TOOLSDS/Makefile \
610 src/UnitTests/Makefile \
612 src/Utils/Test/Makefile \