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.2.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
285 # This flags should be used to switch between the MEDMEM GUI (defined
286 # in the MEDGUI package) and the MEDOP GUI (defined in the MEDOP
287 # package). In any case the module factory function is provided by the
288 # MEDOP GUI library (package MEDOP/gui) and this factory function
289 # creates weither a MedGUI instance or a MEDOPModule instance,
290 # depending on the value of this flags. The default is to use the new
292 AM_CONDITIONAL(WITH_MEDMEMGUI,test "1" = "0")
295 # Other tests should be performed only in --with-interp-kernel-only=no mode
298 if test "$with_interp_kernel_only" != "yes" ; then
301 echo ---------------------------------------------
303 echo ---------------------------------------------
309 echo ---------------------------------------------
311 echo ---------------------------------------------
318 echo ---------------------------------------------
319 echo testing BOOST Library
320 echo ---------------------------------------------
327 echo ---------------------------------------------
328 echo checking SPLITTER
329 echo ---------------------------------------------
332 AC_ENABLE_SPLITTER(yes)
334 if test "x$ENABLE_SPLITTER" = "xyes"; then
342 echo ---------------------------------------------
343 echo testing ParMETIS
344 echo ---------------------------------------------
346 CHECK_PARMETIS dnl parmetis_ok is set to yes by CHECK_PARMETIS
348 if test "x$parmetis_ok" != "xyes"; then
353 echo ---------------------------------------------
355 echo ---------------------------------------------
357 CHECK_METIS dnl metis_ok is set to yes by CHECK_METIS
360 echo ---------------------------------------------
362 echo ---------------------------------------------
364 dnl scotch_ok is set to yes by CHECK_SCOTCH
367 echo ---------------------------------------------
369 echo ---------------------------------------------
371 dnl libxml_ok is set to yes by CHECK_LIBXML
375 AC_ENABLE_RENUMBER(yes)
377 if test "x$ENABLE_RENUMBER" = "xyes"; then
378 if test "x$metis_ok" = "x"; then
380 echo ---------------------------------------------
382 echo ---------------------------------------------
385 CHECK_METIS dnl metis_ok is set to yes by CHECK_METIS
389 if test "${MED_WITH_KERNEL}" = "yes"; then
392 dnl ---------------------------------------------
394 dnl ---------------------------------------------
400 echo ---------------------------------------------
402 echo ---------------------------------------------
412 CORBA=adm_local/unix/$corba
415 dnl echo ---------------------------------------------
416 dnl echo testing mico
417 dnl echo ---------------------------------------------
423 echo ---------------------------------------------
424 echo testing SALOME Kernel
425 echo ---------------------------------------------
431 echo ---------------------------------------------
432 echo testing SALOME GUI
433 echo ---------------------------------------------
438 if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then
442 if test "${SalomeGUI_need}" == "yes"; then
443 if test "${FullGUI_ok}" != "yes"; then
444 AC_MSG_WARN(For configure MED module necessary full GUI!)
446 elif test "${SalomeGUI_need}" == "auto"; then
447 if test "${FullGUI_ok}" != "yes"; then
448 AC_MSG_WARN(Full GUI not found. Build will be done without GUI!)
450 elif test "${SalomeGUI_need}" == "no"; then
451 echo Build without GUI option has been chosen
454 if test "${gui_ok}" = "yes" ; then
457 echo ---------------------------------------------
458 echo testing LEX \& YACC
459 echo ---------------------------------------------
468 echo ---------------------------------------------
470 echo ---------------------------------------------
476 echo ---------------------------------------------
478 echo ---------------------------------------------
484 echo ---------------------------------------------
486 echo ---------------------------------------------
492 echo ---------------------------------------------
493 echo testing OpenCascade
494 echo ---------------------------------------------
499 fi # if "${gui_ok}" = "yes" ...
503 fi # "$with_interp_kernel_only" != "yes" ...
507 # Additional substitutions
516 AM_CONDITIONAL(MED_ENABLE_KERNEL, [test "$MED_WITH_KERNEL" = yes])
517 AM_CONDITIONAL(MED_ENABLE_MICROMED, [test "$with_interp_kernel_only" = yes])
518 AM_CONDITIONAL(MED_ENABLE_GUI, [test "${gui_ok}" = "yes"])
519 AM_CONDITIONAL(MED_ENABLE_SSTREAM, [test "$HAVE_SSTREAM" = yes])
520 AM_CONDITIONAL(MED_SWIG_1_3_21, [test "$SWIG_VERSION" = 1.3.21])
521 AM_CONDITIONAL(MED_ENABLE_SPLITTER, [test "$ENABLE_SPLITTER" = yes])
522 AM_CONDITIONAL(MED_ENABLE_PARMETIS, [test "$ENABLE_PARMETIS" = yes])
523 AM_CONDITIONAL(MED_ENABLE_METIS, [test "$ENABLE_METIS" = yes])
524 AM_CONDITIONAL(MED_ENABLE_SCOTCH, [test "$ENABLE_SCOTCH" = yes])
525 AM_CONDITIONAL(MED_WITHMPI, [test "$WITHMPI" = yes])
526 AM_CONDITIONAL(MED_ENABLE_FVM, [test "$ENABLE_FVM" = yes])
527 AM_CONDITIONAL(MED_ENABLE_MED3, [test "$med3_ok" = yes])
528 AM_CONDITIONAL(MED_ENABLE_RENUMBER, [test "$ENABLE_RENUMBER" = yes])
529 AM_CONDITIONAL(BOOST_IS_OK, [test "$boost_ok" = yes])
535 echo ---------------------------------------------
537 echo ---------------------------------------------
540 if test "$with_interp_kernel_only" = "yes"; then
541 echo "Configure (Micro MED)"
542 elif test "$MED_WITH_KERNEL" = "no"; then
543 echo "Configure (without Kernel)"
544 elif test "${SalomeGUI_need}" == "no"; then
545 echo "Configure (without GUI)"
550 obligatory_vars="cc_ok threads_ok doxygen_ok"
551 optional_vars="mpi_ok fvm_ok cppunit_ok"
554 if test "x$ENABLE_SPLITTER" = "xyes" ; then
555 splitter_obligatory_vars="libxml_ok"
556 splitter_optional_vars="metis_ok parmetis_ok scotch_ok"
559 if test "x$ENABLE_RENUMBER" = "xyes" ; then
560 if test "x$splitter_optional_vars" = "x" ; then
561 renumber_optional_vars="metis_ok"
564 if test "$MED_WITH_KERNEL" = "yes" ; then
566 obligatory_vars="$obligatory_vars python_ok boost_ok swig_ok hdf5_ok med3_ok omniORB_ok $splitter_obligatory_vars"
567 optional_vars="$optional_vars $splitter_optional_vars $renumber_optional_vars graphviz_ok Kernel_ok"
568 if test "${gui_ok}" = "yes"; then
570 gui_vars="lex_yacc_ok OpenGL_ok qt_ok vtk_ok occ_ok gui_ok"
571 elif test "${SalomeGUI_need}" != "no"; then
576 if test "$with_interp_kernel_only" == "yes" ; then
577 # --with-interp-kernel-only=yes mode
578 optional_vars="$optional_vars $splitter_optional_vars $renumber_optional_vars hdf5_ok med3_ok"
580 # --with-interp-kernel-only=no mode
581 obligatory_vars="$obligatory_vars python_ok boost_ok swig_ok hdf5_ok med3_ok $splitter_obligatory_vars"
582 optional_vars="$optional_vars $splitter_optional_vars $renumber_optional_vars"
587 # obligatory products
590 echo "--- Obligatory products:"
592 missing_obligatory=no
593 for var in $obligatory_vars
596 if test x$toto == "x"; then toto="no" ; fi
597 if test x$toto == "xno"; then missing_obligatory=yes ; fi
598 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
602 if test x$missing_obligatory == "xyes"; then
603 AC_MSG_ERROR([one or more obligatory product is missing])
607 # GUI products (if enabled)
610 if test "$gui_vars" != "" ; then
612 echo "--- GUI products (optional):"
617 if test x$toto == "x"; then toto="no"; fi
618 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
627 echo "--- Other (optional) products:"
629 for var in $optional_vars
632 if test x$toto != "x"; then
633 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
639 # default ORB (if enabled)
642 if test "$DEFAULT_ORB" != "" ; then
644 echo "Default ORB : $DEFAULT_ORB"
648 dnl We don t need to say when we re entering directories if we re using
649 dnl GNU make becuase make does it for us.
650 if test "X$GMAKE" = "Xyes"; then
651 AC_SUBST(SETX) SETX=":"
653 AC_SUBST(SETX) SETX="set -x"
656 if test -n "${NO_MED_TRACE+X}"; then
657 CPPFLAGS="${CPPFLAGS} -D_NO_MED_TRACE_"
661 echo ---------------------------------------------
662 echo generating Makefiles and configure files
663 echo ---------------------------------------------
666 AC_OUTPUT_COMMANDS([ \
671 AC_CONFIG_COMMANDS([hack_libtool],[
672 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
673 $(pwd)/hack_libtool \1 \"\$[@]\" \n\
675 CC=\"hack_libtool\"%g" libtool
676 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
677 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
678 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
682 adm_local_without_kernel/SALOMEconfig.h \
685 adm_local/unix/config_files/Makefile \
686 adm_local/unix/Makefile \
687 adm_local/cmake_files/Makefile \
689 adm_local_without_kernel/unix/config_files/Makefile \
690 adm_local_without_kernel/unix/Makefile \
691 adm_local_without_kernel/Makefile \
693 resources/SalomeApp.xml \
694 resources/MEDCatalog.xml \
699 src/INTERP_KERNEL/Makefile \
700 src/INTERP_KERNELTest/Makefile \
701 src/MEDCoupling/Makefile \
702 src/MEDCoupling/Test/Makefile \
703 src/MEDLoader/Makefile \
704 src/MEDLoader/Swig/Makefile \
705 src/MEDLoader/Test/Makefile \
706 src/MEDCoupling_Swig/Makefile \
707 src/MEDCouplingCorba/Makefile \
708 src/MEDCouplingCorba/Client/Makefile \
709 src/MEDCouplingCorba/Test/Makefile \
710 src/MEDCouplingCorba_Swig/Makefile \
711 src/MEDCouplingCorba_Swig/Client/Makefile \
712 src/MEDCalculator/Makefile \
713 src/MEDCalculator/Swig/Makefile \
714 src/MEDCalculator/Test/Makefile \
715 src/MEDPartitioner/Makefile \
716 src/MEDPartitioner/Test/Makefile \
717 src/RENUMBER/Makefile \
718 src/ParaMEDCouplingCorba/Makefile \
719 src/ParaMEDMEM/Makefile \
720 src/ParaMEDMEMComponent/Makefile \
721 src/ParaMEDLoader/Makefile \
722 src/ParaMEDMEMTest/Makefile \
723 src/ParaMEDMEM_Swig/Makefile \
724 src/MEDGUI/Makefile \
726 src/MEDOP/cmp/Makefile \
727 src/MEDOP/tui/Makefile \
728 src/MEDOP/tui/xmedpy/Makefile \
729 src/MEDOP/res/Makefile \
730 src/MEDOP/res/testfiles/Makefile \
731 src/MEDOP/gui/dialogs/Makefile \
732 src/MEDOP/gui/Makefile \
733 src/MEDOP/exe/Makefile \
734 src/MEDOP/exe/image2med/Makefile \
735 src/MEDOP/doc/Makefile \
736 src/MEDOP/doc/sphinx/conf.py \
737 src/MEDOP/doc/sphinx/Makefile \
739 doc/salome/Makefile \
740 doc/salome/tui/Makefile \
741 doc/salome/tui/doxyfile \
742 doc/salome/tui/static/header.html \
743 doc/doxygen/Makefile \
744 doc/doxygen/Doxyfile_med_user \
745 doc/doxygen/static/header.html \