# `configure' writes a definition of `config-sysdirs' in `config.make'.
sysdirs := $(foreach D,$(config-sysdirs),$(firstword $(filter /%,$D) $(..)$D))
-# Add-ons that contribute sysdeps trees get added to the include list
-# after sysdeps/generic. This makes #include <sysdeps/...> work right
-# to find specific add-on files without assuming the add-on directory name.
-# It also means that headers can go into an add-on's base directory
-# instead of the add-on needing a sysdeps/generic of its own.
-sysdeps-srcdirs := $(foreach add-on,$(sysdeps-add-ons),\
- $(firstword $(filter /%,$(add-on)) \
- $(..)$(add-on)))
-+sysdep_dirs = $(sysdirs) $(sysdeps-srcdirs)
++sysdep_dirs = $(sysdirs)
ifdef objdir
+sysdep_dirs := $(objdir) $(+sysdep_dirs)
endif
$(..)config.make.in $(..)config.h.in
cd $(<D); $(SHELL) $(<F)
-# Find all the add-on and sysdeps configure fragments, to make sure we
-# re-run configure when any of them changes.
+# Find all the sysdeps configure fragments, to make sure we re-run
+# configure when any of them changes.
$(common-objpfx)config.status: $(..)version.h $(..)configure \
$(foreach dir,$(sysdirs),\
$(wildcard $(dir)/Implies) \
$(firstword $(wildcard \
$(addprefix $(dir)/,configure configure.ac))))) \
$(patsubst %.ac,%,\
- $(wildcard $(..)sysdeps/*/preconfigure $(..)sysdeps/*/preconfigure.ac)) \
- $(patsubst %.ac,%,\
- $(foreach add-on,$(add-ons),\
- $(firstword $(wildcard \
- $(addprefix $(firstword $(filter /%,$(add-on)) $(..)$(add-on))/,\
- configure configure.ac))) \
- $(wildcard $(addprefix $(firstword $(filter /%,$(add-on)) $(..)$(add-on))/,\
- sysdeps/*/preconfigure sysdeps/*/preconfigure.ac))))
+ $(wildcard $(..)sysdeps/*/preconfigure $(..)sysdeps/*/preconfigure.ac))
@cd $(@D); if test -f $(@F); then exec $(SHELL) $(@F) --recheck; else \
echo The GNU C library has not been configured. >&2; \
echo Run \`configure\' to configure it before building. >&2; \
+link-pie-before-libc = $(CC) -pie -Wl,-O1 -nostdlib -nostartfiles -o $@ \
$(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
$(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
- $(addprefix $(csu-objpfx),S$(start-installed-name)) \
+ $(firstword $(CRT-$(@F)) $(csu-objpfx)S$(start-installed-name)) \
$(+preinit) $(+prectorS) \
$(filter-out $(addprefix $(csu-objpfx),start.o \
S$(start-installed-name))\
# Command for statically linking programs with the C library.
ifndef +link-static
+link-static-before-libc = $(CC) -nostdlib -nostartfiles -static -o $@ \
+ $(DEFAULT-LDFLAGS-$(@F)) \
$(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
- $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
+ $(firstword $(CRT-$(@F)) $(csu-objpfx)$(static-start-installed-name)) \
$(+preinit) $(+prectorT) \
$(filter-out $(addprefix $(csu-objpfx),start.o \
$(start-installed-name))\
+link-before-libc = $(CC) -nostdlib -nostartfiles -o $@ \
$(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
$(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
- $(addprefix $(csu-objpfx),$(start-installed-name)) \
+ $(firstword $(CRT-$(@F)) $(csu-objpfx)$(start-installed-name)) \
$(+preinit) $(+prector) \
$(filter-out $(addprefix $(csu-objpfx),start.o \
$(start-installed-name))\
ifeq ($(sysd-sorted-done),t)
-include $(common-objpfx)soversions.mk
ifndef avoid-generated
-# This lets add-ons give more-specific matches that override defaults
-# in the top-level file.
$(common-objpfx)shlib-versions.v.i: \
$(wildcard $(+sysdep_dirs:=/shlib-versions) \
$(subdir-srcdirs:=/shlib-versions)) \
shlib-versions.v shlib-versions.v.i
before-compile += $(common-objpfx)libc-modules.h
+common-generated += libc-modules.h libc-modules.stmp
ifeq ($(soversions.mk-done),t)
# Generate a header with macro definitions for use with the IS_IN macro.
# These are the possible values for the MODULE_NAME macro defined when building
# glibc.
ifneq (no,$(have-tunables))
before-compile += $(common-objpfx)dl-tunable-list.h
-
-$(common-objpfx)dl-tunable-list.h: $(..)scripts/gen-tunables.awk \
- $(..)elf/dl-tunables.list
- $(AWK) -f $^ > $@.tmp
- mv $@.tmp $@
+common-generated += dl-tunable-list.h dl-tunable-list.stmp
+
+$(common-objpfx)dl-tunable-list.h: $(common-objpfx)dl-tunable-list.stmp; @:
+$(common-objpfx)dl-tunable-list.stmp: \
+ $(..)scripts/gen-tunables.awk \
+ $(..)elf/dl-tunables.list \
+ $(wildcard $(subdirs:%=$(..)%/dl-tunables.list)) \
+ $(wildcard $(sysdirs:%=%/dl-tunables.list))
+ $(AWK) -f $^ > ${@:stmp=T}
+ $(move-if-change) ${@:stmp=T} ${@:stmp=h}
+ touch $@
endif
-common-generated += libc-modules.h libc-modules.stmp
-
# The name under which the run-time dynamic linker is installed.
# We are currently going for the convention that `/lib/ld.so.1'
# names the SVR4/ELF ABI-compliant dynamic linker.
grp pwd posix io termios resource misc socket sysvipc gmon \
gnulib iconv iconvdata wctype manual shadow gshadow po argp \
crypt localedata timezone rt conform debug mathvec support \
- $(add-on-subdirs) dlfcn elf
+ dlfcn elf
ifndef avoid-generated
# sysd-sorted itself will contain rules making the sysd-sorted target