Restructured and adapted to recent build system changes; code

builds and runs both shared and static with native or GNU compiler
This commit is contained in:
Ralph Lange
2003-04-04 12:50:29 +00:00
parent 9242561f9f
commit c8c64a212c
7 changed files with 68 additions and 56 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -11,4 +11,3 @@
include $(CONFIG)/os/CONFIG.UnixCommon.Common
WIND_HOST_TYPE = parisc-hpux10

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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