riscv64: update config.sub and config.guess
[platform/upstream/libtool.git] / bootstrap.conf
1 # bootstrap.conf (GNU Libtool) version 2014-11-18
2 #
3 # Copyright (C) 2010-2015 Free Software Foundation, Inc.
4 # Written by Gary V. Vaughan, 2010
5
6 # This is free software; see the source for copying conditions.  There is NO
7 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8 #
9 # GNU Libtool is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation; either version 2 of
12 # the License, or (at your option) any later version.
13 #
14 # GNU Libtool is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with GNU Libtool; see the file COPYING.  If not, a copy
21 # can be downloaded from  http://www.gnu.org/licenses/gpl.html,
22 # or obtained by writing to the Free Software Foundation, Inc.,
23 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24
25
26 ## -------------------------------- ##
27 ## User overrideable command paths. ##
28 ## -------------------------------- ##
29
30 : "${MAKE=make}"
31
32 export MAKE
33
34
35
36 ## -------------- ##
37 ## Configuration. ##
38 ## -------------- ##
39
40 # File that should exist in the top directory of a checked out hierarchy,
41 # but not in a distribution tarball.
42 checkout_only_file=HACKING
43
44 # List of programs (and minimum versions) required to bootstrap, maintain
45 # and release Libtool.
46 buildreq="
47         help2man   1.29        http://www.gnu.org/s/help2man
48         make       3.81        http://www.gnu.org/s/make
49         makeinfo   4.8         http://www.gnu.org/s/texinfo
50         xz         4.999.8beta http://tukaani.org/xz
51 "
52
53 # Instructions on how to install packages in $buildreq.
54 buildreq_readme=HACKING
55
56 # Non-default gnulib directory options.
57 local_gl_dir=gl
58
59 # Additional gnulib-tool options to use.
60 gnulib_tool_options=$gnulib_tool_options"
61         --avoid=dummy
62         --libtool
63         --macro-prefix=GL
64 "
65
66 # gnulib modules used by this package.
67 gnulib_modules='
68         announce-gen
69         bootstrap
70         do-release-commit-and-tag
71         extract-trace
72         gendocs
73         git-version-gen
74         gitlog-to-changelog
75         gnu-web-doc-update
76         gnupload
77         inline-source
78         maintainer-makefile
79         options-parser
80         readme-release
81         update-copyright
82 '
83
84 # Extra gnulib files that are not in modules, which override files of
85 # the same name installed by other bootstrap tools.
86 gnulib_non_module_files=$gnulib_non_module_files'
87         doc/COPYINGv2
88         doc/fdl.texi
89 '
90
91 # What ignore files to maintain.
92 vc_ignore=.gitignore
93
94 # Running the installed 'libtoolize' will trash the local (newer) libtool.m4
95 # among others.  Don't use ':', since autoreconf can't exec it!
96 LIBTOOLIZE=true
97
98 # List of file droppings from old releases of Libtool.
99 libtool_obsolete_files="
100         acinclude.m4
101         argz.c
102         libltdl/config.h
103         lt__dirent.c
104         lt__strl.c
105 "
106
107
108 ## ------------------- ##
109 ## Override functions. ##
110 ## ------------------- ##
111
112 # func_autopoint
113 # --------------
114 # Libtool does not use autopoint.
115 func_autopoint ()
116 {
117     $debug_cmd
118 }
119
120
121 # func_libtoolize
122 # ---------------
123 # Libtoolize is part of Libtool!
124 func_libtoolize ()
125 {
126     $debug_cmd
127 }
128
129
130
131 ## ---------------------------- ##
132 ## Libtool bootstrap functions. ##
133 ## ---------------------------- ##
134
135 # libtool_prep
136 # ------------
137 # Libtool bootstrap initialisation after successful option parse and
138 # validation.
139 libtool_prep ()
140 {
141     $debug_cmd
142
143     # initial clean-up of checked out tree
144     find . -depth \( -name autom4te.cache -o -name libtool \) -print \
145       | grep -v '{arch}' \
146       | xargs rm -rf
147
148     # remove obsolete file droppings from old Libtool versions
149     for file in $libtool_obsolete_files; do
150       rm -f $file
151     done
152 }
153 func_add_hook func_prep libtool_prep
154
155
156 # libtool_add_libltdl_copying
157 # ---------------------------
158 # Use the canonical COPYING.LESSERv2 from gnulib.
159 libtool_add_libltdl_copying ()
160 {
161     $debug_cmd
162
163     func_gnulib_tool_copy_file doc/COPYING.LESSERv2 libltdl/COPYING.LIB
164 }
165 func_add_hook func_gnulib_tool libtool_add_libltdl_copying
166
167
168 # libtool_build_prerequisites
169 # ---------------------------
170 # Libtool generates some files that are required before any autotools
171 # can be run successfully.
172 libtool_build_prerequisites ()
173 {
174     $debug_cmd
175
176     $require_build_aux
177     $require_ltdl_dir
178     $require_macro_dir
179     $require_package
180     $require_package_bugreport
181     $require_package_name
182     $require_package_url
183     $require_package_version
184
185     # Whip up a dirty Makefile:
186     makes='Makefile.am libltdl/ltdl.mk'
187     rm -f Makefile
188     {
189       echo "aux_dir = $build_aux"
190       echo "ltdl_dir = $ltdl_dir"
191       echo "macro_dir = $macro_dir"
192
193       # The following allow us to tie bootstrap-deps output verbosity
194       # into the bootstrap --verbose option:
195       echo 'AM_V_GEN = $(am__v_GEN_$(V))'
196       echo 'am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))'
197       echo 'am__v_GEN_0 = @echo "  GEN     " $@;'
198       echo 'AM_V_at = $(am__v_at_$(V))'
199       echo 'am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))'
200       echo 'am__v_at_0 = @'
201
202       $SED '/^if /,/^endif$/d;/^else$/,/^endif$/d;/^include /d' $makes
203     } > Makefile
204
205     # Building distributed files from configure is bad for automake, so we
206     # generate them here, and have Makefile rules to keep them up to date.
207     func_show_eval "$MAKE bootstrap-deps \
208         AM_DEFAULT_VERBOSITY=0 `$opt_verbose && echo V=1` \
209         PACKAGE='$package' PACKAGE_BUGREPORT='$package_bugreport' \
210         PACKAGE_NAME='$package_name' PACKAGE_URL='$package_url' \
211         SED='$SED' srcdir=. VERSION='$package_version'"
212     status=$?
213
214     rm -f Makefile
215     test 0 -eq "$status" ||exit $EXIT_FAILURE
216 }
217 func_add_hook func_gnulib_tool libtool_build_prerequisites
218
219
220 # libtool_autoreconf_libltdl
221 # --------------------------
222 # Libtldl directory needs to be autoreconfed too.
223 libtool_autoreconf_libltdl ()
224 {
225     $debug_cmd
226
227     # Also bootstrap libltdl ready for installation.
228     func_autoreconf libltdl
229 }
230 func_add_hook func_reconfigure libtool_autoreconf_libltdl
231
232
233 # libtool_readme_release_package_substitutions
234 # --------------------------------------------
235 # Show our own package details instead of generic strings.
236 libtool_readme_release_package_substitutions ()
237 {
238     $debug_cmd
239
240     $require_build_aux
241     $require_package
242
243     my_readme=README-release
244
245     test -f "$my_readme" \
246         || func_fatal_error "error: '$my_readme' does not exist"
247
248     # Perform substitutions to a temporary file
249     $SED -e "\
250         s|\@PACKAGE\@|$package|g
251     " "$my_readme" > "${my_readme}T" \
252         && mv "${my_readme}T" "$my_readme"
253 }
254 func_add_hook func_fini libtool_readme_release_package_substitutions
255
256
257 # libtool_fudge_timestamps
258 # ------------------------
259 # Autoheader valiantly tries to prevent needless reconfigurations by
260 # not changing the timestamp of config-h.in unless the file contents
261 # are updated.  Unfortunately config-h.in depends on aclocal.m4, which
262 # *is* updated, so running 'libtoolize --ltdl=. && configure && make'
263 # causes autoheader to be called... undesireable for users that do not
264 # have it!  Fudge the timestamp to prevent that:
265 libtool_fudge_timestamps ()
266 {
267     $debug_cmd
268
269     sleep 2 && touch libltdl/config-h.in
270 }
271 func_add_hook func_fini libtool_fudge_timestamps
272
273
274 # libtool_cleanup
275 # ---------------
276 libtool_cleanup ()
277 {
278     $debug_cmd
279
280     # These files can cause an infinite configure loop if left behind.
281     rm -f Makefile libltdl/Makefile libtool vcl.tmp
282 }
283 func_add_hook func_fini libtool_cleanup
284
285
286 # libtool_check_for_bogus_macros
287 # ------------------------------
288 # Try to catch the case where 'aclocal' pulls installed libtool macro
289 # file contents from another version of libtool into the current package
290 # 'aclocal.m4'.
291 libtool_check_for_bogus_macros ()
292 {
293     $debug_cmd
294
295     $opt_dry_run ||
296         for macro in LT_INIT AC_PROG_LIBTOOL AM_PROG_LIBTOOL; do
297           if grep $macro aclocal.m4 libltdl/aclocal.m4; then
298             func_fatal_error "Bogus $macro macro contents in an aclocal.m4 file"
299           else :; fi
300         done
301 }
302 func_add_hook func_fini libtool_check_for_bogus_macros
303
304
305 # libtool_cleanup_empty_dirs
306 # --------------------------
307 # Gnulib leaves behind a few files we don't need.
308 libtool_cleanup_empty_dirs ()
309 {
310     $debug_cmd
311
312     my_gnulib_source=${source_base:-'lib'}
313
314     if test -d "$my_gnulib_source"; then
315       rm -f "$my_gnulib_source/.gitignore" "$my_gnulib_source/Makefile.am" || exit 1
316       rmdir "$my_gnulib_source" || exit 1
317     fi
318 }
319 func_add_hook func_fini libtool_cleanup_empty_dirs
320
321
322
323 ## -------------------- ##
324 ## Resource management. ##
325 ## -------------------- ##
326
327 # require_ltdl_dir
328 # ----------------
329 # Extract libtool's ltdl directory from configure.ac.
330 require_ltdl_dir=func_require_ltdl_dir
331 func_require_ltdl_dir ()
332 {
333     $debug_cmd
334
335     $require_configure_ac
336
337     func_extract_trace LT_CONFIG_LTDL_DIR
338
339     save_ifs=$IFS
340     IFS=:
341     set dummy $func_extract_trace_result
342     IFS=$save_ifs
343     shift
344
345     ltdl_dir=$1
346     func_check_configuration ltdl_dir \
347         "LT_CONFIG_LTDL_DIR([name of your libltdl directory])"
348
349     func_verbose "ltdl_dir='$ltdl_dir'"
350
351     require_ltdl_dir=:
352 }
353
354
355 # require_package_url
356 # -------------------
357 # Ensure that package_url has a sensible default.
358 require_package_url=libtool_require_package_url
359 libtool_require_package_url ()
360 {
361     $debug_cmd
362
363     $require_configure_ac
364
365     func_extract_trace AC_INIT
366
367     save_IFS=$IFS
368     IFS=:
369     set dummy $func_extract_trace_result
370     IFS=$save_IFS
371     shift
372
373     test -n "$package_url " || package_url=$5
374     test -n "$package_url" || {
375       # How to extract the parameters for 'make bootstrap-deps' from
376       # configure.ac.  This is very specific to the way Libtool's
377       # configure.ac layout.
378       sed_extract_package_url='s|#.*$||; s|^dnl .*$||; s| dnl .*$||;
379         /AC_SUBST([[]*PACKAGE_URL/{
380             s|.*AC_SUBST([[      ]*PACKAGE_URL[]         ]*,[[   ]*|package_url="|
381             s|[])        ]*$|"|
382             p
383         }'
384
385       # Extract package_url setting from configure.ac.
386       eval `$SED -n "$sed_extract_package_url" < configure.ac`
387     }
388
389     test -n "$package_url" \
390       || func_fatal_error "unable to determine 'package_url' from '$configure_ac'."
391
392     func_verbose "package_url='$package_url'"
393
394     require_package_url=:
395 }
396
397
398 # Local variables:
399 # mode: shell-script
400 # sh-indentation: 2
401 # eval: (add-hook 'write-file-hooks 'time-stamp)
402 # time-stamp-start: "# bootstrap.conf (GNU Libtool) version "
403 # time-stamp-format: "%:y-%02m-%02d"
404 # time-stamp-end: "$"
405 # End: