summaryrefslogtreecommitdiffstats
path: root/contrib/groff/gendef.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/groff/gendef.sh')
-rw-r--r--contrib/groff/gendef.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/groff/gendef.sh b/contrib/groff/gendef.sh
new file mode 100644
index 0000000..e2b2575
--- /dev/null
+++ b/contrib/groff/gendef.sh
@@ -0,0 +1,24 @@
+# gendef filename var=val var=val
+
+file=$1
+shift
+
+defs="#define $1"
+shift
+for def
+do
+ defs="$defs
+#define $def"
+done
+
+t=/tmp/groff.$$
+
+sed -e 's/=/ /' >$t <<EOF
+$defs
+EOF
+
+test -r $file && cmp -s $t $file || cp $t $file
+
+rm -f $t
+
+exit 0
OpenPOWER on IntegriCloud