1 # Copyright (C) 2007-2012 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], [6.5.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 ---------------------------------------------
273 CHECK_HTML_GENERATORS
280 # CHECK_GUI ONLY if MED_WITH_KERNEL is yes
285 # Other tests should be performed only in --with-interp-kernel-only=no mode
288 if test "$with_interp_kernel_only" != "yes" ; then
291 echo ---------------------------------------------
293 echo ---------------------------------------------
299 echo ---------------------------------------------
301 echo ---------------------------------------------
308 echo ---------------------------------------------
309 echo testing BOOST Library
310 echo ---------------------------------------------
317 echo ---------------------------------------------
318 echo checking SPLITTER
319 echo ---------------------------------------------
322 AC_ENABLE_SPLITTER(yes)
324 if test "x$ENABLE_SPLITTER" = "xyes"; then
327 echo ---------------------------------------------
328 echo testing ParMETIS
329 echo ---------------------------------------------
332 CHECK_PARMETIS dnl parmetis_ok is set to yes by CHECK_PARMETIS
335 echo ---------------------------------------------
337 echo ---------------------------------------------
340 CHECK_METIS dnl metis_ok is set to yes by CHECK_METIS
343 echo ---------------------------------------------
345 echo ---------------------------------------------
348 dnl scotch_ok is set to yes by CHECK_SCOTCH
351 echo ---------------------------------------------
353 echo ---------------------------------------------
356 dnl libxml_ok is set to yes by CHECK_LIBXML
360 AC_ENABLE_RENUMBER(yes)
362 if test "x$ENABLE_RENUMBER" = "xyes"; then
363 if test "x$metis_ok" = "x"; then
365 echo ---------------------------------------------
367 echo ---------------------------------------------
370 CHECK_METIS dnl metis_ok is set to yes by CHECK_METIS
374 if test "${MED_WITH_KERNEL}" = "yes"; then
377 dnl ---------------------------------------------
379 dnl ---------------------------------------------
385 echo ---------------------------------------------
387 echo ---------------------------------------------
397 CORBA=adm_local/unix/$corba
400 dnl echo ---------------------------------------------
401 dnl echo testing mico
402 dnl echo ---------------------------------------------
408 echo ---------------------------------------------
409 echo testing SALOME Kernel
410 echo ---------------------------------------------
416 echo ---------------------------------------------
417 echo testing SALOME GUI
418 echo ---------------------------------------------
423 if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then
427 if test "${SalomeGUI_need}" == "yes"; then
428 if test "${FullGUI_ok}" != "yes"; then
429 AC_MSG_WARN(For configure MED module necessary full GUI!)
431 elif test "${SalomeGUI_need}" == "auto"; then
432 if test "${FullGUI_ok}" != "yes"; then
433 AC_MSG_WARN(Full GUI not found. Build will be done without GUI!)
435 elif test "${SalomeGUI_need}" == "no"; then
436 echo Build without GUI option has been chosen
439 if test "${gui_ok}" = "yes" ; then
442 echo ---------------------------------------------
443 echo testing LEX \& YACC
444 echo ---------------------------------------------
453 echo ---------------------------------------------
455 echo ---------------------------------------------
461 echo ---------------------------------------------
463 echo ---------------------------------------------
469 echo ---------------------------------------------
471 echo ---------------------------------------------
477 echo ---------------------------------------------
478 echo testing OpenCascade
479 echo ---------------------------------------------
484 fi # if "${gui_ok}" = "yes" ...
488 fi # "$with_interp_kernel_only" != "yes" ...
492 # Additional substitutions
501 AM_CONDITIONAL(MED_ENABLE_KERNEL, [test "$MED_WITH_KERNEL" = yes])
502 AM_CONDITIONAL(MED_ENABLE_MICROMED, [test "$with_interp_kernel_only" = yes])
503 AM_CONDITIONAL(MED_ENABLE_GUI, [test "${gui_ok}" = "yes"])
504 AM_CONDITIONAL(MED_ENABLE_SSTREAM, [test "$HAVE_SSTREAM" = yes])
505 AM_CONDITIONAL(MED_SWIG_1_3_21, [test "$SWIG_VERSION" = 1.3.21])
506 AM_CONDITIONAL(MED_ENABLE_SPLITTER, [test "$ENABLE_SPLITTER" = yes])
507 AM_CONDITIONAL(MED_ENABLE_PARMETIS, [test "$ENABLE_PARMETIS" = yes])
508 AM_CONDITIONAL(MED_ENABLE_METIS, [test "$ENABLE_METIS" = yes])
509 AM_CONDITIONAL(MED_ENABLE_SCOTCH, [test "$ENABLE_SCOTCH" = yes])
510 AM_CONDITIONAL(MED_WITHMPI, [test "$WITHMPI" = yes])
511 AM_CONDITIONAL(MED_ENABLE_FVM, [test "$ENABLE_FVM" = yes])
512 AM_CONDITIONAL(MED_ENABLE_MED3, [test "$med3_ok" = yes])
513 AM_CONDITIONAL(MED_ENABLE_RENUMBER, [test "$ENABLE_RENUMBER" = yes])
514 AM_CONDITIONAL(BOOST_IS_OK, [test "$boost_ok" = yes])
520 echo ---------------------------------------------
522 echo ---------------------------------------------
525 if test "$with_interp_kernel_only" = "yes"; then
526 echo "Configure (Micro MED)"
527 elif test "$MED_WITH_KERNEL" = "no"; then
528 echo "Configure (without Kernel)"
529 elif test "${SalomeGUI_need}" == "no"; then
530 echo "Configure (without GUI)"
535 obligatory_vars="cc_ok threads_ok doxygen_ok"
536 optional_vars="mpi_ok fvm_ok cppunit_ok"
539 if test "x$ENABLE_SPLITTER" = "xyes" ; then
540 splitter_obligatory_vars="libxml_ok"
541 splitter_optional_vars="metis_ok parmetis_ok scotch_ok"
544 if test "x$ENABLE_RENUMBER" = "xyes" ; then
545 if test "x$splitter_optional_vars" = "x" ; then
546 renumber_optional_vars="metis_ok"
549 if test "$MED_WITH_KERNEL" = "yes" ; then
551 obligatory_vars="$obligatory_vars python_ok boost_ok swig_ok hdf5_ok med3_ok omniORB_ok $splitter_obligatory_vars"
552 optional_vars="$optional_vars $splitter_optional_vars $renumber_optional_vars graphviz_ok Kernel_ok"
553 if test "${gui_ok}" = "yes"; then
555 gui_vars="lex_yacc_ok OpenGL_ok qt_ok vtk_ok occ_ok gui_ok"
556 elif test "${SalomeGUI_need}" != "no"; then
561 if test "$with_interp_kernel_only" == "yes" ; then
562 # --with-interp-kernel-only=yes mode
563 optional_vars="$optional_vars $splitter_optional_vars $renumber_optional_vars hdf5_ok med3_ok"
565 # --with-interp-kernel-only=no mode
566 obligatory_vars="$obligatory_vars python_ok boost_ok swig_ok hdf5_ok med3_ok $splitter_obligatory_vars"
571 # obligatory products
574 echo "--- Obligatory products:"
576 missing_obligatory=no
577 for var in $obligatory_vars
580 if test x$toto == "x"; then toto="no" ; fi
581 if test x$toto == "xno"; then missing_obligatory=yes ; fi
582 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
586 if test x$missing_obligatory == "xyes"; then
587 AC_MSG_ERROR([one or more obligatory product is missing])
591 # GUI products (if enabled)
594 if test "$gui_vars" != "" ; then
596 echo "--- GUI products (optional):"
601 if test x$toto == "x"; then toto="no"; fi
602 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
611 echo "--- Other (optional) products:"
613 for var in $optional_vars
616 if test x$toto != "x"; then
617 printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
623 # default ORB (if enabled)
626 if test "$DEFAULT_ORB" != "" ; then
628 echo "Default ORB : $DEFAULT_ORB"
632 dnl We don t need to say when we re entering directories if we re using
633 dnl GNU make becuase make does it for us.
634 if test "X$GMAKE" = "Xyes"; then
635 AC_SUBST(SETX) SETX=":"
637 AC_SUBST(SETX) SETX="set -x"
640 if test -n "${NO_MED_TRACE+X}"; then
641 CPPFLAGS="${CPPFLAGS} -D_NO_MED_TRACE_"
645 echo ---------------------------------------------
646 echo generating Makefiles and configure files
647 echo ---------------------------------------------
650 AC_OUTPUT_COMMANDS([ \
655 AC_CONFIG_COMMANDS([hack_libtool],[
656 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
657 $(pwd)/hack_libtool \1 \"\$[@]\" \n\
659 CC=\"hack_libtool\"%g" libtool
660 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
661 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
662 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
666 adm_local_without_kernel/unix/SALOMEconfig.h \
669 adm_local/unix/config_files/Makefile \
670 adm_local/unix/Makefile \
671 adm_local/cmake_files/Makefile \
673 adm_local_without_kernel/unix/config_files/Makefile \
674 adm_local_without_kernel/unix/Makefile \
675 adm_local_without_kernel/Makefile \
677 resources/SalomeApp.xml \
678 resources/MEDCatalog.xml \
683 src/MEDWrapper/Makefile \
684 src/MEDWrapper/Base/Makefile \
685 src/MEDWrapper/Factory/Makefile \
686 src/MEDWrapper/V2_1/Makefile \
687 src/MEDWrapper/V2_1/Core/Makefile \
688 src/MEDWrapper/V2_1/Wrapper/Makefile \
689 src/MEDWrapper/V2_2/Makefile \
690 src/MEDMEM/Doxyfile_med_devel \
691 src/MEDMEM/Doxyfile_med_user \
692 src/MEDMEM/Makefile \
693 src/MEDMEM_SWIG/Makefile \
694 src/MEDMEMBinTest/Makefile \
695 src/MEDMEMCppTest/Makefile \
696 src/INTERP_KERNEL/Makefile \
697 src/INTERP_KERNELTest/Makefile \
698 src/MEDCoupling/Makefile \
699 src/MEDCoupling/Test/Makefile \
700 src/MEDLoader/Makefile \
701 src/MEDLoader/Swig/Makefile \
702 src/MEDLoader/Test/Makefile \
703 src/MEDCoupling_Swig/Makefile \
704 src/MEDCouplingCorba/Makefile \
705 src/MEDCouplingCorba/Client/Makefile \
706 src/MEDCouplingCorba/Test/Makefile \
707 src/MEDCouplingCorba_Swig/Makefile \
708 src/MEDCouplingCorba_Swig/Client/Makefile \
709 src/MEDCalculator/Makefile \
710 src/MEDCalculator/Swig/Makefile \
711 src/MEDCalculator/Test/Makefile \
712 src/MEDSPLITTER/Makefile \
713 src/MEDSPLITTER/Test/Makefile \
714 src/MEDSPLITTER_Swig/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/MEDMEM_I/Makefile \
726 src/MedCorba_Swig/Makefile \
727 src/MED_SWIG/Makefile \
728 src/MedClient/Makefile \
729 src/MedClient/src/Makefile \
730 src/MedClient/test/Makefile \
731 src/MedClient/test/environ/Makefile \
732 src/MedClient/test/environ/runContainer \
733 src/MedClient/test/environ/runEnvironTests \
734 src/MedClient/test/environ/runTestMedCorba \
735 src/MedClient/test/environ/stopContainer \
736 src/MedClient/test/environ/csh/init1 \
737 src/MedClient/test/environ/csh/init2 \
738 src/MedClient/test/environ/csh/init3 \
739 src/MedClient/test/environ/csh/Makefile \
740 src/MedClient/test/environ/csh/runContainer \
741 src/MedClient/test/environ/csh/runEnvironTests \
742 src/MedClient/test/environ/csh/stopContainer \
743 src/MedClient/test/test1/Makefile \
744 src/MedClient/test/test2/Makefile \
745 src/MEDGUI/Makefile \
747 doc/MEDMEM/Makefile \
748 doc/MEDMEM/MEDMEM_Content.tex \
749 doc/MEDMEM/MEDMEM_UML_light.png \
750 doc/MEDMEM/MEDMEM_UML.png \
751 doc/MEDMEM/MEDMEM_UsersGuide.tex \
752 doc/salome/Makefile \
753 doc/salome/tui/Makefile \
754 doc/salome/tui/doxyfile \
755 doc/salome/tui/static/header.html \
756 doc/doxygen/Makefile \
757 doc/doxygen/Doxyfile_med_user \
758 doc/doxygen/static/header.html \