Skip to content

Commit 2f354d2

Browse files
authored
Merge eb16616 into 1211c56
2 parents 1211c56 + eb16616 commit 2f354d2

File tree

19 files changed

+659
-192
lines changed

19 files changed

+659
-192
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
Makefile
1616
Makefile.in
1717
tags
18+
.all.*-generated.timestamp
1819

1920
## Parent directory only
2021
/aclocal.m4

Makefile.am

Lines changed: 82 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,46 @@ SUBDIRS_ALL_LIBS_LOCAL = \
9494

9595
#all all-recursive all-am-local all-local: all-fanout-maybe
9696
all-recursive: all-fanout-maybe
97-
check-recursive install-recursive: generated-headers-with-a-touch
9897

99-
all check install: all-fanout-cleanup
98+
# Make sure automake-defined check/install goals begin with our hack for
99+
# touch-files for generated headers (so each depending sub-directory does
100+
# not re-evaluate those rules in whole); note that these goals may end up
101+
# also calling all-fanout-maybe (as they depend on "all"):
102+
check-recursive install-recursive: generated-headers-with-a-touch
100103

104+
# NOTE: Beside dependency above, also called from some code paths in
105+
# the all-fanout-maybe implementation:
101106
generated-headers-with-a-touch: @dotMAKE@
102-
$(MAKE) $(AM_MAKEFLAGS) NUT_VERSION_H_GENERATED=false nut_version.h
103-
$(MAKE) $(AM_MAKEFLAGS) touch-include-all-nut_version-generated.timestamp
104-
$(MAKE) $(AM_MAKEFLAGS) libupsclient-version.h
105-
$(MAKE) $(AM_MAKEFLAGS) touch-clients-all-libupsclient_version-generated.timestamp
107+
+$(MAKE) $(AM_MAKEFLAGS) NUT_VERSION_H_GENERATED=false nut_version.h
108+
+$(MAKE) $(AM_MAKEFLAGS) touch-include-all-nut_version-generated.timestamp
109+
+$(MAKE) $(AM_MAKEFLAGS) libupsclient-version.h
110+
+$(MAKE) $(AM_MAKEFLAGS) touch-clients-all-libupsclient_version-generated.timestamp
111+
+$(MAKE) $(AM_MAKEFLAGS) NUT_LINKMAN_GENERATED=false prep-linkman-generated
112+
+$(MAKE) $(AM_MAKEFLAGS) touch-docs-man-all-linkman-generated-generated.timestamp
113+
114+
# After completing the automake-defined goals, clean up:
115+
all: all-fanout-cleanup
116+
check: check-fanout-cleanup
117+
install: install-fanout-cleanup
106118

107119
# Run as part of "all", but after the autotools-standard "all-recursive"
108120
# where we quiesce nut_version.h regeneration attempts for each subdir
109-
all-fanout-cleanup: all-recursive
121+
# which automake recipes iterate; similarly for "check" and "install":
122+
cleanup-touchfiles-for-generated-headers:
110123
@rm -f include/.all.nut_version-generated.timestamp \
124+
docs/man/.all.nut_linkman-generated.timestamp \
111125
clients/.all.libupsclient_version-generated.timestamp
112126

127+
all-fanout-cleanup: all-recursive @dotMAKE@
128+
+@$(MAKE) $(AM_MAKEFLAGS) cleanup-touchfiles-for-generated-headers
129+
130+
check-fanout-cleanup: check-recursive @dotMAKE@
131+
+@$(MAKE) $(AM_MAKEFLAGS) cleanup-touchfiles-for-generated-headers
132+
133+
install-fanout-cleanup: install-recursive @dotMAKE@
134+
+@$(MAKE) $(AM_MAKEFLAGS) cleanup-touchfiles-for-generated-headers
135+
136+
# Called from generated-headers-with-a-touch:
113137
touch-include-all-nut_version-generated.timestamp:
114138
@[ -s include/nut_version.h ]
115139
@touch -r include/nut_version.h -d '-10 seconds' include/.all.nut_version-generated.timestamp && exit ; \
@@ -122,6 +146,16 @@ touch-clients-all-libupsclient_version-generated.timestamp:
122146
touch -d '1970-01-01' clients/.all.libupsclient_version-generated.timestamp && exit ; \
123147
touch clients/.all.libupsclient_version-generated.timestamp
124148

149+
touch-docs-man-all-linkman-generated-generated.timestamp:
150+
@[ -s docs/man/linkman-driver-names.txt ] && [ -s docs/man/linkman-drivertool-names.txt ]
151+
@if test -n "`find docs/man/linkman-driver-names.txt -newer docs/man/linkman-drivertool-names.txt`" ; then \
152+
touch -r docs/man/linkman-drivertool-names.txt -d '-10 seconds' docs/man/.all.nut_linkman-generated.timestamp && exit ; \
153+
else \
154+
touch -r docs/man/linkman-driver-names.txt -d '-10 seconds' docs/man/.all.nut_linkman-generated.timestamp && exit ; \
155+
fi ; \
156+
touch -d '1970-01-01' docs/man/.all.nut_linkman-generated.timestamp && exit ; \
157+
touch docs/man/.all.nut_linkman-generated.timestamp
158+
125159
# Verbosity for fanout rule tracing; 0/1 (or "default" that may auto-set
126160
# to 0 or 1 in some rules below)
127161
SUBDIR_MAKE_VERBOSE = default
@@ -134,23 +168,23 @@ all-fanout-maybe: @dotMAKE@
134168
clients/.all.libupsclient_version-generated.timestamp
135169
+@if [ x"$(NUT_MAKE_SKIP_FANOUT)" = xtrue ] ; then \
136170
if [ x"$(SUBDIR_MAKE_VERBOSE)" != x0 ] ; then \
137-
echo " SUBDIR-MAKE $@: skip optimization for parallel make - NUT_MAKE_SKIP_FANOUT is set" ; \
171+
echo " SUBDIR-MAKE SKIP $@: skip optimization for parallel make - NUT_MAKE_SKIP_FANOUT is set" ; \
138172
fi ; \
139173
$(MAKE) $(AM_MAKEFLAGS) generated-headers-with-a-touch || exit ; \
140174
exit 0 ; \
141175
fi ; \
142176
case "-$(MAKEFLAGS) $(AM_MAKEFLAGS)" in \
143177
*-j|*-j" "*|*-{j,l}{0,1,2,3,4,5,6,7,8,9}*|*-[jl][0123456789]*|*{-l,--jobs,--load-average,--max-load}" "{-,0,1,2,3,4,5,6,7,8,9}*|*--jobserver*|*--jobs" "[0123456789]*|*--load-average" "[0123456789]*|*--max-load" "[0123456789]*) \
144178
if [ x"$(SUBDIR_MAKE_VERBOSE)" != x0 ] ; then \
145-
echo " SUBDIR-MAKE $@: implement optimization for parallel make as 'make all-fanout-subdirs'" ; \
179+
echo " SUBDIR-MAKE LAUNCH $@: implement optimization for parallel make as 'make all-fanout-subdirs'" ; \
146180
fi ; \
147181
$(MAKE) $(AM_MAKEFLAGS) all-fanout-subdirs || exit ; \
148182
if [ x"$(SUBDIR_MAKE_VERBOSE)" != x0 ] ; then \
149-
echo " SUBDIR-MAKE $@: optimization for parallel make as 'make all-fanout-subdirs' finished; now automake rules can follow up with default implementation of 'all-recursive' and/or 'all' (may try to regenerate some files again; should keep existing results though)" ; \
183+
echo " SUBDIR-MAKE FINISH $@: optimization for parallel make as 'make all-fanout-subdirs' finished; now automake rules can follow up with default implementation of 'all-recursive' and/or 'all' (may try to regenerate some files again; should keep existing results though)" ; \
150184
fi ;; \
151185
*) \
152186
if [ x"$(SUBDIR_MAKE_VERBOSE)" != x0 ] ; then \
153-
echo " SUBDIR-MAKE $@: skip optimization for parallel make - we seem to run sequentially now, seen MAKEFLAGS='$(MAKEFLAGS)' AM_MAKEFLAGS='$(AM_MAKEFLAGS)'" ; \
187+
echo " SUBDIR-MAKE SKIP $@: skip optimization for parallel make - we seem to run sequentially now, seen MAKEFLAGS='$(MAKEFLAGS)' AM_MAKEFLAGS='$(AM_MAKEFLAGS)'" ; \
154188
fi ; \
155189
$(MAKE) $(AM_MAKEFLAGS) generated-headers-with-a-touch || exit ; \
156190
;; \
@@ -234,12 +268,12 @@ SUBDIR_TGT_RULE = ( \
234268
[ x"$${TGT-}" != x ] || TGT="`echo '$@' | awk -F/ '{print $$1}'`" ; \
235269
[ x"$${DIR-}" != x ] || DIR="`echo '$@' | sed 's,^[^/]*/,,'`" ; \
236270
if [ x"$(SUBDIR_MAKE_VERBOSE)" != x0 ] ; then \
237-
echo " SUBDIR-MAKE STARTING $@: 'make $${SUBDIR_TGT_MAKEFLAGS-} $$TGT' in $$DIR ..." ; \
271+
echo " SUBDIR-MAKE STARTING $@: 'make $${SUBDIR_TGT_MAKEFLAGS-} $$TGT' in $$DIR ..." ; \
238272
fi ; \
239273
cd "$(abs_builddir)/$${DIR}" && \
240274
$(MAKE) $(AM_MAKEFLAGS) $${SUBDIR_TGT_MAKEFLAGS-} "$${TGT}" || { RES=$$?; echo " SUBDIR-MAKE FAILURE: 'make $$TGT' in $$DIR" >&2 ; exit $$RES ; } ; \
241275
if [ x"$(SUBDIR_MAKE_VERBOSE)" != x0 ] ; then \
242-
echo " SUBDIR-MAKE SUCCESS $@: 'make $${SUBDIR_TGT_MAKEFLAGS-} $$TGT' in $$DIR" ; \
276+
echo " SUBDIR-MAKE SUCCESS $@: 'make $${SUBDIR_TGT_MAKEFLAGS-} $$TGT' in $$DIR" ; \
243277
fi ; \
244278
)
245279

@@ -343,16 +377,30 @@ all/include: all-libs-local/include @dotMAKE@
343377
+@NUT_VERSION_H_GENERATED=true; export NUT_VERSION_H_GENERATED; \
344378
$(SUBDIR_TGT_RULE)
345379

346-
prep-src-docs/docs/man: @dotMAKE@
347-
+@SUBDIR_TGT_MAKEFLAGS='MAINTAINER_DOCS_PREP_MAN_DELAY=3'; export SUBDIR_TGT_MAKEFLAGS; \
380+
# Quickly bail out if somehow recursed into this goal from a dependency
381+
# (looking at all/docs with its several sub-make calls):
382+
prep-linkman-generated/docs/man: @dotMAKE@
383+
+@if [ x"$(NUT_LINKMAN_GENERATED)" = xtrue ] || [ x"$${NUT_LINKMAN_GENERATED}" = xtrue ] ; then exit 0 ; fi ; \
384+
SUBDIR_TGT_MAKEFLAGS='NUT_LINKMAN_GENERATED=false'; export SUBDIR_TGT_MAKEFLAGS; \
385+
NUT_LINKMAN_GENERATED=false; export NUT_LINKMAN_GENERATED; \
386+
$(SUBDIR_TGT_RULE) || exit ; \
387+
$(MAKE) $(AM_MAKEFLAGS) touch-docs-man-all-linkman-generated-generated.timestamp
388+
389+
prep-src-docs/docs/man: prep-linkman-generated/docs/man @dotMAKE@
390+
+@SUBDIR_TGT_MAKEFLAGS='MAINTAINER_DOCS_PREP_MAN_DELAY=3 NUT_LINKMAN_GENERATED=true'; export SUBDIR_TGT_MAKEFLAGS; \
391+
NUT_LINKMAN_GENERATED=true; export NUT_LINKMAN_GENERATED; \
348392
$(SUBDIR_TGT_RULE)
349393

