From d06c8143aae6e8745999eb48d3886b6cfa0dd605 Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Sat, 10 Oct 2026 19:06:42 -0300 Subject: [PATCH 1/6] Do not copy include/firebird/impl/boost when --with-system-boost is used --- 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 02a010da801..f5d033be32e 100644 --- a/builds/posix/Makefile.in +++ b/builds/posix/Makefile.in @@ -764,13 +764,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 2b9ba5dbf56e9bbdf329501164fb2a1ff2e70325 Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Sat, 10 Oct 2026 19:58:51 -0300 Subject: [PATCH 2/6] Add WITH_SYSTEM_BOOST option to the Windows build --- builds/win32/make_all.bat | 6 ++++++ builds/win32/make_boot.bat | 17 +++++++++++++++++ builds/win32/msvc15/FirebirdCommon.props | 5 ++++- builds/win32/run_all.bat | 4 ++++ builds/win32/setenvvar.bat | 2 ++ doc/README.build.msvc.html | 1 + 6 files changed, 34 insertions(+), 1 deletion(-) diff --git a/builds/win32/make_all.bat b/builds/win32/make_all.bat index ebeb3910dd6..3dfacdfbce8 100644 --- a/builds/win32/make_all.bat +++ b/builds/win32/make_all.bat @@ -103,6 +103,12 @@ 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_ +@if exist %FB_TEMP_DIR%\FirebirdSystemBoost.props ( + 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 24803a67eaf..838c34ed49a 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 :boost_config + @if not defined FBBUILD_WITHOUT_CLOOP_GENERATION call :interfaces if "!ERRLEV!"=="1" goto :END @@ -129,6 +131,21 @@ for %%v in (firebird plugins) do ( @goto :END +::=================== +:: Record the boost headers choice in a props file used by all later builds (including the IDE) +:boost_config +@mkdir %FB_TEMP_DIR% 2>nul +@set BOOST_PROPS=%FB_TEMP_DIR%\FirebirdSystemBoost.props +@if defined FBBUILD_WITH_SYSTEM_BOOST ( + @echo Using system boost headers + @(echo ^ + echo ^^^^ + echo ^) > "%BOOST_PROPS%" +) else ( + @del "%BOOST_PROPS%" 2>nul +) +@goto :EOF + ::=================== :: BUILD btyacc :btyacc diff --git a/builds/win32/msvc15/FirebirdCommon.props b/builds/win32/msvc15/FirebirdCommon.props index f60c800e00e..b01ffebc20f 100644 --- a/builds/win32/msvc15/FirebirdCommon.props +++ b/builds/win32/msvc15/FirebirdCommon.props @@ -5,12 +5,15 @@ ..\..\..\temp\$(PlatformName)\$(Configuration)\$(ProjectName)\ ..\..\..\temp\$(PlatformName)\$(Configuration)\$(ProjectName)\ false + ../../../extern/boost; + + /EHsc- %(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;../../../extern/libtomcrypt/src/headers;../../../extern/libtommath;../../../extern/icu/include;../../../extern/zlib;../../../extern/re2;$(FbBoostIncludeDir)%(AdditionalIncludeDirectories) false diff --git a/builds/win32/run_all.bat b/builds/win32/run_all.bat index e62fc695e15..76433e6c8d1 100644 --- a/builds/win32/run_all.bat +++ b/builds/win32/run_all.bat @@ -12,6 +12,7 @@ set FBBUILD_BUILD_ONLY=0 set FBBUILD_KITS=ISX ZIP set FBBUILD_TEST_ONLY= set FBBUILD_WITHOUT_CLOOP_GENERATION= +set FBBUILD_WITH_SYSTEM_BOOST= set FB2_SNAPSHOT= ::Check if on-line help is required @@ -84,6 +85,9 @@ 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 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 49d752e2318..32c57b4ed1e 100644 --- a/builds/win32/setenvvar.bat +++ b/builds/win32/setenvvar.bat @@ -14,6 +14,7 @@ set FB_CLEAN= for %%v in ( %* ) do ( ( if /I "%%v"=="DEBUG" ( (set FB_DBG=TRUE) && (set FB_CONFIG=debug) ) ) ( if /I "%%v"=="WITHOUT_CLOOP_GENERATION" (set FBBUILD_WITHOUT_CLOOP_GENERATION=1) ) + ( if /I "%%v"=="WITH_SYSTEM_BOOST" (set FBBUILD_WITH_SYSTEM_BOOST=1) ) ( if /I "%%v"=="CLEAN" (set FB_CLEAN=:rebuild) ) ( if /I "%%v"=="RELEASE" ( (set FB_DBG=) && (set FB_CONFIG=release) ) ) ( if /I "%%v"=="CLIENT_ONLY" (set FB_CLIENT_ONLY=TRUE) ) @@ -205,6 +206,7 @@ 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 @echo msvc_version=%MSVC_VERSION% @echo db_path=%FB_DB_PATH% @echo root_path=%FB_ROOT_PATH% diff --git a/doc/README.build.msvc.html b/doc/README.build.msvc.html index 478421a0516..93c686f8556 100644 --- a/doc/README.build.msvc.html +++ b/doc/README.build.msvc.html @@ -109,6 +109,7 @@

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>\FirebirdSystemBoost.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.
    • After the build finish, an output directory with the binaries is created below your firebird directory.

      From 555e6af27a905bd6112c35a87e6bf80336c9a14d Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Sat, 10 Oct 2026 20:28:43 -0300 Subject: [PATCH 3/6] Add WITH_SYSTEM_TOMMATH, WITH_SYSTEM_TOMCRYPT, WITH_SYSTEM_ZLIB and WITH_SYSTEM_ICU options to the Windows build --- builds/win32/make_all.bat | 2 +- builds/win32/make_boot.bat | 76 +++++++++++++++++------ builds/win32/make_icu.bat | 9 ++- builds/win32/msvc15/FirebirdCommon.props | 12 +++- builds/win32/msvc15/common.vcxproj | 8 +-- builds/win32/msvc15/engine.vcxproj | 4 +- builds/win32/msvc15/engine_static.vcxproj | 4 +- builds/win32/run_all.bat | 16 +++++ builds/win32/setenvvar.bat | 8 +++ doc/README.build.msvc.html | 3 +- 10 files changed, 108 insertions(+), 34 deletions(-) diff --git a/builds/win32/make_all.bat b/builds/win32/make_all.bat index 3dfacdfbce8..b202480cac8 100644 --- a/builds/win32/make_all.bat +++ b/builds/win32/make_all.bat @@ -104,7 +104,7 @@ copy %FB_GEN_DIR%\iberror_c.h %FB_OUTPUT_DIR%\include\firebird\impl > nul 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_ -@if exist %FB_TEMP_DIR%\FirebirdSystemBoost.props ( +@if exist %FB_TEMP_DIR%\FirebirdSystemLibs.props ( 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'" ) diff --git a/builds/win32/make_boot.bat b/builds/win32/make_boot.bat index 838c34ed49a..8d85403597f 100644 --- a/builds/win32/make_boot.bat +++ b/builds/win32/make_boot.bat @@ -29,7 +29,7 @@ for %%v in ( alice auth burp dsql gpre isql jrd misc msgs examples yvalve utilit @mkdir %FB_BIN_DIR%\tzdata 2>nul -call :boost_config +call :system_libs_config @if not defined FBBUILD_WITHOUT_CLOOP_GENERATION call :interfaces if "!ERRLEV!"=="1" goto :END @@ -43,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 @@ -103,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%"=="" ( ::======= @@ -132,18 +138,44 @@ for %%v in (firebird plugins) do ( ::=================== -:: Record the boost headers choice in a props file used by all later builds (including the IDE) -:boost_config +:: 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 BOOST_PROPS=%FB_TEMP_DIR%\FirebirdSystemBoost.props +@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 ^ - echo ^^^^ - echo ^) > "%BOOST_PROPS%" -) else ( - @del "%BOOST_PROPS%" 2>nul + @echo ^^>> "%SYSLIBS_PROPS%" ) +@if defined FBBUILD_WITH_SYSTEM_TOMMATH ( + @echo Using system libtommath + @echo ^^>> "%SYSLIBS_PROPS%" + @echo ^tommath.lib^>> "%SYSLIBS_PROPS%" +) +@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 ::=================== @@ -159,12 +191,16 @@ goto :EOF :: BUILD LibTom :LibTom @echo. -@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% -@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% +@if not defined FBBUILD_WITH_SYSTEM_TOMMATH ( + @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% +) +@if not defined FBBUILD_WITH_SYSTEM_TOMCRYPT ( + @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% +) goto :EOF ::=================== 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 b01ffebc20f..8b3529a815b 100644 --- a/builds/win32/msvc15/FirebirdCommon.props +++ b/builds/win32/msvc15/FirebirdCommon.props @@ -6,14 +6,20 @@ ..\..\..\temp\$(PlatformName)\$(Configuration)\$(ProjectName)\ false ../../../extern/boost; + ../../../extern/libtommath; + ../../../extern/libtommath/lib/$(PlatformName)\$(Configuration)\tommath.lib + ../../../extern/libtomcrypt/src/headers; + ../../../extern/libtomcrypt/lib/$(PlatformName)\$(Configuration)\tomcrypt.lib + ../../../extern/zlib; + ../../../extern/icu/include; - - + + /EHsc- %(AdditionalOptions) true - ../../../src/include;../../../src/include/gen;../../../extern/libtomcrypt/src/headers;../../../extern/libtommath;../../../extern/icu/include;../../../extern/zlib;../../../extern/re2;$(FbBoostIncludeDir)%(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 a9fc6ff0245..bae480e1715 100644 --- a/builds/win32/msvc15/common.vcxproj +++ b/builds/win32/msvc15/common.vcxproj @@ -319,7 +319,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) @@ -331,7 +331,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) @@ -342,7 +342,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) @@ -356,7 +356,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) diff --git a/builds/win32/msvc15/engine.vcxproj b/builds/win32/msvc15/engine.vcxproj index 92cc0ceb720..3541c411a21 100644 --- a/builds/win32/msvc15/engine.vcxproj +++ b/builds/win32/msvc15/engine.vcxproj @@ -185,7 +185,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) @@ -221,7 +221,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 e9bdf53c8f8..968d0f31c7b 100644 --- a/builds/win32/msvc15/engine_static.vcxproj +++ b/builds/win32/msvc15/engine_static.vcxproj @@ -493,7 +493,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) @@ -509,7 +509,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) diff --git a/builds/win32/run_all.bat b/builds/win32/run_all.bat index 76433e6c8d1..e2660a9a5e7 100644 --- a/builds/win32/run_all.bat +++ b/builds/win32/run_all.bat @@ -13,6 +13,10 @@ set FBBUILD_KITS=ISX ZIP set FBBUILD_TEST_ONLY= 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 @@ -88,6 +92,18 @@ goto :END @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 32c57b4ed1e..2003dbd5f5e 100644 --- a/builds/win32/setenvvar.bat +++ b/builds/win32/setenvvar.bat @@ -15,6 +15,10 @@ for %%v in ( %* ) do ( ( if /I "%%v"=="DEBUG" ( (set FB_DBG=TRUE) && (set FB_CONFIG=debug) ) ) ( if /I "%%v"=="WITHOUT_CLOOP_GENERATION" (set FBBUILD_WITHOUT_CLOOP_GENERATION=1) ) ( if /I "%%v"=="WITH_SYSTEM_BOOST" (set FBBUILD_WITH_SYSTEM_BOOST=1) ) + ( if /I "%%v"=="WITH_SYSTEM_TOMMATH" (set FBBUILD_WITH_SYSTEM_TOMMATH=1) ) + ( if /I "%%v"=="WITH_SYSTEM_TOMCRYPT" (set FBBUILD_WITH_SYSTEM_TOMCRYPT=1) ) + ( if /I "%%v"=="WITH_SYSTEM_ZLIB" (set FBBUILD_WITH_SYSTEM_ZLIB=1) ) + ( if /I "%%v"=="WITH_SYSTEM_ICU" (set FBBUILD_WITH_SYSTEM_ICU=1) ) ( if /I "%%v"=="CLEAN" (set FB_CLEAN=:rebuild) ) ( if /I "%%v"=="RELEASE" ( (set FB_DBG=) && (set FB_CONFIG=release) ) ) ( if /I "%%v"=="CLIENT_ONLY" (set FB_CLIENT_ONLY=TRUE) ) @@ -207,6 +211,10 @@ goto :END @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 @echo msvc_version=%MSVC_VERSION% @echo db_path=%FB_DB_PATH% @echo root_path=%FB_ROOT_PATH% diff --git a/doc/README.build.msvc.html b/doc/README.build.msvc.html index 93c686f8556..27ea3d09388 100644 --- a/doc/README.build.msvc.html +++ b/doc/README.build.msvc.html @@ -109,7 +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>\FirebirdSystemBoost.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.
    • +
    • 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 2232fea80e4f22206c70a64ccfe1f028022eb132 Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Sun, 11 Oct 2026 09:25:50 -0300 Subject: [PATCH 4/6] Use RE2 StringPiece/string_view data() instead of begin() --- 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 ee8b2b9ae8d..65b84922210 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 = spResult.length(); return true; } From 8bf3b41ce4b3e2b333d5ebd1b04d5267085f0d71 Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Sun, 11 Oct 2026 09:26:09 -0300 Subject: [PATCH 5/6] Detect libtommath 1.2+ API --- builds/win32/make_boot.bat | 16 ++++++++++++++++ builds/win32/msvc15/FirebirdCommon.props | 3 ++- configure.ac | 2 ++ src/common/BigInteger.cpp | 17 +++++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/builds/win32/make_boot.bat b/builds/win32/make_boot.bat index 8d85403597f..cad7915caef 100644 --- a/builds/win32/make_boot.bat +++ b/builds/win32/make_boot.bat @@ -160,6 +160,7 @@ for %%v in (firebird plugins) do ( @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 @@ -178,6 +179,21 @@ for %%v in (firebird plugins) do ( @echo ^>> "%SYSLIBS_PROPS%" @goto :EOF +:: Check whether the system libtommath has the 1.2+ API (mp_to_ubin and others) +:tommath_probe +@set TOMMATH_PROBE=%FB_TEMP_DIR%\tommath_probe.cpp +@echo #include ^> "%TOMMATH_PROBE%" +@echo int main() { mp_int a; size_t n; return (int) mp_to_ubin(^&a, 0, 0, ^&n); }>> "%TOMMATH_PROBE%" +@cl /nologo /Zs /TP "%TOMMATH_PROBE%" >nul 2>&1 +@if errorlevel 1 ( + @echo libtommath 1.2+ API not found +) else ( + @echo libtommath 1.2+ API found + @echo ^HAVE_TOMMATH_1_2_API;^>> "%SYSLIBS_PROPS%" +) +@del "%TOMMATH_PROBE%" 2>nul +@goto :EOF + ::=================== :: BUILD btyacc :btyacc diff --git a/builds/win32/msvc15/FirebirdCommon.props b/builds/win32/msvc15/FirebirdCommon.props index 8b3529a815b..1b97a652374 100644 --- a/builds/win32/msvc15/FirebirdCommon.props +++ b/builds/win32/msvc15/FirebirdCommon.props @@ -8,6 +8,7 @@ ../../../extern/boost; ../../../extern/libtommath; ../../../extern/libtommath/lib/$(PlatformName)\$(Configuration)\tommath.lib + ../../../extern/libtomcrypt/src/headers; ../../../extern/libtomcrypt/lib/$(PlatformName)\$(Configuration)\tomcrypt.lib ../../../extern/zlib; @@ -36,7 +37,7 @@ Default false true - _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;$(FbTomMathDefines)%(PreprocessorDefinitions) true diff --git a/configure.ac b/configure.ac index cacdb3b3342..7a1a7e0b493 100644 --- a/configure.ac +++ b/configure.ac @@ -1002,6 +1002,8 @@ else LIBS= AC_CHECK_LIB(tommath, mp_init, MATHLIB=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package or use --with-builtin-tommath)) + AC_CHECK_LIB(tommath, mp_to_ubin, + AC_DEFINE(HAVE_TOMMATH_1_2_API, 1, [Define this if libtommath has the 1.2+ API (mp_to_ubin, mp_from_ubin, mp_to_radix)])) XE_RESTORE_ENV() fi AC_SUBST(MATHLIB) diff --git a/src/common/BigInteger.cpp b/src/common/BigInteger.cpp index 6a99404abd8..b991bbe3d07 100644 --- a/src/common/BigInteger.cpp +++ b/src/common/BigInteger.cpp @@ -102,7 +102,11 @@ namespace Firebird void BigInteger::assign(unsigned int count, const unsigned char* bytes) { +#ifdef HAVE_TOMMATH_1_2_API + CHECK_MP(mp_from_ubin(&t, bytes, count)); +#else CHECK_MP(mp_read_unsigned_bin(&t, bytes, count)); +#endif } BigInteger BigInteger::operator+ (const BigInteger& val) const @@ -191,17 +195,26 @@ namespace Firebird void BigInteger::getBytes(Firebird::UCharBuffer& bytes) const { +#ifdef HAVE_TOMMATH_1_2_API + const unsigned int len = length(); + CHECK_MP(mp_to_ubin(&t, bytes.getBuffer(len), len, NULL)); +#else CHECK_MP(mp_to_unsigned_bin(const_cast(&t), bytes.getBuffer(length()))); +#endif } unsigned int BigInteger::length() const { +#ifdef HAVE_TOMMATH_1_2_API + return static_cast(mp_ubin_size(&t)); +#else int rc = mp_unsigned_bin_size(const_cast(&t)); if (rc < 0) { check(rc, "mp_unsigned_bin_size(&t)"); } return static_cast(rc); +#endif } void BigInteger::getText(string& str, unsigned int radix) const @@ -209,7 +222,11 @@ namespace Firebird int size; CHECK_MP(mp_radix_size(const_cast(&t), radix, &size)); str.resize(size - 1, ' '); +#ifdef HAVE_TOMMATH_1_2_API + CHECK_MP(mp_to_radix(&t, str.begin(), size, NULL, radix)); +#else CHECK_MP(mp_toradix(const_cast(&t), str.begin(), radix)); +#endif } BigInteger BigInteger::modPow(const BigInteger& pow, const BigInteger& mod) const From c65e290d7f5edf17ef0dbdada9bc9a4703029301 Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Sun, 11 Oct 2026 13:13:01 -0300 Subject: [PATCH 6/6] Use Alpine 3.22.1 container in CI to fix Node 24 runner failure --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3ad57ba5729..64beaf62d94 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -123,7 +123,7 @@ jobs: build-alpine-x64: if: github.ref_type != 'tag' runs-on: ubuntu-22.04 - container: alpine:3.14 + container: alpine:3.22.1 steps: - name: Checkout