From 7554a547d08dd1bf5ee1f107c7e37438baed635a Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 31 Dec 2022 17:25:23 +0100 Subject: Extract version from new file VERSION, for the benefit of win32 Use the same source of all version information instead of hard-coding it everywhere, and then having to update if for every releae cycle. Signed-off-by: Joachim Wiberg --- VERSION | 1 + configure.ac | 3 ++- win32/msvcbuild.bat | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..cd438c9 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.3-dev diff --git a/configure.ac b/configure.ac index c3ffa26..36ac5ba 100644 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,8 @@ # # Process this file with autoconf to produce a configure script. -AC_INIT([libnet], [1.3-dev], [https://github.com/libnet/libnet/issues],, +AC_INIT([libnet], m4_esyscmd([sed -n '1p' VERSION | tr -d '\n']), + [https://github.com/libnet/libnet/issues],, [https://github.com/libnet/libnet]) # Visible in resulting configure script, e.g. with ./configure --version diff --git a/win32/msvcbuild.bat b/win32/msvcbuild.bat index 7060203..fe669d8 100644 --- a/win32/msvcbuild.bat +++ b/win32/msvcbuild.bat @@ -16,6 +16,7 @@ for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Micros if not exist "%InstallDir%\Common7\Tools\VsDevCmd.bat" (goto fail) @rem Set up common files, paths, and envs +@for /f "delims=-" %%V in ('type VERSION') do set VERSION=%%V @rem relative to C code in src/ @set NPCAP=..\..\npcap-sdk copy win32\*.h include\ @@ -61,7 +62,6 @@ goto msvcbuild @set CC=cl /nologo /MD /MP /O2 /W4 /c /D_CRT_SECURE_NO_DEPRECATE /Fo%OBJDIR%\ @set LD=link /nologo @set MT=mt /nologo -@set VERSION=1.2 @mkdir %OBJDIR% %LIBDIR% %CC% /I..\include /I%PCAPINC% libnet_a*.c libnet_build_*.c libnet_c*.c libnet_dll.c libnet_error.c libnet_i*.c libnet_link_win32.c libnet_p*.c libnet_raw.c libnet_resolve.c libnet_version.c libnet_write.c -- cgit v1.2.1