From f43c96911a3912a9870ebaa304c4d7df8a94a33d Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Mon, 20 Mar 2017 13:31:35 +1100 Subject: Only build attributeOverride if compiler supports -std=gnu++11 GCC prior to 4.8 doesn't support -std=gnu++11, which the attributeOverride tool requires to build. Resolves:open-power/op-build/pull/947 Change-Id: I53ad31b56dd90c2cd77f5ca1f91b46e519cdfe48 Signed-off-by: Stewart Smith Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38131 Reviewed-by: Prachi Gupta Reviewed-by: Matthew A. Ploetz Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- src/build/mkrules/cc.rules.mk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/build/mkrules/cc.rules.mk') diff --git a/src/build/mkrules/cc.rules.mk b/src/build/mkrules/cc.rules.mk index cb00ea001..c89995f82 100644 --- a/src/build/mkrules/cc.rules.mk +++ b/src/build/mkrules/cc.rules.mk @@ -5,7 +5,9 @@ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2013,2014 +# Contributors Listed Below - COPYRIGHT 2013,2017 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -74,3 +76,9 @@ $(IMGDIR)/lib$(MODULE).so : $(OBJECTS) $(ROOTPATH)/src/module.ld $(MODULE_INIT) $(OBJECTS) $(MODULE_INIT) \ -T $(ROOTPATH)/src/module.ld -o $@ endif + +try = $(shell set -e; if ($(1)) >/dev/null 2>&1; \ + then echo "$(2)"; \ + else echo "$(3)"; fi ) + +try-cflag = $(call try,$(1) $(2) -x c -c /dev/null -o /dev/null,$(2)) -- cgit v1.2.1