com32: compile with -std=gnu99
authorH. Peter Anvin <hpa@zytor.com>
Tue, 12 Aug 2008 18:18:28 +0000 (11:18 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 12 Aug 2008 18:18:28 +0000 (11:18 -0700)
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 <hpa@zytor.com>
com32/lib/MCONFIG
com32/libutil/Makefile
com32/menu/Makefile
com32/modules/Makefile
com32/samples/Makefile

index b569abf..e40cf83 100644 (file)
@@ -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
index 01fefac..64d78b9 100644 (file)
@@ -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 \
index f37e479..5496c6e 100644 (file)
@@ -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 \
index 6624a94..506f6ed 100644 (file)
@@ -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 \
index 6ea3c77..c06668d 100644 (file)
@@ -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 \