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