Salome HOME
Update version to 3.2.0a1
[modules/med.git] / configure.in.base
index 064d002baa606c4909e7f3f9c41fffaad5ee461b..632529721fe5d960f0a46e6b1899d0c40022cb91 100644 (file)
@@ -1,23 +1,3 @@
-#
-#  PLEASE DO NOT MODIFY configure.in FILE
-#
-#  ALL CHANGES WILL BE DISCARDED BY THE NEXT
-#  build_configure COMMAND
-#
-#  CHANGES MUST BE MADE IN configure.in.base FILE
-#
-#
-# Author : Marc Tajchman (CEA)
-# Date : 28/06/2001
-# Modified by : Patrick GOLDBRONN (CEA)
-# Modified by : Marc Tajchman (CEA)
-#
-# Created from configure.in.base
-#
-
-AC_INIT(src)
-AC_CONFIG_AUX_DIR(${KERNEL_ROOT_DIR}/salome_adm/unix/config_files)
-AC_CANONICAL_HOST
 
 PACKAGE=salome
 AC_SUBST(PACKAGE)
@@ -44,6 +24,66 @@ echo Build  root directory : $ROOT_BUILDDIR
 echo
 echo
 
+dnl remember MED_WITH_KERNEL set by build configure
+old_with_kernel=${MED_WITH_KERNEL}
+
+dnl
+dnl Check --with-kernel option
+echo
+dnl  ---------------------------------------------
+                 WITH_KERNEL
+dnl  ---------------------------------------------
+dnl
+
+dnl   Update and re-run configure if there was  build_configure --without-kernel
+dnl   but configure --with-kernel=DIR is being called
+
+if test "x${old_with_kernel}" != "x${MED_WITH_KERNEL}"; then
+    if test "x${old_with_kernel}" == "xno" ; then
+         if test ! -d "${KERNEL_ROOT_DIR}"; then
+             echo "failed : KERNEL_ROOT_DIR variable is not correct !"
+             exit
+         fi
+         kernel_check_in_aclocal=`grep KERNEL_ROOT_DIR ${ROOT_SRCDIR}/aclocal.m4`
+         if test "x${kernel_check_in_aclocal}" == "x"; then
+             echo "Configuration changed: without KERNEL -> with KERNEL"
+             echo -n "Updating 'configure' script ...  "
+             cd $ROOT_SRCDIR
+             aclocal --acdir=adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
+             if autoconf; then
+               echo "done"
+             else
+               echo "failed (check file permissions and/or user quotas ...)"
+                cd $ROOT_BUILDDIR
+                exit
+             fi
+             cd $ROOT_BUILDDIR
+             $0 $*
+             exit
+         fi
+    fi
+fi
+
+
+dnl  AC_CONFIG_AUX_DIR - path to install-sh, config.sub, config.guess,
+dnl  Automake and Libtool scripts etc. 
+dnl  config.sub, config.guess are needed for AC_CANONICAL_HOST
+
+WITHOUT_KERNEL_CONFIG_DIR=${ROOT_SRCDIR}/adm_local_without_kernel/unix/config_files
+AUX_CONFIG_DIR=""
+if test "${MED_WITH_KERNEL}" == "yes"; then
+   AUX_CONFIG_DIR=${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
+else
+   AUX_CONFIG_DIR=${WITHOUT_KERNEL_CONFIG_DIR}
+fi
+AC_CONFIG_AUX_DIR(${AUX_CONFIG_DIR})
+AC_CANONICAL_HOST
+
+
+dnl Modification B. Secher portage sur osf CCRT
+AC_CHECK_PROG(SHELL,sh,,)
+AC_SUBST(SHELL)
+
 if test -z "$AR"; then
    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
 fi
@@ -82,7 +122,7 @@ dnl Fix up the INSTALL macro if it s a relative path. We want the
 dnl full-path to the binary instead.
 case "$INSTALL" in
    *install-sh*)
-      INSTALL='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh
+      INSTALL="\${AUX_CONFIG_DIR}/install-sh -c"
       ;;
 esac
 
@@ -96,6 +136,8 @@ cc_ok=no
 dnl inutil car libtool
 dnl AC_PROG_CC
 AC_PROG_CXX
+AC_CXX_WARNINGS
+AC_CXX_TEMPLATE_OPTIONS
 AC_DEPEND_FLAG
 # AC_CC_WARNINGS([ansi])
 cc_ok=yes
@@ -106,6 +148,16 @@ AC_CHECK_LIB(dl,dlopen)
 dnl add library libm :
 AC_CHECK_LIB(m,ceil)
 
+dnl Library librt : for alpha/osf
+AC_CHECK_LIB(rt,nanosleep)
+
+dnl 
+dnl Check if we use std iostream by default or if we must add
+dnl a compiler directive for that
+dnl
+
+AC_CXX_USE_STD_IOSTREAM
+
 dnl 
 dnl Well we use sstream which is not in gcc pre-2.95.3
 dnl We must test if it exists. If not, add it in include !
@@ -115,11 +167,11 @@ AC_CXX_HAVE_SSTREAM
 
 dnl
 dnl ---------------------------------------------
-dnl testing MPICH
+dnl testing linker
 dnl ---------------------------------------------
 dnl
 
-CHECK_MPICH
+AC_LINKER_OPTIONS
 
 echo
 echo ---------------------------------------------
