summaryrefslogtreecommitdiffstats
path: root/libsmartcols/src/Makemodule.am
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:32 +0000
commit8bb05ac73a5b448b339ce0bc8d396c82c459b47f (patch)
tree1fdda006866bca20d41cb206767ea5241e36852f /libsmartcols/src/Makemodule.am
parentAdding debian version 2.39.3-11. (diff)
downloadutil-linux-8bb05ac73a5b448b339ce0bc8d396c82c459b47f.tar.xz
util-linux-8bb05ac73a5b448b339ce0bc8d396c82c459b47f.zip
Merging upstream version 2.40.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libsmartcols/src/Makemodule.am')
-rw-r--r--libsmartcols/src/Makemodule.am64
1 files changed, 62 insertions, 2 deletions
diff --git a/libsmartcols/src/Makemodule.am b/libsmartcols/src/Makemodule.am
index 2bb19fd..377888e 100644
--- a/libsmartcols/src/Makemodule.am
+++ b/libsmartcols/src/Makemodule.am
@@ -1,5 +1,4 @@
-
# smartcols.h is generated, so it's stored in builddir!
smartcolsincdir = $(includedir)/libsmartcols
nodist_smartcolsinc_HEADERS = libsmartcols/src/libsmartcols.h
@@ -21,7 +20,68 @@ libsmartcols_la_SOURCES= \
libsmartcols/src/calculate.c \
libsmartcols/src/grouping.c \
libsmartcols/src/walk.c \
- libsmartcols/src/init.c
+ libsmartcols/src/init.c \
+ \
+ libsmartcols/src/filter-parser.c \
+ libsmartcols/src/filter-scanner.c \
+ libsmartcols/src/filter-parser.h \
+ libsmartcols/src/filter-scanner.h \
+ \
+ libsmartcols/src/filter.c \
+ libsmartcols/src/filter-param.c \
+ libsmartcols/src/filter-expr.c
+
+BUILT_SOURCES += libsmartcols/src/filter-parser.c \
+ libsmartcols/src/filter-parser.h \
+ libsmartcols/src/filter-scanner.c \
+ libsmartcols/src/filter-scanner.h
+
+EXTRA_DIST += libsmartcols/src/filter-parser.y \
+ libsmartcols/src/filter-scanner.l
+
+## Generate filter parser (YACC) and tokenizer (LEX) .c and .h files.
+#
+# Note that we need advanced bison and flex features and configuration
+# directives to generated thread safe parser (usable in stared library), so
+# it's probably a bad idea to use "-y" (posix compatible) as default in
+# autotools. We also need to generate .c and .h files in the same time to avoid
+# duplicate stuff.
+#
+SCOLS_YACC_BASENAME = libsmartcols/src/filter-parser
+SCOLS_YACC_STEMP = $(SCOLS_YACC_BASENAME).stamp
+
+SCOLS_LEX_BASENAME = libsmartcols/src/filter-scanner
+SCOLS_LEX_STEMP = $(SCOLS_LEX_BASENAME).stamp
+
+
+$(SCOLS_YACC_STEMP): $(SCOLS_YACC_BASENAME).y
+ @rm -f $(SCOLS_YACC_STEMP).tmp
+ @touch -f $(SCOLS_YACC_STEMP).tmp
+ $(AM_V_YACC) $(BISON) $< --output=${basename $@}.c --defines=${basename $@}.h
+ @mv -f $(SCOLS_YACC_STEMP).tmp $@
+
+$(SCOLS_YACC_BASENAME).c $(SCOLS_YACC_BASENAME).h: $(SCOLS_YACC_STEMP)
+ @test -f $@ || rm -f $(SCOLS_YACC_STEMP)
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(SCOLS_YACC_STEMP)
+
+
+$(SCOLS_LEX_STEMP): $(SCOLS_LEX_BASENAME).l
+ @rm -f $(SCOLS_LEX_STEMP).tmp
+ @touch -f $(SCOLS_LEX_STEMP).tmp
+ $(AM_V_GEN) $(FLEX) --header-file=${basename $@}.h --outfile=${basename $@}.c $<
+ @mv -f $(SCOLS_LEX_STEMP).tmp $@
+
+$(SCOLS_LEX_BASENAME).c $(SCOLS_LEX_BASENAME).h: $(SCOLS_LEX_STEMP)
+ @test -f $@ || rm -f $(SCOLS_LEX_STEMP)
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(SCOLS_LEX_STEMP)
+
+# Each part of the parser depends on the header files
+$(SCOLS_LEX_BASENAME).c: $(SCOLS_YACC_BASENAME).h
+$(SCOLS_YACC_BASENAME).c: $(SCOLS_LEX_BASENAME).h
+
+# Don't re-generate parser when use sources from tarball
+EXTRA_DIST += $(SCOLS_YACC_STEMP) $(SCOLS_LEX_STEMP)
+
libsmartcols_la_LIBADD = $(LDADD) libcommon.la