X-Git-Url: https://sourceware.org/git/?a=blobdiff_plain;f=Makefile;h=7ebd3b7bd1cf16a8cdf828df543248e7c09d01af;hb=f5c1ec414e169d34cb8b1698686845c9373b0469;hp=87a66eea81bcd684077505c7b2dc0f239dfdec5a;hpb=c40298232a7ed3fb1b64eb4ffe352829deb79694;p=glibc.git diff --git a/Makefile b/Makefile index 87a66eea81..7ebd3b7bd1 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,9 @@ # Library General Public License for more details. # You should have received a copy of the GNU Library General Public -# License along with the GNU C Library; see the file COPYING.LIB. If -# not, write to the Free Software Foundation, Inc., 675 Mass Ave, -# Cambridge, MA 02139, USA. +# License along with the GNU C Library; see the file COPYING.LIB. If not, +# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. # # Master Makefile for the GNU C library @@ -52,9 +52,9 @@ endif # These are the subdirectories containing the library source. subdirs = csu assert ctype db locale intl catgets math setjmp signal stdlib \ - stdio-common $(stdio) malloc string wcsmbs time dirent grp pwd\ + stdio-common $(stdio) $(malloc) string wcsmbs time dirent grp pwd \ posix io termios resource misc login socket sysvipc gmon gnulib \ - wctype manual shadow $(sysdep-subdirs) nss elf po $(add-ons) + wctype manual shadow crypt $(sysdep-subdirs) nss elf po $(add-ons) export subdirs := $(subdirs) # Benign, useless in GNU make before 3.63. # The mach and hurd subdirectories have many generated header files which @@ -82,7 +82,7 @@ subdirs := $(filter mach,$(subdirs)) $(filter hurd,$(subdirs)) \ $(addprefix install-, no-libc.a bin lib data headers others) headers := errno.h sys/errno.h errnos.h limits.h values.h \ - features.h gnu-versions.h libc-lock.h + features.h gnu-versions.h libc-lock.h xopen_lim.h aux = sysdep $(libc-init) version before-compile = $(objpfx)version-info.h @@ -90,6 +90,9 @@ echo-headers: subdir_echo-headers # What to install. install-others = $(includedir)/stubs.h +ifeq (yes,$(build-shared)) +install-others += $(includedir)/gnu/lib-names.h +endif ifeq (yes,$(gnu-ld)) libc-init = set-init @@ -124,13 +127,30 @@ $(objpfx)sysd-dirs: $(+sysdir_pfx)config.make $(all-Subdirs-files) all-Banner-files = $(wildcard $(addsuffix /Banner, $(subdirs))) $(objpfx)version-info.h: $(+sysdir_pfx)config.make $(all-Banner-files) - (files="$(all-Banner-files)"; \ - if [ test -n "$$files" ]; then \ + (case $(config-os) in \ + linux*) version=`(echo -e "#include \nUTS_RELEASE"\ + | $(CC) -E -P - | \ + sed -e 's/"\([^"]*\)".*/\1/p' -e d) 2>/dev/null`;\ + if [ -z "$$version" ]; then \ + if [ -r /proc/version ]; then \ + version=`sed 's/.*version \([^ ]*\) .*/>>\1< $@-tmp - mv -f $@-tmp $@ + fi) > $@T + mv -f $@T $@ +generated += version-info.h version.c-objects := $(addprefix $(objpfx)version,$(object-suffixes)) $(version.c-objects): $(objpfx)version-info.h @@ -155,10 +175,36 @@ $(includedir)/stubs.h: subdir_install echo ' every time called, usually setting errno to ENOSYS. */';\ sort $(subdir-stubs)) > $(objpfx)stubs.h if test -r $@ && cmp -s $(objpfx)stubs.h $@; \ - then echo stubs.h unchanged ; \ + then echo 'stubs.h unchanged'; \ else $(INSTALL_DATA) $(objpfx)stubs.h $@; fi rm -f $(objpfx)stubs.h +ifeq (yes,$(build-shared)) + +# Like stubs.h the gnu/lib-names.h header is not used while building the +# libc itself. So we generate it while installing. +$(includedir)/gnu/lib-names.h: $(common-objpfx)soversions.mk + @rm -f $(objpfx)lib-names.h + (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 */';) > $(objpfx)lib-names.h + if test -r $@ && cmp -s $(objpfx)lib-names.h $@; \ + then echo 'gnu/lib-names.h unchanged'; \ + else $(INSTALL_DATA) $(objpfx)lib-names.h $@; fi + rm -f $(objpfx)lib-names.h +endif + # This makes the Info or DVI file of the documentation from the Texinfo source. .PHONY: info dvi info dvi: @@ -240,9 +286,9 @@ distribute := README INSTALL FAQ NOTES NEWS PROJECTS \ ansidecl.h mkinstalldirs move-if-change install-sh \ configure configure.in aclocal.m4 config.sub config.guess\ config.h.in config.make.in config-name.in Makefile.in \ - autolock.sh munch-tmpl.c munch.awk interp.c \ + autolock.sh rellns-sh munch-tmpl.c munch.awk interp.c \ sysdep.h set-hooks.h libc-symbols.h version.h shlib-versions \ - rpm/Makefile rpm/template rpm/rpmrc + rpm/Makefile rpm/template rpm/rpmrc nsswitch.h netgroup.h distribute := $(strip $(distribute)) generated := $(generated) stubs.h version-info.h