]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Make newsearch compile without lex/yacc.
authorChris Porter <redacted>
Sat, 11 Oct 2008 19:15:53 +0000 (20:15 +0100)
committerChris Porter <redacted>
Sat, 11 Oct 2008 19:15:53 +0000 (20:15 +0100)
build.mk.in
defaults.mk [new file with mode: 0644]
newsearch/Makefile.in
newsearch/newsearch.c

index f9b3cefe632c11d17c1fb77986787207bef3fe60..bcdfa1ba51960dd4ff3935ceaa781f3211a58fbe 100644 (file)
@@ -6,6 +6,7 @@ CFLAGS=
 CC=gcc
 LEX=flex
 
+@sinclude@ @includel@$(INCPATH)defaults.mk@includel@
 @sinclude@ @includel@$(INCPATH)settings.mk@includel@
 
 @ifndef@ BUILDID
diff --git a/defaults.mk b/defaults.mk
new file mode 100644 (file)
index 0000000..83e759b
--- /dev/null
@@ -0,0 +1 @@
+NEWSEARCH_NEWPARSER=0
index 5ebe3178ba585254808bb270db6e68b74793110a..a5595b4f3d8e0c52663dfa9113754a79fbc2fc49 100644 (file)
@@ -3,10 +3,20 @@
 CFLAGS+=$(INCPCRE)
 LDFLAGS+=$(LIBPCRE)
 
+@if@ ${NEWSEARCH_NEWPARSER} == 1
+CFLAGS+=-DNEWSEARCH_NEWPARSER=1
+@endif@
+
+NSCOMMANDS=ns-not.o ns-and.o ns-or.o ns-eq.o ns-match.o ns-hostmask.o ns-realname.o ns-modes.o ns-nick.o ns-ident.o ns-regex.o ns-host.o ns-channel.o ns-lt.o ns-gt.o ns-timestamp.o ns-country.o ns-authname.o ns-ip.o ns-kill.o ns-gline.o ns-exists.o ns-services.o ns-size.o ns-name.o ns-topic.o ns-oppct.o ns-cumodecount.o ns-cumodepct.o ns-hostpct.o ns-authedpct.o ns-length.o ns-kick.o ns-authts.o ns-channels.o ns-server.o ns-authid.o ns-notice.o newsearch_ast.o ns-any.o ns-channeliter.o ns-var.o ns-all.o ns-cumodes.o ns-cidr.o ns-nickiter.o
+
 .PHONY: all clean distclean
 all: newsearch.so
 
-newsearch.so: newsearch.o formats.o y.tab.o lex.yy.o parser.o ns-not.o ns-and.o ns-or.o ns-eq.o ns-match.o ns-hostmask.o ns-realname.o ns-modes.o ns-nick.o ns-ident.o ns-regex.o ns-host.o ns-channel.o ns-lt.o ns-gt.o ns-timestamp.o ns-country.o ns-authname.o ns-ip.o ns-kill.o ns-gline.o ns-exists.o ns-services.o ns-size.o ns-name.o ns-topic.o ns-oppct.o ns-cumodecount.o ns-cumodepct.o ns-hostpct.o ns-authedpct.o ns-length.o ns-kick.o ns-authts.o ns-channels.o ns-server.o ns-authid.o ns-notice.o newsearch_ast.o ns-any.o ns-channeliter.o ns-var.o ns-all.o ns-cumodes.o ns-cidr.o ns-nickiter.o
+@if@ ${NEWSEARCH_NEWPARSER} == 1
+newsearch.so: newsearch.o formats.o y.tab.o lex.yy.o parser.o ${NSCOMMANDS}
+@else@
+newsearch.so: newsearch.o formats.o ${NSCOMMANDS}
+@endif@
 
 y.tab.c y.tab.h: newsearch.y
        ${YACC} -d newsearch.y
index 526052f3b6a95c03acc3f608b51e7183f2becfae..8e34e1f12001843ef58cf84bb721b4b7915228c4 100644 (file)
@@ -1244,6 +1244,7 @@ void var_setstr(struct searchVariable *v, char *data) {
   v->cdata.u.stringbuf = data;
 }
 
+#ifdef NEWSEARCH_NEWPARSER
 void displaystrerror(replyFunc reply, nick *np, const char *input) {
   char buf[515];
 
@@ -1262,6 +1263,7 @@ void displaystrerror(replyFunc reply, nick *np, const char *input) {
 
   reply(np, "Parse error: %s", parseStrError);
 }
+#endif
 
 struct searchNode *argtoconststr(char *command, searchCtx *ctx, char *arg, char **p) {
   struct searchNode *c;