libtool: HACKING file list of files not to edit updated
[libtool.git] / bootstrap.conf
blob85ac3ee197485dcb97736cd1edb33f89ea5b6727
1 # bootstrap.conf (GNU Libtool) version 2014-11-18
3 # Copyright (C) 2010-2019, 2021-2024 Free Software Foundation, Inc.
4 # Written by Gary V. Vaughan, 2010
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.
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.
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.
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.
26 ## -------------------------------- ##
27 ## User overridable command paths. ##
28 ## -------------------------------- ##
30 : "${MAKE=make}"
32 export MAKE
36 ## -------------- ##
37 ## Configuration. ##
38 ## -------------- ##
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
44 # List of programs (and minimum versions) required to bootstrap, maintain
45 # and release Libtool.
46 buildreq="
47         help2man   1.29        https://www.gnu.org/s/help2man
48         make       3.81        https://www.gnu.org/s/make
49         makeinfo   4.8         https://www.gnu.org/s/texinfo
50         xz         4.999.8beta https://tukaani.org/xz
53 # Instructions on how to install packages in $buildreq.
54 buildreq_readme=HACKING
56 # Non-default gnulib directories.
57 local_gl_path=gl:gl-mod/bootstrap
59 # We don't need the whole copy of gnulib.
60 gnulib_clone_since=2019-02-19
62 # Additional gnulib-tool options to use.
63 gnulib_tool_options=$gnulib_tool_options"
64         --avoid=dummy
65         --libtool
66         --macro-prefix=GL
67         --with-tests --tests-base=gnulib-tests
70 # gnulib modules used by this package.
71 gnulib_modules='
72         announce-gen
73         bootstrap
74         do-release-commit-and-tag
75         extract-trace
76         gendocs
77         git-version-gen
78         gitlog-to-changelog
79         gnu-web-doc-update
80         gnupload
81         inline-source
82         maintainer-makefile
83         options-parser
84         readme-release
85         update-copyright
88 gnulib_git_submodules='
89         gl-mod/bootstrap
92 # Extra gnulib files that are not in modules, which override files of
93 # the same name installed by other bootstrap tools.
94 gnulib_non_module_files=$gnulib_non_module_files'
95         doc/COPYINGv2
96         doc/fdl.texi
99 # What ignore files to maintain.
100 vc_ignore=.gitignore
102 # Running the installed 'libtoolize' will trash the local (newer) libtool.m4
103 # among others.  Don't use ':', since autoreconf can't exec it!
104 LIBTOOLIZE=true
106 # List of file droppings from old releases of Libtool.
107 libtool_obsolete_files="
108         acinclude.m4
109         argz.c
110         libltdl/config.h
111         lt__dirent.c
112         lt__strl.c
116 ## ------------------- ##
117 ## Override functions. ##
118 ## ------------------- ##
120 # func_autopoint
121 # --------------
122 # Libtool does not use autopoint.
123 func_autopoint ()
125     $debug_cmd
129 # func_libtoolize
130 # ---------------
131 # Libtoolize is part of Libtool!
132 func_libtoolize ()
134     $debug_cmd
139 ## ---------------------------- ##
140 ## Libtool bootstrap functions. ##
141 ## ---------------------------- ##
143 # libtool_prep
144 # ------------
145 # Libtool bootstrap initialisation after successful option parse and
146 # validation.
147 libtool_prep ()
149     $debug_cmd
151     # initial clean-up of checked out tree
152     find . -depth \( -name autom4te.cache -o -name libtool \) -print \
153       | grep -v '{arch}' \
154       | xargs rm -rf
156     # remove obsolete file droppings from old Libtool versions
157     for file in $libtool_obsolete_files; do
158       rm -f $file
159     done
161 func_add_hook func_prep libtool_prep
164 # libtool_add_libltdl_copying
165 # ---------------------------
166 # Use the canonical COPYING.LESSERv2 from gnulib.
167 libtool_add_libltdl_copying ()
169     $debug_cmd
171     func_gnulib_tool_copy_file doc/COPYING.LESSERv2 libltdl/COPYING.LIB
173 func_add_hook func_gnulib_tool libtool_add_libltdl_copying
176 # libtool_build_prerequisites
177 # ---------------------------
178 # Libtool generates some files that are required before any autotools
179 # can be run successfully.
180 libtool_build_prerequisites ()
182     $debug_cmd
184     $require_build_aux
185     $require_ltdl_dir
186     $require_macro_dir
187     $require_package
188     $require_package_bugreport
189     $require_package_name
190     $require_package_url
191     $require_package_version
193     # Whip up a dirty Makefile:
194     makes='Makefile.am libltdl/ltdl.mk'
195     rm -f Makefile
196     {
197       echo "aux_dir = $build_aux"
198       echo "ltdl_dir = $ltdl_dir"
199       echo "macro_dir = $macro_dir"
201       # The following allow us to tie bootstrap-deps output verbosity
202       # into the bootstrap --verbose option:
203       echo 'AM_V_GEN = $(am__v_GEN_$(V))'
204       echo 'am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))'
205       echo 'am__v_GEN_0 = @echo "  GEN     " $@;'
206       echo 'AM_V_at = $(am__v_at_$(V))'
207       echo 'am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))'
208       echo 'am__v_at_0 = @'
210       $SED '/^if /,/^endif$/d;/^else$/,/^endif$/d;/^include /d' $makes
211     } > Makefile
213     # Building distributed files from configure is bad for automake, so we
214     # generate them here, and have Makefile rules to keep them up to date.
215     func_show_eval "$MAKE bootstrap-deps \
216         AM_DEFAULT_VERBOSITY=0 `$opt_verbose && echo V=1` \
217         PACKAGE='$package' PACKAGE_BUGREPORT='$package_bugreport' \
218         PACKAGE_NAME='$package_name' PACKAGE_URL='$package_url' \
219         SED='$SED' srcdir=. VERSION='$package_version'"
220     status=$?
222     rm -f Makefile
223     test 0 -eq "$status" ||exit $EXIT_FAILURE
225 func_add_hook func_gnulib_tool libtool_build_prerequisites
228 # libtool_autoreconf_libltdl
229 # --------------------------
230 # Libtldl directory needs to be autoreconfed too.
231 libtool_autoreconf_libltdl ()
233     $debug_cmd
235     # Also bootstrap libltdl ready for installation.
236     func_autoreconf libltdl
238 func_add_hook func_reconfigure libtool_autoreconf_libltdl
241 # libtool_readme_release_package_substitutions
242 # --------------------------------------------
243 # Show our own package details instead of generic strings.
244 libtool_readme_release_package_substitutions ()
246     $debug_cmd
248     $require_build_aux
249     $require_package
251     my_readme=README-release
253     test -f "$my_readme" \
254         || func_fatal_error "error: '$my_readme' does not exist"
256     # Perform substitutions to a temporary file
257     $SED -e "\
258         s|\@PACKAGE\@|$package|g
259     " "$my_readme" > "${my_readme}T" \
260         && mv "${my_readme}T" "$my_readme"
262 func_add_hook func_fini libtool_readme_release_package_substitutions
265 # libtool_fudge_timestamps
266 # ------------------------
267 # Autoheader valiantly tries to prevent needless reconfigurations by
268 # not changing the timestamp of config-h.in unless the file contents
269 # are updated.  Unfortunately config-h.in depends on aclocal.m4, which
270 # *is* updated, so running 'libtoolize --ltdl=. && configure && make'
271 # causes autoheader to be called... undesirable for users that do not
272 # have it!  Fudge the timestamp to prevent that.  But only fudge it as
273 # much as configure since configure depends on config-h.in and we don't
274 # want to require autoconf either.
275 libtool_fudge_timestamps ()
277     $debug_cmd
279     (
280     cd libltdl
281     touch -r configure config-h.in
282     )
284 func_add_hook func_fini libtool_fudge_timestamps
287 # libtool_cleanup
288 # ---------------
289 libtool_cleanup ()
291     $debug_cmd
293     # These files can cause an infinite configure loop if left behind.
294     rm -f Makefile libltdl/Makefile libtool vcl.tmp
296 func_add_hook func_fini libtool_cleanup
299 # libtool_check_for_bogus_macros
300 # ------------------------------
301 # Try to catch the case where 'aclocal' pulls installed libtool macro
302 # file contents from another version of libtool into the current package
303 # 'aclocal.m4'.
304 libtool_check_for_bogus_macros ()
306     $debug_cmd
307     $require_build_aux
308     $build_aux/no-bogus-m4-defines || exit 1
310 func_add_hook func_fini libtool_check_for_bogus_macros
313 # libtool_cleanup_empty_dirs
314 # --------------------------
315 # Gnulib leaves behind a few files we don't need.
316 libtool_cleanup_empty_dirs ()
318     $debug_cmd
320     my_gnulib_source=${source_base:-'lib'}
322     if test -d "$my_gnulib_source"; then
323       rm -f "$my_gnulib_source/.gitignore" "$my_gnulib_source/Makefile.am" || exit 1
324       rmdir "$my_gnulib_source" || exit 1
325     fi
327 func_add_hook func_fini libtool_cleanup_empty_dirs
331 ## -------------------- ##
332 ## Resource management. ##
333 ## -------------------- ##
335 # require_ltdl_dir
336 # ----------------
337 # Extract libtool's ltdl directory from configure.ac.
338 require_ltdl_dir=func_require_ltdl_dir
339 func_require_ltdl_dir ()
341     $debug_cmd
343     $require_configure_ac
345     func_extract_trace LT_CONFIG_LTDL_DIR
347     save_ifs=$IFS
348     IFS=:
349     set dummy $func_extract_trace_result
350     IFS=$save_ifs
351     shift
353     ltdl_dir=$1
354     func_check_configuration ltdl_dir \
355         "LT_CONFIG_LTDL_DIR([name of your libltdl directory])"
357     func_verbose "ltdl_dir='$ltdl_dir'"
359     require_ltdl_dir=:
363 # require_package_url
364 # -------------------
365 # Ensure that package_url has a sensible default.
366 require_package_url=libtool_require_package_url
367 libtool_require_package_url ()
369     $debug_cmd
371     $require_configure_ac
373     func_extract_trace AC_INIT
375     save_IFS=$IFS
376     IFS=:
377     set dummy $func_extract_trace_result
378     IFS=$save_IFS
379     shift
381     test -n "$package_url " || package_url=$5
382     test -n "$package_url" || {
383       # How to extract the parameters for 'make bootstrap-deps' from
384       # configure.ac.  This is very specific to the way Libtool's
385       # configure.ac layout.
386       sed_extract_package_url='s|#.*$||; s|^dnl .*$||; s| dnl .*$||;
387         /AC_SUBST([[]*PACKAGE_URL/{
388             s|.*AC_SUBST([[      ]*PACKAGE_URL[]         ]*,[[   ]*|package_url="|
389             s|[])        ]*$|"|
390             p
391         }'
393       # Extract package_url setting from configure.ac.
394       eval `$SED -n "$sed_extract_package_url" < configure.ac`
395     }
397     test -n "$package_url" \
398       || func_fatal_error "unable to determine 'package_url' from '$configure_ac'."
400     func_verbose "package_url='$package_url'"
402     require_package_url=:
406 # Local variables:
407 # mode: shell-script
408 # sh-indentation: 2
409 # eval: (add-hook 'write-file-hooks 'time-stamp)
410 # time-stamp-start: "# bootstrap.conf (GNU Libtool) version "
411 # time-stamp-format: "%:y-%02m-%02d"
412 # time-stamp-end: "$"
413 # End: