From 83a94f669e1aa6c035e81374225bfaab9796d39e Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 12 Aug 2008 11:18:28 -0700 Subject: [PATCH] com32: compile with -std=gnu99 Compile with -std=gnu99, this allows us to define initializers inside for() loops, which makes certain kinds of ugly macros easier to write. Signed-off-by: H. Peter Anvin --- com32/lib/MCONFIG | 4 +++- com32/libutil/Makefile | 6 ++++-- com32/menu/Makefile | 6 ++++-- com32/modules/Makefile | 6 ++++-- com32/samples/Makefile | 6 ++++-- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/com32/lib/MCONFIG b/com32/lib/MCONFIG index b569abf..e40cf83 100644 --- a/com32/lib/MCONFIG +++ b/com32/lib/MCONFIG @@ -3,7 +3,9 @@ topdir = ../.. include $(topdir)/MCONFIG -GCCOPT := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,) +GCCOPT := $(call gcc_ok,-std=gnu99,) \ + $(call gcc_ok,-m32,) \ + $(call gcc_ok,-fno-stack-protector,) \ INCLUDE = -I. STRIP = strip --strip-all -R .comment -R .note diff --git a/com32/libutil/Makefile b/com32/libutil/Makefile index 01fefac..64d78b9 100644 --- a/com32/libutil/Makefile +++ b/com32/libutil/Makefile @@ -35,14 +35,16 @@ CC = gcc gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \ then echo $(1); else echo $(2); fi; rm -f $$tmpf) -M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,) +GCCOPT := $(call gcc_ok,-std=gnu99,) \ + $(call gcc_ok,-m32,) \ + $(call gcc_ok,-fno-stack-protector,) \ LD = ld -m elf_i386 AR = ar NASM = nasm NASMOPT = -O9999 RANLIB = ranlib -CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \ +CFLAGS = $(GCCOPT) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \ -fomit-frame-pointer -D__COM32__ \ -nostdinc -iwithprefix include \ -I./include -I../include \ diff --git a/com32/menu/Makefile b/com32/menu/Makefile index f37e479..5496c6e 100644 --- a/com32/menu/Makefile +++ b/com32/menu/Makefile @@ -20,14 +20,16 @@ CC = gcc gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \ then echo $(1); else echo $(2); fi; rm -f $$tmpf) -M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,) +GCCOPT := $(call gcc_ok,-std=gnu99,) \ + $(call gcc_ok,-m32,) \ + $(call gcc_ok,-fno-stack-protector,) \ LD = ld -m elf_i386 AR = ar NASM = nasm NASMOPT = -O9999 RANLIB = ranlib -CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \ +CFLAGS = $(GCCOPT) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \ -fomit-frame-pointer -D__COM32__ \ -nostdinc -iwithprefix include \ -I../libutil/include -I../include \ diff --git a/com32/modules/Makefile b/com32/modules/Makefile index 6624a94..506f6ed 100644 --- a/com32/modules/Makefile +++ b/com32/modules/Makefile @@ -20,14 +20,16 @@ CC = gcc gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \ then echo $(1); else echo $(2); fi; rm -f $$tmpf) -M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,) +GCCOPT := $(call gcc_ok,-std=gnu99,) \ + $(call gcc_ok,-m32,) \ + $(call gcc_ok,-fno-stack-protector,) \ LD = ld -m elf_i386 AR = ar NASM = nasm NASMOPT = -O9999 RANLIB = ranlib -CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \ +CFLAGS = $(GCCOPT) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \ -fomit-frame-pointer -D__COM32__ \ -nostdinc -iwithprefix include \ -I../libutil/include -I../include \ diff --git a/com32/samples/Makefile b/com32/samples/Makefile index 6ea3c77..c06668d 100644 --- a/com32/samples/Makefile +++ b/com32/samples/Makefile @@ -20,14 +20,16 @@ CC = gcc gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \ then echo $(1); else echo $(2); fi; rm -f $$tmpf) -M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,) +GCCOPT := $(call gcc_ok,-std=gnu99,) \ + $(call gcc_ok,-m32,) \ + $(call gcc_ok,-fno-stack-protector,) \ LD = ld -m elf_i386 AR = ar NASM = nasm NASMOPT = -O9999 RANLIB = ranlib -CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \ +CFLAGS = $(GCCOPT) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \ -fomit-frame-pointer -D__COM32__ \ -nostdinc -iwithprefix include \ -I../libutil/include -I../include \ -- 2.7.4