yasm/YASM-VERSION-GEN.bat
Peter Johnson 0ed2cc4451 Generate version number information from git history.
Due to the svn import structure, a special case is currently implemented
to look for the 1.1.0 branchpoint instead of the most recent tag on the
master branch.  This will be removed after the first release is tagged
on the master branch in git.

Specific details:

autogen.sh: More aggressively clean autoconf cache.
This is needed to ensure the version number is actually regenerated.

Don't generate PACKAGE_PATCHLEVEL or PACKAGE_BUILD variables.  The
genversion program now parses PACKAGE_VERSION directly.

For Mkfiles builds, YASM-VERSION.h is generated and included by the custom
config.h.  This avoids the need to edit config.h for versioning.
2011-08-27 09:25:30 -07:00

38 lines
1 KiB
Batchfile

@echo off
if exist version goto haveversion
set errorlevel=0
set _my_=
for /f "usebackq tokens=1*" %%f in (`reg query HKCU\Software\TortoiseGit /v MSysGit`) do (set _my_=%%f %%g)
if %errorlevel% neq 0 goto notfound
if "%_my_%" == "" goto notfound
rem Using the shell script version (calling Git) ...
set _gitbin_=%_my_:*REG_SZ=%
for /f "tokens=* delims= " %%a in ("%_gitbin_%") do set _gitbin_=%%a
set OLDPATH=%PATH%
set PATH=%_gitbin_%;%PATH%
"%_gitbin_%\sh" YASM-VERSION-GEN.sh "%_gitbin_%"
set PATH=%OLDPATH%
exit /b
:notfound
rem Could not find Git ...
set _ver_=
for /f "usebackq tokens=2 delims==" %%a in (`%SystemRoot%\system32\find "DEF_VER=" ^<YASM-VERSION-GEN.sh`) do (set _ver_=%%a)
set _ver_=%_ver_:~1%
goto output
:haveversion
set /p _ver_=<version
goto output
:output
set /p _oldver_=<YASM-VERSION-FILE
set _oldver_=%_oldver_:~,-1%
if "%_ver_%" == "%_oldver_%" exit /b
echo %_ver_%
echo %_ver_% > YASM-VERSION-FILE
echo #define PACKAGE_STRING "yasm %_ver_%" > YASM-VERSION.h
echo #define PACKAGE_VERSION "%_ver_%" >> YASM-VERSION.h