Skip to content

Commit 4d1a21e

Browse files
committed
build: Separate git operations from build operations.
1 parent bb4f73b commit 4d1a21e

File tree

5 files changed

+528
-33
lines changed

5 files changed

+528
-33
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[subcheckout "gnulib"]
2+
url = git://git.savannah.gnu.org/gnulib.git
3+
path = gnulib

ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2019-04-01 Bruno Haible <bruno@clisp.org>
2+
3+
build: Separate git operations from build operations.
4+
* gitsub.sh: New file, from gnulib.
5+
* .gitmodules: New file.
6+
* autogen.sh: Remove all git operations. Look at GNULIB_SRCDIR
7+
environment variable. Ignore the GNULIB_TOOL environment variable.
8+
* HACKING: Explain when to use gitsub.sh.
9+
110
2019-03-07 Bruno Haible <bruno@clisp.org>
211

312
Avoid signed integer overflow during shifts.

HACKING

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,14 @@ Access to the Git repository is described at
4949
https://savannah.gnu.org/git/?group=libiconv .
5050

5151
After fetching the sources from the Git repository, peek at the comments in
52-
autogen.sh, then run "./autogen.sh"; then you can proceed with "./configure"
53-
as usual.
52+
autogen.sh, then run
53+
./gitsub.sh pull
54+
./autogen.sh
55+
Then you can proceed with "./configure" as usual.
56+
57+
Each time you want to update the source, do not only "git pull". Instead do
58+
git pull && ./gitsub.sh pull
59+
./autogen.sh
5460

5561

5662
Adding new encodings

autogen.sh

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
# with new versions of autoconf or automake.
66
#
77
# This script requires autoconf-2.63..2.69 and automake-1.11..1.16 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.
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'.
1211
# It also requires
1312
# - the gperf program.
1413

@@ -28,12 +27,6 @@
2827
# along with this program. If not, see <https://www.gnu.org/licenses/>.
2928

3029
# Usage: ./autogen.sh [--skip-gnulib]
31-
#
32-
# Usage from a git checkout: ./autogen.sh
33-
# This uses an up-to-date gnulib checkout.
34-
#
35-
# Usage from a released tarball: ./autogen.sh --skip-gnulib
36-
# This does not use a gnulib checkout.
3730

3831
skip_gnulib=false
3932
while :; do
@@ -44,28 +37,29 @@ while :; do
4437
done
4538

4639
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
53-
fi
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
59-
fi
60-
fi
61-
# Skip the gnulib-tool step if gnulib-tool was not found.
62-
if test -n "$GNULIB_TOOL"; then
63-
$GNULIB_TOOL --copy-file build-aux/ar-lib || exit $?
64-
chmod a+x build-aux/ar-lib || exit $?
65-
make -f Makefile.devel \
66-
gnulib-clean srclib/Makefile.gnulib gnulib-imported-files \
67-
GNULIB_TOOL="$GNULIB_TOOL"
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
43+
exit 1
44+
}
45+
else
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
49+
exit 1
50+
}
6851
fi
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
56+
exit 1
57+
}
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"
6963
fi
7064

7165
make -f Makefile.devel totally-clean all || exit $?

0 commit comments

Comments
 (0)