blob: ad56f6002f8cb6484d4b72276eb5bff13c28c2d3 [file] [log] [blame]
openvcdiff311c7142008-08-26 19:29:25 +00001#!/bin/sh
openvcdiff@gmail.com64fe2322011-09-27 21:51:41 +00002# Copyright 2008 Google Inc.
3# Authors: Craig Silverstein, Lincoln Smith
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
openvcdiff311c7142008-08-26 19:29:25 +000017# These are the files that this script might edit:
18# aclocal.m4 configure Makefile.in src/config.h.in \
19# depcomp config.guess config.sub install-sh missing mkinstalldirs \
20# ltmain.sh
21#
22# Here's a command you can run to see what files aclocal will import:
23# aclocal -I ../autoconf --output=- | sed -n 's/^m4_include..\([^]]*\).*/\1/p'
24
25set -ex
26rm -rf autom4te.cache
27
28trap 'rm -f aclocal.m4.tmp' EXIT
29
openvcdiff@gmail.com732fff22010-08-04 18:00:00 +000030# Use version 1.11 of aclocal and automake if available.
31ACLOCAL=aclocal-1.11
openvcdiff311c7142008-08-26 19:29:25 +000032if test -z `which "$ACLOCAL"`; then
33 ACLOCAL=aclocal
34fi
35
openvcdiff@gmail.com732fff22010-08-04 18:00:00 +000036AUTOMAKE=automake-1.11
openvcdiff311c7142008-08-26 19:29:25 +000037if test -z `which "$AUTOMAKE"`; then
38 AUTOMAKE=automake
39fi
40
41# glibtoolize is used for Mac OS X
42LIBTOOLIZE=libtoolize
43if test -z `which "$LIBTOOLIZE"`; then
44 LIBTOOLIZE=glibtoolize
45fi
46
47# aclocal tries to overwrite aclocal.m4 even if the contents haven't
48# changed, which is annoying when the file is not open for edit (in
49# p4). We work around this by writing to a temp file and just
50# updating the timestamp if the file hasn't change.
openvcdiff@gmail.com732fff22010-08-04 18:00:00 +000051"$ACLOCAL" --force -I m4 -I gflags/m4 --output=aclocal.m4.tmp
openvcdiff311c7142008-08-26 19:29:25 +000052if cmp aclocal.m4.tmp aclocal.m4; then
53 touch aclocal.m4 # pretend that we regenerated the file
54 rm -f aclocal.m4.tmp
55else
56 mv aclocal.m4.tmp aclocal.m4 # we did set -e above, so we die if this fails
57fi
58
59grep -q LIBTOOL configure.ac && "$LIBTOOLIZE" -c -f
60autoconf -f -W all,no-obsolete
61autoheader -f -W all
62"$AUTOMAKE" -a -c -f -W all
63
64rm -rf autom4te.cache
65exit 0