From c8c64a212c7b1e4b6fce83db4c1246edf5fef25b Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Fri, 4 Apr 2003 12:50:29 +0000 Subject: [PATCH] Restructured and adapted to recent build system changes; code builds and runs both shared and static with native or GNU compiler --- configure/os/CONFIG.Common.hpux-parisc | 20 +++++++------ .../os/CONFIG.hpux-parisc-gnu.hpux-parisc-gnu | 13 ++++++-- configure/os/CONFIG.hpux-parisc.Common | 1 - configure/os/CONFIG.hpux-parisc.hpux-parisc | 29 +++++++++--------- configure/os/CONFIG_SITE.Common.hpux-parisc | 18 +++++++++++ .../os/CONFIG_SITE.Common.hpux-parisc-gnu | 13 ++++++++ .../os/CONFIG_SITE.hpux-parisc.hpux-parisc | 30 ------------------- 7 files changed, 68 insertions(+), 56 deletions(-) create mode 100644 configure/os/CONFIG_SITE.Common.hpux-parisc create mode 100644 configure/os/CONFIG_SITE.Common.hpux-parisc-gnu delete mode 100644 configure/os/CONFIG_SITE.hpux-parisc.hpux-parisc diff --git a/configure/os/CONFIG.Common.hpux-parisc b/configure/os/CONFIG.Common.hpux-parisc index 8a49dda43..9c4e3762a 100644 --- a/configure/os/CONFIG.Common.hpux-parisc +++ b/configure/os/CONFIG.Common.hpux-parisc @@ -13,21 +13,23 @@ include $(CONFIG)/os/CONFIG.Common.UnixCommon OS_CLASS = hpux ARCH_CLASS = parisc -POSIX_CPPFLAGS_YES = -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -POSIX_CPPFLAGS_NO = -POSIX_LDLIBS_NO += -# When compiling with gcc, static builds need two more libraries (*sigh*) -POSIX_LDLIBS_GNU_YES_STATIC_YES += -lpthread -l:libdld.sl -POSIX_LDLIBS_YES = $(POSIX_LDLIBS_GNU_$(GNU)_STATIC_$(STATIC_BUILD)) +# Posix stuff is not set here as "-mt" (in CONFIG.hpux-parisc.hpux-parisc) +# does all defines and linker options to make posix threads work -OP_SYS_CPPFLAGS = -D_HPUX_SOURCE -DHP_UX +OP_SYS_CPPFLAGS = -DHP_UX +OP_SYS_CFLAGS = -D_HPUX_SOURCE +OP_SYS_CXXFLAGS = -SHARED_LIBRARIES=YES SHRLIB_SUFFIX = .sl$(addprefix .,$(SHRLIB_VERSION)) +# Set runtime path for shared libraries +empty:= # trick from the make docs... +space:= $(empty) $(empty) +RUNTIME_LDFLAGS_YES = -Wl,+b$(subst $(space),:,$(sort $(SHRLIB_SEARCH_DIRS))),+s +RUNTIME_LDFLAGS += $(RUNTIME_LDFLAGS_$(SHARED_LIBRARIES)) + ifdef CROSS GNU_TARGET=parisc-hp-unix CMPLR_SUFFIX= CMPLR_PREFIX=$(addsuffix -,$(GNU_TARGET)) endif - diff --git a/configure/os/CONFIG.hpux-parisc-gnu.hpux-parisc-gnu b/configure/os/CONFIG.hpux-parisc-gnu.hpux-parisc-gnu index a30ec266c..9a81cc7f7 100644 --- a/configure/os/CONFIG.hpux-parisc-gnu.hpux-parisc-gnu +++ b/configure/os/CONFIG.hpux-parisc-gnu.hpux-parisc-gnu @@ -10,11 +10,20 @@ # Include common gnu compiler definitions include $(CONFIG)/CONFIG.gnuCommon -#GNU_DIR = /opt/gnu - CC = $(GNU_BIN)/gcc CCC = $(GNU_BIN)/g++ AR = ar -rc RANLIB= LD = ld -r +# Always keep libc shared to force using the one supplied with the +# target machine (HP system and libc must match - important e.g. for +# multi-CPU-systems) +STATIC_LDFLAGS_YES = -static -l:libc.sl + +# Switch explicitly from default DCE threads to posix threads +POSIX_CPPFLAGS_YES += -D_REENTRANT -D_PTHREADS -D_POSIX_C_SOURCE=199506L +USR_SYS_LIBS += pthread + +# C++ templates need PIC definition also in link phase +SHRLIB_LDFLAGS += -shared -fPIC diff --git a/configure/os/CONFIG.hpux-parisc.Common b/configure/os/CONFIG.hpux-parisc.Common index 111b879ac..7bbb7b614 100644 --- a/configure/os/CONFIG.hpux-parisc.Common +++ b/configure/os/CONFIG.hpux-parisc.Common @@ -11,4 +11,3 @@ include $(CONFIG)/os/CONFIG.UnixCommon.Common WIND_HOST_TYPE = parisc-hpux10 - diff --git a/configure/os/CONFIG.hpux-parisc.hpux-parisc b/configure/os/CONFIG.hpux-parisc.hpux-parisc index a52275259..787ba5847 100644 --- a/configure/os/CONFIG.hpux-parisc.hpux-parisc +++ b/configure/os/CONFIG.hpux-parisc.hpux-parisc @@ -18,9 +18,8 @@ LD = ld -r CONFORM_CFLAGS_ANSI = -Aa CONFORM_CFLAGS_STRICT = -Aa CONFORM_CFLAGS_TRAD = -Ac -###################################################### -# +DAportable causes portable object code to be created for execution -# on different PA-Risc machines + +# Portability across different PA-RISC architecture versions CODE_CFLAGS = +DAportable +z WARN_CFLAGS_YES = WARN_CFLAGS_NO = -w @@ -29,28 +28,30 @@ OPT_CFLAGS_NO = -g CXXCMPLR=STRICT +# Selective filter for getting rid of bogus compiler warnings COMPILE_FILTER.cpp = 2>&1 | $(EPICS_BASE)/configure/tools/filterWarnings.pl # Configure OS vendor C++ compiler -CONFORM_CXXFLAGS_NORMAL = -AA -mt -Aa -#CONFORM_CXXFLAGS_STRICT = +p -CONFORM_CXXFLAGS_STRICT = -AA -mt -Aa +CONFORM_CXXFLAGS_NORMAL = -AA -Aa -mt +CONFORM_CXXFLAGS_STRICT = -AA -Aa -mt +#CONFORM_CXXFLAGS_STRICT += +p -###################################################### -# +DAportable causes portable object code to be created for execution -# on different PA-Risc machines +# Portability across different PA-RISC architecture versions CODE_CXXFLAGS = +DAportable +z WARN_CXXFLAGS_YES = +w WARN_CXXFLAGS_NO = OPT_CXXFLAGS_YES = +O3 OPT_CXXFLAGS_NO = -g +# Always keep libc shared to force using the one supplied with the +# target machine (HP system and libc must match - important e.g. for +# multi-CPU-systems) STATIC_LDFLAGS_YES= -Wl,-a,archive -l:libc.sl -# shared libs will be found by searching environment variable SHLIB_PATH, -# then by searching the specified path (see below) -STATIC_LDFLAGS_NO = -Wl,+b$(DEFAULT_SHRLIB_SEARCH_PATH),+s -STATIC_LDLIBS_YES= -STATIC_LDLIBS_NO= +STATIC_LDFLAGS_NO = + +STATIC_LDLIBS_YES = +STATIC_LDLIBS_NO = + TARGET_LDFLAGS += -AA -mt SHRLIB_LDFLAGS = -b diff --git a/configure/os/CONFIG_SITE.Common.hpux-parisc b/configure/os/CONFIG_SITE.Common.hpux-parisc new file mode 100644 index 000000000..da4d7d49c --- /dev/null +++ b/configure/os/CONFIG_SITE.Common.hpux-parisc @@ -0,0 +1,18 @@ +# CONFIG_SITE.Common.hpux-parisc +# +# $Id$ +# +# Site Specific definitions for hpux-parisc target +# Only the local epics system manager should modify this file + +# NOTE for SHARED_LIBRARIES: If YES (which is the default now) then either +# a) SHLIB_PATH must include the full absolute pathname to +# $(INSTALL_LOCATION)/lib/$(EPICS_HOST_ARCH) (or wherever you install +# the EPICS shared libraries on your system) when invoking base +# executables. +# b) Add the path to SHRLIB_SEARCH_DIRS below, which will burn +# the runtime search path into the executables. +#SHARED_LIBRARIES=YES + +# This is the absolute path to the generic INSTALL_LOCATION, for SHARED_LIBRARY searches. +SHRLIB_SEARCH_DIRS += /opt/epics/R$(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION)/support/base/$(EPICS_VERSION)-$(EPICS_REVISION)-$(EPICS_MODIFICATION)-$(EPICS_UPDATE_NAME)$(EPICS_UPDATE_LEVEL)/lib/$(EPICS_HOST_ARCH) diff --git a/configure/os/CONFIG_SITE.Common.hpux-parisc-gnu b/configure/os/CONFIG_SITE.Common.hpux-parisc-gnu new file mode 100644 index 000000000..efe52e56d --- /dev/null +++ b/configure/os/CONFIG_SITE.Common.hpux-parisc-gnu @@ -0,0 +1,13 @@ +# CONFIG_SITE.Common.hpux-parisc-gnu +# +# $Id$ +# +# Site Specific definitions for hpux-parisc-gnu target +# Only the local epics system manager should modify this file + +# Include definitions for hpux-parisc, as gnu builds will use the HP linker +include $(CONFIG)/os/CONFIG_SITE.Common.hpux-parisc + +# If you have built the GNU suite yourself, set the install location here, +# else the default (/usr/local) will be used +#GNU_DIR = /opt/gcc diff --git a/configure/os/CONFIG_SITE.hpux-parisc.hpux-parisc b/configure/os/CONFIG_SITE.hpux-parisc.hpux-parisc deleted file mode 100644 index 757ffb11b..000000000 --- a/configure/os/CONFIG_SITE.hpux-parisc.hpux-parisc +++ /dev/null @@ -1,30 +0,0 @@ -# CONFIG_SITE.hpux-parisc.hpux-parisc -# -# $Id$ -# -# Site Specific Configuration Information -# Only the local epics system manager should modify this file - -# by default, build and use shared libraries -SHARED_LIBRARIES=YES - -# where we expect to find shared libraries if not found elsewhere -# No special action should be required to build or use shared libraries. -# However, when a new shared library is built using the above configuration, -# it should be copied into the location specified by DEFAULT_SHRLIB_SEARCH_PATH -# which in this specific case is: /cs/lib/R3.13.1.1/ - -# JLab version -#DEFAULT_SHRLIB_SEARCH_PATH = /cs/lib/R$(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION).$(EPICS_UPDATE_NAME)$(EPICS_UPDATE_LEVEL):$(INSTALL_LIB) - -# BESSY version -DEFAULT_SHRLIB_SEARCH_PATH = /opt/epics/R$(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION)/support/base/$(EPICS_VERSION)-$(EPICS_REVISION)-$(EPICS_MODIFICATION)-$(EPICS_UPDATE_NAME)$(EPICS_UPDATE_LEVEL)/lib/hpux-parisc - -# cal added this so that libraries can be built with position -# independent code even if shared libraries aren't being built. -# Otherwise you would have to recompile everything when switching from -# static to shared. -ifeq ($(RELOCATABLE), YES) - ARCH_DEP_CFLAGS += +z - ARCH_DEP_CXXFLAGS += +z -endif