1# Bootstrap configuration.
2
3# Copyright (C) 2006-2020 Free Software Foundation, Inc.
4
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.
9
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.
14
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/>.
17
18avoided_gnulib_modules='
19  --avoid=lock-tests
20'
21
22# gnulib modules used by this package.
23gnulib_modules='
24acl
25alloca
26stdalign
27binary-io
28btowc
29c-ctype
30closeout
31dfa
32extensions
33fdl
34fwriting
35getdelim
36getopt
37gettext-h
38git-version-gen
39gitlog-to-changelog
40ignore-value
41localcharset
42manywarnings
43mbrlen
44mbrtowc
45mbsinit
46memchr
47memrchr
48mkostemp
49non-recursive-gnulib-prefix-hack
50obstack
51perl
52progname
53readme-release
54regex
55rename
56selinux-h
57ssize_t
58stat-macros
59stdbool
60strerror
61strverscmp
62unlocked-io
63update-copyright
64verify
65version-etc-fsf
66wcrtomb
67wctob
68xalloc
69'
70gnulib_name=libsed
71
72checkout_only_file=
73MSGID_BUGS_ADDRESS=bug-gnu-utils@gnu.org
74
75# Additional xgettext options to use.  Use "\\\newline" to break lines.
76XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
77 --flag=asnprintf:3:c-format\\\
78 --flag=asprintf:2:c-format\\\
79 --flag=error:3:c-format\\\
80 --flag=error_at_line:5:c-format\\\
81 --flag=vasnprintf:3:c-format\\\
82 --flag=vasprintf:2:c-format\\\
83 --flag=wrapf:1:c-format\\\
84 --from-code=UTF-8\\\
85'
86
87gnulib_tool_option_extras="--tests-base=gnulib-tests --with-tests --symlink\
88 --makefile-name=gnulib.mk
89 $avoided_gnulib_modules
90"
91
92# Build prerequisites
93buildreq="\
94autoconf   2.64
95automake   1.11.2
96autopoint  -
97gettext    0.19.2
98git        1.4.4
99gzip       -
100makeinfo   6.1
101perl       5.5
102rsync      -
103tar        -
104"
105
106bootstrap_post_import_hook ()
107{
108  # Automake requires that ChangeLog exist.
109  touch ChangeLog || return 1
110
111  # Massage lib/gnulib.mk before using it later in the bootstrapping process.
112  build-aux/prefix-gnulib-mk --lib-name=$gnulib_name lib/$gnulib_mk
113}
114
115bootstrap_epilogue()
116{
117  perl -pi -e "s/\@PACKAGE\@/$package/g" README-release
118
119  # Since this is a "GNU" package, replace this line
120  #   if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null \
121  #      | grep -v 'libtool:' >/dev/null; then
122  # with this:
123  #   if true; then
124  # Why?  That pipeline searches all files in $(top_srcdir), and if you
125  # happen to have large files (or apparently large sparse files), the
126  # first grep may well run out of memory.
127  perl -pi -e 's/if LC_ALL=C grep .GNU .PACKAGE.*; then/if true; then/' \
128    po/Makefile.in.in
129
130  # Add dummy 'install-html' target, required for packages using
131  # non-recursive makefiles with older gettext.
132  # See https://debbugs.gnu.org/25690
133  if ! grep -w 'install-html' po/Makefile.in.in ; then
134    printf 'install-%s:;\n' dvi ps pdf html >> po/Makefile.in.in
135  fi
136}
137