350-
prep-src-docs/docs: @dotMAKE@
351-
+@DOCS_NO_MAN=true; export DOCS_NO_MAN; \
394+
prep-src-docs/docs: prep-linkman-generated/docs/man @dotMAKE@
395+
+@SUBDIR_TGT_MAKEFLAGS='NUT_LINKMAN_GENERATED=true'; export SUBDIR_TGT_MAKEFLAGS; \
396+
DOCS_NO_MAN=true; export DOCS_NO_MAN; \
397+
NUT_LINKMAN_GENERATED=true; export NUT_LINKMAN_GENERATED; \
352398
$(SUBDIR_TGT_RULE)
353399

354400
all/docs/man: prep-src-docs/docs/man @dotMAKE@
355-
+@$(SUBDIR_TGT_RULE)
401+
+@SUBDIR_TGT_MAKEFLAGS='NUT_LINKMAN_GENERATED=true'; export SUBDIR_TGT_MAKEFLAGS; \
402+
NUT_LINKMAN_GENERATED=true; export NUT_LINKMAN_GENERATED; \
403+
$(SUBDIR_TGT_RULE)
356404

357405
# Note: we optionally sort of depend on ChangeLog.adoc so it is pre-made and
358406
# pre-processed for html/pdf renders (if any are requested), so they surely
@@ -361,7 +409,8 @@ all/docs/man: prep-src-docs/docs/man @dotMAKE@
361409
# types are enabled.
362410
MAINTAINER_ASCIIDOCS_CHANGELOG_DELAY = 0
363411
all/docs: prep-src-docs/docs/man @dotMAKE@
364-
+@case "@DOC_BUILD_LIST@" in \
412+
+@NUT_LINKMAN_GENERATED=true; export NUT_LINKMAN_GENERATED; \
413+
case "@DOC_BUILD_LIST@" in \
365414
*pdf*|*html-single*|*html-chunked*) \
366415
echo " DOC-CHANGELOG-ASCIIDOC Pre-generate ChangeLog artifacts before the bulk of $@ ..." ; \
367416
MAINTAINER_ASCIIDOCS_CHANGELOG_DELAY="$(MAINTAINER_ASCIIDOCS_CHANGELOG_DELAY)" \
@@ -371,11 +420,14 @@ all/docs: prep-src-docs/docs/man @dotMAKE@
371420
echo " DOC-CHANGELOG-ASCIIDOC Pre-generate ChangeLog artifacts before the bulk of $@ : SUCCESS" ;; \
372421
*) ;; \
373422
esac
374-
+@$(MAKE) $(AM_MAKEFLAGS) prep-src-docs/docs
375-
+@DOCS_NO_MAN=true; export DOCS_NO_MAN; $(SUBDIR_TGT_RULE)
423+
+@NUT_LINKMAN_GENERATED=true; export NUT_LINKMAN_GENERATED; \
424+
$(MAKE) $(AM_MAKEFLAGS) prep-src-docs/docs
425+
+@NUT_LINKMAN_GENERATED=true; export NUT_LINKMAN_GENERATED; \
426+
DOCS_NO_MAN=true; export DOCS_NO_MAN; $(SUBDIR_TGT_RULE)
376427

377428
all-recursive/docs: all/docs all/docs/man @dotMAKE@
378-
+@$(SUBDIR_TGT_RULE)
429+
+@NUT_LINKMAN_GENERATED=true; export NUT_LINKMAN_GENERATED; \
430+
$(SUBDIR_TGT_RULE)
379431

380432
# Dependencies below are dictated by who needs whose library from another dir
381433
# (generated by a sub-make there, so we pre-emptively ensure it exists to avoid
@@ -761,7 +813,7 @@ spellcheck spellcheck-interactive: @dotMAKE@
761813
if [ x"$(NUT_MAKE_SKIP_FANOUT)" = xtrue ] ; then \
762814
RES=0 ; \
763815
if [ x"$(SUBDIR_MAKE_VERBOSE)" != x0 ] ; then \
764-
echo " SUBDIR-MAKE $@: skip optimization for parallel make - NUT_MAKE_SKIP_FANOUT is set" ; \
816+
echo " SUBDIR-MAKE SKIP $@: skip optimization for parallel make - NUT_MAKE_SKIP_FANOUT is set" ; \
765817
fi ; \
766818
(cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) -k -s $(abs_top_builddir)/docs/.prep-src-docs) || RES=$$? ; \
767819
(cd $(builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -k -s $(abs_top_builddir)/docs/man/.prep-src-docs) || RES=$$? ; \
@@ -781,8 +833,9 @@ spellcheck spellcheck-interactive: @dotMAKE@
781833
fi ; \
782834
export SUBDIR_MAKE_VERBOSE ; \
783835
( $(MAKE) $(AM_MAKEFLAGS) SPELLCHECK_TGT='$@' SUBDIR_MAKE_VERBOSE="$${SUBDIR_MAKE_VERBOSE}" -k -s $(SPELLCHECK_DIRS) && exit ; \
784-
echo "WARNING: FAILED fanned-out attempt in $@, retrying with NUT_MAKE_SKIP_FANOUT" >&2 ; \
785-
$(MAKE) $(AM_MAKEFLAGS) NUT_MAKE_SKIP_FANOUT=true SPELLCHECK_TGT='$@' -k -s $(SPELLCHECK_DIRS) ) || exit ; \
836+
echo "WARNING: FAILED fanned-out attempt in $@, retrying with NUT_MAKE_SKIP_FANOUT" >&2 ; \
837+
$(MAKE) $(AM_MAKEFLAGS) NUT_MAKE_SKIP_FANOUT=true SPELLCHECK_TGT='$@' -k -s $(SPELLCHECK_DIRS) \
838+
) || exit ; \
786839
if [ x'$@' = xspellcheck-interactive ] ; then \
787840
echo "SUCCESS: $@: follow up with spellcheck-quick to revise and update timestamps"; \
788841
$(MAKE) $(AM_MAKEFLAGS) spellcheck-quick ; \
@@ -1087,6 +1140,10 @@ $(abs_top_builddir)/ChangeLog: tools/gitlog2changelog.py dummy-stamp
10871140
ChangeLog.adoc: ChangeLog @dotMAKE@
10881141
+cd $(abs_top_builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) ../ChangeLog.adoc
10891142

1143+
prep-linkman-generated: @dotMAKE@
1144+
@rm -f docs/man/.all.nut_linkman-generated.timestamp
1145+
+cd $(abs_top_builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) prep-linkman-generated
1146+
10901147
nut_version.h include/nut_version.h: @dotMAKE@
10911148
@rm -f include/.all.nut_version-generated.timestamp
10921149
+cd $(abs_top_builddir)/include && $(MAKE) $(AM_MAKEFLAGS) nut_version.h

