[omniORB] FreeBSD Support

Sai-Lai Lo S.Lo@uk.research.att.com
26 Jun 1999 16:56:19 +0100


--=-=-=

I got this patch against 2.7.1 from Andre Fornacon
<afo@linux.hrz.fh-zwickau.de>. This is for FreeBSD 3.2 + egcs 1.1.2.

I've incorporate the patch in the upcoming 2.8.0 release.
Please feel free to try out the patch and report whether the eg* examples
work.

Sai-Lai


--=-=-=
Content-Type: application/x-patch
Content-Disposition: attachment; filename=freebsd.patch
Content-Transfer-Encoding: 8bit

From: afo@linux.hrz.fh-zwickau.de
Subject: patch to support omniORB 2.7.1 on FreeBSD
To: omniorb@uk.research.att.com
Date: Sun, 13 Jun 1999 16:36:28 +0200 (MET DST)
X-From-Line: afo@linux.hrz.fh-zwickau.de Sun Jun 13 15:36:36 1999
Envelope-to: omniorb@uk.research.att.com
Received: from big.hrz.fh-zwickau.de ([141.32.46.65])
	by shallot.uk.research.att.com with smtp (Exim 2.02 #3)
	id 10tBNC-0004cp-00
	for omniorb@uk.research.att.com; Sun, 13 Jun 1999 15:36:34 +0100
Received: (qmail 23504 invoked from network); 13 Jun 1999 14:36:32 -0000
Received: from linux.hrz.fh-zwickau.de (qmailr@141.32.30.70)
  by big.hrz.fh-zwickau.de with SMTP; 13 Jun 1999 14:36:32 -0000
Received: (qmail 31825 invoked by uid 500); 13 Jun 1999 14:36:29 -0000
X-Gnus-Mail-Source: directory:/home/sll/private/Mail/incoming
Message-ID: <19990613143629.31824.qmail@linux.hrz.fh-zwickau.de>
Content-Type: text
Xref: neem.uk.research.att.com patches.mail:33
Lines: 612


this mail contains a patch to support omniORB on FreeBSD 3.2.

the patch applies against a stock omniORB 2.7.1 and allows the build 
of the omniORB toolchain, static and shared libraries

the patch creates the following new files:

  omniORB-2.7.1/README.FreeBSD
  omniORB-2.7.1/mk/platforms/i386_freebsd_3.2.mk

and modifies the following files for FreeBSD:

  omniORB-2.7.1/config/config.mk
  omniORB-2.7.1/include/omnithread.h
  omniORB-2.7.1/src/appl/omniNames/log.cc
  omniORB-2.7.1/src/appl/omniNames/omniNames.cc
  omniORB-2.7.1/src/lib/omniORB2/dynamic/sharedlib/dir.mk
  omniORB-2.7.1/src/lib/omniORB2/lifecycle/sharedlib/dir.mk
  omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/percent_m.c
  omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/sharedlib/dir.mk
  omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/tcpd.h
  omniORB-2.7.1/src/lib/omniORB2/orbcore/sharedlib/dir.mk
  omniORB-2.7.1/src/lib/omnithread/sharedlib/dir.mk
  omniORB-2.7.1/src/tool/omniidl2/driver/drv_fork.cc
  omniORB-2.7.1/src/tool/omniidl2/driver/drv_preproc.cc

>-------------- begin omniORB patch for FreeBSD ------------------------<
diff -Nur orig/omniORB-2.7.1/README.FreeBSD omniORB-2.7.1/README.FreeBSD
--- orig/omniORB-2.7.1/README.FreeBSD	Thu Jan  1 01:00:00 1970
+++ omniORB-2.7.1/README.FreeBSD	Sun Jun 13 13:06:02 1999
@@ -0,0 +1,87 @@
+
+I compiled omniORB 2.7.1 on a FreeBSD 3.2 (RELEASE) system using
+the pthreads from libc , gnu make and egcs 1.1.2.
+
+* the config file for FreeBSD builds :
+
+- omniORB 2.7.1 shared and static libraries
+- omniORB utils linked static against the omniORB libs
+
+* to build applications with omniORB on FreeBSD use
+	CXXFLAGS = -D_REENTRANT -D_THREAD_SAFE
+	CXXFLAGS += -D__x86__ -D__freebsd__ -D__OSVERSION__=3
+	CXXFLAGS += -I<YOUR_OMNIORB_INSTALL_DIRECTORY>/include
+
+	dynamic linked binaries:
+	LDFLAGS = -L<YOUR_OMNIORB_DIRECTORY>/lib/i386_freebsd_3.2
+	LDFLAGS	+= -lomniORB2 -lomniDynamic2 -ltcpwrapGK -lomnithread
+	LDFLAGS += -Wl,-rpath,<YOUR_OMNIORB_DIRECTORY>/lib/i386_freebsd_3.2
+
+	static linked binaries:
+	LDFLAGS = -L<YOUR_OMNIORB_INSTALL_DIRECTORY>/lib/i386_freebsd_3.2
+	LDFLAGS	+= -Wl,-Bstatic 
+	LDFLAGS	+= -lomniORB2 -lomniDynamic2 -ltcpwrapGK -lomnithread
+	LDFLAGS	+= -Wl,-Bdynamic
+
+	!!! link with the -lpthread flag !!!
+
+During the port i run into the following problems:
+
+* fcntl.h doesn't define O_SYNC, so i used O_FSYNC instead
+	omniORB-2.7.1/src/appl/omniNames/log.cc
+	omniORB-2.7.1/src/appl/omniNames/omniNames.cc
+
+* need to include unistd.h and sys/wait.h on freebsd in
+	omniORB-2.7.1/src/tool/omniidl2/driver/drv_fork.cc
+	omniORB-2.7.1/src/tool/omniidl2/driver/drv_preproc.cc
+
+
+* stock egcs 1.1.2 doesn't support the FreeBSD specific -pthread linking flag
+	als the supplied gcc (2.7.2) does.
+	just using -lc_r results into binaries linked against libc_r and libc.
+	'cause libc_r comes first it may work but isn't a good idea IMHO.
+
+	so i modified the egcs-1.1.2/gcc/config/i386/freebsd-elf.h file 
+	the diff is attached below. 
+	apply it and rebuild egcs.	
+	[i rename the compiler drivers from gcc and g++ to egcs and egcs++
+	just to make sure i don't use the supplied system gcc/g++]
+
+--- /src/egcs-1.1.2/gcc/config/i386/freebsd-elf.h.orig	Wed Mar 17 20:39:58 1999
+------------ begin freebsd 3.2 egcs pthread patch ----------------
++++ /src/egcs-1.1.2/gcc/config/i386/freebsd-elf.h	Sat Jun 12 14:19:19 1999
+@@ -145,26 +145,17 @@
+ #define WCHAR_TYPE_SIZE BITS_PER_WORD
+     
+ #undef CPP_PREDEFINES
+-#define CPP_PREDEFINES "-Di386 -Dunix -D__ELF__ -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
++#define CPP_PREDEFINES "-Di386 -Dunix -D__ELF__ -D__FreeBSD__=3 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
+ 
+ #undef CPP_SPEC
+ #define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+ 
+ #undef	LIB_SPEC
+-#if 1
+ /* We no longer link with libc_p.a or libg.a by default. If you
+  * want to profile or debug the C library, please add
+  * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
+  */
+-#define LIB_SPEC \
+-  "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
+-     %{!ggdb:-lc} %{ggdb:-lg}}"
+-#else
+-#define LIB_SPEC \
+-  "%{!shared: \
+-     %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
+-       %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
+-#endif
++#define LIB_SPEC "%{!shared:%{!pg:%{!pthread:%{!kthread:-lc}%{kthread:-lpthread -lc}}%{pthread:-lc_r}}%{pg:%{!pthread:%{!kthread:-lc_p}%{kthread:-lpthread_p -lc_p}}%{pthread:-lc_r_p}}}"
+ 
+ /* Provide a LINK_SPEC appropriate for FreeBSD.  Here we provide support
+    for the special GCC options -static and -shared, which allow us to
+------------ end freebsd 3.2 egcs pthread patch ----------------
+
+
+This information is provided by Andre Fornacon.
+If you have questions regarding omniORB on FreeBSD send them to afo@zlug.org.
+[Last modified: 1999/06/13 13:10:39 by afo@xxo.zlug.org]
diff -Nur orig/omniORB-2.7.1/config/config.mk omniORB-2.7.1/config/config.mk
--- orig/omniORB-2.7.1/config/config.mk	Tue Oct 20 21:52:08 1998
+++ omniORB-2.7.1/config/config.mk	Sun Jun 13 09:34:50 1999
@@ -8,6 +8,7 @@
 #  sun4_sosV_5.5             Solaris 2.5, Sunpro C++/gcc-2.7.2
 #  sun4_sosV_5.6             Solaris 2.6, Sunpro C++/gcc-2.7.2
 #  i586_linux_2.0            x86 Redhat linux 4.2, gcc-2.7.2
+#  i386_freebsd_3.2          x86 FreeBSD 3.2, egcs 1.1.2
 #  alpha_osf1_3.2            Digital Unix 3.2, DEC C++ v5.5
 #  alpha_osf1_4.0            Digital Unix 4.0, DEC C++ v6.0
 #  powerpc_aix_4.2           IBM AIX 4.2, IBM C Set++
@@ -30,6 +31,7 @@
 #platform = sun4_sosV_5.5
 #platform = sun4_sosV_5.6
 #platform = i586_linux_2.0
+platform = i386_freebsd_3.2
 #platform = alpha_osf1_3.2
 #platform = alpha_osf1_4.0
 #platform = powerpc_aix_4.2
diff -Nur orig/omniORB-2.7.1/include/omnithread.h omniORB-2.7.1/include/omnithread.h
--- orig/omniORB-2.7.1/include/omnithread.h	Wed Sep 23 17:20:55 1998
+++ omniORB-2.7.1/include/omnithread.h	Sun Jun 13 09:34:50 1999
@@ -139,6 +139,9 @@
 #elif defined(__irix__)
 #include <omnithread/posix.h>
 
+#elif defined(__freebsd__)
+#include <omnithread/posix.h>
+
 #else
 #error "No implementation header file"
 #endif
diff -Nur orig/omniORB-2.7.1/mk/platforms/i386_freebsd_3.2.mk omniORB-2.7.1/mk/platforms/i386_freebsd_3.2.mk
--- orig/omniORB-2.7.1/mk/platforms/i386_freebsd_3.2.mk	Thu Jan  1 01:00:00 1970
+++ omniORB-2.7.1/mk/platforms/i386_freebsd_3.2.mk	Sun Jun 13 12:42:06 1999
@@ -0,0 +1,76 @@
+# i386_freebsd_3.2.mk - make variables and rules specific to FreeBSD 3.2
+# started: 1999/06/12 afo
+# [Last modified: 1999/06/13 12:42:06 by afo@xxo.zlug.org]
+
+FreeBSD = 1
+x86Processor = 1
+
+#
+# Include general unix things
+#
+
+include $(THIS_IMPORT_TREE)/mk/unix.mk
+
+
+#
+# Standard programs
+#
+
+AR = ar cq
+
+CPP = /usr/libexec/cpp
+
+CXX = egcs++
+CXXMAKEDEPEND = $(TOP)/$(BINDIR)/omkdepend -D__cplusplus -D__GNUG__ -D__GNUC__
+CXXDEBUGFLAGS = -O2
+
+CXXLINK		= $(CXX) -pthread -s
+CXXLINKOPTIONS  = $(CXXDEBUGFLAGS) $(CXXOPTIONS)
+
+CXXOPTIONS      = -Wall -Wno-unused
+EgcsMajorVersion = 1
+EgcsMinorVersion = 1        # This is actually a post-1.0 egcs snapshot.
+
+CC           = egcs
+CMAKEDEPEND  = $(TOP)/$(BINDIR)/omkdepend -D__GNUC__
+CDEBUGFLAGS  = -O2
+
+CLINK        = $(CC)
+CLINKOPTIONS = $(CDEBUGFLAGS) $(COPTIONS)
+
+INSTALL = install -c
+
+IMPORT_CPPFLAGS += -D__x86__ -D__freebsd__ -D__OSVERSION__=3
+
+
+omniORB2GatekeeperImplementation = OMNIORB2_TCPWRAPGK
+CorbaImplementation = OMNIORB2 
+
+#
+# OMNI thread stuff
+#
+
+ThreadSystem = Posix
+OMNITHREAD_POSIX_CPPFLAGS =
+OMNITHREAD_CPPFLAGS = -D_REENTRANT -D_THREAD_SAFE
+OMNITHREAD_LIBS = $(patsubst %,$(LibSearchPattern),omnithread)
+
+OMNITHREAD_POSIX_CPPFLAGS += -DUsePthread -DPthreadDraftVersion=10
+
+lib_depend := $(patsubst %,$(LibPattern),omnithread)
+OMNITHREAD_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
+
+
+# Default location of the omniORB2 configuration file [falls back to this if
+# the environment variable OMNIORB_CONFIG is not set] :
+
+OMNIORB_CONFIG_DEFAULT_LOCATION = \"/etc/omniORB.cfg\"
+
+# Default directory for the omniNames log files.
+OMNINAMES_LOG_DEFAULT_LOCATION = \"/var/omninames\"
+
+# build tools semistatic : shared with system libs and static with omniORB libs
+CORBA_LIB	= -Wl,-Bstatic
+CORBA_LIB	+= -lomniORB2 -lomniDynamic2 -ltcpwrapGK -lomnithread
+CORBA_LIB	+= -Wl,-Bdynamic
+OMNITHREAD_LIB = 
diff -Nur orig/omniORB-2.7.1/src/appl/omniNames/log.cc omniORB-2.7.1/src/appl/omniNames/log.cc
--- orig/omniORB-2.7.1/src/appl/omniNames/log.cc	Thu Mar 11 17:31:36 1999
+++ omniORB-2.7.1/src/appl/omniNames/log.cc	Sat Jun 12 15:34:09 1999
@@ -335,7 +335,11 @@
 #ifdef __WIN32__
       int fd = _open(active, O_WRONLY | O_CREAT | O_TRUNC, _S_IWRITE);
 #else
+#if defined (__freebsd__)
+      int fd = open(active, O_WRONLY | O_CREAT | O_TRUNC | O_FSYNC, 0666);
+#else
       int fd = open(active, O_WRONLY | O_CREAT | O_TRUNC | O_SYNC, 0666);
+#endif /* __freebsd__ */
 #endif
 
       if (fd < 0)
@@ -452,7 +456,11 @@
 #ifdef __WIN32__
   int fd = _open(active, O_WRONLY | O_APPEND);
 #else
+#if defined (__freebsd__)
+  int fd = open(active, O_WRONLY | O_APPEND | O_FSYNC);
+#else
   int fd = open(active, O_WRONLY | O_APPEND | O_SYNC);
+#endif /* __freebsd__ */
 #endif
 
   if (fd < 0) {
@@ -559,7 +567,11 @@
 #ifdef __WIN32__
   int fd = _open(checkpt, O_WRONLY | O_CREAT | O_TRUNC, _S_IWRITE);
 #else
+#if defined (__freebsd__)
+  int fd = open(checkpt, O_WRONLY | O_CREAT | O_TRUNC | O_FSYNC, 0666);
+#else
   int fd = open(checkpt, O_WRONLY | O_CREAT | O_TRUNC | O_SYNC, 0666);
+#endif /* __freebsd__ */
 #endif
 
   try {
@@ -673,7 +685,11 @@
 #ifdef __WIN32__
   fd = _open(active, O_WRONLY | O_APPEND);
 #else
+#if defined (__freebsd__)
+  fd = open(active, O_WRONLY | O_APPEND | O_FSYNC);
+#else
   fd = open(active, O_WRONLY | O_APPEND | O_SYNC);
+#endif /* __freebsd__ */
 #endif
 
   if (fd < 0) {
diff -Nur orig/omniORB-2.7.1/src/appl/omniNames/omniNames.cc omniORB-2.7.1/src/appl/omniNames/omniNames.cc
--- orig/omniORB-2.7.1/src/appl/omniNames/omniNames.cc	Thu Mar 11 17:31:36 1999
+++ omniORB-2.7.1/src/appl/omniNames/omniNames.cc	Sun Jun 13 09:34:50 1999
@@ -119,7 +119,11 @@
       int fd = _open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, _S_IWRITE);
       if (fd < 0 || _dup2(fd,2)) {
 #else
+#if defined (__freebsd__)
+      int fd = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC | O_FSYNC, 0666);
+#else
       int fd = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC | O_SYNC, 0666);
+#endif /* __freebsd__ */
       if (fd < 0 || dup2(fd,2) < 0) {
 #endif
 	cerr << "Cannot open error log file: " << argv[2] << endl;
diff -Nur orig/omniORB-2.7.1/src/lib/omniORB2/dynamic/sharedlib/dir.mk omniORB-2.7.1/src/lib/omniORB2/dynamic/sharedlib/dir.mk
--- orig/omniORB-2.7.1/src/lib/omniORB2/dynamic/sharedlib/dir.mk	Thu Feb 18 18:31:24 1999
+++ omniORB-2.7.1/src/lib/omniORB2/dynamic/sharedlib/dir.mk	Sun Jun 13 09:34:50 1999
@@ -257,6 +257,48 @@
 endif
 
 #############################################################################
+#   Make rules for FreeBSD 3.x egcs                                         #
+#############################################################################
+
+ifdef FreeBSD
+ifdef EgcsMajorVersion
+
+DIR_CPPFLAGS += -fPIC
+
+libname = libomniORB$(major_version).so
+soname  = $(libname).$(minor_version)
+lib = $(soname)
+
+dynlibname = libomniDynamic$(major_version).so
+dynsoname  = $(dynlibname).$(minor_version)
+dynlib = $(dynsoname)
+
+
+all:: $(dynlib)
+
+$(dynlib): $(DYN2_OBJS)
+	(set -x; \
+        $(RM) $@; \
+        $(CXX) -shared -Wl,-soname,$(dynsoname) -o $@ $(IMPORT_LIBRARY_FLAGS) \
+         $(filter-out $(LibSuffixPattern),$^) \
+       )
+#    ../../orbcore/sharedlib/$(lib);
+
+clean::
+	$(RM) $(dynlib)
+
+export:: $(dynlib)
+	@$(ExportLibrary)
+	@(set -x; \
+          cd $(EXPORT_TREE)/$(LIBDIR); \
+          $(RM) $(dynlibname); \
+          ln -s $(dynsoname) $(dynlibname); \
+         )
+
+endif
+endif
+
+#############################################################################
 #   Make rules for Digital Unix                                             #
 #############################################################################
 
diff -Nur orig/omniORB-2.7.1/src/lib/omniORB2/lifecycle/sharedlib/dir.mk omniORB-2.7.1/src/lib/omniORB2/lifecycle/sharedlib/dir.mk
--- orig/omniORB-2.7.1/src/lib/omniORB2/lifecycle/sharedlib/dir.mk	Tue Feb  2 12:31:00 1999
+++ omniORB-2.7.1/src/lib/omniORB2/lifecycle/sharedlib/dir.mk	Sun Jun 13 09:34:50 1999
@@ -261,6 +261,53 @@
 endif
 endif
 
+
+#############################################################################
+#   Make rules for FreeBSD 3.x egcs                                         #
+#############################################################################
+
+ifdef FreeBSD
+ifdef EgcsMajorVersion
+
+DIR_CPPFLAGS += -fPIC
+
+libname = libomniORB$(major_version).so
+soname  = $(libname).$(minor_version)
+lib = $(soname)
+
+dynlibname = libomniDynamic$(major_version).so
+dynsoname  = $(dynlibname).$(minor_version)
+dynlib = $(dynsoname)
+
+lclibname = libomniLC.so
+lcsoname  = $(lclibname).$(lc_minor_version)
+lclib = $(lcsoname)
+
+all:: $(lclib)
+
+$(lclib): $(LC_OBJS)
+	(set -x; \
+        $(RM) $@; \
+        $(CXX) -shared -Wl,-soname,$(lcsoname) -o $@ $(IMPORT_LIBRARY_FLAGS) \
+         $(filter-out $(LibSuffixPattern),$^) \
+       )
+# $(OMNITHREAD_LIB) 
+#         ../../orbcore/sharedlib/$(lib) ../../dynamic/sharedlib/$(dynlib);
+
+clean::
+	$(RM) $(lclib)
+
+export:: $(lclib)
+	@$(ExportLibrary)
+	@(set -x; \
+          cd $(EXPORT_TREE)/$(LIBDIR); \
+          $(RM) $(lclibname); \
+          ln -s $(lcsoname) $(lclibname); \
+         )
+
+endif
+endif
+
 #############################################################################
 #   Make rules for Digital Unix                                             #
 #############################################################################
diff -Nur orig/omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/percent_m.c omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/percent_m.c
--- orig/omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/percent_m.c	Thu Dec 18 18:28:15 1997
+++ omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/percent_m.c	Sun Jun 13 09:34:50 1999
@@ -12,6 +12,11 @@
 #include <errno.h>
 #include <string.h>
 
+/* FreeBSD has sys_errlist already defined in stdio.h */
+#if defined (__freebsd__)
+#define SYS_ERRLIST_DEFINED		1
+#endif
+
 extern int errno;
 #if !(defined(__GLIBC__) && __GLIBC__ >=2)
 #ifndef SYS_ERRLIST_DEFINED
diff -Nur orig/omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/sharedlib/dir.mk omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/sharedlib/dir.mk
--- orig/omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/sharedlib/dir.mk	Thu Jan  7 16:04:09 1999
+++ omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/sharedlib/dir.mk	Sun Jun 13 09:34:51 1999
@@ -205,6 +205,43 @@
 endif
 endif
 
+#############################################################################
+#   Make rules for FreeBSD 3.x egcs                                         #
+#############################################################################
+
+ifdef FreeBSD
+ifdef EgcsMajorVersion
+
+DIR_CPPFLAGS += -fPIC
+
+libname = libtcpwrapGK.so
+soname  = $(libname).$(minor_version)
+lib = $(soname)
+
+$(lib): $(OBJS) $(CXXOBJS)
+	(set -x; \
+        $(RM) $@; \
+        $(CXX) $(CXXOPTIONS) -shared -Wl,-soname,$(soname) -o $@ $(IMPORT_LIBRARY_FLAGS) \
+         $(filter-out $(LibSuffixPattern),$^)  \
+       )
+#$(OMNITHREAD_LIB);
+
+all:: $(lib)
+
+clean::
+	$(RM) $(lib)
+
+export:: $(lib)
+	@$(ExportLibrary)
+	@(set -x; \
+          cd $(EXPORT_TREE)/$(LIBDIR); \
+          $(RM) $(libname); \
+          ln -s $(soname) $(libname); \
+         )
+
+endif
+endif
+
 
 #############################################################################
 #   Make rules for SGI Irix 6.2                                             #
diff -Nur orig/omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/tcpd.h omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/tcpd.h
--- orig/omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/tcpd.h	Tue Aug 11 21:05:06 1998
+++ omniORB-2.7.1/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/tcpd.h	Sun Jun 13 09:34:51 1999
@@ -11,7 +11,7 @@
 #ifndef _TCPD_H
 #define _TCPD_H
 
-#if defined(__nextstep__) || defined(__osr5__)
+#if defined(__nextstep__) || defined(__osr5__) || defined(__freebsd__)
 #include <sys/types.h>
 #endif
 
diff -Nur orig/omniORB-2.7.1/src/lib/omniORB2/orbcore/sharedlib/dir.mk omniORB-2.7.1/src/lib/omniORB2/orbcore/sharedlib/dir.mk
--- orig/omniORB-2.7.1/src/lib/omniORB2/orbcore/sharedlib/dir.mk	Mon Jan 25 19:01:30 1999
+++ omniORB-2.7.1/src/lib/omniORB2/orbcore/sharedlib/dir.mk	Sun Jun 13 09:34:51 1999
@@ -243,6 +243,43 @@
 endif
 
 #############################################################################
+#   Make rules for FreeBSD 3.x egcs                                         #
+#############################################################################
+
+ifdef FreeBSD
+ifdef EgcsMajorVersion
+
+DIR_CPPFLAGS += -fPIC
+
+libname = libomniORB$(major_version).so
+soname  = $(libname).$(minor_version)
+lib = $(soname)
+
+all:: $(lib)
+
+$(lib): $(ORB2_OBJS)
+	(set -x; \
+        $(RM) $@; \
+        $(CXX) -shared -Wl,-soname,$(soname) -o $@ $(IMPORT_LIBRARY_FLAGS) \
+         $(filter-out $(LibSuffixPattern),$^)  \
+       )
+# $(OMNITHREAD_LIB);
+
+clean::
+	$(RM) $(lib)
+
+export:: $(lib)
+	@$(ExportLibrary)
+	@(set -x; \
+          cd $(EXPORT_TREE)/$(LIBDIR); \
+          $(RM) $(libname); \
+          ln -s $(soname) $(libname); \
+         )
+
+endif
+endif
+
+#############################################################################
 #   Make rules for Digital Unix                                             #
 #############################################################################
 
diff -Nur orig/omniORB-2.7.1/src/lib/omnithread/sharedlib/dir.mk omniORB-2.7.1/src/lib/omnithread/sharedlib/dir.mk
--- orig/omniORB-2.7.1/src/lib/omnithread/sharedlib/dir.mk	Thu Jan 14 16:54:58 1999
+++ omniORB-2.7.1/src/lib/omnithread/sharedlib/dir.mk	Sun Jun 13 09:34:51 1999
@@ -224,6 +224,42 @@
 endif
 
 #############################################################################
+#   Make rules for FreeBSD 3.x egcs                                         #
+#############################################################################
+
+ifdef FreeBSD
+ifdef EgcsMajorVersion
+
+DIR_CPPFLAGS += -fPIC
+
+libname = libomnithread.so
+soname  = $(libname).$(minor_version)
+lib = $(soname)
+
+$(lib): $(OBJS)
+	(set -x; \
+        $(RM) $@; \
+        $(CXX) $(CXXOPTIONS) -shared -Wl,-soname,$(soname) -o $@ $(IMPORT_LIBRARY_FLAGS) \
+         $(filter-out $(LibSuffixPattern),$^); \
+       )
+
+all:: $(lib)
+
+clean::
+	$(RM) $(lib)
+
+export:: $(lib)
+	@$(ExportLibrary)
+	@(set -x; \
+          cd $(EXPORT_TREE)/$(LIBDIR); \
+          $(RM) $(libname); \
+          ln -s $(soname) $(libname); \
+         )
+
+endif
+endif
+
+#############################################################################
 #   Make rules for IBM AIX                                                  #
 #############################################################################
 
diff -Nur orig/omniORB-2.7.1/src/tool/omniidl2/driver/drv_fork.cc omniORB-2.7.1/src/tool/omniidl2/driver/drv_fork.cc
--- orig/omniORB-2.7.1/src/tool/omniidl2/driver/drv_fork.cc	Sat Aug 22 15:21:52 1998
+++ omniORB-2.7.1/src/tool/omniidl2/driver/drv_fork.cc	Sun Jun 13 09:34:51 1999
@@ -119,6 +119,11 @@
 #include      <wait.h>                // POSIX definition of wait()
 #endif
 
+#if defined(__freebsd__) 
+#include      <unistd.h>              // POSIX standard types
+#include      <sys/wait.h>                // POSIX definition of wait()
+#endif
+
 #if !defined(__WIN32__) && !defined(__VMS)
 
 // Note that Windows NT version can only handle one file on command line.
diff -Nur orig/omniORB-2.7.1/src/tool/omniidl2/driver/drv_preproc.cc omniORB-2.7.1/src/tool/omniidl2/driver/drv_preproc.cc
--- orig/omniORB-2.7.1/src/tool/omniidl2/driver/drv_preproc.cc	Wed Jan  6 17:15:17 1999
+++ omniORB-2.7.1/src/tool/omniidl2/driver/drv_preproc.cc	Sun Jun 13 09:34:51 1999
@@ -134,6 +134,12 @@
 #include      <wait.h>                // POSIX definition of wait()
 #endif
 
+#if defined(__freebsd__) 
+#include      <unistd.h>              // POSIX standard types
+#include      <sys/wait.h>                // POSIX definition of wait()
+#endif
+
+
 #ifdef __WIN32__
 #include <io.h>
 #include <process.h>

>-------------- end omniORB patch for FreeBSD --------------------------<

-- 
Andre Fornacon
-- on the internet nobody knows you are a dog
afo <at> zlug <dot> org


--=-=-=



-- 
Sai-Lai Lo                                   S.Lo@uk.research.att.com
AT&T Laboratories Cambridge           WWW:   http://www.uk.research.att.com 
24a Trumpington Street                Tel:   +44 1223 343000
Cambridge CB2 1QA                     Fax:   +44 1223 313542
ENGLAND


--=-=-=--