@@ -140,14 +192,6 @@ echo
 
 CHECK_PYTHON
 
-dnl echo
-dnl echo ---------------------------------------------
-dnl echo testing java
-dnl echo ---------------------------------------------
-dnl echo
-
-dnl CHECK_JAVA
-
 echo
 echo ---------------------------------------------
 echo testing swig
@@ -164,21 +208,68 @@ echo
 
 ENABLE_PTHREADS
 
+dnl BOOST is needed for MED Wrapper
 echo
 echo ---------------------------------------------
-echo testing omniORB
+echo BOOST Library
 echo ---------------------------------------------
 echo
 
-CHECK_OMNIORB
+CHECK_BOOST
+
+echo
+echo ---------------------------------------------
+echo testing HDF5
+echo ---------------------------------------------
+echo
+
+CHECK_HDF5
+
+echo
+echo ---------------------------------------------
+echo testing MED2
+echo ---------------------------------------------
+echo
+
+CHECK_MED2
+
+
+if test "${MED_WITH_KERNEL}" == "yes"; then
+{
+#CPPFLAGS="$CPPFLAGS -DMED_WITH_KERNEL"
 
 dnl echo
 dnl echo ---------------------------------------------
-dnl echo testing mico
+dnl echo testing java
 dnl echo ---------------------------------------------
 dnl echo
 
-dnl CHECK_MICO
+dnl CHECK_JAVA
+
+dnl
+dnl ---------------------------------------------
+dnl testing MPICH
+dnl ---------------------------------------------
+dnl
+
+CHECK_MPI
+CHECK_MPICH
+
+dnl
+dnl ---------------------------------------------
+dnl testing WITHIHM
+dnl ---------------------------------------------
+dnl
+
+CHECK_WITHIHM
+
+echo
+echo ---------------------------------------------
+echo testing omniORB
+echo ---------------------------------------------
+echo
+
+CHECK_OMNIORB
 
 echo
 echo ---------------------------------------------
@@ -219,43 +310,52 @@ CHECK_VTK
 
 echo
 echo ---------------------------------------------
-echo testing HDF5
+echo Testing OpenCascade
 echo ---------------------------------------------
 echo
 
-CHECK_HDF5
+CHECK_CAS
 
 echo
 echo ---------------------------------------------
-echo testing MED2
+echo Testing Kernel
 echo ---------------------------------------------
 echo
 
-CHECK_MED2
+CHECK_KERNEL
 
-echo
-echo ---------------------------------------------
-echo Testing OpenCascade
-echo ---------------------------------------------
-echo
+dnl echo
+dnl echo ---------------------------------------------
+dnl echo testing mico
+dnl echo ---------------------------------------------
+dnl echo
 
-CHECK_CAS
+dnl CHECK_MICO
 
 echo
 echo ---------------------------------------------
-echo Testing html generators
+echo testing MSG2QM
 echo ---------------------------------------------
 echo
 
-CHECK_HTML_GENERATORS
+CHECK_MSG2QM
+
+}
+else
+{
+  WITHIHM=""
+  AC_SUBST(WITHIHM)
+  CPPFLAGS="$CPPFLAGS -DMED_WITHOUT_KERNEL"
+}
+fi # MED_WITH_KERNEL
 
 echo
 echo ---------------------------------------------
-echo Testing Kernel
+echo Testing html generators
 echo ---------------------------------------------
 echo
 
-CHECK_KERNEL
+CHECK_HTML_GENERATORS
 
 echo
 echo ---------------------------------------------
@@ -263,9 +363,13 @@ echo Summary
 echo ---------------------------------------------
 echo
 
-echo Configure
-variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok med2_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok"
+if test "$MED_WITH_KERNEL" == "no"; then 
+   echo "Configure (without Kernel)"
+else
+   echo Configure
+fi
 
+variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok hdf5_ok med2_ok boost_ok doxygen_ok graphviz_ok OpenGL_ok qt_ok vtk_ok omniORB_ok occ_ok Kernel_ok"
 for var in $variables
 do
    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
@@ -294,12 +398,13 @@ else
 fi
 
 # make other build directories
-for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources share/salome/doc idl
+for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources idl
 do
 #   if test ! -d $rep ; then
 #      eval mkdir $rep
 #   fi
-    $INSTALL -d $rep
+#    $INSTALL -d $rep
+    mkdir -p $rep
 done
 
 echo 
@@ -327,19 +432,23 @@ dnl copy shells and utilities contained in the bin directory
 dnl excluding .in files (treated in AC-OUTPUT below) and CVS 
 dnl directory
 
-cd bin
+mkdir -p bin/salome
+cd bin/salome
+
 for i in $ROOT_SRCDIR/bin/*
 do
   local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
   case "$local_bin" in
         *.in | *~)                    ;;
-        ./bin/CVS)                    ;;
-        *) ln -fs $i; echo $local_bin ;;
+        ./bin/CVS | ./bin/salome)                    ;;
+        *) ln -fs $i .; echo $local_bin ;;
   esac
 done
 cd $ROOT_BUILDDIR
 
+if test ${MED_WITH_KERNEL} = "yes"; then
 AC_SUBST_FILE(ENVSCRIPT) ENVSCRIPT=salome_adm/unix/envScript
+fi
 
 dnl copy xml files to the build tree (lib directory)
 dnl pourquoi ????