]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
PR: mergefrom_ADAM_br1_12Mar04
authorprascle <prascle>
Mon, 15 Mar 2004 08:48:11 +0000 (08:48 +0000)
committerprascle <prascle>
Mon, 15 Mar 2004 08:48:11 +0000 (08:48 +0000)
salome_adm/unix/config_files/check_omniorb.m4
src/NamingService/SALOME_NamingService.hxx
src/SALOMEDS/SALOMEDS_Client.cxx
src/SALOMEDS/SALOMEDS_Server.cxx
src/Utils/Utils_ORB_INIT.cxx

index 500abac3114190acd0bbd813d81bc0a220106325..c7a9699e31edaaa1ce5d3f3fa64a4834873999e1 100644 (file)
@@ -30,19 +30,35 @@ then
   AC_SUBST(OMNIORB_IDL)
 
   OMNIORB_BIN=`echo ${OMNIORB_IDL} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
-  OMNIORB_LIB=`echo ${OMNIORB_BIN} | sed -e "s,bin,lib,"`
-
-  OMNIORB_ROOT=`echo ${OMNIORB_BIN}  | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
-  OMNIORB_ROOT=`echo ${OMNIORB_ROOT} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
+  OMNIORB_ROOT=${OMNIORB_BIN}
+  # one-level up
+  OMNIORB_ROOT=`echo ${OMNIORB_ROOT}  | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
+  #
+  #
+  if test -d $OMNIORB_ROOT/include ; then
+    # if $OMNIORB_ROOT/include exists, there are a lot of chance that
+    # this is omniORB4.x installed via configure && make && make install
+    OMNIORB_LIB=`echo ${OMNIORB_BIN} | sed -e "s,bin\$,lib,"`
+    OMNIORB_VERSION=4
+  else
+    # omniORB has been installed old way
+    OMNIORB_LIB=`echo ${OMNIORB_BIN} | sed -e "s,bin/,lib/,"`
+    # one-level up again
+    OMNIORB_ROOT=`echo ${OMNIORB_ROOT}  | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
+    if test -d $OMNIORB_ROOT/include/omniORB4 ; then
+      OMNIORB_VERSION=4
+    else
+      OMNIORB_VERSION=3
+    fi
+  fi
   AC_SUBST(OMNIORB_ROOT)
 
-  OMNIORB_INCLUDES="-I$OMNIORB_ROOT/include -I$OMNIORB_ROOT/include/omniORB3 -I$OMNIORB_ROOT/include/COS"
-dnl  OMNIORB_INCLUDES="-I$OMNIORB_ROOT/include -I$OMNIORB_ROOT/include/omniORB4 -I$OMNIORB_ROOT/include/COS"
+  OMNIORB_INCLUDES="-I$OMNIORB_ROOT/include -I$OMNIORB_ROOT/include/omniORB${OMNIORB_VERSION} -I$OMNIORB_ROOT/include/COS"
   AC_SUBST(OMNIORB_INCLUDES)
 
   ENABLE_PTHREADS
 
-  OMNIORB_CXXFLAGS=
+  OMNIORB_CXXFLAGS="-DOMNIORB_VERSION=$OMNIORB_VERSION"
   case $build_cpu in
     sparc*)
       AC_DEFINE(__sparc__)
@@ -120,16 +136,23 @@ then
   AC_CHECK_LIB(nsl,gethostbyname, LIBS="-lnsl $LIBS",,)
 
   LIBS_old=$LIBS
-  OMNIORB_LIBS="$OMNIORB_LDFLAGS -lomniORB3 -ltcpwrapGK -lomniDynamic3 -lomnithread -lCOS3 -lCOSDynamic3"
-dnl  OMNIORB_LIBS="$OMNIORB_LDFLAGS -lomniORB4 -lomniDynamic4 -lomnithread -lCOS4 -lCOSDynamic4"
+  OMNIORB_LIBS="$OMNIORB_LDFLAGS"
+  OMNIORB_LIBS="$OMNIORB_LIBS -lomniORB${OMNIORB_VERSION}"
+  OMNIORB_LIBS="$OMNIORB_LIBS -lomniDynamic${OMNIORB_VERSION}"
+  OMNIORB_LIBS="$OMNIORB_LIBS -lCOS${OMNIORB_VERSION}"
+  OMNIORB_LIBS="$OMNIORB_LIBS -lCOSDynamic${OMNIORB_VERSION}"
+  OMNIORB_LIBS="$OMNIORB_LIBS -lomnithread"
+  if test $OMNIORB_VERSION = 3 ; then
+    OMNIORB_LIBS="$OMNIORB_LIBS -ltcpwrapGK"
+  fi
   AC_SUBST(OMNIORB_LIBS)
 
   LIBS="$OMNIORB_LIBS $LIBS"
   CXXFLAGS_old=$CXXFLAGS
   CXXFLAGS="$CXXFLAGS $OMNIORB_CXXFLAGS $OMNIORB_INCLUDES"
 
-  AC_MSG_CHECKING(whether we can link with omniORB3)
-  AC_CACHE_VAL(salome_cv_lib_omniorb3,[
+  AC_MSG_CHECKING(whether we can link with omniORB)
+  AC_CACHE_VAL(salome_cv_lib_omniorb,[
     AC_TRY_LINK(
 #include <CORBA.h>
 ,   CORBA::ORB_var orb,
@@ -184,21 +207,22 @@ then
 
   CORBA_ORB_INIT_HAVE_3_ARGS=1
   AC_DEFINE(CORBA_ORB_INIT_HAVE_3_ARGS)
-  CORBA_ORB_INIT_THIRD_ARG='"omniORB3"'
-  AC_DEFINE(CORBA_ORB_INIT_THIRD_ARG, "omniORB3")
+  CORBA_ORB_INIT_THIRD_ARG='"omniORB"'
+  AC_DEFINE(CORBA_ORB_INIT_THIRD_ARG, "omniORB")
 
 fi
 
 omniORBpy_ok=no
 if  test "x$omniORB_ok" = "xyes"
 then
-  AC_MSG_CHECKING(omniORBpy (CORBA.py file available))
-  if test -f ${OMNIORB_ROOT}/lib/python/CORBA.py
-  then
-    omniORBpy_ok=yes
-    PYTHONPATH=${OMNIORB_ROOT}/lib/python:${OMNIORB_LIB}:${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}:${PYTHONPATH}
-    AC_SUBST(PYTHONPATH)
+  AC_MSG_CHECKING(omniORBpy)
+  $PYTHON -c "import omniORB" &> /dev/null
+  if test $? = 0 ; then
     AC_MSG_RESULT(yes)
+    omniORBpy_ok=yes
+  else
+    AC_MSG_RESULT(no, check your installation of omniORBpy)
+    omniORBpy_ok=no
   fi
 fi
 
index e22bf2d169a65f3fb79bbcb8e64e63b6d188ea5f..dde3261388331532bb793ee1da79e7e61e41f558 100644 (file)
@@ -31,7 +31,8 @@
 
 #include "utilities.h"
 //#include <omniORB4/CORBA.h>
-#include <omniORB3/CORBA.h>
+//##include <omniORB3/CORBA.h>
+#include <CORBA.h>
 #include <vector>
 #include <string>
 
index aa39a9f526eb935fa043f095df9f9168077e65bd..37104eab0728c56c1fce0c9f6562f75bd8a2c331 100644 (file)
@@ -279,8 +279,13 @@ int main(int argc, char** argv)
 { 
   try {
     // Initialise the ORB.
+#if OMNIORB_VERSION >= 4
+    const char* options[][2] = { { "giopMaxMsgSize", "104857600" }, { 0, 0 } };
+    CORBA::ORB_var orb = CORBA::ORB_init( argc , argv , "omniORB4", options) ;
+#else
     CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB3");
     omniORB::MaxMessageSize(100 * 1024 * 1024);
+#endif
     
     // Obtain a reference to the root POA.
     CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
index 11be220654bbb55fb295c09ec34430591caa1f76..1ed30a91efe121876a87ea94c498d6faaa05ce3e 100644 (file)
@@ -129,8 +129,7 @@ int main(int argc, char** argv)
                      }
                  }
              }
-       
-           }
+                   }
          catch( const SALOME_Exception &ex )
            {
              MESSAGE( "Communication Error : " << ex.what() );
index 0da127b344b0d6dc5b776e0feff7cc261f1d4a8f..0f39159ec27e0463503efc39782c84e5cfce2d0a 100644 (file)
@@ -53,12 +53,15 @@ CORBA::ORB_var &ORB_INIT::operator() ( int argc , char **argv ) throw( CommExcep
        {
                try
                {
-                 //              const char* options[][2] = { { "giopMaxMsgSize", "104857600" }, { 0, 0 } };
-                 //              _orb = CORBA::ORB_init( argc , argv , "omniORB4", options) ;
+#if OMNIORB_VERSION >= 4
+                 const char* options[][2] = { { "giopMaxMsgSize", "104857600" }, { 0, 0 } };
+                 _orb = CORBA::ORB_init( argc , argv , "omniORB4", options) ;
+#else
                  _orb = CORBA::ORB_init( argc , argv ) ;
                  //set GIOP message size equal to 50Mb for transferring brep shapes as 
                  //sequence of bytes using C++ streams
                  omniORB::MaxMessageSize(100*1024*1024);
+#endif
                }
                catch( const CORBA::Exception &ex )
                {