8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 21:23:04 +01:00
firebird-mirror/builds/posix/make.defaults

437 lines
13 KiB
Plaintext
Raw Normal View History

#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (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.mozilla.org/MPL/
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. You may obtain a copy of the Licence at
# http://www.gnu.org/copyleft/gpl.html
2009-12-04 11:05:41 +01:00
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Relevant for more details.
2009-12-04 11:05:41 +01:00
#
# This file was created by members of the firebird development team.
# All individual contributions remain the Copyright (C) of those
# individuals. Contributors to this file are either listed here or
# can be obtained from a CVS history command.
2009-12-04 11:05:41 +01:00
#
# All rights reserved.
#
# Created by: Mark O'Donohue <mark.odonohue@ludwig.edu.au>
2009-12-04 11:05:41 +01:00
#
# Contributor(s):
2009-12-04 11:05:41 +01:00
#
#
#
#_____________________________________________________________________________
# This file contains default values that are used by the build process do not
# change these here, but override them in the platform specific file
2009-12-04 11:05:41 +01:00
# prefix.xxx where xxx is the platform name using the form SH := bash
# see the readme file with the Makefile.in files for more details.
#_____________________________________________________________________________
TMP_ROOT=$(ROOT)/temp/$(TARGET)
GEN_ROOT=$(ROOT)/gen
SRC_ROOT=$(ROOT)/src
BLD_ROOT=$(ROOT)/builds
LNG_ROOT=$(ROOT)/lang_helpers
EXA_ROOT=$(ROOT)/examples
2003-03-27 12:21:47 +01:00
IsCross=@IS_CROSS@
TOMMATH_BUILD_FLG=@TOMMATH_BUILD@
TOMCRYPT_BUILD_FLG=@TOMCRYPT_BUILD@
FB_BUILD=$(GEN_ROOT)/$(TARGET)/firebird
ifeq ($(IsCross), Y)
FIREBIRD=$(GEN_ROOT)/Native/firebird
else
FIREBIRD=$(FB_BUILD)
endif
FIREBIRD_LOCK=$(FIREBIRD)
2003-03-27 12:21:47 +01:00
export FIREBIRD
export FIREBIRD_LOCK
2003-03-27 12:21:47 +01:00
2011-03-21 14:43:51 +01:00
# Set firebird to boot build mode
FIREBIRD_BOOT_BUILD=1
export FIREBIRD_BOOT_BUILD
LIB=$(FB_BUILD)/lib
BIN=$(FB_BUILD)/bin
PLUGINS=$(FB_BUILD)/plugins
RBIN=$(FIREBIRD)/bin
2003-03-27 12:21:47 +01:00
# This picks up the current directory and maps it to the equivalent module
# in the src and gen area.
RealSrcRootPath = $(shell cd $(SRC_ROOT); pwd)
#ModuleName:=$(notdir $(CURDIR))
ModuleName:=$(subst $(RealSrcRootPath)/,,$(CURDIR))
2010-10-12 10:02:57 +02:00
OBJ=$(TMP_ROOT)
2003-03-27 12:21:47 +01:00
GEN_SRC=$(OBJ)
2010-10-12 10:02:57 +02:00
# avoid generated cpp files deletion
.SECONDARY:
2010-10-12 10:02:57 +02:00
2003-03-27 12:21:47 +01:00
# This one is not so widely used at the momement.
# but I would like it to become so.
RealFirebirdPath = @NEW_FIREBIRD_DIR@
#____________________________________________________________________________
# From here we may set some global options to both compiler and linker.
2011-10-11 15:42:55 +02:00
# Use empty default global options for all compilers and linkers
GLOB_OPTIONS:=
# Possible use - profiling.
2011-10-11 15:42:55 +02:00
#GLOB_OPTIONS:= -pg
2005-12-28 07:58:28 +01:00
#____________________________________________________________________________
# Global c++ flags: firebird needs no RTTI, choose build standard
2021-05-31 13:55:26 +02:00
PLUSPLUS_FLAGS:= -fno-rtti -std=c++17
2011-10-11 15:42:55 +02:00
2010-10-12 19:40:27 +02:00
# If this is defined then we use special rules useful for developers only
2010-10-12 10:02:57 +02:00
IsDeveloper = @DEVEL_FLG@
2005-12-28 07:58:28 +01:00
CpuType=@CPU_TYPE@
2003-02-19 06:14:36 +01:00
PLATFORM=@PLATFORM@
2008-09-02 16:22:42 +02:00
SFIO_EXAMPLES=@SFIO_EXAMPLES@
2008-09-04 13:48:41 +02:00
# link with readline libraries - set by configure
EDITLINE_FLG=@EDITLINE_FLG@
STD_EDITLINE=@STD_EDITLINE@
READLINE=@READLINE@
# threading options - set by configure
THR_FLAGS=@PTHREAD_CFLAGS@
THR_LIBS=@PTHREAD_LIBS@
2009-05-07 16:49:40 +02:00
# thread local storage options - set by configure
TLS_OPTIONS=@TLS_OPTIONS@
2009-07-21 10:58:28 +02:00
# atomic options - set by configure
ATOMIC_OPTIONS=@ATOMIC_OPTIONS@
# compare and swap options - set by configure
# needed at least for solaris inline assembly routines
CAS_OPTIONS=@CAS_OPTIONS@
# multiple-precision integer library
MATHLIB=@MATHLIB@
2018-02-07 18:16:57 +01:00
DECLIB=-ldecFloat$(CROSS)
2019-08-14 03:31:10 +02:00
RE2LIB=-lre2
# crypt library
CRYPTLIB=@CRYPTLIB@
2016-05-25 14:14:01 +02:00
LSB_FLG=@LSB_FLG@
ifeq ($(LSB_FLG), Y)
LSB_UNDEF=-Wl,--allow-shlib-undefined
endif
2012-02-24 17:55:18 +01:00
# switch to make sed edit files inplace
INLINE_EDIT_SED:= -i
# Default programs and tools to be used in the build process
SH= sh -c
RM= rm -f
RM_R= rm -rf
CHMOD= chmod
CHMOD_6= chmod 666
CHMOD_7= chmod 777
CHMOD_S7= chmod 06777
MV= mv -f
TOUCH= touch
CP= cp
ECHO= echo
QUIET_ECHO= @echo
CD= cd
CAT= cat
AR= ar @AR_OPTIONS@
LN= @LN_S@
RANLIB= @RANLIB@
BTYACC=$(ROOT)/extern/btyacc/btyacc
2015-04-07 05:19:51 +02:00
CLOOP=$(GEN_ROOT)/$(TARGET)/cloop/release/bin/cloop
2006-07-04 06:05:06 +02:00
CC = @CC@
CXX = @CXX@
LD = @CXX@
AC_CFLAGS = @CFLAGS@
AC_CXXFLAGS = @CXXFLAGS@
2016-05-25 14:14:01 +02:00
2006-07-04 06:05:06 +02:00
# LINKER COMMANDS
2019-11-28 16:54:50 +01:00
# FIXME: -static-libstdc++ in MacOS
ifeq ($(PLATFORM),DARWIN)
LIB_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS)
EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS)
else
LIB_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) -static-libstdc++
EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) -static-libstdc++
2019-11-28 16:54:50 +01:00
endif
STATICLIB_LINK = $(AR) crus
STATICEXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) -static-libstdc++
2006-07-04 06:05:06 +02:00
2019-08-14 03:31:10 +02:00
LINK_LIBS = @LIBS@ $(DECLIB) $(RE2LIB)
SO_LINK_LIBS = @LIBS@ $(DECLIB) $(RE2LIB)
2006-07-04 06:05:06 +02:00
# Default extensions
ARCH_EXT= .a
2002-12-06 15:30:40 +01:00
EXEC_EXT= @EXEEXT@
SHRLIB_EXT=@SHRLIB_EXT@
2005-06-10 12:32:51 +02:00
LIB_PREFIX= lib
2008-12-05 14:53:53 +01:00
SHRLIB_FOREIGN_EXT= $(SHRLIB_EXT)
2003-03-27 12:21:47 +01:00
#_____________________________________________________________________________
# Include file with version variable definitions
include $(ROOT)/gen/Make.Version
# Add windows dll to library patterns
.LIBPATTERNS += %.dll lib%.dll
# Search path for libraries
vpath %.so $(LIB)
vpath %.a $(LIB)
vpath %.dll $(LIB)
#_____________________________________________________________________________
# From jrd
# The firebird shared library name
2003-07-09 02:46:55 +02:00
# SD: This name is also hard-coded in builds/install/.../linux/classic scripts.
# Scold me, but I don't want library names to be in configure.in
2009-12-04 11:05:41 +01:00
#
2010-10-12 10:02:57 +02:00
#LibraryFileName=libfbclient
LibraryFileName=libfbclient
2010-10-12 10:02:57 +02:00
LibraryFullName=$(LibraryFileName).${SHRLIB_EXT}.${FirebirdVersion}
2010-10-25 17:48:35 +02:00
LibrarySoName=$(LibraryFileName).${SHRLIB_EXT}.2
2010-10-12 10:02:57 +02:00
LibraryBaseName=$(LibraryFileName).${SHRLIB_EXT}
2010-10-12 10:02:57 +02:00
LIBFIREBIRD_FULLNAME = $(LIB)/$(LibraryFullName)
LIBFIREBIRD_SONAME = $(LIB)/$(LibraryBaseName)
LIBFIREBIRD_BASENAME = $(LIB)/$(LibrarySoName)
2010-10-12 10:02:57 +02:00
# The firebird engine library name
EngineFileName=libEngine${OdsVersion}
EngineSoName=$(EngineFileName).${SHRLIB_EXT}
ENGINE_SONAME = $(PLUGINS)/$(EngineSoName)
# intl will load dynamically, and having the whole soname set with version
# confuses the dynamic load process. So we only have the .$(SHRLIB_EXT) file
# MOD 28-July-2002
LIBFBINTL_SO = $(FB_BUILD)/intl/$(LIB_PREFIX)fbintl.$(SHRLIB_EXT)
ifeq ($(EDITLINE_FLG),Y)
ifeq ($(STD_EDITLINE), true)
LIBEDITLINE := -l$(READLINE)
else
LIBEDITLINE := $(LIB)/libedit.a
endif
TERMLIB := -l@TERMLIB@
endif
2003-05-25 02:04:54 +02:00
# Shared library name for usage inside of the UDF
2005-06-10 12:32:51 +02:00
IbUtilLibraryName = $(LIB_PREFIX)ib_util.$(SHRLIB_EXT)
2003-05-25 02:04:54 +02:00
LIBIBUTIL_SO = $(LIB)/$(IbUtilLibraryName)
# Own tommath support
TOMMATH=$(ROOT)/extern/libtommath
TOMMATH_INC=$(TOMMATH)
TOMMATH_VER=0
2019-11-28 16:54:50 +01:00
ifeq ($(PLATFORM),DARWIN)
TOMMATH_SO=$(TOMMATH)/.libs/libtommath.dylib
else
TOMMATH_SO=$(TOMMATH)/.libs/libtommath.so
endif
# Own tomcrypt support
TOMCRYPT=$(ROOT)/extern/libtomcrypt
TOMCRYPT_INC=$(TOMCRYPT)/src/headers
TOMCRYPT_SO=$(TOMCRYPT)/.libs/libtomcrypt.so
TOMCRYPT_VER=1
# LINKER OPTIONS
#
UNDEF_PLATFORM = -Wl,--no-undefined
2010-10-12 10:02:57 +02:00
ifeq ($(TARGET),Debug)
UNDEF_FLAGS = $(UNDEF_PLATFORM)
endif
FIREBIRD_VERS = firebird.vers
FBINTL_VERS = fbintl.vers
IB_UTIL_VERS = ib_util.vers
UDR_PLUGIN_VERS = udr_plugin.vers
EMPTY_VERS = empty.vers
PLUGIN_VERS = fbplugin.vers
ALLVERS = $(FIREBIRD_VERS) $(FBINTL_VERS) $(IB_UTIL_VERS)
ALLVERS += $(UDR_PLUGIN_VERS) $(EMPTY_VERS) $(PLUGIN_VERS)
LINK_FIREBIRD_SYMBOLS = $(call LIB_LINK_MAPFILE,$(FIREBIRD_VERS))
LINK_FBINTL_SYMBOLS = $(call LIB_LINK_MAPFILE,$(FBINTL_VERS))
LINK_IBUTIL_SYMBOLS = $(call LIB_LINK_MAPFILE,$(IB_UTIL_VERS))
LINK_UDR_PLUGIN_SYMBOLS = $(call LIB_LINK_MAPFILE,$(UDR_PLUGIN_VERS))
LINK_EMPTY_SYMBOLS = $(call LIB_LINK_MAPFILE,$(EMPTY_VERS))
LINK_PLUGIN_SYMBOLS = $(call LIB_LINK_MAPFILE,$(PLUGIN_VERS))
LINK_EXEC_EXPORT=-rdynamic
UDR_SUPPORT_LIBS=
2019-11-28 16:54:50 +01:00
ifeq ($(PLATFORM),DARWIN)
LIB_LINK_RPATH =
else
LIB_PLATFORM_RPATH = -Wl,-rpath,$(1)
ifeq (@USE_RPATH@,1)
ifeq ($(strip @BINRELOC_CFLAGS@),)
LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,$(if $(subst intl,,$(1)),@FB_LIBDIR@,@FB_INTLDIR@))
else
LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,'$$ORIGIN/../$(1)')
endif
2009-04-22 17:49:28 +02:00
else
LIB_LINK_RPATH =
2009-04-22 17:49:28 +02:00
endif
2019-11-28 16:54:50 +01:00
endif
ifeq ($(PLATFORM),DARWIN)
LINK_DARWIN_RPATH = -Wl,-rpath,@loader_path/$(1)
LIB_LINK_DARWIN_INSTALL_NAME = -install_name @rpath/$(1)
else
LINK_DARWIN_RPATH =
LIB_LINK_DARWIN_INSTALL_NAME =
endif
LIB_PATH_OPTS = $(call LIB_LINK_RPATH,lib) $(call LIB_LINK_RPATH,intl)
LIB_LINK_SONAME= -Wl,-soname,$(1)
LIB_LINK_MAPFILE= -Wl,--version-script,$(1)
2019-08-13 18:22:18 +02:00
FIREBIRD_LIBRARY_LINK= -L$(LIB) -lfbclient $(MATHLIB) $(CRYPTLIB)
2004-05-20 11:55:36 +02:00
EXE_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) $(LINK_EMPTY_SYMBOLS)
LIB_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) -shared
2010-10-12 10:02:57 +02:00
FB_DAEMON = $(BIN)/firebird$(EXEC_EXT)
# Per-library link rules
2010-10-12 10:02:57 +02:00
LINK_UDF = $(LIB_LINK) $(LIB_LINK_OPTIONS) $(call LIB_LINK_SONAME,$(1).$(SHRLIB_EXT)) $(UNDEF_FLAGS)\
2019-11-28 16:54:50 +01:00
$(call LIB_LINK_RPATH,lib) $(call LINK_DARWIN_RPATH,..)
LINK_UDF_LIBS = $(THR_LIBS) -L$(LIB) -lib_util $(SO_LINK_LIBS)
2010-10-12 10:02:57 +02:00
LINK_IB_UTIL = $(LIB_LINK) $(LINK_IBUTIL_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\
2019-11-28 16:54:50 +01:00
$(call LIB_LINK_SONAME,$(IbUtilLibraryName)) $(call LIB_LINK_RPATH,lib) $(call LINK_DARWIN_RPATH,..)
LINK_IB_UTIL_LIBS = $(THR_LIBS)
2010-10-12 10:02:57 +02:00
LINK_INTL = $(LIB_LINK) $(LINK_FBINTL_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\
2019-11-28 16:54:50 +01:00
$(call LIB_LINK_SONAME,libfbintl.$(SHRLIB_EXT).1) $(call LIB_LINK_RPATH,lib) $(call LINK_DARWIN_RPATH,..)
LINK_INTL_LIBS = -L$(LIB) $(SO_LINK_LIBS) $(FIREBIRD_LIBRARY_LINK)
LINK_TRACE = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\
2019-11-28 16:54:50 +01:00
$(call LIB_LINK_SONAME,$(LIB_PREFIX)fbtrace.$(SHRLIB_EXT).0) $(call LIB_LINK_RPATH,lib) $(call LINK_DARWIN_RPATH,..)
LINK_TRACE_LIBS = -L$(LIB) $(SO_LINK_LIBS)
2009-02-03 13:03:25 +01:00
2010-10-12 10:02:57 +02:00
LINK_FIREBIRD = $(LIB_LINK) $(LINK_FIREBIRD_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_FIREBIRD_OPTIONS) $(UNDEF_FLAGS)\
2019-11-28 16:54:50 +01:00
$(call LIB_LINK_SONAME,$(LibrarySoName)) $(call LIB_LINK_RPATH,lib) $(call LINK_DARWIN_RPATH,..)
LINK_FIREBIRD_LIBS = -L$(LIB) $(LIB_GUI) $(SO_LINK_LIBS) $(MATHLIB) $(CRYPTLIB)
2010-10-12 10:02:57 +02:00
LINK_ENGINE = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_FIREBIRD_OPTIONS) $(UNDEF_FLAGS)\
2019-11-28 16:54:50 +01:00
$(call LIB_LINK_SONAME,$(EngineSoName)) $(call LIB_LINK_RPATH,lib) $(call LINK_DARWIN_RPATH,..)
LINK_ENGINE_LIBS = $(LINK_FIREBIRD_LIBS) $(FIREBIRD_LIBRARY_LINK)
2019-11-28 16:54:50 +01:00
LINK_UDRENG = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(call LIB_LINK_RPATH,lib) $(UNDEF_FLAGS)\
$(call LINK_DARWIN_RPATH,..)
2010-10-16 03:15:51 +02:00
LINK_UDRENG_LIBS = -L$(LIB) $(SO_LINK_LIBS)
2019-11-28 16:54:50 +01:00
LINK_PLUGIN = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(call LIB_LINK_RPATH,lib) $(UNDEF_FLAGS)\
$(call LINK_DARWIN_RPATH,..)
LINK_PLUG_LIBS = -L$(LIB) $(SO_LINK_LIBS)
2010-10-12 10:02:57 +02:00
# Pay attention - we place common library into obj, not lib dir
# It's just a set of object files, prepared to be used by ld, not an output library
COMMON_LIB = $(OBJ)/common.a
2009-12-04 11:05:41 +01:00
# From utilities
CREATE_DB = $(RBIN)/create_db$(EXEC_EXT)
GDS_DROP = $(BIN)/gds_drop$(EXEC_EXT)
FBSVCMGR = $(BIN)/fbsvcmgr$(EXEC_EXT)
2009-06-25 03:17:43 +02:00
FBTRACEMGR = $(BIN)/fbtracemgr$(EXEC_EXT)
GSTAT = $(BIN)/gstat$(EXEC_EXT)
NBACKUP = $(BIN)/nbackup$(EXEC_EXT)
LOCKPRINT = $(BIN)/fb_lock_print$(EXEC_EXT)
GSEC = $(BIN)/gsec$(EXEC_EXT)
GFIX = $(BIN)/gfix$(EXEC_EXT)
RUN_GFIX = $(RBIN)/gfix$(EXEC_EXT)
GDS_REBUILD = $(BIN)/gds_rebuild$(EXEC_EXT)
GDS_INSTALL = $(BIN)/gds_install$(EXEC_EXT)
GDS_INSTALL = $(BIN)/gds_install_service$(EXEC_EXT)
FBGUARD = $(BIN)/fbguard$(EXEC_EXT)
IBGUARD = $(BIN)/ibguard$(EXEC_EXT)
FBMGR_BIN = $(BIN)/fbmgr.bin$(EXEC_EXT)
INSTREG = $(BIN)/instreg$(EXEC_EXT)
INSTSVC = $(BIN)/instsvc$(EXEC_EXT)
2010-10-12 10:02:57 +02:00
SECURITY_FDB = $(FIREBIRD)/security5.fdb
# From isql
ISQL = $(BIN)/isql$(EXEC_EXT)
RUN_ISQL = $(RBIN)/isql$(EXEC_EXT)
# From burp
GBAK = $(BIN)/gbak$(EXEC_EXT)
RUN_GBAK = $(RBIN)/gbak$(EXEC_EXT)
2003-11-05 17:53:37 +01:00
GSPLIT = $(BIN)/gsplit$(EXEC_EXT)
# From gpre
# (gpre current is a link to one of the others)
GPRE_BOOT = $(RBIN)/gpre_boot$(EXEC_EXT)
GPRE = $(BIN)/gpre$(EXEC_EXT)
RUN_GPRE = $(RBIN)/gpre$(EXEC_EXT)
GPRE_CURRENT = $(RBIN)/gpre_current$(EXEC_EXT)
# From msgs
CHECK_MESSAGES = $(BIN)/check_messages$(EXEC_EXT)
BUILD_FILE = $(BIN)/build_file$(EXEC_EXT)
2003-07-08 12:45:47 +02:00
FIREBIRD_MSG = $(FIREBIRD)/firebird.msg
ENTER_MESSAGES = $(BIN)/enter_messages$(EXEC_EXT)
MODIFY_MESSAGES = $(BIN)/modify_messages$(EXEC_EXT)
CHANGE_MESSAGES = $(BIN)/change_messages$(EXEC_EXT)
fr_FR_MSG = $(FIREBIRD)/fr_FR.msg
de_DE_MSG = $(FIREBIRD)/de_DE.msg
ja_JP_MSG = $(FIREBIRD)/ja_JP.msg
#Platform Manager
#For want of a better suggestion we may as well default to posix
PLATFORM_PATH = os/posix
2009-03-01 16:42:23 +01:00
TRACE_OS_Sources =