Skip to content

Commit 3b26401

Browse files
eli-schwartzbluca
authored andcommitted
configure: fix basic syntax errors in the shell script programming language
There is no such thing as `+=` unless you happen to be using the Bash programming language, i.e. your script shebang is /bin/bash. However, configure scripts are run via /bin/sh instead, which may or may not be be bash, usually depending on whether the system in question preferred to have one less package installed (in which case it is bash) vs. have a faster /bin/sh installed (in which case it is probably the dash shell).
1 parent 959a133 commit 3b26401

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

configure.ac

+8-8
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ ZMQ_ORIG_CXXFLAGS="${CXXFLAGS:-none}"
6666

6767
# Checks for programs.
6868
AC_PROG_CC
69-
AX_CHECK_COMPILE_FLAG([-std=c11], [CFLAGS+=" -std=c11 -D_DEFAULT_SOURCE"], [AC_PROG_CC_C99])
69+
AX_CHECK_COMPILE_FLAG([-std=c11], [CFLAGS="${CFLAGS} -std=c11 -D_DEFAULT_SOURCE"], [AC_PROG_CC_C99])
7070
AC_PROG_CXX
7171
AX_CODE_COVERAGE
7272
AM_PROG_CC_C_O
@@ -87,8 +87,8 @@ AC_ARG_ENABLE([force-CXX98-compat],
8787
[AS_HELP_STRING([--enable-force-CXX98-compat], [force C++98 build [default=disabled]])])
8888
if test "x$enable_force_CXX98_compat" = "xyes"; then
8989
AC_LANG_PUSH([C++])
90-
AX_CHECK_COMPILE_FLAG([-std=gnu++98], [CXXFLAGS+=" -std=gnu++98"], [])
91-
AX_CHECK_COMPILE_FLAG([-Wc++98-compat -Wc++98-compat-pedantic], [CXXFLAGS+=" -Wc++98-compat"], [])
90+
AX_CHECK_COMPILE_FLAG([-std=gnu++98], [CXXFLAGS="${CXXFLAGS} -std=gnu++98"], [])
91+
AX_CHECK_COMPILE_FLAG([-Wc++98-compat -Wc++98-compat-pedantic], [CXXFLAGS="${CXXFLAGS} -Wc++98-compat"], [])
9292
AC_LANG_POP([C++])
9393
else
9494
AX_CXX_COMPILE_STDCXX_11([ext], [optional])
@@ -799,7 +799,7 @@ AM_CONDITIONAL(ON_GNU, test "x$libzmq_on_gnu" = "xyes")
799799
# Check for __atomic_Xxx compiler intrinsics
800800
AC_LANG_PUSH([C++])
801801
AX_CHECK_COMPILE_FLAG([-Watomic-alignment],
802-
[CXXFLAGS+=" -Wno-atomic-alignment"],
802+
[CXXFLAGS="${CXXFLAGS} -Wno-atomic-alignment"],
803803
[],
804804
[-Werror])
805805
LIBZMQ_CHECK_ATOMIC_INTRINSICS([
@@ -1137,12 +1137,12 @@ AM_CONDITIONAL(FUZZING_ENGINE_LIB, test "x$FUZZING_ENGINE_LIB" != "x")
11371137
# clang 6 has a warning that does not make sense on multi-platform code
11381138
AC_LANG_PUSH([C])
11391139
AX_CHECK_COMPILE_FLAG([-Wtautological-constant-compare],
1140-
[CFLAGS+=" -Wno-tautological-constant-compare"],
1140+
[CFLAGS="${CFLAGS} -Wno-tautological-constant-compare"],
11411141
[],
11421142
[-Werror])
11431143
AC_LANG_POP([C])
11441144
AX_CHECK_COMPILE_FLAG([-Wtautological-constant-compare],
1145-
[CXXFLAGS+=" -Wno-tautological-constant-compare"],
1145+
[CXXFLAGS="${CXXFLAGS} -Wno-tautological-constant-compare"],
11461146
[],
11471147
[-Werror])
11481148

@@ -1151,12 +1151,12 @@ AX_CHECK_COMPILE_FLAG([-Wtautological-constant-compare],
11511151
# E: lto-no-text-in-archive
11521152
AC_LANG_PUSH([C])
11531153
AX_CHECK_COMPILE_FLAG([-ffat-lto-objects],
1154-
[CFLAGS+=" -ffat-lto-objects"],
1154+
[CFLAGS="${CFLAGS} -ffat-lto-objects"],
11551155
[],
11561156
[-Werror])
11571157
AC_LANG_POP([C])
11581158
AX_CHECK_COMPILE_FLAG([-ffat-lto-objects],
1159-
[CXXFLAGS+=" -ffat-lto-objects"],
1159+
[CXXFLAGS="${CXXFLAGS} -ffat-lto-objects"],
11601160
[],
11611161
[-Werror])
11621162

0 commit comments

Comments
 (0)