Update after gnulib changed.
[libiconv.git] / autogen.sh
blob5f65529a1c47c0b0f202f7776e1f35d9c7b12c15
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.71 and automake-1.11..1.16 in the PATH.
8 # If not used from a released tarball, it also requires either
9 # - the GNULIB_SRCDIR environment variable pointing to a gnulib checkout, or
10 # - a preceding invocation of './gitsub.sh pull'.
11 # It also requires
12 # - the gperf program.
14 # Copyright (C) 2003-2012, 2016, 2018-2021 Free Software Foundation, Inc.
16 # This program is free software: you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 3 of the License, or
19 # (at your option) any later version.
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with this program. If not, see <https://www.gnu.org/licenses/>.
29 # Usage: ./autogen.sh [--skip-gnulib]
31 skip_gnulib=false
32 while :; do
33 case "$1" in
34 --skip-gnulib) skip_gnulib=true; shift;;
35 *) break ;;
36 esac
37 done
39 # ========== Copy files from gnulib, automake, or the internet. ==========
41 if test $skip_gnulib = false; then
42 if test -n "$GNULIB_SRCDIR"; then
43 test -d "$GNULIB_SRCDIR" || {
44 echo "*** GNULIB_SRCDIR is set but does not point to an existing directory." 1>&2
45 exit 1
47 else
48 GNULIB_SRCDIR=`pwd`/gnulib
49 test -d "$GNULIB_SRCDIR" || {
50 echo "*** Subdirectory 'gnulib' does not yet exist. Use './gitsub.sh pull' to create it, or set the environment variable GNULIB_SRCDIR." 1>&2
51 exit 1
54 # Now it should contain a gnulib-tool.
55 GNULIB_TOOL="$GNULIB_SRCDIR/gnulib-tool"
56 test -f "$GNULIB_TOOL" || {
57 echo "*** gnulib-tool not found." 1>&2
58 exit 1
60 for file in build-aux/compile build-aux/ar-lib; do
61 $GNULIB_TOOL --copy-file $file || exit $?
62 chmod a+x $file || exit $?
63 done
64 make -f Makefile.devel \
65 gnulib-clean srclib/Makefile.gnulib gnulib-imported-files srclib/Makefile.in \
66 GNULIB_TOOL="$GNULIB_TOOL"
69 # Copy files into the libcharset subpackage, so that libcharset/autogen.sh
70 # does not need to invoke gnulib-tool nor automake.
71 for file in INSTALL.generic; do
72 cp -p $file libcharset/$file || exit $?
73 done
74 for file in config.guess config.libpath config.sub install-sh libtool-reloc mkinstalldirs; do
75 cp -p build-aux/$file libcharset/build-aux/$file || exit $?
76 done
77 for file in codeset.m4 fcntl-o.m4 lib-ld.m4 relocatable.m4 relocatable-lib.m4 visibility.m4; do
78 cp -p srcm4/$file libcharset/m4/$file || exit $?
79 done
81 # ========== Generate files. ==========
83 make -f Makefile.devel totally-clean all || exit $?
85 (cd libcharset
86 ./autogen.sh || exit $?
89 echo "$0: done. Now you can run './configure'."