drop -ansi because opensolaris has some odd implications like breaking getopt if it's there. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://coreboot.org/openbios/trunk/fcode-utils-devel@775 f158a5a8-5612-0410-a976-696ce0be7e32
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
diff --git a/detok/Makefile b/detok/Makefile
index 2626098..0b730dc 100644
--- a/detok/Makefile
+++ b/detok/Makefile
@@ -29,7 +29,7 @@ STRIP = strip
INCLUDES = -I../shared
# Normal Flags:
-CFLAGS = -O2 -Wall -ansi #-Wextra
+CFLAGS = -O2 -Wall #-Wextra
LDFLAGS =
# Coverage:
diff --git a/romheaders/Makefile b/romheaders/Makefile
index a63edf2..7d47a21 100644
--- a/romheaders/Makefile
+++ b/romheaders/Makefile
@@ -24,7 +24,7 @@
CC ?= gcc
STRIP = strip
-CFLAGS = -O2 -Wall -Wextra -ansi
+CFLAGS = -O2 -Wall -Wextra
INCLUDES = -I../shared
SOURCES = romheaders.c ../shared/classcodes.c
diff --git a/toke/Makefile b/toke/Makefile
index 9fbb6c0..a3d81b1 100644
--- a/toke/Makefile
+++ b/toke/Makefile
@@ -29,7 +29,7 @@ STRIP = strip
INCLUDES = -I../shared
# Normal flags
-CFLAGS = -O2 -Wall -ansi -Wno-pointer-sign #-Wextra
+CFLAGS = -O2 -Wall #-Wextra
LDFLAGS =
# Coverage:
@@ -39,6 +39,12 @@ LDFLAGS =
# Debugging:
# CFLAGS := $(CFLAGS) -g
+# for gcc 4. remove if you fixed the code.
+_GCC4_CFLAGS=$(shell echo 'main(int argc, char **argv){return 0;}' > .test.c; \
+ $(CC) -Wno-pointer-sign -c .test.c -o .test.o > /dev/null 2>&1 \
+ && echo -Wno-pointer-sign; rm .test.c .test.o )
+CFLAGS := $(CFLAGS) $(_GCC4_CFLAGS)
+
OBJS = clflags.o conditl.o devnode.o dictionary.o emit.o errhandler.o \
flowcontrol.o macros.o nextfcode.o parselocals.o scanner.o stack.o \
stream.o strsubvocab.o ticvocab.o toke.o tokzesc.o tracesyms.o \