1 # Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # Author : Marc Tajchman (CEA)
22 # Modified by : Patrick GOLDBRONN (CEA)
23 # Modified by : Marc Tajchman (CEA)
24 # Modified by : Mikhail PONIKAROV (OCN)
26 AC_INIT([Salome2 Project MED module], [7.1.0], [webmaster.salome@opencascade.com], [SalomeMED])
27 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
30 AM_INIT_AUTOMAKE([tar-pax -Wno-portability])
32 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
37 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
42 dnl Initialize source and build root directories
45 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
51 AC_SUBST(ROOT_BUILDDIR)
54 echo Source root directory : $ROOT_SRCDIR
55 echo Build root directory : $ROOT_BUILDDIR
58 dnl remember MED_WITH_KERNEL set by build configure
60 old_with_kernel=${MED_WITH_KERNEL}
63 dnl Check --with-kernel option
65 dnl ---------------------------------------------
67 dnl ---------------------------------------------
70 dnl Update and re-run configure if there was build_configure --without-kernel
71 dnl but configure --with-kernel=DIR is being called
73 if test "x${old_with_kernel}" != "x${MED_WITH_KERNEL}"; then
74 if test "x${old_with_kernel}" = "xno" ; then
75 if test ! -d "${KERNEL_ROOT_DIR}"; then
76 echo "failed : KERNEL_ROOT_DIR variable is not correct !"
79 kernel_check_in_aclocal=`grep KERNEL_ROOT_DIR ${ROOT_SRCDIR}/aclocal.m4`
80 if test "x${kernel_check_in_aclocal}" = "x"; then
81 echo "Configuration changed: without KERNEL -> with KERNEL"
82 echo -n "Updating 'configure' script ... "
84 if build_configure --with-kernel={MED_WITH_KERNEL}; then
99 echo ---------------------------------------------
100 echo "MED_WITH_KERNEL: ${MED_WITH_KERNEL}"
101 echo ---------------------------------------------
105 # --with-interp-kernel-only option: available only in --with-kernel=no mode (see build_configure)
108 AC_ARG_WITH([interp-kernel-only],
109 [AC_HELP_STRING([--with-interp-kernel-only],[Build MicroMED packages only, default=no])],
110 [],[with_interp_kernel_only=no])
112 if test "$MED_WITH_KERNEL" == "yes" ; then
113 if test "$with_interp_kernel_only" != "no" ; then
114 AC_MSG_WARN([Option --with-interp-kernel-only is supported in --without-kernel mode only])
116 with_interp_kernel_only="no"
123 dnl Modification B. Secher portage sur osf CCRT
124 AC_CHECK_PROG(SHELL,sh,,)
127 if test -z "$AR"; then
128 AC_CHECK_PROGS(AR,ar xar,:,$PATH)
132 dnl Export the AR macro so that it will be placed in the libtool file
137 echo ---------------------------------------------
139 echo ---------------------------------------------
146 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
149 AC_DISABLE_PRODUCTION
152 echo ---------------------------------------------
154 echo ---------------------------------------------
157 dnl first, we set static to no!
158 dnl if we want it, use --enable-static
164 dnl Fix up the INSTALL macro if it s a relative path. We want the
165 dnl full-path to the binary instead.
168 INSTALL='\${ROOT_BUILDDIR}'/adm_local/unix/config_files/install-sh
173 echo ---------------------------------------------
175 echo ---------------------------------------------
179 dnl inutil car libtool
183 AC_CXX_TEMPLATE_OPTIONS
185 # AC_CC_WARNINGS([ansi])
189 AC_CHECK_LIB(dl,dlopen)
191 dnl Library librt : for alpha/osf
192 AC_CHECK_LIB(rt,nanosleep)
194 dnl add library libm :
198 dnl Check if we use std iostream by default or if we must add
199 dnl a compiler directive for that
202 AC_CXX_USE_STD_IOSTREAM
205 dnl Well we use sstream which is not in gcc pre-2.95.3
206 dnl We must test if it exists. If not, add it in include !
212 dnl ---------------------------------------------
214 dnl ---------------------------------------------
220 echo ---------------------------------------------
222 echo ---------------------------------------------
228 echo ---------------------------------------------
230 echo ---------------------------------------------
236 echo ---------------------------------------------
238 echo ---------------------------------------------
244 echo ---------------------------------------------
246 echo ---------------------------------------------
252 echo ---------------------------------------------------
253 echo "testing CPPUNIT (only required for unitary testing)"
254 echo --------------------------------------------------
260 echo ---------------------------------------------
261 echo testing FVM library generators
262 echo ---------------------------------------------
268 echo ---------------------------------------------
269 echo testing html generators
270 echo ---------------------------------------------
274 CHECK_HTML_GENERATORS
281 # CHECK_GUI ONLY if MED_WITH_KERNEL is yes
286 # Other tests should be performed only in --with-interp-kernel-only=no mode
289 if test "$with_interp_kernel_only" != "yes" ; then
292 echo ---------------------------------------------
294 echo ---------------------------------------------
300 echo ---------------------------------------------
302 echo ---------------------------------------------
309 echo ---------------------------------------------
310 echo testing BOOST Library
311 echo ---------------------------------------------
318 echo ---------------------------------------------
319 echo checking SPLITTER
320 echo ---------------------------------------------
323 AC_ENABLE_SPLITTER(yes)
325 if test "x$ENABLE_SPLITTER" = "xyes"; then
333 echo ---------------------------------------------
334 echo testing ParMETIS
335 echo ---------------------------------------------
337 CHECK_PARMETIS dnl parmetis_ok is set to yes by CHECK_PARMETIS
339 if test "x$parmetis_ok" != "xyes"; then
344 echo ---------------------------------------------
346 echo ---------------------------------------------
348 CHECK_METIS dnl metis_ok is set to yes by CHECK_METIS
351 echo ---------------------------------------------
353 echo ---------------------------------------------
355 dnl scotch_ok is set to yes by CHECK_SCOTCH
358 echo ---------------------------------------------
360 echo ---------------------------------------------
362 dnl libxml_ok is set to yes by CHECK_LIBXML
366 AC_ENABLE_RENUMBER(yes)
368 if test "x$ENABLE_RENUMBER" = "xyes"; then
369 if test "x$metis_ok" = "x"; then
371 echo ---------------------------------------------
373 echo ---------------------------------------------
376 CHECK_METIS dnl metis_ok is set to yes by CHECK_METIS
380 if test "${MED_WITH_KERNEL}" = "yes"; then
383 dnl ---------------------------------------------
385 dnl ---------------------------------------------
391 echo ---------------------------------------------
393 echo ---------------------------------------------
403 CORBA=adm_local/unix/$corba
406 dnl echo ---------------------------------------------
407 dnl echo testing mico
408 dnl echo ---------------------------------------------
414 echo ---------------------------------------------
415 echo testing SALOME Kernel
416 echo ---------------------------------------------
422 echo ---------------------------------------------
423 echo testing SALOME GUI
424 echo ---------------------------------------------
429 if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then
433 if test "${SalomeGUI_need}" == "yes"; then
434 if test "${FullGUI_ok}" != "yes"; then
435 AC_MSG_WARN(For configure MED module necessary full GUI!)
437 elif test "${SalomeGUI_need}" == "auto"; then
438 if test "${FullGUI_ok}" != "yes"; then
439 AC_MSG_WARN(Full GUI not found. Build will be done without GUI!)
441 elif test "${SalomeGUI_need}" == "no"; then
442 echo Build without GUI option has been chosen
445 if test "${gui_ok}" = "yes" ; then
448 echo ---------------------------------------------
449 echo testing LEX \& YACC
450 echo ---------------------------------------------
459 echo ---------------------------------------------
461 echo ---------------------------------------------
467 echo ---------------------------------------------
469 echo ---------------------------------------------
475 echo ---------------------------------------------
477 echo ---------------------------------------------
483 echo ---------------------------------------------
484 echo testing OpenCascade
485 echo ---------------------------------------------
490 fi # if "${gui_ok}" = "yes" ...
494 fi # "$with_interp_kernel_only" != "yes" ...
498 # Additional substitutions
507 AM_CONDITIONAL(MED_ENABLE_KERNEL, [test "$MED_WITH_KERNEL" = yes])
508 AM_CONDITIONAL(MED_ENABLE_MICROMED, [test "$with_interp_kernel_only" = yes])
509 AM_CONDITIONAL(MED_ENABLE_GUI, [test "${gui_ok}" = "yes"])
510 AM_CONDITIONAL(MED_ENABLE_SSTREAM, [test "$HAVE_SSTREAM" = yes])
511 AM_CONDITIONAL(MED_SWIG_1_3_21, [test "$SWIG_VERSION" = 1.3.21])
512 AM_CONDITIONAL(MED_ENABLE_SPLITTER, [test "$ENABLE_SPLITTER" = yes])
513 AM_CONDITIONAL(MED_ENABLE_PARMETIS, [test "$ENABLE_PARMETIS" = yes])
514 AM_CONDITIONAL(MED_ENABLE_METIS, [test "$ENABLE_METIS" = yes])
515 AM_CONDITIONAL(MED_ENABLE_SCOTCH, [test "$ENABLE_SCOTCH" = yes])
516 AM_CONDITIONAL(MED_WITHMPI, [test "$WITHMPI" = yes])
517 AM_CONDITIONAL(MED_ENABLE_FVM, [test "$ENABLE_FVM" = yes])
518 AM_CONDITIONAL(MED_ENABLE_MED3, [test "$med3_ok" = yes])
519 AM_CONDITIONAL(MED_ENABLE_RENUMBER, [test "$ENABLE_RENUMBER" = yes])
520 AM_CONDITIONAL(BOOST_IS_OK, [test "$boost_ok" = yes])
526 echo ---------------------------------------------
528 echo ---------------------------------------------
531 if test "$with_interp_kernel_only" = "yes"; then
532 echo "Configure (Micro MED)"
533 elif test "$MED_WITH_KERNEL" = "no"; then
534 echo "Configure (without Kernel)"
535 elif test "${SalomeGUI_need}" == "no"; then
536 echo "Configure (without GUI)"
541 obligatory_vars="cc_ok threads_ok doxygen_ok"
542 optional_vars="mpi_ok fvm_ok cppunit_ok"
545 if test "x$ENABLE_SPLITTER" = "xyes" ; then
546 splitter_obligatory_vars="libxml_ok"
547 splitter_optional_vars="metis_ok parmetis_ok scotch_ok"
550 if test "x$ENABLE_RENUMBER" = "xyes" ; then
551 if test "x$splitter_optional_vars" = "x" ; then
552 renumber_optional_vars="metis_ok"
555 if test "$MED_WITH_KERNEL" = "yes" ; then
557 obligatory_vars="$obligatory_vars python_ok boost_ok swig_ok hdf5_ok med3_ok omniORB_ok $splitter_obligatory_vars"
558 optional_vars="$optional_vars $splitter_optional_vars $renumber_optional_vars graphviz_ok Kernel_ok"
559 if test "${gui_ok}" = "yes"; then
561 gui_vars="lex_yacc_ok OpenGL_ok qt_ok vtk_ok occ_ok gui_ok"
562 elif test "${SalomeGUI_need}" != "no"; then
567 if test "$with_interp_kernel_only" == "yes" ; then
568 # --with-interp-kernel-only=yes mode
569 optional_vars="$optional_vars $splitter_optional_vars $renumber_optional_vars hdf5_ok med3_ok"
571 # --with-interp-kernel-only=no mode
572 obligatory_vars="$obligatory_vars python_ok boost_ok swig_ok hdf5_ok med3_ok $splitter_obligatory_vars"
573 optional_vars="$optional_vars $splitter_optional_vars $renumber_optional_vars"
578 # obligatory products
581 echo "--- Obligatory products:"
583 missing_obligatory=no
584 for var in $obligatory_vars
587 if test x$toto == "x"; then toto="no" ; fi
588 if test x$toto == "xno"; then missing_obligatory=yes ; fi
589 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
593 if test x$missing_obligatory == "xyes"; then
594 AC_MSG_ERROR([one or more obligatory product is missing])
598 # GUI products (if enabled)
601 if test "$gui_vars" != "" ; then
603 echo "--- GUI products (optional):"
608 if test x$toto == "x"; then toto="no"; fi
609 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
618 echo "--- Other (optional) products:"
620 for var in $optional_vars
623 if test x$toto != "x"; then
624 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
630 # default ORB (if enabled)
633 if test "$DEFAULT_ORB" != "" ; then
635 echo "Default ORB : $DEFAULT_ORB"
639 dnl We don t need to say when we re entering directories if we re using
640 dnl GNU make becuase make does it for us.
641 if test "X$GMAKE" = "Xyes"; then
642 AC_SUBST(SETX) SETX=":"
644 AC_SUBST(SETX) SETX="set -x"
647 if test -n "${NO_MED_TRACE+X}"; then
648 CPPFLAGS="${CPPFLAGS} -D_NO_MED_TRACE_"
652 echo ---------------------------------------------
653 echo generating Makefiles and configure files
654 echo ---------------------------------------------
657 AC_OUTPUT_COMMANDS([ \
662 AC_CONFIG_COMMANDS([hack_libtool],[
663 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
664 $(pwd)/hack_libtool \1 \"\$[@]\" \n\
666 CC=\"hack_libtool\"%g" libtool
667 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
668 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
669 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
673 adm_local_without_kernel/SALOMEconfig.h \
676 adm_local/unix/config_files/Makefile \
677 adm_local/unix/Makefile \
678 adm_local/cmake_files/Makefile \
680 adm_local_without_kernel/unix/config_files/Makefile \
681 adm_local_without_kernel/unix/Makefile \
682 adm_local_without_kernel/Makefile \
684 resources/SalomeApp.xml \
685 resources/MEDCatalog.xml \
690 src/MEDWrapper/Makefile \
691 src/MEDWrapper/Base/Makefile \
692 src/MEDWrapper/Factory/Makefile \
693 src/MEDWrapper/V2_2/Makefile \
694 src/INTERP_KERNEL/Makefile \
695 src/INTERP_KERNELTest/Makefile \
696 src/MEDCoupling/Makefile \
697 src/MEDCoupling/Test/Makefile \
698 src/MEDLoader/Makefile \
699 src/MEDLoader/Swig/Makefile \
700 src/MEDLoader/Test/Makefile \
701 src/MEDCoupling_Swig/Makefile \
702 src/MEDCouplingCorba/Makefile \
703 src/MEDCouplingCorba/Client/Makefile \
704 src/MEDCouplingCorba/Test/Makefile \
705 src/MEDCouplingCorba_Swig/Makefile \
706 src/MEDCouplingCorba_Swig/Client/Makefile \
707 src/MEDCalculator/Makefile \
708 src/MEDCalculator/Swig/Makefile \
709 src/MEDCalculator/Test/Makefile \
710 src/MEDPartitioner/Makefile \
711 src/MEDPartitioner/Test/Makefile \
712 src/RENUMBER/Makefile \
713 src/ParaMEDCouplingCorba/Makefile \
714 src/ParaMEDMEM/Makefile \
715 src/ParaMEDMEMComponent/Makefile \
716 src/ParaMEDLoader/Makefile \
717 src/ParaMEDMEMTest/Makefile \
718 src/ParaMEDMEM_Swig/Makefile \
719 src/MEDGUI/Makefile \
721 src/MEDOP/cmp/Makefile \
722 src/MEDOP/tui/Makefile \
723 src/MEDOP/tui/xmedpy/Makefile \
724 src/MEDOP/res/Makefile \
725 src/MEDOP/res/testfiles/Makefile \
726 src/MEDOP/gui/dialogs/Makefile \
727 src/MEDOP/gui/Makefile \
728 src/MEDOP/exe/Makefile \
729 src/MEDOP/exe/appligen/Makefile \
730 src/MEDOP/exe/appligen/config_appli_model.xml \
731 src/MEDOP/exe/appligen/appligen.sh \
732 src/MEDOP/exe/image2med/Makefile \
733 src/MEDOP/doc/Makefile \
734 src/MEDOP/doc/sphinx/conf.py \
735 src/MEDOP/doc/sphinx/Makefile \
737 doc/salome/Makefile \
738 doc/salome/tui/Makefile \
739 doc/salome/tui/doxyfile \
740 doc/salome/tui/static/header.html \
741 doc/doxygen/Makefile \
742 doc/doxygen/Doxyfile_med_user \
743 doc/doxygen/static/header.html \