aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 18 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 65e54a18b6..29591284bd 100644
--- a/Makefile
+++ b/Makefile
@@ -84,7 +84,7 @@ subdirs := $(filter mach,$(subdirs)) $(filter hurd,$(subdirs)) \
headers := errno.h sys/errno.h errnos.h limits.h values.h \
features.h gnu-versions.h libc-lock.h
aux = sysdep $(libc-init) version
-before-compile = $(objpfx)version-info.h
+before-compile = $(objpfx)version-info.h $(objpfx)features.h
echo-headers: subdir_echo-headers
@@ -151,6 +151,23 @@ $(objpfx)version-info.h: $(+sysdir_pfx)config.make $(all-Banner-files)
version.c-objects := $(addprefix $(objpfx)version,$(object-suffixes))
$(version.c-objects): $(objpfx)version-info.h
+$(objpfx)features.h: features.h.in Makefile $(common-objpfx)soversions.mk
+ nr="$(libc.so-version)"; \
+ if test -n $$nr; then \
+ nr=`echo $$nr | sed 's/^[.]//'`; \
+ tmpfile=$${TMPDIR:-/tmp}/sedtmp.$$$$; \
+ rm -f $$tmpfile; \
+ (echo '/^INTERFACENUMBER/ { i\'; \
+ echo '/* Interface number of the shared library. */\'; \
+ echo "#define __GNU_LIBRARY_INTERFACE__ $$nr"; \
+ echo ' s/^INTERFACENUMBER//'; \
+ echo '}') > $$tmpfile; \
+ sed -f $$tmpfile < $< > $@; \
+ rm -f $$tmpfile; \
+ else \
+ sed -e '/^INTERFACENUMBER/d' < $< > $@; \
+ fi
+
# Makerules creates a file `stub-$(subdir)' for each subdirectory, which
# contains `#define __stub_FUNCTION' for each function which is a stub.
# Here we paste all of these together into <stubs.h>.