diff options
-rw-r--r-- | lang/cparser/DESCR | 6 | ||||
-rw-r--r-- | lang/cparser/Makefile | 37 | ||||
-rw-r--r-- | lang/cparser/PLIST | 2 | ||||
-rw-r--r-- | lang/cparser/distinfo | 7 | ||||
-rw-r--r-- | lang/cparser/patches/patch-aa | 111 | ||||
-rw-r--r-- | lang/cparser/patches/patch-ab | 16 |
6 files changed, 179 insertions, 0 deletions
diff --git a/lang/cparser/DESCR b/lang/cparser/DESCR new file mode 100644 index 00000000000..4d587ec0c82 --- /dev/null +++ b/lang/cparser/DESCR @@ -0,0 +1,6 @@ +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. diff --git a/lang/cparser/Makefile b/lang/cparser/Makefile new file mode 100644 index 00000000000..bcb9927a531 --- /dev/null +++ b/lang/cparser/Makefile @@ -0,0 +1,37 @@ +# $NetBSD: Makefile,v 1.1.1.1 2008/11/28 01:17:47 bjs Exp $ +# + +DISTNAME= cparser-0.9.5 +CATEGORIES= lang +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=cparser/} +EXTRACT_SUFX= .tar.bz2 + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= http://cparser.sourceforge.net/ +COMMENT= Recursive descent C99 parser + +PKG_DESTDIR_SUPPORT= user-destdir + +NO_CONFIGURE= yes + +USE_LANGUAGES= c99 +USE_LIBTOOL= yes +USE_TOOLS+= gmake pkg-config + +AUTO_MKDIRS= yes +COPTS?= -O2 + +#DBG?= -g3 # XXX debugging option? + +MAKE_ENV+= LIBTOOL_CFLAGS=-prefer-pic +MAKE_ENV+= COPTS=${COPTS:Q} + +BUILDLINK_TRANSFORM+= rm:-Werror + +do-install: + ${LIBTOOL} --mode=install \ + ${INSTALL_PROGRAM} ${WRKSRC}/build/cparser \ + ${DESTDIR}${PREFIX}/bin/cparser + +.include "../../devel/libfirm/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/lang/cparser/PLIST b/lang/cparser/PLIST new file mode 100644 index 00000000000..ba51e630428 --- /dev/null +++ b/lang/cparser/PLIST @@ -0,0 +1,2 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2008/11/28 01:17:47 bjs Exp $ +bin/cparser diff --git a/lang/cparser/distinfo b/lang/cparser/distinfo new file mode 100644 index 00000000000..956bc4089b1 --- /dev/null +++ b/lang/cparser/distinfo @@ -0,0 +1,7 @@ +$NetBSD: distinfo,v 1.1.1.1 2008/11/28 01:17:47 bjs Exp $ + +SHA1 (cparser-0.9.5.tar.bz2) = 50665cc78f4722a9aca38c2d2d07e4ef7b816f1b +RMD160 (cparser-0.9.5.tar.bz2) = 3e2b95f8bda16ce2d6f569a5d1e94673e0536545 +Size (cparser-0.9.5.tar.bz2) = 151405 bytes +SHA1 (patch-aa) = fa9cbb571ca87c8dafe84fcbdb7699491dd450f3 +SHA1 (patch-ab) = 3f373e0fd25d8d8632434d0425368e3e02583a90 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); |