From ac7ebcc589757af7de0a7cba68126a80224fb989 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 5 Nov 2021 10:07:37 +0100 Subject: configure: simplify calls to meson_quote meson_quote assumes a non-empty argument list, and incorrectly returns a one-entry array if passed nothing. Move the check for an empty argument list from the invocations to the function itself. Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- configure | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 33682cb..369b545 100755 --- a/configure +++ b/configure @@ -3894,6 +3894,7 @@ echo "TOPSRC_DIR=$source_path" >> $config_mak if test "$skip_meson" = no; then cross="config-meson.cross.new" meson_quote() { + test $# = 0 && return echo "'$(echo $* | sed "s/ /','/g")'" } @@ -3908,10 +3909,10 @@ if test "$skip_meson" = no; then test -z "$cxx" && echo "link_language = 'c'" >> $cross echo "[built-in options]" >> $cross - echo "c_args = [${CFLAGS:+$(meson_quote $CFLAGS)}]" >> $cross - echo "cpp_args = [${CXXFLAGS:+$(meson_quote $CXXFLAGS)}]" >> $cross - echo "c_link_args = [${LDFLAGS:+$(meson_quote $LDFLAGS)}]" >> $cross - echo "cpp_link_args = [${LDFLAGS:+$(meson_quote $LDFLAGS)}]" >> $cross + echo "c_args = [$(meson_quote $CFLAGS)]" >> $cross + echo "cpp_args = [$(meson_quote $CXXFLAGS)]" >> $cross + echo "c_link_args = [$(meson_quote $LDFLAGS)]" >> $cross + echo "cpp_link_args = [$(meson_quote $LDFLAGS)]" >> $cross echo "[binaries]" >> $cross echo "c = [$(meson_quote $cc $CPU_CFLAGS)]" >> $cross test -n "$cxx" && echo "cpp = [$(meson_quote $cxx $CPU_CFLAGS)]" >> $cross -- cgit v1.1