Skip to content

Commit

Permalink
configure.ac: Fix bashisms
Browse files Browse the repository at this point in the history
configure scripts need to be runnable with a POSIX-compliant /bin/sh.

On many (but not all!) systems, /bin/sh is provided by Bash, so errors
like this aren't spotted. Notably Debian defaults to /bin/sh provided
by dash which doesn't tolerate such bashisms as '=='.

This retains compatibility with bash.

Signed-off-by: Sam James <[email protected]>
  • Loading branch information
thesamesam committed Nov 18, 2022
1 parent 2113da3 commit 12e10f9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ PKG_PROG_PKG_CONFIG(0.18)
# PKG_CHECK_MODULES will fail if systemd is not found by default, so make sure
# we set the proper vars and deal with it
PKG_CHECK_MODULES([systemd], [systemd], [HAS_SYSTEMD=yes], [HAS_SYSTEMD=no])
if test "x$HAS_SYSTEMD" == "xyes"; then
if test "x$HAS_SYSTEMD" = "xyes"; then
PKG_CHECK_VAR([SYSTEMD_UNIT_DIR], [systemd], [systemdsystemunitdir])
if test "x$SYSTEMD_UNIT_DIR" == "x"; then
if test "x$SYSTEMD_UNIT_DIR" = "x"; then
AC_MSG_ERROR([Unable to detect systemd unit dir automatically])
fi

PKG_CHECK_VAR([SYSTEMD_TMPFILES_DIR], [systemd], [tmpfilesdir])
if test "x$SYSTEMD_TMPFILES_DIR" == "x"; then
if test "x$SYSTEMD_TMPFILES_DIR" = "x"; then
AC_MSG_ERROR([Unable to detect systemd tmpfiles directory automatically])
fi

Expand All @@ -168,7 +168,7 @@ if test "x$HAS_SYSTEMD" == "xyes"; then
fi

fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$HAS_SYSTEMD" == xyes ])
AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$HAS_SYSTEMD" = xyes ])


dnl ===============================================
Expand Down

0 comments on commit 12e10f9

Please sign in to comment.