From 23b00b8909bb30ef57cabc3c0915d6f7129467df Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Fri, 11 Jan 2008 18:23:47 +0000 Subject: Add the ability to extend CFLAGS as needed for several new distros Signed-off-by: Ronald G. Minnich Acked-by: Peter Stuge Acked-by: Stefan Reinauer Acked-by: Jordan Crouse git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3046 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- targets/buildtarget | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/targets/buildtarget b/targets/buildtarget index b9447dbdb0..7fce1e1497 100755 --- a/targets/buildtarget +++ b/targets/buildtarget @@ -53,4 +53,25 @@ fi export PYTHONPATH=$config_dir $PYTHON $config_py $config_lb $lbpath +# now start checking for distro-specific breakage. +## This check is for the no stack protector mess. +EXTRA_CFLAGS= + +if [ -z "$CC" ]; then + CC=gcc +fi + +$CC -fno-stack-protector -S -xc /dev/null -o .$$.tmp + +if [ $? -eq 0 ]; then + EXTRA_CFLAGS=-fno-stack-protector +fi + +rm -rf .$$.tmp + +for i in $build_dir/Makefile.settings $build_dir/*/Makefile.settings +do + echo CFLAGS+=$EXTRA_CFLAGS >>$i +done + exit $? -- cgit v1.2.3