3
# This script is a work-alike of `aclocal' contained in the GNU automake
4
# package. It is needed because our aclocal.m4 must be generated from the
5
# non-gettext .m4 files in /usr/share/aclocal and from the gettext specific
6
# .m4 files in the local m4 directory.
7
# With "aclocal --acdir=m4"
8
# we get an error: macro `AM_INIT_AUTOMAKE' not found in library
10
# we get an error: duplicated macro `AM_GNU_GETTEXT'
11
# The solution is to put all the .m4 files into a temporary directory.
13
# This program is free software; you can redistribute it and/or modify
14
# it under the terms of the GNU General Public License as published by
15
# the Free Software Foundation; either version 2, or (at your option)
18
# This program is distributed in the hope that it will be useful,
19
# but WITHOUT ANY WARRANTY; without even the implied warranty of
20
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
# GNU General Public License for more details.
23
# You should have received a copy of the GNU General Public License
24
# along with this program; if not, write to the Free Software
25
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
31
echo "Usage: $0 aclocal-program [aclocal-options]" 1>&2
38
# Prepare temporary directory.
40
trap "rm -rf aclocal.tmp; exit 1" 1 2 15
42
# First, copy the standard m4 files.
43
for f in `"$ACLOCAL" --print-ac-dir`/*.m4; do
47
# Then, copy the contents of any -I directories, overriding previously
48
# copied files of the same name.
53
if test $last_was_I = yes; then
54
for f in "$arg"/*.m4; do
61
*) last_was_I=no options="$options $arg";;
66
# Now call `aclocal' for real.
67
"$ACLOCAL" --acdir=aclocal.tmp $options
69
# Clean up temporary directory.