From c6f1c5892315fcc7d0c466263c3d5178ab36d08b Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 24 Mar 2024 06:48:41 +0100 Subject: [PATCH] Applied updates --- appveyor.yml | 6 ++--- autogen.ps1 | 66 +++++++++++++++++++++++++++---------------------- configure.ac | 2 +- m4/common.m4 | 6 ++--- m4/libcerror.m4 | 9 ++++--- 5 files changed, 50 insertions(+), 39 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 03a3cfb..8d57707 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -117,8 +117,8 @@ environment: install: - cmd: if [%BUILD_ENVIRONMENT%]==[msbuild] ( git clone https://github.com/libyal/vstools.git ..\vstools ) -- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew update-reset && brew update -q; fi -- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew install -q autoconf automake gettext gnu-sed libtool pkg-config || true; fi +- sh: if ( test `uname -s` = "Darwin" && test ${BUILD_ENVIRONMENT} = "python-tox" ) || test ${BUILD_ENVIRONMENT} = "xcode"; then brew update-reset && brew update -q; fi +- sh: if ( test `uname -s` = "Darwin" && test ${BUILD_ENVIRONMENT} = "python-tox" ) || test ${BUILD_ENVIRONMENT} = "xcode"; then brew install -q autoconf automake gettext gnu-sed libtool pkg-config || true; fi - ps: If ($env:BUILD_ENVIRONMENT -eq "cygwin64") { (New-Object Net.WebClient).DownloadFile("https://cygwin.com/setup-x86_64.exe", "C:\\cygwin64\\setup-x86_64.exe") } - cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] ( @@ -129,7 +129,7 @@ install: $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile ..\codecov.exe } build_script: -- ps: If ($env:BUILD_ENVIRONMENT -eq "msbuild" -or ($env:BUILD_ENVIRONMENT -eq "python" -and $isWindows)) { +- ps: If ($env:BUILD_ENVIRONMENT -eq "msbuild" -or ($env:BUILD_ENVIRONMENT -eq "python-tox" -and $isWindows)) { .\synclibs.ps1; .\autogen.ps1 } - ps: If ($env:TARGET -eq "vs2008") { diff --git a/autogen.ps1 b/autogen.ps1 index ed2049a..fd3f68b 100644 --- a/autogen.ps1 +++ b/autogen.ps1 @@ -1,6 +1,6 @@ # Script to generate the necessary files for a msvscpp build # -# Version: 20230104 +# Version: 20240306 $WinFlex = "..\win_flex_bison\win_flex.exe" $WinBison = "..\win_flex_bison\win_bison.exe" @@ -9,48 +9,56 @@ $Library = Get-Content -Path configure.ac | select -skip 3 -first 1 | % { $_ -Re $Version = Get-Content -Path configure.ac | select -skip 4 -first 1 | % { $_ -Replace " \[","" } | % { $_ -Replace "\],","" } $Prefix = ${Library}.Substring(3) -Get-Content -Path "include\${Library}.h.in" > "include\${Library}.h" -Get-Content -Path "include\${Library}\definitions.h.in" | % { $_ -Replace "@VERSION@","${Version}" } > "include\${Library}\definitions.h" -Get-Content -Path "include\${Library}\features.h.in" | % { $_ -Replace "@[A-Z0-9_]*@","0" } > "include\${Library}\features.h" -Get-Content -Path "include\${Library}\types.h.in" | % { $_ -Replace "@[A-Z0-9_]*@","0" } > "include\${Library}\types.h" -Get-Content -Path "common\types.h.in" | % { $_ -Replace "@PACKAGE@","${Library}" } > "common\types.h" -Get-Content -Path "${Library}\${Library}_definitions.h.in" | % { $_ -Replace "@VERSION@","${Version}" } > "${Library}\${Library}_definitions.h" -Get-Content -Path "${Library}\${Library}.rc.in" | % { $_ -Replace "@VERSION@","${Version}" } > "${Library}\${Library}.rc" +Get-Content -Path "include\${Library}.h.in" | Out-File -Encoding ascii "include\${Library}.h" +Get-Content -Path "include\${Library}\definitions.h.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "include\${Library}\definitions.h" +Get-Content -Path "include\${Library}\features.h.in" | % { $_ -Replace "@[A-Z0-9_]*@","0" } | Out-File -Encoding ascii "include\${Library}\features.h" +Get-Content -Path "include\${Library}\types.h.in" | % { $_ -Replace "@[A-Z0-9_]*@","0" } | Out-File -Encoding ascii "include\${Library}\types.h" +Get-Content -Path "common\types.h.in" | % { $_ -Replace "@PACKAGE@","${Library}" } | Out-File -Encoding ascii "common\types.h" +Get-Content -Path "${Library}\${Library}_definitions.h.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Library}\${Library}_definitions.h" +Get-Content -Path "${Library}\${Library}.rc.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Library}\${Library}.rc" + +If (Test-Path "setup.cfg.in") +{ + Get-Content -Path "setup.cfg.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "setup.cfg" +} If (Test-Path "${Prefix}.net") { - Get-Content -Path "${Prefix}.net\${Prefix}.net.rc.in" | % { $_ -Replace "@VERSION@","${Version}" } > "${Prefix}.net\${Prefix}.net.rc" + Get-Content -Path "${Prefix}.net\${Prefix}.net.rc.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Prefix}.net\${Prefix}.net.rc" } $NamePrefix = "" -ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.l") +ForEach (${Library} in Get-ChildItem -Directory -Path "lib*") { - $OutputFile = ${DirectoryElement} -Replace ".l$",".c" + ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.l") + { + $OutputFile = ${DirectoryElement} -Replace ".l$",".c" - $NamePrefix = Split-Path -path ${DirectoryElement} -leaf - $NamePrefix = ${NamePrefix} -Replace ".l$","_" + $NamePrefix = Split-Path -path ${DirectoryElement} -leaf + $NamePrefix = ${NamePrefix} -Replace ".l$","_" - Write-Host "Running: ${WinFlex} -Cf ${DirectoryElement}" + Write-Host "Running: ${WinFlex} -Cf ${DirectoryElement}" - # PowerShell will raise NativeCommandError if win_flex writes to stdout or stderr - # therefore 2>&1 is added and the output is stored in a variable. - $Output = Invoke-Expression -Command "& '${WinFlex}' -Cf ${DirectoryElement} 2>&1" - Write-Host ${Output} + # PowerShell will raise NativeCommandError if win_flex writes to stdout or stderr + # therefore 2>&1 is added and the output is stored in a variable. + $Output = Invoke-Expression -Command "& '${WinFlex}' -Cf ${DirectoryElement} 2>&1" + Write-Host ${Output} - # Moving manually since win_flex -o does not provide the expected behavior. - Move-Item "lex.yy.c" ${OutputFile} -force -} + # Moving manually since `win_flex -o filename' does not provide the expected behavior. + Move-Item "lex.yy.c" ${OutputFile} -force + } -ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.y") -{ - $OutputFile = ${DirectoryElement} -Replace ".y$",".c" + ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.y") + { + $OutputFile = ${DirectoryElement} -Replace ".y$",".c" - Write-Host "Running: ${WinBison} -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement}" + Write-Host "Running: ${WinBison} -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement}" - # PowerShell will raise NativeCommandError if win_bison writes to stdout or stderr - # therefore 2>&1 is added and the output is stored in a variable. - $Output = Invoke-Expression -Command "& '${WinBison}' -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement} 2>&1" - Write-Host ${Output} + # PowerShell will raise NativeCommandError if win_bison writes to stdout or stderr + # therefore 2>&1 is added and the output is stored in a variable. + $Output = Invoke-Expression -Command "& '${WinBison}' -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement} 2>&1" + Write-Host ${Output} + } } diff --git a/configure.ac b/configure.ac index a8b07b0..d99b9a7 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.71]) AC_INIT( [libclocale], - [20240107], + [20240324], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( diff --git a/m4/common.m4 b/m4/common.m4 index f578de1..71c18b8 100644 --- a/m4/common.m4 +++ b/m4/common.m4 @@ -1,6 +1,6 @@ dnl Checks for common headers and functions dnl -dnl Version: 20181117 +dnl Version: 20240308 dnl Function to test if a certain feature was disabled AC_DEFUN([AX_COMMON_ARG_DISABLE], @@ -26,7 +26,7 @@ AC_DEFUN([AX_COMMON_ARG_ENABLE], [$1], [AS_HELP_STRING( [--enable-$1], - [$3 [default=$4]])], + [$3 @<:@default=$4@:>@])], [ac_cv_enable_$2=$enableval], [ac_cv_enable_$2=$4])dnl @@ -43,7 +43,7 @@ AC_DEFUN([AX_COMMON_ARG_WITH], [$1], [AS_HELP_STRING( [--with-$1[[=$5]]], - [$3 [default=$4]])], + [$3 @<:@default=$4@:>@])], [ac_cv_with_$2=$withval], [ac_cv_with_$2=$4])dnl diff --git a/m4/libcerror.m4 b/m4/libcerror.m4 index 755722f..87af3e1 100644 --- a/m4/libcerror.m4 +++ b/m4/libcerror.m4 @@ -1,6 +1,6 @@ dnl Checks for libcerror required headers and functions dnl -dnl Version: 20190308 +dnl Version: 20240314 dnl Function to detect if libcerror is available dnl ac_libcerror_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -10,8 +10,10 @@ AC_DEFUN([AX_LIBCERROR_CHECK_LIB], [ac_cv_libcerror=no], [ac_cv_libcerror=check dnl Check if the directory provided as parameter exists + dnl For both --with-libcerror which returns "yes" and --with-libcerror= which returns "" + dnl treat them as auto-detection. AS_IF( - [test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect], + [test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect && test "x$ac_cv_with_libcerror" != xyes], [AS_IF( [test -d "$ac_cv_with_libcerror"], [CFLAGS="$CFLAGS -I${ac_cv_with_libcerror}/include" @@ -99,8 +101,9 @@ AC_DEFUN([AX_LIBCERROR_CHECK_LIB], ac_cv_libcerror_LIBADD="-lcerror"]) ]) + AS_IF( - [test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect && test "x$ac_cv_libcerror" != xyes], + [test "x$ac_cv_libcerror" != xyes && test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect && test "x$ac_cv_with_libcerror" != xyes], [AC_MSG_FAILURE( [unable to find supported libcerror in directory: $ac_cv_with_libcerror], [1])