annotate bootstrap @ 31191:bb9d776eafac stable

Fix wrong color in PDF printout of some latex strings (bug #62884) * octave-svgconvert (draw): For "rect" elements only set brush color if necessary and eventually restore to previous color.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Sun, 14 Aug 2022 18:24:07 +0200
parents b0024e96ed31
children e98fb9b4be86
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3298
aaf82ff88c82 [project @ 1999-10-19 17:58:31 by jwe]
jwe
parents:
diff changeset
1 #! /bin/sh
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
2 # Print a version string.
29666
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
3 scriptversion=2021-04-11.09; # UTC
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
4
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
5 # Bootstrap this package from checked-out sources.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
6
29495
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
7 # Copyright (C) 2003-2021 Free Software Foundation, Inc.
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
8
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
9 # This program is free software: you can redistribute it and/or modify
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
10 # it under the terms of the GNU General Public License as published by
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
11 # the Free Software Foundation, either version 3 of the License, or
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
12 # (at your option) any later version.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
13
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
14 # This program is distributed in the hope that it will be useful,
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
17 # GNU General Public License for more details.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
18
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
19 # You should have received a copy of the GNU General Public License
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 22323
diff changeset
20 # along with this program. If not, see <https://www.gnu.org/licenses/>.
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
21
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
22 # Originally written by Paul Eggert. The canonical version of this
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
23 # script is maintained as build-aux/bootstrap in gnulib, however, to
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
24 # be useful to your project, you should place a copy of it under
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
25 # version control in the top-level directory of your project. The
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
26 # intent is that all customization can be done with a bootstrap.conf
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
27 # file also maintained in your version control; gnulib comes with a
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
28 # template build-aux/bootstrap.conf to get you started.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
29
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
30 # Please report bugs or propose patches to bug-gnulib@gnu.org.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
31
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
32 nl='
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
33 '
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
34
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
35 # Ensure file names are sorted consistently across platforms.
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
36 LC_ALL=C
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
37 export LC_ALL
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
38
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
39 # Ensure that CDPATH is not set. Otherwise, the output from cd
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
40 # would cause trouble in at least one use below.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
41 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
42
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
43 local_gl_dir=gl
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
44
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
45 # Honor $PERL, but work even if there is none.
20460
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
46 PERL="${PERL-perl}"
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
47
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
48 me=$0
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
49
29495
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
50 default_gnulib_url=https://git.savannah.gnu.org/git/gnulib.git
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
51
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
52 usage() {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
53 cat <<EOF
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
54 Usage: $me [OPTION]...
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
55 Bootstrap this package from the checked-out sources.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
56
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
57 Options:
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
58 --gnulib-srcdir=DIRNAME specify the local directory where gnulib
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
59 sources reside. Use this if you already
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
60 have gnulib sources on your machine, and
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
61 do not want to waste your bandwidth downloading
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
62 them again. Defaults to \$GNULIB_SRCDIR
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
63 --bootstrap-sync if this bootstrap script is not identical to
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
64 the version in the local gnulib sources,
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
65 update this script, and then restart it with
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
66 /bin/sh or the shell \$CONFIG_SHELL
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
67 --no-bootstrap-sync do not check whether bootstrap is out of sync
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
68 --copy copy files instead of creating symbolic links
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
69 --force attempt to bootstrap even if the sources seem
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
70 not to have been checked out
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
71 --no-git do not use git to update gnulib. Requires that
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
72 --gnulib-srcdir point to a correct gnulib snapshot
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
73 --skip-po do not download po files
29495
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
74 EOF
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
75 bootstrap_print_option_usage_hook
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
76 cat <<EOF
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
77 If the file $me.conf exists in the same directory as this script, its
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
78 contents are read as shell variables to configure the bootstrap.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
79
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
80 For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
81 are honored.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
82
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
83 Gnulib sources can be fetched in various ways:
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
84
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
85 * If this package is in a git repository with a 'gnulib' submodule
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
86 configured, then that submodule is initialized and updated and sources
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
87 are fetched from there. If \$GNULIB_SRCDIR is set (directly or via
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
88 --gnulib-srcdir) and is a git repository, then it is used as a reference.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
89
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
90 * Otherwise, if \$GNULIB_SRCDIR is set (directly or via --gnulib-srcdir),
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
91 then sources are fetched from that local directory. If it is a git
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
92 repository and \$GNULIB_REVISION is set, then that revision is checked
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
93 out.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
94
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
95 * Otherwise, if this package is in a git repository with a 'gnulib'
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
96 submodule configured, then that submodule is initialized and updated and
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
97 sources are fetched from there.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
98
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
99 * Otherwise, if the 'gnulib' directory does not exist, Gnulib sources are
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
100 cloned into that directory using git from \$GNULIB_URL, defaulting to
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
101 $default_gnulib_url.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
102 If \$GNULIB_REVISION is set, then that revision is checked out.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
103
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
104 * Otherwise, the existing Gnulib sources in the 'gnulib' directory are
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
105 used. If it is a git repository and \$GNULIB_REVISION is set, then that
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
106 revision is checked out.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
107
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
108 If you maintain a package and want to pin a particular revision of the
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
109 Gnulib sources that has been tested with your package, then there are two
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
110 possible approaches: either configure a 'gnulib' submodule with the
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
111 appropriate revision, or set \$GNULIB_REVISION (and if necessary
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
112 \$GNULIB_URL) in $me.conf.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
113
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
114 Running without arguments will suffice in most cases.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
115 EOF
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
116 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
117
29666
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
118 copyright_year=`echo "$scriptversion" | sed -e 's/[^0-9].*//'`
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
119 copyright="Copyright (C) ${copyright_year} Free Software Foundation, Inc.
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
120 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
121 This is free software: you are free to change and redistribute it.
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
122 There is NO WARRANTY, to the extent permitted by law."
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
123
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
124 # warnf_ FORMAT-STRING ARG1...
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
125 warnf_ ()
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
126 {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
127 warnf_format_=$1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
128 shift
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
129 nl='
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
130 '
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
131 case $* in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
132 *$nl*) me_=$(printf "$me"|tr "$nl|" '??')
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
133 printf "$warnf_format_" "$@" | sed "s|^|$me_: |" ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
134 *) printf "$me: $warnf_format_" "$@" ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
135 esac >&2
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
136 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
137
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
138 # warn_ WORD1...
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
139 warn_ ()
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
140 {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
141 # If IFS does not start with ' ', set it and emit the warning in a subshell.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
142 case $IFS in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
143 ' '*) warnf_ '%s\n' "$*";;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
144 *) (IFS=' '; warn_ "$@");;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
145 esac
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
146 }
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
147
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
148 # die WORD1...
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
149 die() { warn_ "$@"; exit 1; }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
150
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
151 # Configuration.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
152
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
153 # Name of the Makefile.am
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
154 gnulib_mk=gnulib.mk
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
155
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
156 # List of gnulib modules needed.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
157 gnulib_modules=
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
158
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
159 # Any gnulib files needed that are not in modules.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
160 gnulib_files=
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
161
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
162 : ${AUTOPOINT=autopoint}
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
163 : ${AUTORECONF=autoreconf}
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
164
29495
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
165 # A function to be called for each unrecognized option. Returns 0 if
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
166 # the option in $1 has been processed by the function. Returns 1 if
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
167 # the option has not been processed by the function. Override it via
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
168 # your own definition in bootstrap.conf
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
169
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
170 bootstrap_option_hook() { return 1; }
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
171
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
172 # A function to be called in order to print the --help information
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
173 # corresponding to user-defined command-line options.
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
174
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
175 bootstrap_print_option_usage_hook() { :; }
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
176
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
177 # A function to be called right after gnulib-tool is run.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
178 # Override it via your own definition in bootstrap.conf.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
179 bootstrap_post_import_hook() { :; }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
180
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
181 # A function to be called after everything else in this script.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
182 # Override it via your own definition in bootstrap.conf.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
183 bootstrap_epilogue() { :; }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
184
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
185 # The command to download all .po files for a specified domain into a
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
186 # specified directory. Fill in the first %s with the destination
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
187 # directory and the second with the domain name.
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
188 po_download_command_format=\
28016
626ba7cc1d6c update bootstrap script with changes from gnulib version
John W. Eaton <jwe@octave.org>
parents: 28013
diff changeset
189 "wget --mirror --level=1 -nd -nv -A.po -P '%s' \
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
190 https://translationproject.org/latest/%s/"
12158
a73df5341f3c autogen.sh: check for required files instead of having automake do it
John W. Eaton <jwe@octave.org>
parents: 9946
diff changeset
191
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
192 # Prefer a non-empty tarname (4th argument of AC_INIT if given), else
29495
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
193 # fall back to the package name (1st argument with munging).
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
194 extract_package_name='
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
195 /^AC_INIT(\[*/{
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
196 s///
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
197 /^[^,]*,[^,]*,[^,]*,[ []*\([^][ ,)]\)/{
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
198 s//\1/
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
199 s/[],)].*//
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
200 p
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
201 q
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
202 }
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
203 s/[],)].*//
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
204 s/^GNU //
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
205 y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
206 s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
207 p
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
208 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
209 '
29495
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
210 package=$(${AUTOCONF:-autoconf} --trace AC_INIT:\$4 configure.ac 2>/dev/null)
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
211 if test -z "$package"; then
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
212 package=$(sed -n "$extract_package_name" configure.ac) \
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
213 || die 'cannot find package name in configure.ac'
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
214 fi
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
215 gnulib_name=lib$package
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
216
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
217 build_aux=build-aux
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
218 source_base=lib
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
219 m4_base=m4
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
220 doc_base=doc
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
221 tests_base=tests
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
222 gnulib_extra_files="
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
223 build-aux/install-sh
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
224 build-aux/mdate-sh
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
225 build-aux/texinfo.tex
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
226 build-aux/depcomp
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
227 build-aux/config.guess
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
228 build-aux/config.sub
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
229 doc/INSTALL
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
230 "
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
231
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
232 # Additional gnulib-tool options to use. Use "\newline" to break lines.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
233 gnulib_tool_option_extras=
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
234
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
235 # Other locale categories that need message catalogs.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
236 EXTRA_LOCALE_CATEGORIES=
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
237
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
238 # Additional xgettext options to use. Use "\\\newline" to break lines.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
239 XGETTEXT_OPTIONS='\\\
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
240 --flag=_:1:pass-c-format\\\
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
241 --flag=N_:1:pass-c-format\\\
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
242 --flag=error:3:c-format --flag=error_at_line:5:c-format\\\
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
243 '
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
244
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
245 # Package bug report address and copyright holder for gettext files
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
246 COPYRIGHT_HOLDER='Free Software Foundation, Inc.'
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
247 MSGID_BUGS_ADDRESS=bug-$package@gnu.org
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
248
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
249 # Files we don't want to import.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
250 excluded_files=
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
251
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
252 # File that should exist in the top directory of a checked out hierarchy,
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
253 # but not in a distribution tarball.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
254 checkout_only_file=README-hacking
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
255
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
256 # Whether to use copies instead of symlinks.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
257 copy=false
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
258
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
259 # Set this to '.cvsignore .gitignore' in bootstrap.conf if you want
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
260 # those files to be generated in directories like lib/, m4/, and po/.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
261 # Or set it to 'auto' to make this script select which to use based
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
262 # on which version control system (if any) is used in the source directory.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
263 vc_ignore=auto
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
264
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
265 # Set this to true in bootstrap.conf to enable --bootstrap-sync by
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
266 # default.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
267 bootstrap_sync=false
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
268
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
269 # Use git to update gnulib sources
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
270 use_git=true
12158
a73df5341f3c autogen.sh: check for required files instead of having automake do it
John W. Eaton <jwe@octave.org>
parents: 9946
diff changeset
271
20460
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
272 check_exists() {
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
273 if test "$1" = "--verbose"; then
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
274 ($2 --version </dev/null) >/dev/null 2>&1
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
275 if test $? -ge 126; then
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
276 # If not found, run with diagnostics as one may be
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
277 # presented with env variables to set to find the right version
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
278 ($2 --version </dev/null)
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
279 fi
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
280 else
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
281 ($1 --version </dev/null) >/dev/null 2>&1
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
282 fi
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
283
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
284 test $? -lt 126
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
285 }
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
286
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
287 # find_tool ENVVAR NAMES...
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
288 # -------------------------
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
289 # Search for a required program. Use the value of ENVVAR, if set,
20460
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
290 # otherwise find the first of the NAMES that can be run.
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
291 # If found, set ENVVAR to the program name, die otherwise.
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
292 #
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
293 # FIXME: code duplication, see also gnu-web-doc-update.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
294 find_tool ()
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
295 {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
296 find_tool_envvar=$1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
297 shift
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
298 find_tool_names=$@
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
299 eval "find_tool_res=\$$find_tool_envvar"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
300 if test x"$find_tool_res" = x; then
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
301 for i; do
20460
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
302 if check_exists $i; then
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
303 find_tool_res=$i
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
304 break
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
305 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
306 done
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
307 fi
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
308 if test x"$find_tool_res" = x; then
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
309 warn_ "one of these is required: $find_tool_names;"
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
310 die "alternatively set $find_tool_envvar to a compatible tool"
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
311 fi
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
312 eval "$find_tool_envvar=\$find_tool_res"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
313 eval "export $find_tool_envvar"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
314 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
315
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
316 # Override the default configuration, if necessary.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
317 # Make sure that bootstrap.conf is sourced from the current directory
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
318 # if we were invoked as "sh bootstrap".
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
319 case "$0" in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
320 */*) test -r "$0.conf" && . "$0.conf" ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
321 *) test -r "$0.conf" && . ./"$0.conf" ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
322 esac
12158
a73df5341f3c autogen.sh: check for required files instead of having automake do it
John W. Eaton <jwe@octave.org>
parents: 9946
diff changeset
323
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
324 if test "$vc_ignore" = auto; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
325 vc_ignore=
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
326 test -d .git && vc_ignore=.gitignore
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
327 test -d CVS && vc_ignore="$vc_ignore .cvsignore"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
328 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
329
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
330 if test x"$gnulib_modules$gnulib_files$gnulib_extra_files" = x; then
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
331 use_gnulib=false
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
332 else
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
333 use_gnulib=true
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
334 fi
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
335
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
336 # Translate configuration into internal form.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
337
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
338 # Parse options.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
339
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
340 for option
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
341 do
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
342 case $option in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
343 --help)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
344 usage
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
345 exit;;
29666
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
346 --version)
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
347 set -e
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
348 echo "bootstrap $scriptversion"
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
349 echo "$copyright"
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
350 exit 0
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
351 ;;
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
352 --gnulib-srcdir=*)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
353 GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
354 --skip-po)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
355 SKIP_PO=t;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
356 --force)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
357 checkout_only_file=;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
358 --copy)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
359 copy=true;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
360 --bootstrap-sync)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
361 bootstrap_sync=true;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
362 --no-bootstrap-sync)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
363 bootstrap_sync=false;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
364 --no-git)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
365 use_git=false;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
366 *)
29495
0cf53a415b7f maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 28554
diff changeset
367 bootstrap_option_hook $option || die "$option: unknown option";;
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
368 esac
12158
a73df5341f3c autogen.sh: check for required files instead of having automake do it
John W. Eaton <jwe@octave.org>
parents: 9946
diff changeset
369 done
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
370
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
371 $use_git || test -d "$GNULIB_SRCDIR" \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
372 || die "Error: --no-git requires --gnulib-srcdir"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
373
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
374 if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
375 die "Bootstrapping from a non-checked-out distribution is risky."
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
376 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
377
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
378 # Strip blank and comment lines to leave significant entries.
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
379 gitignore_entries() {
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
380 sed '/^#/d; /^$/d' "$@"
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
381 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
382
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
383 # If $STR is not already on a line by itself in $FILE, insert it at the start.
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
384 # Entries are inserted at the start of the ignore list to ensure existing
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
385 # entries starting with ! are not overridden. Such entries support
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
386 # whitelisting exceptions after a more generic blacklist pattern.
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
387 insert_if_absent() {
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
388 file=$1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
389 str=$2
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
390 test -f $file || touch $file
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
391 test -r $file || die "Error: failed to read ignore file: $file"
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
392 duplicate_entries=$(gitignore_entries $file | sort | uniq -d)
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
393 if [ "$duplicate_entries" ] ; then
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
394 die "Error: Duplicate entries in $file: " $duplicate_entries
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
395 fi
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
396 linesold=$(gitignore_entries $file | wc -l)
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
397 linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
398 if [ $linesold != $linesnew ] ; then
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
399 { echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
400 || die "insert_if_absent $file $str: failed"
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
401 fi
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
402 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
403
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
404 # Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
405 # insert_if_absent.
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
406 insert_vc_ignore() {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
407 vc_ignore_file="$1"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
408 pattern="$2"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
409 case $vc_ignore_file in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
410 *.gitignore)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
411 # A .gitignore entry that does not start with '/' applies
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
412 # recursively to subdirectories, so prepend '/' to every
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
413 # .gitignore entry.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
414 pattern=$(echo "$pattern" | sed s,^,/,);;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
415 esac
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
416 insert_if_absent "$vc_ignore_file" "$pattern"
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
417 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
418
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
419 # Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
420 found_aux_dir=no
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
421 grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
422 >/dev/null && found_aux_dir=yes
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
423 grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
424 >/dev/null && found_aux_dir=yes
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
425 test $found_aux_dir = yes \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
426 || die "configure.ac lacks 'AC_CONFIG_AUX_DIR([$build_aux])'; add it"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
427
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
428 # If $build_aux doesn't exist, create it now, otherwise some bits
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
429 # below will malfunction. If creating it, also mark it as ignored.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
430 if test ! -d $build_aux; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
431 mkdir $build_aux
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
432 for dot_ig in x $vc_ignore; do
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
433 test $dot_ig = x && continue
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
434 insert_vc_ignore $dot_ig $build_aux
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
435 done
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
436 fi
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
437
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
438 # Note this deviates from the version comparison in automake
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
439 # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
440 # but this should suffice as we won't be specifying old
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
441 # version formats or redundant trailing .0 in bootstrap.conf.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
442 # If we did want full compatibility then we should probably
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
443 # use m4_version_compare from autoconf.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
444 sort_ver() { # sort -V is not generally available
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
445 ver1="$1"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
446 ver2="$2"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
447
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
448 # split on '.' and compare each component
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
449 i=1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
450 while : ; do
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
451 p1=$(echo "$ver1" | cut -d. -f$i)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
452 p2=$(echo "$ver2" | cut -d. -f$i)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
453 if [ ! "$p1" ]; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
454 echo "$1 $2"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
455 break
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
456 elif [ ! "$p2" ]; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
457 echo "$2 $1"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
458 break
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
459 elif [ ! "$p1" = "$p2" ]; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
460 if [ "$p1" -gt "$p2" ] 2>/dev/null; then # numeric comparison
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
461 echo "$2 $1"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
462 elif [ "$p2" -gt "$p1" ] 2>/dev/null; then # numeric comparison
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
463 echo "$1 $2"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
464 else # numeric, then lexicographic comparison
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
465 lp=$(printf "$p1\n$p2\n" | LANG=C sort -n | tail -n1)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
466 if [ "$lp" = "$p2" ]; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
467 echo "$1 $2"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
468 else
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
469 echo "$2 $1"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
470 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
471 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
472 break
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
473 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
474 i=$(($i+1))
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
475 done
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
476 }
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
477
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
478 get_version_sed='
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
479 # Move version to start of line.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
480 s/.*[v ]\([0-9]\)/\1/
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
481
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
482 # Skip lines that do not start with version.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
483 /^[0-9]/!d
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
484
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
485 # Remove characters after the version.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
486 s/[^.a-z0-9-].*//
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
487
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
488 # The first component must be digits only.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
489 s/^\([0-9]*\)[a-z-].*/\1/
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
490
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
491 #the following essentially does s/5.005/5.5/
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
492 s/\.0*\([1-9]\)/.\1/g
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
493 p
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
494 q'
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
495
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
496 get_version() {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
497 app=$1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
498
20460
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
499 $app --version >/dev/null 2>&1 || { $app --version; return 1; }
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
500
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
501 $app --version 2>&1 | sed -n "$get_version_sed"
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
502 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
503
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
504 check_versions() {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
505 ret=0
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
506
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
507 while read app req_ver; do
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
508 # We only need libtoolize from the libtool package.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
509 if test "$app" = libtool; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
510 app=libtoolize
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
511 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
512 # Exempt git if --no-git is in effect.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
513 if test "$app" = git; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
514 $use_git || continue
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
515 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
516 # Honor $APP variables ($TAR, $AUTOCONF, etc.)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
517 appvar=$(echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_')
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
518 test "$appvar" = TAR && appvar=AMTAR
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
519 case $appvar in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
520 GZIP) ;; # Do not use $GZIP: it contains gzip options.
20460
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
521 PERL::*) ;; # Keep perl modules as-is
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
522 *) eval "app=\${$appvar-$app}" ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
523 esac
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
524
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
525 # Handle the still-experimental Automake-NG programs specially.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
526 # They remain named as the mainstream Automake programs ("automake",
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
527 # and "aclocal") to avoid gratuitous incompatibilities with
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
528 # pre-existing usages (by, say, autoreconf, or custom autogen.sh
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
529 # scripts), but correctly identify themselves (as being part of
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
530 # "GNU automake-ng") when asked their version.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
531 case $app in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
532 automake-ng|aclocal-ng)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
533 app=${app%-ng}
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
534 ($app --version | grep '(GNU automake-ng)') >/dev/null 2>&1 || {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
535 warn_ "Error: '$app' not found or not from Automake-NG"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
536 ret=1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
537 continue
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
538 } ;;
20460
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
539 # Another check is for perl modules. These can be written as
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
540 # e.g. perl::XML::XPath in case of XML::XPath module, etc.
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
541 perl::*)
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
542 # Extract module name
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
543 app="${app#perl::}"
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
544 if ! $PERL -m"$app" -e 'exit 0' >/dev/null 2>&1; then
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
545 warn_ "Error: perl module '$app' not found"
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
546 ret=1
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
547 fi
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
548 continue
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
549 ;;
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
550 esac
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
551 if [ "$req_ver" = "-" ]; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
552 # Merely require app to exist; not all prereq apps are well-behaved
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
553 # so we have to rely on $? rather than get_version.
20460
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
554 if ! check_exists --verbose $app; then
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
555 warn_ "Error: '$app' not found"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
556 ret=1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
557 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
558 else
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
559 # Require app to produce a new enough version string.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
560 inst_ver=$(get_version $app)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
561 if [ ! "$inst_ver" ]; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
562 warn_ "Error: '$app' not found"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
563 ret=1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
564 else
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
565 latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
566 if [ ! "$latest_ver" = "$inst_ver" ]; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
567 warnf_ '%s\n' \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
568 "Error: '$app' version == $inst_ver is too old" \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
569 " '$app' version >= $req_ver is required"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
570 ret=1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
571 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
572 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
573 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
574 done
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
575
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
576 return $ret
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
577 }
3298
aaf82ff88c82 [project @ 1999-10-19 17:58:31 by jwe]
jwe
parents:
diff changeset
578
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
579 print_versions() {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
580 echo "Program Min_version"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
581 echo "----------------------"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
582 printf %s "$buildreq"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
583 echo "----------------------"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
584 # can't depend on column -t
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
585 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
586
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
587 # Find sha1sum, named gsha1sum on MacPorts, shasum on Mac OS X 10.6.
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
588 # Also find the compatible sha1 utility on the BSDs
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
589 if test x"$SKIP_PO" = x; then
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
590 find_tool SHA1SUM sha1sum gsha1sum shasum sha1
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
591 fi
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
592
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
593 use_libtool=0
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
594 # We'd like to use grep -E, to see if any of LT_INIT,
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
595 # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
596 # but that's not portable enough (e.g., for Solaris).
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
597 grep '^[ ]*A[CM]_PROG_LIBTOOL' configure.ac >/dev/null \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
598 && use_libtool=1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
599 grep '^[ ]*LT_INIT' configure.ac >/dev/null \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
600 && use_libtool=1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
601 if test $use_libtool = 1; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
602 find_tool LIBTOOLIZE glibtoolize libtoolize
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
603 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
604
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
605 # gnulib-tool requires at least automake and autoconf.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
606 # If either is not listed, add it (with minimum version) as a prerequisite.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
607 case $buildreq in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
608 *automake*) ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
609 *) buildreq="automake 1.9
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
610 $buildreq" ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
611 esac
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
612 case $buildreq in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
613 *autoconf*) ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
614 *) buildreq="autoconf 2.59
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
615 $buildreq" ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
616 esac
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
617
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
618 # When we can deduce that gnulib-tool will require patch,
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
619 # and when patch is not already listed as a prerequisite, add it, too.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
620 if test -d "$local_gl_dir" \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
621 && ! find "$local_gl_dir" -name '*.diff' -exec false {} +; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
622 case $buildreq in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
623 *patch*) ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
624 *) buildreq="patch -
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
625 $buildreq" ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
626 esac
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
627 fi
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
628
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
629 if ! printf "$buildreq" | check_versions; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
630 echo >&2
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
631 if test -f README-prereq; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
632 die "See README-prereq for how to get the prerequisite programs"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
633 else
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
634 die "Please install the prerequisite programs"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
635 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
636 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
637
20460
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
638 # Warn the user if autom4te appears to be broken; this causes known
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
639 # issues with at least gettext 0.18.3.
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
640 probe=$(echo 'm4_quote([hi])' | autom4te -l M4sugar -t 'm4_quote:$%' -)
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
641 if test "x$probe" != xhi; then
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
642 warn_ "WARNING: your autom4te wrapper eats stdin;"
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
643 warn_ "if bootstrap fails, consider upgrading your autotools"
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
644 fi
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
645
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
646 echo "$0: Bootstrapping from checked-out $package sources..."
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
647
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
648 # See if we can use gnulib's git-merge-changelog merge driver.
20460
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
649 if $use_git && test -d .git && check_exists git; then
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
650 if git config merge.merge-changelog.driver >/dev/null ; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
651 :
20460
2de0eb7405e4 * bootstrap: Update from gnulib sources.
John W. Eaton <jwe@octave.org>
parents: 17299
diff changeset
652 elif check_exists git-merge-changelog; then
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
653 echo "$0: initializing git-merge-changelog driver"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
654 git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
655 git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
656 else
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
657 echo "$0: consider installing git-merge-changelog from gnulib"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
658 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
659 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
660
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
661
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
662 cleanup_gnulib() {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
663 status=$?
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
664 rm -fr "$gnulib_path"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
665 exit $status
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
666 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
667
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
668 git_modules_config () {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
669 test -f .gitmodules && git config --file .gitmodules "$@"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
670 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
671
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
672 if $use_gnulib; then
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
673 if $use_git; then
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
674 gnulib_path=$(git_modules_config submodule.gnulib.path)
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
675 test -z "$gnulib_path" && gnulib_path=gnulib
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
676 fi
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
677
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
678 # Get gnulib files. Populate $GNULIB_SRCDIR, possibly updating a
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
679 # submodule, for use in the rest of the script.
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
680
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
681 case ${GNULIB_SRCDIR--} in
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
682 -)
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
683 # Note that $use_git is necessarily true in this case.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
684 if git_modules_config submodule.gnulib.url >/dev/null; then
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
685 echo "$0: getting gnulib files..."
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
686 git submodule init -- "$gnulib_path" || exit $?
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
687 git submodule update -- "$gnulib_path" || exit $?
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
688
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
689 elif [ ! -d "$gnulib_path" ]; then
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
690 echo "$0: getting gnulib files..."
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
691
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
692 trap cleanup_gnulib 1 2 13 15
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
693
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
694 shallow=
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
695 if test -z "$GNULIB_REVISION"; then
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
696 git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
697 fi
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
698 git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
699 || cleanup_gnulib
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
700
29666
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
701 trap - 1 2 13 15
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
702
29500
5fad0c81f7db bootstrap: Revert local change removed in hg id 0cf53a415b7f.
Markus Mützel <markus.muetzel@gmx.de>
parents: 29495
diff changeset
703 elif test -n "$GNULIB_REVISION" \
5fad0c81f7db bootstrap: Revert local change removed in hg id 0cf53a415b7f.
Markus Mützel <markus.muetzel@gmx.de>
parents: 29495
diff changeset
704 && ! git --git-dir="$gnulib_path"/.git cat-file \
5fad0c81f7db bootstrap: Revert local change removed in hg id 0cf53a415b7f.
Markus Mützel <markus.muetzel@gmx.de>
parents: 29495
diff changeset
705 commit "$GNULIB_REVISION"; then
5fad0c81f7db bootstrap: Revert local change removed in hg id 0cf53a415b7f.
Markus Mützel <markus.muetzel@gmx.de>
parents: 29495
diff changeset
706 git --git-dir="$gnulib_path"/.git fetch
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
707 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
708 GNULIB_SRCDIR=$gnulib_path
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
709 ;;
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
710 *)
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
711 # Use GNULIB_SRCDIR directly or as a reference.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
712 if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
713 git_modules_config submodule.gnulib.url >/dev/null; then
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
714 echo "$0: getting gnulib files..."
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
715 if git submodule -h|grep -- --reference > /dev/null; then
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
716 # Prefer the one-liner available in git 1.6.4 or newer.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
717 git submodule update --init --reference "$GNULIB_SRCDIR" \
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
718 "$gnulib_path" || exit $?
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
719 else
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
720 # This fallback allows at least git 1.5.5.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
721 if test -f "$gnulib_path"/gnulib-tool; then
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
722 # Since file already exists, assume submodule init already complete.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
723 git submodule update -- "$gnulib_path" || exit $?
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
724 else
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
725 # Older git can't clone into an empty directory.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
726 rmdir "$gnulib_path" 2>/dev/null
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
727 git clone --reference "$GNULIB_SRCDIR" \
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
728 "$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
729 && git submodule init -- "$gnulib_path" \
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
730 && git submodule update -- "$gnulib_path" \
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
731 || exit $?
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
732 fi
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
733 fi
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
734 GNULIB_SRCDIR=$gnulib_path
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
735 fi
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
736 ;;
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
737 esac
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
738
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
739 if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" \
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
740 && ! git_modules_config submodule.gnulib.url >/dev/null; then
29666
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
741 if ! git --git-dir="$GNULIB_SRCDIR"/.git cat-file \
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
742 commit "$GNULIB_REVISION"; then
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
743 git --git-dir="$GNULIB_SRCDIR"/.git fetch
b0024e96ed31 maint: update gnulib
John W. Eaton <jwe@octave.org>
parents: 29500
diff changeset
744 fi
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
745 (cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
746 fi
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
747
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
748 # $GNULIB_SRCDIR now points to the version of gnulib to use, and
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
749 # we no longer need to use git or $gnulib_path below here.
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
750
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
751 if $bootstrap_sync; then
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
752 cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
753 echo "$0: updating bootstrap and restarting..."
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
754 case $(sh -c 'echo "$1"' -- a) in
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
755 a) ignored=--;;
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
756 *) ignored=ignored;;
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
757 esac
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
758 exec sh -c \
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
759 'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
760 $ignored "$GNULIB_SRCDIR/build-aux/bootstrap" \
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
761 "$0" "$@" --no-bootstrap-sync
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
762 }
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
763 fi
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
764
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
765 gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
766 <$gnulib_tool || exit $?
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
767 fi
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9645
diff changeset
768
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
769 # Get translations.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
770
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
771 download_po_files() {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
772 subdir=$1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
773 domain=$2
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
774 echo "$me: getting translations into $subdir for $domain..."
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
775 cmd=$(printf "$po_download_command_format" "$subdir" "$domain")
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
776 eval "$cmd"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
777 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
778
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
779 # Mirror .po files to $po_dir/.reference and copy only the new
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
780 # or modified ones into $po_dir. Also update $po_dir/LINGUAS.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
781 # Note po files that exist locally only are left in $po_dir but will
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
782 # not be included in LINGUAS and hence will not be distributed.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
783 update_po_files() {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
784 # Directory containing primary .po files.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
785 # Overwrite them only when we're sure a .po file is new.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
786 po_dir=$1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
787 domain=$2
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
788
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
789 # Mirror *.po files into this dir.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
790 # Usually contains *.s1 checksum files.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
791 ref_po_dir="$po_dir/.reference"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
792
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
793 test -d $ref_po_dir || mkdir $ref_po_dir || return
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
794 download_po_files $ref_po_dir $domain \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
795 && ls "$ref_po_dir"/*.po 2>/dev/null |
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
796 sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
797
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
798 langs=$(cd $ref_po_dir && echo *.po | sed 's/\.po//g')
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
799 test "$langs" = '*' && langs=x
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
800 for po in $langs; do
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
801 case $po in x) continue;; esac
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
802 new_po="$ref_po_dir/$po.po"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
803 cksum_file="$ref_po_dir/$po.s1"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
804 if ! test -f "$cksum_file" ||
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
805 ! test -f "$po_dir/$po.po" ||
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
806 ! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
807 echo "$me: updated $po_dir/$po.po..."
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
808 cp "$new_po" "$po_dir/$po.po" \
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
809 && $SHA1SUM < "$new_po" > "$cksum_file" || return
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
810 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
811 done
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
812 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
813
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
814 case $SKIP_PO in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
815 '')
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
816 if test -d po; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
817 update_po_files po $package || exit
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
818 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
819
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
820 if test -d runtime-po; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
821 update_po_files runtime-po $package-runtime || exit
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
822 fi;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
823 esac
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
824
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
825 symlink_to_dir()
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
826 {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
827 src=$1/$2
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
828 dst=${3-$2}
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
829
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
830 test -f "$src" && {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
831
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
832 # If the destination directory doesn't exist, create it.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
833 # This is required at least for "lib/uniwidth/cjk.h".
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
834 dst_dir=$(dirname "$dst")
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
835 if ! test -d "$dst_dir"; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
836 mkdir -p "$dst_dir"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
837
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
838 # If we've just created a directory like lib/uniwidth,
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
839 # tell version control system(s) it's ignorable.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
840 # FIXME: for now, this does only one level
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
841 parent=$(dirname "$dst_dir")
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
842 for dot_ig in x $vc_ignore; do
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
843 test $dot_ig = x && continue
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
844 ig=$parent/$dot_ig
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
845 insert_vc_ignore $ig "${dst_dir##*/}"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
846 done
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
847 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
848
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
849 if $copy; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
850 {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
851 test ! -h "$dst" || {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
852 echo "$me: rm -f $dst" &&
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
853 rm -f "$dst"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
854 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
855 } &&
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
856 test -f "$dst" &&
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
857 cmp -s "$src" "$dst" || {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
858 echo "$me: cp -fp $src $dst" &&
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
859 cp -fp "$src" "$dst"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
860 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
861 else
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
862 # Leave any existing symlink alone, if it already points to the source,
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
863 # so that broken build tools that care about symlink times
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
864 # aren't confused into doing unnecessary builds. Conversely, if the
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
865 # existing symlink's timestamp is older than the source, make it afresh,
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
866 # so that broken tools aren't confused into skipping needed builds. See
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
867 # <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00326.html>.
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
868 test -h "$dst" &&
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
869 src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
870 dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
871 test "$src_i" = "$dst_i" &&
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
872 both_ls=$(ls -dt "$src" "$dst") &&
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
873 test "X$both_ls" = "X$dst$nl$src" || {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
874 dot_dots=
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
875 case $src in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
876 /*) ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
877 *)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
878 case /$dst/ in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
879 *//* | */../* | */./* | /*/*/*/*/*/)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
880 die "invalid symlink calculation: $src -> $dst";;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
881 /*/*/*/*/) dot_dots=../../../;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
882 /*/*/*/) dot_dots=../../;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
883 /*/*/) dot_dots=../;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
884 esac;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
885 esac
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
886
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
887 echo "$me: ln -fs $dot_dots$src $dst" &&
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
888 ln -fs "$dot_dots$src" "$dst"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
889 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
890 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
891 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
892 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
893
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
894 version_controlled_file() {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
895 parent=$1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
896 file=$2
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
897 if test -d .git; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
898 git rm -n "$file" > /dev/null 2>&1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
899 elif test -d .svn; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
900 svn log -r HEAD "$file" > /dev/null 2>&1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
901 elif test -d CVS; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
902 grep -F "/${file##*/}/" "$parent/CVS/Entries" 2>/dev/null |
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
903 grep '^/[^/]*/[0-9]' > /dev/null
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
904 else
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
905 warn_ "no version control for $file?"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
906 false
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
907 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
908 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
909
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
910 # NOTE: we have to be careful to run both autopoint and libtoolize
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
911 # before gnulib-tool, since gnulib-tool is likely to provide newer
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
912 # versions of files "installed" by these two programs.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
913 # Then, *after* gnulib-tool (see below), we have to be careful to
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
914 # run autoreconf in such a way that it does not run either of these
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
915 # two just-pre-run programs.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
916
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
917 # Import from gettext.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
918 with_gettext=yes
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
919 grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
920 with_gettext=no
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
921
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
922 if test $with_gettext = yes || test $use_libtool = 1; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
923
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
924 tempbase=.bootstrap$$
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
925 trap "rm -f $tempbase.0 $tempbase.1" 1 2 13 15
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
926
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
927 > $tempbase.0 > $tempbase.1 &&
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
928 find . ! -type d -print | sort > $tempbase.0 || exit
14185
d584f90d2c47 configure: search for gfortran first instead of g77
John W. Eaton <jwe@octave.org>
parents: 12733
diff changeset
929
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
930 if test $with_gettext = yes; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
931 # Released autopoint has the tendency to install macros that have been
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
932 # obsoleted in current gnulib, so run this before gnulib-tool.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
933 echo "$0: $AUTOPOINT --force"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
934 $AUTOPOINT --force || exit
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
935 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
936
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
937 # Autoreconf runs aclocal before libtoolize, which causes spurious
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
938 # warnings if the initial aclocal is confused by the libtoolized
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
939 # (or worse out-of-date) macro directory.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
940 # libtoolize 1.9b added the --install option; but we support back
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
941 # to libtoolize 1.5.22, where the install action was default.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
942 if test $use_libtool = 1; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
943 install=
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
944 case $($LIBTOOLIZE --help) in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
945 *--install*) install=--install ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
946 esac
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
947 echo "running: $LIBTOOLIZE $install --copy"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
948 $LIBTOOLIZE $install --copy
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
949 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
950
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
951 find . ! -type d -print | sort >$tempbase.1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
952 old_IFS=$IFS
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
953 IFS=$nl
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
954 for file in $(comm -13 $tempbase.0 $tempbase.1); do
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
955 IFS=$old_IFS
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
956 parent=${file%/*}
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
957 version_controlled_file "$parent" "$file" || {
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
958 for dot_ig in x $vc_ignore; do
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
959 test $dot_ig = x && continue
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
960 ig=$parent/$dot_ig
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
961 insert_vc_ignore "$ig" "${file##*/}"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
962 done
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
963 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
964 done
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
965 IFS=$old_IFS
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
966
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
967 rm -f $tempbase.0 $tempbase.1
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
968 trap - 1 2 13 15
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
969 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
970
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
971 # Import from gnulib.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
972
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
973 if $use_gnulib; then
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
974 gnulib_tool_options="\
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
975 --no-changelog\
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
976 --aux-dir=$build_aux\
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
977 --doc-base=$doc_base\
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
978 --lib=$gnulib_name\
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
979 --m4-base=$m4_base/\
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
980 --source-base=$source_base/\
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
981 --tests-base=$tests_base\
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
982 --local-dir=$local_gl_dir\
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
983 $gnulib_tool_option_extras\
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
984 "
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
985 if test $use_libtool = 1; then
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
986 case "$gnulib_tool_options " in
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
987 *' --libtool '*) ;;
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
988 *) gnulib_tool_options="$gnulib_tool_options --libtool" ;;
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
989 esac
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
990 fi
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
991 echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
992 $gnulib_tool $gnulib_tool_options --import $gnulib_modules \
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
993 || die "gnulib-tool failed"
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
994
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
995 for file in $gnulib_files; do
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
996 symlink_to_dir "$GNULIB_SRCDIR" $file \
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
997 || die "failed to symlink $file"
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
998 done
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
999 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1000
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1001 bootstrap_post_import_hook \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1002 || die "bootstrap_post_import_hook failed"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1003
28016
626ba7cc1d6c update bootstrap script with changes from gnulib version
John W. Eaton <jwe@octave.org>
parents: 28013
diff changeset
1004 # Don't proceed if there are uninitialized submodules. In particular,
626ba7cc1d6c update bootstrap script with changes from gnulib version
John W. Eaton <jwe@octave.org>
parents: 28013
diff changeset
1005 # the next step will remove dangling links, which might be links into
626ba7cc1d6c update bootstrap script with changes from gnulib version
John W. Eaton <jwe@octave.org>
parents: 28013
diff changeset
1006 # uninitialized submodules.
626ba7cc1d6c update bootstrap script with changes from gnulib version
John W. Eaton <jwe@octave.org>
parents: 28013
diff changeset
1007 #
626ba7cc1d6c update bootstrap script with changes from gnulib version
John W. Eaton <jwe@octave.org>
parents: 28013
diff changeset
1008 # Uninitialized submodules are listed with an initial dash.
626ba7cc1d6c update bootstrap script with changes from gnulib version
John W. Eaton <jwe@octave.org>
parents: 28013
diff changeset
1009 if $use_git && git submodule | grep '^-' >/dev/null; then
626ba7cc1d6c update bootstrap script with changes from gnulib version
John W. Eaton <jwe@octave.org>
parents: 28013
diff changeset
1010 die "some git submodules are not initialized. " \
28550
f00e92f9e85b maint: update gnulib
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 28019
diff changeset
1011 "Run 'git submodule update --init' and bootstrap again."
28016
626ba7cc1d6c update bootstrap script with changes from gnulib version
John W. Eaton <jwe@octave.org>
parents: 28013
diff changeset
1012 fi
626ba7cc1d6c update bootstrap script with changes from gnulib version
John W. Eaton <jwe@octave.org>
parents: 28013
diff changeset
1013
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1014 # Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1015 # gnulib-populated directories. Such .m4 files would cause aclocal to fail.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1016 # The following requires GNU find 4.2.3 or newer. Considering the usual
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1017 # portability constraints of this script, that may seem a very demanding
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1018 # requirement, but it should be ok. Ignore any failure, which is fine,
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1019 # since this is only a convenience to help developers avoid the relatively
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1020 # unusual case in which a symlinked-to .m4 file is git-removed from gnulib
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1021 # between successive runs of this script.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1022 find "$m4_base" "$source_base" \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1023 -depth \( -name '*.m4' -o -name '*.[ch]' \) \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1024 -type l -xtype l -delete > /dev/null 2>&1
14185
d584f90d2c47 configure: search for gfortran first instead of g77
John W. Eaton <jwe@octave.org>
parents: 12733
diff changeset
1025
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
1026 # Invoke autoreconf with --force --install to ensure upgrades of tools
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
1027 # such as ylwrap.
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
1028 AUTORECONFFLAGS="--verbose --install --force -I $m4_base $ACLOCAL_FLAGS"
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
1029
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1030 # Some systems (RHEL 5) are using ancient autotools, for which the
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1031 # --no-recursive option had not been invented. Detect that lack and
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
1032 # omit the option when it's not supported. FIXME in 2017: remove this
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
1033 # hack when RHEL 5 autotools are updated, or when they become irrelevant.
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1034 case $($AUTORECONF --help) in
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
1035 *--no-recursive*) AUTORECONFFLAGS="$AUTORECONFFLAGS --no-recursive";;
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1036 esac
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1037
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1038 # Tell autoreconf not to invoke autopoint or libtoolize; they were run above.
17299
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
1039 echo "running: AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS"
a801d0ab5830 bootstrap: Update from gnulib sources, make portable to OpenBSD (bug #35580)
Mike Miller <mtmiller@ieee.org>
parents: 15920
diff changeset
1040 AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS \
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1041 || die "autoreconf failed"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1042
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1043 # Get some extra files from gnulib, overriding existing files.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1044 for file in $gnulib_extra_files; do
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1045 case $file in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1046 */INSTALL) dst=INSTALL;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1047 build-aux/*) dst=$build_aux/${file#build-aux/};;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1048 *) dst=$file;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1049 esac
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1050 symlink_to_dir "$GNULIB_SRCDIR" $file $dst \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1051 || die "failed to symlink $file"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1052 done
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1053
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1054 if test $with_gettext = yes; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1055 # Create gettext configuration.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1056 echo "$0: Creating po/Makevars from po/Makevars.template ..."
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1057 rm -f po/Makevars
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1058 sed '
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1059 /^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1060 /^COPYRIGHT_HOLDER *=/s/=.*/= '"$COPYRIGHT_HOLDER"'/
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1061 /^MSGID_BUGS_ADDRESS *=/s|=.*|= '"$MSGID_BUGS_ADDRESS"'|
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1062 /^XGETTEXT_OPTIONS *=/{
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1063 s/$/ \\/
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1064 a\
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1065 '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1066 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1067 ' po/Makevars.template >po/Makevars \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1068 || die 'cannot generate po/Makevars'
14185
d584f90d2c47 configure: search for gfortran first instead of g77
John W. Eaton <jwe@octave.org>
parents: 12733
diff changeset
1069
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1070 # If the 'gettext' module is in use, grab the latest Makefile.in.in.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1071 # If only the 'gettext-h' module is in use, assume autopoint already
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1072 # put the correct version of this file into place.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1073 case $gnulib_modules in
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1074 *gettext-h*) ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1075 *gettext*)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1076 cp $GNULIB_SRCDIR/build-aux/po/Makefile.in.in po/Makefile.in.in \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1077 || die "cannot create po/Makefile.in.in"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1078 ;;
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1079 esac
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1080
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1081 if test -d runtime-po; then
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1082 # Similarly for runtime-po/Makevars, but not quite the same.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1083 rm -f runtime-po/Makevars
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1084 sed '
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1085 /^DOMAIN *=.*/s/=.*/= '"$package"'-runtime/
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1086 /^subdir *=.*/s/=.*/= runtime-po/
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1087 /^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1088 /^XGETTEXT_OPTIONS *=/{
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1089 s/$/ \\/
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1090 a\
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1091 '"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+}
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1092 }
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1093 ' po/Makevars.template >runtime-po/Makevars \
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1094 || die 'cannot generate runtime-po/Makevars'
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1095
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1096 # Copy identical files from po to runtime-po.
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1097 (cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1098 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1099 fi
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1100
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1101 bootstrap_epilogue
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1102
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1103 echo "$0: done. Now you can run './configure'."
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1104
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1105 # Local variables:
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
1106 # eval: (add-hook 'before-save-hook 'time-stamp)
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1107 # time-stamp-start: "scriptversion="
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1108 # time-stamp-format: "%:y-%02m-%02d.%02H"
26416
c36321a88d17 * bootstrap: update from gnulib source repository
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
1109 # time-stamp-time-zone: "UTC0"
15920
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1110 # time-stamp-end: "; # UTC"
b91fc9348e2e use hook functions for gnulib's bootrap script instead of our wrapper script
John W. Eaton <jwe@octave.org>
parents: 15414
diff changeset
1111 # End: