From deb227d5e6642c9cc345e01dc9842432d9d32443 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 7 Feb 2007 17:31:45 +0100 Subject: [PATCH] More work on that autoconf/automake stuff.. --- AUTHORS | 0 ChangeLog | 0 INSTALL | 0 Makefile.am | 1 + NEWS | 0 README | 0 build.sh | 9 +++++++++ src/Makefile.am | 15 +++++++-------- src/parser.y | 5 +++-- src/scanner.l | 3 +++ 10 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 AUTHORS create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 NEWS create mode 100644 README create mode 100755 build.sh diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..e69de29 diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..af437a6 --- /dev/null +++ b/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..89d3a68 --- /dev/null +++ b/build.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +set -x + +autoheader \ +&& aclocal \ +&& libtoolize --ltdl --copy --force \ +&& automake --add-missing --copy \ +&& autoconf diff --git a/src/Makefile.am b/src/Makefile.am index 2c2c026..e519ada 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,16 +1,15 @@ AUTOMAKE_OPTIONS = foreign no-dependencies -BUILT_SOURCES = scanner.h parser.h -CLEANFILES = scanner.h scanner.c parser.h parser.c - -AM_YFLAGS = -d +BUILT_SOURCES = scanner.c parser.h +CLEANFILES = parser.h parser.c scanner.c include_HEADERS = oconfig.h lib_LTLIBRARIES = liboconfig.la -liboconfig_la_SOURCES = oconfig.c oconfig.h scanner.l parser.y +scanner.c: scanner.l + $(LEX) $(AM_LFLAGS) $(LFLAGS) -o scanner.c $< -scanner.h: scanner.l parser.h - $(LEX) -o scanner.c --header-file=scanner.h scanner.l +parser.h: parser.y scanner.c + $(YACC) $(AM_YFLAGS) $(YFLAGS) -o parser.c $< -parser.h: parser.y +liboconfig_la_SOURCES = oconfig.c oconfig.h parser.c diff --git a/src/parser.y b/src/parser.y index ca0844e..9932469 100644 --- a/src/parser.y +++ b/src/parser.y @@ -2,7 +2,6 @@ #include #include #include "oconfig.h" -#include "scanner.h" struct statement_list_s { @@ -166,11 +165,13 @@ entire_file: statement_list { $$.children = $1.statement; - $$.children_num = $1.statement.num; + $$.children_num = $1.statement_num; } ; %% +#include "scanner.c" + static char *unquote (const char *orig) { char *ret = strdup (orig); diff --git a/src/scanner.l b/src/scanner.l index 1d23805..de92f1c 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -1,3 +1,6 @@ +%{ +#include +%} WHITE_SPACE [\ \t\b] ALNUM [A-Za-z0-9_] QUOTED_STRING \"([^\"]+|\\.)*\" -- 2.11.0