Salome HOME
In openmpi need to link with libmpi_cxx and libmpi.so
[modules/kernel.git] / salome_adm / unix / config_files / check_omniorb.m4
index 1f63365bf30438d3bf8ed8057466d08d16f84114..72b0fa0f768c9d9c6c98a0b1cea17bf9739e8f8b 100644 (file)
@@ -1,3 +1,24 @@
+dnl Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
 
 AC_DEFUN([CHECK_OMNIORB],[
 AC_REQUIRE([AC_PROG_CC])dnl
@@ -17,7 +38,7 @@ AC_LANG_SAVE
 AC_LANG_CPLUSPLUS
 
 AC_PATH_PROG(OMNIORB_IDL, omniidl)
-if test "xOMNIORB_IDL" = "x"
+if test "x$OMNIORB_IDL" = "x"
 then
   omniORB_ok=no
   AC_MSG_RESULT(omniORB binaries not in PATH variable)
@@ -61,25 +82,31 @@ then
   OMNIORB_CXXFLAGS="-DOMNIORB_VERSION=$OMNIORB_VERSION"
   case $build_cpu in
     sparc*)
-      AC_DEFINE(__sparc__)
+      AC_DEFINE(__sparc__)
       OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -D__sparc__"
       ;;
    *86*)
-      AC_DEFINE(__x86__)
+      AC_DEFINE(__x86__)
       OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -D__x86__"
       ;;
   esac
   case $build_os in
+    osf*)
+      # AC_DEFINE(__osf1__)
+      __OSVERSION__=5
+      AC_DEFINE([__OSVERSION__], [5], [Description])
+      OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -D__osf1__"
+      ;;
     solaris*)
-      AC_DEFINE(__sunos__)
+      AC_DEFINE(__sunos__)
       __OSVERSION__=5
-      AC_DEFINE(__OSVERSION__)
+      AC_DEFINE([__OSVERSION__], [5], [Description])
       OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -D__sunos__"
       ;;
    linux*)
-      AC_DEFINE(__linux__)
+      AC_DEFINE(__linux__)
       __OSVERSION__=2
-      AC_DEFINE(__OSVERSION__)
+      AC_DEFINE([__OSVERSION__], [2], [Description])
       OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -D__linux__"
       ;;
   esac
@@ -95,15 +122,15 @@ then
 
 fi
 
-dnl omniORB_ok=yes
-
 if test "x$omniORB_ok" = "xyes" 
 then
   if test "x$OMNIORB_LIB" = "x/usr/lib"
   then
     OMNIORB_LDFLAGS=""
+    OMNIORB_RFLAGS=""
   else
     OMNIORB_LDFLAGS="-L$OMNIORB_LIB"
+    OMNIORB_RFLAGS="-Wl,-R$OMNIORB_LIB"
   fi
 
   LIBS_old=$LIBS
@@ -147,6 +174,7 @@ then
   OMNIORB_LIBS="$OMNIORB_LIBS -lCOS${OMNIORB_VERSION}"
   OMNIORB_LIBS="$OMNIORB_LIBS -lCOSDynamic${OMNIORB_VERSION}"
   OMNIORB_LIBS="$OMNIORB_LIBS -lomnithread"
+  OMNIORB_LIBS="$OMNIORB_LIBS ${OMNIORB_RFLAGS}"
   if test $OMNIORB_VERSION = 3 ; then
     OMNIORB_LIBS="$OMNIORB_LIBS -ltcpwrapGK"
   fi
@@ -181,9 +209,14 @@ fi
 if test "x$omniORB_ok" = "xyes" 
 then
 
-  OMNIORB_IDLCXXFLAGS="-nf -I$OMNIORB_ROOT/idl"
-  OMNIORB_IDLPYFLAGS="-bpython -I$OMNIORB_ROOT/idl"
+  OMNIORB_IDLCXXFLAGS="-Wba -nf -I${OMNIORB_ROOT}/idl"
+  OMNIORB_PACOIDLCXXFLAGS="-nf -I${OMNIORB_ROOT}/idl"
+  OMNIORB_IDLPYFLAGS_1='-bpython -nf '
+  OMNIORB_IDLPYFLAGS_2=" -I${OMNIORB_ROOT}/idl"
+  OMNIORB_IDLPYFLAGS=${OMNIORB_IDLPYFLAGS_1}${OMNIORB_IDLPYFLAGS_2}
+
   AC_SUBST(OMNIORB_IDLCXXFLAGS)
+  AC_SUBST(OMNIORB_PACOIDLCXXFLAGS)
   AC_SUBST(OMNIORB_IDLPYFLAGS)
 
   OMNIORB_IDL_CLN_H=.hh
@@ -205,15 +238,15 @@ then
   AC_SUBST(OMNIORB_IDL_TIE_H)
   AC_SUBST(OMNIORB_IDL_TIE_CXX)
   
-  AC_DEFINE(OMNIORB)
+  AC_DEFINE([OMNIORB], [], [Description])
 
   CORBA_HAVE_POA=1
-  AC_DEFINE(CORBA_HAVE_POA)
+  AC_DEFINE([CORBA_HAVE_POA], [], [Description])
 
   CORBA_ORB_INIT_HAVE_3_ARGS=1
-  AC_DEFINE(CORBA_ORB_INIT_HAVE_3_ARGS)
+  AC_DEFINE([CORBA_ORB_INIT_HAVE_3_ARGS], [], [Description])
   CORBA_ORB_INIT_THIRD_ARG='"omniORB"'
-  AC_DEFINE(CORBA_ORB_INIT_THIRD_ARG, "omniORB")
+  AC_DEFINE([CORBA_ORB_INIT_THIRD_ARG], [], [omniORB])
 
 fi