The syntax is `m4.sh filename args-to-m4` which processes filename.m4 and
writes it to filename. Additional arguments are passed to m4.
This script differs from just calling m4 that it writes the header "Do not
edit this file" to the generated file to prevent accidental changes.
--- /dev/null
+#!/bin/sh
+
+# m4 wrapper script which uses $1.m4 as template file, feeds it to m4 and
+# writes it to m4 with a warning at the beginning to not edit the generated
+# file.
+#
+# All arguments to this script (except the first which is the filename) are
+# passed to m4.
+
+
+# First argument is file name.
+file=$1
+shift
+
+# Write a warning to the generated file.
+echo "###################################" > $file
+echo "# WARNING! DO NOT EDIT THIS FILE! #" >> $file
+echo "###################################" >> $file
+echo >> $file
+echo "# It was generated from $file.m4 on `date`." >> $file
+echo >> $file
+
+# Process $1.m4 with m4 using the given options.
+m4 $* $file.m4 >> $file