From 77437e443bb2e402f91aeb0a337142ff35249c4e Mon Sep 17 00:00:00 2001 From: AlexPeshkoff Date: Thu, 9 Apr 2020 17:18:41 +0300 Subject: [PATCH] Applied freebsd-related changes from PR#72 --- builds/posix/Makefile.in | 4 +++- builds/posix/prefix.freebsd_amd64 | 7 ++++++- extern/cloop/Makefile | 16 +++++++++++----- extern/editline/src/chartype.h | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/builds/posix/Makefile.in b/builds/posix/Makefile.in index c194682fc3..146db3670a 100644 --- a/builds/posix/Makefile.in +++ b/builds/posix/Makefile.in @@ -68,7 +68,9 @@ ifeq ($(LSB_FLG),Y) GCC=/opt/lsb/bin/lsbcc export CC export CXX -else +endif + +ifndef GCC GCC=gcc endif diff --git a/builds/posix/prefix.freebsd_amd64 b/builds/posix/prefix.freebsd_amd64 index d8f53767c2..f27567a271 100644 --- a/builds/posix/prefix.freebsd_amd64 +++ b/builds/posix/prefix.freebsd_amd64 @@ -18,7 +18,12 @@ # # 2 Oct 2002, Nickolay Samofatov - Major Cleanup -EXE_LINK_OPTIONS+=-Wl,-rpath,../gen/firebird/lib +EXE_LINK_OPTIONS := $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) -Wl,-rpath,../gen/firebird/lib PROD_FLAGS=-O -fno-builtin -DFREEBSD -DAMD64 -pipe -MMD -fPIC DEV_FLAGS=-ggdb -DFREEBSD -DAMD64 -pipe -MMD -p -fPIC -Wall -Wno-non-virtual-dtor + +# This file must be compiled with SSE4.2 support +%/CRC32C.o: CXXFLAGS += -msse4 + +CXXFLAGS := $(CXXFLAGS) -std=c++11 diff --git a/extern/cloop/Makefile b/extern/cloop/Makefile index bab489ab69..c4277f0919 100644 --- a/extern/cloop/Makefile +++ b/extern/cloop/Makefile @@ -31,6 +31,12 @@ C_FLAGS := -ggdb -fPIC -MMD -MP -W -Wall -Wno-unused-parameter CXX_FLAGS := $(C_FLAGS) FPC_FLAGS := -Mdelphi +ifeq ($(shell uname),FreeBSD) + DL_LIB := +else + DL_LIB := -ldl +endif + ifeq ($(TARGET),release) CXX_FLAGS += -O3 endif @@ -85,7 +91,7 @@ $(BIN_DIR)/cloop: \ $(OBJ_DIR)/cloop/Parser.o \ $(OBJ_DIR)/cloop/Main.o \ - $(LD) $^ -o $@ + $(LD) $^ -o $@ $(LIBS) $(SRC_DIR)/tests/test1/CalcCApi.h: $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl c-header $@ CALC_C_API_H CALC_I @@ -112,23 +118,23 @@ $(BIN_DIR)/test1-c$(SHRLIB_EXT): \ $(OBJ_DIR)/tests/test1/CalcCApi.o \ $(OBJ_DIR)/tests/test1/CTest.o \ - $(LD) $^ -shared -ldl -o $@ + $(LD) $^ -shared $(DL_LIB) -o $@ $(LIBS) $(BIN_DIR)/test1-c$(EXE_EXT): \ $(OBJ_DIR)/tests/test1/CalcCApi.o \ $(OBJ_DIR)/tests/test1/CTest.o \ - $(LD) $^ -ldl -o $@ + $(LD) $^ $(DL_LIB) -o $@ $(LIBS) $(BIN_DIR)/test1-cpp$(SHRLIB_EXT): \ $(OBJ_DIR)/tests/test1/CppTest.o \ - $(LD) $^ -shared -ldl -o $@ + $(LD) $^ -shared $(DL_LIB) -o $@ $(LIBS) $(BIN_DIR)/test1-cpp$(EXE_EXT): \ $(OBJ_DIR)/tests/test1/CppTest.o \ - $(LD) $^ -ldl -o $@ + $(LD) $^ $(DL_LIB) -o $@ $(LIBS) $(BIN_DIR)/test1-pascal$(SHRLIB_EXT): \ $(SRC_DIR)/tests/test1/PascalClasses.pas \ diff --git a/extern/editline/src/chartype.h b/extern/editline/src/chartype.h index 0beee17cd2..d037363c23 100644 --- a/extern/editline/src/chartype.h +++ b/extern/editline/src/chartype.h @@ -44,7 +44,7 @@ * supports non-BMP code points without requiring UTF-16, but nothing * seems to actually advertise this properly, despite Unicode 3.1 having * been around since 2001... */ -#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__OpenBSD__) +#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__OpenBSD__) && !defined(__FreeBSD__) #ifndef __STDC_ISO_10646__ /* In many places it is assumed that the first 127 code points are ASCII * compatible, so ensure wchar_t indeed does ISO 10646 and not some other