]> granicus.if.org Git - postgis/commitdiff
Add the parser build rules back into the liblwgeom Makefile, so now any changes to...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Thu, 3 Jul 2008 09:28:38 +0000 (09:28 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Thu, 3 Jul 2008 09:28:38 +0000 (09:28 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2820 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac
liblwgeom/Makefile.in

index d24c9c7bc08dd5373558373c00c907c0af7db2e8..363b264c99fc3c19aa888571be76f4327d6d5d1b 100644 (file)
@@ -46,6 +46,16 @@ POSTGIS_MINOR_VERSION=`cat Version.config | grep POSTGIS_MINOR_VERSION | sed 's/
 POSTGIS_MICRO_VERSION=`cat Version.config | grep POSTGIS_MICRO_VERSION | sed 's/[[^=]]*=\([[0-9]]\)/\1/g'`
 
 
+dnl
+dnl Search for flex/bison to build the parser
+dnl
+
+AC_PROG_LEX
+AC_PROG_YACC
+AC_SUBST([LEX])
+AC_SUBST([YACC])
+
+
 dnl
 dnl Search for xsltproc which is required for building documentation
 dnl
index a5aaf5186f1acb3f35c5885761dea8510bfba884..04563f46d61add02843f46abc3d0ed42cd012d00 100644 (file)
@@ -13,6 +13,9 @@
 CC=@CC@
 CFLAGS=@CFLAGS@ @PICFLAGS@ @WARNFLAGS@ 
 
+YACC=@YACC@
+LEX=@LEX@
+
 # Standalone LWGEOM objects
 SA_OBJS=measures.o \
        box2d.o \
@@ -48,4 +51,13 @@ clean:
 # Command to build each of the .o files
 $(SA_OBJS): %.o: %.c
        $(CC) $(CFLAGS) -c -o $@ $<
+
+# Commands to generate the lexer and parser from input files
+wktparse.tab.c: wktparse.y
+       $(YACC) -vd -p lwg_parse_yy wktparse.y
+       mv -f y.tab.c wktparse.tab.c
+       mv -f y.tab.h wktparse.tab.h
+lex.yy.c: wktparse.lex wktparse.tab.c
+       $(LEX) -Plwg_parse_yy -i -f -o 'lex.yy.c' wktparse.lex