summaryrefslogtreecommitdiff
path: root/acinstall
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>1996-08-24 16:20:57 +0000
committerTom Tromey <tromey@redhat.com>1996-08-24 16:20:57 +0000
commit18518e21c98c5539b7df51a4c08652db1620db72 (patch)
tree8ca8c7dcfcb2bde747f8998235936c30b2075a20 /acinstall
parent4568092540936f783c021ffde1a115529b631e76 (diff)
downloadautomake-18518e21c98c5539b7df51a4c08652db1620db72.tar.gz
m4 fixes
Diffstat (limited to 'acinstall')
-rwxr-xr-xacinstall35
1 files changed, 35 insertions, 0 deletions
diff --git a/acinstall b/acinstall
new file mode 100755
index 000000000..e77fdf5a4
--- /dev/null
+++ b/acinstall
@@ -0,0 +1,35 @@
+#! /bin/sh
+
+# Install an aclocal-style M4 file. A script is needed to do this
+# because we want to do serial-number checking; newer versions of
+# macro files should always be preferred.
+
+# Usage:
+# acinstall file directory installprogram [install-args]...
+
+file="$1"
+dir="$2"
+shift
+shift
+
+localserial="`grep '^# serial' $file | sed -e 's/^# serial //g'`"
+if test -z "$localserial"; then
+ echo "acinstall: no serial number in $file" 1>&2
+ exit 1
+fi
+
+# Maybe if the installed file has no serial number we should just
+# assume it is ancient.
+instserial="`grep '^# serial' $dir/$file | sed -e 's/^# serial //g'`"
+if test -z "$instserial"; then
+ echo "acinstall: no serial number in $dir/$file" 1>&2
+ exit 1
+fi
+
+if test $localserial -lt $instserial; then
+ # Installed file is newer.
+ exit 0
+fi
+
+# Install the file.
+$* $file $dir/$file