Skip to content

Commit 71815b5

Browse files
authored
Merge pull request #3453 from jimklimov/fix-ci-freebsd15
Recipe, source and docs revision due to FreeBSD 15 worker and NUT CI farm JDK bumps
2 parents 8603f25 + 77decfc commit 71815b5

24 files changed

Lines changed: 326 additions & 85 deletions

.github/pull_request_template.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@
3838
quality and content of the change, and is presumed to have the right to
3939
post that code to be published further under the project's license terms.
4040

41+
- [ ] Especially with involvement of AI, including modern IDE coding aid,
42+
please be sure to revise that proposed code and documentation changes
43+
follow NUT code style guide -- this helps portability across the decades
44+
worth of supported systems. Notably, avoid Unicode characters where ASCII
45+
text is expected (C sources and headers, manual pages and other `acsiidoc`
46+
inputs). Particularly AI is keen on adding `mdash` characters instead of
47+
plain ASCII double-dash (which renders into the long dash where applicable).
48+
4149
- [ ] Please star NUT on GitHub, this helps with sponsorships! ;)
4250

4351
## Frequent "underwater rocks" for driver addition/update PRs

Jenkinsfile-dynamatrix

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,10 +1355,46 @@ set | sort -n """
13551355
summary = dynamatrix.toStringStageCountDump()
13561356
} catch (Throwable t) {}
13571357

1358+
try {
1359+
// TRY: Implementation below requires https://plugins.jenkins.io/ircbot (+ setup)
1360+
if (summary == null || summary == "") {
1361+
ircNotify (notificationStrategy:'FAILURE_AND_FIXED')
1362+
} else {
1363+
ircNotify (notificationStrategy:'FAILURE_AND_FIXED', customMessage: summary)
1364+
}
1365+
} catch (Throwable t) {
1366+
echo "Failed to ircNotify() a notification: ${t}"
1367+
}
1368+
}
1369+
1370+
dynacfgPipeline.notifyHandlerAlert = { String msg ->
1371+
def summary = null
1372+
try {
1373+
summary = dynamatrix.toStringStageCountDump()
1374+
summary += "\n\n" + dynamatrix.toStringStageCountPerNodeDump()
1375+
} catch (Throwable t) {}
1376+
13581377
if (summary == null || summary == "") {
1359-
ircNotify (notificationStrategy:'FAILURE_AND_FIXED')
1378+
summary = "Got some alert about Jenkins-Dynamatrix run ${BUILD_URL}"
13601379
} else {
1361-
ircNotify (notificationStrategy:'FAILURE_AND_FIXED', customMessage: summary)
1380+
summary = "Got an alert about Jenkins-Dynamatrix run ${BUILD_URL} : ${summary}"
1381+
}
1382+
if (msg != null && msg != "") {
1383+
summary += "\n\n${msg}"
1384+
}
1385+
1386+
try {
1387+
// TRY: Implementation below requires https://plugins.jenkins.io/email-ext
1388+
1389+
// NOTE: If someone adapts this pipeline to their repository,
1390+
// be sure to change these settings (currently NUT-specific):
1391+
emailext (attachLog: false,
1392+
to: "nutci-alerts@networkupstools.org",
1393+
subject: "Alert from NUT CI farm job ${JOB_NAME} build ${BUILD_ID}",
1394+
body: summary
1395+
)
1396+
} catch (Throwable t) {
1397+
echo "Failed to emailext() a notification: ${t}"
13621398
}
13631399
}
13641400

@@ -1383,7 +1419,7 @@ def stageNameFunc_ShellcheckCustom(DynamatrixSingleBuildConfig dsbc) {
13831419
if ( env?.BRANCH_NAME ==~ /.*verbose.*/ )
13841420
{
13851421
dynamatrixGlobalState.enableDebugTrace = true
1386-
//dynamatrixGlobalState.enableDebugTraceResolver = true
1422+
//dynamatrixGlobalState.enableDebugTraceResolver = true
13871423
dynamatrixGlobalState.enableDebugErrors = true
13881424
dynamatrixGlobalState.enableDebugMilestones = true
13891425
dynamatrixGlobalState.enableDebugMilestonesDetails = true

Makefile.am

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,11 +1782,28 @@ git-realclean-check:
17821782
# separately from the probably slower/louder stages for test programs like
17831783
# check-NIT:
17841784
CHECK_FILES_QUICK_TARGETS = check-man
1785+
17851786
if WITH_SPELLCHECK
17861787
CHECK_FILES_QUICK_TARGETS += spellcheck-quick
17871788
endif WITH_SPELLCHECK
1789+
1790+
if HAVE_PERL
1791+
CHECK_FILES_QUICK_TARGETS += check-source-nonascii
1792+
endif HAVE_PERL
1793+
17881794
check-files-quick: $(CHECK_FILES_QUICK_TARGETS)
17891795

1796+
# Style check of sorts, except that some older systems may refuse to handle
1797+
# source files with wide/multi-byte characters (have yet to see complaints
1798+
# about single-byte non-ASCII). So far not listing C++ here as its tools are
1799+
# more modern (we mostly care about C++11 and newer).
1800+
check-source-nonascii:
1801+
@echo " CHECK-SOURCE-NONASCII **/*.c **/*.h"
1802+
@ @PERL@ $(top_srcdir)/tools/check-source-nonascii.pl $(top_srcdir)/*/*.c $(top_srcdir)/*/*.h $(top_srcdir)/*/*/*.c $(top_srcdir)/*/*/*.h
1803+
1804+
# TBD: clang-format, etc?
1805+
stylecheck: check-source-nonascii
1806+
17901807
# Autotools hook: run the quick checks before recursing for defaults:
17911808
check-recursive: check-files-quick
17921809

NEWS.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ https://github.com/networkupstools/nut/milestone/13
148148
names not exposed with dynamic linking metadata (e.g. some Mozilla NSS
149149
dependencies were not previously discovered and bundled). [issue #3420,
150150
PRs #3429, #3432]
151+
* Updated a NUT CI farm worker to FreeBSD 15 and updated the recipes and
152+
documentation according to problems that were found along the way. [#3453]
153+
* Jenkins used as the NUT CI farm core has bumped JDK requirements for its
154+
controllers and build agents, `docs/config-prereqs.txt` revised.
151155

152156

153157
Release notes for NUT 2.8.5 - what's new since 2.8.4

ci_build.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ fi
215215
[ -n "$MAKE_FLAGS_VERBOSE" ] || MAKE_FLAGS_VERBOSE="VERBOSE=1 V=1 -s"
216216
[ -n "$MAKE_FLAGS_CLEAN" ] || MAKE_FLAGS_CLEAN="${MAKE_FLAGS_QUIET}"
217217

218-
normalize_path() {
218+
normalize_path_perl() {
219+
perl -e 'my %PATH; while (<>) { foreach my $D (split(/[:\r\n]/, $_)) { if (length($D) > 0 && !defined($PATH{$D})) { $PATH{$D} = scalar keys %PATH; } } } ; my $joined = join ":", sort { $PATH{$a} <=> $PATH{$b} } keys %PATH; print "$joined";'
220+
}
221+
222+
normalize_path_shell() {
219223
# STDIN->STDOUT: strip duplicate "/" and extra ":" if present,
220224
# leave first copy of duplicates in (preferred) place
221225
sed -e 's,:::*,:,g' -e 's,^:*,,' -e 's,:*$,,' -e 's,///*,/,g' \
@@ -237,6 +241,19 @@ normalize_path() {
237241
)
238242
}
239243

244+
HAVE_PERL=false
245+
if perl -e 1 2>/dev/null; then
246+
HAVE_PERL=true
247+
fi
248+
249+
normalize_path() {
250+
if $HAVE_PERL ; then
251+
normalize_path_perl "$@"
252+
else
253+
normalize_path_shell "$@"
254+
fi
255+
}
256+
240257
propose_CI_CCACHE_SYMLINKDIR() {
241258
# This is where many symlinks like "gcc -> ../bin/ccache" reside:
242259
echo \
@@ -1282,6 +1299,7 @@ configure_nut() {
12821299
while : ; do # Note the CI_SHELL_IS_FLAKY=true support below
12831300
echo "=== CONFIGURING NUT: $CONFIGURE_SCRIPT ${CONFIG_OPTS_STR}"
12841301
echo "=== CC='$CC' CXX='$CXX' CPP='$CPP'"
1302+
echo "=== PATH='$PATH'"
12851303
12861304
[ -z "${CI_SHELL_IS_FLAKY-}" ] || echo "=== CI_SHELL_IS_FLAKY='$CI_SHELL_IS_FLAKY'"
12871305
if [ x"${DO_USE_AUTOCONF_CACHE}" = xyes ] && [ -n "${CI_CACHE_NUT_HASHDIR_CFG_OPT}" ] && [ -s "${CI_CACHE_NUT_HASHDIR_CFG}/config.cache" ] ; then
@@ -1773,6 +1791,8 @@ export DO_CLEAN_AUTOCONF_CACHE_BEFORE
17731791
17741792
echo "Processing BUILD_TYPE='${BUILD_TYPE}' ..."
17751793
1794+
PATH="`echo \"${PATH}\" | normalize_path`"
1795+
17761796
ensure_CI_CCACHE_SYMLINKDIR_envvar
17771797
echo "Build host settings:"
17781798
set | ${EGREP} '^(PATH|[^ ]*CCACHE[^ ]*|CI_[^ ]*|OS_[^ ]*|CANBUILD_[^ ]*|NODE_LABELS|MAKE|C[^ ]*FLAGS|LDFLAGS|ARCH[^ ]*|BITS[^ ]*|CC|CXX|CPP|DO_[^ ]*|BUILD_[^ ]*|[^ ]*_TGT|INPLACE_RUNTIME)=' | sed 's,\(.\)$,\1 \\,' || true

clients/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ if HAVE_WINDOWS
314314
libnutclient_la_LDFLAGS += -no-undefined
315315
endif HAVE_WINDOWS
316316
if WITH_SSL_CXX
317-
libnutclient_la_LIBADD += $(LIBSSL_LDFLAGS_RPATH) $(LIBSSL_LIBS)
317+
libnutclient_la_LIBADD += $(LIBSSL_LDFLAGS_RPATH) $(LIBSSL_LIBS_CXX)
318318
endif WITH_SSL_CXX
319319
else !HAVE_CXX11
320320
EXTRA_DIST += nutclient.h nutclient.cpp

clients/upsstats.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,13 @@ static void ups_connect(void)
536536
}
537537

538538
if (currups && upscli_connect(&ups, hostname, port, UPSCLI_CONN_TRYSSL) < 0)
539-
fprintf(stderr, "UPS [%s]: can't connect to server: %s\n", currups->sys, upscli_strerror(&ups));
539+
fprintf(stderr, "UPS [%s]: can't connect to server: %s\n",
540+
currups ? NUT_STRARG(currups->sys) : "<currups=null>",
541+
upscli_strerror(&ups));
540542

541543
lastups = currups;
542-
upsdebug_call_finished2(": pick first device on newly connected data server [%s]", NUT_STRARG(currups->sys));
544+
upsdebug_call_finished2(": pick first device on newly connected data server [%s]",
545+
currups ? NUT_STRARG(currups->sys) : "<currups=null>");
543546
}
544547

545548
static void do_hostlink(void)

configure.ac

Lines changed: 77 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,19 @@ AC_MSG_RESULT([${CONFIG_FLAGS}])
148148
AC_DEFINE_UNQUOTED([CONFIG_FLAGS],["${CONFIG_FLAGS}"],[Flags passed to configure script])
149149
AC_SUBST(CONFIG_FLAGS)
150150

151+
dnl Some versions of ccache take poorly to an exported empty CCACHE_DIR etc.
152+
dnl ccache: error: CCACHE_DIR must not be the empty string
153+
dnl and this breaks "checking for C compiler version" in a standard step below
154+
AS_IF([set | ${EGREP} '^CCACHE_DIR(=|=""|='"''"')$'], [
155+
AC_MSG_NOTICE([Unsetting a provided but empty CCACHE_DIR environment variable])
156+
AS_UNSET([CCACHE_DIR])
157+
])
158+
159+
AS_IF([set | ${EGREP} '^CCACHE_PATH(=|=""|='"''"')$'], [
160+
AC_MSG_NOTICE([Resetting a provided but empty CCACHE_PATH environment variable to current PATH])
161+
CCACHE_PATH="${PATH}"
162+
])
163+
151164
AC_CHECK_PROGS([MKTEMP], [mktemp], [])
152165
AS_IF([test x"${MKTEMP}" = x], [
153166
dnl # Have a simple (unsafe, unfeatured) fallback implementation:
@@ -260,7 +273,14 @@ dnl But OpenBSD 6.5 requires autoconf-2.65 and automake-1.13 or newer...
260273
AS_IF([test x"${nut_enable_configure_debug}" = xyes], [
261274
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) CFLAGS_BEFORE_ACPROG="${CFLAGS-}"])
262275
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) CXXFLAGS_BEFORE_ACPROG="${CXXFLAGS-}"])
276+
dnl Find and report the location of attempted compiler
277+
dnl (maybe wrapped with something like ccache, distcc, etc.)
278+
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) PATH='${PATH}'])
279+
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) CCACHE_PATH='${CCACHE_PATH}'])
280+
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) Compiler location: CC: '${CC}' => '`command -v ${CC}`'])
281+
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) Compiler location: CXX: '${CXX}' => '`command -v ${CXX}`'])
263282
])
283+
264284
AC_MSG_CHECKING(for autoconf macro to enable system extensions)
265285
m4_version_prereq(2.61, [
266286
AC_MSG_RESULT(yes)
@@ -278,6 +298,9 @@ dnl Macro AC_PROG_CC_C99 is obsolete; use AC_PROG_CC
278298
dnl Note that NUT does not support building with C89 anyway
279299
dnl AC_PROG_CC_C99
280300
dnl Needed for per-target flags
301+
dnl NOTE: The AM macro below wraps its AC name-sake to perform
302+
dnl additional tricks needed for automake. There seems to not be
303+
dnl a CXX variant of that however, or at least not ubiquitoisly.
281304
AM_PROG_CC_C_O
282305
AC_PROG_CPP
283306
AC_PROG_CXX
@@ -2297,6 +2320,22 @@ printf("%ld ", GetAdaptersInfo(buf, &bufsz))
22972320
AC_SUBST([NETLIBS_GETADDRS])
22982321
AC_CACHE_VAL([nut_cv_var_NETLIBS_GETADDRS], [nut_cv_var_NETLIBS_GETADDRS="${NETLIBS_GETADDRS}"])
22992322

2323+
dnl ----------------------------------------------------------------------
2324+
dnl Simple check that it exists and can be executed
2325+
AC_PATH_PROGS([PERL], perl, [none])
2326+
AS_IF([test x"${PERL}" != xnone], [
2327+
AC_MSG_CHECKING([whether PERL interpreter is basically usable: '${PERL}'])
2328+
AS_IF([${PERL} -e 1 >/dev/null], [
2329+
AC_MSG_RESULT([yes])
2330+
], [
2331+
AC_MSG_RESULT([no])
2332+
PERL=none
2333+
])
2334+
])
2335+
2336+
AC_SUBST([PERL])
2337+
AM_CONDITIONAL([HAVE_PERL], [test x"$PERL" != xnone])
2338+
23002339
dnl ----------------------------------------------------------------------
23012340
dnl First remember if caller wants a custom Python package location?
23022341
NUT_ARG_WITH([python-modules-dir], [install the PyNUT module files under specified path for default Python interpreter (auto for its reported site-packages location, if not with UI app)], [auto])
@@ -4263,14 +4302,18 @@ dnl not fail if we have no tools to generate it (so add to SKIP list).
42634302

42644303
esac
42654304
done
4266-
rm -rf "${DOCTESTDIR}"
42674305

42684306
AS_IF([test x"${nut_enable_configure_debug}" = xyes], [
42694307
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_BUILD_LIST: '${DOC_BUILD_LIST}'])
42704308
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_CANNOTBUILD_LIST: '${DOC_CANNOTBUILD_LIST}'])
42714309
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_SKIPBUILD_LIST: '${DOC_SKIPBUILD_LIST}'])
42724310
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_INSTALL_DISTED_MANS: '${DOC_INSTALL_DISTED_MANS}'])
42734311
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_INSTALL_SELECTED_MANS: '${DOC_INSTALL_SELECTED_MANS}'])
4312+
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) This script's DOCTESTDIR: '${DOCTESTDIR}'])
4313+
],[
4314+
dnl If we are debugging, and doc generation fails, we want the directory
4315+
dnl else remove it later (after confirming success) below
4316+
rm -rf "${DOCTESTDIR}"
42744317
])
42754318

42764319
case "${nut_with_doc}" in
@@ -4315,6 +4358,11 @@ AM_CONDITIONAL(WITH_PDF_NONASCII_TITLES, [test x"$can_build_doc_pdf_nonascii_tit
43154358
NUT_REPORT_FEATURE([would build specific documentation format(s)], [${nut_with_doc}], [${DOC_BUILD_LIST} ${DOC_INSTALL_SELECTED_MANS}],
43164359
[WITH_DOCS], [Define to enable overall documentation generation], [-])
43174360

4361+
AS_IF([test x"${nut_enable_configure_debug}" = xyes], [
4362+
dnl Delayed clean-up after success of desired doc types:
4363+
rm -rf "${DOCTESTDIR}"
4364+
])
4365+
43184366
# To cater for less portable make's, precalculate the target list
43194367
# for "make check" in "docs/" here...
43204368
DOC_CHECK_LIST=""
@@ -6627,18 +6675,24 @@ dnl # -Wno-c11-extensions -- clang-21 on Ubuntu 26.04 at least complains a lot
66276675
dnl # about system headers (string.h, cdefs.h, etc.) using __glibc_const_generic
66286676
dnl # -Wno-used-but-marked-unused -- openssl and clang do not always agree...
66296677
dnl # -Wno-thread-safety-negative -- clang bug, it seems (https://reviews.llvm.org/D84604)
6678+
dnl # -Wno-unused-command-line-argument -- avoid the likes of (clang++)
6679+
dnl # error: argument unused during compilation: '-pthread'
6680+
dnl # (apparently in FreeBSD 15 builds something gets into the wrong *FLAGS,
6681+
dnl # maybe via pkg-config... or it was just the first one to notice and yell)
66306682
AS_CASE(["${nut_enable_warnings}"],
66316683
[all], [
66326684
CFLAGS="${CFLAGS} -Wall"
66336685
CXXFLAGS="${CXXFLAGS} -Wall"
66346686
],
66356687
[clang-hard], [
6636-
CFLAGS="${CFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c11-extensions -pedantic -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-thread-safety-negative"
6637-
CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-exit-time-destructors -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-thread-safety-negative"
6688+
CFLAGS="${CFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c11-extensions -pedantic -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-thread-safety-negative -Wno-unused-command-line-argument"
6689+
CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-exit-time-destructors -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-thread-safety-negative -Wno-unused-command-line-argument"
6690+
LDFLAGS="${LDFLAGS} -Wno-unused-command-line-argument"
66386691
],
66396692
[clang-medium], [
6640-
CFLAGS="${CFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c11-extensions -pedantic -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-float-conversion -Wno-double-promotion -Wno-implicit-float-conversion -Wno-conversion -Wno-incompatible-pointer-types-discards-qualifiers -Wno-incompatible-function-pointer-types-strict -Wno-nullable-to-nonnull-conversion -Wno-used-but-marked-unused -Wno-thread-safety-negative"
6641-
CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-exit-time-destructors -Wno-global-constructors -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-nullable-to-nonnull-conversion -Wno-used-but-marked-unused -Wno-thread-safety-negative"
6693+
CFLAGS="${CFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c11-extensions -pedantic -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-float-conversion -Wno-double-promotion -Wno-implicit-float-conversion -Wno-conversion -Wno-incompatible-pointer-types-discards-qualifiers -Wno-incompatible-function-pointer-types-strict -Wno-nullable-to-nonnull-conversion -Wno-used-but-marked-unused -Wno-thread-safety-negative -Wno-unused-command-line-argument"
6694+
CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-exit-time-destructors -Wno-global-constructors -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-nullable-to-nonnull-conversion -Wno-used-but-marked-unused -Wno-thread-safety-negative -Wno-unused-command-line-argument"
6695+
LDFLAGS="${LDFLAGS} -Wno-unused-command-line-argument"
66426696
],
66436697
[clang-minimal], [
66446698
CFLAGS="${CFLAGS} -ferror-limit=0 -Wall -Wextra -Wno-documentation -Wno-documentation-unknown-command -fcomment-block-commands=retval"
@@ -7028,8 +7082,9 @@ AC_ARG_VAR(CCACHE_DIR)
70287082
AC_ARG_VAR(CCACHE_PATH)
70297083

70307084
dnl Some versions of ccache take poorly to an exported empty CCACHE_DIR etc.
7031-
dnl Avoid exporting them if not set at the configure time (assuming ci_build.sh
7032-
dnl integration or user's shell profile sets them persistently)
7085+
dnl ccache: error: CCACHE_DIR must not be the empty string
7086+
dnl Avoid exporting them if NOT set at the configure time (assuming ci_build.sh
7087+
dnl integration or user's shell profile sets them persistently... or empty)
70337088
AS_IF([test x"${CCACHE_NAMESPACE-}" = x], [NUT_AM_EXPORT_CCACHE_NAMESPACE="#"], [NUT_AM_EXPORT_CCACHE_NAMESPACE=""])
70347089
AC_SUBST(NUT_AM_EXPORT_CCACHE_NAMESPACE)
70357090
AS_IF([test x"${CCACHE_BASEDIR-}" = x], [NUT_AM_EXPORT_CCACHE_BASEDIR="#"], [NUT_AM_EXPORT_CCACHE_BASEDIR=""])
@@ -7268,6 +7323,21 @@ AC_SUBST(LIBSSL_CXXFLAGS)
72687323
NUT_REPORT_FEATURE([enable SSL support in C++ client library], [${nut_with_ssl_cxx}], [${nut_ssl_lib}],
72697324
[WITH_SSL_CXX], [Define to enable SSL in libnutclient])
72707325

7326+
dnl At least FreeBSD clang complains about NSS builds with
7327+
dnl error: argument unused during compilation: '-pthread'
7328+
dnl which pops up in LDFLAGS/LIBS and is kept as "compiler"
7329+
dnl flag when calling the linker.
7330+
dnl Does not hurt plain C builds though.
7331+
LIBSSL_LIBS_CXX="${LIBSSL_LIBS}"
7332+
AS_IF([test "$nut_with_ssl_cxx" = "yes"],
7333+
[AS_CASE([$LIBSSL_LIBS_CXX],
7334+
[*" -pthread "*|"-pthread "*|*" -pthread"|-pthread], [
7335+
AC_MSG_NOTICE([Remove -pthread from LIBSSL_LIBS for C++ builds])
7336+
LIBSSL_LIBS_CXX="`echo \"${LIBSSL_LIBS}\" | sed 's, *-pthread *, ,'`"
7337+
])
7338+
])
7339+
AC_SUBST(LIBSSL_LIBS_CXX)
7340+
72717341
AC_DEFINE_UNQUOTED([EXEEXT], ["${EXEEXT}"], [Platform-specific extension for binary program files (may be empty where not required)])
72727342
AC_SUBST(EXEEXT)
72737343

0 commit comments

Comments
 (0)