From 440fad4858462c3ab33cf41254d9fdb7248da5f3 Mon Sep 17 00:00:00 2001 From: alexpeshkoff Date: Thu, 23 Jul 2009 08:58:26 +0000 Subject: [PATCH] HPUX port by Bill Oliver and Jerry Adair --- builds/posix/prefix.hpux_aCC | 79 ++++++++++++++++++++++++++++++++++++ configure.in | 45 ++++++++++---------- src/common/StatusArg.h | 6 ++- src/include/types_pub.h | 2 +- src/jrd/common.h | 5 +++ 5 files changed, 111 insertions(+), 26 deletions(-) create mode 100644 builds/posix/prefix.hpux_aCC diff --git a/builds/posix/prefix.hpux_aCC b/builds/posix/prefix.hpux_aCC new file mode 100644 index 0000000000..3e48e59801 --- /dev/null +++ b/builds/posix/prefix.hpux_aCC @@ -0,0 +1,79 @@ +# The contents of this file are subject to the Interbase Public +# License Version 1.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy +# of the License at http://www.Inprise.com/IPL.html +# +# Software distributed under the License is distributed on an +# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express +# or implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code was created by Inprise Corporation +# and its predecessors. Portions created by Inprise Corporation are +# Copyright (C) Inprise Corporation. +# +# All Rights Reserved. +# Contributor(s): Paul Beach, Jerry Adair, Bill Oliver +# + +# Compiler settings for HPUX using aCC + +# Before attempting the HPUX build, you must export necessary +# CFLAGS and CXXFLAGS to be picked up by the configure process and +# subsequent build. Make sure CC is in the path! +# +# for typical 64-bit build +# export CC=cc +# export CXX=CC +# export CFLAGS="+DD64" +# export CXXFLAGS=$CFLAGS + +# Useful predefined macros from HP aCC +# __HP_aCC, identifies the HP aC++ compiler driver version +# __HP_cc, identifies the HP C compiler driver version +# _ILP32, defined for +DD32 +# _LP64, defined for +DD64 +# __hpux +# __hppa, defined for PA RISC +# __ia64, defined for IA-64 +# __unix + + +# Flags shared by production and debug build +#COMMON_FLAGS= -DHP11 -DHPUX -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED +COMMON_FLAGS= -DHP11 -DHPUX -D_XOPEN_SOURCE_EXTENDED \ + -D_POSIX_C_SOURCE=199506L -mt $(ISA_COMMON_FLAGS) + +# Production flags +PROD_FLAGS= -fast -O -DNDEBUG \ + $(COMMON_FLAGS) + +# Devel flags +DEV_FLAGS= -g -AA \ + $(COMMON_FLAGS) $(ISA_DEV_FLAGS) + +OS_ServerFiles=inet_server.cpp +Server_main_dummy= os/sun/server_main_dummy.cpp + +# link options for HP-UX linker, /usr/bin/ld +LINK_OPTS= $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) -AA -latomic +LINK_LIBS+= -latomic $(ICU_LIBS) +LIB_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) -latomic -b + +LINK_UDF_LIBS+=$(ICU_LIBS) + +# From original HPUX prefix file +LIB_LINK_RPATH= -Wl,+b,$(1) +LIB_LINK_SONAME= -Wl,+h,$(1) +LIB_LINK_MAPFILE= -Wl,-c, +LINK_FBINTL_SYMBOLS= $(LIB_LINK_MAPFILE)$(ROOT)/builds/posix/fbintl.hpux.vers +LINK_IBUTIL_SYMBOLS= $(LIB_LINK_MAPFILE)$(ROOT)/builds/posix/ib_util.hpux.vers +LINK_FIREBIRD_SYMBOLS= $(LIB_LINK_MAPFILE)$(ROOT)/builds/posix/firebird.hpux.vers +LINK_TRACE_SYMBOLS = $(LIB_LINK_MAPFILE)$(ROOT)/builds/posix/fbtrace.hpux.vers + +EMBED_UTIL_TARGETS=gstat gds_relay gsec nbackup fbguard fb_lock_print fbsvcmgr +CLIENT_UTIL_TARGETS=gds_relay gstat gsec nbackup fbguard fbmgr_bin fb_lock_print fbsvcmgr + +Physical_IO_Module=unix.cpp + +UNDEF_PLATFORM= diff --git a/configure.in b/configure.in index 8696771353..90bdc9fd57 100644 --- a/configure.in +++ b/configure.in @@ -239,38 +239,35 @@ dnl CPU_TYPE=ppc64 ia64-*-hpux*) comp=`echo "$CXX" | cut -c1-3` case $comp in - aCC) MAKEFILE_PREFIX=hpux-aCC ; + aCC) MAKEFILE_PREFIX=hpux_aCC ; ICU_PLATFORM=HP-UX11ACC ; - AC_DEFINE(HPUXACC, 1, [Define this if using native compilers]) - libdir=/opt/aCC/lib ;; + ;; *) MAKEFILE_PREFIX=hpux_ia64 ; - libdir=/opt/hp-gcc-4.3.1/lib ;; + ;; + esac + INSTALL_PREFIX=hpux + PLATFORM=HPUX + AC_DEFINE(HPUX, 1, [Define this if OS is HP-UX]) + EDITLINE_FLG=Y + libdir=/usr/lib/pa20_64 + RT_LIB_CHECK=true + ;; + + hppa*-*-hpux*) + comp=`echo "$CXX" | cut -c1-3` + case $comp in + aCC) MAKEFILE_PREFIX=hpux_aCC ; + ICU_PLATFORM=HP-UX11ACC ; + ;; + *) MAKEFILE_PREFIX=hpux ; + ;; esac INSTALL_PREFIX=hpux PLATFORM=HPUX AC_DEFINE(HPUX, 1, [Define this if OS is HP-UX]) EDITLINE_FLG=Y SHRLIB_EXT=sl -dnl libdir=/opt/hp-gcc-4.3.1/lib -dnl libdir=/usr/lib/pa20_64 - RT_LIB_CHECK=true - ;; - - *-*-hpux*) - comp=`echo "$CXX" | cut -c1-3` - case $comp in - aCC) MAKEFILE_PREFIX=hpux-aCC ; - ICU_PLATFORM=HP-UX11ACC ; - AC_DEFINE(HPUXACC, 1, [Define this if using native compilers]) - libdir=/opt/aCC/lib ;; - *) MAKEFILE_PREFIX=hpux ; - libdir=/opt/hp-gcc-4.3.1/lib ;; - esac - PLATFORM=HPUX - AC_DEFINE(HPUX, 1, [Define this if OS is HP-UX]) - EDITLINE_FLG=Y - SHRLIB_EXT=sl -dnl libdir=/usr/lib/pa20_64 + libdir=/usr/lib/pa20_64 RT_LIB_CHECK=true ;; diff --git a/src/common/StatusArg.h b/src/common/StatusArg.h index 2d1e4c0e26..9b6201010a 100644 --- a/src/common/StatusArg.h +++ b/src/common/StatusArg.h @@ -42,7 +42,12 @@ class StatusVector; class Base { +#ifdef __HP_aCC +// aCC gives error, cannot access protected member class ImplBase +public: +#else protected: +#endif class ImplBase { private: @@ -75,7 +80,6 @@ protected: ~Base() { delete implementation; } ImplBase* const implementation; - public: ISC_STATUS getKind() const throw() { return implementation->getKind(); } ISC_STATUS getCode() const throw() { return implementation->getCode(); } diff --git a/src/include/types_pub.h b/src/include/types_pub.h index a05a1996e8..d4801d49a4 100644 --- a/src/include/types_pub.h +++ b/src/include/types_pub.h @@ -29,7 +29,7 @@ #include -#if defined(__GNUC__) +#if defined(__GNUC__) || defined (__HP_cc) || defined (__HP_aCC) #include #else diff --git a/src/jrd/common.h b/src/jrd/common.h index 27b9e0d5a8..0be6e16ca0 100644 --- a/src/jrd/common.h +++ b/src/jrd/common.h @@ -371,6 +371,11 @@ extern "C" int remove(const char* path); //#define FB_DOUBLE_ALIGN 8 #define IMPLEMENTATION isc_info_db_impl_isc_hp_ux /* 31 */ +#if defined (__HP_aCC) +// aCC error, __thread can be used only with C-like structs +#undef HAVE___THREAD +#endif + #define IEEE #pragma OPT_LEVEL 1 // 16-Apr-2002 HP10 in unistd.h Paul Beach