]> git.ipfire.org Git - thirdparty/glibc.git/blob - Makeconfig
Do not build with -Winline
[thirdparty/glibc.git] / Makeconfig
1 # Copyright (C) 1991-2015 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
3
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
13
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <http://www.gnu.org/licenses/>.
17
18 #
19 # Makefile configuration options for the GNU C library.
20 #
21 ifneq (,)
22 This makefile requires GNU Make.
23 endif
24
25 all: # Make this the default goal
26
27 ifneq "$(origin +included-Makeconfig)" "file"
28
29 +included-Makeconfig := yes
30
31 ifdef subdir
32 .. := ../
33 endif
34
35 # $(common-objdir) is the place to put objects and
36 # such that are not specific to a single subdir.
37 ifdef objdir
38 objpfx := $(patsubst %//,%/,$(objdir)/$(subdir)/)
39 common-objpfx = $(objdir)/
40 common-objdir = $(objdir)
41 else
42 objdir must be defined by the build-directory Makefile.
43 endif
44
45 # Root of the sysdeps tree.
46 sysdep_dir := $(..)sysdeps
47 export sysdep_dir := $(sysdep_dir)
48
49 # Get the values defined by options to `configure'.
50 include $(common-objpfx)config.make
51
52 # What flags to give to sources which call user provided callbacks
53 uses-callbacks = $(exceptions)
54
55 # What flags to give to tests which test stack alignment
56 stack-align-test-flags =
57
58 # Complete path to sysdep dirs.
59 # `configure' writes a definition of `config-sysdirs' in `config.make'.
60 sysdirs := $(foreach D,$(config-sysdirs),$(firstword $(filter /%,$D) $(..)$D))
61
62 # Add-ons that contribute sysdeps trees get added to the include list
63 # after sysdeps/generic. This makes #include <sysdeps/...> work right
64 # to find specific add-on files without assuming the add-on directory name.
65 # It also means that headers can go into an add-on's base directory
66 # instead of the add-on needing a sysdeps/generic of its own.
67 sysdeps-srcdirs := $(foreach add-on,$(sysdeps-add-ons),\
68 $(firstword $(filter /%,$(add-on)) \
69 $(..)$(add-on)))
70 +sysdep_dirs = $(sysdirs) $(sysdeps-srcdirs)
71 ifdef objdir
72 +sysdep_dirs := $(objdir) $(+sysdep_dirs)
73 endif
74
75 # Run config.status to update config.make and config.h. We don't show the
76 # dependence of config.h to Make, because it is only touched when it
77 # changes and so config.status would be run every time; the dependence of
78 # config.make should suffice to force regeneration and re-exec, and the new
79 # image will notice if config.h changed.
80 $(common-objpfx)config.make: $(common-objpfx)config.status \
81 $(..)config.make.in $(..)config.h.in
82 cd $(<D); $(SHELL) $(<F)
83
84 # Find all the add-on and sysdeps configure fragments, to make sure we
85 # re-run configure when any of them changes.
86 $(common-objpfx)config.status: $(..)version.h $(..)configure \
87 $(foreach dir,$(sysdirs),\
88 $(wildcard $(dir)/Implies) \
89 $(patsubst %.ac,%,\
90 $(firstword $(wildcard \
91 $(addprefix $(dir)/,configure configure.ac))))) \
92 $(patsubst %.ac,%,\
93 $(wildcard $(..)sysdeps/*/preconfigure $(..)sysdeps/*/preconfigure.ac)) \
94 $(patsubst %.ac,%,\
95 $(foreach add-on,$(add-ons),\
96 $(firstword $(wildcard \
97 $(addprefix $(firstword $(filter /%,$(add-on)) $(..)$(add-on))/,\
98 configure configure.ac))) \
99 $(wildcard $(addprefix $(firstword $(filter /%,$(add-on)) $(..)$(add-on))/,\
100 sysdeps/*/preconfigure sysdeps/*/preconfigure.ac))))
101 @cd $(@D); if test -f $(@F); then exec $(SHELL) $(@F) --recheck; else \
102 echo The GNU C library has not been configured. >&2; \
103 echo Run \`configure\' to configure it before building. >&2; \
104 echo Try \`configure --help\' for more details. >&2; \
105 exit 1; fi
106
107 # We don't want CPPFLAGS to be exported to the command running configure.
108 unexport CPPFLAGS
109
110 # Get the user's configuration parameters.
111 ifneq ($(wildcard $(..)configparms),)
112 include $(..)configparms
113 endif
114 ifneq ($(objpfx),)
115 ifneq ($(wildcard $(common-objpfx)configparms),)
116 include $(common-objpfx)configparms
117 endif
118 endif
119 \f
120 ####
121 #### These are the configuration variables. You can define values for
122 #### the variables below in the file `configparms'.
123 #### Do NOT edit this file.
124 ####
125
126
127 # Common prefix for machine-independent installation directories.
128 ifeq ($(origin prefix),undefined) # ifndef would override explicit empty value.
129 prefix = /usr/local
130 endif
131
132 # Decide whether we shall build the programs or not. We always do this
133 # unless the user tells us (in configparms) or we are building for a
134 # standalone target.
135 ifndef build-programs
136 ifneq ($(config-os),none)
137 build-programs=yes
138 else
139 build-programs=no
140 endif
141 endif
142
143 # Common prefix for machine-dependent installation directories.
144 ifeq ($(origin exec_prefix),undefined)
145 exec_prefix = $(prefix)
146 endif
147
148 # Where to install the library and object files.
149 ifndef libdir
150 libdir = $(exec_prefix)/lib
151 endif
152 inst_libdir = $(install_root)$(libdir)
153
154 # Where to install the shared library.
155 ifndef slibdir
156 slibdir = $(exec_prefix)/lib
157 endif
158 inst_slibdir = $(install_root)$(slibdir)
159
160 # Where to install the dynamic linker.
161 ifndef rtlddir
162 rtlddir = $(slibdir)
163 endif
164 inst_rtlddir = $(install_root)$(rtlddir)
165
166 # Prefix to put on files installed in $(libdir). For libraries `libNAME.a',
167 # the prefix is spliced between `lib' and the name, so the linker switch
168 # `-l$(libprefix)NAME' finds the library; for other files the prefix is
169 # just prepended to the whole file name.
170 ifeq ($(origin libprefix),undefined)
171 libprefix =
172 endif
173
174 # Where to install the header files.
175 ifndef includedir
176 includedir = $(prefix)/include
177 endif
178 inst_includedir = $(install_root)$(includedir)
179
180 # Where to install machine-independent data files.
181 # These are the timezone database, and the locale database.
182 ifndef datadir
183 datadir = $(prefix)/share
184 endif
185 inst_datadir = $(install_root)$(datadir)
186
187 # Where to install the timezone data files (which are machine-independent).
188 ifndef zonedir
189 zonedir = $(datadir)/zoneinfo
190 endif
191 inst_zonedir = $(install_root)$(zonedir)
192
193 # Where to install the locale files.
194 ifndef localedir
195 localedir = $(libdir)/locale
196 endif
197 inst_localedir = $(install_root)$(localedir)
198
199 # Where to install the message catalog data files (which are
200 # machine-independent).
201 ifndef msgcatdir
202 msgcatdir = $(datadir)/locale
203 endif
204 inst_msgcatdir = $(install_root)$(msgcatdir)
205
206 # Where to install the locale charmap source files.
207 ifndef i18ndir
208 i18ndir = $(datadir)/i18n
209 endif
210 inst_i18ndir = $(install_root)$(i18ndir)
211
212 # Where to install the shared object for charset transformation.
213 ifndef gconvdir
214 gconvdir = $(libdir)/gconv
215 endif
216 inst_gconvdir = $(install_root)$(gconvdir)
217
218 # Where to install programs.
219 ifndef bindir
220 bindir = $(exec_prefix)/bin
221 endif
222 inst_bindir = $(install_root)$(bindir)
223
224 # Where to install internal programs.
225 ifndef libexecdir
226 libexecdir = $(exec_prefix)/libexec
227 endif
228 inst_libexecdir = $(install_root)$(libexecdir)
229
230 # Where to install administrative programs.
231 ifndef rootsbindir
232 rootsbindir = $(exec_prefix)/sbin
233 endif
234 inst_rootsbindir = $(install_root)$(rootsbindir)
235
236 ifndef sbindir
237 sbindir = $(exec_prefix)/sbin
238 endif
239 inst_sbindir = $(install_root)$(sbindir)
240
241 # Where to install the Info files.
242 ifndef infodir
243 infodir = $(prefix)/info
244 endif
245 inst_infodir = $(install_root)$(infodir)
246
247 # Where to install audit libraries.
248 ifndef auditdir
249 auditdir = $(libdir)/audit
250 endif
251 inst_auditdir = $(install_root)$(auditdir)
252
253 # Where to install default configuration files. These include the local
254 # timezone specification and network data base files.
255 ifndef sysconfdir
256 sysconfdir = $(prefix)/etc
257 endif
258 inst_sysconfdir = $(install_root)$(sysconfdir)
259
260 # Directory for the database files and Makefile for nss_db.
261 ifndef vardbdir
262 vardbdir = $(localstatedir)/db
263 endif
264 inst_vardbdir = $(install_root)$(vardbdir)
265
266 # Where to install the "localtime" timezone file; this is the file whose
267 # contents $(localtime) specifies. If this is a relative pathname, it is
268 # relative to $(zonedir). It is a good idea to put this somewhere
269 # other than there, so the zoneinfo directory contains only universal data,
270 # localizing the configuration data elsewhere.
271 ifndef localtime-file
272 localtime-file = $(sysconfdir)/localtime
273 endif
274
275 # What to use for leap second specifications in compiling the default
276 # timezone files. Set this to `/dev/null' for no leap second handling as
277 # 1003.1 requires, or to `leapseconds' for proper leap second handling.
278 # Both zone flavors are always available as `posix/ZONE' and `right/ZONE'.
279 # This variable determines the default: if it's `/dev/null',
280 # ZONE==posix/ZONE; if it's `leapseconds', ZONE==right/ZONE.
281 ifndef leapseconds
282 leapseconds = /dev/null
283 endif
284
285 # What timezone's DST rules should be used when a POSIX-style TZ
286 # environment variable doesn't specify any rules. For 1003.1 compliance
287 # this timezone must use rules that are as U.S. federal law defines DST.
288 # Run `make -C time echo-zonenames' to see a list of available zone names.
289 # This setting can be changed with `zic -p TIMEZONE' at any time.
290 # If you want POSIX.1 compatibility, use `America/New_York'.
291 ifndef posixrules
292 posixrules = America/New_York
293 endif
294
295 # Where to install the "posixrules" timezone file; this is file
296 # whose contents $(posixrules) specifies. If this is a relative
297 # pathname, it is relative to $(zonedir).
298 ifndef posixrules-file
299 posixrules-file = posixrules
300 endif
301
302
303 # Directory where your system's native header files live.
304 # This is used on Unix systems to generate some GNU libc header files.
305 ifndef sysincludedir
306 sysincludedir = /usr/include
307 endif
308
309
310 # Commands to install files.
311 ifndef INSTALL_DATA
312 INSTALL_DATA = $(INSTALL) -m 644
313 endif
314 ifndef INSTALL_SCRIPT
315 INSTALL_SCRIPT = $(INSTALL)
316 endif
317 ifndef INSTALL_PROGRAM
318 INSTALL_PROGRAM = $(INSTALL)
319 endif
320 ifndef INSTALL
321 INSTALL = install
322 endif
323
324
325 # The name of the C compiler.
326 # If you've got GCC, and it works, use it.
327 ifeq ($(origin CC),default)
328 CC := gcc
329 endif
330
331 # The name of the C compiler to use for compilations of programs to run on
332 # the host that is building the library. If you set CC to a
333 # cross-compiler, you must set this to the normal compiler.
334 ifndef BUILD_CC
335 BUILD_CC = $(CC)
336 endif
337
338 # Default flags to pass the C compiler.
339 ifndef default_cflags
340 ifeq ($(release),stable)
341 default_cflags := -g -O2
342 else
343 default_cflags := -g -O
344 endif
345 endif
346
347 # Flags to pass the C compiler when assembling preprocessed assembly code
348 # (`.S' files). On some systems the assembler doesn't understand the `#' line
349 # directives the preprocessor produces. If you have troubling compiling
350 # assembly code, try using -P here to suppress these directives.
351 ifndef asm-CPPFLAGS
352 asm-CPPFLAGS =
353 endif
354
355 as-needed := -Wl,--as-needed
356 no-as-needed := -Wl,--no-as-needed
357
358 # Must be supported by the linker.
359 no-whole-archive = -Wl,--no-whole-archive
360 whole-archive = -Wl,--whole-archive
361
362 # Installed name of the startup code.
363 # The ELF convention is that the startfile is called crt1.o
364 start-installed-name = crt1.o
365 # On systems that do not need a special startfile for statically linked
366 # binaries, simply set it to the normal name.
367 ifndef static-start-installed-name
368 static-start-installed-name = $(start-installed-name)
369 endif
370
371 ifeq (yesyes,$(build-shared)$(have-z-combreloc))
372 combreloc-LDFLAGS = -Wl,-z,combreloc
373 LDFLAGS.so += $(combreloc-LDFLAGS)
374 LDFLAGS-rtld += $(combreloc-LDFLAGS)
375 endif
376
377 relro-LDFLAGS = -Wl,-z,relro
378 LDFLAGS.so += $(relro-LDFLAGS)
379 LDFLAGS-rtld += $(relro-LDFLAGS)
380
381 ifeq (yes,$(have-hash-style))
382 # For the time being we unconditionally use 'both'. At some time we
383 # should declare statically linked code as 'out of luck' and compile
384 # with --hash-style=gnu only.
385 hashstyle-LDFLAGS = -Wl,--hash-style=both
386 LDFLAGS.so += $(hashstyle-LDFLAGS)
387 LDFLAGS-rtld += $(hashstyle-LDFLAGS)
388 endif
389
390 # Command to run after every final link (executable or shared object).
391 # This is invoked with $(call after-link,...), so it should operate on
392 # the file $1. This can be set to do some sort of post-processing on
393 # binaries, or to perform some sort of static sanity check.
394 ifndef after-link
395 after-link =
396 endif
397
398 # Command for linking PIE programs with the C library.
399 ifndef +link-pie
400 +link-pie-before-libc = $(CC) -pie -Wl,-O1 -nostdlib -nostartfiles -o $@ \
401 $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
402 $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
403 $(addprefix $(csu-objpfx),S$(start-installed-name)) \
404 $(+preinit) $(+prectorS) \
405 $(filter-out $(addprefix $(csu-objpfx),start.o \
406 S$(start-installed-name))\
407 $(+preinit) $(link-extra-libs) \
408 $(common-objpfx)libc% $(+postinit),$^) \
409 $(link-extra-libs)
410 +link-pie-after-libc = $(+postctorS) $(+postinit)
411 define +link-pie
412 $(+link-pie-before-libc) $(rtld-LDFLAGS) $(link-libc) $(+link-pie-after-libc)
413 $(call after-link,$@)
414 endef
415 define +link-pie-tests
416 $(+link-pie-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \
417 $(+link-pie-after-libc)
418 $(call after-link,$@)
419 endef
420 endif
421 # Command for statically linking programs with the C library.
422 ifndef +link-static
423 +link-static-before-libc = $(CC) -nostdlib -nostartfiles -static -o $@ \
424 $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
425 $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
426 $(+preinit) $(+prectorT) \
427 $(filter-out $(addprefix $(csu-objpfx),start.o \
428 $(start-installed-name))\
429 $(+preinit) $(link-extra-libs-static) \
430 $(common-objpfx)libc% $(+postinit),$^) \
431 $(link-extra-libs-static)
432 +link-static-after-libc = $(+postctorT) $(+postinit)
433 define +link-static
434 $(+link-static-before-libc) $(link-libc-static) $(+link-static-after-libc)
435 $(call after-link,$@)
436 endef
437 define +link-static-tests
438 $(+link-static-before-libc) $(link-libc-static-tests) $(+link-static-after-libc)
439 $(call after-link,$@)
440 endef
441 endif
442 # Commands for linking programs with the C library.
443 ifndef +link
444 ifeq (yes,$(build-shared))
445 +link-before-libc = $(CC) -nostdlib -nostartfiles -o $@ \
446 $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
447 $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
448 $(addprefix $(csu-objpfx),$(start-installed-name)) \
449 $(+preinit) $(+prector) \
450 $(filter-out $(addprefix $(csu-objpfx),start.o \
451 $(start-installed-name))\
452 $(+preinit) $(link-extra-libs) \
453 $(common-objpfx)libc% $(+postinit),$^) \
454 $(link-extra-libs)
455 +link-after-libc = $(+postctor) $(+postinit)
456 define +link
457 $(+link-before-libc) $(rtld-LDFLAGS) $(link-libc) $(+link-after-libc)
458 $(call after-link,$@)
459 endef
460 define +link-tests
461 $(+link-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \
462 $(+link-after-libc)
463 $(call after-link,$@)
464 endef
465 else
466 +link = $(+link-static)
467 +link-tests = $(+link-static-tests)
468 endif
469 endif
470 ifeq (yes,$(build-shared))
471 ifndef rtld-LDFLAGS
472 rtld-LDFLAGS = -Wl,-dynamic-linker=$(rtlddir)/$(rtld-installed-name)
473 endif
474 ifndef rtld-tests-LDFLAGS
475 ifeq (yes,$(build-hardcoded-path-in-tests))
476 rtld-tests-LDFLAGS = -Wl,-dynamic-linker=$(elf-objpfx)ld.so
477 else
478 rtld-tests-LDFLAGS = $(rtld-LDFLAGS)
479 endif
480 endif
481 endif
482 ifndef link-libc
483 ifeq (yes,$(build-shared))
484 # We need the versioned name of libc.so in the deps of $(others) et al
485 # so that the symlink to libc.so is created before anything tries to
486 # run the linked programs.
487 link-libc-rpath-link = -Wl,-rpath-link=$(rpath-link)
488 ifeq (yes,$(build-hardcoded-path-in-tests))
489 link-libc-tests-rpath-link = -Wl,-rpath=$(rpath-link)
490 else
491 link-libc-tests-rpath-link = $(link-libc-rpath-link)
492 endif
493 link-libc-before-gnulib = $(common-objpfx)libc.so$(libc.so-version) \
494 $(common-objpfx)$(patsubst %,$(libtype.oS),c) \
495 $(as-needed) $(elf-objpfx)ld.so \
496 $(no-as-needed)
497 link-libc = $(link-libc-rpath-link) $(link-libc-before-gnulib) $(gnulib)
498 link-libc-tests = $(link-libc-tests-rpath-link) \
499 $(link-libc-before-gnulib) $(gnulib-tests)
500 # This is how to find at build-time things that will be installed there.
501 rpath-dirs = math elf dlfcn nss nis rt resolv crypt
502 rpath-link = \
503 $(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%)))
504 else
505 link-libc = $(common-objpfx)libc.a $(otherlibs) $(gnulib) $(common-objpfx)libc.a $(gnulib)
506 link-libc-tests = $(common-objpfx)libc.a $(otherlibs) $(gnulib-tests) $(common-objpfx)libc.a $(gnulib-tests)
507 endif
508 endif
509
510 # Differences in the linkers on the various platforms.
511 LDFLAGS-rpath-ORIGIN = -Wl,-rpath,'$$ORIGIN'
512 LDFLAGS-soname-fname = -Wl,-soname,$(@F)
513 LDFLAGS-rdynamic = -rdynamic
514 LDFLAGS-Bsymbolic = -Bsymbolic
515
516 # Choose the default search path for the dynamic linker based on
517 # where we will install libraries.
518 ifneq ($(libdir),$(slibdir))
519 default-rpath = $(slibdir):$(libdir)
520 else
521 default-rpath = $(libdir)
522 endif
523
524 ifndef link-extra-libs
525 link-extra-libs = $(LDLIBS-$(@F))
526 link-extra-libs-static = $(link-extra-libs)
527 endif
528
529 # The static libraries.
530 link-libc-static = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib) -Wl,--end-group
531 link-libc-static-tests = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib-tests) -Wl,--end-group
532
533 # How to link against libgcc. Some libgcc functions, such as those
534 # for "long long" arithmetic or software floating point, can always be
535 # built without use of C library headers and do not have any global
536 # state so can safely be linked statically into any executable or
537 # shared library requiring them; these functions are in libgcc.a.
538 # Other functions, relating to exception handling, may require C
539 # library headers to build and it may not be safe to have more than
540 # one copy of them in a process; these functions are only in
541 # libgcc_s.so and libgcc_eh.a.
542 #
543 # To avoid circular dependencies when bootstrapping, it is desirable
544 # to avoid use of libgcc_s and libgcc_eh in building glibc. Where any
545 # glibc functionality (in particular, thread cancellation) requires
546 # exception handling, this is implemented through dlopen of libgcc_s
547 # to avoid unnecessary dependencies on libgcc_s by programs not using
548 # that functionality; executables built with glibc do not use
549 # exception handling other than through thread cancellation.
550 #
551 # Undefined references to functions from libgcc_eh or libgcc_s may
552 # arise for code built with -fexceptions. In the case of statically
553 # linked programs installed by glibc, unwinding will never actually
554 # occur at runtime and the use of elf/static-stubs.c to resolve these
555 # references is safe. In the case of statically linked test programs
556 # and test programs built with -fexceptions, unwinding may occur in
557 # some cases and it is preferable to link with libgcc_eh or libgcc_s
558 # so that the testing is as similar as possible to how programs will
559 # be built with the installed glibc.
560 #
561 # Some architectures have architecture-specific systems for exception
562 # handling that may involve undefined references to
563 # architecture-specific functions. On those architectures,
564 # gnulib-arch and static-gnulib-arch may be defined in sysdeps
565 # makefiles to use additional libraries for linking executables and
566 # shared libraries built by glibc.
567 ifndef gnulib
568 ifneq ($(have-cc-with-libunwind),yes)
569 libunwind =
570 else
571 libunwind = -lunwind
572 endif
573 libgcc_eh := -Wl,--as-needed -lgcc_s $(libunwind) -Wl,--no-as-needed
574 gnulib-arch =
575 gnulib = -lgcc $(gnulib-arch)
576 gnulib-tests := -lgcc $(libgcc_eh)
577 static-gnulib-arch =
578 # By default, elf/static-stubs.o, instead of -lgcc_eh, is used to
579 # statically link programs. When --disable-shared is used, we use
580 # -lgcc_eh since elf/static-stubs.o isn't sufficient.
581 ifeq (yes,$(build-shared))
582 static-gnulib = -lgcc $(static-gnulib-arch)
583 else
584 static-gnulib = -lgcc -lgcc_eh $(static-gnulib-arch)
585 endif
586 static-gnulib-tests := -lgcc -lgcc_eh $(libunwind)
587 libc.so-gnulib := -lgcc
588 endif
589 +preinit = $(addprefix $(csu-objpfx),crti.o)
590 +postinit = $(addprefix $(csu-objpfx),crtn.o)
591 +prector = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbegin.o`
592 +postctor = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
593 # Variants of the two previous definitions for linking PIE programs.
594 +prectorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginS.o`
595 +postctorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtendS.o`
596 # Variants of the two previous definitions for statically linking programs.
597 +prectorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginT.o`
598 +postctorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
599 +interp = $(addprefix $(elf-objpfx),interp.os)
600 csu-objpfx = $(common-objpfx)csu/
601 elf-objpfx = $(common-objpfx)elf/
602
603 # A command that, prepended to the name and arguments of a program,
604 # and run on the build system, causes that program with those
605 # arguments to be run on the host for which the library is built.
606 ifndef test-wrapper
607 test-wrapper =
608 endif
609 # Likewise, but the name of the program is preceded by
610 # <variable>=<value> assignments for environment variables.
611 ifndef test-wrapper-env
612 test-wrapper-env = $(test-wrapper) env
613 endif
614 # Likewise, but the program's environment will be empty except for any
615 # explicit <variable>=<value> assignments preceding the program name.
616 ifndef test-wrapper-env-only
617 test-wrapper-env-only = $(test-wrapper) env -i
618 endif
619
620 # Whether to run test programs built for the library's host system.
621 ifndef run-built-tests
622 ifeq (yes|,$(cross-compiling)|$(test-wrapper))
623 run-built-tests = no
624 else
625 run-built-tests = yes
626 endif
627 endif
628
629 # Whether to stop immediately when a test fails. Nonempty means to
630 # stop, empty means not to stop.
631 ifndef stop-on-test-failure
632 stop-on-test-failure =
633 endif
634
635 # How to run a program we just linked with our library.
636 # The program binary is assumed to be $(word 2,$^).
637 built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^))
638 rtld-prefix = $(elf-objpfx)$(rtld-installed-name) \
639 --library-path \
640 $(rpath-link)$(patsubst %,:%,$(sysdep-library-path))
641 ifeq (yes,$(build-shared))
642 comma = ,
643 sysdep-library-path = \
644 $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
645 $(filter -Wl$(comma)-rpath-link=%,\
646 $(sysdep-LDFLAGS)))))
647 # $(run-via-rtld-prefix) is a command that, when prepended to the name
648 # of a program built with the newly built library, produces a command
649 # that, executed on the host for which the library is built, runs that
650 # program. For tests listed in tests-static or xtests-static, it is
651 # empty.
652 run-via-rtld-prefix = \
653 $(if $(strip $(filter $(notdir $(built-program-file)), \
654 $(tests-static) $(xtests-static))),, $(rtld-prefix))
655 else
656 run-via-rtld-prefix =
657 endif
658 # $(run-program-env) is the default environment variable settings to
659 # use when running a program built with the newly built library.
660 run-program-env = GCONV_PATH=$(common-objpfx)iconvdata \
661 LOCPATH=$(common-objpfx)localedata LC_ALL=C
662 # $(run-program-prefix) is a command that, when prepended to the name
663 # of a program built with the newly built library, produces a command
664 # that, executed on the build system on which "make" is run, runs that
665 # program. $(run-program-prefix-before-env) and
666 # $(run-program-prefix-after-env) are similar, but separate parts
667 # before and after a list of environment variables.
668 run-program-prefix-before-env = $(test-wrapper-env)
669 run-program-prefix-after-env = $(run-via-rtld-prefix)
670 run-program-prefix = $(run-program-prefix-before-env) $(run-program-env) \
671 $(run-program-prefix-after-env)
672 # $(built-program-cmd) is a command that, executed on the build system
673 # on which "make" is run, runs the newly built program that is the
674 # second dependency of the makefile target in which
675 # $(built-program-cmd) is used. $(built-program-cmd-before-env) and
676 # $(built-program-cmd-after-env) are similar, before and after a list
677 # of environment variables.
678 built-program-cmd-before-env = $(test-wrapper-env)
679 built-program-cmd-after-env = $(run-via-rtld-prefix) $(built-program-file)
680 built-program-cmd = $(built-program-cmd-before-env) $(run-program-env) \
681 $(built-program-cmd-after-env)
682 # $(host-built-program-cmd) is a command that, executed on the host
683 # for which the library is built, runs the newly built program that is
684 # the second dependency of the makefile target in which
685 # $(host-built-program-cmd) is used.
686 host-built-program-cmd = $(run-via-rtld-prefix) $(built-program-file)
687
688 ifndef LD
689 LD := ld -X
690 endif
691
692 # $(test-via-rtld-prefix) is a command that, when prepended to the name
693 # of a test program built with the newly built library, produces a command
694 # that, executed on the host for which the library is built, runs that
695 # program. For tests listed in tests-static or xtests-static as well
696 # as when test programs are hardcoded to the newly built libraries, it
697 # is empty.
698
699 # $(test-program-prefix) is a command that, when prepended to the name
700 # of a test program built with the newly built library, produces a command
701 # that, executed on the build system on which "make" is run, runs that
702 # test program. $(test-program-prefix-before-env) and
703 # $(test-program-prefix-after-env) are similar, before and after a
704 # list of environment variables.
705
706 # $(test-program-cmd) is a command that, executed on the build system
707 # on which "make" is run, runs the newly built test program that is the
708 # second dependency of the makefile target in which
709 # $(test-program-cmd) is used. $(test-program-cmd-before-env) and
710 # $(test-program-cmd-after-env) are similar, before and after a list
711 # of environment variables.
712
713 # $(host-test-program-cmd) is a command that, executed on the host
714 # for which the library is built, runs the newly built test program that
715 # is the second dependency of the makefile target in which
716 # $(host-test-program-cmd) is used.
717
718 ifeq (yes,$(build-hardcoded-path-in-tests))
719 test-via-rtld-prefix =
720 test-program-prefix-before-env = $(test-wrapper-env)
721 test-program-prefix-after-env =
722 test-program-prefix = $(test-program-prefix-before-env) $(run-program-env) \
723 $(test-program-prefix-after-env)
724 test-program-cmd-before-env = $(test-wrapper-env)
725 test-program-cmd-after-env = $(built-program-file)
726 test-program-cmd = $(test-program-cmd-before-env) $(run-program-env) \
727 $(test-program-cmd-after-env)
728 host-test-program-cmd = $(built-program-file)
729 else
730 test-via-rtld-prefix = $(run-via-rtld-prefix)
731 test-program-prefix-before-env = $(run-program-prefix-before-env)
732 test-program-prefix-after-env = $(run-program-prefix-after-env)
733 test-program-prefix = $(run-program-prefix)
734 test-program-cmd-before-env = $(built-program-cmd-before-env)
735 test-program-cmd-after-env = $(built-program-cmd-after-env)
736 test-program-cmd = $(built-program-cmd)
737 host-test-program-cmd = $(host-built-program-cmd)
738 endif
739
740 # Extra flags to pass to GCC.
741 ifeq ($(all-warnings),yes)
742 +gccwarn := -Wall -Wwrite-strings -Wcast-qual -Wbad-function-cast -Wmissing-noreturn -Wmissing-prototypes -Wmissing-declarations -Wcomment -Wcomments -Wtrigraphs -Wsign-compare -Wfloat-equal -Wmultichar
743 else
744 +gccwarn := -Wall -Wwrite-strings
745 endif
746 +gccwarn += -Wundef
747 ifeq ($(enable-werror),yes)
748 +gccwarn += -Werror -Wno-error=undef
749 endif
750 +gccwarn-c = -Wstrict-prototypes
751
752 # We do not depend on the address of constants in different files to be
753 # actually different, so allow the compiler to merge them all.
754 +merge-constants = -fmerge-all-constants
755
756 # We have to assume that glibc functions are called in any rounding
757 # mode and also change the rounding mode in a few functions. So,
758 # disable any optimization that assume default rounding mode.
759 +math-flags = -frounding-math
760
761 # This is the program that generates makefile dependencies from C source files.
762 # The -MP flag tells GCC >= 3.2 (which we now require) to produce dummy
763 # targets for headers so that removed headers don't break the build.
764 ifndef +mkdep
765 +mkdep = $(CC) -M -MP
766 endif
767
768 # The program that makes Emacs-style TAGS files.
769 ETAGS := etags
770
771 # The `xgettext' program for producing .pot files from sources.
772 ifndef XGETTEXT
773 XGETTEXT = xgettext
774 endif
775
776 # The `m4' macro processor; this is used by sysdeps/sparc/Makefile (and
777 # perhaps others) to preprocess assembly code in some cases.
778 M4 = m4
779
780 # To force installation of files even if they are older than the
781 # installed files. This variable is included in the dependency list
782 # of all installation targets.
783 ifeq ($(force-install),yes)
784 +force = force-install
785 else
786 +force =
787 endif
788
789 ####
790 #### End of configuration variables.
791 ####
792 \f
793 # This tells some versions of GNU make before 3.63 not to export all variables.
794 .NOEXPORT:
795
796 # We want to echo the commands we're running without
797 # umpteen zillion filenames along with it (we use `...' instead)
798 # but we don't want this echoing done when the user has said
799 # he doesn't want to see commands echoed by using -s.
800 ifneq "$(findstring s,$(MAKEFLAGS))" "" # if -s
801 +cmdecho := echo >/dev/null
802 else # not -s
803 +cmdecho := echo
804 endif # -s
805
806 # These are the flags given to the compiler to tell
807 # it what sort of optimization and/or debugging output to do.
808 ifndef +cflags
809 # If `CFLAGS' was defined, use that.
810 ifdef CFLAGS
811 +cflags := $(filter-out -I%,$(CFLAGS))
812 endif # CFLAGS
813 endif # +cflags
814
815 # If none of the above worked, default to "-g -O".
816 ifeq "$(strip $(+cflags))" ""
817 +cflags := $(default_cflags)
818 endif # $(+cflags) == ""
819
820 +cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants) $(+math-flags)
821 +gcc-nowarn := -w
822
823 # Don't duplicate options if we inherited variables from the parent.
824 +cflags := $(sort $(+cflags))
825
826 # Each sysdeps directory can contain header files that both will be
827 # used to compile and will be installed. Each can also contain an
828 # include/ subdirectory, whose header files will be used to compile
829 # but will not be installed, and will take precedence over the
830 # installed files. This mirrors the top-level include/ subdirectory.
831 +sysdep-includes := $(foreach dir,$(+sysdep_dirs),\
832 $(addprefix -I,$(wildcard $(dir)/include) $(dir)))
833
834 # These are flags given to the C compiler to tell it to look for
835 # include files (including ones given in angle brackets) in the parent
836 # library source directory, in the include directory, and in the
837 # current directory.
838 +includes = -I$(..)include $(if $(subdir),$(objpfx:%/=-I%)) \
839 $(+sysdep-includes) $(includes) \
840 $(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes)
841
842 # Since libio has several internal header files, we use a -I instead
843 # of many little headers in the include directory.
844 libio-include = -I$(..)libio
845
846 # List of non-library modules that we build.
847 built-modules = iconvprogs iconvdata ldconfig lddlibc4 libmemusage \
848 libSegFault libpcprofile librpcsvc locale-programs \
849 memusagestat nonlib nscd extramodules libnldbl
850
851 in-module = $(subst -,_,$(firstword $(libof-$(basename $(@F))) \
852 $(libof-$(<F)) \
853 $(libof-$(@F)) \
854 libc))
855
856 module-cppflags-real = -include $(common-objpfx)libc-modules.h \
857 -DMODULE_NAME=$(in-module)
858
859 # We don't need libc-modules.h and the MODULE_NAME definition for .v.i
860 # files. These targets don't (and will likely never need to) use the IS_IN
861 # facility. In fact, shlib-versions should not use it because that will
862 # create a circular dependency as libc-modules.h is generated from
863 # shlib-versions.
864 module-cppflags = $(if $(filter %.v.i,$(@F)),,$(module-cppflags-real))
865
866 # These are the variables that the implicit compilation rules use.
867 # Note that we can't use -std=* in CPPFLAGS, because it overrides
868 # the implicit -lang-asm and breaks cpp behavior for .S files--notably
869 # it causes cpp to stop predefining __ASSEMBLER__.
870 CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
871 $($(subdir)-CPPFLAGS) \
872 $(+includes) $(defines) $(module-cppflags) \
873 -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
874 $(CPPFLAGS-$(suffix $@)) \
875 $(foreach lib,$(libof-$(basename $(@F))) \
876 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
877 $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
878 override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) $(config-extra-cflags) \
879 $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
880 $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
881 $(CFLAGS-$(@F)) \
882 $(foreach lib,$(libof-$(basename $(@F))) \
883 $(libof-$(<F)) $(libof-$(@F)),$(CFLAGS-$(lib)))
884 override CXXFLAGS = $(c++-sysincludes) \
885 $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
886 $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
887
888 # If everything is compiled with -fPIC (implicitly) we must tell this by
889 # defining the PIC symbol.
890 ifeq (yes,$(build-pic-default))
891 pic-default = -DPIC
892 endif
893
894 # Enable object files for different versions of the library.
895 # Various things use $(object-suffixes) to know what all to make.
896 # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
897 # to pass different flags for each flavor.
898 libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
899 all-object-suffixes := .o .os .op .og .oS
900 object-suffixes :=
901 CPPFLAGS-.o = $(pic-default)
902 CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
903 libtype.o := lib%.a
904 object-suffixes += .o
905 ifeq (yes,$(build-shared))
906 # Under --enable-shared, we will build a shared library of PIC objects.
907 # The PIC object files are named foo.os.
908 object-suffixes += .os
909 CPPFLAGS-.os = -DPIC -DSHARED
910 CFLAGS-.os = $(filter %frame-pointer,$(+cflags)) $(pic-ccflag)
911 libtype.os := lib%_pic.a
912 # This can be changed by a sysdep makefile
913 pic-ccflag = -fPIC
914 # This one should always stay like this unless there is a very good reason.
915 PIC-ccflag = -fPIC
916 endif
917 # This can be changed by a sysdep makefile
918 pie-ccflag = -fpie
919 # This one should always stay like this unless there is a very good reason.
920 PIE-ccflag = -fPIE
921 ifeq (yes,$(build-profile))
922 # Under --enable-profile, we will build a static library of profiled objects.
923 # The profiled object files are named foo.op.
924 object-suffixes += .op
925 CPPFLAGS-.op = -DPROF $(pic-default)
926 CFLAGS-.op = -pg
927 libtype.op = lib%_p.a
928 endif
929
930 # Convenience variable for when we want to treat shared-library cases
931 # differently from the rest.
932 object-suffixes-noshared := $(filter-out .os,$(object-suffixes))
933
934 object-suffixes-for-libc := $(object-suffixes)
935
936 ifeq (yes,$(build-shared))
937 # Build special library that contains the static-only routines for libc.
938 object-suffixes-for-libc += .oS
939
940 # Must build the routines as PIC, though, because they can end up in (users')
941 # shared objects. We don't want to use CFLAGS-os because users may, for
942 # example, make that processor-specific.
943 CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
944 CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
945 libtype.oS = lib%_nonshared.a
946 endif
947
948 # The assembler can generate debug information too.
949 ifndef ASFLAGS
950 ASFLAGS := $(filter -g% -fdebug-prefix-map=%,$(CFLAGS))
951 endif
952 ASFLAGS += -Werror=undef $(ASFLAGS-config) $(asflags-cpu)
953
954 ifndef BUILD_CC
955 BUILD_CC = $(CC)
956 endif
957
958 move-if-change = $(SHELL) $(..)scripts/move-if-change
959 \f
960 -include $(common-objpfx)sysd-sorted
961 subdirs = $(sorted-subdirs)
962 subdir-srcdirs = $(foreach dir,$(subdirs),\
963 $(firstword $($(dir)-srcdir) $(..)$(dir)))
964
965 # This is a pair of implicit rules to preprocess a file with # comments,
966 # %ifdef et al, based on config.h settings or other %include'd files.
967 # We use chained rules instead of a pipeline here so that we can properly
968 # check the exit status of cpp rather than using its bad output when there
969 # is a preprocessing error. Another rule should depend on the output file
970 # `FOO.v', and along with that `FOO.v.i' should be given dependencies
971 # listing both its input files, and any header files that it may reference
972 # (but no commands).
973 %.v.i: $(common-objpfx)config.h $(..)Makeconfig
974 sed '/^[ ]*%/!s/#.*$$//;/^[ ]*$$/d;s/^[ ]*%/#/' \
975 $(filter-out FORCE %.h $(..)Makeconfig,$^) \
976 | $(CC) -E -undef $(CPPFLAGS) -x assembler-with-cpp - \
977 > $@T
978 mv -f $@T $@
979 %.v: %.v.i
980 sed '/^[ ]*#/d;/^[ ]*$$/d' $< > $@T
981 mv -f $@T $@
982
983 ifeq (yes, $(build-shared))
984
985 # To generate a header to support more than one ABI for different
986 # architecture variants, the CPU/Makefile defines abi-variants to be a
987 # list of names for those variants (e.g. 32 64), and, for each variant,
988 # defines abi-$(variant)-condition to be the condition for those options
989 # to use in a C #if condition. abi-includes may be defined to a list of
990 # headers to include in the generated header, if the default does not
991 # suffice. default-abi is defined to be the ABI for the current glibc
992 # build.
993
994 ifndef abi-includes
995 abi-includes := bits/wordsize.h
996 endif
997
998 # Process the shlib-versions file, which tells us what shared library
999 # version numbers to use when we install shared objects on this system.
1000 # We need to wait until $(subdirs) is complete.
1001 ifeq ($(sysd-sorted-done),t)
1002 -include $(common-objpfx)soversions.mk
1003 ifndef avoid-generated
1004 # This lets add-ons give more-specific matches that override defaults
1005 # in the top-level file.
1006 $(common-objpfx)shlib-versions.v.i: \
1007 $(wildcard $(+sysdep_dirs:=/shlib-versions) \
1008 $(subdir-srcdirs:=/shlib-versions)) \
1009 $(..)shlib-versions
1010
1011 $(common-objpfx)soversions.i: $(..)scripts/soversions.awk \
1012 $(common-objpfx)shlib-versions.v
1013 $(AWK) -f $^ > $@T
1014 mv -f $@T $@
1015 $(common-objpfx)soversions.mk: $(common-objpfx)soversions.i $(..)Makeconfig
1016 (while read which lib number setname; do \
1017 eval seen_$$which=1; \
1018 test x"$$which" = xDEFAULT || continue; \
1019 case $$number in \
1020 [0-9]*) echo "$$lib.so-version=.$$number"; \
1021 echo "all-sonames+=$$lib=$$lib.so\$$($$lib.so-version)";;\
1022 *) echo "$$lib.so-version=$$number"; \
1023 echo "all-sonames+=$$lib=\$$($$lib.so-version)";;\
1024 esac; \
1025 done; \
1026 echo soversions.mk-done = t;) < $< > $@T; exit 0
1027 mv -f $@T $@
1028 endif
1029 endif
1030
1031 postclean-generated += soversions.mk soversions.i \
1032 shlib-versions.v shlib-versions.v.i
1033
1034 before-compile += $(common-objpfx)libc-modules.h
1035 ifeq ($(soversions.mk-done),t)
1036 # Generate a header with macro definitions for use with the IS_IN macro.
1037 # These are the possible values for the MODULE_NAME macro defined when building
1038 # sources, to identify which module the translation unit is going to be built
1039 # into.
1040 $(common-objpfx)libc-modules.h: $(common-objpfx)libc-modules.stmp; @:
1041 $(common-objpfx)libc-modules.stmp: $(..)scripts/gen-libc-modules.awk \
1042 $(common-objpfx)soversions.i
1043 $(AWK) -v buildlist="$(subst -,_,$(built-modules))" -f $^ > ${@:stmp=T}
1044 $(move-if-change) ${@:stmp=T} ${@:stmp=h}
1045 touch $@
1046
1047 endif
1048
1049 common-generated += libc-modules.h libc-modules.stmp
1050
1051 # The name under which the run-time dynamic linker is installed.
1052 # We are currently going for the convention that `/lib/ld.so.1'
1053 # names the SVR4/ELF ABI-compliant dynamic linker.
1054 ifndef rtld-installed-name
1055 ifdef ld.so-version
1056 rtld-installed-name = $(ld.so-version)
1057 else
1058 rtld-installed-name = ld.so.1
1059 endif
1060 endif
1061
1062 ifndef rtld-version-installed-name
1063 rtld-version-installed-name = ld-$(version).so
1064 endif
1065
1066 endif # build-shared
1067
1068
1069 ifeq ($(build-shared),yes)
1070 libdl = $(common-objpfx)dlfcn/libdl.so$(libdl.so-version)
1071 else
1072 libdl = $(common-objpfx)dlfcn/libdl.a
1073 endif
1074
1075 ifeq ($(build-shared),yes)
1076 libm = $(common-objpfx)math/libm.so$(libm.so-version)
1077 else
1078 libm = $(common-objpfx)math/libm.a
1079 endif
1080
1081 # These are the subdirectories containing the library source. The order
1082 # is more or less arbitrary. The sorting step will take care of the
1083 # dependencies.
1084 all-subdirs = csu assert ctype locale intl catgets math setjmp signal \
1085 stdlib stdio-common libio malloc string wcsmbs time dirent \
1086 grp pwd posix io termios resource misc socket sysvipc gmon \
1087 gnulib iconv iconvdata wctype manual shadow gshadow po argp \
1088 crypt localedata timezone rt conform debug \
1089 $(add-on-subdirs) dlfcn elf
1090
1091 ifndef avoid-generated
1092 # sysd-sorted itself will contain rules making the sysd-sorted target
1093 # depend on Depend files. But if you just added a Depend file to an
1094 # existing directory not in all-subdirs, then sysd-sorted needs to
1095 # be regenerated, so it depends on existing $(sorted-subdirs:=/Depend) files.
1096 all-Depend-files := $(wildcard $(sort \
1097 $(foreach dir,$(all-subdirs),\
1098 $(firstword $($(dir)-srcdir) \
1099 $(..)$(dir))/Depend) \
1100 $(sorted-subdirs:=/Depend)))
1101 $(common-objpfx)sysd-sorted: $(..)scripts/gen-sorted.awk \
1102 $(common-objpfx)config.make $(..)Makeconfig \
1103 $(wildcard $(sysdirs:=/Subdirs)) \
1104 $(all-Depend-files)
1105 $(AWK) -f $< \
1106 -v subdirs='$(all-subdirs)' \
1107 -v srcpfx='$(..)' \
1108 $(filter %/Subdirs %/Depend,$^) > $@-tmp
1109 mv -f $@-tmp $@
1110 $(all-Depend-files): ;
1111 endif
1112
1113 # This gives partial TARGET:SOURCE pattern pairs to have rules
1114 # emitted into sysd-rules. A sysdeps Makeconfig fragment can
1115 # add its own special object file prefix to this list with e.g. foo-%:%
1116 # to have foo-*.? compiled from *.? using $(foo-CPPFLAGS).
1117 sysd-rules-patterns := %:% rtld-%:rtld-% rtld-%:% m_%:s_%
1118
1119 # Let sysdeps/ subdirs contain a Makeconfig fragment for us to include here.
1120 sysdep-makeconfigs := $(wildcard $(+sysdep_dirs:=/Makeconfig))
1121 ifneq (,$(sysdep-makeconfigs))
1122 include $(sysdep-makeconfigs)
1123 endif
1124
1125 # Compute just the target patterns. Makeconfig has set sysd-rules-patterns.
1126 sysd-rules-targets := $(sort $(foreach p,$(sysd-rules-patterns),\
1127 $(firstword $(subst :, ,$p))))
1128
1129 # A sysdeps Makeconfig fragment may set libc-reentrant to yes.
1130 ifeq (yes,$(libc-reentrant))
1131 defines += -D_LIBC_REENTRANT
1132
1133 libio-mtsafe = -D_IO_MTSAFE_IO
1134 endif
1135
1136 # The name to give to a test in test results summaries.
1137 test-name = $(strip $(patsubst %.out, %, $(patsubst $(common-objpfx)%, %, $@)))
1138
1139 # Likewise, in XFAIL variable names.
1140 test-xfail-name = $(strip $(patsubst %.out, %, $(patsubst $(objpfx)%, %, $@)))
1141
1142 # Command to output a test status line (such as PASS: test-name). If
1143 # test-xfail-$(test-xfail-name) has a nonempty value, the status will be
1144 # XPASS or XFAIL rather than PASS or FAIL.
1145 evaluate-test = $(..)scripts/evaluate-test.sh $(test-name) $$? \
1146 $(if $(test-xfail-$(test-xfail-name)),true,false) \
1147 $(if $(stop-on-test-failure),true,false) \
1148 > $(common-objpfx)$(test-name).test-result
1149
1150 endif # Makeconfig not yet included
1151
1152 # Local Variables:
1153 # mode: makefile
1154 # End: