aboutsummaryrefslogtreecommitdiff
path: root/0.8.0/misc/do_m4.bash
diff options
context:
space:
mode:
Diffstat (limited to '0.8.0/misc/do_m4.bash')
-rwxr-xr-x0.8.0/misc/do_m4.bash23
1 files changed, 23 insertions, 0 deletions
diff --git a/0.8.0/misc/do_m4.bash b/0.8.0/misc/do_m4.bash
new file mode 100755
index 0000000..63a042e
--- /dev/null
+++ b/0.8.0/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