8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:03:03 +01:00

Allow to build using prefixed toolchain (configure --host).

This commit is contained in:
Adriano dos Santos Fernandes 2022-09-23 21:25:52 -03:00
parent cac5051bf9
commit a47a1699af
8 changed files with 29 additions and 20 deletions

View File

@ -93,13 +93,13 @@ buildDebugInfo: buildRoot
for x in `(cd $(GEN_ROOT)/buildroot; find)`; do \ for x in `(cd $(GEN_ROOT)/buildroot; find)`; do \
FIL=$(GEN_ROOT)/buildroot/$$x; \ FIL=$(GEN_ROOT)/buildroot/$$x; \
D_FIL=$(GEN_ROOT)/$(DebugDir)/`dirname $${x}`/.debug/`basename $${x}`.debug; \ D_FIL=$(GEN_ROOT)/$(DebugDir)/`dirname $${x}`/.debug/`basename $${x}`.debug; \
if [ ! -h $$FIL ] && readelf -h $$FIL > /dev/null 2> /dev/null; then \ if [ ! -h $$FIL ] && $(READELF) -h $$FIL > /dev/null 2> /dev/null; then \
mkdir -p $(GEN_ROOT)/$(DebugDir)/`dirname $$x`/.debug; \ mkdir -p $(GEN_ROOT)/$(DebugDir)/`dirname $$x`/.debug; \
echo Generating external debug info for $$x; \ echo Generating external debug info for $$x; \
cp $${FIL} $${D_FIL}; \ cp $${FIL} $${D_FIL}; \
objcopy --add-gnu-debuglink=$${D_FIL} $${FIL}; \ $(OBJCOPY) --add-gnu-debuglink=$${D_FIL} $${FIL}; \
echo Stripping unneeded symbols from $${x}; \ echo Stripping unneeded symbols from $${x}; \
objcopy --strip-debug --strip-unneeded $${FIL}; \ $(OBJCOPY) --strip-debug --strip-unneeded $${FIL}; \
fi; \ fi; \
done done
(cd $(GEN_ROOT)/$(DebugDir); mkdir -p ./$(MiscDir); \ (cd $(GEN_ROOT)/$(DebugDir); mkdir -p ./$(MiscDir); \

View File

@ -37,7 +37,7 @@ TargetDir=buildroot # Where we want to build the install image
SecurityDatabase=security5.fdb SecurityDatabase=security5.fdb
TomMathBuild="@TOMMATH_BUILD@" TomMathBuild="@TOMMATH_BUILD@"
TomCryptBuild="@TOMCRYPT_BUILD@" TomCryptBuild="@TOMCRYPT_BUILD@"
OBJDUMP=@OBJDUMP@
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# addLibs # addLibs
@ -55,9 +55,9 @@ addLibs() {
echo "#!/bin/sh" >>$libTarget echo "#!/bin/sh" >>$libTarget
echo >>$libTarget echo >>$libTarget
LIB=`objdump -p $libSdir/firebird|grep NEEDED|grep tomcrypt|awk '{print $2;}'` LIB=`$OBJDUMP -p $libSdir/firebird|grep NEEDED|grep tomcrypt|awk '{print $2;}'`
[ "$LIB" ] && echo "export LIBTOMCRYPT=$LIB" >>$libTarget [ "$LIB" ] && echo "export LIBTOMCRYPT=$LIB" >>$libTarget
LIB=$(echo `objdump -p $libSdir/isql|grep NEEDED|egrep "(curses|termcap|tinfo)"|awk '{print $2;}'`) LIB=$(echo `$OBJDUMP -p $libSdir/isql|grep NEEDED|egrep "(curses|termcap|tinfo)"|awk '{print $2;}'`)
[ "$LIB" ] && echo "export LIBCURSES='$LIB'" >>$libTarget [ "$LIB" ] && echo "export LIBCURSES='$LIB'" >>$libTarget
echo >>$libTarget echo >>$libTarget

View File

@ -174,10 +174,10 @@ $(GEN_ROOT)/Make.Version : $(SRC_ROOT)/misc/writeBuildNum.sh
# #
external: external:
CC="$(CC)" CFLAGS="$(CFLAGS)" $(MAKE) -C $(ROOT)/extern/btyacc CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" $(MAKE) -C $(ROOT)/extern/btyacc
CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" $(MAKE) -C $(ROOT)/extern/cloop TARGET=release WITH_FPC=0 BUILD_DIR=$(TMP_ROOT)/cloop OUT_DIR=$(GEN_ROOT)/$(TARGET)/cloop CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" $(MAKE) -C $(ROOT)/extern/cloop TARGET=release WITH_FPC=0 BUILD_DIR=$(TMP_ROOT)/cloop OUT_DIR=$(GEN_ROOT)/$(TARGET)/cloop core
CC="$(CC)" CFLAGS="$(CFLAGS)" $(MAKE) -C $(ROOT)/extern/decNumber CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" $(MAKE) -C $(ROOT)/extern/decNumber
ln -sf $(ROOT)/extern/decNumber/libdecFloat.a $(LIB) ln -sf $(ROOT)/extern/decNumber/libdecFloat.a $(LIB)
ifeq ($(ABSEIL_BUILD_FLG),Y) ifeq ($(ABSEIL_BUILD_FLG),Y)
@ -186,12 +186,12 @@ ifeq ($(ABSEIL_BUILD_FLG),Y)
endif endif
ifeq ($(RE2_BUILD_FLG),Y) ifeq ($(RE2_BUILD_FLG),Y)
CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS) -O3 -g -fPIC" $(MAKE) -C $(ROOT)/extern/re2 CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS) -O3 -g -fPIC" AR="$(AR)" $(MAKE) -C $(ROOT)/extern/re2
ln -sf $(ROOT)/extern/re2/obj/libre2.a $(LIB) ln -sf $(ROOT)/extern/re2/obj/libre2.a $(LIB)
endif endif
ifeq ($(TOMMATH_BUILD_FLG),Y) ifeq ($(TOMMATH_BUILD_FLG),Y)
CC="$(CC)" CFLAGS="$(CFLAGS)" $(MAKE) -C $(ROOT)/extern/libtommath -f makefile.shared GCC=$(GCC) CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" $(MAKE) -C $(ROOT)/extern/libtommath -f makefile.shared GCC="$(CC)"
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)
install_name_tool -id "@rpath/lib/libtommath.dylib" $(TOMMATH)/.libs/libtommath.0.dylib install_name_tool -id "@rpath/lib/libtommath.dylib" $(TOMMATH)/.libs/libtommath.0.dylib
@ -203,7 +203,7 @@ endif
endif endif
ifeq ($(TOMCRYPT_BUILD_FLG),Y) ifeq ($(TOMCRYPT_BUILD_FLG),Y)
CC="$(CC)" CFLAGS="$(CFLAGS) $(TOM2TOM_CFLAGS)" $(MAKE) -C $(ROOT)/extern/libtomcrypt -f makefile.shared GCC=$(GCC) LTC_LDFLAGS=$(LTC_LDFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS) $(TOM2TOM_CFLAGS)" $(MAKE) -C $(ROOT)/extern/libtomcrypt -f makefile.shared GCC="$(CC)" LTC_LDFLAGS=$(LTC_LDFLAGS)
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)
install_name_tool -id "@rpath/lib/libtomcrypt.dylib" $(TOMCRYPT)/.libs/libtomcrypt.1.dylib install_name_tool -id "@rpath/lib/libtomcrypt.dylib" $(TOMCRYPT)/.libs/libtomcrypt.1.dylib
@ -216,7 +216,7 @@ endif
ifeq ($(STD_EDITLINE),false) ifeq ($(STD_EDITLINE),false)
ifeq ($(EDITLINE_FLG),Y) ifeq ($(EDITLINE_FLG),Y)
CC="$(CC)" CFLAGS="$(CFLAGS)" $(MAKE) -f $(GEN_ROOT)/Makefile.extern.editline CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" $(MAKE) -f $(GEN_ROOT)/Makefile.extern.editline
endif endif
endif endif
@ -339,7 +339,7 @@ cross2:
$(MAKE) tommath $(MAKE) tommath
$(MAKE) LTCSOURCE=-DLTC_SOURCE tomcrypt $(MAKE) LTCSOURCE=-DLTC_SOURCE tomcrypt
$(MAKE) re2 $(MAKE) re2
CC="$(CC)" CFLAGS="$(CFLAGS)" $(MAKE) -C $(ROOT)/extern/decNumber CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)" $(MAKE) -C $(ROOT)/extern/decNumber
ln -sf $(ROOT)/extern/decNumber/libdecFloat$(CROSS).a $(LIB) ln -sf $(ROOT)/extern/decNumber/libdecFloat$(CROSS).a $(LIB)
CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" $(MAKE) -C $(ROOT)/extern/int128/absl/numeric CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" $(MAKE) -C $(ROOT)/extern/int128/absl/numeric
ln -sf $(ROOT)/extern/int128/absl/numeric/libi128$(CROSS).a $(LIB) ln -sf $(ROOT)/extern/int128/absl/numeric/libi128$(CROSS).a $(LIB)

