libtool 1.0d fix
[automake.git] / acinstall
blobedb8ddda9877a0a9d3fec8c6e158fddb321fadb3
1 #! /bin/sh
3 # Install an aclocal-style M4 file. A script is needed to do this
4 # because we want to do serial-number checking; newer versions of
5 # macro files should always be preferred.
7 # Usage:
8 # acinstall file directory installprogram [install-args]...
10 file="$1"
11 dir="$2"
12 shift
13 shift
15 localserial=`grep '^# serial ' $file | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
16 if test -z "$localserial"; then
17 echo "acinstall: no serial number in $file" 1>&2
18 exit 1
21 # Maybe if the installed file has no serial number we should just
22 # assume it is ancient.
23 instserial=`grep '^# serial ' $dir/$file | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
24 if test -z "$instserial"; then
25 echo "acinstall: no serial number in $dir/$file" 1>&2
26 exit 1
29 if test $localserial -lt $instserial; then
30 # Installed file is newer.
31 exit 0
34 # Install the file.
35 $* $file $dir/$file