diff options
author | bjs <bjs@pkgsrc.org> | 2008-11-28 01:17:47 +0000 |
---|---|---|
committer | bjs <bjs@pkgsrc.org> | 2008-11-28 01:17:47 +0000 |
commit | d0919f55bd2829394b363e0f10683cda8ea692a4 (patch) | |
tree | 12f84988a4af26b831c6019809dce63332c1b664 /lang/cparser/patches | |
parent | 664866af9f48c40af552e1fd390ba0701731dc0f (diff) | |
download | pkgsrc-d0919f55bd2829394b363e0f10683cda8ea692a4.tar.gz |
Import cparser-0.9.5.
Cparser is a recursive descent C99 parser written in C99. It contains
a lexer, a parser, and the appropriate constructs; it does AST and
semantic analysis. It is currently used as a frontend to the
libFirm intermediate representation. However, it can be used
independently, and also is able to bootstrap itself. Currently, cparser
uses an external preprocessor.
Diffstat (limited to 'lang/cparser/patches')
-rw-r--r-- | lang/cparser/patches/patch-aa | 111 | ||||
-rw-r--r-- | lang/cparser/patches/patch-ab | 16 |
2 files changed, 127 insertions, 0 deletions
diff --git a/lang/cparser/patches/patch-aa b/lang/cparser/patches/patch-aa new file mode 100644 index 00000000000..3484b2b65c7 --- /dev/null +++ b/lang/cparser/patches/patch-aa @@ -0,0 +1,111 @@ +$NetBSD: patch-aa,v 1.1.1.1 2008/11/28 01:17:47 bjs Exp $ + +--- Makefile.orig 2008-11-27 19:36:46.000000000 -0500 ++++ Makefile +@@ -8,18 +8,18 @@ BUILDDIR ?= build + FIRM_CFLAGS ?= `pkg-config --cflags libfirm` + FIRM_LIBS ?= `pkg-config --libs libfirm` + +-CPPFLAGS = -DHAVE_CONFIG_H -DFIRM_BACKEND ++CPPFLAGS += -DHAVE_CONFIG_H -DFIRM_BACKEND + CPPFLAGS += -I. + CPPFLAGS += $(FIRM_CFLAGS) + + CFLAGS += -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Werror -std=c99 -pedantic +-CFLAGS += -O0 -g3 ++CFLAGS += ${COPTS} ${DBG} + #CFLAGS += -O3 -march=pentium4 -fomit-frame-pointer -DNDEBUG + #CFLAGS += -pg -O3 -fno-inline +-ICC_CFLAGS = -O0 -g3 -std=c99 -Wall -Werror ++#ICC_CFLAGS = -O0 -g3 -std=c99 -Wall -Werror + #LFLAGS += -pg +-ICC ?= true +-GCCO1 ?= true ++#ICC ?= true ++#GCCO1 ?= true + + LFLAGS += $(FIRM_LIBS) + +@@ -51,13 +51,13 @@ SOURCES := \ + driver/firm_opt.c \ + driver/gen_firm_asm.c \ + +-OBJECTS = $(SOURCES:%.c=build/%.o) ++OBJECTS = $(SOURCES:%.c=build/%.lo) + + SPLINTS = $(addsuffix .splint, $(SOURCES)) + CPARSERS = $(addsuffix .cparser, $(SOURCES)) +-CPARSEROS = $(SOURCES:%.c=build/cpb/%.o) +-CPARSEROS_E = $(SOURCES:%.c=build/cpbe/%.o) +-CPARSEROS2 = $(SOURCES:%.c=build/cpb2/%.o) ++CPARSEROS = $(SOURCES:%.c=build/cpb/%.lo) ++CPARSEROS_E = $(SOURCES:%.c=build/cpbe/%.lo) ++CPARSEROS2 = $(SOURCES:%.c=build/cpb2/%.lo) + + Q = @ + +@@ -93,7 +93,8 @@ UNUSED := $(shell mkdir -p $(DIRS)) + + $(GOAL): $(OBJECTS) + @echo "===> LD $@" +- $(Q)$(CC) $(OBJECTS) $(LFLAGS) -o $(GOAL) ++ $(Q)$(LIBTOOL) --mode=link --tag=CC \ ++ $(CC) $(OBJECTS) $(LFLAGS) -o $(GOAL) + + splint: $(SPLINTS) + +@@ -123,36 +124,40 @@ builtins.h: builtins/builtins.c + + main.c: builtins.h + +-build/cpb/%.o: %.c build/cparser ++build/cpb/%.lo: %.c build/cparser + @echo '===> CPARSER $<' +- $(Q)./build/cparser $(CPPFLAGS) -std=c99 -Wall -g3 -c $< -o $@ ++ $(Q)$(LIBTOOL) --mode=compile --tag=CC \ ++ ./build/cparser $(CPPFLAGS) -std=c99 -Wall -g3 -c $< -o $@ + +-build/cpbe/%.o: %.c ++build/cpbe/%.lo: %.c + @echo '===> ECCP $<' +- $(Q)eccp $(CPPFLAGS) -std=c99 -Wall -c $< -o $@ ++ $(Q)$(LIBTOOL) --mode=compile --tag=CC \ ++ eccp $(CPPFLAGS) -std=c99 -Wall -c $< -o $@ + +-build/cpb2/%.o: %.c cparser.bootstrap ++build/cpb2/%.lo: %.c cparser.bootstrap + @echo '===> CPARSER.BOOTSTRAP $<' +- $(Q)./cparser.bootstrap $(CPPFLAGS) -Wall -g -c $< -o $@ ++ $(Q)$(LIBTOOL) --mode=compile --tag=CC \ ++ ./cparser.bootstrap $(CPPFLAGS) -Wall -g -c $< -o $@ + + cparser.bootstrap: $(CPARSEROS) + @echo "===> LD $@" +- $(Q)./build/cparser $(CPARSEROS) $(LFLAGS) -o $@ ++ $(Q)$(LIBTOOL) --mode=link \ ++ ./build/cparser $(CPARSEROS) $(LFLAGS) -o $@ + + cparser.bootstrape: $(CPARSEROS_E) + @echo "===> LD $@" +- $(Q)gcc $(CPARSEROS_E) $(LFLAGS) -o $@ ++ $(Q)$(LIBTOOL) --mode=link \ ++ $(CC) $(CPARSEROS_E) $(LFLAGS) -o $@ + + cparser.bootstrap2: $(CPARSEROS2) + @echo "===> LD $@" +- $(Q)./cparser.bootstrap $(CPARSEROS2) $(LFLAGS) -o $@ ++ $(Q)$(LIBTOOL) --mode=link \ ++ ./cparser.bootstrap $(CPARSEROS2) $(LFLAGS) -o $@ + +-build/%.o: %.c ++build/%.lo: %.c + @echo '===> CC $<' +- $(Q)$(ICC) $(CPPFLAGS) $(ICC_CFLAGS) -c $< -o $@ +- $(Q)$(GCCO1) $(CPPFLAGS) $(CFLAGS) -O1 -c $< -o $@ +- $(Q)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ +- ++ $(Q)$(LIBTOOL) --mode=compile --tag=CC \ ++ $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ + clean: + @echo '===> CLEAN' + $(Q)rm -rf build/* $(GOAL) .depend diff --git a/lang/cparser/patches/patch-ab b/lang/cparser/patches/patch-ab new file mode 100644 index 00000000000..d726c7d12f5 --- /dev/null +++ b/lang/cparser/patches/patch-ab @@ -0,0 +1,16 @@ +$NetBSD: patch-ab,v 1.1.1.1 2008/11/28 01:17:47 bjs Exp $ + +Quell warning about possible uninitialized use; +someone may wish to look into this further. + +--- parser.c.orig 2008-08-01 05:01:24.000000000 -0400 ++++ parser.c +@@ -2402,7 +2402,7 @@ static initializer_t *parse_initializer( + { + type_t *type = skip_typeref(env->type); + initializer_t *result = NULL; +- size_t max_index; ++ size_t max_index = 0; + + if(is_type_scalar(type)) { + result = parse_scalar_initializer(type, env->must_be_constant); |