summaryrefslogtreecommitdiff
path: root/Makeconfig
diff options
context:
space:
mode:
Diffstat (limited to 'Makeconfig')
-rw-r--r--Makeconfig27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makeconfig b/Makeconfig
index 8b82a31124..74f8d795a4 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -566,6 +566,33 @@ $(common-objpfx)soversions.mk: $(..)shlib-versions $(..)Makeconfig \
# Get $(version) defined with the release version number.
-include $(common-objpfx)version.mk
+# Generate the header containing the names of all shared libraries.
+# We use a stamp file to avoid uncessary recompilations.
+before-compile += $(common-objpfx)gnu/lib-names.h
+$(common-objpfx)gnu/lib-names.h: $(common-objpfx)gnu/lib-names.stmp
+$(common-objpfx)gnu/lib-names.stmp: $(common-objpfx)soversions.mk
+ $(make-target-directory)
+ @rm -f ${@:stmp=T} $@
+ (echo '/* This file is automatically generated.';\
+ echo ' It defines macros to allow user program to find the shared';\
+ echo ' library files which come as part of GNU libc. */';\
+ echo '#ifndef __GNU_LIB_NAMES_H'; \
+ echo '#define __GNU_LIB_NAMES_H 1'; \
+ echo; \
+ (libs='$(all-sonames)';\
+ for l in $$libs; do \
+ upname=`echo $$l | sed 's/[.]so.*//' | \
+ tr '[:lower:]-' '[:upper:]_'`; \
+ echo "#define $${upname}_SO \"$$l\""; \
+ done;) | sort; \
+ echo; \
+ echo '#endif /* gnu/lib-names.h */';) > ${@:stmp=T}
+ if test -r ${@:stmp=h} && cmp -s ${@:stmp=h} ${@:stmp=T}; \
+ then rm -f ${@:stmp=T}; \
+ else mv -f ${@:stmp=T} ${@:stmp=h}; fi
+ touch $@
+
+common-generated += gnu/lib-names.h gnu/lib-names.stmp
# The name under which the run-time dynamic linker is installed.
# We are currently going for the convention that `/lib/ld.so.1'