1 # Bootstrap configuration.
3 # Copyright (C) 2006-2024 Free Software Foundation, Inc.
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <https://www.gnu.org/licenses/>.
19 # We don't need these modules.
20 avoided_gnulib_modules='
21 --avoid=canonicalize-lgpl
27 # gnulib modules used by this package.
29 $avoided_gnulib_modules
77 do-release-commit-and-tag
282 useless-if-before-free
319 # Other locale categories that need message catalogs.
320 EXTRA_LOCALE_CATEGORIES=LC_TIME
322 # Additional xgettext options to use. Use "\\\newline" to break lines.
323 XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
324 --flag=asnprintf:3:c-format\\\
325 --flag=asprintf:2:c-format\\\
326 --flag=error:3:c-format\\\
327 --flag=error_at_line:5:c-format\\\
328 --flag=vasnprintf:3:c-format\\\
329 --flag=vasprintf:2:c-format\\\
330 --flag=verror:3:c-format\\\
331 --flag=verror_at_line:5:c-format\\\
332 --flag=wrapf:1:c-format\\\
333 --flag=xasprintf:1:c-format\\\
334 --flag=xfprintf:2:c-format\\\
335 --flag=xprintf:1:c-format\\\
339 # Append these, since we use the propername module.
340 see_manual='"This is a proper name. See the gettext manual, section Names."'
341 see_manual=\'"$see_manual"\'
342 XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
343 --keyword=proper_name:1,'"$see_manual"'\\\
344 --keyword=proper_name_lite:1,'"$see_manual"'\\\
347 gnulib_tool_option_extras="--tests-base=gnulib-tests --with-tests --symlink\
348 --makefile-name=gnulib.mk --automake-subdir
351 # Build prerequisites
371 bootstrap_post_import_hook ()
373 # Automake requires that ChangeLog exist.
374 touch ChangeLog || return 1
375 # List of coreutils programs. See heading comments in the invoked
376 # script for more info. Keep this in sync with the rules in
377 (m4f=m4/cu-progs.m4 mkf=src/cu-progs.mk tmp=cu-progs.tmp \
378 && rm -f $m4f $mkf $tmp-1 $tmp-2 \
379 && build-aux/gen-lists-of-programs.sh --autoconf >$tmp-1 \
380 && build-aux/gen-lists-of-programs.sh --automake >$tmp-2 \
381 && chmod a-w $tmp-1 $tmp-2 \
382 && mv -f $tmp-1 $m4f && mv -f $tmp-2 $mkf)
384 # Regenerate src/single-binary.mk
385 (mkf=src/single-binary.mk tmp=single-binary.tmp \
387 && build-aux/gen-single-binary.sh src/local.mk >$tmp \
391 # Copy tests/init.sh from Gnulib.
392 $gnulib_tool --copy-file tests/init.sh
398 # Since this is a "GNU" package, replace this line
399 # if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null \
400 # | grep -v 'libtool:' >/dev/null; then
403 # Why? That pipeline searches all files in $(top_srcdir), and if you
404 # happen to have large files (or apparently large sparse files), the
405 # first grep may well run out of memory.
406 perl -pi -e 's/if LC_ALL=C grep .GNU .PACKAGE.*; then/if true; then/' \
409 # Add dummy 'install-html' target, required for packages using
410 # non-recursive makefiles with older gettext.
411 # See https://debbugs.gnu.org/25690
412 if ! grep -w 'install-html' po/Makefile.in.in ; then
413 printf 'install-%s:;\n' dvi ps pdf html >> po/Makefile.in.in
416 # Install our git hooks, as long as "cp" accepts the --backup option,
417 # so that we can back up any existing files.
418 case $(cp --help) in *--backup*) backup=1;; *) backup=0;; esac
419 if test $backup = 1; then
420 hooks=$(cd scripts/git-hooks && git ls-files)
422 # If it is identical, skip it.
423 cmp scripts/git-hooks/$f .git/hooks/$f > /dev/null \
425 cp --backup=numbered scripts/git-hooks/$f .git/hooks
426 chmod a-w .git/hooks/$f