Skip to content

TODO: Fallback configure.ac detection of libneon without pkgconfig #593

@jimklimov

Description

@jimklimov

In travis use-case for NO_PKG_CONFIG=true avoid this:

checking for libneon version via pkg-config (0.25.0 minimum required)... none found
checking for libneon cflags... 
checking for libneon ldflags... 
...

libtool: compile:  /usr/lib/ccache/gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../../tools/nut-scanner -I../../include -I/home/travis/build/networkupstools/nut/tmp/include -I../../../clients -I../../../include -I../../../drivers -DWITH_DMFMIB=0 -DWITH_DMF_LUA=0 -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.18/CORE -D_FORTIFY_SOURCE=2 -I/usr/include -I/home/travis/build/networkupstools/nut/tmp/include -Wall -Wsign-compare -MT libnutscan_la-scan_snmp.lo -MD -MP -MF .deps/libnutscan_la-scan_snmp.Tpo -c ../../../tools/nut-scanner/scan_snmp.c  -fPIC -DPIC -o .libs/libnutscan_la-scan_snmp.o
In file included from ../../../include/dmf.h:34:0,
                 from ../../../tools/nut-scanner/scan_snmp.c:89:
../../../include/dmfcore.h:36:2: error: #error "LibNEON is required to build DMF"
 #error "LibNEON is required to build DMF"
  ^
../../../include/dmfcore.h:80:2: error: unknown type name 'ne_xml_startelm_cb'
  ne_xml_startelm_cb *xml_dict_start_cb;
  ^
../../../include/dmfcore.h:81:2: error: unknown type name 'ne_xml_cdata_cb'
  ne_xml_cdata_cb *xml_cdata_cb;
  ^
../../../include/dmfcore.h:82:2: error: unknown type name 'ne_xml_endelm_cb'
  ne_xml_endelm_cb *xml_end_cb;
  ^
../../../include/dmfcore.h:103:3: error: unknown type name 'ne_xml_startelm_cb'
   ne_xml_startelm_cb* xml_dict_start_cb,
   ^
../../../include/dmfcore.h:104:3: error: unknown type name 'ne_xml_cdata_cb'
   ne_xml_cdata_cb* xml_cdata_cb,
   ^
../../../include/dmfcore.h:105:3: error: unknown type name 'ne_xml_endelm_cb'
   ne_xml_endelm_cb* xml_end_cb);
   ^
make[5]: *** [libnutscan_la-scan_snmp.lo] Error 1
make[5]: Leaving directory `/home/travis/build/networkupstools/nut/nut-2.7.4.1/_build/tools/nut-scanner'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/home/travis/build/networkupstools/nut/nut-2.7.4.1/_build/tools/nut-scanner'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/travis/build/networkupstools/nut/nut-2.7.4.1/_build/tools'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/travis/build/networkupstools/nut/nut-2.7.4.1/_build'
make[1]: *** [distcheck] Error 1
make[1]: Leaving directory `/home/travis/build/networkupstools/nut'
make: *** [distcheck-light] Error 2
Command exited with non-zero status 2
real 32.04
user 18.68
sys 3.50

Note e.g. that we can find other dependencies with other ways too:

checking for Net-SNMP version via net-snmp-config... 5.7.2 found
checking for Net-SNMP cflags... -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.18/CORE -D_FORTIFY_SOURCE=2 -I/usr/include
checking for Net-SNMP libs... -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -L/usr/lib/x86_64-linux-gnu -lnetsnmp -lcrypto -lm
checking for net-snmp/net-snmp-config.h... yes
checking for init_snmp... yes

checking for libusb version via pkg-config... checking via libusb-config... 0.1.12 found
checking for libusb cflags... 
checking for libusb ldflags... -L/usr/lib/x86_64-linux-gnu -lusb
checking for usb.h... yes
checking for usb_init... yes
checking for usb_detach_kernel_driver_np... yes

checking for libmodbus version via pkg-config... none found
checking for libmodbus cflags... -I/usr/include/modbus
checking for libmodbus ldflags... -lmodbus
checking for modbus.h... yes
checking for modbus_new_rtu... yes
checking for modbus_new_tcp... yes

so absence of pkgconfig is not fatal per se (and is sort of supported since #491).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions