Skip to content

Commit 9d05ac9

Browse files
authored
Merge pull request #2929 from jimklimov/issue-2927
Fix `configure --with-drivers=dummy-ups`
2 parents dfe6062 + 2582c93 commit 9d05ac9

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

NEWS.adoc

+5-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ https://github.com/networkupstools/nut/milestone/9
4646
* Fixed a regression in recipes of NUT v2.8.3 release (as compared to
4747
v2.8.2), where `configure --with-docs=all` no longer failed a run
4848
of the `configure` script when some of the required rendering tools
49-
were not in fact available. [#2842]
49+
were not in fact available. [#2842, fixed by #2921]
50+
* A change in `Makefile.am` recipes to evaluate some driver names in the
51+
`DRIVERLIST` variables inspected by `configure` script, rather than
52+
having all their names hard-coded like before, led to inability to
53+
`configure --with-drivers=dummy-ups`. [#2825, #2927, fixed by PR #2929]
5054

5155
- common code:
5256
* Revised common `writepid()` to use `altpidpath()` as location for the

configure.ac

+31-5
Original file line numberDiff line numberDiff line change
@@ -2128,31 +2128,57 @@ AC_ARG_WITH(drivers,
21282128
MACOSX_DRIVERLIST MODBUS_DRIVERLIST LINUX_I2C_DRIVERLIST
21292129
POWERMAN_DRIVERLIST IPMI_DRIVERLIST GPIO_DRIVERLIST"
21302130
2131-
get_drvlist() (
2131+
dnl Gets ONE Makefile assignment value
2132+
get_drivers_makefile_value() (
21322133
dnl Note escaped brackets - "against" m4 parser
21332134
m4_version_prereq(2.62,
21342135
[LB="@<:@"; RB="@:>@"],
21352136
[LB="[["; RB="]]"]
21362137
)
2138+
dnl ###DEBUG### echo "RECURSIVE SEARCH FOR: '$1'" >&2
21372139
SPACE="`printf "$LB"' \t'"$RB"`"
21382140
SPACES="${SPACE}*"
21392141
sed -e "s/${SPACES}""$LB"'+'"$RB"'*='"${SPACES}/=/" \
21402142
-e "s/^${SPACES}//" < "$srcdir/drivers/Makefile.am" \
2141-
| {
2143+
| (
21422144
C=false; V=false
21432145
while read LINE ; do
21442146
case "$LINE" in
21452147
*'\') C=true; if $V ; then echo "$LINE" ; fi ;;
2146-
*) C=false; V=false ;;
2148+
*) if $C ; then exit 0; fi ; C=false; V=false ;;
21472149
esac
21482150
case "$LINE" in
21492151
"$1"=*)
2150-
echo "$LINE" | sed -e 's,^'"$LB"'^='"$RB"'*=,,' -e 's,\$,,'
2152+
echo "$LINE" | sed -e 's,^'"$LB"'^='"$RB"'*=,,'
21512153
V=$C
21522154
;;
21532155
esac
21542156
done
2155-
} | tr '\n' ' ' | sed -e "s,${SPACE}${SPACES}, ," -e "s,${SPACES}\$,,"
2157+
echo ""
2158+
) | tr '\n' ' ' | sed -e 's,\$(EXEEXT),,g' \
2159+
| tr ' ' '\n' | while read TOKEN ; do
2160+
case x"${TOKEN}" in
2161+
x) ;;
2162+
'x$('*')') get_drivers_makefile_value "`echo "${TOKEN}" | sed -e 's,^\$(,,' -e 's,)$,,'`" ;;
2163+
'x${'*'}') get_drivers_makefile_value "`echo "${TOKEN}" | sed -e 's,^\${,,' -e 's,}$,,'`" ;;
2164+
*) echo "${TOKEN} " ;;
2165+
esac
2166+
done dnl ###DEBUG### | tee -a /dev/stderr
2167+
)
2168+
2169+
get_drvlist() (
2170+
m4_version_prereq(2.62,
2171+
[LB="@<:@"; RB="@:>@"],
2172+
[LB="[["; RB="]]"]
2173+
)
2174+
dnl ###DEBUG### echo "SEARCH FOR: '$1'" >&2
2175+
SPACE="`printf "$LB"' \t'"$RB"`"
2176+
SPACES="${SPACE}*"
2177+
2178+
dnl Let it recurse, and only then we collect the
2179+
dnl result into one string with reduced spaces:
2180+
get_drivers_makefile_value "$1" \
2181+
| tr '\n' ' ' | sed -e "s,${SPACE}${SPACES}, ,g" -e "s,${SPACES}\$,,"
21562182
)
21572183
21582184
for DRVLIST_NAME in $DRVLIST_NAMES; do

0 commit comments

Comments
 (0)