From 9b9c94244a9d0df752fbb0cbee20207a2ee0c7e1 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 5 May 2024 10:52: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 | 12 ++++++++-- common/Makefile.am | 13 +++++------ configure.ac | 2 +- include/Makefile.am | 14 +++++------- libsmdev/Makefile.am | 14 +++++------- m4/libcdata.m4 | 6 ++--- m4/libcerror.m4 | 6 ++--- m4/libcfile.m4 | 6 ++--- m4/libclocale.m4 | 6 ++--- m4/libcnotify.m4 | 6 ++--- m4/libcthreads.m4 | 6 ++--- m4/libuna.m4 | 6 ++--- m4/python.m4 | 10 +++++---- manuals/Makefile.am | 6 ++--- msvscpp/Makefile.am | 6 ++--- pysmdev/Makefile.am | 10 ++++----- smdevtools/Makefile.am | 10 ++++----- synclibs.sh | 11 ++++----- tests/Makefile.am | 13 +++++------ tests/test_library.sh | 9 +++----- tests/test_manpage.sh | 9 +++----- tests/test_python_module.sh | 26 +++++++++++++-------- tests/test_smdevinfo.sh | 9 +++----- 29 files changed, 149 insertions(+), 132 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ebfd381..96096e9 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 53b87c8..b0b664c 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 d0bff2f..44031f0 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 15c13bf..d98d681 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 6df1b61..c889baf 100644 --- a/.gitignore +++ b/.gitignore @@ -131,6 +131,7 @@ stamp-h[1-9] /smdevtools/*.exe /smdevtools/smdevinfo /tests/*.exe +/tests/notify_stream.log /tests/smdev_test_ata /tests/smdev_test_error /tests/smdev_test_handle diff --git a/Makefile.am b/Makefile.am index 85f0243..a9adfa3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -55,8 +55,15 @@ EXTRA_DIST = \ $(SETUP_PY_FILES) \ $(SPEC_FILES) -MAINTAINERCLEANFILES = \ - Makefile.in +DISTCLEANFILES = \ + config.status \ + config.cache \ + config.log \ + libsmdev.pc \ + libsmdev.spec \ + Makefile \ + Makefile.in \ + po/Makevars pkgconfigdir = $(libdir)/pkgconfig @@ -80,15 +87,3 @@ library: (cd $(srcdir)/libsmdev && $(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 libsmdev.pc - -rm -f libsmdev.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 82654ff..a4798bf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -241,11 +241,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 ) @@ -258,9 +266,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 2433a75..f7aa524 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 ebd662d..5723b3b 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.71]) AC_INIT( [libsmdev], - [20240309], + [20240505], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( diff --git a/include/Makefile.am b/include/Makefile.am index 2d9c8b6..ce193c3 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -15,13 +15,11 @@ EXTRA_DIST = \ libsmdev/features.h.in \ libsmdev/types.h.in -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + libsmdev.h \ + libsmdev/definitions.h \ + libsmdev/features.h \ + libsmdev/types.h \ + Makefile \ Makefile.in -distclean: clean - -rm -f libsmdev.h - -rm -f libsmdev/definitions.h - -rm -f libsmdev/features.h - -rm -f libsmdev/types.h - -rm -f Makefile - diff --git a/libsmdev/Makefile.am b/libsmdev/Makefile.am index e57728a..a4f0f93 100644 --- a/libsmdev/Makefile.am +++ b/libsmdev/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@ \ @@ -56,14 +56,12 @@ EXTRA_DIST = \ libsmdev.rc \ libsmdev.rc.in -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + libsmdev_definitions.h \ + libsmdev.rc \ + Makefile \ Makefile.in -distclean: clean - -rm -f libsmdev_definitions.h - -rm -f libsmdev.rc - -rm -f Makefile - sources-local: $(BUILT_SOURCES) splint-local: diff --git a/m4/libcdata.m4 b/m4/libcdata.m4 index 309ec51..aa01d93 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 7d7f40f..e9abcdb 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 5596e9c..81ac5f1 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 d82d1fd..bd5a10e 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 41cf9e8..e382bdb 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/libcthreads.m4 b/m4/libcthreads.m4 index 6503ce5..c9c4e46 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/libuna.m4 b/m4/libuna.m4 index b1301f4..996ac60 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 d1f8067..87f89bd 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 e0b5a9a..622ac05 100644 --- a/manuals/Makefile.am +++ b/manuals/Makefile.am @@ -6,9 +6,7 @@ EXTRA_DIST = \ libsmdev.3 \ smdevinfo.1 -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + Makefile \ Makefile.in -distclean: clean - -rm -f Makefile - diff --git a/msvscpp/Makefile.am b/msvscpp/Makefile.am index 2cb2da5..61a5bb3 100644 --- a/msvscpp/Makefile.am +++ b/msvscpp/Makefile.am @@ -24,9 +24,7 @@ MSVSCPP_FILES = \ EXTRA_DIST = \ $(MSVSCPP_FILES) -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + Makefile \ Makefile.in -distclean: clean - -rm -f Makefile - diff --git a/pysmdev/Makefile.am b/pysmdev/Makefile.am index 45007de..fba6f1e 100644 --- a/pysmdev/Makefile.am +++ b/pysmdev/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@ \ @@ -36,9 +36,7 @@ pysmdev_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS) endif -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + Makefile \ Makefile.in -distclean: clean - -rm -f Makefile - diff --git a/smdevtools/Makefile.am b/smdevtools/Makefile.am index 78eb667..039f99f 100644 --- a/smdevtools/Makefile.am +++ b/smdevtools/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@ \ @@ -37,12 +37,10 @@ smdevinfo_LDADD = \ @LIBCERROR_LIBADD@ \ @LIBINTL@ -MAINTAINERCLEANFILES = \ +DISTCLEANFILES = \ + Makefile \ Makefile.in -distclean: clean - -rm -f Makefile - splint-local: @echo "Running splint on smdevinfo ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(smdevinfo_SOURCES) diff --git a/synclibs.sh b/synclibs.sh index 0fa7f79..a162203 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 9bebf72..809eba1 100644 --- a/tests/Makefile.am +++ b/tests/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@ \ @@ -184,9 +184,8 @@ smdev_test_track_value_LDADD = \ ../libsmdev/libsmdev.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 0fe2d2c..3c15c9d 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_manpage.sh b/tests/test_manpage.sh index 4abb656..b5fafd7 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 2c37fd8..5543fde 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="libsmdev"; +PYTHON_MODULE="pysmdev"; + test_python_function() { local TEST_FUNCTION=$1; local TEST_DESCRIPTION="Testing Python-bindings functions: ${TEST_FUNCTION}"; - local TEST_SCRIPT="${TEST_TOOL_DIRECTORY}/pysmdev_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}/pysmdev_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" "pysmdev"); + 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_smdevinfo.sh b/tests/test_smdevinfo.sh index 09f5513..ee1e479 100755 --- a/tests/test_smdevinfo.sh +++ b/tests/test_smdevinfo.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