summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-08-01 00:43:05 +0200
committerLennart Poettering <lennart@poettering.net>2011-08-01 00:43:05 +0200
commitf975e971accc4d50c73ae53167db3df7a7099cf2 (patch)
treeba7442194a0e6a13cb12645db19e90073f2cb80b /Makefile.am
parentf786e80d7a76fd7446d142f610d62ea8c28ed902 (diff)
load-fragment: speed up parsing by using a perfect hash table with configuration settings built by gperf
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am23
1 files changed, 21 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index b526183300..32877233a6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -601,6 +601,10 @@ libsystemd_core_la_SOURCES = \
src/sd-daemon.c \
src/install.c
+nodist_libsystemd_core_la_SOURCES = \
+ src/load-fragment-gperf.c \
+ src/load-fragment-gperf-nulstr.c
+
libsystemd_core_la_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS) \
@@ -967,6 +971,9 @@ systemd_logind_SOURCES = \
src/cgroup-util.c \
src/polkit.c
+nodist_systemd_logind_SOURCES = \
+ src/logind-gperf.c
+
systemd_logind_CFLAGS = \
$(AM_CFLAGS) \
$(DBUS_CFLAGS) \
@@ -1486,13 +1493,25 @@ src/%.policy.in: src/%.policy.in.in Makefile
src/%.rules: src/%.rules.in Makefile
$(SED_PROCESS)
+src/%.c: src/%.gperf
+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
+ $(GPERF) < $< > $@
+
+src/%: src/%.m4
+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
+ $(M4) -P $(M4_DEFINES) < $< > $@ || rm $@
+
+src/load-fragment-gperf-nulstr.c: src/load-fragment-gperf.gperf
+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
+ $(AWK) 'BEGIN{ keywords=0 ; FS="," ; print "extern const char load_fragment_gperf_nulstr[];" ; print "const char load_fragment_gperf_nulstr[] ="} ; keyword==1 { print "\"" $$1 "\\0\"" } ; /%%/ { keyword=1} ; END { print ";" }' < $< > $@ || rm $@
+
M4_PROCESS_SYSTEM = \
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
- $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@ || rm $@
+ $(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@ || rm $@
M4_PROCESS_USER = \
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
- $(M4) -P $(M4_DISTRO_FLAG) -DFOR_USER=1 < $< > $@ || rm $@
+ $(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@ || rm $@
units/%: units/%.m4 Makefile
$(M4_PROCESS_SYSTEM)