aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-19 23:47:58 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-19 23:47:58 +0000
commit867d2b7dfb8b82ec8a731080f6b51642ced8baf3 (patch)
tree992d0435a02fd37db712d16c374127f782bf8bec /misc
parentb62836c62ecb1769687e6290f765b5a946082951 (diff)
downloadpaludis-867d2b7dfb8b82ec8a731080f6b51642ced8baf3.tar.gz
paludis-867d2b7dfb8b82ec8a731080f6b51642ced8baf3.tar.xz
Regenerate m4-created files where needed. Should only affect SVN users who don't rerun ./autogen.bash after every update. Normal users (if we ever get any) shouldn't ever hit this, and so won't need the GNU m4 dependency.
Diffstat (limited to 'misc')
-rw-r--r--misc/Makefile.am2
-rwxr-xr-xmisc/do_m4.bash23
2 files changed, 24 insertions, 1 deletions
diff --git a/misc/Makefile.am b/misc/Makefile.am
index 91a5cf3..ef81f09 100644
--- a/misc/Makefile.am
+++ b/misc/Makefile.am
@@ -1,4 +1,4 @@
CLEANFILES = *~
MAINTAINERCLEANFILES = Makefile.in svn-version-filter-data.bash
-EXTRA_DIST = generated-file.txt svn-version-filter-data.bash.in
+EXTRA_DIST = generated-file.txt svn-version-filter-data.bash.in do_m4.bash
diff --git a/misc/do_m4.bash b/misc/do_m4.bash
new file mode 100755
index 0000000..63a042e
--- /dev/null
+++ b/misc/do_m4.bash
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et tw=80 :
+
+if test "xyes" = x"${BASH_VERSION}" ; then
+ echo "This is not bash!"
+ exit 127
+fi
+
+trap 'echo "exiting." ; exit 250' 15
+KILL_PID=$$
+
+get_m4() {
+ type "gm4" &>/dev/null && echo gm4 && return
+ type "m4" &>/dev/null && echo m4 && return
+ echo "Could not find m4" 1>&2
+ kill $KILL_PID
+}
+
+echo ">>> $(get_m4 ) -I. -I.. -I../.. -E ${1}.m4 > ${1}"
+if ! $(get_m4 ) -I. -I.. -I../.. -E ${1}.m4 > ${1} ; then
+ echo "oops!" 1>&2
+ exit 127
+fi