Skip to content

Commit 304f0c3

Browse files
authored
Merge pull request #2921 from jimklimov/issue-2842
Fix fallout from PR #2842 : do fail `configure` when requested doc types can not be built
2 parents 59ff716 + 0db755e commit 304f0c3

File tree

3 files changed

+36
-16
lines changed

3 files changed

+36
-16
lines changed

NEWS.adoc

+7
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ https://github.com/networkupstools/nut/milestone/9
4141

4242
- (expected) Bug fixes for fallout possible due to "fightwarn" effort in 2.8.0+
4343

44+
- Fix fallout of development in NUT v2.8.0 and/or v2.8.1 and/or v2.8.2 and/or
45+
v2.8.3:
46+
* Fixed a regression in recipes of NUT v2.8.3 release (as compared to
47+
v2.8.2), where `configure --with-docs=all` no longer failed a run
48+
of the `configure` script when some of the required rendering tools
49+
were not in fact available. [#2842]
50+
4451
- common code:
4552
* Revised common `writepid()` to use `altpidpath()` as location for the
4653
PID file creation, if the default `rootpidpath()` is not accessible

configure.ac

+17-15
Original file line numberDiff line numberDiff line change
@@ -3463,9 +3463,6 @@ dnl is set to 'no', we may still want to build some doc targets manually
34633463
dnl (so enable the Makefile recipes for those targets if tools are available)
34643464
NUT_CHECK_ASCIIDOC
34653465

3466-
NUT_REPORT_FEATURE([requested to build and install documentation], [${nut_with_doc}], [],
3467-
[WITH_ASCIIDOC], [Define to enable Asciidoc support])
3468-
34693466
DOC_INSTALL_DISTED_MANS=no
34703467
KNOWN_UNABLE_MANS=no
34713468

@@ -3496,6 +3493,9 @@ dnl If user passed --with-doc='' they they want nothing, right?
34963493
;;
34973494
esac
34983495

3496+
NUT_REPORT_FEATURE([requested to build and install documentation], ['${nut_with_doc}' => '${nut_doc_build_list}'], [],
3497+
[WITH_ASCIIDOC], [Define to enable Asciidoc support], [-])
3498+
34993499
if test -z "${abs_srcdir}" ; then
35003500
case "${srcdir}" in
35013501
/*) abs_srcdir="${srcdir}";;
@@ -3574,7 +3574,7 @@ dnl not fail if we have no tools to generate it (so add to SKIP list).
35743574
AC_MSG_RESULT(no)
35753575
DOC_CANNOTBUILD_LIST="${DOC_CANNOTBUILD_LIST} ${nut_doc_build_target_base}"
35763576
if test "${nut_doc_build_target_flag}" = "yes" ; then
3577-
AC_MSG_WARN([Unable to build ${nut_doc_build_target_base} documentation which you requested])
3577+
AC_MSG_WARN([Unable to build ${nut_doc_build_target_base} documentation which you requested; will reflect on this below])
35783578
else
35793579
DOC_SKIPBUILD_LIST="${DOC_SKIPBUILD_LIST} ${nut_doc_build_target_base}"
35803580
fi
@@ -3597,7 +3597,7 @@ dnl not fail if we have no tools to generate it (so add to SKIP list).
35973597
AC_MSG_RESULT(no)
35983598
DOC_CANNOTBUILD_LIST="${DOC_CANNOTBUILD_LIST} ${nut_doc_build_target_base}"
35993599
if test "${nut_doc_build_target_flag}" = "yes" ; then
3600-
AC_MSG_WARN([Unable to build ${nut_doc_build_target_base} documentation which you requested])
3600+
AC_MSG_WARN([Unable to build ${nut_doc_build_target_base} documentation which you requested; will reflect on this below])
36013601
else
36023602
DOC_SKIPBUILD_LIST="${DOC_SKIPBUILD_LIST} ${nut_doc_build_target_base}"
36033603
fi
@@ -3623,7 +3623,7 @@ dnl not fail if we have no tools to generate it (so add to SKIP list).
36233623
AC_MSG_RESULT(no)
36243624
DOC_CANNOTBUILD_LIST="${DOC_CANNOTBUILD_LIST} ${nut_doc_build_target_base}"
36253625
if test "${nut_doc_build_target_flag}" = "yes" ; then
3626-
AC_MSG_WARN([Unable to build ${nut_doc_build_target_base} documentation which you requested])
3626+
AC_MSG_WARN([Unable to build ${nut_doc_build_target_base} documentation which you requested; will reflect on this below])
36273627
else
36283628
DOC_SKIPBUILD_LIST="${DOC_SKIPBUILD_LIST} ${nut_doc_build_target_base}"
36293629
fi
@@ -3660,7 +3660,7 @@ dnl not fail if we have no tools to generate it (so add to SKIP list).
36603660
DOC_CANNOTBUILD_LIST="${DOC_CANNOTBUILD_LIST} ${nut_doc_build_target_base}"
36613661
KNOWN_UNABLE_MANS=yes
36623662
if test "${nut_doc_build_target_flag}" = "yes" ; then
3663-
AC_MSG_WARN([Unable to build ${nut_doc_build_target_base} documentation which you requested])
3663+
AC_MSG_WARN([Unable to build ${nut_doc_build_target_base} documentation which you requested; will reflect on this below])
36643664
else
36653665
DOC_SKIPBUILD_LIST="${DOC_SKIPBUILD_LIST} ${nut_doc_build_target_base}"
36663666
if test "${nut_doc_build_target_flag}" = "auto" || test "${nut_doc_build_target_flag}" = "dist-auto" ; then
@@ -3684,28 +3684,30 @@ done
36843684
rm -rf "${DOCTESTDIR}"
36853685

36863686
AS_IF([test x"${nut_enable_configure_debug}" = xyes], [
3687-
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_BUILD_LIST: '${DOC_BUILD_LIST}'])
3688-
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_CANNOTBUILD_LIST: '${DOC_CANNOTBUILD_LIST}'])
3689-
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_SKIPBUILD_LIST: '${DOC_SKIPBUILD_LIST}'])
3687+
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_BUILD_LIST: '${DOC_BUILD_LIST}'])
3688+
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_CANNOTBUILD_LIST: '${DOC_CANNOTBUILD_LIST}'])
3689+
AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_SKIPBUILD_LIST: '${DOC_SKIPBUILD_LIST}'])
36903690
])
36913691

36923692
case "${nut_with_doc}" in
36933693
auto)
36943694
if test -n "${DOC_BUILD_LIST}"; then
3695+
dnl # We can build at least one format...
36953696
nut_with_doc="yes"
36963697
else
3698+
dnl # We can not build any formats...
36973699
nut_with_doc="no"
36983700
fi
36993701
;;
37003702
no)
37013703
;;
3702-
*)
3704+
*) dnl # yes, all, skip...
37033705
if test -n "${DOC_CANNOTBUILD_LIST}"; then
37043706
DOC_CANNOTBUILD_LIST_LINES="`echo "${DOC_CANNOTBUILD_LIST}" | tr ' ' '\n' | grep -vE '^$'`"
3705-
for DOCTYPE in ${DOC_BUILD_LIST} ; do
3706-
if echo "${DOC_CANNOTBUILD_LIST_LINES}" | grep -E "^${DOCTYPE}(|=yes)\$" ; then
3707+
for DOCTYPE in ${nut_doc_build_list} ; do
3708+
if echo "${DOC_CANNOTBUILD_LIST_LINES}" | grep -E "^${DOCTYPE}(|=yes)\$" >/dev/null 2>/dev/null ; then
37073709
AC_MSG_ERROR([Unable to build${DOC_CANNOTBUILD_LIST} documentation (check for 'no' results above)])
3708-
else if echo "${DOC_CANNOTBUILD_LIST_LINES}" | grep -E "^${DOCTYPE}=(skip|auto|dist-auto)\$" ; then
3710+
else if echo "${DOC_CANNOTBUILD_LIST_LINES}" | grep -E "^${DOCTYPE}=(skip|auto|dist-auto)\$" >/dev/null 2>/dev/null ; then
37093711
AC_MSG_NOTICE([Unable to build${DOC_CANNOTBUILD_LIST} documentation (check for 'no' results above), skipping])
37103712
fi
37113713
fi
@@ -3727,7 +3729,7 @@ esac
37273729
AM_CONDITIONAL(WITH_PDF_NONASCII_TITLES, [test x"$can_build_doc_pdf_nonascii_titles" = xyes])
37283730

37293731
NUT_REPORT_FEATURE([would build specific documentation format(s)], [${nut_with_doc}], [${DOC_BUILD_LIST}],
3730-
[WITH_DOCS], [Define to enable overall documentation generation])
3732+
[WITH_DOCS], [Define to enable overall documentation generation], [-])
37313733

37323734
# To cater for less portable make's, precalculate the target list
37333735
# for "make check" in "docs/" here...

m4/nut_report_feature.m4

+12-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,18 @@ AC_DEFUN([NUT_REPORT_FEATURE],
111111
dnl arg#3 = value
112112
dnl arg#4 = autoconf varname
113113
dnl arg#5 = longer description (autoconf comment)
114-
AC_MSG_CHECKING([whether to $1])
114+
dnl arg#6 = (OPTIONAL) word(s) after prefix "whether" before "$1",
115+
dnl or nothing if "-"; NOTE: "whether" is not part of this
116+
dnl consideration (see NUT REPORT used below with a partial
117+
dnl message)
118+
nrf_tmp="${6-}"
119+
AS_CASE([x"${nrf_tmp}"],
120+
[x], [nrf_tmp="to "],
121+
[x-], [nrf_tmp=""]
122+
)
123+
AC_MSG_CHECKING([whether ${nrf_tmp}$1])
124+
unset nrf_tmp
125+
115126
AC_MSG_RESULT([$2 $3])
116127
NUT_REPORT([$1], [$2 $3])
117128

0 commit comments

Comments
 (0)