From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id F170C138334 for ; Thu, 7 Jun 2018 14:09:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B7953E0AF8; Thu, 7 Jun 2018 14:09:44 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8B35DE0AF1 for ; Thu, 7 Jun 2018 14:09:44 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E3E4F335CA5 for ; Thu, 7 Jun 2018 14:09:42 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CA39F3E for ; Thu, 7 Jun 2018 14:09:40 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1528346490.3361e7f62bccabc396b4e298cbb2ddebedb8855f.vapier@gentoo> Subject: [gentoo-commits] proj/pax-utils:master commit in: / X-VCS-Repository: proj/pax-utils X-VCS-Files: Makefile X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 3361e7f62bccabc396b4e298cbb2ddebedb8855f X-VCS-Branch: master Date: Thu, 7 Jun 2018 14:09:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 21b89b0f-6467-47df-83c0-a7262ad472ae X-Archives-Hash: f671ecb5cf88e3ed19b388b0c17295f2 commit: 3361e7f62bccabc396b4e298cbb2ddebedb8855f Author: Mike Frysinger gentoo org> AuthorDate: Fri Mar 3 20:26:24 2017 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Thu Jun 7 04:41:30 2018 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=3361e7f6 build: support clang a bit better Use the -Werror=unknown-warning-option option if available so clang will reject some of the extra -W flags we add ourselves. Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 569e924..c906311 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,15 @@ # Distributed under the terms of the GNU General Public License v2 #################################################################### -check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ +check_compiler = \ + $(shell if $(CC) $(WUNKNOWN) $(1) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \ then echo "$(1)"; else echo "$(2)"; fi) -check_gcc_many = $(foreach flag,$(1),$(call check_gcc,$(flag))) +check_compiler_many = $(foreach flag,$(1),$(call check_compiler,$(flag))) #################################################################### # Avoid CC overhead when installing ifneq ($(MAKECMDGOALS),install) +WUNKNOWN := $(call check_compiler,-Werror=unknown-warning-option) _WFLAGS := \ -Wdeclaration-after-statement \ -Wextra \ @@ -19,7 +21,7 @@ WFLAGS := -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 \ -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings \ -Wbad-function-cast -Wnested-externs -Wcomment -Winline \ -Wchar-subscripts -Wcast-align -Wno-format-nonliteral \ - $(call check_gcc_many,$(_WFLAGS)) + $(call check_compiler_many,$(_WFLAGS)) endif CFLAGS ?= -O2 -pipe @@ -86,7 +88,7 @@ DEBUG_FLAGS = \ -fsanitize=leak \ -fsanitize=undefined debug: clean - $(MAKE) CFLAGS="$(CFLAGS) -g3 -ggdb $(call check_gcc_many,$(DEBUG_FLAGS))" all + $(MAKE) CFLAGS="$(CFLAGS) -g3 -ggdb $(call check_compiler_many,$(DEBUG_FLAGS))" all @-chpax -permsx $(ELF_TARGETS) @-paxctl -permsx $(ELF_TARGETS)