Skip to content

Commit

Permalink
Merge 9b09951 into 9066236
Browse files Browse the repository at this point in the history
  • Loading branch information
jimklimov authored Jan 22, 2025
2 parents 9066236 + 9b09951 commit 62803a1
Show file tree
Hide file tree
Showing 3 changed files with 247 additions and 45 deletions.
15 changes: 8 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ platform: x64
# https://www.appveyor.com/docs/build-cache/
environment:
APPVEYOR_SAVE_CACHE_ON_ERROR: true
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=9
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=6
CCACHE_DIR: /home/appveyor/.ccache

# https://github.com/networkupstools/nut/blob/Windows-v2.8.0-1/docs/config-prereqs.txt#L951
Expand All @@ -47,7 +47,8 @@ install:
C:\msys64\usr\bin\bash -lc "date -u; pacman --noconfirm -Syuu"
- cmd: |
REM Prerequisites for NUT per https://github.com/networkupstools/nut/blob/master/docs/config-prereqs.txt :
C:\msys64\usr\bin\bash -lc "date -u; pacman --noconfirm -S --needed base-devel mingw-w64-x86_64-toolchain autoconf-wrapper automake-wrapper libtool mingw-w64-x86_64-libltdl gcc ccache mingw-w64-x86_64-ccache git aspell aspell-en python mingw-w64-x86_64-python-pygments mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libusb mingw-w64-x86_64-libusb-compat-git mingw-w64-x86_64-neon libneon-devel mingw-w64-x86_64-libmodbus-git mingw-w64-x86_64-libgd mingw-w64-x86_64-cppunit"
C:\msys64\usr\bin\bash -lc "date -u; pacman --noconfirm -S --needed base-devel mingw-w64-x86_64-toolchain autoconf-wrapper automake-wrapper libtool mingw-w64-x86_64-libltdl gcc ccache mingw-w64-x86_64-ccache git aspell aspell-en python mingw-w64-x86_64-python-pygments mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libusb mingw-w64-x86_64-libusb-compat-git mingw-w64-x86_64-neon libneon-devel mingw-w64-x86_64-libgd mingw-w64-x86_64-cppunit"
REM SKIP mingw-w64-x86_64-libmodbus-git : we custom-build one with USB support
- cmd: |
REM Assorted stats after package processing:
C:\msys64\usr\bin\bash -lc "date -u; ls -la / ; du -ksx / ; date -u; du -ks /var/cache/pacman/pkg; date -u"
Expand All @@ -68,7 +69,7 @@ before_build:
set CHERE_INVOKING=yes
REM Start a 64 bit Mingw environment:
set MSYSTEM=MINGW64
C:\msys64\usr\bin\bash -lc "date -u; export MSYS2_PATH ; bash ./scripts/Windows/build-mingw-prereqs.sh"
C:\msys64\usr\bin\bash -lc 'date -u; export MSYS2_PATH ; PATH="/mingw64/lib/ccache/bin:/mingw64/bin:$PATH" bash ./scripts/Windows/build-mingw-prereqs.sh'
build_script:
Expand Down Expand Up @@ -96,9 +97,9 @@ test_script:
REM Start a 64 bit Mingw environment:
set MSYSTEM=MINGW64
REM Start Mingw-based integration and unit checks:
C:\msys64\usr\bin\bash -lc 'date -u; NUT_STATEPATH="C:\\Users\\appveyor\\AppData\\Local\\Temp\\nut-test"; mkdir -p "${NUT_STATEPATH}"; export NUT_STATEPATH; PATH="/mingw64/bin:$PATH" make -s check || bash -lc "for F in tests/*.log tests/*.trs ; do echo \"===---=== $F :\"; cat \"$F\"; done; exit 1;" '
REM Start a Mingw-based documentation spellcheck:
C:\msys64\usr\bin\bash -lc 'date -u; PATH="/mingw64/bin:$PATH" make -s -j 4 spellcheck'
C:\msys64\usr\bin\bash -lc 'date -u; NUT_STATEPATH="C:\\Users\\appveyor\\AppData\\Local\\Temp\\nut-test"; mkdir -p "${NUT_STATEPATH}"; export NUT_STATEPATH; PATH="/mingw64/lib/ccache/bin:/mingw64/bin:$PATH" make -s check || bash -lc "for F in tests/*.log tests/*.trs ; do echo \"===---=== $F :\"; cat \"$F\"; done; exit 1;" '
REM Start a Mingw-based documentation spellcheck (note that "make check" above could cover some documents in path of artifact delivery, but maybe not all that we have):
C:\msys64\usr\bin\bash -lc 'date -u; PATH="/mingw64/lib/ccache/bin:/mingw64/bin:$PATH" make -s -j 8 spellcheck'
after_test:
Expand All @@ -109,7 +110,7 @@ after_test:
set MSYSTEM=MINGW64
REM Oh the joys of shell scripting with strings passed through CMD:
REM Note: currently Python installation path with MSYS is buggy [#1584]
C:\msys64\usr\bin\bash -lc 'date -u; if ! rm -rf ".inst" ; then echo "WARNING: Failed to clean away .inst" ; fi ; PATH="/mingw64/bin:$PATH" make -s install-win-bundle DESTDIR="`pwd`/.inst/NUT-for-Windows-x86_64-SNAPSHOT-%APPVEYOR_BUILD_VERSION%" ; ln -fs "NUT-for-Windows-x86_64-SNAPSHOT-%APPVEYOR_BUILD_VERSION%" ./.inst/NUT-for-Windows-x86_64-SNAPSHOT ; ( cd .inst/NUT-for-Windows-x86_64-SNAPSHOT ; find . -ls ; )'
C:\msys64\usr\bin\bash -lc 'date -u; if ! rm -rf ".inst" ; then echo "WARNING: Failed to clean away .inst" ; fi ; PATH="/mingw64/lib/ccache/bin:/mingw64/bin:$PATH" make -s install-win-bundle DESTDIR="`pwd`/.inst/NUT-for-Windows-x86_64-SNAPSHOT-%APPVEYOR_BUILD_VERSION%" ; ln -fs "NUT-for-Windows-x86_64-SNAPSHOT-%APPVEYOR_BUILD_VERSION%" ./.inst/NUT-for-Windows-x86_64-SNAPSHOT ; ( cd .inst/NUT-for-Windows-x86_64-SNAPSHOT ; find . -ls ; )'
cd .inst
7z a ../NUT-for-Windows-x86_64-SNAPSHOT-%APPVEYOR_BUILD_VERSION%.7z NUT*
- cmd: |
Expand Down
14 changes: 13 additions & 1 deletion m4/nut_check_libmodbus.m4
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,21 @@ if test -z "${nut_have_libmodbus_seen}"; then
CFLAGS="${CFLAGS_ORIG} ${depCFLAGS}"
LIBS="${LIBS_ORIG} ${depLIBS}"
AC_CHECK_HEADERS(modbus.h, [nut_have_libmodbus=yes], [nut_have_libmodbus=no], [AC_INCLUDES_DEFAULT])
AS_IF([test x"${nut_have_libmodbus}" = xyes ], [
AC_CHECK_FUNCS(modbus_new_tcp, [], [
AC_REQUIRE([NUT_CHECK_SOCKETLIB])
AS_IF([test x"${NETLIBS-}${NETLIBS_GETADDRS-}" = x], [
nut_have_libmodbus=no
],[
AC_MSG_NOTICE([Retry detection of libmodbus TCP support with NETLIBS])
unset ac_cv_func_modbus_new_tcp
LIBS="${LIBS} ${NETLIBS} ${NETLIBS_GETADDRS-}"
AC_CHECK_FUNCS(modbus_new_tcp, [], [nut_have_libmodbus=no])
])
])
])
AS_IF([test x"${nut_have_libmodbus}" = xyes ], [
AC_CHECK_FUNCS(modbus_new_rtu, [], [nut_have_libmodbus=no])
AC_CHECK_FUNCS(modbus_new_tcp, [], [nut_have_libmodbus=no])
AC_CHECK_FUNCS(modbus_set_byte_timeout, [], [nut_have_libmodbus=no])
AC_CHECK_FUNCS(modbus_set_response_timeout, [], [nut_have_libmodbus=no])
])
Expand Down
Loading

0 comments on commit 62803a1

Please sign in to comment.