[PATCH] Makefile: improve the cc-option compatibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The build on Ubuntu Xenial with GCC 5.4.0 will fail with:
    cc: error: unrecognized command line option ‘-Wimplicit-fallthrough’

This unsupported flag is not skipped as expected.

It is because of the /bin/sh shell on Ubuntu, DASH, which does not
support this &> redirection. Use 2>&1 to solve this problem.

Signed-off-by: Po-Hsu Lin <po-hsu.lin@xxxxxxxxxxxxx>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 7d7247c..a4ce55a 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@
 #
 ##############################################################################
 
-cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null &>/dev/null; \
+cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null > /dev/null 2>&1; \
 	      then echo $(1); fi)
 
 CFLAGS ?= -O2 -Wall -Wundef					\
-- 
2.25.1




[Index of Archives]     [linux Cryptography]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]

  Powered by Linux