On Jan 3, 2008 9:12 AM, Stefan Reinauer <[EMAIL PROTECTED]> wrote:
> * ron minnich <[EMAIL PROTECTED]> [080103 17:25]:
> > This patch will enable setting distro variables such as
> > -fno_stack_protector as needed. It is a simple patch to  buildtarget
> > and can be extended for other uses.
> >
> > If this patch is acceptable then we can fix the various makefiles to
> > include the variable.
> >
> > The only remaining question is the name -- is CPU_OPT really appropriate?
>
> Why not make it CFLAGS? The C compiler is called CC in our environment,
> too.


like this?

Tested on FC8 and works fine.

ron
Add the ability to extend CFLAGS as needed for several new distros
Signed-off-by: Ronald G. Minnich <[EMAIL PROTECTED]>

Index: targets/buildtarget
===================================================================
--- targets/buildtarget	(revision 3031)
+++ targets/buildtarget	(working copy)
@@ -53,4 +53,25 @@
 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 $?
-- 
linuxbios mailing list
linuxbios@linuxbios.org
http://www.linuxbios.org/mailman/listinfo/linuxbios

Reply via email to