View File

@ -181,9 +181,12 @@ RANLIB= @RANLIB@
BTYACC=$(ROOT)/extern/btyacc/btyacc BTYACC=$(ROOT)/extern/btyacc/btyacc
CLOOP=$(GEN_ROOT)/$(TARGET)/cloop/release/bin/cloop CLOOP=$(GEN_ROOT)/$(TARGET)/cloop/release/bin/cloop
AR = @AR@
CC = @CC@ CC = @CC@
CXX = @CXX@ CXX = @CXX@
LD = @CXX@ LD = @CXX@
OBJCOPY = @OBJCOPY@
READELF = @READELF@
AC_CFLAGS = @CFLAGS@ AC_CFLAGS = @CFLAGS@
AC_CXXFLAGS = @CXXFLAGS@ AC_CXXFLAGS = @CXXFLAGS@

View File

@ -794,6 +794,8 @@ AC_PROG_CPP
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
AC_CHECK_TOOL([OBJCOPY], [objcopy])
AC_CHECK_TOOL([READELF], [readelf])
LT_INIT([dlopen win32-dll]) LT_INIT([dlopen win32-dll])
dnl Check for system header files dnl Check for system header files
@ -1283,7 +1285,7 @@ AC_SUBST(SFIO_LDFLAGS)
AC_SUBST(SFIO_EXAMPLES) AC_SUBST(SFIO_EXAMPLES)
dnl The following file defines the version number strings. Specially for install/uninstall routines dnl The following file defines the version number strings. Specially for install/uninstall routines
. ./src/misc/writeBuildNum.sh CXX="$CXX" . ./src/misc/writeBuildNum.sh
AC_SUBST(FIREBIRD_VERSION) AC_SUBST(FIREBIRD_VERSION)
AC_SUBST(FIREBIRD_PACKAGE_VERSION) AC_SUBST(FIREBIRD_PACKAGE_VERSION)

