1 # Copyright (C) 2007-2012 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.5.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)}'`
43 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
48 echo ---------------------------------------------
49 echo Initialize source and build root directories
50 echo ---------------------------------------------
54 # This function return on stdout the absolute path of the filename in
56 # $ filename="../KERNEL_SRC/configure
57 # $ absfilename=`absolute_path $filename`
58 function absolute_path {
61 apath=`dirname $filename`
68 # Build directory, where the configure script is executed.
70 # Source directory, where the configure script is located.
71 ROOT_SRCDIR=`absolute_path $0`
74 AC_SUBST(ROOT_BUILDDIR)
77 echo Source root directory : $ROOT_SRCDIR
78 echo Build root directory : $ROOT_BUILDDIR
80 # ----------------------------------------------------------------------------
83 AC_ARG_ENABLE(corba_gen,
84 [AC_HELP_STRING([--enable-corba-gen],[Generate CORBA stuff [default=yes]])],
85 [case "${enableval}" in
86 yes) corba_gen=true ;;
87 no) corba_gen=false ;;
88 *) AC_MSG_ERROR(bad value ${enableval} for --enable-corba-gen) ;;
89 esac],[corba_gen=true])
90 AM_CONDITIONAL(CORBA_GEN, test x$corba_gen = xtrue)
92 # ---- option to build only launcher and resources manager
93 AC_ARG_WITH(onlylauncher,
94 [AC_HELP_STRING([--with-onlylauncher],[Build only launcher and resources manager [default=no]])],
96 [with_onlylauncher="no"])
97 AM_CONDITIONAL(WITHONLYLAUNCHER, test x$with_onlylauncher = xyes)
98 if test "$with_onlylauncher" != "yes"; then
99 AC_DEFINE([HAVE_SALOME_CONFIG], [], [True if SALOMEconfig.h file is used])
102 # ----------------------------------------------------------------------------
106 echo ============================================================
107 echo testing general mandatory products - for all configurations
108 echo ============================================================
111 dnl Modification B. Secher portage sur osf
112 AC_CHECK_PROG(SHELL,sh)
115 if test -z "$AR"; then
116 AC_CHECK_PROGS(AR,ar xar,:,$PATH)
121 echo ---------------------------------------------
123 echo ---------------------------------------------
130 echo ---------------------------------------------
131 echo Configuring production
132 echo ---------------------------------------------
136 AC_ENABLE_PRODUCTION(no)
137 AC_ENABLE_MPI_SEQ_CONTAINER(no)
139 # _GBO_SALOME_PYTHON_PACKAGING_
140 if test "X$enable_debug" = "Xyes"; then
148 echo ---------------------------------------------
150 echo ---------------------------------------------
153 dnl first, we set static to no!
154 dnl if we want it, use --enable-static
160 echo ---------------------------------------------
162 echo ---------------------------------------------
170 AC_CXX_TEMPLATE_OPTIONS
172 # AC_CC_WARNINGS([ansi])
176 AC_CHECK_LIB(dl,dlopen)
178 dnl Library librt : for alpha/osf
179 AC_CHECK_LIB(rt,nanosleep)
181 dnl add library libm :
184 AC_CXX_USE_STD_IOSTREAM
192 echo ---------------------------------------------
193 echo testing Fortran INTEGER size for CALCIUM
194 echo ---------------------------------------------
200 echo ---------------------------------------------
202 echo ---------------------------------------------
208 echo ---------------------------------------------
210 echo ---------------------------------------------
216 echo ---------------------------------------------
218 echo ---------------------------------------------
221 # _GBO_ This definition is required. Without this definition, the pythondir
222 # would not be defined. The version doesn't matter.
227 echo ---------------------------------------------
229 echo ---------------------------------------------
235 echo ---------------------------------------------
236 echo checking if MPI is requested by user
237 echo ---------------------------------------------
242 if test x$with_onlylauncher = xno; then
244 echo ---------------------------------------------
246 echo ---------------------------------------------
251 # ----------------------------------------------------------------------------
254 if test x$corba_gen = xtrue; then
257 echo ============================================================
258 echo testing mandatory products for CORBA configurations
259 echo ============================================================
263 dnl ---------------------------------------------
265 dnl ---------------------------------------------
271 echo ---------------------------------------------
272 echo Configuration of the ORB
273 echo ---------------------------------------------
276 echo Testing OMNIORB ...
279 echo Selecting the default ORB
281 echo DEFAULT_ORB : $DEFAULT_ORB
284 CORBA=salome_adm/unix/make_$ORB
288 # The CORBA variable defines the file name that
289 # implements the building rules to be included by Makefile to process
290 # idl files and CORBA specific dependencies (ex: the file
291 # salome_adm/unix/make_omniorb is the default for SALOME). The value
292 # of ORB is defined by CHECK_CORBA.
294 # Note that this checking process is no longer relevant for SALOME
295 # because the possibility of changing the ORB as a plugin is probably
296 # deprecated. The software configuration is clearly omniorb for CORBA
297 # communication. This could be simplify in a near futur.
300 echo ---------------------------------------------
302 echo ---------------------------------------------
309 # ----------------------------------------------------------------------------
312 # --- end test ONLYLAUNCHER
313 # ----------------------------------------------------------------------------
316 echo ============================================================
317 echo testing parallel products
318 echo ============================================================
322 echo ---------------------------------------------
323 echo checking if PaCO++ is requested by user
324 echo ---------------------------------------------
330 echo ------------------------------------------------------------
331 echo checking if parallel kernel extensions are requested by user
332 echo ------------------------------------------------------------
335 AC_MSG_CHECKING(whether to enable parallel kernel extension)
336 AC_ARG_ENABLE(parallel_extension,
337 AC_HELP_STRING([--enable-parallel_extension], [parallel kernel extension = [no/yes] (default is no)]),
338 parallel_extension_ok=$enableval,
339 parallel_extension_ok=no)
340 if test "x$parallel_extension_ok" = "xyes"
342 if test "x$PaCO_ok" = "xno"
344 parallel_extension_ok=no
348 if test "x$parallel_extension_ok" = "xyes"
355 AM_CONDITIONAL([WITH_PACO_PARALLEL], [test "x$parallel_extension_ok" = "xyes"])
358 echo ============================================================
359 echo testing optionnal products
360 echo ============================================================
364 echo ----------------------------------------------
365 echo testing CPPUNIT only required for unit testing
366 echo ----------------------------------------------
371 echo --------------------------------------------------------------
372 echo Testing libBatch only required for batch functions in Launcher
373 echo --------------------------------------------------------------
377 AM_CONDITIONAL(WITH_LIBBATCH, [test x"$libbatch_ok" = xyes])
380 echo ============================================================
381 echo testing products required only for documentation generation
382 echo ============================================================
386 echo ---------------------------------------------
387 echo Testing html generators
388 echo ---------------------------------------------
391 CHECK_HTML_GENERATORS
393 # Additional conditional to avoid compilation of non-portable code
394 AM_CONDITIONAL(WINDOWS, [ test ])
397 echo ---------------------------------------------
399 echo ---------------------------------------------
404 echo ============================================================
406 echo ============================================================
409 # This function displays the values of each variable given in arguments
412 for var in $variables
415 if test x$toto != "x"; then
416 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
422 # --------------------------------------
424 function check_fatal_error {
426 for var in $variables
429 if test x$toto != "xyes"; then
430 echo "FATAL ERROR: some mandatory products are missing."
431 echo "Installing the missing products is required before running the configure script".
437 # --------------------------------------
439 if test x$with_onlylauncher = xno; then
440 if test x$corba_gen = xtrue; then
441 basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok libxml_ok"
443 basic_mandatory_products="cc_ok threads_ok hdf5_ok libxml_ok"
446 basic_mandatory_products="cc_ok threads_ok libxml_ok"
449 echo --- General mandatory products - Light configuration:
450 summary $basic_mandatory_products
451 check_fatal_error $basic_mandatory_products
454 if test x$with_onlylauncher = xno; then
455 corba_mandatory_products="omniORB_ok omniORBpy_ok boost_ok"
456 if test x$corba_gen = xtrue; then
457 echo --- CORBA mandatory products - default configuration:
458 summary $corba_mandatory_products
459 check_fatal_error $corba_mandatory_products
461 echo --- CORBA products not required - option --disable-corba-gen
466 parallel_products="mpi_ok PaCO_ok parallel_extension_ok"
467 echo --- Kernel parallel extensions:
468 summary $parallel_products
471 optional_products="cppunit_ok numpy_ok libbatch_ok"
472 echo --- Optional products:
473 echo [" These products are optional because the KERNEL functions"]
474 echo [" using them are built only if the products are detected."]
475 summary $optional_products
477 if test x$libbatch_ok = xno; then
478 echo [" Warning: Batch functions will not be available in"]
479 echo [" Salome Launcher because they require libBatch."]
483 htmldoc_products="doxygen_ok graphviz_ok rst2html_ok sphinx_ok"
485 echo --- Html documentation products: only required for doc production
486 summary $htmldoc_products
489 if test x$with_onlylauncher = xno; then
491 echo "Default ORB : $DEFAULT_ORB"
495 dnl generals files which could be included in every makefile
497 AC_SUBST_FILE(COMMENCE) COMMENCE=salome_adm/unix/make_commence
498 AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude
499 AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
502 AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
504 dnl We don t need to say when we re entering directories if we re using
505 dnl GNU make becuase make does it for us.
506 if test "X$GMAKE" = "Xyes"; then
507 AC_SUBST(SETX) SETX=":"
509 AC_SUBST(SETX) SETX="set -x"
513 echo ---------------------------------------------
514 echo generating Makefiles and configure files
515 echo ---------------------------------------------
519 AC_CONFIG_COMMANDS([hack_libtool],[
520 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
521 $(pwd)/hack_libtool \1 \"\$[@]\" \n\
523 CC=\"hack_libtool\"%g" libtool
524 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
525 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
526 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
529 # This list is initiated using autoscan and must be updated manually
530 # when adding a new file <filename>.in to manage. When you execute
531 # autoscan, the Makefile list is generated in the output file configure.scan.
532 # This could be helpfull to update de configuration.
535 salome_adm/unix/SALOMEconfig.ref \
536 salome_adm/Makefile \
537 salome_adm/cmake_files/Makefile \
538 salome_adm/unix/Makefile \
539 salome_adm/unix/config_files/Makefile \
542 bin/appliskel/Makefile \
545 doc/docutils/conf.py \
546 doc/salome/Makefile \
547 doc/salome/tui/Makefile \
548 doc/salome/tui/doxyfile \
549 doc/salome/tui/static/header.html \
550 doc/salome/gui/Makefile \
551 doc/salome/gui/doxyfile \
552 doc/salome/gui/static/header.html \
553 doc/docutils/Makefile \
555 idl/Calcium_Ports.idl \
557 resources/KERNELCatalog.xml \
558 resources/CatalogResources.xml \
560 src/Basics/Makefile \
561 src/Basics/Test/Makefile \
562 src/Communication/Makefile \
563 src/Communication_SWIG/Makefile \
564 src/Container/Makefile \
565 src/ParallelContainer/Makefile \
568 src/DSC/DSC_Basic/Makefile \
569 src/DSC/DSC_User/Makefile \
570 src/DSC/DSC_User/Basic/Makefile \
571 src/DSC/DSC_User/Datastream/Makefile \
572 src/DSC/DSC_User/Datastream/Palm/Makefile \
573 src/DSC/DSC_User/Datastream/Calcium/Makefile \
574 src/DSC/DSC_User/Datastream/Calcium/calcium_integer_port_uses.hxx \
575 src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.hxx \
576 src/DSC/DSC_User/Datastream/Calcium/CalciumFortranInt.h \
577 src/DSC/ParallelDSC/Makefile \
578 src/DSC/DSC_Python/Makefile \
579 src/GenericObj/Makefile \
580 src/HDFPersist/Makefile \
581 src/KERNEL_PY/Makefile \
582 src/KERNEL_PY/kernel/Makefile \
583 src/KERNEL_PY/kernel/kernelpy_autotest.sh \
584 src/KERNEL_PY/kernel/logconfig.py \
585 src/KERNEL_PY/kernel/parametric/Makefile \
586 src/Launcher/Makefile \
587 src/LifeCycleCORBA/Makefile \
588 src/LifeCycleCORBA/Test/Makefile \
589 src/LifeCycleCORBA_SWIG/Makefile \
590 src/LifeCycleCORBA_SWIG/Test/Makefile \
591 src/Logger/Makefile \
592 src/Logger/Test/Makefile \
593 src/ModuleCatalog/Makefile \
594 src/ModuleGenerator/Makefile \
595 src/ModuleGenerator/testIDLparser \
596 src/MPIContainer/Makefile \
597 src/NamingService/Makefile \
598 src/NamingService/Test/Makefile \
599 src/Notification/Makefile \
600 src/NOTIFICATION_SWIG/Makefile \
601 src/Registry/Makefile \
602 src/ResourcesManager/Makefile \
603 src/SALOMEDS/Makefile \
604 src/SALOMEDS/Test/Makefile \
605 src/SALOMEDSClient/Makefile \
606 src/SALOMEDSImpl/Makefile \
607 src/SALOMEDSImpl/Test/Makefile \
608 src/SALOMELocalTrace/Makefile \
609 src/SALOMELocalTrace/Test/Makefile \
610 src/SALOMETraceCollector/Makefile \
611 src/SALOMETraceCollector/Test/Makefile \
612 src/TestContainer/Makefile \
613 src/TestMPIContainer/Makefile \
614 src/TOOLSDS/Makefile \
615 src/UnitTests/Makefile \
617 src/Utils/Test/Makefile \
618 src/KernelHelpers/Makefile \
619 src/KernelHelpers/Test/Makefile \