diff --git a/configure.in b/configure.in index e7c2cf5fd757a47a22a5ee5514e41e9738f21db2..450866b81f1652a307aebe1c4455e3b3f6268f51 100644 --- a/configure.in +++ b/configure.in @@ -652,7 +652,7 @@ CPPFLAGS="$OLD_CPPFLAGS -m32" AC_PREPROC_IFELSE( [AC_LANG_SOURCE([/* Check if preprocessor supports option -m32 */])], [if test -e conftest.i; then - DEFAULT_CPP_SUPPORTED_ARCH_OPTS+='\"-m32\"; '; + DEFAULT_CPP_SUPPORTED_ARCH_OPTS="$DEFAULT_CPP_SUPPORTED_ARCH_OPTS "'\"-m32\";'; fi], []) rm -f conftest.i @@ -660,7 +660,7 @@ CPPFLAGS="$OLD_CPPFLAGS -m64" AC_PREPROC_IFELSE( [AC_LANG_SOURCE([/* Check if preprocessor supports option -m64 */])], [if test -e conftest.i; then - DEFAULT_CPP_SUPPORTED_ARCH_OPTS+='\"-m64\"; '; + DEFAULT_CPP_SUPPORTED_ARCH_OPTS="$DEFAULT_CPP_SUPPORTED_ARCH_OPTS "'\"-m64\";'; fi], []) rm -f conftest.i @@ -668,13 +668,13 @@ CPPFLAGS="$OLD_CPPFLAGS -m16" AC_PREPROC_IFELSE( [AC_LANG_SOURCE([/* Check if preprocessor supports option -m16 */])], [if test -e conftest.i; then - DEFAULT_CPP_SUPPORTED_ARCH_OPTS+='\"-m16\"; '; + DEFAULT_CPP_SUPPORTED_ARCH_OPTS="$DEFAULT_CPP_SUPPORTED_ARCH_OPTS "'\"-m16\";'; fi], []) # revert CPPFLAGS to original value CPPFLAGS=$OLD_CPPFLAGS -AC_MSG_RESULT(Default preprocessor supported architecture-related options: $DEFAULT_CPP_SUPPORTED_ARCH_OPTS) +AC_MSG_RESULT(Default preprocessor supported architecture-related options:$DEFAULT_CPP_SUPPORTED_ARCH_OPTS) ################# diff --git a/share/analysis-scripts/analysis.mk b/share/analysis-scripts/analysis.mk index 4984908d62fbdbc85e8cf6b38912c14f961ad84e..3483b89d6d4689e36703eebed525d4ff2f79223a 100644 --- a/share/analysis-scripts/analysis.mk +++ b/share/analysis-scripts/analysis.mk @@ -65,12 +65,15 @@ ifneq (4.0,$(firstword $(sort $(MAKE_VERSION) 4.0))) $(error This Makefile requires Make >= 4.0 - available at http://ftp.gnu.org/gnu/make/) endif -# Test if on a Mac (and therefore sed has fewer options) -# Also test if /usr/bin/time is available, otherwise use the shell builtin +# Test if sed has the '--unbuffered' option (GNU sed has, but neither macOS' +# nor Busybox' have it, in which case we ignore it) +SED_UNBUFFERED:=sed$(shell sed --unbuffered //p /dev/null 2>/dev/null && echo " --unbuffered" || true) + +# Test if on a Mac; +# test if /usr/bin/time is available, otherwise use the shell builtin # (which has less options) UNAME := $(shell uname -s) ifeq ($(UNAME),Darwin) - SED_UNBUFFERED:=sed ifneq (,$(wildcard /usr/bin/time)) define time_with_output /usr/bin/time -p @@ -81,7 +84,6 @@ define time_with_output endef endif else - SED_UNBUFFERED:=sed --unbuffered ifneq (,$(wildcard /usr/bin/time)) define time_with_output /usr/bin/time -f 'user_time=%U\nmemory=%M' -o "$(1)" diff --git a/tests/spec/preprocess_dos.sh b/tests/spec/preprocess_dos.sh index a63a982d043b5847b333d4e556892393f97c8a7d..26b571be5e0e46e39d4e8b0e8e2cfed89a498586 100755 --- a/tests/spec/preprocess_dos.sh +++ b/tests/spec/preprocess_dos.sh @@ -1,3 +1,5 @@ #!/bin/sh gcc -C -E -I. -o $3 $2 -$1 -q $3 +# Note: some versions of dos2unix (e.g. Busybox) do not have a '-q' flag, +# so we avoid using them +$1 $3 >/dev/null 2>/dev/null