[omniORB-dev] patch to allow disabling the long double support

Mika Laitio lamikr at pilppa.org
Wed Oct 13 04:15:31 BST 2010


In some systems like mips or arm the gcc toolchain fails to build 
long double code that is generated from the corbaidl.idl
If we are in addition building in the cross compile environment, we must also call 
external omniidl instead of the just build one. Therfore the disabling of 
long double support from the just generated omniidl version would not 
work on crosscompile environment.

include/omniORB4/CORBA_sysdep_trad.h:
-#  define HAS_LongDouble
+#if defined(_GLIBCXX_USE_C99)
+	#  define HAS_LongDouble
+#endif

Therefore I created attached patch which adds "--disbale-longdouble" option to configure. (once
regenerated with autoreconf command) If --disable-longdouble is given, 
then -DDISABLE_LONGDOUBLE option is passed to omniidl when it is reguested 
to generate stups from corbaidl.idl. corbaidl.idl instead have new "ifndef 
DISABLE_LONGDOUBLE" check which surrounds the part of the idl which 
defines the long double sequence.

In addition of this patch, when crosscompiling for example to mips, I need 
to remove the $(TOOLBINDIR) from the omniidl path definition in 
mk/beforeauto.mk.in file so that my build systems omniidl will get called 
instead of this target system crosscompiled one.

Maybe another configure option for allowing to define the path to omniidl 
version used, would be a good idea? At the moment I do not have that 
available, but if that approach is good, I can try to create something.

Mika
-------------- next part --------------
diff -Naur omniorb_41_branch_orig/acinclude.m4 omniorb_41_branch_new/acinclude.m4
--- omniorb_41_branch_orig/acinclude.m4	2010-10-13 00:01:31.821617703 +0300
+++ omniorb_41_branch_new/acinclude.m4	2010-10-13 01:38:41.471615078 +0300
@@ -420,6 +420,18 @@
 fi
 ])
 
+dnl Disable support for long double even if the toolchain claims to support it. (does really not work on mipsel or arm)
+AC_DEFUN([OMNI_DISABLE_LONGDOUBLE],
+[AC_CACHE_CHECK(whether to disable long double support even if toolchain supports it,
+omni_cv_enable_longdouble,
+[AC_ARG_ENABLE(longdouble,
+               AC_HELP_STRING([--disable-longdouble],
+                  [disable long double suppor (default enable-longdouble)]),
+               omni_cv_enable_longdouble=$enableval,
+               omni_cv_enable_longdouble=yes)
+])
+AC_SUBST(ENABLE_LONGDOUBLE, $omni_cv_enable_longdouble)
+])
 
 dnl
 dnl Tests from http://www.gnu.org/software/ac-archive/
diff -Naur omniorb_41_branch_orig/configure.ac omniorb_41_branch_new/configure.ac
--- omniorb_41_branch_orig/configure.ac	2010-10-13 00:01:20.549617644 +0300
+++ omniorb_41_branch_new/configure.ac	2010-10-13 01:14:17.435865139 +0300
@@ -134,7 +134,7 @@
 OMNI_DISABLE_THREAD_TRACING
 OMNI_DISABLE_IPV6_CHECK
 OMNI_DISABLE_ALLOCA
-
+OMNI_DISABLE_LONGDOUBLE
 
 dnl ** Compiler name
 
diff -Naur omniorb_41_branch_orig/idl/corbaidl.idl omniorb_41_branch_new/idl/corbaidl.idl
--- omniorb_41_branch_orig/idl/corbaidl.idl	2010-10-11 22:43:09.334511122 +0300
+++ omniorb_41_branch_new/idl/corbaidl.idl	2010-10-13 01:13:11.990614981 +0300
@@ -73,9 +73,11 @@
 #endif
   typedef sequence<float>              FloatSeq;
   typedef sequence<double>             DoubleSeq;
+#ifndef DISABLE_LONGDOUBLE
 #ifdef HAS_LongDouble
   typedef sequence<long double>        LongDoubleSeq;
 #endif
+#endif
   typedef sequence<string>             StringSeq;
   typedef sequence<wstring>            WStringSeq;
 
diff -Naur omniorb_41_branch_orig/mk/beforeauto.mk.in omniorb_41_branch_new/mk/beforeauto.mk.in
--- omniorb_41_branch_orig/mk/beforeauto.mk.in	2010-10-13 01:18:36.027617578 +0300
+++ omniorb_41_branch_new/mk/beforeauto.mk.in	2010-10-13 01:47:49.339615274 +0300
@@ -718,6 +718,10 @@
 NoStaticLibrary = 1
 endif
 
+ifeq (@ENABLE_LONGDOUBLE@,no)
+NoLongDouble = 1
+endif
+
 
 ###########################################################################
 #
diff -Naur omniorb_41_branch_orig/src/lib/omniORB/dir.mk omniorb_41_branch_new/src/lib/omniORB/dir.mk
--- omniorb_41_branch_orig/src/lib/omniORB/dir.mk	2010-10-13 01:07:48.069617556 +0300
+++ omniorb_41_branch_new/src/lib/omniORB/dir.mk	2010-10-13 02:02:30.616870659 +0300
@@ -11,6 +11,12 @@
 SUBDIRS += dynamic codesets connections
 endif
 
+ifdef NoLongDouble
+OPT_DISABLE_LONGDOUBLE="-DDISABLE_LONGDOUBLE"
+else
+OPT_DISABLE_LONGDOUBLE=""
+endif
+
 EXPORTHEADERS = omniORB4/distdate.hh \
                 omniORB4/Naming.hh \
                 omniORB4/corbaidl_defs.hh \
@@ -89,7 +95,7 @@
 
 omniORB4/corbaidl_defs.hh omniORB4/corbaidl_operators.hh omniORB4/corbaidl_poa.hh: corbaidl.idl
 	@(dir=omniORB4; $(CreateDir))
-	$(OMNIORB_IDL) -v -nf -P -WbF -ComniORB4 $<
+	$(OMNIORB_IDL) -v -nf -P -WbF -ComniORB4 $(OPT_DISABLE_LONGDOUBLE) $<
 
 omniORB4/boxes_defs.hh omniORB4/boxes_operators.hh omniORB4/boxes_poa.hh: boxes.idl
 	@(dir=omniORB4; $(CreateDir))


More information about the omniORB-dev mailing list