Skip to content

Commit

Permalink
Applied updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Apr 12, 2024
1 parent 98adfd4 commit 8a91e0c
Show file tree
Hide file tree
Showing 9 changed files with 232 additions and 205 deletions.
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ install:
- cmd: if [%BUILD_ENVIRONMENT%]==[python-tox] (
"%PYTHON%" -m pip install -U tox twine )
- sh: if test `uname -s` = "Darwin" && test ${BUILD_ENVIRONMENT} = "python-tox"; then brew install -q python@${PYTHON_VERSION} tox twine-pypi || true; fi
- sh: if test `uname -s` = "Linux" && test ${BUILD_ENVIRONMENT} = "python-tox"; then sudo apt-get update && sudo apt-get -y install autoconf automake autopoint build-essential git libtool patchelf pkg-config python3 python3-dev python3-distutils python3-pip python3-setuptools tox twine; fi
- sh: if test `uname -s` = "Linux" && test ${BUILD_ENVIRONMENT} = "python-tox"; then sudo apt-get update && sudo apt-get -y install autoconf automake autopoint build-essential flex git libtool patchelf pkg-config python3 python3-dev python3-distutils python3-pip python3-setuptools tox twine; 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] (
Expand All @@ -272,7 +272,7 @@ build_script:
- cmd: if [%BUILD_ENVIRONMENT%]==[python-tox] (
"%PYTHON%" -m tox -e%TOXENV% )
- sh: if test `uname -s` = "Darwin" && test ${BUILD_ENVIRONMENT} = "python-tox"; then export PATH="/usr/local/opt/gettext/bin:$PATH"; export SED="/usr/local/bin/gsed"; ./synclibs.sh && ./autogen.sh && ./configure --disable-nls --disable-shared-libs && make sources >/dev/null && tox -e${TOXENV}; fi
- sh: if test `uname -s` = "Linux" && test ${BUILD_ENVIRONMENT} = "python-tox"; then ./synclibs.sh && ./autogen.sh && ./configure --disable-nls --disable-shared-libs && make sources >/dev/null && tox -e${TOXENV} && tox -eauditwheel -- --plat ${AUDITWHEEL_PLAT} dist/*.whl; fi
- sh: if test `uname -s` = "Linux" && test ${BUILD_ENVIRONMENT} = "python-tox"; then ./synclibs.sh && ./autogen.sh && ./configure --disable-nls --disable-shared-libs && make sources >/dev/null && tox -e${TOXENV} && tox -eauditwheel -- --plat ${AUDITWHEEL_PLAT} dist/*.whl && rm -f dist/*.whl && mv wheelhouse/*.whl dist/; fi
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] (
xcopy /i /q /s C:\projects\libfwnt C:\cygwin64\home\appveyor\libfwnt &&
C:\cygwin64\bin\bash -e -l -c "cd libfwnt && wget -q 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -O './config.guess' && wget -q 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -O './config.sub'" &&
Expand Down
45 changes: 24 additions & 21 deletions autogen.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Script to generate the necessary files for a msvscpp build
#
# Version: 20230118
# Version: 20240306

$WinFlex = "..\win_flex_bison\win_flex.exe"
$WinBison = "..\win_flex_bison\win_bison.exe"
Expand Down Expand Up @@ -29,33 +29,36 @@ If (Test-Path "${Prefix}.net")

$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 filename' 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}
}
}

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ([2.71])

AC_INIT(
[libfwnt],
[20240126],
[20240412],
[joachim.metz@gmail.com])

AC_CONFIG_SRCDIR(
Expand Down
6 changes: 3 additions & 3 deletions m4/common.m4
Original file line number Diff line number Diff line change
@@ -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],
Expand All @@ -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
Expand All @@ -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
Expand Down
9 changes: 6 additions & 3 deletions m4/libcdata.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dnl Checks for libcdata required headers and functions
dnl
dnl Version: 20230108
dnl Version: 20240314

dnl Function to detect if libcdata is available
dnl ac_libcdata_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
Expand All @@ -10,8 +10,10 @@ AC_DEFUN([AX_LIBCDATA_CHECK_LIB],
[ac_cv_libcdata=no],
[ac_cv_libcdata=check
dnl Check if the directory provided as parameter exists
dnl For both --with-libcdata which returns "yes" and --with-libcdata= which returns ""
dnl treat them as auto-detection.
AS_IF(
[test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect],
[test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect && test "x$ac_cv_with_libcdata" != xyes],
[AS_IF(
[test -d "$ac_cv_with_libcdata"],
[CFLAGS="$CFLAGS -I${ac_cv_with_libcdata}/include"
Expand Down Expand Up @@ -497,8 +499,9 @@ AC_DEFUN([AX_LIBCDATA_CHECK_LIB],
ac_cv_libcdata_LIBADD="-lcdata"])
])
AS_IF(
[test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect && test "x$ac_cv_libcdata" != xyes],
[test "x$ac_cv_libcdata" != xyes && test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect && test "x$ac_cv_with_libcdata" != xyes],
[AC_MSG_FAILURE(
[unable to find supported libcdata in directory: $ac_cv_with_libcdata],
[1])
Expand Down
9 changes: 6 additions & 3 deletions m4/libcerror.m4
Original file line number Diff line number Diff line change
@@ -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<library> arguments
Expand All @@ -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"
Expand Down Expand Up @@ -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])
Expand Down
9 changes: 6 additions & 3 deletions m4/libcnotify.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dnl Checks for libcnotify required headers and functions
dnl
dnl Version: 20190308
dnl Version: 20240314

dnl Function to detect if libcnotify is available
dnl ac_libcnotify_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
Expand All @@ -10,8 +10,10 @@ AC_DEFUN([AX_LIBCNOTIFY_CHECK_LIB],
[ac_cv_libcnotify=no],
[ac_cv_libcnotify=check
dnl Check if the directory provided as parameter exists
dnl For both --with-libcnotify which returns "yes" and --with-libcnotify= which returns ""
dnl treat them as auto-detection.
AS_IF(
[test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect],
[test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect && test "x$ac_cv_with_libcnotify" != xyes],
[AS_IF(
[test -d "$ac_cv_with_libcnotify"],
[CFLAGS="$CFLAGS -I${ac_cv_with_libcnotify}/include"
Expand Down Expand Up @@ -96,8 +98,9 @@ AC_DEFUN([AX_LIBCNOTIFY_CHECK_LIB],
ac_cv_libcnotify_LIBADD="-lcnotify"])
])
AS_IF(
[test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect && test "x$ac_cv_libcnotify" != xyes],
[test "x$ac_with_libcnotify" != xyes && test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect && test "x$ac_cv_with_libcnotify" != xyes],
[AC_MSG_FAILURE(
[unable to find supported libcnotify in directory: $ac_cv_with_libcnotify],
[1])
Expand Down
8 changes: 5 additions & 3 deletions m4/libcthreads.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dnl Checks for libcthreads required headers and functions
dnl
dnl Version: 20190308
dnl Version: 20240314

dnl Function to detect if libcthreads is available
dnl ac_libcthreads_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
Expand All @@ -10,8 +10,10 @@ AC_DEFUN([AX_LIBCTHREADS_CHECK_LIB],
[ac_cv_libcthreads=no],
[ac_cv_libcthreads=check
dnl Check if the directory provided as parameter exists
dnl For both --with-libcthreads which returns "yes" and --with-libcthreads= which returns ""
dnl treat them as auto-detection.
AS_IF(
[test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect],
[test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect && test "x$ac_cv_with_libcthreads" != xyes],
[AS_IF(
[test -d "$ac_cv_with_libcthreads"],
[CFLAGS="$CFLAGS -I${ac_cv_with_libcthreads}/include"
Expand Down Expand Up @@ -248,7 +250,7 @@ AC_DEFUN([AX_LIBCTHREADS_CHECK_LIB],
])
AS_IF(
[test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect && test "x$ac_cv_libcthreads" != xyes],
[test "x$ac_cv_libcthreads" != xyes && test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect && test "x$ac_cv_with_libcthreads" != xyes],
[AC_MSG_FAILURE(
[unable to find supported libcthreads in directory: $ac_cv_with_libcthreads],
[1])
Expand Down
Loading

0 comments on commit 8a91e0c

Please sign in to comment.