From 86561ff0344931d500142bf12b4c9200023c42cb Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Tue, 23 Apr 2024 06:34:36 +0200 Subject: [PATCH] Changes for deployment --- .github/workflows/build.yml | 35 ++++++++++++++++++++++++----- .github/workflows/build_freebsd.yml | 2 +- .github/workflows/build_shared.yml | 2 +- .github/workflows/build_wheel.yml | 2 +- .gitignore | 1 + Makefile.am | 23 ++++++++----------- appveyor.yml | 14 +++++++++--- common/Makefile.am | 13 +++++------ configure.ac | 2 +- include/Makefile.am | 14 +++++------- liblnk.nuspec | 4 ++-- liblnk/Makefile.am | 14 +++++------- lnktools/Makefile.am | 10 ++++----- m4/libbfio.m4 | 6 ++--- m4/libcdata.m4 | 6 ++--- m4/libcerror.m4 | 6 ++--- m4/libcfile.m4 | 6 ++--- m4/libclocale.m4 | 6 ++--- m4/libcnotify.m4 | 6 ++--- m4/libcpath.m4 | 6 ++--- m4/libcsplit.m4 | 6 ++--- m4/libcthreads.m4 | 6 ++--- m4/libfdatetime.m4 | 6 ++--- m4/libfguid.m4 | 6 ++--- m4/libfole.m4 | 11 +++++---- m4/libfwps.m4 | 10 +++++---- m4/libfwsi.m4 | 11 +++++---- m4/libuna.m4 | 6 ++--- m4/python.m4 | 10 +++++---- manuals/Makefile.am | 6 ++--- msvscpp/Makefile.am | 6 ++--- ossfuzz/Makefile.am | 10 ++++----- pylnk/Makefile.am | 10 ++++----- synclibs.sh | 11 ++++----- tests/Makefile.am | 13 +++++------ tests/test_library.sh | 9 +++----- tests/test_lnkinfo.sh | 9 +++----- tests/test_manpage.sh | 9 +++----- tests/test_python_module.sh | 26 +++++++++++++-------- tests/test_tools.sh | 9 +++----- 40 files changed, 194 insertions(+), 174 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ebfd381d..96096e98 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: compiler: 'gcc' configure_options: '--enable-static-executables=yes --enable-multi-threading-support=no' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install build dependencies run: | sudo apt-get -y install autoconf automake autopoint build-essential git libtool pkg-config @@ -42,6 +42,30 @@ jobs: - name: Run tests run: | tests/runtests.sh + build_dist: + runs-on: ubuntu-22.04 + strategy: + matrix: + include: + - architecture: 'x64' + compiler: 'gcc' + configure_options: '' + steps: + - uses: actions/checkout@v4 + - name: Install build dependencies + run: | + sudo apt-get -y install autoconf automake autopoint build-essential git libtool pkg-config + - name: Download test data + run: | + if test -x "synctestdata.sh"; then ./synctestdata.sh; fi + - name: Building from source + env: + CC: ${{ matrix.compiler }} + run: | + tests/build.sh ${{ matrix.configure_options }} + - name: Run tests + run: | + make distcheck build_python_ubuntu: runs-on: ubuntu-22.04 strategy: @@ -52,7 +76,7 @@ jobs: configure_options: '--enable-python' python_version: '' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install build dependencies run: | sudo add-apt-repository universe && @@ -81,7 +105,7 @@ jobs: configure_options: '' python-version: '3.10' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: @@ -111,7 +135,7 @@ jobs: compiler: 'gcc' configure_options: '--enable-wide-character-type' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install build dependencies run: | sudo apt-get -y install autoconf automake autopoint build-essential git libtool pkg-config @@ -132,6 +156,7 @@ jobs: (cd ${DIRECTORY} && find . -maxdepth 1 -name \*.gcno -type f -exec gcov -pb {} \;) \ done - name: Upload coverage report to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: name: linux-${{ matrix.architecture }}-gcc-no-optimization + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/build_freebsd.yml b/.github/workflows/build_freebsd.yml index 53b87c8e..b0b664c0 100644 --- a/.github/workflows/build_freebsd.yml +++ b/.github/workflows/build_freebsd.yml @@ -6,7 +6,7 @@ jobs: build_freebsd: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Building from source id: build_freebsd uses: vmactions/freebsd-vm@v1 diff --git a/.github/workflows/build_shared.yml b/.github/workflows/build_shared.yml index d0bff2f4..44031f02 100644 --- a/.github/workflows/build_shared.yml +++ b/.github/workflows/build_shared.yml @@ -17,7 +17,7 @@ jobs: compiler: 'gcc' configure_options: '--enable-wide-character-type' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install build dependencies run: | sudo apt-get -y install autoconf automake autopoint build-essential git libtool pkg-config diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index 15c13bf9..d98d681e 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -21,7 +21,7 @@ jobs: - python-version: '3.12' toxenv: 'py312' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install build dependencies run: | sudo add-apt-repository universe && diff --git a/.gitignore b/.gitignore index 3995c5e7..be7c85ae 100644 --- a/.gitignore +++ b/.gitignore @@ -149,6 +149,7 @@ stamp-h[1-9] /tests/lnk_test_tools_output /tests/lnk_test_tools_path_string /tests/lnk_test_tools_signal +/tests/notify_stream.log /tests/tmp* # Local library dependencies specific files diff --git a/Makefile.am b/Makefile.am index 8ffcedfb..7d3db785 100644 --- a/Makefile.am +++ b/Makefile.am @@ -64,8 +64,15 @@ EXTRA_DIST = \ $(SETUP_PY_FILES) \ $(SPEC_FILES) -MAINTAINERCLEANFILES = \ - Makefile.in +DISTCLEANFILES = \ + config.status \ + config.cache \ + config.log \ + liblnk.pc \ + liblnk.spec \ + Makefile \ + Makefile.in \ + po/Makevars pkgconfigdir = $(libdir)/pkgconfig @@ -97,15 +104,3 @@ library: (cd $(srcdir)/liblnk && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/po && $(MAKE) $(AM_MAKEFLAGS)) -distclean: clean - -rm -f Makefile - -rm -f config.status - -rm -f config.cache - -rm -f config.log - -rm -f liblnk.pc - -rm -f liblnk.spec - @for dir in ${subdirs}; do \ - (cd $$dir && $(MAKE) distclean) \ - || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" - diff --git a/appveyor.yml b/appveyor.yml index b1bda065..7380060f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ environment: nuget_token: - secure: l8kGPdWSs3RTcW6B+mgcT8ByCdVvXx6HbWPNd8nnqoUDhku8g507tpxla7LUPDOM + secure: xFlOodfYttki8HxA1hdhVhQ2lkVbj1EA1FxP9T1il2MUsBfH1rPEbTZy+etaMTD8 PYPI_TOKEN: secure: VHuZiUWgTqTciKE2nsv/LnOzyM4uRdrNKBIdRDMmLDusmU2artgxHGP07emAy+w4uqx0yIn6p2YpJz6Kk9VaNyY92bNcH6XfudcwiiHNx5YodywIlLablGAwO85gHT5Acr7rJVvBErJcex8mM+bfkiLQTTXQlMBT3q2PtGwhImCGWRzdE08qJLfzEjcrgrYrpWcYntto6MTsLHI8OB+Pij8Ha2kHuw1kEb0VUzDasfi+gMTquzev4L3mOW3wbnPBdWzW5h3TWb7rcGrpMXiXRg== matrix: @@ -249,11 +249,19 @@ environment: CFLAGS: "--coverage -O0" CPPFLAGS: "-DOPTIMIZATION_DISABLED" LDFLAGS: "--coverage" + - TARGET: mingw-w64-gcc-python + BUILD_ENVIRONMENT: mingw-w64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 + CONFIGURE_OPTIONS: "--enable-python" - TARGET: mingw-w64-gcc-static-executables BUILD_ENVIRONMENT: mingw-w64 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 CONFIGURE_OPTIONS: "--enable-static-executables" +matrix: + allow_failures: + - TARGET: mingw-w64-gcc-python + install: - cmd: if [%BUILD_ENVIRONMENT%]==[msbuild] ( git clone https://github.com/libyal/vstools.git ..\vstools ) @@ -266,9 +274,9 @@ install: - 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] ( - C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P gettext-devel -P wget -P python3-devel ) + C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P gettext-devel -P python3-devel -P wget ) - cmd: if [%BUILD_ENVIRONMENT%]==[mingw-w64] ( - C:\msys64\usr\bin\pacman -S --noconfirm --needed autoconf automake gettext-devel libtool make mingw-w64-x86_64-gcc ) + C:\msys64\usr\bin\pacman -S --noconfirm --needed autoconf automake gettext-devel libtool make mingw-w64-x86_64-gcc mingw-w64-x86_64-python3 ) - ps: If ( ( "cygwin64-gcc-no-optimization", "mingw-w64-gcc-no-optimization" ).Contains( $env:TARGET ) ) { $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile ..\codecov.exe } diff --git a/common/Makefile.am b/common/Makefile.am index 2433a75e..f7aa5243 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,4 +1,5 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include +AM_CPPFLAGS = \ + -I../include -I$(top_srcdir)/include EXTRA_DIST = \ byte_stream.h \ @@ -15,11 +16,9 @@ EXTRA_DIST = \ types.h.in \ wide_string.h -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + config.h \ + types.h \ + Makefile \ Makefile.in -distclean: clean - -rm -f config.h - -rm -f types.h - -rm -f Makefile - diff --git a/configure.ac b/configure.ac index 2cd1cbde..625e7c1b 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.71]) AC_INIT( [liblnk], - [20240310], + [20240423], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( diff --git a/include/Makefile.am b/include/Makefile.am index f8f32d3a..0cc2b9a3 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -15,13 +15,11 @@ EXTRA_DIST = \ liblnk/features.h.in \ liblnk/types.h.in -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + liblnk.h \ + liblnk/definitions.h \ + liblnk/features.h \ + liblnk/types.h \ + Makefile \ Makefile.in -distclean: clean - -rm -f liblnk.h - -rm -f liblnk/definitions.h - -rm -f liblnk/features.h - -rm -f liblnk/types.h - -rm -f Makefile - diff --git a/liblnk.nuspec b/liblnk.nuspec index dbb787ef..6d394e18 100644 --- a/liblnk.nuspec +++ b/liblnk.nuspec @@ -2,7 +2,7 @@ liblnk - 20240310 + 20240423 Joachim Metz joachimmetz LGPL-3.0-or-later @@ -10,7 +10,7 @@ false liblnk Library to access the Windows Shortcut File (LNK) format - Release of liblnk 20240310 + Release of liblnk 20240423 Copyright (C) 2009-2024 native diff --git a/liblnk/Makefile.am b/liblnk/Makefile.am index b85a557a..a8300224 100644 --- a/liblnk/Makefile.am +++ b/liblnk/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/common \ + -I../include -I$(top_srcdir)/include \ + -I../common -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCTHREADS_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @@ -86,14 +86,12 @@ EXTRA_DIST = \ liblnk.rc \ liblnk.rc.in -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + liblnk_definitions.h \ + liblnk.rc \ + Makefile \ Makefile.in -distclean: clean - -rm -f liblnk_definitions.h - -rm -f liblnk.rc - -rm -f Makefile - sources-local: $(BUILT_SOURCES) splint-local: diff --git a/lnktools/Makefile.am b/lnktools/Makefile.am index 08f4f6f5..afdd2019 100644 --- a/lnktools/Makefile.am +++ b/lnktools/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/common \ + -I../include -I$(top_srcdir)/include \ + -I../common -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @@ -58,12 +58,10 @@ lnkinfo_LDADD = \ @LIBCERROR_LIBADD@ \ @LIBINTL@ -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + Makefile \ Makefile.in -distclean: clean - -rm -f Makefile - splint-local: @echo "Running splint on lnkinfo ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(lnkinfo_SOURCES) diff --git a/m4/libbfio.m4 b/m4/libbfio.m4 index 1e222595..112bac64 100644 --- a/m4/libbfio.m4 +++ b/m4/libbfio.m4 @@ -1,6 +1,6 @@ dnl Checks for libbfio required headers and functions dnl -dnl Version: 20240308 +dnl Version: 20240413 dnl Function to detect if libbfio is available dnl ac_libbfio_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -324,7 +324,7 @@ AC_DEFUN([AX_LIBBFIO_CHECK_LIB], ]) AS_IF( - [test "x$ac_cv_with_libbfio" != x && test "x$ac_cv_with_libbfio" != xauto-detect && test "x$ac_cv_with_libbfio" != xyes], + [test "x$ac_cv_libbfio" != xyes && test "x$ac_cv_with_libbfio" != x && test "x$ac_cv_with_libbfio" != xauto-detect && test "x$ac_cv_with_libbfio" != xyes], [AC_MSG_FAILURE( [unable to find supported libbfio in directory: $ac_cv_with_libbfio], [1]) @@ -354,7 +354,7 @@ dnl Function to detect if libbfio dependencies are available AC_DEFUN([AX_LIBBFIO_CHECK_LOCAL], [dnl No additional checks. - ac_cv_libbfio_CPPFLAGS="-I../libbfio"; + ac_cv_libbfio_CPPFLAGS="-I../libbfio -I\$(top_srcdir)/libbfio"; ac_cv_libbfio_LIBADD="../libbfio/libbfio.la"; ac_cv_libbfio=local diff --git a/m4/libcdata.m4 b/m4/libcdata.m4 index 309ec517..aa01d932 100644 --- a/m4/libcdata.m4 +++ b/m4/libcdata.m4 @@ -1,6 +1,6 @@ dnl Checks for libcdata required headers and functions dnl -dnl Version: 20240308 +dnl Version: 20240413 dnl Function to detect if libcdata is available dnl ac_libcdata_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -501,7 +501,7 @@ AC_DEFUN([AX_LIBCDATA_CHECK_LIB], ]) AS_IF( - [test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect && test "x$ac_cv_with_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]) @@ -531,7 +531,7 @@ dnl Function to detect if libcdata dependencies are available AC_DEFUN([AX_LIBCDATA_CHECK_LOCAL], [dnl No additional checks. - ac_cv_libcdata_CPPFLAGS="-I../libcdata"; + ac_cv_libcdata_CPPFLAGS="-I../libcdata -I\$(top_srcdir)/libcdata"; ac_cv_libcdata_LIBADD="../libcdata/libcdata.la"; ac_cv_libcdata=local diff --git a/m4/libcerror.m4 b/m4/libcerror.m4 index 7d7f40fb..e9abcdbc 100644 --- a/m4/libcerror.m4 +++ b/m4/libcerror.m4 @@ -1,6 +1,6 @@ dnl Checks for libcerror required headers and functions dnl -dnl Version: 20240308 +dnl Version: 20240413 dnl Function to detect if libcerror is available dnl ac_libcerror_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -103,7 +103,7 @@ AC_DEFUN([AX_LIBCERROR_CHECK_LIB], ]) AS_IF( - [test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect && test "x$ac_cv_with_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]) @@ -169,7 +169,7 @@ AC_DEFUN([AX_LIBCERROR_CHECK_LOCAL], ]) ]) - ac_cv_libcerror_CPPFLAGS="-I../libcerror"; + ac_cv_libcerror_CPPFLAGS="-I../libcerror -I\$(top_srcdir)/libcerror"; ac_cv_libcerror_LIBADD="../libcerror/libcerror.la"; ac_cv_libcerror=local diff --git a/m4/libcfile.m4 b/m4/libcfile.m4 index 5596e9c2..81ac5f14 100644 --- a/m4/libcfile.m4 +++ b/m4/libcfile.m4 @@ -1,6 +1,6 @@ dnl Checks for libcfile required headers and functions dnl -dnl Version: 20240308 +dnl Version: 20240413 dnl Function to detect if libcfile is available dnl ac_libcfile_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -207,7 +207,7 @@ AC_DEFUN([AX_LIBCFILE_CHECK_LIB], ]) AS_IF( - [test "x$ac_cv_with_libcfile" != x && test "x$ac_cv_with_libcfile" != xauto-detect && test "x$ac_cv_with_libcfile" != xyes], + [test "x$ac_cv_libcfile" != xyes && test "x$ac_cv_with_libcfile" != x && test "x$ac_cv_with_libcfile" != xauto-detect && test "x$ac_cv_with_libcfile" != xyes], [AC_MSG_FAILURE( [unable to find supported libcfile in directory: $ac_cv_with_libcfile], [1]) @@ -361,7 +361,7 @@ AC_DEFUN([AX_LIBCFILE_CHECK_LOCAL], [1]) ]) - ac_cv_libcfile_CPPFLAGS="-I../libcfile"; + ac_cv_libcfile_CPPFLAGS="-I../libcfile -I\$(top_srcdir)/libcfile"; ac_cv_libcfile_LIBADD="../libcfile/libcfile.la"; ac_cv_libcfile=local diff --git a/m4/libclocale.m4 b/m4/libclocale.m4 index d82d1fd2..bd5a10e5 100644 --- a/m4/libclocale.m4 +++ b/m4/libclocale.m4 @@ -1,6 +1,6 @@ dnl Checks for libclocale required headers and functions dnl -dnl Version: 20240308 +dnl Version: 20240413 dnl Function to detect if libclocale is available dnl ac_libclocale_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -130,7 +130,7 @@ AC_DEFUN([AX_LIBCLOCALE_CHECK_LIB], ]) AS_IF( - [test "x$ac_cv_with_libclocale" != x && test "x$ac_cv_with_libclocale" != xauto-detect && test "x$ac_cv_with_libclocale" != xyes], + [test "x$ac_cv_libclocale" != xyes && test "x$ac_cv_with_libclocale" != x && test "x$ac_cv_with_libclocale" != xauto-detect && test "x$ac_cv_with_libclocale" != xyes], [AC_MSG_FAILURE( [unable to find supported libclocale in directory: $ac_cv_with_libclocale], [1]) @@ -223,7 +223,7 @@ AC_DEFUN([AX_LIBCLOCALE_CHECK_LOCAL], AX_LIBCLOCALE_CHECK_FUNC_LANGINFO_CODESET - ac_cv_libclocale_CPPFLAGS="-I../libclocale"; + ac_cv_libclocale_CPPFLAGS="-I../libclocale -I\$(top_srcdir)/libclocale"; ac_cv_libclocale_LIBADD="../libclocale/libclocale.la"; ac_cv_libclocale=local diff --git a/m4/libcnotify.m4 b/m4/libcnotify.m4 index 41cf9e80..e382bdb0 100644 --- a/m4/libcnotify.m4 +++ b/m4/libcnotify.m4 @@ -1,6 +1,6 @@ dnl Checks for libcnotify required headers and functions dnl -dnl Version: 20240308 +dnl Version: 20240413 dnl Function to detect if libcnotify is available dnl ac_libcnotify_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -100,7 +100,7 @@ AC_DEFUN([AX_LIBCNOTIFY_CHECK_LIB], ]) AS_IF( - [test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect && test "x$ac_cv_with_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]) @@ -141,7 +141,7 @@ AC_DEFUN([AX_LIBCNOTIFY_CHECK_LOCAL], dnl Headers included in libcnotify/libcnotify_stream.c AC_CHECK_HEADERS([errno.h]) - ac_cv_libcnotify_CPPFLAGS="-I../libcnotify"; + ac_cv_libcnotify_CPPFLAGS="-I../libcnotify -I\$(top_srcdir)/libcnotify"; ac_cv_libcnotify_LIBADD="../libcnotify/libcnotify.la"; ac_cv_libcnotify=local diff --git a/m4/libcpath.m4 b/m4/libcpath.m4 index 7001a053..bf44d46e 100644 --- a/m4/libcpath.m4 +++ b/m4/libcpath.m4 @@ -1,6 +1,6 @@ dnl Checks for libcpath required headers and functions dnl -dnl Version: 20240308 +dnl Version: 20240413 dnl Function to detect if libcpath is available dnl ac_libcpath_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -156,7 +156,7 @@ AC_DEFUN([AX_LIBCPATH_CHECK_LIB], ]) AS_IF( - [test "x$ac_cv_with_libcpath" != x && test "x$ac_cv_with_libcpath" != xauto-detect && test "x$ac_cv_with_libcpath" != xyes], + [test "x$ac_cv_libcpath" != xyes && test "x$ac_cv_with_libcpath" != x && test "x$ac_cv_with_libcpath" != xauto-detect && test "x$ac_cv_with_libcpath" != xyes], [AC_MSG_FAILURE( [unable to find supported libcpath in directory: $ac_cv_with_libcpath], [1]) @@ -276,7 +276,7 @@ AC_DEFUN([AX_LIBCPATH_CHECK_LOCAL], AX_LIBCPATH_CHECK_FUNC_MKDIR - ac_cv_libcpath_CPPFLAGS="-I../libcpath"; + ac_cv_libcpath_CPPFLAGS="-I../libcpath -I\$(top_srcdir)/libcpath"; ac_cv_libcpath_LIBADD="../libcpath/libcpath.la"; ac_cv_libcpath=local diff --git a/m4/libcsplit.m4 b/m4/libcsplit.m4 index 765360fa..1ac7b9f2 100644 --- a/m4/libcsplit.m4 +++ b/m4/libcsplit.m4 @@ -1,6 +1,6 @@ dnl Checks for libcsplit required headers and functions dnl -dnl Version: 20240308 +dnl Version: 20240413 dnl Function to detect if libcsplit is available dnl ac_libcsplit_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -151,7 +151,7 @@ AC_DEFUN([AX_LIBCSPLIT_CHECK_LIB], ]) AS_IF( - [test "x$ac_cv_with_libcsplit" != x && test "x$ac_cv_with_libcsplit" != xauto-detect && test "x$ac_cv_with_libcsplit" != xyes], + [test "x$ac_cv_libcsplit" != xyes && test "x$ac_cv_with_libcsplit" != x && test "x$ac_cv_with_libcsplit" != xauto-detect && test "x$ac_cv_with_libcsplit" != xyes], [AC_MSG_FAILURE( [unable to find supported libcsplit in directory: $ac_cv_with_libcsplit], [1]) @@ -181,7 +181,7 @@ dnl Function to detect if libcsplit dependencies are available AC_DEFUN([AX_LIBCSPLIT_CHECK_LOCAL], [dnl No additional checks. - ac_cv_libcsplit_CPPFLAGS="-I../libcsplit"; + ac_cv_libcsplit_CPPFLAGS="-I../libcsplit -I\$(top_srcdir)/libcsplit"; ac_cv_libcsplit_LIBADD="../libcsplit/libcsplit.la"; ac_cv_libcsplit=local diff --git a/m4/libcthreads.m4 b/m4/libcthreads.m4 index 6503ce53..c9c4e46a 100644 --- a/m4/libcthreads.m4 +++ b/m4/libcthreads.m4 @@ -1,6 +1,6 @@ dnl Checks for libcthreads required headers and functions dnl -dnl Version: 20240308 +dnl Version: 20240413 dnl Function to detect if libcthreads is available dnl ac_libcthreads_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -250,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_with_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]) @@ -292,7 +292,7 @@ AC_DEFUN([AX_LIBCTHREADS_CHECK_LOCAL], AS_IF( [test "x$ac_cv_libcthreads_multi_threading" != xno], - [ac_cv_libcthreads_CPPFLAGS="-I../libcthreads"; + [ac_cv_libcthreads_CPPFLAGS="-I../libcthreads -I\$(top_srcdir)/libcthreads"; ac_cv_libcthreads_LIBADD="../libcthreads/libcthreads.la"; ac_cv_libcthreads=local], diff --git a/m4/libfdatetime.m4 b/m4/libfdatetime.m4 index 13b8cf36..d8f1066e 100644 --- a/m4/libfdatetime.m4 +++ b/m4/libfdatetime.m4 @@ -1,6 +1,6 @@ dnl Checks for libfdatetime required headers and functions dnl -dnl Version: 20240308 +dnl Version: 20240413 dnl Function to detect if libfdatetime is available dnl ac_libfdatetime_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -463,7 +463,7 @@ AC_DEFUN([AX_LIBFDATETIME_CHECK_LIB], ]) AS_IF( - [test "x$ac_cv_with_libfdatetime" != x && test "x$ac_cv_with_libfdatetime" != xauto-detect && test "x$ac_cv_with_libfdatetime" != xyes], + [test "x$ac_cv_libfdatetime" != xyes && test "x$ac_cv_with_libfdatetime" != x && test "x$ac_cv_with_libfdatetime" != xauto-detect && test "x$ac_cv_with_libfdatetime" != xyes], [AC_MSG_FAILURE( [unable to find supported libfdatetime in directory: $ac_cv_with_libfdatetime], [1]) @@ -493,7 +493,7 @@ dnl Function to detect if libfdatetime dependencies are available AC_DEFUN([AX_LIBFDATETIME_CHECK_LOCAL], [dnl No additional checks. - ac_cv_libfdatetime_CPPFLAGS="-I../libfdatetime"; + ac_cv_libfdatetime_CPPFLAGS="-I../libfdatetime -I\$(top_srcdir)/libfdatetime"; ac_cv_libfdatetime_LIBADD="../libfdatetime/libfdatetime.la"; ac_cv_libfdatetime=local diff --git a/m4/libfguid.m4 b/m4/libfguid.m4 index 6d1cd724..5e44bb63 100644 --- a/m4/libfguid.m4 +++ b/m4/libfguid.m4 @@ -1,6 +1,6 @@ dnl Checks for libfguid required headers and functions dnl -dnl Version: 20240308 +dnl Version: 20240413 dnl Function to detect if libfguid is available dnl ac_libfguid_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -111,7 +111,7 @@ AC_DEFUN([AX_LIBFGUID_CHECK_LIB], ]) AS_IF( - [test "x$ac_cv_with_libfguid" != x && test "x$ac_cv_with_libfguid" != xauto-detect && test "x$ac_cv_with_libfguid" != xyes], + [test "x$ac_cv_libfguid" != xyes && test "x$ac_cv_with_libfguid" != x && test "x$ac_cv_with_libfguid" != xauto-detect && test "x$ac_cv_with_libfguid" != xyes], [AC_MSG_FAILURE( [unable to find supported libfguid in directory: $ac_cv_with_libfguid], [1]) @@ -141,7 +141,7 @@ dnl Function to detect if libfguid dependencies are available AC_DEFUN([AX_LIBFGUID_CHECK_LOCAL], [dnl No additional checks. - ac_cv_libfguid_CPPFLAGS="-I../libfguid"; + ac_cv_libfguid_CPPFLAGS="-I../libfguid -I\$(top_srcdir)/libfguid"; ac_cv_libfguid_LIBADD="../libfguid/libfguid.la"; ac_cv_libfguid=local diff --git a/m4/libfole.m4 b/m4/libfole.m4 index e62b6660..e3a4b34d 100644 --- a/m4/libfole.m4 +++ b/m4/libfole.m4 @@ -1,6 +1,6 @@ dnl Checks for libfole required headers and functions dnl -dnl Version: 20190308 +dnl Version: 20240413 dnl Function to detect if libfole is available dnl ac_libfole_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -10,8 +10,10 @@ AC_DEFUN([AX_LIBFOLE_CHECK_LIB], [ac_cv_libfole=no], [ac_cv_libfole=check dnl Check if the directory provided as parameter exists + dnl For both --with-libfole which returns "yes" and --with-libfole= which returns "" + dnl treat them as auto-detection. AS_IF( - [test "x$ac_cv_with_libfole" != x && test "x$ac_cv_with_libfole" != xauto-detect], + [test "x$ac_cv_with_libfole" != x && test "x$ac_cv_with_libfole" != xauto-detect && test "x$ac_cv_with_libfole" != xyes], [AS_IF( [test -d "$ac_cv_with_libfole"], [CFLAGS="$CFLAGS -I${ac_cv_with_libfole}/include" @@ -57,8 +59,9 @@ AC_DEFUN([AX_LIBFOLE_CHECK_LIB], ac_cv_libfole_LIBADD="-lfole"]) ]) + AS_IF( - [test "x$ac_cv_with_libfole" != x && test "x$ac_cv_with_libfole" != xauto-detect && test "x$ac_cv_libfole" != xyes], + [test "x$ac_cv_libfole" != xyes && test "x$ac_cv_with_libfole" != x && test "x$ac_cv_with_libfole" != xauto-detect && test "x$ac_cv_with_libfole" != xyes], [AC_MSG_FAILURE( [unable to find supported libfole in directory: $ac_cv_with_libfole], [1]) @@ -88,7 +91,7 @@ dnl Function to detect if libfole dependencies are available AC_DEFUN([AX_LIBFOLE_CHECK_LOCAL], [dnl No additional checks. - ac_cv_libfole_CPPFLAGS="-I../libfole"; + ac_cv_libfole_CPPFLAGS="-I../libfole -I\$(top_srcdir)/libfole"; ac_cv_libfole_LIBADD="../libfole/libfole.la"; ac_cv_libfole=local diff --git a/m4/libfwps.m4 b/m4/libfwps.m4 index 07770c49..1f968f74 100644 --- a/m4/libfwps.m4 +++ b/m4/libfwps.m4 @@ -1,6 +1,6 @@ dnl Checks for libfwps required headers and functions dnl -dnl Version: 20240224 +dnl Version: 20240413 dnl Function to detect if libfwps is available dnl ac_libfwps_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -10,8 +10,10 @@ AC_DEFUN([AX_LIBFWPS_CHECK_LIB], [ac_cv_libfwps=no], [ac_cv_libfwps=check dnl Check if the directory provided as parameter exists + dnl For both --with-libfwps which returns "yes" and --with-libfwps= which returns "" + dnl treat them as auto-detection. AS_IF( - [test "x$ac_cv_with_libfwps" != x && test "x$ac_cv_with_libfwps" != xauto-detect], + [test "x$ac_cv_with_libfwps" != x && test "x$ac_cv_with_libfwps" != xauto-detect && test "x$ac_cv_with_libfwps" != xyes], [AS_IF( [test -d "$ac_cv_with_libfwps"], [CFLAGS="$CFLAGS -I${ac_cv_with_libfwps}/include" @@ -250,7 +252,7 @@ AC_DEFUN([AX_LIBFWPS_CHECK_LIB], ac_cv_libfwps_LIBADD="-lfwps"]) ]) AS_IF( - [test "x$ac_cv_with_libfwps" != x && test "x$ac_cv_with_libfwps" != xauto-detect && test "x$ac_cv_libfwps" != xyes], + [test "x$ac_cv_libfwps" != xyes && test "x$ac_cv_with_libfwps" != x && test "x$ac_cv_with_libfwps" != xauto-detect && test "x$ac_cv_with_libfwps" != xyes], [AC_MSG_FAILURE( [unable to find supported libfwps in directory: $ac_cv_with_libfwps], [1]) @@ -296,7 +298,7 @@ dnl Function to detect if libfwps dependencies are available AC_DEFUN([AX_LIBFWPS_CHECK_LOCAL], [dnl No additional checks. - ac_cv_libfwps_CPPFLAGS="-I../libfwps"; + ac_cv_libfwps_CPPFLAGS="-I../libfwps -I\$(top_srcdir)/libfwps"; ac_cv_libfwps_LIBADD="../libfwps/libfwps.la"; ac_cv_libfwps=local diff --git a/m4/libfwsi.m4 b/m4/libfwsi.m4 index 3378630c..4ace41b3 100644 --- a/m4/libfwsi.m4 +++ b/m4/libfwsi.m4 @@ -1,6 +1,6 @@ dnl Checks for libfwsi required headers and functions dnl -dnl Version: 20190308 +dnl Version: 20240413 dnl Function to detect if libfwsi is available dnl ac_libfwsi_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -10,8 +10,10 @@ AC_DEFUN([AX_LIBFWSI_CHECK_LIB], [ac_cv_libfwsi=no], [ac_cv_libfwsi=check dnl Check if the directory provided as parameter exists + dnl For both --with-libfwsi which returns "yes" and --with-libfwsi= which returns "" + dnl treat them as auto-detection. AS_IF( - [test "x$ac_cv_with_libfwsi" != x && test "x$ac_cv_with_libfwsi" != xauto-detect], + [test "x$ac_cv_with_libfwsi" != x && test "x$ac_cv_with_libfwsi" != xauto-detect && test "x$ac_cv_with_libfwsi" != xyes], [AS_IF( [test -d "$ac_cv_with_libfwsi"], [CFLAGS="$CFLAGS -I${ac_cv_with_libfwsi}/include" @@ -89,8 +91,9 @@ AC_DEFUN([AX_LIBFWSI_CHECK_LIB], ac_cv_libfwsi_LIBADD="-lfwsi"]) ]) + AS_IF( - [test "x$ac_cv_with_libfwsi" != x && test "x$ac_cv_with_libfwsi" != xauto-detect && test "x$ac_cv_libfwsi" != xyes], + [test "x$ac_cv_libfwsi" != xyes && test "x$ac_cv_with_libfwsi" != x && test "x$ac_cv_with_libfwsi" != xauto-detect && test "x$ac_cv_with_libfwsi" != xyes], [AC_MSG_FAILURE( [unable to find supported libfwsi in directory: $ac_cv_with_libfwsi], [1]) @@ -120,7 +123,7 @@ dnl Function to detect if libfwsi dependencies are available AC_DEFUN([AX_LIBFWSI_CHECK_LOCAL], [dnl No additional checks. - ac_cv_libfwsi_CPPFLAGS="-I../libfwsi"; + ac_cv_libfwsi_CPPFLAGS="-I../libfwsi -I\$(top_srcdir)/libfwsi"; ac_cv_libfwsi_LIBADD="../libfwsi/libfwsi.la"; ac_cv_libfwsi=local diff --git a/m4/libuna.m4 b/m4/libuna.m4 index b1301f41..996ac60d 100644 --- a/m4/libuna.m4 +++ b/m4/libuna.m4 @@ -1,6 +1,6 @@ dnl Checks for libuna or required headers and functions dnl -dnl Version: 20240308 +dnl Version: 20240413 dnl Function to detect if a specific libuna definition is available. AC_DEFUN([AX_LIBUNA_CHECK_DEFINITION], @@ -946,7 +946,7 @@ AC_DEFUN([AX_LIBUNA_CHECK_LIB], ]) AS_IF( - [test "x$ac_cv_with_libuna" != x && test "x$ac_cv_with_libuna" != xauto-detect && test "x$ac_cv_with_libuna" != xyes], + [test "x$ac_cv_libuna" != xyes && test "x$ac_cv_with_libuna" != x && test "x$ac_cv_with_libuna" != xauto-detect && test "x$ac_cv_with_libuna" != xyes], [AC_MSG_FAILURE( [unable to find supported libuna in directory: $ac_cv_with_libuna], [1]) @@ -976,7 +976,7 @@ dnl Function to detect if libuna dependencies are available AC_DEFUN([AX_LIBUNA_CHECK_LOCAL], [dnl No additional checks. - ac_cv_libuna_CPPFLAGS="-I../libuna"; + ac_cv_libuna_CPPFLAGS="-I../libuna -I\$(top_srcdir)/libuna"; ac_cv_libuna_LIBADD="../libuna/libuna.la"; ac_cv_libuna=local diff --git a/m4/python.m4 b/m4/python.m4 index d1f8067b..87f89bd9 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -1,6 +1,6 @@ dnl Functions for Python bindings dnl -dnl Version: 20231119 +dnl Version: 20240418 dnl Function to check if the python binary is available dnl "python${PYTHON_VERSION} python python# python#.#" @@ -76,10 +76,12 @@ AC_DEFUN([AX_PYTHON_CHECK], AC_MSG_RESULT( [$PYTHON_LDFLAGS]) - dnl For CygWin add the -no-undefined linker flag + dnl For CygWin and MinGW add the -no-undefined linker flag AS_CASE( - [$host_os], - [cygwin*],[PYTHON_LDFLAGS="${PYTHON_LDFLAGS} -no-undefined"], + [$build], + [*-*-cygwin*],[PYTHON_LDFLAGS="${PYTHON_LDFLAGS} -no-undefined"], + [*-*-mingw*],[PYTHON_LDFLAGS="${PYTHON_LDFLAGS} -no-undefined"], + [*-*-msys*],[PYTHON_LDFLAGS="${PYTHON_LDFLAGS} -no-undefined"], [*],[]) dnl Check for the existence of Python.h diff --git a/manuals/Makefile.am b/manuals/Makefile.am index a4c3c8df..19211115 100644 --- a/manuals/Makefile.am +++ b/manuals/Makefile.am @@ -6,9 +6,7 @@ EXTRA_DIST = \ lnkinfo.1 \ liblnk.3 -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + Makefile \ Makefile.in -distclean: clean - -rm -f Makefile - diff --git a/msvscpp/Makefile.am b/msvscpp/Makefile.am index ef697274..de1534c0 100644 --- a/msvscpp/Makefile.am +++ b/msvscpp/Makefile.am @@ -39,9 +39,7 @@ MSVSCPP_FILES = \ EXTRA_DIST = \ $(MSVSCPP_FILES) -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + Makefile \ Makefile.in -distclean: clean - -rm -f Makefile - diff --git a/ossfuzz/Makefile.am b/ossfuzz/Makefile.am index 817e5539..76e9468d 100644 --- a/ossfuzz/Makefile.am +++ b/ossfuzz/Makefile.am @@ -1,7 +1,7 @@ if HAVE_LIB_FUZZING_ENGINE AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/common \ + -I../include -I$(top_srcdir)/include \ + -I../common -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @@ -33,12 +33,10 @@ file_fuzzer_LDADD = \ @LIBINTL@ endif -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + Makefile \ Makefile.in -distclean: clean - -rm -f Makefile - splint-local: @echo "Running splint on file_fuzzer ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(file_fuzzer_SOURCES) diff --git a/pylnk/Makefile.am b/pylnk/Makefile.am index 28a3457d..cf112522 100644 --- a/pylnk/Makefile.am +++ b/pylnk/Makefile.am @@ -1,7 +1,7 @@ if HAVE_PYTHON AM_CFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/common \ + -I../include -I$(top_srcdir)/include \ + -I../common -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @@ -58,9 +58,7 @@ pylnk_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS) endif -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + Makefile \ Makefile.in -distclean: clean - -rm -f Makefile - diff --git a/synclibs.sh b/synclibs.sh index ed48efea..1eeb030a 100755 --- a/synclibs.sh +++ b/synclibs.sh @@ -1,7 +1,7 @@ #!/bin/sh # Script that synchronizes the local library dependencies # -# Version: 20231023 +# Version: 20240414 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -95,10 +95,11 @@ endif d } -/distclean: clean/ { +/DISTCLEANFILES = / { n - N - d + /${LOCAL_LIB}_definitions.h/ { + d + } }"; echo "${SED_SCRIPT}" >> ${LOCAL_LIB}-$$.sed; sed -i'~' -f ${LOCAL_LIB}-$$.sed ${LOCAL_LIB_MAKEFILE_AM}; @@ -140,7 +141,7 @@ SED_SCRIPT="/^$/ { then if ! test -f "m4/libuna.m4"; then - sed -i'~' 's?@LIBUNA_CPPFLAGS@?-I$(top_srcdir)/libuna?' ${LOCAL_LIB_MAKEFILE_AM}; + sed -i'~' 's?@LIBUNA_CPPFLAGS@?-I../libuna -I$(top_srcdir)/libuna?' ${LOCAL_LIB_MAKEFILE_AM}; fi fi diff --git a/tests/Makefile.am b/tests/Makefile.am index eb782b57..d2e0301d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,8 +1,8 @@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/common \ + -I../include -I$(top_srcdir)/include \ + -I../common -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ @LIBCTHREADS_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @@ -332,9 +332,8 @@ lnk_test_tools_signal_LDADD = \ ../liblnk/liblnk.la \ @LIBCERROR_LIBADD@ -MAINTAINERCLEANFILES = \ - Makefile.in - -distclean: clean - -rm -f Makefile +DISTCLEANFILES = \ + Makefile \ + Makefile.in \ + notify_stream.log diff --git a/tests/test_library.sh b/tests/test_library.sh index e46db11b..b831de67 100755 --- a/tests/test_library.sh +++ b/tests/test_library.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Tests library functions and types. # -# Version: 20231007 +# Version: 20240413 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -141,12 +141,9 @@ then exit ${EXIT_IGNORE}; fi -TEST_RUNNER="tests/test_runner.sh"; +TEST_DIRECTORY=`dirname $0`; -if ! test -f "${TEST_RUNNER}"; -then - TEST_RUNNER="./test_runner.sh"; -fi +TEST_RUNNER="${TEST_DIRECTORY}/test_runner.sh"; if ! test -f "${TEST_RUNNER}"; then diff --git a/tests/test_lnkinfo.sh b/tests/test_lnkinfo.sh index 3250823e..8aae7133 100755 --- a/tests/test_lnkinfo.sh +++ b/tests/test_lnkinfo.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Info tool testing script # -# Version: 20231005 +# Version: 20240413 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -32,12 +32,9 @@ then exit ${EXIT_FAILURE}; fi -TEST_RUNNER="tests/test_runner.sh"; +TEST_DIRECTORY=`dirname $0`; -if ! test -f "${TEST_RUNNER}"; -then - TEST_RUNNER="./test_runner.sh"; -fi +TEST_RUNNER="${TEST_DIRECTORY}/test_runner.sh"; if ! test -f "${TEST_RUNNER}"; then diff --git a/tests/test_manpage.sh b/tests/test_manpage.sh index 4abb656e..b5fafd79 100755 --- a/tests/test_manpage.sh +++ b/tests/test_manpage.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Tests man pages. # -# Version: 20230410 +# Version: 20240413 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -45,12 +45,9 @@ then exit ${EXIT_IGNORE}; fi -TEST_RUNNER="tests/test_runner.sh"; +TEST_DIRECTORY=`dirname $0`; -if ! test -f "${TEST_RUNNER}"; -then - TEST_RUNNER="./test_runner.sh"; -fi +TEST_RUNNER="${TEST_DIRECTORY}/test_runner.sh"; if ! test -f "${TEST_RUNNER}"; then diff --git a/tests/test_python_module.sh b/tests/test_python_module.sh index 6f4a1398..92d0bc61 100755 --- a/tests/test_python_module.sh +++ b/tests/test_python_module.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Tests Python module functions and types. # -# Version: 20240120 +# Version: 20240417 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -15,12 +15,15 @@ OPTION_SETS=(); TEST_TOOL_DIRECTORY="."; INPUT_GLOB="*"; +LIBRARY_NAME="liblnk"; +PYTHON_MODULE="pylnk"; + test_python_function() { local TEST_FUNCTION=$1; local TEST_DESCRIPTION="Testing Python-bindings functions: ${TEST_FUNCTION}"; - local TEST_SCRIPT="${TEST_TOOL_DIRECTORY}/pylnk_test_${TEST_FUNCTION}.py"; + local TEST_SCRIPT="${TEST_TOOL_DIRECTORY}/${PYTHON_MODULE}_test_${TEST_FUNCTION}.py"; run_test_with_arguments "${TEST_DESCRIPTION}" "${TEST_SCRIPT}"; local RESULT=$?; @@ -33,7 +36,7 @@ test_python_function_with_input() local TEST_FUNCTION=$1; local TEST_DESCRIPTION="Testing Python-bindings functions: ${TEST_FUNCTION}"; - local TEST_SCRIPT="${TEST_TOOL_DIRECTORY}/pylnk_test_${TEST_FUNCTION}.py"; + local TEST_SCRIPT="${TEST_TOOL_DIRECTORY}/${PYTHON_MODULE}_test_${TEST_FUNCTION}.py"; if ! test -d "input"; then @@ -50,7 +53,7 @@ test_python_function_with_input() return ${EXIT_IGNORE}; fi - local TEST_PROFILE_DIRECTORY=$(get_test_profile_directory "input" "pylnk"); + local TEST_PROFILE_DIRECTORY=$(get_test_profile_directory "input" "${PYTHON_MODULE}"); local IGNORE_LIST=$(read_ignore_list "${TEST_PROFILE_DIRECTORY}"); @@ -125,12 +128,9 @@ then exit ${EXIT_IGNORE}; fi -TEST_RUNNER="tests/test_runner.sh"; +TEST_DIRECTORY=`dirname $0`; -if ! test -f "${TEST_RUNNER}"; -then - TEST_RUNNER="./test_runner.sh"; -fi +TEST_RUNNER="${TEST_DIRECTORY}/test_runner.sh"; if ! test -f "${TEST_RUNNER}"; then @@ -141,6 +141,14 @@ fi source ${TEST_RUNNER}; +PLATFORM=`uname -s | sed 's/-.*$//'`; + +if test "${PLATFORM}" = "MINGW64_NT" || test "${PLATFORM}" = "MSYS_NT"; +then + cp ../${LIBRARY_NAME}/.libs/*.dll ../${PYTHON_MODULE}/.libs/; + cp ../${PYTHON_MODULE}/.libs/${PYTHON_MODULE}.dll ../${PYTHON_MODULE}/.libs/${PYTHON_MODULE}.pyd; +fi + RESULT=${EXIT_IGNORE}; for TEST_FUNCTION in ${TEST_FUNCTIONS}; diff --git a/tests/test_tools.sh b/tests/test_tools.sh index 82fc8df3..c9ca3ea3 100755 --- a/tests/test_tools.sh +++ b/tests/test_tools.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Tests tools functions and types. # -# Version: 20231007 +# Version: 20240413 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -141,12 +141,9 @@ then exit ${EXIT_IGNORE}; fi -TEST_RUNNER="tests/test_runner.sh"; +TEST_DIRECTORY=`dirname $0`; -if ! test -f "${TEST_RUNNER}"; -then - TEST_RUNNER="./test_runner.sh"; -fi +TEST_RUNNER="${TEST_DIRECTORY}/test_runner.sh"; if ! test -f "${TEST_RUNNER}"; then