10
extern/cloop/Makefile vendored
View File

@ -61,10 +61,14 @@ $1/%.o: %.cpp | $1
$(CXX) -c $$(CXX_FLAGS) $$< -o $$@ $(CXX) -c $$(CXX_FLAGS) $$< -o $$@
endef endef
.PHONY: all mkdirs clean .PHONY: all core mkdirs clean
all: mkdirs \ all: core tests
$(BIN_DIR)/cloop \
core: mkdirs \
$(BIN_DIR)/cloop
tests: mkdirs \
$(BIN_DIR)/test1-c$(SHRLIB_EXT) \ $(BIN_DIR)/test1-c$(SHRLIB_EXT) \
$(BIN_DIR)/test1-c$(EXE_EXT) \ $(BIN_DIR)/test1-c$(EXE_EXT) \
$(BIN_DIR)/test1-cpp$(SHRLIB_EXT) \ $(BIN_DIR)/test1-cpp$(SHRLIB_EXT) \

View File

@ -95,7 +95,7 @@ srcdir = .
BUILT_SOURCES = vi.h emacs.h common.h fcns.h help.h fcns.c help.c \ BUILT_SOURCES = vi.h emacs.h common.h fcns.h help.h fcns.c help.c \
$(append_1) $(append_1)
AHDR = vi.h emacs.h common.h AHDR = vi.h emacs.h common.h
ASRC = $(srcdir)/vi.c $(srcdir)/emacs.c $(srcdir)/common.c ASRC = $(srcdir)/vi.c $(srcdir)/emacs.c $(srcdir)/common.c
CLEANFILES = $(BUILT_SOURCES) CLEANFILES = $(BUILT_SOURCES)
LIBRARY = libedit.a LIBRARY = libedit.a

View File

@ -94,7 +94,7 @@ bn_mp_to_signed_bin_n.o bn_mp_to_unsigned_bin_n.o
objs: $(OBJECTS) objs: $(OBJECTS)
$(LIBNAME): $(OBJECTS) $(LIBNAME): $(OBJECTS)
$(LIBTOOL) --mode=link --tag=CC gcc *.lo -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) $(LIBTOOL) --mode=link --tag=CC $(GCC) *.lo -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION)
install: $(LIBNAME) install: $(LIBNAME)
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)