From 4cd5c17b29210d3da3eebc72a997d0d3b4bf163e Mon Sep 17 00:00:00 2001 From: Piotr Kubaj Date: Tue, 13 Dec 2022 04:15:22 +0100 Subject: [PATCH] Add support for FreeBSD/powerpc64 --- builds/posix/prefix.freebsd_powerpc64 | 29 +++++++++++++++++++++++++ configure.ac | 10 +++++++++ src/common/classes/DbImplementation.cpp | 2 +- src/common/common.h | 4 ++++ src/include/firebird/impl/inf_pub.h | 2 ++ 5 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 builds/posix/prefix.freebsd_powerpc64 diff --git a/builds/posix/prefix.freebsd_powerpc64 b/builds/posix/prefix.freebsd_powerpc64 new file mode 100644 index 0000000000..3191c00206 --- /dev/null +++ b/builds/posix/prefix.freebsd_powerpc64 @@ -0,0 +1,29 @@ +# 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) 2000 Inprise Corporation +# All Rights Reserved. +# Contributor(s): ______________________________________. +# Start of file prefix.freebsd_powerpc64: $(VERSION) @PLATFORM@ +# +# 2 Oct 2002, Nickolay Samofatov - Major Cleanup + +EXE_LINK_OPTIONS := $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) -Wl,-rpath,../gen/firebird/lib + +COMMON_FLAGS=-DFREEBSD -DPPC64 -pipe -MMD -fPIC -fsigned-char +PROD_FLAGS=$(COMMON_FLAGS) -O3 -g -fno-builtin -Wno-deprecated +DEV_FLAGS=$(COMMON_FLAGS) -ggdb -p -Wall -Wno-non-virtual-dtor + +# These files are generated incorrectly (e.g. array.epp => array.cpp) +%/array.o %/blob.o %/alice_meta.o %/restore.o %/backup.o: COMMON_FLAGS += -Wno-narrowing +%/OdsDetection.o %/dba.o: COMMON_FLAGS += -Wno-narrowing diff --git a/configure.ac b/configure.ac index 78df015501..dabb801aa9 100644 --- a/configure.ac +++ b/configure.ac @@ -188,6 +188,16 @@ dnl CPU_TYPE=ppc64 SHRLIB_EXT=so ;; + powerpc64-*-freebsd*) + MAKEFILE_PREFIX=freebsd_powerpc64 + PLATFORM=FREEBSD + INSTALL_PREFIX=freebsd + AC_DEFINE(FREEBSD, 1, [Define this if OS is FreeBSD]) + AC_DEFINE(PPC64, 1, [Define this if CPU is ppc64]) + EDITLINE_FLG=Y + SHRLIB_EXT=so + ;; + *-gentoo-freebsd*) MAKEFILE_PREFIX=freebsd PLATFORM=GENTOOFREEBSD diff --git a/src/common/classes/DbImplementation.cpp b/src/common/classes/DbImplementation.cpp index fdfde4fdd7..c1d382ea27 100644 --- a/src/common/classes/DbImplementation.cpp +++ b/src/common/classes/DbImplementation.cpp @@ -128,7 +128,7 @@ const UCHAR backwardTable[FB_NELEM(hardware) * FB_NELEM(operatingSystem)] = /* HPUX */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, /* AIX */ 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* MVS */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* FreeBSD */ 61, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, +/* FreeBSD */ 61, 67, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, /* NetBSD */ 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; diff --git a/src/common/common.h b/src/common/common.h index 865dcac831..00f7e49839 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -287,6 +287,10 @@ #define FB_CPU CpuPowerPc64el #endif +#ifdef PPC64 +#define FB_CPU CpuPowerPc64 +#endif + #if defined(i386) || defined(__i386) || defined(__i386__) #define I386 #define FB_CPU CpuIntel diff --git a/src/include/firebird/impl/inf_pub.h b/src/include/firebird/impl/inf_pub.h index e3d6ce04d2..3d765e7d7a 100644 --- a/src/include/firebird/impl/inf_pub.h +++ b/src/include/firebird/impl/inf_pub.h @@ -302,6 +302,8 @@ enum info_db_implementations isc_info_db_impl_linux_mips64el = 90, + isc_info_db_impl_freebsd_ppc64 = 91, + isc_info_db_impl_last_value // Leave this LAST! };