build: avoid build failures on gcc <= 10, or clang
[coreutils.git] / bootstrap.conf
blob22e8cd0310674d1b9e4e56a6dcacb53547ae367d
1 # Bootstrap configuration.
3 # Copyright (C) 2006-2023 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
22   --avoid=dummy
25 # gnulib modules used by this package.
26 gnulib_modules="
27   $avoided_gnulib_modules
28   acl
29   alignalloc
30   alignasof
31   alloca
32   announce-gen
33   areadlink-with-size
34   areadlinkat-with-size
35   argmatch
36   argv-iter
37   assert
38   assert-h
39   assure
40   attribute
41   autobuild
42   backup-rename
43   backupfile
44   base32
45   base64
46   btowc
47   buffer-lcm
48   byteswap
49   c-strcase
50   canon-host
51   canonicalize
52   chmodat
53   chown
54   chownat
55   cl-strtod
56   cl-strtold
57   closein
58   closeout
59   config-h
60   configmake
61   copy-file-range
62   count-leading-zeros
63   crypto/md5
64   crypto/sha1
65   crypto/sha256
66   crypto/sha512
67   crypto/sm3
68   cycle-check
69   d-ino
70   d-type
71   di-set
72   dirfd
73   dirname
74   do-release-commit-and-tag
75   dtoastr
76   dup2
77   environ
78   error
79   euidaccess
80   exclude
81   exitfail
82   explicit_bzero
83   faccessat
84   fadvise
85   fchdir
86   fchmodat
87   fchownat
88   fclose
89   fcntl
90   fcntl-safer
91   fd-reopen
92   fdatasync
93   fdopen
94   fdutimensat
95   file-has-acl
96   file-type
97   fileblocks
98   filemode
99   filenamecat
100   filevercmp
101   flexmember
102   fnmatch-gnu
103   fopen-safer
104   fprintftime
105   fpurge
106   free-posix
107   freopen
108   freopen-safer
109   fseeko
110   fstatat
111   fsusage
112   fsync
113   ftoastr
114   ftruncate
115   fts
116   full-read
117   full-write
118   gethrxtime
119   getline
120   getloadavg
121   getlogin
122   getndelim2
123   getopt-gnu
124   getpagesize
125   gettext-h
126   gettime
127   gettime-res
128   git-version-gen
129   gitlog-to-changelog
130   gnu-web-doc-update
131   gnumakefile
132   gnupload
133   hard-locale
134   hash
135   hash-triple
136   heap
137   host-os
138   human
139   idcache
140   idx
141   ignore-value
142   inttostr
143   inttypes
144   isapipe
145   isatty
146   isblank
147   largefile
148   lchmod
149   ldtoastr
150   lib-ignore
151   libgmp
152   linebuffer
153   link
154   link-follow
155   linkat
156   long-options
157   lstat
158   maintainer-makefile
159   malloc-gnu
160   manywarnings
161   mbrlen
162   mbrtowc
163   mbschr
164   mbslen
165   mbswidth
166   memcasecmp
167   memchr
168   memcmp2
169   mempcpy
170   memrchr
171   minmax
172   mkancesdirs
173   mkdir
174   mkdir-p
175   mkdirat
176   mkfifo
177   mkfifoat
178   mknod
179   mkostemp
180   mkstemp
181   mktime
182   modechange
183   mountlist
184   mpsort
185   nproc
186   nstrftime
187   nullptr
188   obstack
189   open
190   openat-safer
191   parse-datetime
192   parse-datetime2
193   pathmax
194   perl
195   physmem
196   pipe-posix
197   pipe2
198   posix-shell
199   posixtm
200   posixver
201   priv-set
202   progname
203   propername-lite
204   pthread-cond
205   pthread-mutex
206   pthread-thread
207   pthread_sigmask
208   putenv
209   quote
210   quotearg
211   randint
212   randperm
213   rawmemchr
214   read-file
215   readtokens
216   readtokens0
217   readutmp
218   regex
219   remove
220   renameat
221   renameatu
222   rmdir
223   root-dev-ino
224   safe-read
225   same
226   save-cwd
227   savedir
228   savewd
229   select
230   selinux-at
231   setenv
232   settime
233   sig2str
234   sigaction
235   smack
236   ssize_t
237   stat-macros
238   stat-size
239   stat-time
240   stdbool
241   stdckdint
242   stdlib-safer
243   stpcpy
244   strdup-posix
245   strnlen
246   strnumcmp
247   strsignal
248   strtoimax
249   strtoumax
250   symlinkat
251   sys_ioctl
252   sys_resource
253   sys_stat
254   sys_wait
255   targetdir
256   tempname
257   termios
258   time_rz
259   timer-time
260   timespec
261   tmpdir
262   uname
263   unicodeio
264   unistd-safer
265   unlink-busy
266   unlinkat
267   unlinkdir
268   unlocked-io
269   unsetenv
270   update-copyright
271   useless-if-before-free
272   userspec
273   utimecmp
274   utimens
275   utimensat
276   vasprintf-posix
277   vc-list-files
278   verify
279   verror
280   version-etc-fsf
281   wcwidth
282   winsz-ioctl
283   winsz-termios
284   write-any-file
285   xalignalloc
286   xalloc
287   xbinary-io
288   xdectoint
289   xfts
290   xgetcwd
291   xgetgroups
292   xgethostname
293   xmemcoll
294   xnanosleep
295   xprintf
296   xprintf-posix
297   xreadlink
298   xstrtod
299   xstrtoimax
300   xstrtol
301   xstrtol-error
302   xstrtold
303   xstrtoumax
304   year2038-recommended
305   yesno
308 # Other locale categories that need message catalogs.
309 EXTRA_LOCALE_CATEGORIES=LC_TIME
311 # Additional xgettext options to use.  Use "\\\newline" to break lines.
312 XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
313  --flag=asnprintf:3:c-format\\\
314  --flag=asprintf:2:c-format\\\
315  --flag=error:3:c-format\\\
316  --flag=error_at_line:5:c-format\\\
317  --flag=vasnprintf:3:c-format\\\
318  --flag=vasprintf:2:c-format\\\
319  --flag=verror:3:c-format\\\
320  --flag=verror_at_line:5:c-format\\\
321  --flag=wrapf:1:c-format\\\
322  --flag=xasprintf:1:c-format\\\
323  --flag=xfprintf:2:c-format\\\
324  --flag=xprintf:1:c-format\\\
325  --from-code=UTF-8\\\
328 # Append these, since we use the propername module.
329 see_manual='"This is a proper name. See the gettext manual, section Names."'
330 see_manual=\'"$see_manual"\'
331 XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
332  --keyword=proper_name:1,'"$see_manual"'\\\
333  --keyword=proper_name_lite:1,'"$see_manual"'\\\
336 gnulib_tool_option_extras="--tests-base=gnulib-tests --with-tests --symlink\
337  --makefile-name=gnulib.mk --automake-subdir
340 # Build prerequisites
341 buildreq="\
342 autoconf   2.64
343 automake   1.11.2
344 autopoint  0.19.2
345 bison      -
346 gettext    0.19.2
347 git        1.4.4
348 gperf      -
349 gzip       -
350 m4         -
351 makeinfo   6.1
352 texi2pdf   6.1
353 patch      -
354 perl       5.5
355 tar        -
356 wget       -
357 xz         -
360 bootstrap_post_import_hook ()
362   # Automake requires that ChangeLog exist.
363   touch ChangeLog || return 1
364   # List of coreutils programs.  See heading comments in the invoked
365   # script for more info.  Keep this in sync with the rules in
366   (m4f=m4/cu-progs.m4 mkf=src/cu-progs.mk tmp=cu-progs.tmp \
367     && rm -f $m4f $mkf $tmp-1 $tmp-2 \
368     && build-aux/gen-lists-of-programs.sh --autoconf >$tmp-1 \
369     && build-aux/gen-lists-of-programs.sh --automake >$tmp-2 \
370     && chmod a-w $tmp-1 $tmp-2 \
371     && mv -f $tmp-1 $m4f && mv -f $tmp-2 $mkf)
373   # Regenerate src/single-binary.mk
374   (mkf=src/single-binary.mk tmp=single-binary.tmp \
375     && rm -f $mkf $tmp \
376     && build-aux/gen-single-binary.sh src/local.mk >$tmp \
377     && chmod a-w $tmp \
378     && mv -f $tmp $mkf)
382 bootstrap_epilogue()
384   # Since this is a "GNU" package, replace this line
385   #   if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null \
386   #      | grep -v 'libtool:' >/dev/null; then
387   # with this:
388   #   if true; then
389   # Why?  That pipeline searches all files in $(top_srcdir), and if you
390   # happen to have large files (or apparently large sparse files), the
391   # first grep may well run out of memory.
392   perl -pi -e 's/if LC_ALL=C grep .GNU .PACKAGE.*; then/if true; then/' \
393     po/Makefile.in.in
395   # Add dummy 'install-html' target, required for packages using
396   # non-recursive makefiles with older gettext.
397   # See https://debbugs.gnu.org/25690
398   if ! grep -w 'install-html' po/Makefile.in.in ; then
399     printf 'install-%s:;\n' dvi ps pdf html >> po/Makefile.in.in
400   fi
402   # Install our git hooks, as long as "cp" accepts the --backup option,
403   # so that we can back up any existing files.
404   case $(cp --help) in *--backup*) backup=1;; *) backup=0;; esac
405   if test $backup = 1; then
406     hooks=$(cd scripts/git-hooks && git ls-files)
407     for f in $hooks; do
408       # If it is identical, skip it.
409       cmp scripts/git-hooks/$f .git/hooks/$f > /dev/null \
410         && continue
411       cp --backup=numbered scripts/git-hooks/$f .git/hooks
412       chmod a-w .git/hooks/$f
413     done
414   fi