More work on that autoconf/automake stuff..
authorFlorian Forster <octo@leeloo.(none)>
Wed, 7 Feb 2007 16:31:45 +0000 (17:31 +0100)
committerFlorian Forster <octo@leeloo.(none)>
Wed, 7 Feb 2007 16:31:45 +0000 (17:31 +0100)
AUTHORS [new file with mode: 0644]
ChangeLog [new file with mode: 0644]
INSTALL [new file with mode: 0644]
Makefile.am [new file with mode: 0644]
NEWS [new file with mode: 0644]
README [new file with mode: 0644]
build.sh [new file with mode: 0755]
src/Makefile.am
src/parser.y
src/scanner.l

diff --git a/AUTHORS b/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ChangeLog b/ChangeLog
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..af437a6
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = src
diff --git a/NEWS b/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/build.sh b/build.sh
new file mode 100755 (executable)
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
index 2c2c026..e519ada 100644 (file)
@@ -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
index ca0844e..9932469 100644 (file)
@@ -2,7 +2,6 @@
 #include <stdlib.h>
 #include <string.h>
 #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);
index 1d23805..de92f1c 100644 (file)
@@ -1,3 +1,6 @@
+%{
+#include <stdlib.h>
+%}
 WHITE_SPACE [\ \t\b]
 ALNUM [A-Za-z0-9_]
 QUOTED_STRING \"([^\"]+|\\.)*\"