NEWS.adoc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ https://github.com/networkupstools/nut/milestone/12
8686
not-requested (e.g. do not start `upsd` in `MODE=netclient`), even though
8787
the unit is nominally enabled; this should make packaging and providing
8888
service pre-sets more simple. [issue #837, PR #3233]
89+
+
90+
In a way, this should also fix fallout of a change delivered in NUT v2.8.4
91+
release, where `upsmon` could have started with `MODE=none` in `nut.conf`,
92+
but the `nutshutdown` script would bail out quickly and quietly. [PR #3008]
8993
* Fixed thread-safety of IP address printout in `libupsclient` method
9094
`upscli_tryconnect()` (practical bug seen in `nut-scanner` parallel scans).
9195
[issue #3234]
@@ -327,7 +331,7 @@ https://github.com/networkupstools/nut/milestone/12
327331

328332
- `upsd` data server updates:
329333
* Sometimes "Data for UPS [X] is stale" and "UPS [X] data is no longer
330-
stale" messages were logged in the same second, especially no busy
334+
stale" messages were logged in the same second, especially on busy
331335
systems. Now we allow one more second on top of `MAXAGE` setting to
332336
declare the device dead, just in case fractional/whole second rounding
333337
comes into play and breaks things. [issue #661]
@@ -337,7 +341,10 @@ https://github.com/networkupstools/nut/milestone/12
337341
operating system allows, by only waiting for that amount of Unix sockets
338342
or Windows `HANDLE`'s at a time, and moving on to another chunk.
339343
The system-provided value can be further limited by `NUT_SYSMAXCONN_LIMIT`
340-
environment variable (e.g. in tests). [#3302]
344+
environment variable (e.g. in tests). For the other side of the coin, the
345+
NIT script now supports an optional `DUMMY_UPS_SWARM_COUNT` environment
346+
variable which can specify the amount of additional drivers to spawn for
347+
the sake of stress-testing, and `UPSLOG_SWARM_COUNT` for clients. [#3302]
341348
* Extended processing of `CERTREQUEST` setting to handle numeric or specific
342349
string values, to match both ways of reading ambiguous documentation.
343350
Added `configure --with-ssl-client-validation` toggle to expose the
@@ -502,6 +509,8 @@ several `FSD` notifications into one executed action. [PR #3097]
502509
* Added an option to (primarily) `--disable-threading` for systems with
503510
detected but broken `libpthread` support, or to test alternate code
504511
paths during development or in CI. [#3300]
512+
* Adjusted C++ header search path on Termux when `-isystem` is involved,
513+
as noted with NSS builds. [issues #1599, #1711, PR #3353]
505514

506515
- Recipes, CI and helper script updates not classified above:
507516
* Fixed CI recipes for PyPI publication of PyNUT(Client) module to also

clients/Makefile.am

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ CLEANFILES =
1616
# optionally includes "common.h" with the NUT build setup - and this option
1717
# was never triggered in fact, not until pushed through command line like this:
1818
AM_CXXFLAGS = -DHAVE_NUTCOMMON=1 -I$(top_builddir)/include -I$(top_srcdir)/include
19-
if WITH_SSL
20-
AM_CXXFLAGS += $(LIBSSL_CFLAGS)
21-
endif WITH_SSL
19+
if WITH_SSL_CXX
20+
AM_CXXFLAGS += $(LIBSSL_CXXFLAGS)
21+
endif WITH_SSL_CXX
2222

2323
# Make sure out-of-dir dependencies exist (especially when dev-building parts):
2424
$(top_builddir)/include/nut_version.h \
@@ -309,9 +309,9 @@ if HAVE_WINDOWS
309309
# Many versions of MingW seem to fail to build non-static DLL without this
310310
libnutclient_la_LDFLAGS += -no-undefined
311311
endif HAVE_WINDOWS
312-
if WITH_SSL
312+
if WITH_SSL_CXX
313313
libnutclient_la_LIBADD += $(LIBSSL_LDFLAGS_RPATH) $(LIBSSL_LIBS)
314-
endif WITH_SSL
314+
endif WITH_SSL_CXX
315315
else !HAVE_CXX11
316316
EXTRA_DIST += nutclient.h nutclient.cpp
317317
endif !HAVE_CXX11

0 commit comments

Comments
 (0)