[pacman-dev] [PATCH] Add autotools magic for pactests
Henning Garus
henning.garus at googlemail.com
Thu Aug 14 18:42:23 EDT 2008
Added a Makefile.am for the pactest/tests dir. This is a blatant ripoff
of scripts/Makefile.am, which replaces predefined expressions in
NAME.py.in pactests with configure variables.
This can be used to write pactests which consider compile time options.
Signed-off-by: Henning Garus <henning.garus at gmail.com>
---
Makefile.am | 2 +-
configure.ac | 1 +
pactest/tests/Makefile.am | 19 +++++++++++++++++++
3 files changed, 21 insertions(+), 1 deletions(-)
create mode 100644 pactest/tests/Makefile.am
diff --git a/Makefile.am b/Makefile.am
index ea3b0e0..4f2ea83 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = lib/libalpm src/util src/pacman scripts etc po pactest contrib
+SUBDIRS = lib/libalpm src/util src/pacman scripts etc po pactest pactest/tests contrib
if WANT_DOC
SUBDIRS += doc
endif
diff --git a/configure.ac b/configure.ac
index 9f4209b..5c09e2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -342,6 +342,7 @@ doc/Makefile
etc/Makefile
po/Makefile.in
pactest/Makefile
+pactest/tests/Makefile
contrib/Makefile
Makefile
])
diff --git a/pactest/tests/Makefile.am b/pactest/tests/Makefile.am
new file mode 100644
index 0000000..4590e3c
--- /dev/null
+++ b/pactest/tests/Makefile.am
@@ -0,0 +1,19 @@
+CONFTESTS = $(patsubst %py.in,%py,$(wildcard *.py.in))
+
+noinst_SCRIPTS = $(CONFTESTS)
+
+CLEANFILES = $(CONFTESTS)
+
+edit = sed \
+ -e 's|@LIBS[@]|$(LIBS)|g' \
+ -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
+
+
+$(CONFTESTS): Makefile
+ rm -f $@ $@.tmp
+ test -f $(srcdir)/$@.in && $(edit) $(srcdir)/$@.in >$@.tmp || true
+ test -f $@.tmp || false
+ chmod a-w $@.tmp
+ mv $@.tmp $@
+
+# vim:set ts=2 sw=2 noet:
--
1.5.6.5
More information about the pacman-dev
mailing list