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.

```
 * QA Notice: command not found:
 *
 *      /var/tmp/portage/media-libs/libsndfile-1.2.2-r2/work/libsndfile-1.2.2/configure: 25166: common_cflags+= -Wno-format-truncation: not found
 *      /var/tmp/portage/media-libs/libsndfile-1.2.2-r2/work/libsndfile-1.2.2/configure: 25173: common_cxxflags+= -Wno-format-truncation: not found
```

Signed-off-by: Sam James <sam@gentoo.org>
  • Loading branch information
thesamesam authored and SoapGentoo committed Jan 11, 2024
1 parent e486f20 commit e5ee50f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,11 @@ common_cflags="${common_flags}"
dnl Clang doesn't know about -Wno-format-truncation
dnl and would spew tons of warnings otherwise.
AS_IF([test "x$ax_cv_c_compiler_vendor" = "xgnu"], [
common_cflags+=" -Wno-format-truncation"
common_cflags="${common_cflags} -Wno-format-truncation"
])
common_cxxflags="${common_flags}"
AS_IF([test "x$ax_cv_cxx_compiler_vendor" = "xgnu"], [
common_cxxflags+=" -Wno-format-truncation"
common_cxxflags="${common_cxxflags} -Wno-format-truncation"
])

AX_APPEND_COMPILE_FLAGS([${common_cflags} -Wvla -Wbad-function-cast -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Waggregate-return], [CFLAGS])
Expand Down

0 comments on commit e5ee50f

Please sign in to comment.