From 55bbcb5a04ecd021cefcb1f6614af0218c82bf71 Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Sat, 10 Oct 2026 19:06:42 -0300 Subject: [PATCH 1/4] Do not copy include/firebird/impl/boost when --with-system-boost is used (cherry picked from commit d06c8143aae6e8745999eb48d3886b6cfa0dd605) --- builds/posix/Makefile.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builds/posix/Makefile.in b/builds/posix/Makefile.in index ab416b93ce5..07cbab28e71 100644 --- a/builds/posix/Makefile.in +++ b/builds/posix/Makefile.in @@ -861,13 +861,16 @@ $(INCLUDE_DEST)/ib_util.h : $(SRC_OtherDistribHeaders) $(CP) $^ $(INCLUDE_DEST)/ NEW_INCLUDES_SRC = $(shell find $(SRC_ROOT)/include/firebird -type f) +ifeq ($(SYSTEM_BOOST_FLG),Y) +NEW_INCLUDES_SRC := $(filter-out $(SRC_ROOT)/include/firebird/impl/boost/%,$(NEW_INCLUDES_SRC)) +endif NEW_INCLUDES_DEST = $(patsubst $(SRC_ROOT)/include/firebird/%, $(INCLUDE_DEST)/firebird/%, $(NEW_INCLUDES_SRC)) include_generic: $(NEW_INCLUDES_DEST) $(INCLUDE_DEST)/ib_util.h ifeq ($(SYSTEM_BOOST_FLG),Y) $(INCLUDE_DEST)/firebird/Message.h : $(SRC_ROOT)/include/firebird/Message.h - sed 's,^#include "\./impl/boost/\(.\+\)",#include ,; s/\bFB_BOOST_PP_/BOOST_PP_/g' $< > $@ + sed 's,^#include "\./impl/boost/\(.*\)",#include ,; s/FB_BOOST_PP_/BOOST_PP_/g' $< > $@ endif $(INCLUDE_DEST)/firebird/%: $(SRC_ROOT)/include/firebird/% From d159b3c642b7717b06b7921bbc8889387fe2af9f Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Sun, 11 Oct 2026 09:25:50 -0300 Subject: [PATCH 2/4] Use RE2 StringPiece/string_view data() instead of begin() (cherry picked from commit 2232fea80e4f22206c70a64ccfe1f028022eb132) --- src/common/SimilarToRegex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/SimilarToRegex.cpp b/src/common/SimilarToRegex.cpp index 7c2fa26af5e..c69b09fde88 100644 --- a/src/common/SimilarToRegex.cpp +++ b/src/common/SimilarToRegex.cpp @@ -831,7 +831,7 @@ bool SimilarToRegex::matches(const char* buffer, unsigned bufferLen, Arraypush(MatchPos{ - static_cast(resSp.data() - sp.begin()), + static_cast(resSp.data() - sp.data()), static_cast(resSp.length()) }); } @@ -879,7 +879,7 @@ bool SubstringSimilarRegex::matches(const char* buffer, unsigned bufferLen, if (RE2::FullMatch(sp, *regexp.get(), nullptr, &spResult, nullptr)) { - *resultStart = spResult.begin() - buffer; + *resultStart = spResult.data() - buffer; *resultLength = static_cast(spResult.length()); return true; } From 22668b9c3ff1815eb61a31ea335d2c7095603a02 Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Thu, 15 Oct 2026 22:05:11 -0300 Subject: [PATCH 3/4] Add WITH_SYSTEM_BOOST, WITH_SYSTEM_TOMMATH, WITH_SYSTEM_TOMCRYPT, WITH_SYSTEM_ZLIB and WITH_SYSTEM_ICU options to the Windows build Backport of the Windows part of #9209 (v5), adapted to the master build scripts. --- builds/win32/make_all.bat | 7 +++ builds/win32/make_boot.bat | 67 +++++++++++++++++++++-- builds/win32/make_icu.bat | 9 ++- builds/win32/msvc15/FirebirdCommon.props | 14 ++++- builds/win32/msvc15/common.vcxproj | 36 ++++++------ builds/win32/msvc15/engine.vcxproj | 8 +-- builds/win32/msvc15/engine_static.vcxproj | 8 +-- builds/win32/run_all.bat | 20 +++++++ builds/win32/setenvvar.bat | 30 ++++++++++ doc/README.build.msvc.html | 2 + 10 files changed, 168 insertions(+), 33 deletions(-) diff --git a/builds/win32/make_all.bat b/builds/win32/make_all.bat index 9e9e3280dcc..1e7aae2602f 100644 --- a/builds/win32/make_all.bat +++ b/builds/win32/make_all.bat @@ -118,6 +118,13 @@ copy %FB_GEN_DIR%\iberror_c.h %FB_OUTPUT_DIR%\include\firebird\impl > nul :: New API headers xcopy /y %FB_ROOT_PATH%\src\include\firebird %FB_OUTPUT_DIR%\include\firebird /e > nul +:: With system boost, do not distribute the embedded copy and make Message.h use and BOOST_PP_ +@findstr /C:"" "%FB_TEMP_DIR%\FirebirdSystemLibs.props" >nul 2>&1 +@if not errorlevel 1 ( + rmdir /S /Q %FB_OUTPUT_DIR%\include\firebird\impl\boost 2>nul + powershell -NoProfile -Command "(Get-Content '%FB_ROOT_PATH%\src\include\firebird\Message.h') -replace '^#include \x22\./impl/boost/(.+)\x22', '#include ' -replace '\bFB_BOOST_PP_', 'BOOST_PP_' | Set-Content -Encoding ascii '%FB_OUTPUT_DIR%\include\firebird\Message.h'" +) + @if "%FB_CLIENT_ONLY%"=="" ( :: UDR copy %FB_ROOT_PATH%\src\extlib\*.sql %FB_OUTPUT_DIR%\plugins\udr > nul diff --git a/builds/win32/make_boot.bat b/builds/win32/make_boot.bat index 5ad8fe89d18..9d59f576d42 100644 --- a/builds/win32/make_boot.bat +++ b/builds/win32/make_boot.bat @@ -29,6 +29,8 @@ for %%v in ( alice auth burp dsql gpre isql jrd misc msgs examples yvalve utilit @mkdir %FB_BIN_DIR%\tzdata 2>nul +call :system_libs_config + @if not defined FBBUILD_WITHOUT_CLOOP_GENERATION call :interfaces if "!ERRLEV!"=="1" goto :END @@ -41,8 +43,10 @@ if "!ERRLEV!"=="1" goto :END if "%FB_TARGET_PLATFORM%"=="x64" call :ttmath if "!ERRLEV!"=="1" goto :END -call :zlib -if "!ERRLEV!"=="1" goto :END +@if not defined FBBUILD_WITH_SYSTEM_ZLIB ( + call :zlib + if "!ERRLEV!"=="1" goto :END +) @if "%FB_CLIENT_ONLY%"=="" ( call :re2 @@ -101,10 +105,14 @@ for %%v in (firebird plugins) do ( ) :: Copy ICU and zlib to the output directory -@copy %FB_ROOT_PATH%\extern\icu\icudt???.dat %FB_BIN_DIR% >nul 2>&1 -@copy %FB_ICU_SOURCE_BIN%\*.dll %FB_BIN_DIR% >nul 2>&1 +@if not defined FBBUILD_WITH_SYSTEM_ICU ( + @copy %FB_ROOT_PATH%\extern\icu\icudt???.dat %FB_BIN_DIR% >nul 2>&1 + @copy %FB_ICU_SOURCE_BIN%\*.dll %FB_BIN_DIR% >nul 2>&1 +) @copy %FB_ROOT_PATH%\extern\icu\tzdata-extract\* %FB_BIN_DIR%\tzdata >nul 2>&1 -@copy %FB_ROOT_PATH%\extern\zlib\%FB_TARGET_PLATFORM%\*.dll %FB_BIN_DIR% >nul 2>&1 +@if not defined FBBUILD_WITH_SYSTEM_ZLIB ( + @copy %FB_ROOT_PATH%\extern\zlib\%FB_TARGET_PLATFORM%\*.dll %FB_BIN_DIR% >nul 2>&1 +) @if "%FB_CLIENT_ONLY%"=="" ( ::======= @@ -129,6 +137,48 @@ for %%v in (firebird plugins) do ( @goto :END +::=================== +:: Record the system libraries choice in a props file used by all later builds (including the IDE) +:system_libs_config +@mkdir %FB_TEMP_DIR% 2>nul +@set SYSLIBS_PROPS=%FB_TEMP_DIR%\FirebirdSystemLibs.props +@del "%SYSLIBS_PROPS%" 2>nul +@set SYSLIBS_ANY= +@if defined FBBUILD_WITH_SYSTEM_BOOST set SYSLIBS_ANY=1 +@if defined FBBUILD_WITH_SYSTEM_TOMMATH set SYSLIBS_ANY=1 +@if defined FBBUILD_WITH_SYSTEM_TOMCRYPT set SYSLIBS_ANY=1 +@if defined FBBUILD_WITH_SYSTEM_ZLIB set SYSLIBS_ANY=1 +@if defined FBBUILD_WITH_SYSTEM_ICU set SYSLIBS_ANY=1 +@if not defined SYSLIBS_ANY goto :EOF +@echo ^> "%SYSLIBS_PROPS%" +@echo ^>> "%SYSLIBS_PROPS%" +@if defined FBBUILD_WITH_SYSTEM_BOOST ( + @echo Using system boost headers + @echo ^^>> "%SYSLIBS_PROPS%" +) +@if defined FBBUILD_WITH_SYSTEM_TOMMATH ( + @echo Using system libtommath + @echo ^^>> "%SYSLIBS_PROPS%" + @echo ^tommath.lib^>> "%SYSLIBS_PROPS%" + call :tommath_probe +) +@if defined FBBUILD_WITH_SYSTEM_TOMCRYPT ( + @echo Using system libtomcrypt + @echo ^^>> "%SYSLIBS_PROPS%" + @echo ^tomcrypt.lib^>> "%SYSLIBS_PROPS%" +) +@if defined FBBUILD_WITH_SYSTEM_ZLIB ( + @echo Using system zlib + @echo ^^>> "%SYSLIBS_PROPS%" +) +@if defined FBBUILD_WITH_SYSTEM_ICU ( + @echo Using system ICU + @echo ^^>> "%SYSLIBS_PROPS%" +) +@echo ^>> "%SYSLIBS_PROPS%" +@echo ^>> "%SYSLIBS_PROPS%" +@goto :EOF + ::=================== :: BUILD btyacc :btyacc @@ -142,10 +192,17 @@ goto :EOF :: BUILD LibTom :LibTom @echo. +@if defined FBBUILD_WITH_SYSTEM_TOMMATH goto :LibTomCrypt @echo Building LibTomMath (%FB_OBJ_DIR%)... @call compile.bat extern\libtommath\libtommath_MSVC%MSVC_VERSION% libtommath_%FB_CONFIG%_%FB_TARGET_PLATFORM%.log libtommath if errorlevel 1 call :boot2 libtommath_%FB_OBJ_DIR% & goto :EOF +:LibTomCrypt @if defined FBBUILD_WITHOUT_TOMCRYPT goto :LibTomDone +@if defined FBBUILD_WITH_SYSTEM_TOMCRYPT goto :LibTomDone +@echo Building LibTomCrypt (%FB_OBJ_DIR%)... +@call compile.bat extern\libtomcrypt\libtomcrypt_MSVC%MSVC_VERSION% libtomcrypt_%FB_CONFIG%_%FB_TARGET_PLATFORM%.log libtomcrypt +if errorlevel 1 call :boot2 libtomcrypt_%FB_OBJ_DIR% +:LibTomDone @echo Building LibTomCrypt (%FB_OBJ_DIR%)... @call compile.bat extern\libtomcrypt\libtomcrypt_MSVC%MSVC_VERSION% libtomcrypt_%FB_CONFIG%_%FB_TARGET_PLATFORM%.log libtomcrypt if errorlevel 1 call :boot2 libtomcrypt_%FB_OBJ_DIR% diff --git a/builds/win32/make_icu.bat b/builds/win32/make_icu.bat index dd82ee1ebe7..176034b8baa 100644 --- a/builds/win32/make_icu.bat +++ b/builds/win32/make_icu.bat @@ -22,7 +22,14 @@ if not defined FB_UNZIP ( if not exist "%FB_UNZIP%" set FB_UNZIP= -if not defined FB_UNZIP ( +if defined FBBUILD_WITH_SYSTEM_ICU ( + @echo Using system ICU, extracting tzdata only + if not defined FB_UNZIP ( + cscript /nologo unzip.vbs %FB_ROOT_PATH%\extern\icu\tzdata\le.zip %FB_ROOT_PATH%\extern\icu\tzdata-extract + ) else ( + "%FB_UNZIP%" -o %FB_ROOT_PATH%\extern\icu\tzdata\le.zip -d %FB_ROOT_PATH%\extern\icu\tzdata-extract + ) +) else if not defined FB_UNZIP ( cscript /nologo unzip.vbs %FB_ROOT_PATH%\extern\icu\icu_windows.zip %FB_ROOT_PATH%\extern\icu cscript /nologo unzip.vbs %FB_ROOT_PATH%\extern\icu\icudt.zip %FB_ROOT_PATH%\extern\icu cscript /nologo unzip.vbs %FB_ROOT_PATH%\extern\icu\tzdata\le.zip %FB_ROOT_PATH%\extern\icu\tzdata-extract diff --git a/builds/win32/msvc15/FirebirdCommon.props b/builds/win32/msvc15/FirebirdCommon.props index 545ac6ff443..9ada056c9d1 100644 --- a/builds/win32/msvc15/FirebirdCommon.props +++ b/builds/win32/msvc15/FirebirdCommon.props @@ -5,12 +5,24 @@ ..\..\..\temp\$(PlatformName)\$(Configuration)\$(ProjectName)\ ..\..\..\temp\$(PlatformName)\$(Configuration)\$(ProjectName)\ false + $(Configuration) + Release + Debug + ../../../extern/boost; + ../../../extern/libtommath; + ../../../extern/libtommath/lib/$(PlatformName)\$(FbExternConfiguration)\tommath.lib + ../../../extern/libtomcrypt/src/headers; + ../../../extern/libtomcrypt/lib/$(PlatformName)\$(FbExternConfiguration)\tomcrypt.lib + ../../../extern/zlib; + ../../../extern/icu/include; + + /EHsc- /Zc:__cplusplus %(AdditionalOptions) true - ../../../src/include;../../../src/include/gen;../../../extern/libtomcrypt/src/headers;../../../extern/libtommath;../../../extern/icu/include;../../../extern/zlib;../../../extern/re2;../../../extern/boost;%(AdditionalIncludeDirectories) + ../../../src/include;../../../src/include/gen;$(FbTomCryptIncludeDir)$(FbTomMathIncludeDir)$(FbIcuIncludeDir)$(FbZlibIncludeDir)../../../extern/re2;$(FbBoostIncludeDir)%(AdditionalIncludeDirectories) false diff --git a/builds/win32/msvc15/common.vcxproj b/builds/win32/msvc15/common.vcxproj index 65f08080be3..f71dd410954 100644 --- a/builds/win32/msvc15/common.vcxproj +++ b/builds/win32/msvc15/common.vcxproj @@ -495,7 +495,7 @@ WIN32;NDEBUG;_LIB;SUPERSERVER;%(PreprocessorDefinitions) - ws2_32.lib;../../../extern/libtommath/lib/$(PlatformName)\$(Configuration)\tommath.lib;../../../extern/libtomcrypt/lib/$(PlatformName)\$(Configuration)\tomcrypt.lib;../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;%(AdditionalDependencies) + ws2_32.lib;$(FbTomMathLib);$(FbTomCryptLib);../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;%(AdditionalDependencies) @@ -507,7 +507,7 @@ EditAndContinue - ws2_32.lib;../../../extern/libtommath/lib/$(PlatformName)\$(Configuration)\tommath.lib;../../../extern/libtomcrypt/lib/$(PlatformName)\$(Configuration)\tomcrypt.lib;../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;%(AdditionalDependencies) + ws2_32.lib;$(FbTomMathLib);$(FbTomCryptLib);../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;%(AdditionalDependencies) @@ -518,7 +518,7 @@ WIN32;NDEBUG;_LIB;SUPERSERVER;%(PreprocessorDefinitions) - ws2_32.lib;../../../extern/libtommath/lib/$(PlatformName)\$(Configuration)\tommath.lib;../../../extern/libtomcrypt/lib/$(PlatformName)\$(Configuration)\tomcrypt.lib;../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;../../../extern/ttmath\$(Configuration)\ttmathuint_x86_64_msvc.obj;%(AdditionalDependencies) + ws2_32.lib;$(FbTomMathLib);$(FbTomCryptLib);../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;../../../extern/ttmath\$(Configuration)\ttmathuint_x86_64_msvc.obj;%(AdditionalDependencies) @@ -532,7 +532,7 @@ - ws2_32.lib;../../../extern/libtommath/lib/$(PlatformName)\$(Configuration)\tommath.lib;../../../extern/libtomcrypt/lib/$(PlatformName)\$(Configuration)\tomcrypt.lib;../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;../../../extern/ttmath\$(Configuration)\ttmathuint_x86_64_msvc.obj;%(AdditionalDependencies) + ws2_32.lib;$(FbTomMathLib);$(FbTomCryptLib);../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;../../../extern/ttmath\$(Configuration)\ttmathuint_x86_64_msvc.obj;%(AdditionalDependencies) @@ -540,8 +540,8 @@ WIN32;NDEBUG;_LIB;SUPERSERVER;%(PreprocessorDefinitions) - ../../../extern/libtommath/lib/$(PlatformName)\Release\tommath.lib;../../../extern/libtomcrypt/lib/$(PlatformName)\Release\tomcrypt.lib;../../../extern/decNumber/lib/$(PlatformName)\Release\decnumber.lib;%(AdditionalDependencies) - ../../../extern/libtommath/lib/$(PlatformName)\Release\tommath.lib;../../../extern/decNumber/lib/$(PlatformName)\Release\decnumber.lib;%(AdditionalDependencies) + $(FbTomMathLib);$(FbTomCryptLib);../../../extern/decNumber/lib/$(PlatformName)\Release\decnumber.lib;%(AdditionalDependencies) + $(FbTomMathLib);../../../extern/decNumber/lib/$(PlatformName)\Release\decnumber.lib;%(AdditionalDependencies) @@ -553,8 +553,8 @@ EditAndContinue - ../../../extern/libtommath/lib/$(PlatformName)\Debug\tommath.lib;../../../extern/libtomcrypt/lib/$(PlatformName)\Debug\tomcrypt.lib;../../../extern/decNumber/lib/$(PlatformName)\Debug\decnumber.lib;%(AdditionalDependencies) - ../../../extern/libtommath/lib/$(PlatformName)\Debug\tommath.lib;../../../extern/decNumber/lib/$(PlatformName)\Debug\decnumber.lib;%(AdditionalDependencies) + $(FbTomMathLib);$(FbTomCryptLib);../../../extern/decNumber/lib/$(PlatformName)\Debug\decnumber.lib;%(AdditionalDependencies) + $(FbTomMathLib);../../../extern/decNumber/lib/$(PlatformName)\Debug\decnumber.lib;%(AdditionalDependencies) @@ -565,7 +565,7 @@ WIN32;NDEBUG;_LIB;SUPERSERVER;%(PreprocessorDefinitions) - ws2_32.lib;../../../extern/libtommath/lib/$(PlatformName)\$(Configuration)\tommath.lib;../../../extern/libtomcrypt/lib/$(PlatformName)\$(Configuration)\tomcrypt.lib;../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;%(AdditionalDependencies) + ws2_32.lib;$(FbTomMathLib);$(FbTomCryptLib);../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;%(AdditionalDependencies) @@ -579,7 +579,7 @@ - ws2_32.lib;../../../extern/libtommath/lib/$(PlatformName)\$(Configuration)\tommath.lib;../../../extern/libtomcrypt/lib/$(PlatformName)\$(Configuration)\tomcrypt.lib;../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;%(AdditionalDependencies) + ws2_32.lib;$(FbTomMathLib);$(FbTomCryptLib);../../../extern/decNumber/lib/$(PlatformName)\$(Configuration)\decnumber.lib;%(AdditionalDependencies) @@ -590,8 +590,8 @@ WIN32;NDEBUG;_LIB;SUPERSERVER;%(PreprocessorDefinitions) - ../../../extern/libtommath/lib/$(PlatformName)\Release\tommath.lib;../../../extern/libtomcrypt/lib/$(PlatformName)\Release\tomcrypt.lib;../../../extern/decNumber/lib/$(PlatformName)\Release\decnumber.lib;../../../extern/ttmath\Release\ttmathuint_x86_64_msvc.obj;%(AdditionalDependencies) - ../../../extern/libtommath/lib/$(PlatformName)\Release\tommath.lib;../../../extern/decNumber/lib/$(PlatformName)\Release\decnumber.lib;../../../extern/ttmath\Release\ttmathuint_x86_64_msvc.obj;%(AdditionalDependencies) + $(FbTomMathLib);$(FbTomCryptLib);../../../extern/decNumber/lib/$(PlatformName)\Release\decnumber.lib;../../../extern/ttmath\Release\ttmathuint_x86_64_msvc.obj;%(AdditionalDependencies) + $(FbTomMathLib);../../../extern/decNumber/lib/$(PlatformName)\Release\decnumber.lib;../../../extern/ttmath\Release\ttmathuint_x86_64_msvc.obj;%(AdditionalDependencies) @@ -605,8 +605,8 @@ - ../../../extern/libtommath/lib/$(PlatformName)\Debug\tommath.lib;../../../extern/libtomcrypt/lib/$(PlatformName)\Debug\tomcrypt.lib;../../../extern/decNumber/lib/$(PlatformName)\Debug\decnumber.lib;../../../extern/ttmath\Debug\ttmathuint_x86_64_msvc.obj;%(AdditionalDependencies) - ../../../extern/libtommath/lib/$(PlatformName)\Debug\tommath.lib;../../../extern/decNumber/lib/$(PlatformName)\Debug\decnumber.lib;../../../extern/ttmath\Debug\ttmathuint_x86_64_msvc.obj;%(AdditionalDependencies) + $(FbTomMathLib);$(FbTomCryptLib);../../../extern/decNumber/lib/$(PlatformName)\Debug\decnumber.lib;../../../extern/ttmath\Debug\ttmathuint_x86_64_msvc.obj;%(AdditionalDependencies) + $(FbTomMathLib);../../../extern/decNumber/lib/$(PlatformName)\Debug\decnumber.lib;../../../extern/ttmath\Debug\ttmathuint_x86_64_msvc.obj;%(AdditionalDependencies) @@ -617,8 +617,8 @@ WIN32;NDEBUG;_LIB;SUPERSERVER;%(PreprocessorDefinitions) - ../../../extern/libtommath/lib/$(PlatformName)\Release\tommath.lib;../../../extern/libtomcrypt/lib/$(PlatformName)\Release\tomcrypt.lib;../../../extern/decNumber/lib/$(PlatformName)\Release\decnumber.lib;%(AdditionalDependencies) - ../../../extern/libtommath/lib/$(PlatformName)\Release\tommath.lib;../../../extern/decNumber/lib/$(PlatformName)\Release\decnumber.lib;%(AdditionalDependencies) + $(FbTomMathLib);$(FbTomCryptLib);../../../extern/decNumber/lib/$(PlatformName)\Release\decnumber.lib;%(AdditionalDependencies) + $(FbTomMathLib);../../../extern/decNumber/lib/$(PlatformName)\Release\decnumber.lib;%(AdditionalDependencies) @@ -632,8 +632,8 @@ - ../../../extern/libtommath/lib/$(PlatformName)\Debug\tommath.lib;../../../extern/libtomcrypt/lib/$(PlatformName)\Debug\tomcrypt.lib;../../../extern/decNumber/lib/$(PlatformName)\Debug\decnumber.lib;%(AdditionalDependencies) - ../../../extern/libtommath/lib/$(PlatformName)\Debug\tommath.lib;../../../extern/decNumber/lib/$(PlatformName)\Debug\decnumber.lib;%(AdditionalDependencies) + $(FbTomMathLib);$(FbTomCryptLib);../../../extern/decNumber/lib/$(PlatformName)\Debug\decnumber.lib;%(AdditionalDependencies) + $(FbTomMathLib);../../../extern/decNumber/lib/$(PlatformName)\Debug\decnumber.lib;%(AdditionalDependencies) diff --git a/builds/win32/msvc15/engine.vcxproj b/builds/win32/msvc15/engine.vcxproj index 65dd4554e1f..a2721c675a5 100644 --- a/builds/win32/msvc15/engine.vcxproj +++ b/builds/win32/msvc15/engine.vcxproj @@ -229,7 +229,7 @@ Disabled - ../../../src/include;../../../src/include/gen;../../../extern/icu/include;../../../src/vulcan;%(AdditionalIncludeDirectories) + ../../../src/include;../../../src/include/gen;$(FbIcuIncludeDir)../../../src/vulcan;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_LIB;SUPERSERVER;DEV_BUILD;NAMESPACE=Vulcan;%(PreprocessorDefinitions) @@ -245,7 +245,7 @@ Disabled - ../../../src/include;../../../src/include/gen;../../../extern/icu/include;../../../src/vulcan;%(AdditionalIncludeDirectories) + ../../../src/include;../../../src/include/gen;$(FbIcuIncludeDir)../../../src/vulcan;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_LIB;SUPERSERVER;DEV_BUILD;NAMESPACE=Vulcan;%(PreprocessorDefinitions) @@ -281,7 +281,7 @@ OnlyExplicitInline true Speed - ../../../src/include;../../../src/include/gen;../../../extern/icu/include;../../../src/vulcan;%(AdditionalIncludeDirectories) + ../../../src/include;../../../src/include/gen;$(FbIcuIncludeDir)../../../src/vulcan;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_LIB;SUPERSERVER;NAMESPACE=Vulcan;%(PreprocessorDefinitions) @@ -302,7 +302,7 @@ OnlyExplicitInline true Speed - ../../../src/include;../../../src/include/gen;../../../extern/icu/include;../../../src/vulcan;%(AdditionalIncludeDirectories) + ../../../src/include;../../../src/include/gen;$(FbIcuIncludeDir)../../../src/vulcan;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_LIB;SUPERSERVER;NAMESPACE=Vulcan;%(PreprocessorDefinitions) diff --git a/builds/win32/msvc15/engine_static.vcxproj b/builds/win32/msvc15/engine_static.vcxproj index 2fa3a4d2d68..e561ec88c72 100644 --- a/builds/win32/msvc15/engine_static.vcxproj +++ b/builds/win32/msvc15/engine_static.vcxproj @@ -567,7 +567,7 @@ Disabled - ../../../src/include;../../../src/include/gen;../../../extern/icu/include;../../../src/vulcan;%(AdditionalIncludeDirectories) + ../../../src/include;../../../src/include/gen;$(FbIcuIncludeDir)../../../src/vulcan;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_LIB;SUPERSERVER;DEV_BUILD;NAMESPACE=Vulcan;%(PreprocessorDefinitions) @@ -577,7 +577,7 @@ Disabled - ../../../src/include;../../../src/include/gen;../../../extern/icu/include;../../../src/vulcan;%(AdditionalIncludeDirectories) + ../../../src/include;../../../src/include/gen;$(FbIcuIncludeDir)../../../src/vulcan;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_LIB;SUPERSERVER;DEV_BUILD;NAMESPACE=Vulcan;%(PreprocessorDefinitions) @@ -593,7 +593,7 @@ X64 - ../../../src/include;../../../src/include/gen;../../../extern/icu/include;../../../src/vulcan;%(AdditionalIncludeDirectories) + ../../../src/include;../../../src/include/gen;$(FbIcuIncludeDir)../../../src/vulcan;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_LIB;SUPERSERVER;NAMESPACE=Vulcan;%(PreprocessorDefinitions) @@ -604,7 +604,7 @@ ARM64 - ../../../src/include;../../../src/include/gen;../../../extern/icu/include;../../../src/vulcan;%(AdditionalIncludeDirectories) + ../../../src/include;../../../src/include/gen;$(FbIcuIncludeDir)../../../src/vulcan;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_LIB;SUPERSERVER;NAMESPACE=Vulcan;%(PreprocessorDefinitions) diff --git a/builds/win32/run_all.bat b/builds/win32/run_all.bat index 5805fc020a9..c6d1b6ed426 100644 --- a/builds/win32/run_all.bat +++ b/builds/win32/run_all.bat @@ -13,6 +13,11 @@ set FBBUILD_KITS=ISX ZIP set FBBUILD_TEST_ONLY= set FBBUILD_WITHOUT_TOMCRYPT= set FBBUILD_WITHOUT_CLOOP_GENERATION= +set FBBUILD_WITH_SYSTEM_BOOST= +set FBBUILD_WITH_SYSTEM_TOMMATH= +set FBBUILD_WITH_SYSTEM_TOMCRYPT= +set FBBUILD_WITH_SYSTEM_ZLIB= +set FBBUILD_WITH_SYSTEM_ICU= set FB2_SNAPSHOT= ::Check if on-line help is required @@ -87,6 +92,21 @@ goto :END @echo. @echo WITHOUT_CLOOP_GENERATION - omit Cloop build and interface generation @echo. +@echo WITH_SYSTEM_BOOST - use boost headers from the system include path +@echo instead of extern\boost +@echo. +@echo WITH_SYSTEM_TOMMATH - use libtommath headers and tommath.lib from the system +@echo include/lib paths instead of extern\libtommath +@echo. +@echo WITH_SYSTEM_TOMCRYPT - use libtomcrypt headers and tomcrypt.lib from the system +@echo include/lib paths instead of extern\libtomcrypt +@echo. +@echo WITH_SYSTEM_ZLIB - use zlib headers from the system include path and do not +@echo distribute zlib1.dll (instead of extern\zlib) +@echo. +@echo WITH_SYSTEM_ICU - use ICU headers from the system include path and do not +@echo distribute ICU libraries and icudt (instead of extern\icu) +@echo. @echo REALCLEAN - Run CLEAN_ALL.BAT REALCLEAN @echo This will do a deeper clean. @echo Recommended for multi-platform builds diff --git a/builds/win32/setenvvar.bat b/builds/win32/setenvvar.bat index 0f81c358b66..bffd4f5506e 100644 --- a/builds/win32/setenvvar.bat +++ b/builds/win32/setenvvar.bat @@ -36,6 +36,31 @@ if /I "%~1"=="WITHOUT_CLOOP_GENERATION" ( shift /1 goto :parse_args ) +if /I "%~1"=="WITH_SYSTEM_BOOST" ( + set FBBUILD_WITH_SYSTEM_BOOST=1 + shift /1 + goto :parse_args +) +if /I "%~1"=="WITH_SYSTEM_TOMMATH" ( + set FBBUILD_WITH_SYSTEM_TOMMATH=1 + shift /1 + goto :parse_args +) +if /I "%~1"=="WITH_SYSTEM_TOMCRYPT" ( + set FBBUILD_WITH_SYSTEM_TOMCRYPT=1 + shift /1 + goto :parse_args +) +if /I "%~1"=="WITH_SYSTEM_ZLIB" ( + set FBBUILD_WITH_SYSTEM_ZLIB=1 + shift /1 + goto :parse_args +) +if /I "%~1"=="WITH_SYSTEM_ICU" ( + set FBBUILD_WITH_SYSTEM_ICU=1 + shift /1 + goto :parse_args +) if /I "%~1"=="CLEAN" ( set FB_CLEAN=:rebuild shift /1 @@ -294,6 +319,11 @@ goto :END @echo FB_VSCOMNTOOLS=%FB_VSCOMNTOOLS% @echo platform=%FB_TARGET_PLATFORM% @if defined FBBUILD_WITHOUT_CLOOP_GENERATION echo without_cloop_generation=yes +@if defined FBBUILD_WITH_SYSTEM_BOOST echo with_system_boost=yes +@if defined FBBUILD_WITH_SYSTEM_TOMMATH echo with_system_tommath=yes +@if defined FBBUILD_WITH_SYSTEM_TOMCRYPT echo with_system_tomcrypt=yes +@if defined FBBUILD_WITH_SYSTEM_ZLIB echo with_system_zlib=yes +@if defined FBBUILD_WITH_SYSTEM_ICU echo with_system_icu=yes @if /I "%FB_CLIENT_ONLY%"=="STATIC" ( @echo fbclient_static_config=%FB_STATIC_CONFIG% @if defined FBBUILD_WITHOUT_TOMCRYPT echo without_tomcrypt=yes diff --git a/doc/README.build.msvc.html b/doc/README.build.msvc.html index 478421a0516..27ea3d09388 100644 --- a/doc/README.build.msvc.html +++ b/doc/README.build.msvc.html @@ -109,6 +109,8 @@

4.1.-Standard build

  • make_all.bat [DEBUG] [CLEAN]
  • To skip the Cloop build and generated interface updates, pass WITHOUT_CLOOP_GENERATION to run_all.bat.
  • +
  • To use boost headers from the system include path (e.g. the INCLUDE environment variable) instead of extern\boost, pass WITH_SYSTEM_BOOST to make_boot.bat (or run_all.bat). The choice is recorded in temp\<Platform>\FirebirdSystemLibs.props and used by later builds, including from the IDE; a make_boot.bat run without the option removes it, and so does clean_all.bat. The installed Message.h then uses <boost/...> and the embedded boost copy is not distributed.
  • +
  • Likewise, WITH_SYSTEM_TOMMATH, WITH_SYSTEM_TOMCRYPT, WITH_SYSTEM_ZLIB and WITH_SYSTEM_ICU make the build use the headers (and, for libtommath and libtomcrypt, tommath.lib and tomcrypt.lib) from the system INCLUDE and LIB paths instead of extern\libtommath, extern\libtomcrypt, extern\zlib and extern\icu. The embedded copy is not built or extracted, and the corresponding runtime files (zlib1.dll, ICU libraries and icudt; tzdata is still extracted and copied) are not copied to the output directory, so they must be provided by you. These options are also recorded in FirebirdSystemLibs.props.
    • After the build finish, an output directory with the binaries is created below your firebird directory.

      From 64465e734fab556b61e512e636a1fb0b010c16ce Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Thu, 15 Oct 2026 22:35:02 -0300 Subject: [PATCH 4/4] Backport system library build fixes from #9211 (v5) - Windows: add FBBUILD_SYSTEM_INCLUDE_DIR as extra include directory for system ICU/zlib headers, since MSBuild ignores %INCLUDE%. - Windows: link system libtommath/libtomcrypt in final binaries (FbTomMathSysLib/FbTomCryptSysLib) instead of merging them into common.lib. - configure: link libtommath in the check for system libtomcrypt, as a shared libtomcrypt may not record its dependency on it. --- builds/win32/make_boot.bat | 13 +++++++++---- builds/win32/msvc15/FirebirdCommon.props | 6 ++++-- configure.ac | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/builds/win32/make_boot.bat b/builds/win32/make_boot.bat index 9d59f576d42..f3c3ef37e6e 100644 --- a/builds/win32/make_boot.bat +++ b/builds/win32/make_boot.bat @@ -150,6 +150,9 @@ for %%v in (firebird plugins) do ( @if defined FBBUILD_WITH_SYSTEM_ZLIB set SYSLIBS_ANY=1 @if defined FBBUILD_WITH_SYSTEM_ICU set SYSLIBS_ANY=1 @if not defined SYSLIBS_ANY goto :EOF +:: Optional extra include directory for system ICU/zlib headers (e.g. vcpkg), since MSBuild ignores %INCLUDE% +@set SYSLIBS_INCDIR= +@if defined FBBUILD_SYSTEM_INCLUDE_DIR set SYSLIBS_INCDIR=%FBBUILD_SYSTEM_INCLUDE_DIR%; @echo ^> "%SYSLIBS_PROPS%" @echo ^>> "%SYSLIBS_PROPS%" @if defined FBBUILD_WITH_SYSTEM_BOOST ( @@ -159,21 +162,23 @@ for %%v in (firebird plugins) do ( @if defined FBBUILD_WITH_SYSTEM_TOMMATH ( @echo Using system libtommath @echo ^^>> "%SYSLIBS_PROPS%" - @echo ^tommath.lib^>> "%SYSLIBS_PROPS%" + @echo ^^>> "%SYSLIBS_PROPS%" + @echo ^tommath.lib^>> "%SYSLIBS_PROPS%" call :tommath_probe ) @if defined FBBUILD_WITH_SYSTEM_TOMCRYPT ( @echo Using system libtomcrypt @echo ^^>> "%SYSLIBS_PROPS%" - @echo ^tomcrypt.lib^>> "%SYSLIBS_PROPS%" + @echo ^^>> "%SYSLIBS_PROPS%" + @echo ^tomcrypt.lib^>> "%SYSLIBS_PROPS%" ) @if defined FBBUILD_WITH_SYSTEM_ZLIB ( @echo Using system zlib - @echo ^^>> "%SYSLIBS_PROPS%" + @echo ^%SYSLIBS_INCDIR%^>> "%SYSLIBS_PROPS%" ) @if defined FBBUILD_WITH_SYSTEM_ICU ( @echo Using system ICU - @echo ^^>> "%SYSLIBS_PROPS%" + @echo ^%SYSLIBS_INCDIR%^>> "%SYSLIBS_PROPS%" ) @echo ^>> "%SYSLIBS_PROPS%" @echo ^>> "%SYSLIBS_PROPS%" diff --git a/builds/win32/msvc15/FirebirdCommon.props b/builds/win32/msvc15/FirebirdCommon.props index 9ada056c9d1..ffdcbd41969 100644 --- a/builds/win32/msvc15/FirebirdCommon.props +++ b/builds/win32/msvc15/FirebirdCommon.props @@ -13,10 +13,12 @@ ../../../extern/libtommath/lib/$(PlatformName)\$(FbExternConfiguration)\tommath.lib ../../../extern/libtomcrypt/src/headers; ../../../extern/libtomcrypt/lib/$(PlatformName)\$(FbExternConfiguration)\tomcrypt.lib + + ../../../extern/zlib; ../../../extern/icu/include; - + @@ -47,7 +49,7 @@ true $(IntDir)$(TargetName).pdb $(IntDir)$(TargetName).lib - bcrypt.lib;psapi.lib;%(AdditionalDependencies) + bcrypt.lib;psapi.lib;$(FbTomMathSysLib);$(FbTomCryptSysLib);%(AdditionalDependencies) ../../../extern/re2/builds/$(PlatformName)/$(Configuration) diff --git a/configure.ac b/configure.ac index b01795fa93f..2c9f1b4ee25 100644 --- a/configure.ac +++ b/configure.ac @@ -958,7 +958,7 @@ else AC_MSG_ERROR(Include file for tomcrypt not found - please install development tomcrypt package or use --with-builtin-tomcrypt)) XE_RESTORE_ENV() XE_SAVE_ENV() - LIBS= + LIBS=$MATHLIB AC_CHECK_LIB(tomcrypt, sha1_init, CRYPTLIB=-ltomcrypt, AC_MSG_ERROR(Library tomcrypt not found - please install development tomcrypt package or use --with-builtin-tomcrypt)) XE_RESTORE_ENV()