Skip to content

Commit 36c3d2c

Browse files
committed
Move git hash logic away from config
1 parent 85a9c3c commit 36c3d2c

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

build_scripts/php-fb-build.bat

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@REM
55

66
@REM config ======================================================================================
7+
call %~dp0php-fb-config.dist.bat
78
call %~dp0php-fb-config.bat
89

910
set pfb_php_tag=%1
@@ -41,6 +42,17 @@ if "%pfb_php_vers%" == "" (
4142
exit 1
4243
)
4344

45+
@REM Grab version
46+
for /f "tokens=3" %%i in ('findstr /b /c:"#define PHP_INTERBASE_VER_MAJOR" %~dp0..\php_interbase.h') do set VER_MAJOR=%%i
47+
for /f "tokens=3" %%i in ('findstr /b /c:"#define PHP_INTERBASE_VER_MINOR" %~dp0..\php_interbase.h') do set VER_MINOR=%%i
48+
for /f "tokens=3" %%i in ('findstr /b /c:"#define PHP_INTERBASE_VER_REV" %~dp0..\php_interbase.h') do set VER_REV=%%i
49+
for /f "tokens=3" %%i in ('findstr /b /c:"#define PHP_INTERBASE_VER_PRE" %~dp0..\php_interbase.h') do set VER_PRE=%%~i
50+
set PFB_VERS=%VER_MAJOR%.%VER_MINOR%.%VER_REV%%VER_PRE%
51+
52+
if %PFB_ATTACH_GIT_HASH_TO_VERS% equ 1 (
53+
for /f %%i in ('git -C %~dp0..\ rev-parse --short HEAD') do set PFB_VERS=%PFB_VERS%-%%i
54+
)
55+
4456
@REM Initialize
4557
set php_root=php%pfb_php_vers%\%pfb_cpp_vers%\%pfb_arch%\php-src\
4658
set php_interbase=php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%
Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
@echo off
2+
@REM Do not modify this file directly.
3+
@REM Create build_scripts/php-fb-config.bat if you need to change any variable
4+
@REM and put overrides there
5+
26
@REM php-firebird source directory
37
@REM Should point one level up. For example
48
@REM PFB_SOURCE_DIR=D:\php-firebird\ then your source should reside in D:\php-firebird\php-firebird\
@@ -11,18 +15,8 @@ set PFB_OUTPUT_DIR=%PFB_SOURCE_DIR%releases\
1115
set PFB_FB32_DIR=C:\Program Files\Firebird\Firebird_5_0-x86
1216
set PFB_FB64_DIR=C:\Program Files\Firebird\Firebird_5_0
1317

14-
@REM Attach current git commit hash. git command must be in PATH
15-
set USE_GIT_HASH=0
16-
17-
@REM Grab version
18-
for /f "tokens=3" %%i in ('findstr /b /c:"#define PHP_INTERBASE_VER_MAJOR" %~dp0..\php_interbase.h') do set VER_MAJOR=%%i
19-
for /f "tokens=3" %%i in ('findstr /b /c:"#define PHP_INTERBASE_VER_MINOR" %~dp0..\php_interbase.h') do set VER_MINOR=%%i
20-
for /f "tokens=3" %%i in ('findstr /b /c:"#define PHP_INTERBASE_VER_REV" %~dp0..\php_interbase.h') do set VER_REV=%%i
21-
for /f "tokens=3" %%i in ('findstr /b /c:"#define PHP_INTERBASE_VER_PRE" %~dp0..\php_interbase.h') do set VER_PRE=%%~i
22-
set PFB_VERS=%VER_MAJOR%.%VER_MINOR%.%VER_REV%%VER_PRE%
23-
24-
if %USE_GIT_HASH% equ 1 (
25-
for /f %%i in ('git -C %~dp0..\ rev-parse --short HEAD') do set PFB_VERS=%PFB_VERS%-%%i
26-
)
18+
@REM Attach current git commit hash to version. git command must be in PATH
19+
set PFB_ATTACH_GIT_HASH_TO_VERS=0
2720

21+
@REM Additional flags for ./configure
2822
@REM set PFB_CONFIGURE_FLAGS=--enable-debug

0 commit comments

Comments
 (0)