make.defaults 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. #
  2. # The contents of this file are subject to the Mozilla Public
  3. # License Version 1.1 (the "License"); you may not use this file
  4. # except in compliance with the License. You may obtain a copy of
  5. # the License at http://www.mozilla.org/MPL/
  6. # Alternatively, the contents of this file may be used under the
  7. # terms of the GNU General Public License Version 2 or later (the
  8. # "GPL"), in which case the provisions of the GPL are applicable
  9. # instead of those above. You may obtain a copy of the Licence at
  10. # http://www.gnu.org/copyleft/gpl.html
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # Relevant for more details.
  16. #
  17. # This file was created by members of the firebird development team.
  18. # All individual contributions remain the Copyright (C) of those
  19. # individuals. Contributors to this file are either listed here or
  20. # can be obtained from a CVS history command.
  21. #
  22. # All rights reserved.
  23. #
  24. # Created by: Mark O'Donohue <[email protected]>
  25. #
  26. # Contributor(s):
  27. #
  28. #
  29. #
  30. #_____________________________________________________________________________
  31. # This file contains default values that are used by the build process do not
  32. # change these here, but override them in the platform specific file
  33. # prefix.xxx where xxx is the platform name using the form SH := bash
  34. # see the readme file with the Makefile.in files for more details.
  35. #_____________________________________________________________________________
  36. TMP_ROOT=$(ROOT)/temp/$(TARGET)
  37. GEN_ROOT=$(ROOT)/gen
  38. SRC_ROOT=$(ROOT)/src
  39. BLD_ROOT=$(ROOT)/builds
  40. EXA_ROOT=$(ROOT)/examples
  41. IsCross=@IS_CROSS@
  42. TOMMATH_BUILD_FLG=@TOMMATH_BUILD@
  43. TOMCRYPT_BUILD_FLG=@TOMCRYPT_BUILD@
  44. RE2_BUILD_FLG=@RE2_BUILD@
  45. SYSTEM_BOOST_FLG=@SYSTEM_BOOST@
  46. FB_BUILD=$(GEN_ROOT)/$(TARGET)/firebird
  47. ifeq ($(IsCross), Y)
  48. FIREBIRD=$(GEN_ROOT)/Native/firebird
  49. else
  50. FIREBIRD=$(FB_BUILD)
  51. endif
  52. FIREBIRD_LOCK=$(FIREBIRD)
  53. export FIREBIRD
  54. export FIREBIRD_LOCK
  55. # Set firebird to boot build mode
  56. FIREBIRD_BOOT_BUILD=1
  57. export FIREBIRD_BOOT_BUILD
  58. buildSubDirectory=$(FB_BUILD)/$(1)
  59. LIB=$(call buildSubDirectory,lib)
  60. BIN=$(call buildSubDirectory,bin)
  61. PLUGINS=$(call buildSubDirectory,plugins)
  62. TZDATA=$(call buildSubDirectory,tzdata)
  63. FB_TESTS_DIR=$(call buildSubDirectory,tests)
  64. STATIC_LIB=$(TMP_ROOT)
  65. RBIN=$(FIREBIRD)/bin
  66. # This picks up the current directory and maps it to the equivalent module
  67. # in the src and gen area.
  68. RealSrcRootPath = $(shell cd $(SRC_ROOT); pwd)
  69. #ModuleName:=$(notdir $(CURDIR))
  70. ModuleName:=$(subst $(RealSrcRootPath)/,,$(CURDIR))
  71. OBJ=$(TMP_ROOT)
  72. GEN_SRC=$(OBJ)
  73. # avoid generated cpp files deletion
  74. .SECONDARY:
  75. # This one is not so widely used at the momement.
  76. # but I would like it to become so.
  77. RealFirebirdPath = @NEW_FIREBIRD_DIR@
  78. #____________________________________________________________________________
  79. # From here we may set some global options to both compiler and linker.
  80. # Use empty default global options for all compilers and linkers
  81. GLOB_OPTIONS:=
  82. # Possible use - profiling.
  83. #GLOB_OPTIONS:= -pg
  84. #____________________________________________________________________________
  85. # Global c++ flags: firebird needs no RTTI, choose build standard and c++ specific warnings level
  86. PLUSPLUS_FLAGS:= -fno-rtti -std=c++20 -Werror=delete-incomplete -Werror=return-type
  87. # If this is defined then we use special rules useful for developers only
  88. IsDeveloper = @DEVEL_FLG@
  89. CLIENT_ONLY_FLG=@CLIENT_ONLY_FLG@
  90. WITH_TOMCRYPT=@WITH_TOMCRYPT@
  91. CpuType=@CPU_TYPE@
  92. PLATFORM=@PLATFORM@
  93. TZDATA_ZIP=@TZDATA_ZIP@
  94. SFIO_EXAMPLES=@SFIO_EXAMPLES@
  95. # link with readline libraries - set by configure
  96. EDITLINE_FLG=@EDITLINE_FLG@
  97. STD_EDITLINE=@STD_EDITLINE@
  98. READLINE=@READLINE@
  99. # threading options - set by configure
  100. THR_FLAGS=@PTHREAD_CFLAGS@
  101. THR_LIBS=@PTHREAD_LIBS@
  102. # thread local storage options - set by configure
  103. TLS_OPTIONS=@TLS_OPTIONS@
  104. # atomic options - set by configure
  105. ATOMIC_OPTIONS=@ATOMIC_OPTIONS@
  106. # compare and swap options - set by configure
  107. # needed at least for solaris inline assembly routines
  108. CAS_OPTIONS=@CAS_OPTIONS@
  109. # BigEndian int128 support
  110. ABSEIL_BUILD_FLG = @ABSEIL_BUILD_FLG@
  111. # multiple-precision integer library
  112. MATHLIB=@MATHLIB@
  113. DECLIB=-ldecFloat$(CROSS)
  114. RE2LIB=-lre2
  115. ifeq ($(ABSEIL_BUILD_FLG), Y)
  116. I128LIB=-li128$(CROSS)
  117. else
  118. I128LIB=
  119. endif
  120. LIBCDSLIB=-lcds
  121. # crypt library
  122. CRYPTLIB=@CRYPTLIB@
  123. LSB_FLG=@LSB_FLG@
  124. ifeq ($(LSB_FLG), Y)
  125. LSB_UNDEF=-Wl,--allow-shlib-undefined
  126. endif
  127. # switch to make sed edit files inplace
  128. INLINE_EDIT_SED:= -i
  129. # Default programs and tools to be used in the build process
  130. SH= sh -c
  131. RM= rm -f
  132. RM_R= rm -rf
  133. CHMOD= chmod
  134. CHMOD_6= chmod 666
  135. CHMOD_7= chmod 777
  136. CHMOD_S7= chmod 06777
  137. MV= mv -f
  138. TOUCH= touch
  139. CP= cp
  140. ECHO= echo
  141. QUIET_ECHO= @echo
  142. CD= cd
  143. CAT= cat
  144. AR= ar @AR_OPTIONS@
  145. LN= @LN_S@
  146. RANLIB= @RANLIB@
  147. BTYACC=$(ROOT)/extern/btyacc/btyacc
  148. CLOOP=$(GEN_ROOT)/$(TARGET)/cloop/release/bin/cloop
  149. AR = @AR@
  150. CC = @CC@
  151. CXX = @CXX@
  152. LD = @CXX@
  153. OBJCOPY = @OBJCOPY@
  154. READELF = @READELF@
  155. AC_CFLAGS = @CFLAGS@
  156. AC_CXXFLAGS = @CXXFLAGS@
  157. AC_LDFLAGS = @LDFLAGS@
  158. # LINKER COMMANDS
  159. LIB_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(WLDFLAGS)
  160. EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(WLDFLAGS)
  161. STATICLIB_LINK = $(AR) crus
  162. LINK_LIBS = @LIBS@ $(DECLIB) $(I128LIB)
  163. SO_LINK_LIBS = @LIBS@ $(DECLIB) $(I128LIB)
  164. # Default extensions
  165. ARCH_EXT= .a
  166. EXEC_EXT= @EXEEXT@
  167. SHRLIB_EXT=@SHRLIB_EXT@
  168. LIB_PREFIX= lib
  169. SHRLIB_FOREIGN_EXT= $(SHRLIB_EXT)
  170. #_____________________________________________________________________________
  171. # Include file with version variable definitions
  172. include $(ROOT)/gen/Make.Version
  173. # Add windows dll to library patterns
  174. .LIBPATTERNS += %.dll lib%.dll
  175. # Search path for libraries
  176. vpath %.so $(LIB)
  177. vpath %.a $(LIB)
  178. vpath %.dll $(LIB)
  179. #_____________________________________________________________________________
  180. # From jrd
  181. # The firebird shared library name
  182. # SD: This name is also hard-coded in builds/install/.../linux/classic scripts.
  183. # Scold me, but I don't want library names to be in configure.in
  184. #
  185. #LibraryFileName=libfbclient
  186. LibraryFileName=libfbclient
  187. LibraryFullName=$(LibraryFileName).${SHRLIB_EXT}.${FirebirdVersion}
  188. LibrarySoName=$(LibraryFileName).${SHRLIB_EXT}.2
  189. LibraryBaseName=$(LibraryFileName).${SHRLIB_EXT}
  190. LIBFIREBIRD_FULLNAME = $(LIB)/$(LibraryFullName)
  191. LIBFIREBIRD_SONAME = $(LIB)/$(LibraryBaseName)
  192. LIBFIREBIRD_BASENAME = $(LIB)/$(LibrarySoName)
  193. # The firebird engine library name
  194. EngineFileName=libEngine${OdsVersion}
  195. EngineSoName=$(EngineFileName).${SHRLIB_EXT}
  196. ENGINE_SONAME = $(PLUGINS)/$(EngineSoName)
  197. ENGINE_TEST = $(FB_TESTS_DIR)/$(EngineFileName)_test$(EXEC_EXT)
  198. # intl will load dynamically, and having the whole soname set with version
  199. # confuses the dynamic load process. So we only have the .$(SHRLIB_EXT) file
  200. # MOD 28-July-2002
  201. LIBFBINTL_SO=$(call buildSubDirectory,intl)/$(LIB_PREFIX)fbintl.$(SHRLIB_EXT)
  202. ifeq ($(EDITLINE_FLG),Y)
  203. ifeq ($(STD_EDITLINE), true)
  204. LIBEDITLINE := -l$(READLINE)
  205. else
  206. LIBEDITLINE := $(STATIC_LIB)/libedit.a
  207. TERMLIB := -l@TERMLIB@
  208. endif
  209. endif
  210. # Shared library name for usage inside of the UDF
  211. IbUtilLibraryName = $(LIB_PREFIX)ib_util.$(SHRLIB_EXT)
  212. LIBIBUTIL_SO = $(LIB)/$(IbUtilLibraryName)
  213. # Own tommath support
  214. TOMMATH=$(ROOT)/extern/libtommath
  215. TOMMATH_INC=$(TOMMATH)
  216. TOMMATH_VER=0
  217. ifeq ($(PLATFORM),DARWIN)
  218. TOMMATH_SO=$(TOMMATH)/.libs/libtommath.dylib
  219. else
  220. TOMMATH_SO=$(TOMMATH)/.libs/libtommath.so
  221. endif
  222. # Own tomcrypt support
  223. TOMCRYPT=$(ROOT)/extern/libtomcrypt
  224. TOMCRYPT_INC=$(TOMCRYPT)/src/headers
  225. TOMCRYPT_SO=$(TOMCRYPT)/.libs/libtomcrypt.so
  226. TOMCRYPT_VER=1
  227. # Own libcds support
  228. LIBCDS=$(ROOT)/extern/libcds
  229. LIBCDS_INC=$(LIBCDS)
  230. LIBCDS_DEF=CDS_BUILD_STATIC_LIB
  231. # LINKER OPTIONS
  232. #
  233. UNDEF_PLATFORM = -Wl,--no-undefined
  234. ifeq ($(TARGET),Debug)
  235. UNDEF_FLAGS = $(UNDEF_PLATFORM)
  236. endif
  237. FIREBIRD_VERS = firebird.vers
  238. FBINTL_VERS = fbintl.vers
  239. IB_UTIL_VERS = ib_util.vers
  240. UDR_PLUGIN_VERS = udr_plugin.vers
  241. EMPTY_VERS = empty.vers
  242. PLUGIN_VERS = fbplugin.vers
  243. ALLVERS = $(FIREBIRD_VERS) $(FBINTL_VERS) $(IB_UTIL_VERS)
  244. ALLVERS += $(UDR_PLUGIN_VERS) $(EMPTY_VERS) $(PLUGIN_VERS)
  245. LINK_FIREBIRD_SYMBOLS = $(call LIB_LINK_MAPFILE,$(FIREBIRD_VERS))
  246. LINK_FBINTL_SYMBOLS = $(call LIB_LINK_MAPFILE,$(FBINTL_VERS))
  247. LINK_IBUTIL_SYMBOLS = $(call LIB_LINK_MAPFILE,$(IB_UTIL_VERS))
  248. LINK_UDR_PLUGIN_SYMBOLS = $(call LIB_LINK_MAPFILE,$(UDR_PLUGIN_VERS))
  249. LINK_EMPTY_SYMBOLS = $(call LIB_LINK_MAPFILE,$(EMPTY_VERS))
  250. LINK_PLUGIN_SYMBOLS = $(call LIB_LINK_MAPFILE,$(PLUGIN_VERS))
  251. LINK_EXEC_EXPORT=-rdynamic
  252. UDR_SUPPORT_LIBS=
  253. ifeq ($(PLATFORM),DARWIN)
  254. LIB_LINK_RPATH =
  255. else
  256. LIB_PLATFORM_RPATH = -Wl,-rpath,$(1)
  257. ifeq (@USE_RPATH@,1)
  258. ifeq ($(strip @BINRELOC_CFLAGS@),)
  259. LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,$(if $(subst intl,,$(1)),@FB_LIBDIR@,@FB_INTLDIR@))
  260. else
  261. LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,\$$ORIGIN/../$(1))
  262. endif
  263. else
  264. LIB_LINK_RPATH =
  265. endif
  266. endif
  267. ifeq ($(PLATFORM),DARWIN)
  268. LINK_DARWIN_RPATH = -Wl,-rpath,@loader_path/$(1)
  269. LIB_LINK_DARWIN_INSTALL_NAME = -install_name @rpath/$(1)
  270. else
  271. LINK_DARWIN_RPATH =
  272. LIB_LINK_DARWIN_INSTALL_NAME =
  273. endif
  274. LIB_PATH_OPTS = $(call LIB_LINK_RPATH,lib) $(call LIB_LINK_RPATH,intl)
  275. LIB_LINK_SONAME= -Wl,-soname,$(1)
  276. LIB_LINK_MAPFILE= -Wl,--version-script,$(1)
  277. FIREBIRD_LIBRARY_LINK= -L$(LIB) -L$(STATIC_LIB) -lfbclient $(MATHLIB) $(CRYPTLIB)
  278. EXE_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) $(call LINK_DARWIN_RPATH,..) $(LINK_EMPTY_SYMBOLS)
  279. LIB_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) -shared
  280. FB_DAEMON = $(BIN)/firebird$(EXEC_EXT)
  281. # Per-library link rules
  282. LINK_UDF = $(LIB_LINK) $(LIB_LINK_OPTIONS) $(call LIB_LINK_SONAME,$(1).$(SHRLIB_EXT)) $(UNDEF_FLAGS)\
  283. $(call LIB_LINK_RPATH,lib) $(call LINK_DARWIN_RPATH,..)
  284. LINK_UDF_LIBS = $(THR_LIBS) -L$(LIB) -L$(STATIC_LIB) -lib_util $(SO_LINK_LIBS)
  285. LINK_IB_UTIL = $(LIB_LINK) $(LINK_IBUTIL_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\
  286. $(call LIB_LINK_SONAME,$(IbUtilLibraryName)) $(call LIB_LINK_RPATH,lib) $(call LINK_DARWIN_RPATH,..)
  287. LINK_IB_UTIL_LIBS = $(THR_LIBS)
  288. LINK_INTL = $(LIB_LINK) $(LINK_FBINTL_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\
  289. $(call LIB_LINK_SONAME,libfbintl.$(SHRLIB_EXT).1) $(call LIB_LINK_RPATH,lib) $(call LINK_DARWIN_RPATH,..)
  290. LINK_INTL_LIBS = -L$(LIB) -L$(STATIC_LIB) $(SO_LINK_LIBS) $(FIREBIRD_LIBRARY_LINK)
  291. LINK_TRACE = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\
  292. $(call LIB_LINK_SONAME,$(LIB_PREFIX)fbtrace.$(SHRLIB_EXT).0) $(call LIB_LINK_RPATH,lib) $(call LINK_DARWIN_RPATH,..)
  293. LINK_TRACE_LIBS = -L$(LIB) -L$(STATIC_LIB) $(SO_LINK_LIBS)
  294. LINK_FIREBIRD = $(LIB_LINK) $(LINK_FIREBIRD_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_FIREBIRD_OPTIONS) $(UNDEF_FLAGS)\
  295. $(call LIB_LINK_SONAME,$(LibrarySoName)) $(call LIB_LINK_RPATH,lib) $(call LINK_DARWIN_RPATH,..)
  296. LINK_FIREBIRD_LIBS = -L$(LIB) -L$(STATIC_LIB) $(LIB_GUI) $(SO_LINK_LIBS) $(MATHLIB)
  297. LINK_ENGINE = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_FIREBIRD_OPTIONS) $(UNDEF_FLAGS)\
  298. $(call LIB_LINK_SONAME,$(EngineSoName)) $(call LIB_LINK_RPATH,lib) $(call LINK_DARWIN_RPATH,..)
  299. LINK_ENGINE_LIBS = $(LINK_FIREBIRD_LIBS) $(RE2LIB) $(LIBCDSLIB) $(FIREBIRD_LIBRARY_LINK)
  300. LINK_UDRENG = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(call LIB_LINK_RPATH,lib) $(UNDEF_FLAGS)\
  301. $(call LINK_DARWIN_RPATH,..)
  302. LINK_UDRENG_LIBS = -L$(LIB) -L$(STATIC_LIB) $(SO_LINK_LIBS)
  303. LINK_PLUGIN = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(call LIB_LINK_RPATH,lib) $(UNDEF_FLAGS)\
  304. $(call LINK_DARWIN_RPATH,..)
  305. LINK_PLUG_LIBS = -L$(LIB) -L$(STATIC_LIB) $(SO_LINK_LIBS)
  306. # Pay attention - we place common library into obj, not lib dir
  307. # It's just a set of object files, prepared to be used by ld, not an output library
  308. COMMON_LIB = $(OBJ)/common.a
  309. COMMON_TEST = $(FB_TESTS_DIR)/common_test$(EXEC_EXT)
  310. # From utilities
  311. FBSVCMGR = $(BIN)/fbsvcmgr$(EXEC_EXT)
  312. FBTRACEMGR = $(BIN)/fbtracemgr$(EXEC_EXT)
  313. GSTAT = $(BIN)/gstat$(EXEC_EXT)
  314. NBACKUP = $(BIN)/nbackup$(EXEC_EXT)
  315. LOCKPRINT = $(BIN)/fb_lock_print$(EXEC_EXT)
  316. GSEC = $(BIN)/gsec$(EXEC_EXT)
  317. GFIX = $(BIN)/gfix$(EXEC_EXT)
  318. RUN_GFIX = $(RBIN)/gfix$(EXEC_EXT)
  319. FBGUARD = $(BIN)/fbguard$(EXEC_EXT)
  320. INSTREG = $(BIN)/instreg$(EXEC_EXT)
  321. INSTSVC = $(BIN)/instsvc$(EXEC_EXT)
  322. SECURITY_FDB = $(FIREBIRD)/security6.fdb
  323. # From isql
  324. ISQL = $(BIN)/isql$(EXEC_EXT)
  325. ISQL_TEST = $(FB_TESTS_DIR)/isql_test$(EXEC_EXT)
  326. RUN_ISQL = $(RBIN)/isql$(EXEC_EXT)
  327. # From burp
  328. GBAK = $(BIN)/gbak$(EXEC_EXT)
  329. RUN_GBAK = $(RBIN)/gbak$(EXEC_EXT)
  330. GSPLIT = $(BIN)/gsplit$(EXEC_EXT)
  331. # From gpre
  332. # (gpre current is a link to one of the others)
  333. GPRE_BOOT = $(RBIN)/gpre_boot$(EXEC_EXT)
  334. GPRE = $(BIN)/gpre$(EXEC_EXT)
  335. RUN_GPRE = $(RBIN)/gpre$(EXEC_EXT)
  336. GPRE_CURRENT = $(RBIN)/gpre_current$(EXEC_EXT)
  337. # From msgs
  338. BUILD_FILE = $(BIN)/build_file$(EXEC_EXT)
  339. FIREBIRD_MSG = $(FIREBIRD)/firebird.msg
  340. # Platform Manager
  341. # For want of a better suggestion we may as well default to posix
  342. PLATFORM_PATH = os/posix
  343. TRACE_OS_Sources =