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