gcc in Solaris
Thomas Wenger
wenger@iam.unibe.ch
Thu, 18 Sep 1997 09:12:51 +0200
----------
X-Sun-Data-Type: text
X-Sun-Data-Description: text
X-Sun-Data-Name: text
X-Sun-Charset: us-ascii
X-Sun-Content-Lines: 24
OmniORB can be built with GNU g++ (2.7.2) under Solaris. Here are the points I have noticed so far:
1. I could not build shared libs. So I modified all makefiles in the shared lib folder to return without any operation executed.
2. I had to compile on a new Solaris System that has POSIX threads (2.5)
3. I had to do some modifications to the config.mk file. The file is attached.
4. With newer systems you don't need ranlib any more. If you hate the error-messages, then put a script with name "ranlib" in your path that does nothing.
If anybody has a better solution (building shared libs or so), please let me know.
And let us know about experiences!
mfg TOM
--
=================================================================
Thomas Wenger wenger@iam.unibe.ch
University: Institute of Computer Science and
Applied Mathematics (IAM), Office 205
Neubrueckstr. 10, CH-3012 Bern +41 31 631 49 90
Private: Wydacherstrasse 4, CH-3113 Rubigen +41 31 721 41 18
=================================================================
----------
X-Sun-Data-Type: default
X-Sun-Data-Description: default
X-Sun-Data-Name: config.mk
X-Sun-Charset: us-ascii
X-Sun-Content-Lines: 81
#
# sun_gnu.mk - make variables and rules specific to Solaris 2.5.
#
# mit GNU g++
PLATFORM = sun4_sosV_5.5
LIBDIR = $(TOP)/lib
BINDIR = $(TOP)/bin
#
# C preprocessor macro definitions for this architecture
#
PLATFORM_CPPFLAGS = -D__sunos__ -D__sparc__ -D__OSVERSION__=5 -DSVR4
#
# Standard programs
#
AR = ar cq
RANLIB = ranlib
MKDIRHIER = /usr/openwin/bin/mkdirhier
CP = cp
MV = mv -f
RM = rm -f
CXX = g++
CXXFLAGS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(CPPFLAGS)
CXXDEBUGFLAGS =
CXXOPTIONS = -fhandle-exceptions -Wall -Wno-unused
CXXLINK = g++
CXXLINKOPTIONS = $(CXXDEBUGFLAGS) $(CXXOPTIONS)
CPPFLAGS = $(DIR_CPPFLAGS) $(PLATFORM_CPPFLAGS)
.SUFFIXES: .o .cc .C .cpp .cxx
.cc.o:
$(CXX) -c $(CXXFLAGS) -o $@ $<
.C.o:
$(CXX) -c $(CXXFLAGS) -o $@ $<
.cpp.o:
$(CXX) -c $(CXXFLAGS) -o $@ $<
.cxx.o:
$(CXX) -c $(CXXFLAGS) -o $@ $<
# To build omnithread on top of solaris threads, uncomment the following two
# lines and comment out the corresponding ones in posix section below.
# You also have to update $(TOP)/src/lib/omnithread/Makefile and
# $(TOP)/src/lib/omnithread/sharedlib/sun4_sosV_5.5.mk
#
#OMNITHREAD_LIB = -lomnithread -lthread
#OMNITHREAD_CPPFLAGS = -I$(TOP)/include -D_REENTRANT
# To build omnithread on top of posix threads, uncomment the following three
# lines and comment out the corresponding ones in the solaris section above
# You also have to update $(TOP)/src/lib/omnithread/Makefile and
# $(TOP)/src/lib/omnithread/sharedlib/sun4_sosV_5.5.mk
#
OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10 \
-DPthreadSupportThreadPriority
OMNITHREAD_CPPFLAGS = -I$(TOP)/include -DUsePthread -D_REENTRANT
OMNITHREAD_LIB = -lomnithread -lpthread -lposix4
OMNITHREAD_STATIC_LIB = -W1,-Bstatic -lomnithread -W1,-Bdynamic -lpthread -lposix4
# 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\"
OMNIORB_CPPFLAGS = -D__OMNIORB2__ $(OMNITHREAD_CPPFLAGS)
OMNIORB_LIB = -lomniORB2 $(OMNITHREAD_LIB) -lsocket -lnsl
OMNIORB_STATIC_LIB = -W1,-Bstatic -lomniORB2 -W1,-Bdynamic $(OMNITHREAD_STATIC_LIB) \
-lsocket -lnsl
# Default directory for the omniNames log files.
OMNINAMES_LOG_DEFAULT_LOCATION = \"/var/omninames\"