pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/lang/cparser Import cparser-0.9.5.
details: https://anonhg.NetBSD.org/pkgsrc/rev/cce50798f91f
branches: trunk
changeset: 550754:cce50798f91f
user: bjs <bjs%pkgsrc.org@localhost>
date: Fri Nov 28 01:17:47 2008 +0000
description:
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:
lang/cparser/DESCR | 6 ++
lang/cparser/Makefile | 37 ++++++++++++++
lang/cparser/PLIST | 2 +
lang/cparser/distinfo | 7 ++
lang/cparser/patches/patch-aa | 111 ++++++++++++++++++++++++++++++++++++++++++
lang/cparser/patches/patch-ab | 16 ++++++
6 files changed, 179 insertions(+), 0 deletions(-)
diffs (203 lines):
diff -r 4f727549e059 -r cce50798f91f lang/cparser/DESCR
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/cparser/DESCR Fri Nov 28 01:17:47 2008 +0000
@@ -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 -r 4f727549e059 -r cce50798f91f lang/cparser/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/cparser/Makefile Fri Nov 28 01:17:47 2008 +0000
@@ -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@localhost
+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 -r 4f727549e059 -r cce50798f91f lang/cparser/PLIST
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/cparser/PLIST Fri Nov 28 01:17:47 2008 +0000
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2008/11/28 01:17:47 bjs Exp $
+bin/cparser
diff -r 4f727549e059 -r cce50798f91f lang/cparser/distinfo
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/cparser/distinfo Fri Nov 28 01:17:47 2008 +0000
@@ -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 -r 4f727549e059 -r cce50798f91f lang/cparser/patches/patch-aa
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/cparser/patches/patch-aa Fri Nov 28 01:17:47 2008 +0000
@@ -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 -r 4f727549e059 -r cce50798f91f lang/cparser/patches/patch-ab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/cparser/patches/patch-ab Fri Nov 28 01:17:47 2008 +0000
@@ -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);
Home |
Main Index |
Thread Index |
Old Index