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