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