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.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'.
12 # - the gperf program.
14 # Copyright (C) 2003-2012, 2016, 2018-2019 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]
34 --skip-gnulib) skip_gnulib
=true
; shift;;
39 if test $skip_gnulib = false
; then
40 if test -n "$GNULIB_SRCDIR"; then
41 test -d "$GNULIB_SRCDIR" ||
{
42 echo "*** GNULIB_SRCDIR is set but does not point to an existing directory." 1>&2
46 GNULIB_SRCDIR
=`pwd`/gnulib
47 test -d "$GNULIB_SRCDIR" ||
{
48 echo "*** Subdirectory 'gnulib' does not yet exist. Use './gitsub.sh pull' to create it, or set the environment variable GNULIB_SRCDIR." 1>&2
52 # Now it should contain a gnulib-tool.
53 GNULIB_TOOL
="$GNULIB_SRCDIR/gnulib-tool"
54 test -f "$GNULIB_TOOL" ||
{
55 echo "*** gnulib-tool not found." 1>&2
58 $GNULIB_TOOL --copy-file build-aux
/ar-lib ||
exit $?
59 chmod a
+x build-aux
/ar-lib ||
exit $?
60 make -f Makefile.devel \
61 gnulib-clean srclib
/Makefile.gnulib gnulib-imported-files \
62 GNULIB_TOOL
="$GNULIB_TOOL"
65 make -f Makefile.devel totally-clean all ||
exit $?
67 # Copy files into the libcharset subpackage, so that libcharset/autogen.sh
68 # does not need to invoke gnulib-tool nor automake.
69 for file in INSTALL.generic
; do
70 cp -p $file libcharset
/$file ||
exit $?
72 for file in config.guess config.libpath config.sub install-sh libtool-reloc mkinstalldirs
; do
73 cp -p build-aux
/$file libcharset
/build-aux
/$file ||
exit $?
75 for file in codeset.
m4 fcntl-o.
m4 glibc21.
m4 lib-ld.
m4 relocatable.
m4 relocatable-lib.
m4 visibility.
m4; do
76 cp -p srcm
4/$file libcharset
/m
4/$file ||
exit $?
80 .
/autogen.sh ||
exit $?
83 echo "$0: done. Now you can run './configure'."