Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ dnl have an older version, they can use our --with-runstatedir.
sbd_runstatedir=""
AC_ARG_WITH([runstatedir],
[AS_HELP_STRING([--with-runstatedir=DIR],
[modifiable per-process data @<:@LOCALSTATEDIR/run@:>@ (ignored if --runstatedir is available)])],
[modifiable per-process data @<:@LOCALSTATEDIR/run@:>@])],
[ sbd_runstatedir="$withval" ]
)

Expand Down Expand Up @@ -343,7 +343,13 @@ expand_path_option oldincludedir
expand_path_option infodir
expand_path_option mandir

AS_IF([test x"${runstatedir}" = x""], [runstatedir="${sbd_runstatedir}"])
AS_IF([test x"${runstatedir}" = x""], [runstatedir="${sbd_runstatedir}"],
[test x"${sbd_runstatedir}" != x""], [
echo "--with-runstatedir=${sbd_runstatedir} is taking precedence"
echo "over runstatedir=${runstatedir}."
echo "Consider using --runstatedir=${sbd_runstatedir} directly or let it"
echo "go with the default."
runstatedir="${sbd_runstatedir}"])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this will only do anything if runstatedir is empty

I think we want something like

AS_IF([test x"${sbd_runstatedir}" != x""],
           [
               AS_IF([test x"${runstatedir}" != x""], [echo "...taking precedence..."])
               runstatedir="${sbd_runstatedir}"
           ])

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it did work in my tests.
According to documentation AS_IF is more like if ... then ... else if ... then ... else ...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, I misread the third block as else rather than else if

looks good to me

expand_path_option runstatedir "${localstatedir}/run"
AC_SUBST(runstatedir)

Expand Down