Salome HOME
PR: merge from tag mergeto_HEAD_25Jan05
[modules/kernel.git] / salome_adm / unix / config_files / check_omniorb.m4
index c7a9699e31edaaa1ce5d3f3fa64a4834873999e1..f3d5abcdb62d902211015d7a4bdc6ef2c1a10514 100644 (file)
@@ -176,7 +176,7 @@ fi
 if test "x$omniORB_ok" = "xyes" 
 then
 
-  OMNIORB_IDLCXXFLAGS="-I$OMNIORB_ROOT/idl"
+  OMNIORB_IDLCXXFLAGS="-nf -I$OMNIORB_ROOT/idl"
   OMNIORB_IDLPYFLAGS="-bpython -I$OMNIORB_ROOT/idl"
   AC_SUBST(OMNIORB_IDLCXXFLAGS)
   AC_SUBST(OMNIORB_IDLPYFLAGS)
@@ -226,7 +226,7 @@ then
   fi
 fi
 
-AC_LANG_RESTORE
+dnl AC_LANG_RESTORE
 
 AC_MSG_RESULT(for omniORBpy: $omniORBpy_ok)
 AC_MSG_RESULT(for omniORB: $omniORB_ok)
@@ -234,5 +234,68 @@ AC_MSG_RESULT(for omniORB: $omniORB_ok)
 # Save cache
 AC_CACHE_SAVE
 
+dnl AC_LANG_CPLUSPLUS
+
+CXXFLAGS_old=$CXXFLAGS
+CXXFLAGS="$CXXFLAGS $OMNIORB_CXXFLAGS $OMNIORB_INCLUDES"
+LIBS_old=$LIBS
+LIBS="$LIBS $OMNIORB_LDFLAGS $OMNIORB_LIBS"
+AC_MSG_CHECKING(whether we have double and CORBA::Double compatibility)
+AC_TRY_RUN(
+#include <stdlib.h>
+#include <CORBA.h>
+int main ()
+{
+  CORBA::Double *a=new CORBA::Double(2.5);
+  double c=2.5;
+  double *b;
+  b=(double *)a;
+
+  if( (c==*b) && (sizeof(double)==sizeof(CORBA::Double)) ){
+    delete a;
+    exit(0);
+  }
+  else{
+    delete a;
+    exit(1);
+  }
+}
+,DOUBLECOMP="yes",DOUBLECOMP="no")
+if test "$DOUBLECOMP" = yes; then
+  OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -DCOMP_CORBA_DOUBLE"
+  AC_MSG_RESULT(yes)
+else
+  AC_MSG_RESULT(no)
+fi
+AC_MSG_CHECKING(whether we have int and CORBA::Long compatibility)
+AC_TRY_RUN(
+#include <stdlib.h>
+#include <CORBA.h>
+int main ()
+{
+  CORBA::Long *a=new CORBA::Long(2);
+  int c=2;
+  int *b;
+  b=(int *)a;
+
+  if( (c==*b) && (sizeof(int)==sizeof(CORBA::Long)) )
+    exit(0);
+  else
+    exit(1);
+}
+,LONGCOMP="yes",LONGCOMP="no")
+if test "$LONGCOMP" = yes; then
+  OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -DCOMP_CORBA_LONG"
+  AC_MSG_RESULT(yes)
+else
+  AC_MSG_RESULT(no)
+fi
+CXXFLAGS=$CXXFLAGS_old
+LIBS=$LIBS_old
+
+AC_LANG_RESTORE
+
+AC_SUBST(OMNIORB_CXXFLAGS)
+
 ])dnl
 dnl