Get rid of autom4te.cache directories, as far as possible.
[libiconv.git] / autogen.sh
blob3a0cad4e177f3fd8de44e67237c4790c401ba90b
1 #!/bin/sh
2 # Convenience script for regenerating all autogeneratable files that are
3 # omitted from the version control repository. In particular, this script
4 # also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files
5 # with new versions of autoconf or automake.
7 # This script requires autoconf-2.63..2.69 and automake-1.11..1.15 in the PATH.
8 # It also requires either
9 # - the GNULIB_TOOL environment variable pointing to the gnulib-tool script
10 # in a gnulib checkout, or
11 # - the git program in the PATH and an internet connection.
12 # It also requires
13 # - the gperf program.
15 # Copyright (C) 2003-2012, 2016 Free Software Foundation, Inc.
17 # This program is free software: you can redistribute it and/or modify
18 # it under the terms of the GNU General Public License as published by
19 # the Free Software Foundation; either version 3 of the License, or
20 # (at your option) any later version.
22 # This program is distributed in the hope that it will be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 # GNU General Public License for more details.
27 # You should have received a copy of the GNU General Public License
28 # along with this program. If not, see <http://www.gnu.org/licenses/>.
30 # Usage: ./autogen.sh [--skip-gnulib]
32 # Usage from a git checkout: ./autogen.sh
33 # This uses an up-to-date gnulib checkout.
35 # Usage from a released tarball: ./autogen.sh --skip-gnulib
36 # This does not use a gnulib checkout.
38 skip_gnulib=false
39 while :; do
40 case "$1" in
41 --skip-gnulib) skip_gnulib=true; shift;;
42 *) break ;;
43 esac
44 done
46 if test $skip_gnulib = false; then
47 if test -z "$GNULIB_TOOL"; then
48 # Check out gnulib in a subdirectory 'gnulib'.
49 if test -d gnulib; then
50 (cd gnulib && git pull)
51 else
52 git clone git://git.savannah.gnu.org/gnulib.git
54 # Now it should contain a gnulib-tool.
55 if test -f gnulib/gnulib-tool; then
56 GNULIB_TOOL=`pwd`/gnulib/gnulib-tool
57 else
58 echo "** warning: gnulib-tool not found" 1>&2
61 # Skip the gnulib-tool step if gnulib-tool was not found.
62 if test -n "$GNULIB_TOOL"; then
63 make -f Makefile.devel \
64 gnulib-clean srclib/Makefile.gnulib gnulib-imported-files \
65 GNULIB_TOOL="$GNULIB_TOOL"
69 make -f Makefile.devel totally-clean all || exit $?
71 # Copy files into the libcharset subpackage, so that libcharset/autogen.sh
72 # does not need to invoke gnulib-tool nor automake.
73 for file in INSTALL.generic; do
74 cp -p $file libcharset/$file || exit $?
75 done
76 for file in config.guess config.libpath config.sub install-sh mkinstalldirs; do
77 cp -p build-aux/$file libcharset/build-aux/$file || exit $?
78 done
79 for file in codeset.m4 fcntl-o.m4 glibc21.m4 relocatable-lib.m4 visibility.m4; do
80 cp -p srcm4/$file libcharset/m4/$file || exit $?
81 done
83 (cd libcharset
84 ./autogen.sh || exit $?
87 echo "$0: done. Now you can run './configure'."