Skip to content

Commit

Permalink
configure: fix bashisms
Browse files Browse the repository at this point in the history
See also zeromq/libzmq@3b26401.

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.
  • Loading branch information
thesamesam committed Apr 8, 2024
1 parent f256329 commit 4d7b9d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no],
[With GCC Code Coverage reporting])],
[ZPROJECT_GCOV="$withval"])

if test "x${ZPROJECT_GCOV}" == "xyes"; then
if test "x${ZPROJECT_GCOV}" = "xyes"; then
CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"

if test "x${ZPROJECT_ORIG_CFLAGS}" != "xnone"; then
Expand All @@ -94,7 +94,7 @@ AC_ARG_ENABLE(address-sanitizer, [AS_HELP_STRING([--enable-address-sanitizer=yes
[Build with GCC Address Sanitizer instrumentation])],
[ZPROJECT_ASAN="$enableval"])

if test "x${ZPROJECT_ASAN}" == "xyes"; then
if test "x${ZPROJECT_ASAN}" = "xyes"; then
CFLAGS="${CFLAGS} -fsanitize=address"
CXXFLAGS="${CXXFLAGS} -fsanitize=address"

Expand All @@ -114,7 +114,7 @@ AC_ARG_ENABLE([bindings-python],
[ZPROJECT_BINDINGS_PYTHON=$enableval],
[ZPROJECT_BINDINGS_PYTHON=no])

if test "x$ZPROJECT_BINDINGS_PYTHON" == "xyes"; then
if test "x$ZPROJECT_BINDINGS_PYTHON" = "xyes"; then
AM_CONDITIONAL(ENABLE_BINDINGS_PYTHON, true)
AC_MSG_RESULT([yes])
else
Expand Down

0 comments on commit 4d7b9d7

Please sign in to comment.