diff --git a/.gitignore b/.gitignore index e08573fb2f..534bdd283a 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ common/.dirstamp /cppcheck*.xml /.ci*.log /.ci*.log.* +.dirstamp # Python precompiled files __pycache__/ diff --git a/tests/.gitignore b/tests/.gitignore index b7a2de42f9..cdee50ce56 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -9,3 +9,4 @@ /getvaluetest /getvaluetest.log /getvaluetest.trs +/hidparser.c diff --git a/tools/nut-scanner/.gitignore b/tools/nut-scanner/.gitignore index bf1ab545d2..393712ae49 100644 --- a/tools/nut-scanner/.gitignore +++ b/tools/nut-scanner/.gitignore @@ -1,3 +1,5 @@ /nut-scanner /nutscan-snmp.h /nutscan-usb.h +/serial.c +/bcmxcp_ser.c diff --git a/tools/nut-scanner/Makefile.am b/tools/nut-scanner/Makefile.am index 32ccb12fe9..632f2c5ba3 100644 --- a/tools/nut-scanner/Makefile.am +++ b/tools/nut-scanner/Makefile.am @@ -22,7 +22,7 @@ $(top_builddir)/common/libcommon.la: # 'dist', and is only required for actual build, in which case # BUILT_SOURCES (in ../include) will ensure nut_version.h will # be built before anything else -common.c nut-scanner.c: $(top_builddir)/include/nut_version.h +nut-scanner.c: $(top_builddir)/include/nut_version.h LINKED_SOURCE_FILES = @@ -37,14 +37,6 @@ LINKED_SOURCE_FILES += $(builddir)/bcmxcp_ser.c $(builddir)/bcmxcp_ser.c: $(top_srcdir)/drivers/bcmxcp_ser.c test -s "$@" || ln -s -f "$(top_srcdir)/drivers/bcmxcp_ser.c" "$@" -LINKED_SOURCE_FILES += $(builddir)/common.c -$(builddir)/common.c: $(top_srcdir)/common/common.c - test -s "$@" || ln -s -f "$(top_srcdir)/common/common.c" "$@" - -LINKED_SOURCE_FILES += $(builddir)/str.c -$(builddir)/str.c: $(top_srcdir)/common/str.c - test -s "$@" || ln -s -f "$(top_srcdir)/common/str.c" "$@" - CLEANFILES += $(LINKED_SOURCE_FILES) BUILT_SOURCES += $(LINKED_SOURCE_FILES) @@ -62,6 +54,7 @@ libnutscan_la_SOURCES = scan_nut.c scan_ipmi.c \ scan_avahi.c scan_eaton_serial.c nutscan-serial.c nodist_libnutscan_la_SOURCES = $(LINKED_SOURCE_FILES) libnutscan_la_LIBADD = $(NETLIBS) $(LIBLTDL_LIBS) +libnutscan_la_LIBADD += $(top_builddir)/common/libcommonclient.la # # Below we set API versions of public libraries # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html @@ -69,12 +62,22 @@ libnutscan_la_LIBADD = $(NETLIBS) $(LIBLTDL_LIBS) # object .so names would differ) # # libnutscan version information -libnutscan_la_LDFLAGS = $(SERLIBS) -version-info 1:0:0 -export-symbols-regex ^nutscan_ +libnutscan_la_LDFLAGS = $(SERLIBS) -version-info 1:0:0 +# libnutscan exported symbols regex +# WARNING: Since the library includes parts of libcommon (as much as needed +# e.g. for logging or string manipulations), we export a few symbols from +# those too. This may cause issues for (third-party) code development that +# would use both libnutscan and libcommon or similar libs. Here we did have +# a problem with nut-scanner using two copies of common.c and conflicting +# copies of "nut_debug_level" making fun of our debug-logging attempts. +# One solution to tackle if needed for those cases would be to make some +# dynamic/shared libnutcommon (etc.) +libnutscan_la_LDFLAGS += -export-symbols-regex '^(nutscan_|nut_debug_level|s_upsdebugx)' libnutscan_la_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include $(LIBLTDL_CFLAGS) -I$(top_srcdir)/drivers nut_scanner_SOURCES = nut-scanner.c nut_scanner_CFLAGS = -I$(top_srcdir)/clients -I$(top_srcdir)/include -nut_scanner_LDADD = $(top_builddir)/common/libcommon.la libnutscan.la +nut_scanner_LDADD = libnutscan.la if WITH_SSL libnutscan_la_CFLAGS += $(LIBSSL_CFLAGS)