]> git.ipfire.org Git - pakfire.git/commitdiff
configure: Fix raw bison and call it directly
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 15 Feb 2021 10:50:26 +0000 (10:50 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 15 Feb 2021 10:50:26 +0000 (10:50 +0000)
The old YACC macro has some issues with using modern bison features and
always enables compatibility mode with yacc.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
configure.ac

index 9a602bbeaf94ff728a1181e7d4d881e0f51ab2ba..50882996956d609a7ff5791e8565bc5e8235ee33 100644 (file)
@@ -45,6 +45,7 @@ scriptsdir = $(prefix)/lib/$(PACKAGE_NAME)
 
 TEST_ROOTFS = $(abs_top_builddir)/tests/.root
 
+BUILT_SOURCES =
 CLEANFILES =
 DISTCLEANFILES =
 EXTRA_DIST =
@@ -62,8 +63,6 @@ AM_LDFLAGS = $(OUR_LDFLAGS) \
        -Wl,--gc-sections \
        -Wl,--as-needed
 
-AM_YFLAGS = -d
-
 PAKFIRE_CPPFLAGS = -I$(top_srcdir)/src/libpakfire/include
 PAKFIRE_LIBS     = libpakfire.la
 
@@ -256,6 +255,14 @@ libpakfire_parser_la_CPPFLAGS = \
 
 src/libpakfire/parser/scanner.c: src/libpakfire/parser/grammar.h
 
+src/libpakfire/parser/grammar.h: src/libpakfire/parser/grammar.c
+
+src/libpakfire/parser/grammar.c: src/libpakfire/parser/grammar.y Makefile
+       $(AM_V_GEN) $(BISON) -Wall -t -d -o $@ $<
+
+BUILT_SOURCES += \
+       src/libpakfire/parser/grammar.h
+
 lib_LTLIBRARIES += \
        libpakfire.la
 
index 3f1ed8a87ed84547153c357a01ad9300c78ec81b..b28ebf03a7fcc558e826405b8ec4604d1e5a7ddc 100644 (file)
@@ -108,8 +108,8 @@ CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
 AC_SUBST([OUR_LDFLAGS], $with_ldflags)
 
 # Bison
-AC_PATH_PROG(YACC, bison)
-AC_SUBST(YACC)
+AC_PROG_YACC
+AC_PATH_PROG([BISON],[bison])
 
 # Flex
 AM_PROG_LEX