Hi Adam,

After a long break, I am back on the Salome packaging. I was pleased
to discover all your advances and the new building process for every
module. Thank you very much for all your efforts. I think that it is
the right time to start porting the patches to Salome 5.1.4 so we can
submit them to upstream before a new release.

I have enclosed most of the patches for building the KERNEL module with
the 5.1.4 version. Moreover a start of the documentation that I plan
to send for patches submission can be found here:
https://hg.python-science.org/salome-packaging/file/d60a8c2112dc/debian-patch-review.rst

However I wanted to discuss with you on 3 patches that I did not include
because I thought that they concern Debian choices:

    - kernel-config-extra.patch
    - kernel-doc-images-svg.patch
    - kernel-install-without-docs.patch

and this one does not make sense alone because the command is then
renamed in 'debian/rules':

    - kernel-python-noexec.patch

In case you have arguments or ideas about how to submit them, I will
include them in the report. Now I plan to continue on the following
modules.

All the best,

André

Allow a separate MPI include directory (used by Debian's /usr/include/mpi link)

Index: salome/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_mpi.m4
===================================================================
--- a/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_mpi.m4
+++ b/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_mpi.m4
@@ -28,6 +28,10 @@ AC_ARG_WITH(mpi_lib,
    [AC_HELP_STRING([--with-mpi_lib=DIR],[directory path of MPICH lib installation])],
    MPILIBREQUESTED="$withval")
 
+AC_ARG_WITH(mpi_include,
+   [AC_HELP_STRING([--with-mpi_include=DIR],[directory path of MPICH header file installation])],
+   MPIINCLUDEREQUESTED="$withval")
+
 AC_ARG_WITH(mpi,
    [AC_HELP_STRING([--with-mpi=DIR],[root directory path of MPICH installation])],
    MPIREQUESTED="yes",MPIREQUESTED="no")
@@ -59,6 +63,10 @@ if test x"$MPIREQUESTED" = xyes; then
     MPI_LIBS="-L$MPILIBREQUESTED"
   fi
 
+  if test x"$MPIINCLUDEREQUESTED" != x; then
+    MPI_INCLUDES="-I$MPIINCLUDEREQUESTED"
+  fi
+
   CPPFLAGS_old="$CPPFLAGS"
   CPPFLAGS="$MPI_INCLUDES $CPPFLAGS"
   AC_CHECK_HEADER(mpi.h,WITHMPI="yes",WITHMPI="no")
Debian-specific patch to use our libmpi++.so alternatives symlink.

Index: salome/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_mpi.m4
===================================================================
--- a/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_mpi.m4
+++ b/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_mpi.m4
@@ -85,7 +85,7 @@ if test x"$MPIREQUESTED" = xyes; then
 
   if test "$WITHMPI" = "yes";then
     mpi_ok=yes
-    MPI_LIBS="$MPI_LIBS -lmpi -lmpio -lmpiCC"
+    MPI_LIBS="$MPI_LIBS -lmpi -lmpi++"
   else
     mpi_ok=no
   fi
The HDF5 library requires MPI in order to work, so the MPI check needs to go
first, and the MPI variables need to be in the HDF5 check.

Index: salome/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_hdf5.m4
===================================================================
--- a/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_hdf5.m4
+++ b/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_hdf5.m4
@@ -66,7 +66,7 @@ fi
 dnl hdf5 headers
 
 CPPFLAGS_old="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
+CPPFLAGS="$CPPFLAGS $MPI_INCLUDES $LOCAL_INCLUDES"
 AC_CHECK_HEADER(hdf5.h,hdf5_ok=yes ,hdf5_ok=no)
 CPPFLAGS="$CPPFLAGS_old"
 
@@ -77,7 +77,7 @@ then
 dnl hdf5 library
 
   LIBS_old="$LIBS"
-  LIBS="$LIBS $LOCAL_LIBS"
+  LIBS="$LIBS $MPI_LIBS $LOCAL_LIBS"
   AC_CHECK_LIB(hdf5,H5open,hdf5_ok=yes,hdf5_ok=no)
   LIBS="$LIBS_old"
 
@@ -85,9 +85,9 @@ fi
 
 if  test "x$hdf5_ok" = "xyes"
 then
-  HDF5_INCLUDES="$LOCAL_INCLUDES"
-  HDF5_LIBS="$LOCAL_LIBS -lhdf5 $LOCAL_RLIBS"
-  HDF5_MT_LIBS="$LOCAL_LIBS -lhdf5 $LOCAL_RLIBS"
+  HDF5_INCLUDES="$MPI_INCLUDES $LOCAL_INCLUDES"
+  HDF5_LIBS="$MPI_LIBS $LOCAL_LIBS -lhdf5 $LOCAL_RLIBS"
+  HDF5_MT_LIBS="$MPI_LIBS $LOCAL_LIBS -lhdf5 $LOCAL_RLIBS"
 fi
 
 if  test "x$hdf5_ok" = "xyes"
Index: salome/KERNEL_SRC_5.1.4/configure.ac
===================================================================
--- a/KERNEL_SRC_5.1.4/configure.ac
+++ b/KERNEL_SRC_5.1.4/configure.ac
@@ -222,6 +222,14 @@ echo
 
 CHECK_LIBXML
 
+echo
+echo ---------------------------------------------
+echo checking if MPI is requested by user
+echo ---------------------------------------------
+echo
+
+CHECK_MPI
+
 if test x$with_onlylauncher = xno; then
 echo
 echo ---------------------------------------------
@@ -303,14 +311,6 @@ echo
 
 echo
 echo ---------------------------------------------
-echo checking if MPI is requested by user
-echo ---------------------------------------------
-echo
-
-CHECK_MPI
-
-echo
-echo ---------------------------------------------
 echo checking if PaCO++ is requested by user
 echo ---------------------------------------------
 echo
Remove unnecessary extern "C" instances and add one necessary one.
Background: One must not #include mpi.h from within an extern "C" block.
Both mpi.h and hdf5.h are C++-safe, and should be included directly without
extern "C".  For details, see:
http://www.open-mpi.org/community/lists/users/2007/12/4763.php

Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFobject.hxx
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFobject.hxx
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFobject.hxx
@@ -27,10 +27,7 @@
 #ifndef HDFOBJECT_HXX
 #define HDFOBJECT_HXX
 
-extern "C"
-{
 #include "HDFtypes.h"
-}
 #include "HDFexport.hxx"
 
 class HDFPERSIST_EXPORT HDFobject {
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFinternalObject.cc
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFinternalObject.cc
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFinternalObject.cc
@@ -24,10 +24,7 @@
 //  File   : HDFinternalObject.cc
 //  Module : SALOME
 //
-extern "C"
-{
 #include "hdfi.h"
-}
 #include "HDFinternalObject.hxx"
 
 HDFinternalObject::HDFinternalObject(const char *name)
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFattribute.cc
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFattribute.cc
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFattribute.cc
@@ -24,10 +24,7 @@
 //  File   : HDFattribute.cc
 //  Module : SALOME
 //
-extern "C"
-{
 #include "hdfi.h"
-}
 #include "HDFexception.hxx"
 #include "HDFattribute.hxx"
 #include "HDFinternalObject.hxx"
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFcontainerObject.cc
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFcontainerObject.cc
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFcontainerObject.cc
@@ -24,10 +24,7 @@
 //  File   : HDFcontainerObject.cc
 //  Module : SALOME
 //
-extern "C"
-{
 #include "hdfi.h"
-}
 #include "HDFcontainerObject.hxx"
 #include "HDFexception.hxx"
 
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFdataset.cc
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFdataset.cc
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFdataset.cc
@@ -24,11 +24,8 @@
 //  File   : HDFdataset.cc
 //  Module : SALOME
 //
-extern "C"
-{
 #include "hdfi.h"
 #include <string.h>
-}
 #include "HDFdataset.hxx"
 #include "HDFcontainerObject.hxx"
 #include "HDFexception.hxx"
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFfile.cc
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFfile.cc
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFfile.cc
@@ -24,8 +24,6 @@
 //  File   : HDFfile.cc
 //  Module : SALOME
 //
-extern "C"
-{
 #include "hdfi.h"
 #ifndef WIN32
 #include <unistd.h>
@@ -35,7 +33,6 @@ extern "C"
 #define access _access
 #endif
 #include <string.h>
-}
 #include <iostream>
 #include "HDFfile.hxx"
 #include "HDFexception.hxx"
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFgroup.cc
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFgroup.cc
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFgroup.cc
@@ -24,11 +24,8 @@
 //  File   : HDFgroup.cc
 //  Module : SALOME
 //
-extern "C"
-{
 #include "hdfi.h"
 #include <string.h>
-}
 #include "HDFgroup.hxx"
 #include "HDFexception.hxx"
 
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFcontainerObject.hxx
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFcontainerObject.hxx
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFcontainerObject.hxx
@@ -27,10 +27,7 @@
 #ifndef HDFCONTAINEROBJECT_HXX
 #define HDFCONTAINEROBJECT_HXX
 
-extern "C"
-{
 #include "HDFtypes.h"
-}
 #include "HDFobject.hxx"
 #include "HDFinternalObject.hxx"
 #include "HDFexport.hxx"
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFconvert.hxx
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFconvert.hxx
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFconvert.hxx
@@ -27,8 +27,6 @@
 #ifndef HDFCONVERT_HXX
 #define HDFCONVERT_HXX
 
-extern "C"
-{
 #include "HDFtypes.h"
 #ifndef WIN32
 #include <unistd.h>
@@ -40,7 +38,6 @@ extern "C"
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-}
 #include "HDFexport.hxx"
 #include "HDFcontainerObject.hxx"
 #include "HDFdataset.hxx"
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFOI.hxx
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFOI.hxx
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFOI.hxx
@@ -24,10 +24,7 @@
 //  File   : HDFOI.hxx
 //  Module : SALOME
 //
-extern "C"
-{
 #include "HDFtypes.h"
-}
 
 #include "HDFattribute.hxx"
 #include "HDFfile.hxx"
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/hdfi.h
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/hdfi.h
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/hdfi.h
@@ -33,6 +33,9 @@
 
 /* HDF C INTERFACE */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 /* File Interface */
 extern
 hdf_idt HDFfileCreate(char *name);
@@ -126,5 +129,8 @@ hdf_err HDFobjectIdentify(hdf_idt fid,const char *path,int i,char *name);
 
 extern
 hdf_err HDFobjectType(hdf_idt id, char *name, hdf_object_type *type);
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* HDFI_H */
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFinternalObject.hxx
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFinternalObject.hxx
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFinternalObject.hxx
@@ -27,10 +27,7 @@
 #ifndef HDFINTERNALOBJECT_HXX
 #define HDFINTERNALOBJECT_HXX
 
-extern "C"
-{
 #include "HDFtypes.h"
-}
 #include "HDFobject.hxx"
 #include "HDFexport.hxx"
 
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFattribute.hxx
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFattribute.hxx
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFattribute.hxx
@@ -27,10 +27,7 @@
 #ifndef HDFATTRIBUTE_HXX
 #define HDFATTRIBUTE_HXX
 
-extern "C"
-{
 #include "HDFtypes.h"
-}
 #include "HDFinternalObject.hxx"
 #include "HDFcontainerObject.hxx"
 
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFdataset.hxx
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFdataset.hxx
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFdataset.hxx
@@ -27,10 +27,7 @@
 #ifndef HDFDATASET_HXX
 #define HDFDATASET_HXX
 
-extern "C"
-{
 #include "HDFtypes.h"
-}
 #include "HDFinternalObject.hxx"
 #include "HDFcontainerObject.hxx"
 #include "HDFexport.hxx"
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFfile.hxx
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFfile.hxx
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFfile.hxx
@@ -27,10 +27,7 @@
 #ifndef HDFFILE_HXX
 #define HDFFILE_HXX
 
-extern "C"
-{
 #include "HDFtypes.h"
-}
 #include "HDFcontainerObject.hxx"
 #include "HDFexport.hxx"
 
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFgroup.hxx
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFgroup.hxx
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFgroup.hxx
@@ -27,10 +27,7 @@
 #ifndef HDFGROUP_HXX
 #define HDFGROUP_HXX
 
-extern "C"
-{
 #include "HDFtypes.h"
-}
 #include "HDFcontainerObject.hxx"
 #include "HDFexport.hxx"
 
Index: salome/KERNEL_SRC_5.1.4/src/HDFPersist/HDFobject.cc
===================================================================
--- a/KERNEL_SRC_5.1.4/src/HDFPersist/HDFobject.cc
+++ b/KERNEL_SRC_5.1.4/src/HDFPersist/HDFobject.cc
@@ -25,10 +25,7 @@
 //  Module : SALOME
 //
 #include "HDFobject.hxx"
-extern "C"
-{
 #include "hdfi.h"
-}
 
 #include <cstring>
 #include <stdlib.h>
I have no idea why these are undef'd, they break the build when using OpenMPI.

Index: salome/KERNEL_SRC_5.1.4/src/Communication_SWIG/libSALOME_Comm.i
===================================================================
--- a/KERNEL_SRC_5.1.4/src/Communication_SWIG/libSALOME_Comm.i
+++ b/KERNEL_SRC_5.1.4/src/Communication_SWIG/libSALOME_Comm.i
@@ -27,9 +27,6 @@
 %{
   #include "ReceiverFactory.hxx"
   #include "MatrixClient.hxx"
-  #undef SEEK_SET
-  #undef SEEK_CUR
-  #undef SEEK_END
   #include "SALOME_Comm_i.hxx"
   #include "SALOMEMultiComm.hxx"
   #include "SenderFactory.hxx"
Add missing #include

Index: salome/KERNEL_SRC_5.1.4/src/MPIContainer/MPIObject_i.hxx
===================================================================
--- salome.orig/KERNEL_SRC_5.1.4/src/MPIContainer/MPIObject_i.hxx
+++ salome/KERNEL_SRC_5.1.4/src/MPIContainer/MPIObject_i.hxx
@@ -29,6 +29,7 @@
 
 #include <mpi.h>
 #include <string>
+#include <map>
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOME_MPIObject)
 
Index: salome/KERNEL_SRC_5.1.4/doc/salome/tui/Makefile.am
===================================================================
--- a/KERNEL_SRC_5.1.4/doc/salome/tui/Makefile.am
+++ b/KERNEL_SRC_5.1.4/doc/salome/tui/Makefile.am
@@ -37,7 +37,7 @@ dev_docs:
 	$(DOXYGEN) doxyfile
 
 clean-local:
-	-rm -fr KERNEL log.txt doxyfile.bak
+	-rm -fr log.txt doxyfile.bak KERNEL/*.jpg KERNEL/*.html KERNEL/*.map KERNEL/*.md5 KERNEL/*.gif KERNEL/*.css KERNEL/*.png
 
 install-data-local:
 	if test -d KERNEL; then \
Index: salome/KERNEL_SRC_5.1.4/Makefile.am
===================================================================
--- a/KERNEL_SRC_5.1.4/Makefile.am
+++ b/KERNEL_SRC_5.1.4/Makefile.am
@@ -41,7 +41,7 @@ endif
 
 DIST_SUBDIRS= salome_adm idl src doc bin resources
 
-DISTCLEANFILES = a.out local-install.sh
+DISTCLEANFILES = a.out local-install.sh aclocal.m4 configure salome_adm/unix/config_files/config.guess salome_adm/unix/config_files/config.sub salome_adm/unix/config_files/depcomp salome_adm/unix/config_files/install-sh salome_adm/unix/config_files/libtool.m4 salome_adm/unix/config_files/ltmain.sh salome_adm/unix/config_files/ltoptions.m4 salome_adm/unix/config_files/ltsugar.m4 salome_adm/unix/config_files/ltversion.m4 salome_adm/unix/config_files/lt~obsolete.m4 salome_adm/unix/config_files/missing salome_adm/unix/config_files/py-compile
 
 salomeinclude_DATA = KERNEL_version.h
 
Replace >& csh construct by 2>

The former is recognized by bash, but not all by POSIX
shells, for instance dash throws this error:
  sh: Syntax error: Bad fd number

Index: salome/KERNEL_SRC_5.1.4/bin/waitNS.sh
===================================================================
--- a/KERNEL_SRC_5.1.4/bin/waitNS.sh
+++ b/KERNEL_SRC_5.1.4/bin/waitNS.sh
@@ -23,7 +23,7 @@
 
 status=1
 while [ $status -ne 0 ]; do
-  ls $HOME/$APPLI/USERS/.omniORB_${USER}_last.cfg >& /dev/null
+  ls $HOME/$APPLI/USERS/.omniORB_${USER}_last.cfg 2> /dev/null
   status=$?
   sleep 1
   echo -n "#"
Use random instead of deprecated whrandom (gone as of python 2.5).

Index: salome/KERNEL_SRC_5.1.4/src/KERNEL_PY/batchmode_salome.py
===================================================================
--- a/KERNEL_SRC_5.1.4/src/KERNEL_PY/batchmode_salome.py
+++ b/KERNEL_SRC_5.1.4/src/KERNEL_PY/batchmode_salome.py
@@ -53,8 +53,8 @@ def SalomeGUIgetAllSelected(self):
     #--------------------------------------------------------------------------
 
 def generateName(prefix = None):
-    import whrandom;
-    int = whrandom.randint(1,1000);
+    import random;
+    int = random.randint(1,1000);
     if prefix is None:
         return "Study" + str(int)
     else :
Index: salome/KERNEL_SRC_5.1.4/src/KERNEL_PY/salome_study.py
===================================================================
--- a/KERNEL_SRC_5.1.4/src/KERNEL_PY/salome_study.py
+++ b/KERNEL_SRC_5.1.4/src/KERNEL_PY/salome_study.py
@@ -110,8 +110,8 @@ def IDToSObject(id):
     #--------------------------------------------------------------------------
 
 def generateName(prefix = None):
-    import whrandom;
-    int = whrandom.randint(1,1000);
+    import random;
+    int = random.randint(1,1000);
     if prefix is None:
         return "Study" + str(int)
     else :
Option to use the Debian/Ubuntu OpenCASCADE installation location, but
preferring the OCC standard install.

Index: salome/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_cas.m4
===================================================================
--- a/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_cas.m4
+++ b/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_cas.m4
@@ -42,6 +42,9 @@ AC_SUBST(CAS_DATAEXCHANGE)
 AC_SUBST(CAS_LDFLAGS)
 AC_SUBST(CAS_LDPATH)
 AC_SUBST(CAS_STDPLUGIN)
+AC_SUBST(CAS_LIBDIR)
+AC_SUBST(CAS_DATADIR)
+AC_SUBST(CASROOT)
 
 CAS_CPPFLAGS=""
 CAS_CXXFLAGS=""
@@ -88,18 +91,18 @@ if test -z "$CASROOT"; then
   done
 fi
 
-if test -d ${CASROOT}/${casdir}/lib; then
-  CAS_LDPATH="-L$CASROOT/$casdir/lib "
+CAS_LIBDIR="$CASROOT/$casdir/lib"
+if test -d ${CAS_LIBDIR}; then
   AC_MSG_RESULT(yes)
 else
   if test -d ${CASROOT}/lib; then
-    CAS_LDPATH="-L$CASROOT/lib "
+    CAS_LIBDIR="$CASROOT/lib"
     AC_MSG_RESULT(yes)
   else
     AC_MSG_RESULT(no)
   fi
 fi
-
+  CAS_LDPATH="-L$CAS_LIBDIR "
 
 dnl were is OCC ?
 if test -z "$CASROOT"; then
@@ -109,8 +112,12 @@ else
   OCC_VERSION_MAJOR=0
   OCC_VERSION_MINOR=0
   OCC_VERSION_MAINTENANCE=0
-  ff=$CASROOT/inc/Standard_Version.hxx
-  if test -f $ff ; then
+  if test -f $CASROOT/inc/Standard_Version.hxx; then
+    ff=$CASROOT/inc/Standard_Version.hxx
+  else
+    ff=$CASROOT/include/opencascade/Standard_Version.hxx
+  fi
+  if test -f $ff; then
     grep "define OCC_VERSION_MAJOR" $ff > /dev/null
     if test $? = 0 ; then
       OCC_VERSION_MAJOR=`grep "define OCC_VERSION_MAJOR" $ff | awk '{i=3 ; print $i}'`
@@ -123,6 +130,19 @@ else
     if test $? = 0 ; then
       OCC_VERSION_MAINTENANCE=`grep "define OCC_VERSION_MAINTENANCE" $ff | awk '{i=3 ; print $i}'`
     fi
+    AC_MSG_CHECKING(for OpenCascade data files)
+    if test -f ${CASROOT}/src/UnitsAPI/Lexi_Expr.dat; then
+      CAS_DATADIR=${CASROOT}
+      AC_MSG_RESULT(found in $CAS_DATADIR/src)
+    else
+      if test -f ${CASROOT}/share/opencascade/${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}/src/UnitsAPI/Lexi_Expr.dat; then
+        CAS_DATADIR=${CASROOT}/share/opencascade/${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}
+        AC_MSG_RESULT(found in $CAS_DATADIR/src)
+      else
+        occ_ok=no
+	AC_MSG_RESULT(not found, check OpenCascade installation)
+      fi
+    fi
   fi
 fi
 
@@ -152,7 +172,7 @@ case $host_os in
           CAS_CPPFLAGS="$CAS_CPPFLAGS -DOCC_CONVERT_SIGNALS"
           ;;
       esac
-      CAS_CPPFLAGS="$CAS_CPPFLAGS -I$CASROOT/inc"
+      CAS_CPPFLAGS="$CAS_CPPFLAGS -I$CASROOT/inc -I$CASROOT/include/opencascade"
       ;;
    osf*)
       CAS_CPPFLAGS="-DOCC_VERSION_MAJOR=$OCC_VERSION_MAJOR -DOCC_VERSION_MINOR=$OCC_VERSION_MINOR -DOCC_VERSION_MAINTENANCE=$OCC_VERSION_MAINTENANCE -DLIN -DLINTEL -DCSFDB -DNo_exception -DHAVE_CONFIG_H -DHAVE_LIMITS_H -DHAVE_WOK_CONFIG_H -I$CASROOT/inc"
Use Debian-correct directory locations.

Index: salome/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_Kernel.m4
===================================================================
--- a/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_Kernel.m4
+++ b/KERNEL_SRC_5.1.4/salome_adm/unix/config_files/check_Kernel.m4
@@ -57,7 +57,7 @@ if test "x${KERNEL_DIR}" = "x" ; then
   fi
 fi
 
-if test -f ${KERNEL_DIR}/bin/salome/runSalome ; then
+if test -f ${KERNEL_DIR}/lib/salome/bin/runSalome ; then
    AC_MSG_RESULT(Using Kernel module distribution in ${KERNEL_DIR})
    Kernel_ok=yes
 
@@ -72,7 +72,7 @@ if test -f ${KERNEL_DIR}/bin/salome/runSalome ; then
    AC_SUBST(KERNEL_ROOT_DIR)
    AC_SUBST(KERNEL_SITE_DIR)
 
-   KERNEL_LDFLAGS=-L${KERNEL_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
+   KERNEL_LDFLAGS=-L${KERNEL_DIR}/lib${LIB_LOCATION_SUFFIX}/salome/lib
    KERNEL_CXXFLAGS=-I${KERNEL_DIR}/include/salome
 
    AC_SUBST(KERNEL_LDFLAGS)

Reply via email to