networkupstools / nut

The Network UPS Tools repository. UPS management protocol Informational RFC 9271 published by IETF at https://www.rfc-editor.org/info/rfc9271 Please star NUT on GitHub, this helps with sponsorships!
https://networkupstools.org/
Other
2.03k stars 350 forks source link

Provide more prereqs for linux+mingw builds #1473

Open jimklimov opened 2 years ago

jimklimov commented 2 years ago

Current configure script reports (on a container prepared per scripts/Windows/README instructions, build handled by the accompanying script) the following build ability:

Configuration summary:
======================
build serial drivers: yes 
build USB drivers: yes (libusb-0.1-config)
build neon based XML driver: no 
enable Avahi support: no 
build Powerman PDU client driver: no 
build Modbus driver: no 
build IPMI driver: no 
build Mac OS X meta-driver: no 
build i2c based drivers: no 
enable SSL support: no 
enable libwrap (tcp-wrappers) support: no 
enable libltdl (Libtool dlopen abstraction) support: yes 
build nut-scanner: yes
build CGI programs: no 
build and install documentation: man=auto 
build specific documentation format(s): yes  man
build and install the development files: yes 
build SNMP drivers: yes 
------------------
Compiler settings:
CC          :x86_64-w64-mingw32-gcc
CFLAGS      :-isystem /usr/local/include  -D_POSIX=1 -D_POSIX_C_SOURCE=200112L -I/usr/x86_64-w64-mingw32/include/ -D_WIN32_WINNT=0xffff -Wno-reserved-identifier -Wno-unknown-warning-option -std=gnu99 -Wno-system-headers -Wall -Wextra -Wsign-compare -pedantic -Wno-format -Werror
CXX         :x86_64-w64-mingw32-g++
CXXFLAGS    :-isystem /usr/local/include  -D_POSIX=1 -D_POSIX_C_SOURCE=200112L -I/usr/x86_64-w64-mingw32/include/ -D_WIN32_WINNT=0xffff -Wno-reserved-identifier -Wno-unknown-warning-option -std=gnu++11 -Wno-system-headers -Wall -Wextra -Wno-format -Werror
CPP         :x86_64-w64-mingw32-gcc -E
CPPFLAGS    :

Notably this container (and instruction) lacks some presumably low-hanging fruits, such as:

Some possibly harder targets would be:

jimklimov commented 2 years ago

Documented prerequisites for libmodbus (see also nut#1515) and libgd (except fontconfig due to ICU; CGI bins build - no idea how usable the result is).

libwrap seems to be antiquated by now, many OSes are removing it from default daemons.

libneon and libavahi wanted some non-trivial work to proceed.

jimklimov commented 2 years ago

Analysis update: net-snmp is built statically (not dll) for mingw, so that needed a differrent pkg-config query. My earlier experiments just patched netsnmp.pc file. Now it is part of NUT m4 recipes logic.

jimklimov commented 2 years ago

To cross-build libneon from source/git in mingw on Linux, some fixes are needed - posted as https://github.com/notroj/neon/pull/84

jimklimov commented 2 years ago

Openssl-1.1.1 covered

jimklimov commented 2 years ago

Avahi is a huge snowball with libintl/gettext, libpcre, glib2... not a low-hanging fruit.

jimklimov commented 2 years ago

FreeIPMI wants libgcrypt (maybe doable, also quickly avoidable --without-encryption as far as build dependency for NUT goes) and getpwuid_r for SDR cache (can be avoided in configure.ac to not error out) :\ But then its headers just want e.g. <sys/socket.h> with no options for winsock, so also not a low-hanging fruit.

jimklimov commented 2 years ago

Want to revise net-snmp build vs (presumably shared-DLL) report in

jimklimov commented 2 years ago

Suggestions there proved helpful, the big make LDFLAGS=... was a good starting point (all other things equal)