This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

make dist overhaul [PATCH]



Here's a revised version of the `make dist' overhaul.  I believe it
generates a correct distribution.  It's significantly faster, it has
fewer quirks, it removes a major block to future improvements in the
makefiles (having some goals in separate makefiles made it too hard to
rework the directory iterator).

The patch depends on my previous patch to Makeconfig (in message titled
`Re: cross-compilation fails').

Some notes:

Files are no longer distributed if they appear in sysdep_routines for
the current configuration.  They must be in a Dist file.  This ensures
that `make dist' does the same thing on all platforms.

Dist files must have only one file per line.  The shell script that
reads them is much simpler this way.

There is now logic to rebuild generated files that go into the
distribution.  In normal Makefiles, set src-generated to a list of the
files to be rebuilt, and provide rules to remake them.  This should
happen in the source tree.  In sysdep Makefiles, have the `dist'
target depend on any files to be rebuilt.

`make dist' is the same as `make release'.  You can also do `make
snapshot.' Please check the CVS tagging code.

tarprefix.c only knows how to adjust GNU-format tarfiles.  Since the
next release of gnutar will have the functionality of tarprefix built
in, I don't see this as a major problem.

TAGS files may come out ordered differently.  libc.pot is not rebuilt
at dist time; you must `make libc.pot' explicitly.

zw

1998-06-15 12:49 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>

	* Makeconfig (always-subdirs): New variable.
	(sometimes-subdirs): New variable.
	(subdirs): Redefine in terms of $(always-subdirs).
	(all-subdirs): New variable; lists every non-addon source dir.
	(all-sysd-dirs): New variable; lists every sysdeps directory.

	* Makefile:  Add rules to build the distribution tar file.  Add
	rules to regenerate README, COPYING.LIB, po/libc.pot.
	(+subdir_targets): Remove subdir_distinfo,
	subdir_echo-distinfo, subdir_echo-headers.
	(src-generated): New variable.
	(subdir_distinfo): New target. Iterate _all_ subdirs, including
	ones not configured.
	(subdir_TAGS): Likewise.
	(echo-distinfo): Removed target.
	(parent_echo-distinfo): Removed target.
	(snapshot): New target.
	(release): New target.
	* Makerules: Add rule to make subdir distinfo file.  Add rule
	to make TAGS file.  Strip out old code that hands these off to
	other makefiles.

	* scripts/gen-distinfo: New file.
	* scripts/gen-sysd-distlist: New file.
	* scripts/tarprefix.c: New file.
	* scripts/fixpatch: New file.

	* Make-dist: Removed.
	* MakeTAGS: Removed.
	
	* config.make.in: Add TAR, have_tar_--name-prefix, XGETTEXT to
	be substituted.
	* configure.in: Check for tar and xgettext.  Check whether tar
	supports the --name-prefix switch (new in gtar 1.12a)
	
	* mach/Machrules: Don't create .udeps files if no_deps is set.
	* sysdeps/unix/Makefile: Don't create sysd-syscalls or
	s-proto.d if avoid-generated is set.

	* manual/Makefile: Clean up.  Fix tags table to be useful.
	Make sure everything to be distributed is present.
	* manual/chapters.awk: New file.

	* sysdeps/alpha/Dist: Put all files on separate lines.
	* sysdeps/generic/Dist: Likewise.
	* sysdeps/m68k/fpu/switch/Dist: Likewise.
	* sysdeps/sparc/sparc32/Dist: Likewise.
	* sysdeps/unix/Dist: Likewise.
	* sysdeps/unix/sysv/irix4/Dist: Likewise.

	* sysdeps/generic/Dist: Add endutxent.c, getutxent.c, getutxid.c,
	getutxline.c, pututxline.c, setutxent.c, updwtmpx.c, utmpxname.c.
	* sysdeps/unix/sysv/linux/Dist: Add getresuid.c, getresgid.c.

	* sysdeps/gnu/Makefile (dist): New target; depend on
	sysdeps/gnu/errlist.c.
	* sysdeps/sparc/sparc32/Makefile (+divrem-targets): List all
	files to be built and distributed.
	(dist): Depend on $(+divrem-targets).

============================================================
Index: Makeconfig
--- Makeconfig	Sun, 14 Jun 1998 10:20:45 -0400 zack 
+++ Makeconfig	Sun, 14 Jun 1998 22:18:19 -0400 zack
@@ -549,11 +550,21 @@
 endif
 
 # These are the subdirectories containing the library source.
-subdirs = csu assert ctype db2 locale intl catgets math setjmp signal stdlib \
-	  stdio-common $(stdio) malloc string wcsmbs time dirent grp pwd \
-	  posix io termios resource misc socket sysvipc gmon gnulib iconv \
-	  iconvdata wctype manual shadow md5-crypt po argp $(add-ons) nss \
-	  localedata timezone rt debug $(sysdep-subdirs) $(binfmt-subdir)
+always-subdirs = \
+	argp assert catgets csu ctype db2 debug dirent gmon gnulib grp	\
+	iconv iconvdata intl io locale localedata malloc manual math	\
+	md5-crypt misc nss po posix pwd resource rt setjmp shadow	\
+	signal socket stdio-common stdlib string sysvipc termios time	\
+	timezone wcsmbs wctype
+
+sometimes-subdirs = \
+	aout bare db elf hesiod hurd inet libio login mach nis nscd	\
+	resolv stdio streams sunrpc
+
+subdirs = $(always-subdirs) $(stdio) $(add-ons) \
+	  $(sysdep-subdirs) $(binfmt-subdir)
+
+all-subdirs = $(always-subdirs) $(sometimes-subdirs)
 
 # The mach and hurd subdirectories have many generated header files which
 # much of the rest of the library depends on, so it is best to build them
@@ -570,5 +581,48 @@
 	 sed 's/#.*$$//' $(all-Subdirs-files) /dev/null;	\
 	 echo endef) > $@-tmp
 	mv -f $@-tmp $@
+
+# This list must be updated when new sysdep dirs are added.  Create it
+# by running this command from sysdeps:
+# find . -type d | egrep -v '/(CVS|bits|sys|nfs|scsi|net[a-z0-9]*)$' | cut -c3-
+# Then edit out unix/sysv/linux/alpha/alpha and format to taste.
+# A better method would be appreciated -zw
+all-sysd-dirs = $(addprefix $(..)sysdeps/, \
+	alpha alpha/alphaev5 alpha/elf alpha/fpu am29k arm arm/elf	\
+	arm/fpu generic generic/elf gnu hppa hppa/hppa1.1 i370 i386	\
+	i386/elf i386/fpu i386/i486 i386/i586 i386/i686 i860 i960	\
+	ieee754 libm-i387 libm-i387/i686 libm-ieee754 m68k m68k/elf	\
+	m68k/fpu m68k/fpu/switch m68k/m68020 m88k m88k/m88100		\
+	m88k/m88110 mach mach/alpha mach/hppa mach/hurd			\
+	mach/hurd/alpha mach/hurd/hppa mach/hurd/i386 mach/hurd/mips	\
+	mach/i386 mach/mips mach/powerpc mips mips/dec mips/elf		\
+	mips/mips3 mips/mips64 mips/mipsel mips/p40 mvs posix powerpc	\
+	powerpc/elf rs6000 sparc sparc/fpu sparc/sparc32		\
+	sparc/sparc32/elf sparc/sparc32/fpu sparc/sparc32/sparcv8	\
+	sparc/sparc64 sparc/sparc64/elf sparc/sparc64/fpu standalone	\
+	standalone/arm standalone/i386 standalone/i386/force_cpu386	\
+	standalone/i960 standalone/i960/nindy960 standalone/m68k	\
+	standalone/m68k/m68020 standalone/m68k/m68020/mvme135		\
+	standalone/m68k/m68020/mvme136 tahoe unix unix/alpha unix/arm	\
+	unix/bsd unix/bsd/hp unix/bsd/hp/m68k unix/bsd/bsd4.4		\
+	unix/bsd/i386 unix/bsd/m68k unix/bsd/osf unix/bsd/osf/alpha	\
+	unix/bsd/sequent unix/bsd/sequent/i386 unix/bsd/sony		\
+	unix/bsd/sony/newsos unix/bsd/sony/newsos/m68k			\
+	unix/bsd/sony/newsos4 unix/bsd/sun unix/bsd/sun/m68k		\
+	unix/bsd/sun/sparc unix/bsd/sun/sunos4 unix/bsd/tahoe		\
+	unix/bsd/ultrix4 unix/bsd/ultrix4/mips unix/bsd/vax		\
+	unix/common unix/i386 unix/inet unix/mips unix/mman unix/sparc	\
+	unix/sysv unix/sysv/i386 unix/sysv/irix4 unix/sysv/isc2.2	\
+	unix/sysv/linux unix/sysv/linux/alpha unix/sysv/linux/arm	\
+	unix/sysv/linux/i386 unix/sysv/linux/i386/i686			\
+	unix/sysv/linux/m68k unix/sysv/linux/mips			\
+	unix/sysv/linux/powerpc unix/sysv/linux/sparc			\
+	unix/sysv/linux/sparc/sparc32 unix/sysv/linux/sparc/sparc64	\
+	unix/sysv/minix unix/sysv/sco3.2 unix/sysv/sco3.2.4		\
+	unix/sysv/sysv4 unix/sysv/sysv4/i386 unix/sysv/sysv4/solaris2	\
+	unix/sysv/sysv4/solaris2/sparc vax wordsize-32 wordsize-64	\
+	z8000)
+
+export SYSDIRS = $(all-sysd-dirs) # gen-distinfo picks it up from the environment
 
 endif # Makeconfig not yet included
============================================================
Index: Makefile
--- Makefile	Sun, 14 Jun 1998 10:20:45 -0400 zack 
+++ Makefile	Mon, 15 Jun 1998 11:56:17 -0400 zack
@@ -53,18 +53,13 @@
 # These are the targets that are made by making them in each subdirectory.
 +subdir_targets	:= subdir_lib objects objs others subdir_mostlyclean	\
 		   subdir_clean subdir_distclean subdir_realclean	\
-		   tests subdir_lint.out				\
-		   subdir_distinfo					\
-		   subdir_echo-headers subdir_echo-distinfo		\
-		   subdir_install					\
+		   tests subdir_lint.out subdir_install			\
 		   $(addprefix install-, no-libc.a bin lib data headers others)
 
 headers := errno.h sys/errno.h bits/errno.h limits.h values.h	\
 	   features.h gnu-versions.h bits/libc-lock.h bits/xopen_lim.h	\
 	   gnu/libc-version.h
 
-echo-headers: subdir_echo-headers
-
 # The headers are in the include directory.
 subdir-dirs = include
 vpath %.h $(subdir-dirs)
@@ -77,6 +72,10 @@
 install-others += $(inst_includedir)/gnu/lib-names.h
 endif
 
+# These are generated already when distributed.  Rules are far below.
+# The list is needed in Makerules, so it has to be up here.
+src-generated := README INSTALL NOTES COPYING.LIB FAQ
+
 include Makerules
 
 ifeq ($(build-programs),yes)
@@ -177,7 +176,21 @@
 $(all-subdirs-targets):
 	$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
 
+# subdir_distinfo is *almost* the same.  It needs to iterate all the dirs,
+# even the ones that aren't configured, and it needs to do it with no_deps
+# and avoid-generated set.
+subdir_distinfo: $(all-subdirs:%=%/distinfo)
+$(all-subdirs:%=%/distinfo):
+	$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F) avoid-generated=t no_deps=t
+
+# Likewise for subdir_TAGS.
+subdir_TAGS: $(all-subdirs:%=%/TAGS)
+$(all-subdirs:%=%/TAGS):
+	$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F) avoid-generated=t no_deps=t
+
 .PHONY: $(+subdir_targets) $(all-subdirs-targets)
+.PHONY: $(all-subdirs:%=%/distinfo) $(all-subdirs:%=%/TAGS)
+
 
 # Targets to clean things up to various degrees.
 
@@ -229,18 +242,72 @@
 .PHONY: echo_subdirs
 echo_subdirs:;@echo '$(subdirs)'
 
-.PHONY: echo-distinfo parent_echo-distinfo
-echo-distinfo: parent_echo-distinfo subdir_echo-distinfo
-parent_echo-distinfo:
-	@echo $(addprefix +header+,$(headers)) \
-	      $(addprefix +nodist+,$(generated))
-
 
 # Make the distribution tarfile.
 
+snap = $(shell date +%y%m%d)
+last-snap = $(shell cat .last-snapshot)
+rel = $(version)
+last-rel = $(shell cat .last-release)
+snapshot-x = $(snap)
+release-x = $(rel)
+
+XX = ud # FIXME: is this correct for the XX in libc-XX-YYMMDD tags?
+
+snapshot-tarball  = glibc-$(snap)
+snapshot-diff	  = glibc-$(last-snap)-$(snap)
+snapshot-tag	  = libc-$(XX)-$(snap)
+snapshot-last-tag = libc-$(XX)-$(last-snap)
+release-tarball   = glibc-$(version)
+release-diff	  = glibc-$(last-rel)-$(rel)
+release-tag	  = libc-$(XX)-$(subst .,_,$(rel))
+release-last-tag  = libc-$(XX)-$(subst .,_,$(last-rel))
+
+ifeq ($(have_tar_--name-prefix),yes)
+tar-cmd = $(TAR) -c -T $< --name-prefix $($@-tarball)/
+dist-deps = $(common-objpfx)distlist
+else
+tar-cmd = $(TAR) -c -T $< | $(common-objpfx)tarprefix $($@-tarball)/
+dist-deps = $(common-objpfx)distlist $(common-objpfx)tarprefix
+endif
+
+.PHONY: snapshot release dist
+snapshot release: $(dist-deps)
+	$(tar-cmd) | gzip > $@.T
+	mv -f $@.T $($@-tarball).tar.gz
+ifeq ($(with-cvs),yes)
+	cvs $(CVSOPTS) tag $($@-tag)
+	cvs $(CVSOPTS) diff -u -r$($@-last-tag) |./scripts/fixpatch |gzip >$@.D
+	mv -f $@.D $(@-diff).diff.gz
+endif
+	echo $($@-x) > .last-$@
+
+dist: release
+$(common-objpfx)distlist: $(objpfx)distinfo $(objpfx)sysd-distlist \
+			  subdir_distinfo
+	sort -u $(objpfx)distinfo $(objpfx)sysd-distlist \
+		$(all-subdirs:%=$(common-objpfx)%/distinfo) > $@.T
+	mv -f $@.T $@
+
+$(common-objpfx)tarprefix: scripts/tarprefix.c
+	$(BUILD_CC) $(CFLAGS) $< -o $@
+
+# No meaningful deplist is possible for these targets.
+.PHONY: $(objpfx)sysd-distlist $(objpfx)sysd-dist.mk
+$(objpfx)sysd-distlist: $(objpfx)sysd-dist.mk
+	$(MAKE) -f $< dist no_deps=t avoid-generated=t
+	./scripts/gen-sysd-distlist > $@.T
+	mv -f $@.T $@
+
+# Like sysd-Makefile except that it includes all the sysdep Makefiles.
+$(objpfx)sysd-dist.mk: $(wildcard $(all-sysd-dirs:%=%/Makefile))
+	(echo 'dist:'; echo; echo 'include Makeconfig'; \
+	for M in $^; do echo "include $$M"; done) > $@T
+	mv -f $@T $@
+
 distribute  :=	README README.libm INSTALL FAQ FAQ.in NOTES NEWS BUGS	\
-		PROJECTS COPYING.LIB COPYING ChangeLog ChangeLog.[0-9]	\
-		Makefile Makeconfig Makerules Rules Make-dist MakeTAGS	\
+		PROJECTS COPYING.LIB ChangeLog ChangeLog.[0-9]		\
+		Makefile Makeconfig Makerules Rules			\
 		extra-lib.mk o-iterator.mk libc.map configure		\
 		configure.in aclocal.m4 config.h.in config.make.in	\
 		config-name.in Makefile.in sysdep.h set-hooks.h		\
@@ -250,34 +317,67 @@
 		$(addprefix scripts/,					\
 			    rellns-sh config.sub config.guess		\
 			    mkinstalldirs move-if-change install-sh	\
-			    test-installation.pl gen-FAQ.pl)
+			    test-installation.pl gen-FAQ.pl subdir-dist \
+			    tarprefix.c fixpatch gen-distinfo 		\
+			    gen-sysd-distlist)
+ifeq ($(release), experimental)
+distribute += README-alpha
+endif
 
 distribute := $(strip $(distribute))
 generated := $(generated) stubs.h
 
-README: README.template version.h ; # Make-dist should update README.
+ifeq ($(with-cvs),yes)
+define cvs-commit
+chmod 444 $@
+test ! -d CVS || cvs $(CVSOPTS) commit -m'Remade for $(release)-$(version)' $@
+endef
+else
+define cvs-commit
+chmod 444 $@
+endef
+endif
 
 define format-me
-@rm -f $@
-makeinfo --no-validate --no-warn --no-headers $< -o $@
--chmod a-w $@
+makeinfo --no-validate --no-warn --no-headers $< -o $@.new
+mv -f $@.new $@
 endef
-INSTALL: manual/install.texi; $(format-me)
-NOTES: manual/creature.texi; $(format-me)
-manual/dir-add.texi manual/dir-add.info: FORCE
-	$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
+
+README: README.template version.h
+	-rm -f $@
+	sed -e 's/RELEASE/$(release)/' -e 's/VERSION/$(version)/' < $< > $@
+	$(cvs-commit)
+INSTALL: manual/install.texi; $(format-me); $(cvs-commit)
+NOTES: manual/creature.texi; $(format-me); $(cvs-commit)
+COPYING.LIB: manual/lgpl.texinfo; $(format-me); $(cvs-commit)
+
 FAQ: scripts/gen-FAQ.pl FAQ.in
-	$(PERL) $^ > $@.new && rm -f $@ && mv $@.new $@ && chmod a-w $@
-ifeq ($(with-cvs),yes)
-	test ! -d CVS || cvs $(CVSOPTS) commit -m'Regenerated:  $(PERL) $^' $@
-endif
-FORCE:
+	$(PERL) $^ > $@.new && rm -f $@ && mv $@.new $@
+	$(cvs-commit)
 
-rpm/%: subdir_distinfo
-	$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
+#rpm/%: subdir_distinfo
+#	$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
 
 iconvdata/%:
 	$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
+
+# The message translation template.
+.PHONY: libc.pot
+libc.pot: po/libc.pot
+
+# You need a recent gettext, and a date that knows %z.
+# Arguably this should be in $(src-generated), except it needs
+# the entire distlist file, and distributing out-of-date versions
+# isn't the end of the world.
+po/libc.pot: $(common-objpfx)distlist po/header.pot
+	@rm -f $@.new
+	sed -e 's/VERSION/$(version)/' \
+	    -e "s/DATE/`date +'%Y-%m-%d %H:%M %z`/" \
+	    po/header.pot > $@.new
+	$(XGETTEXT) --keyword=_ --keyword=N_ --add-comments=TRANS \
+		--sort-output --omit-header -n -d - \
+			>> $@.new `grep '\\.[ch]$$' $<`
+	mv -f $@.new $@
 
 # This is a special goal for people making binary distributions.  Normally
 # everybody uses the DES based crypt library but for the distribution we
============================================================
Index: Makerules
--- Makerules	Sat, 30 May 1998 16:12:00 -0400 zack 
+++ Makerules	Mon, 15 Jun 1998 11:26:09 -0400 zack
@@ -832,15 +832,6 @@
 .PHONY: check
 check: tests
 
-.PHONY: TAGS
-TAGS: $(objpfx)distinfo $(..)MakeTAGS
-	$(MAKE) $(addprefix -f ,$^) $@
-
-$(..)po/%.pot: $(objpfx)distinfo $(..)MakeTAGS FORCE
-	$(MAKE) $(addprefix -f ,$(filter-out FORCE,$^)) $@
-FORCE:
-
-
 .PHONY: echo-headers
 echo-headers:
 	@echo $(headers)
@@ -900,40 +891,30 @@
 	     /dev/null) > $@T
 	mv -f $@T $@
 
-# Make the distribution tar file.
+.PHONY: distinfo
+distinfo: $(objpfx)distinfo
 
-.PHONY: dist
-dist: $(objpfx)distinfo $(..)Make-dist
-	$(MAKE) -f $< -f $(word 2,$^) $(Make-dist-args)
-
-# Avoid depending on source files found in sysdeps dirs,
-# because the references affect implicit rule selection.
-dist: $(filter-out %.c %.S %.s,$(distribute))
-
-# We used to simply export all these variables, but that frequently made the
-# environment get too large.  Instead, we write all the information into
-# a generated makefile fragment `distinfo', and then include it with -f in
-# the sub-make that makes the distribution (above).
-$(objpfx)distinfo: Makefile $(..)Makerules \
-		   $(wildcard $(foreach dir,$(sysdirs),$(dir)/Makefile))
+$(objpfx)distinfo: Makefile $(src-generated)
 	$(make-target-directory)
-	$(distinfo-vars)
+	$(..)scripts/gen-distinfo '$(subdir)' '$(subdir-dirs)'		  \
+		'$(sort $(routines:=.c) $(aux:=.c) $(others:=.c)	  \
+		   $(foreach l, $(extra-libs), $($l-routines:=.c) $l.map) \
+		   $(distribute) $(headers) $(test-srcs:=.c) $(tests:=.c) \
+		   $(tests-static:=.c) $(tests:=.input) $(tests:=.args))' \
+		> $@.new
 	mv -f $@.new $@
-.PHONY: subdir_distinfo
-subdir_distinfo: $(objpfx)distinfo
 
-define distinfo-vars
-rm -f $@.new
-echo > $@.new 'subdir := $(subdir)'
-$(foreach var,subdir-dirs sources elided-routines sysdep_routines \
-	      headers sysdep_headers distribute dont_distribute generated \
-	      others tests test-srcs extra-libs $(extra-libs:%=%-routines) \
-	      tests-static $(extra-libs:%=%-map) versioned \
-	      $(addprefix install-,lib lib.so data bin sbin others),
-echo >> $@.new '$(subdir)-$(var) := $($(var))'
-echo >> $@.new '$(var) = $$($(subdir)-$(var))')
-endef
-
+# Tag tables.
+tag-these = $(sort $(shell grep '\.c$$' $<)) $(sort $(shell grep '\.h$$' $<))
+ifdef subdir
+TAGS: $(objpfx)distinfo $(common-objpfx)empty.c
+	cd $(..) && $(ETAGS) -o $(subdir)/$@ $(tag-these) $(common-objpfx)empty.c
+else
+TAGS: $(objpfx)distinfo subdir_TAGS $(common-objpfx)empty.c
+	$(ETAGS) -o $@ $(tag-these) $(common-objpfx)empty.c $(all-subdirs:%=-i %/TAGS)
+endif
+
+# zw: is this still used?
 ifneq (,$(strip $(gpl2lgpl)))
 ifneq (,$(wildcard $(..)gpl2lgpl.sed))
 # Snarf from the master source and frob the copying notice.
============================================================
Index: config.make.in
--- config.make.in	Sun, 14 Jun 1998 10:20:45 -0400 zack 
+++ config.make.in	Mon, 15 Jun 1998 11:22:07 -0400 zack
@@ -84,6 +84,10 @@
 AS = $(CC) -c
 MIG = @MIG@
 
+TAR = @TAR@
+have_tar_--name-prefix = @have_tar_nameprefix@
+XGETTEXT = @XGETTEXT@
+
 # Installation tools.
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
============================================================
Index: configure.in
--- configure.in	Sun, 14 Jun 1998 10:20:45 -0400 zack 
+++ configure.in	Mon, 15 Jun 1998 11:21:46 -0400 zack
@@ -508,6 +508,10 @@
 *** some features will be disabled.
 *** Check the INSTALL file for required versions.])
 
+if test "$MSGFMT" != ":"; then
+  AC_CHECK_PROG(XGETTEXT, xgettext, xgettext, :)
+fi
+
 AC_PROG_CC_LOCAL
 AC_CANONICAL_BUILD
 if test $host != $build; then
@@ -604,6 +608,23 @@
 AC_PROG_AWK
 AC_PATH_PROGS(PERL, perl, no)
 AC_SUBST(PERL)
+
+AC_CHECK_PROGS(TAR, tar gtar)
+if test -n "$TAR"; then
+  AC_CACHE_CHECK(whether $TAR supports --name-prefix,
+  libc_cv_prog_tar_nameprefix, [dnl
+    cp /dev/null conftest
+    if $TAR -c --name-prefix foo conftest >/dev/null 2>&1; then
+      libc_cv_prog_tar_nameprefix=yes
+    else
+      libc_cv_prog_tar_nameprefix=no
+    fi
+    rm -f conftest])
+  have_tar_nameprefix=libc_cv_prog_tar_nameprefix 
+else
+  have_tar_nameprefix=no
+fi
+AC_SUBST(have_tar_nameprefix)
 
 AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl
 echo '#include <stddef.h>
============================================================
Index: mach/Machrules
--- mach/Machrules	Sat, 30 May 1998 16:12:00 -0400 zack 
+++ mach/Machrules	Sun, 14 Jun 1998 22:12:15 -0400 zack
@@ -104,6 +104,7 @@
 echo '#include <$(firstword $($*.defs) $*.defs)>'
 endef
 
+ifndef no_deps
 # Not an implicit rule so the stamps are never removed as intermediates!
 $(patsubst %,$(objpfx)%.ustamp,$(user-interfaces)): $(objpfx)%.ustamp:
 	rm -f $@
@@ -128,6 +129,7 @@
 			  $(@:.udeps=_server.c) $(@:.udeps=_server.h):,' \
 	    $(sed-remove-objpfx) > $@.new
 	mv -f $@.new $@
+endif
 
 # Look for the server stub files where they will be written.
 vpath %_server.c $(addprefix $(objpfx),$(sort $(dir $(server-interfaces))))
============================================================
Index: manual/Makefile
--- manual/Makefile	Sun, 14 Jun 1998 10:20:45 -0400 zack 
+++ manual/Makefile	Mon, 15 Jun 1998 12:21:38 -0400 zack
@@ -41,31 +41,12 @@
 info: libc.info dir-add.info
 endif
 
-# Set chapters and chapters-incl[12].
 -include chapters
-chapters: libc.texinfo
-	$(find-includes)
-ifdef chapters
-# @includes in chapter files
--include chapters-incl1
-chapters-incl1: $(chapters)
-	$(find-includes)
-chapters-incl1 := $(filter-out summary.texi,$(chapters-incl1))
-endif
-ifdef chapters-incl1
-# @includes in files included by chapter files, if any
--include chapters-incl2
-chapters-incl2: $(chapters-incl1)
-	$(find-includes)
-endif
-
-chapters-incl := $(chapters-incl1) $(chapters-incl2)
-
-define find-includes
-(echo '$(@F) :=' \\	;\
- $(AWK) '$$1 == "@include" { print $$2 " \\" }' $^) > $@.new
-mv -f $@.new $@
-endef
+chapters: libc.texinfo $(filter-out %.c.texi, $(chapters))
+	-$(AWK) -f chapters.awk $< > $@.new 2> /dev/null
+	mv -f $@.new $@
+chapters = $(filter-out %.c.texi, $(texis))
+examples = $(filter %.c.texi, $(texis))
 
 # scripts we use
 ifndef move-if-change
@@ -73,7 +54,7 @@
 endif
 mkinstalldirs = $(..)scripts/mkinstalldirs
 
-libc.dvi libc.info: $(chapters) summary.texi $(chapters-incl)
+libc.dvi libc.info: $(chapters) $(examples)
 libc.dvi: texinfo.tex
 
 %.info: %.texinfo
@@ -84,7 +65,7 @@
 
 # Generate the summary from the Texinfo source files for each chapter.
 summary.texi: stamp-summary ;
-stamp-summary: summary.awk $(chapters) $(chapters-incl)
+stamp-summary: summary.awk $(filter-out summary.texi, $(chapters))
 	$(AWK) -f $^ \
 	| sort -df +1 -2 | tr '\014' '\012' > summary-tmp
 	$(move-if-change) summary-tmp summary.texi
@@ -110,18 +91,14 @@
 	mv -f $@.new $@
 
 
-minimal-dist = summary.awk libc.texinfo $(chapters)			\
-	       $(patsubst %.c.texi,examples/%.c,			\
-			  $(filter-out summary.texi,$(chapters-incl)))
+minimal-dist  = summary.awk libc.texinfo $(examples:%.c.texi=examples/%.c) \
+		$(filter-out summary.texi, $(chapters))
 doc-only-dist = Makefile COPYING.LIB
-distribute = $(minimal-dist)	       					\
-	     $(patsubst examples/%.c,%.c.texi,$(filter examples/%.c,	\
-			$(minimal-dist)))				\
-	     libc.info* libc.?? libc.??s texinfo.tex summary.texi	\
-	     stamp-summary chapters chapters-incl1 chapters-incl2	\
+
+distribute = $(minimal-dist) $(examples) libc.info* texinfo.tex 	\
+	     summary.texi stamp-summary chapters chapters.awk		\
 	     xtract-typefun.awk dir-add.texinfo dir-add.info dir	\
 	     stdio-fp.c
-export distribute := $(distribute)
 
 tar-it = tar chovf $@ $^
 
@@ -149,7 +126,7 @@
 
 .PHONY: mostlyclean distclean realclean clean
 mostlyclean:
-	-rm -f libc.dvi libc.info* dir-add.info stubs
+	-rm -f libc.dvi libc.info* dir-add.info stubs TAGS
 	-rm -f $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
 clean: mostlyclean
 distclean: clean
@@ -157,7 +134,7 @@
 realclean: distclean
 	-rm -f chapters chapters-incl* summary.texi stamp-summary *.c.texi
 	-rm -f $(foreach index,$(indices),libc.$(index) libc.$(index)s)
-	-rm -f libc.log libc.aux libc.toc dir-add.texi
+	-rm -f libc.log libc.aux libc.toc dir-add.texinfo
 
 .PHONY: install subdir_install installdirs install-data
 install-data subdir_install: install
@@ -182,19 +159,25 @@
 installdirs:
 	$(mkinstalldirs) $(inst_infodir)
 
-.PHONY: dist
-dist: # glibc-doc-$(edition).tar.gz
-
-ifneq (,$(wildcard ../Make-dist))
-dist: ../Make-dist
-	$(MAKE) -f $< $(Make-dist-args)
-endif
+.PHONY: distinfo
+distinfo: $(objpfx)distinfo
+$(objpfx)distinfo: Makefile info
+	$(make-target-directory)
+	$(..)scripts/gen-distinfo manual '' '$(distribute)' > $@.new
+	mv -f $@.new $@
 
 ifndef ETAGS
 ETAGS = etags -T
 endif
-TAGS: $(minimal-dist)
-	$(ETAGS) -o $@ $^
+# This mess makes etags tag all @deftypefoo lines in the texi files.
+define tags-texi
+--language=none \
+--regex='/^@deftype\(fnx?\|vrx?\) +\([^ ]+\|{[^}]+}\) +\([^ ]+\|{[^}]+}\) +\([a-zA-Z0-9_]+\)/\4/' \
+--regex='/^@deftype\(funx?\|varx?\) +\([^ ]+\|{[^}]+}\) +\([a-zA-Z0-9_]+\)/\3/'
+endef
+
+TAGS: $(filter %.texi, $(minimal-dist))
+	$(ETAGS) -o $@ $(tags-texi) $^
 
 # The parent makefile sometimes invokes us with targets `subdir_REAL-TARGET'.
 subdir_%: % ;
@@ -218,7 +201,7 @@
 .PHONY: stubs
 stubs: $(objpfx)stubs
 endif
-$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%:
+$(objpfx)stubs $(objpfx)stamp%:
 	$(make-target-directory)
 	touch $@
 
@@ -228,6 +211,10 @@
 $(addprefix $(mkinstalldirs) ,\
 	    $(filter-out $(wildcard $(@D:%/=%)),$(@D:%/=%)))
 endef
+
+# This is needed by the doc-dist.
+COPYING.LIB: lgpl.texinfo
+	$(MAKEINFO) --no-validate --no-headers --no-warn $< -o $@
 
 # The top-level glibc Makefile expects subdir_install to update the stubs file.
 subdir_install: stubs
============================================================
Index: sysdeps/alpha/Dist
--- sysdeps/alpha/Dist	Sat, 09 May 1998 13:36:13 -0400 zack 
+++ sysdeps/alpha/Dist	Sun, 14 Jun 1998 21:54:49 -0400 zack
@@ -1,5 +1,8 @@
 divrem.h
-divl.S divq.S reml.S remq.S
+divl.S
+divq.S
+reml.S
+remq.S
 _mcount.S
 stxcpy.S
 stxncpy.S
============================================================
Index: sysdeps/generic/Dist
--- sysdeps/generic/Dist	Sat, 09 May 1998 13:36:13 -0400 zack 
+++ sysdeps/generic/Dist	Mon, 15 Jun 1998 02:01:46 -0400 zack
@@ -1,5 +1,15 @@
-make_siglist.c signame.c signame.h
+make_siglist.c
+signame.c
+signame.h
 det_endian.c
 entry.h
 getresgid.c
 getresuid.c
+endutxent.c
+getutxent.c
+getutxid.c
+getutxline.c
+pututxline.c
+setutxent.c
+updwtmpx.c
+utmpxname.c
============================================================
Index: sysdeps/gnu/Makefile
--- sysdeps/gnu/Makefile	Sat, 09 May 1998 13:36:13 -0400 zack 
+++ sysdeps/gnu/Makefile	Mon, 15 Jun 1998 11:55:50 -0400 zack
@@ -29,6 +29,9 @@
 	test ! -d CVS || cvs commit -m'Regenerated from $^' $@
 endif
 
+# This file goes in the distribution.
+dist: $(..)sysdeps/gnu/errlist.c
+
 ifeq ($(subdir),login)
 sysdep_routines += setutxent getutxent endutxent getutxid getutxline \
                    pututxline utmpxname updwtmpx
============================================================
Index: sysdeps/m68k/fpu/switch/Dist
--- sysdeps/m68k/fpu/switch/Dist	Sat, 09 May 1998 13:36:13 -0400 zack 
+++ sysdeps/m68k/fpu/switch/Dist	Sun, 14 Jun 1998 21:54:49 -0400 zack
@@ -1 +1,2 @@
-68881-sw.h switch.c
+68881-sw.h
+switch.c
============================================================
Index: sysdeps/sparc/sparc32/Dist
--- sysdeps/sparc/sparc32/Dist	Sat, 09 May 1998 13:36:13 -0400 zack 
+++ sysdeps/sparc/sparc32/Dist	Sun, 14 Jun 1998 21:54:49 -0400 zack
@@ -1,3 +1,8 @@
-dotmul.S umul.S
-divrem.m4 sdiv.S udiv.S rem.S urem.S
+dotmul.S
+umul.S
+divrem.m4
+sdiv.S
+udiv.S
+rem.S
+urem.S
 alloca.S
============================================================
Index: sysdeps/sparc/sparc32/Makefile
--- sysdeps/sparc/sparc32/Makefile	Sat, 09 May 1998 13:36:13 -0400 zack 
+++ sysdeps/sparc/sparc32/Makefile	Mon, 15 Jun 1998 12:02:14 -0400 zack
@@ -37,7 +37,10 @@
 +divrem-S-rem := true
 +divrem-S-udiv := false
 +divrem-S-urem := false
-$(divrem:%=$(sysdep_dir)/sparc/sparc32/%.S): $(sysdep_dir)/sparc/sparc32/divrem.m4
+
++divrem-targets := $(divrem:%=$(sysdep_dir)/sparc/sparc32/%.S)
+
+$(+divrem-targets): $(sysdep_dir)/sparc/sparc32/divrem.m4
 	(echo "define(NAME,\`.$(+divrem-NAME)')\
 	       define(OP,\`$(+divrem-OP-$(+divrem-NAME))')\
 	       define(S,\`$(+divrem-S-$(+divrem-NAME))')\
@@ -50,4 +53,6 @@
 	test ! -d CVS || cvs commit -m'Regenerated from $<' $@
 endif
 
-sysdep-realclean := $(sysdep-realclean) $(divrem:%=sysdeps/sparc/sparc32/%.S)
+dist: $(+divrem-targets)
+
+sysdep-realclean := $(sysdep-realclean) $(+divrem-targets)
============================================================
Index: sysdeps/unix/Dist
--- sysdeps/unix/Dist	Sat, 09 May 1998 13:36:13 -0400 zack 
+++ sysdeps/unix/Dist	Sun, 14 Jun 1998 21:54:50 -0400 zack
@@ -1,5 +1,8 @@
-errnos-tmpl.c errnos.awk
-ioctls-tmpl.c ioctls.awk snarf-ioctls
+errnos-tmpl.c
+errnos.awk
+ioctls-tmpl.c
+ioctls.awk
+snarf-ioctls
 make_errlist.c
 mk-local_lim.c
 s-proto.S
============================================================
Index: sysdeps/unix/Makefile
--- sysdeps/unix/Makefile	Sat, 09 May 1998 13:36:13 -0400 zack 
+++ sysdeps/unix/Makefile	Sun, 14 Jun 1998 22:02:07 -0400 zack
@@ -270,6 +270,7 @@
 
 endif
 
+ifndef avoid-generated
 ifndef inhibit-unix-syscalls
 
 # Sysdep dirs unix/... can contain a file syscalls.list,
@@ -311,4 +312,5 @@
 common-generated += s-proto.d
 postclean-generated += sysd-syscalls
 
+endif
 endif
============================================================
Index: sysdeps/unix/sysv/irix4/Dist
--- sysdeps/unix/sysv/irix4/Dist	Sat, 09 May 1998 13:36:13 -0400 zack 
+++ sysdeps/unix/sysv/irix4/Dist	Sun, 14 Jun 1998 21:54:50 -0400 zack
@@ -1 +1,2 @@
-__handler.S sigtramp.c
+__handler.S
+sigtramp.c
============================================================
Index: sysdeps/unix/sysv/linux/Dist
--- sysdeps/unix/sysv/linux/Dist	Sat, 09 May 1998 13:36:13 -0400 zack 
+++ sysdeps/unix/sysv/linux/Dist	Mon, 15 Jun 1998 02:03:02 -0400 zack
@@ -74,3 +74,5 @@
 sys/vt.h
 xstatconv.c
 getdents64.c
+getresgid.c
+getresuid.c
============================================================
Index: manual/chapters.awk
--- /dev/null	Tue May 27 20:49:58 1997
+++ manual/chapters.awk	Sat May 30 15:54:11 1998
@@ -0,0 +1,17 @@
+BEGIN {
+    print "texis = \\"
+    input[0] = ARGV[1]
+    for (s = 0; s >= 0; s--)
+    {
+        while ((getline < input[s]) > 0)
+	{
+            if ($1 == "@include") 
+	    {
+	        input[++s] = $2
+		print $2 " \\"
+	    }
+        }
+        close(input[stackptr])
+    }
+    print ""
+}
============================================================
Index: scripts/gen-sysd-distlist
--- /dev/null	Tue May 27 20:49:58 1997
+++ scripts/gen-sysd-distlist	Mon Jun 15 01:52:58 1998
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+# SYSDIRS='$(all-sysd-dirs)' gen-sysd-distlist
+
+for dir in $SYSDIRS
+do
+    [ -f $dir/Implies	    ] && echo $dir/Implies
+    [ -f $dir/Subdirs	    ] && echo $dir/Subdirs
+    [ -f $dir/Makefile	    ] && echo $dir/Makefile
+    [ -f $dir/configure     ] && echo $dir/configure
+    [ -f $dir/configure.in  ] && echo $dir/configure.in
+    [ -f $dir/syscalls.list ] && echo $dir/syscalls.list
+    [ -f $dir/Dist	    ] && {
+	echo $dir/Dist
+	while read file; do echo $dir/$file; done <$dir/Dist
+    }
+done
+
+exit 0
============================================================
Index: scripts/fixpatch
--- /dev/null	Tue May 27 20:49:58 1997
+++ scripts/fixpatch	Mon Jun 15 12:31:57 1998
@@ -0,0 +1,18 @@
+#! /usr/bin/awk -f
+
+/^Ind/ {
+  small = full = $2;
+  sub(/.*\//, "", small);
+  print "============================================================";
+}
+    
+/^===/ || /^RCS/ || /^ret/ || /^dif/ { next }
+
+/^---/ || /^\+\+\+/ {
+  sub(/\.orig/, "");
+  sub(/\([[:alnum:][:space:]\/._-]+\)/, "");
+  if(small) { sub("[[:space:]]+" small, " " full) }
+  sub(full "[[:space:]]+", full "\t");
+}
+
+{ print }
============================================================
Index: scripts/gen-distinfo
--- /dev/null	Tue May 27 20:49:58 1997
+++ scripts/gen-distinfo	Mon Jun 15 02:06:05 1998
@@ -0,0 +1,78 @@
+#! /bin/sh
+
+# SYSDIRS=$(all-sysd-dirs) gen_distinfo $(subdir) $(subdir-dirs) $(distribute)
+# (see Makerules)
+
+[ -n "$1" ] && { subdir=$1/; dd=../; }
+
+subdir_dirs="$2"
+list="$3"
+
+csysd=
+hsysd=
+for f in $list
+do
+    case $f in
+    ../../*)
+	echo "gen-distinfo: ${subdir-TOP}: File outside source tree: $f" >&2
+	exit 1;;
+    ../*)
+	if [ -z "$dd" ]; then
+	    echo "gen-distinfo: TOP: File outside source tree: $f" >&2
+	    exit 1
+	fi
+	[ -f $f ] && echo "${f#../}";;
+    *.c)
+    # If it's in . or subdir_dirs it's not system dependent.
+    if [ -f $f ]; then
+	echo "$subdir$f"
+    else
+	found=
+	for d in $subdir_dirs
+	do
+	    if [ -f $d/$f ]; then
+		echo "$subdir$d/$f"
+		found=t
+	    fi
+	done
+	[ -n "$found" ] || csysd="$csysd $f"
+    fi;;
+    *.h|*.def)
+	if [ -f $f ]; then
+	    echo "$subdir$f"
+	else
+	    found=
+	    for d in $subdir_dirs
+	    do
+		if [ -f $d/$f ]; then
+		    echo "$l$subdir$d/$f"
+		    found=t
+		fi
+	    done
+	    [ -n "$found" ] || hsysd="$hsysd $f"
+	fi
+	[ -f ${dd}include/$f ] && echo "include/$f";;
+    *)
+	# Might be a glob.
+	for ff in $f; do
+	    [ -f $ff ] && echo "$subdir$ff"
+	done;;
+    esac
+done
+
+for s in $SYSDIRS; do
+    for f in $csysd; do
+	if   [ -f $s/$f ];        then echo "${s#$dd}/$f"
+	elif [ -f $s/${f%.c}.S ]; then echo "${s#$dd}/${f%.c}.S"
+	elif [ -f $s/${f%.c}.s ]; then echo "${s#$dd}/${f%.c}.s"
+	fi
+    done
+    for f in $hsysd; do
+	[ -f $s/$f ] && echo "${s#$dd}/$f"
+    done
+done
+
+# Always distribute subdir/Makefile.
+[ -f Makefile ] && echo ${subdir}Makefile
+
+exit 0
============================================================
Index: scripts/tarprefix.c
--- /dev/null	Tue May 27 20:49:58 1997
+++ scripts/tarprefix.c	Mon Jun 15 12:45:08 1998
@@ -0,0 +1,165 @@
+/* tarprefix.c
+   Copy the tarfile on stdin to stdout, prepending all filenames
+   with the single argument. */
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+
+/* Tarfile info */
+#define MAGIC "ustar  "
+#define MOFF  257
+#define NOFF 0
+#define NLEN 100
+#define CKOFF 148
+#define CKLEN 6
+#define CKLENS "6"
+#define POFF 345
+#define PLEN 155
+#define SOFF 124
+#define SLEN 12
+
+#define min(x,y) (((x) < (y)) ? (x) : (y))
+
+void readblock (char *b, int s);
+void writeblock (char *b, int s);
+
+int
+main (int argc, char **argv)
+{
+  char buffer[32 * 1024];
+  int size, len, i, sum;
+
+  if (argc != 2)
+    {
+      fputs ("tarprefix: usage: tarprefix PREFIX\n", stderr);
+      exit (2);
+    }
+
+  len = strlen (argv[1]);
+
+  for (;;)
+    {
+      readblock (buffer, 512);
+
+      if (strncmp (MAGIC, &buffer[MOFF], sizeof MAGIC))
+	{
+	  for (i = 0; i < 512; i++)
+	    {
+	      if (buffer[i])
+		{
+		  fputs ("tarprefix: corrupted archive\n", stderr);
+		  exit (1);
+		}
+
+	    }
+	  writeblock (buffer, 512);
+	  break;
+	}
+
+      if (buffer[NOFF + NLEN - 1 - len] != '\0')
+	{
+	  if (buffer[POFF + PLEN - 1 - len] != '\0')
+	    {
+	      fputs ("tarprefix: name too long\n", stderr);
+	      exit (1);
+	    }
+	  memmove (&buffer[POFF + len], &buffer[POFF], PLEN - len);
+	  memcpy (&buffer[POFF], argv[1], len);
+	}
+      else
+	{
+	  memmove (&buffer[NOFF + len], &buffer[NOFF], NLEN - len);
+	  memcpy (&buffer[NOFF], argv[1], len);
+	}
+      size = strtol (&buffer[SOFF], NULL, 8);
+      if (size % 512)
+	{
+	  size -= size % 512;
+	  size += 512;
+	}
+
+      sum = 0;
+      for (i = 0; i < 512; i++)
+	sum += (CKOFF <= i && i <= CKOFF + CKLEN) ? ' ' : buffer[i];
+      sprintf (&buffer[CKOFF], "%" CKLENS "o", sum);
+
+      writeblock (buffer, 512);
+
+      while (size > 0)
+	{
+	  readblock (buffer, min (size, 32 * 1024));
+	  writeblock (buffer, min (size, 32 * 1024));
+	  size -= 32 * 1024;
+	}
+
+    }
+
+  readblock (buffer, 512);
+  writeblock (buffer, 512);
+  return 0;
+}
+
+void
+readblock (char *b, int s)
+{
+  int r, c = 0;
+
+  do
+    {
+      r = read (0, b, s);
+      if (r == -1)
+	{
+	  fprintf (stderr, "tarprefix: read: %s\n", strerror (errno));
+	  exit (1);
+	}
+      else if (r == 0)
+	{
+	  if (c++)
+	    {
+	      fprintf (stderr, "tarprefix: archive truncated\n");
+	      exit (1);
+	    }
+	}
+      else
+	c = 0;
+
+      s -= r;
+      b += r;
+    }
+  while (s > 0);
+}
+
+void
+writeblock (char *b, int s)
+{
+  int r, c = 0;
+
+  do
+    {
+      r = write (1, b, s);
+      if (r == -1)
+	{
+	  fprintf (stderr, "tarprefix: write: %s\n", strerror (errno));
+	  exit (1);
+	}
+      else if (r == 0)
+	{
+	  if (c++)
+	    {
+	      fputs ("tarprefix: unexpected EOF writing\n", stderr);
+	      exit (1);
+	    }
+	}
+      else
+	c = 0;
+
+      s -= r;
+      b += r;
+    }
+  while (s > 0);
+}
============================================================
Index: Make-dist
--- Make-dist	Sat May 30 16:12:00 1998
+++ /dev/null	Tue May 27 20:49:58 1997
@@ -1,248 +0,0 @@
-# Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# 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., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-dist:
-
-# Make the value empty so ifdef fails if it's $(-subdir).
-subdir := $(subdir)
-ifdef subdir
-.. := ../
-else
-.. :=
-endif
-
-include $(..)Makeconfig
-
-foo:=$(shell echo 'distribute=$(distribute)'>&2)
-foo:=$(shell echo 'dont_distribute=$(dont_distribute)'>&2)
-foo:=$(shell echo 'foobar=$(filter %.c %.S %.s %.h,$(distribute))'>&2)
-
-ifndef sysdep_dirs
-# Find all sysdep directories.
-export sysdep_dirs := $(shell find $(..)sysdeps -type d ! -name bits \
-				   ! -name CVS ! -name RCS -print)
-else
-# Defined by the parent.
-sysdep_dirs := $(addprefix $(..),$(sysdep_dirs))
-endif
-
-# Don't distribute add-on subdirs.
-subdirs := $(filter-out $(add-ons),$(subdirs))
-
-# Make sure both stdio and libio get in, whichever is in use.
-subdirs += stdio libio
-
-# Make sure both aout and elf get in, whichever is in use.
-subdirs += aout elf
-
-sysdep-Subdir-files := $(wildcard $(addsuffix /Subdirs,$(sysdep_dirs)))
-ifdef sysdep-Subdir-files
-subdirs := $(sort $(subdirs) \
-		  $(shell sed -e 's/\#.*$$//' $(sysdep-Subdir-files)))
-endif
-
-
-# Makefiles can define `source_dirs' to list nonstandard directories
-# where source files might be found.
-
-ifdef	subdir
-all-headers = $(filter-out $(sysdep_headers),$(headers))
-else
-+distinfo := $(shell MAKEFLAGS= MFLAGS= $(MAKE) -s no_deps=t \
-		     inhibit_interface_rules=t inhibit_mach_syscalls=t \
-		     subdirs='$(subdirs)' echo-distinfo | grep -v '^make')
-foo:=$(shell echo>&2 '+distinfo=$(+distinfo)')
-all-headers := $(patsubst +header+%,%,$(filter +header+%,$(+distinfo)))
-# Ignore subdir headers without top-level indirections.
-all-headers := $(sort $(headers) \
-		      $(patsubst include/%,%,\
-				 $(wildcard $(addprefix include/,\
-							$(all-headers)))))
-# Filter out names like ../conf/portability.h that would point outside
-# the source directory.
-all-headers := $(filter-out ../%,$(all-headers))
-+subdir-nodist := $(patsubst +nodist+%,%,$(filter +nodist+%,$(+distinfo)))
-+subdir-headers := $(filter-out $(headers),$(all-headers))
-endif
-foo:=$(shell echo 'IS THIS WORKING??? all-headers=$(all-headers)' >&2)
-
-sources += $(addsuffix .c,$(elided-routines) \
-		          $(foreach l,$(extra-libs),$($l-routines)))
-
-# Find all sysdep sources and headers.
-+maybe-sysdeps := $(sources) $(sources:.c=.s) $(sources:.c=.S) $(all-headers) \
-		  $(filter %.c %.S %.s %.h %.sub,$(distribute))
-foo:=$(shell echo '+maybe-sysdeps=$(+maybe-sysdeps)'>&2)
-# Find all the files that have a generic version.
-try-sysdeps := $(foreach dir,$(..)sysdeps/generic $(..)sysdeps/libm-ieee754,\
-			     $(addprefix $(dir)/,$(+maybe-sysdeps)))
-foo:=$(shell echo 'try-sysdeps=$(try-sysdeps)'>&2)
-+sysdeps := $(wildcard $(try-sysdeps))
-foo:=$(shell echo 'generic +sysdeps=$(+sysdeps)'>&2)
-+sysdep-names := $(sort $(patsubst $(..)sysdeps/generic/%,%,\
-				   $(patsubst $(..)sysdeps/libm-ieee754/%,%,\
-					      $(+sysdeps))))
-foo:=$(shell echo '+sysdep-names=$(+sysdep-names)' >&2)
-
-ifdef subdir-dirs
-vpath % $(subdir-dirs)
-endif
-
-# Now find all the sysdep versions of those files.
-+sysdeps := $(foreach dir,$(sysdep_dirs) $(source_dirs),\
-		      $(wildcard $(addprefix $(dir)/, \
-					     $(+sysdep-names) \
-					     $(+sysdep-names:.c=.s) \
-					     $(+sysdep-names:.c=.S) \
-				  )))
-
-
-# Source and header files to go in the distribution tar file.
-
-.S.s := $(wildcard $(sources:.c=.S) $(sources:.c=.s))
-sources := $(filter-out $(addsuffix .c,$(basename $(.S.s))),$(sources)) $(.S.s)
-
-+out := $(patsubst %.S,%.c,$(+sysdep-names:.s=.c)) \
-	$(addsuffix .c,$(sysdep_routines)) \
-	$(+subdir-nodist) $(dont_distribute)
-foo:=$(shell echo '+out=$(+out)' >&2; echo foofoo >&2)
-+tsrcs	:= $(filter-out $(+out), $(sources) $(all-headers) $(distribute)) \
-	   $(foreach l,$(extra-libs),$($l-map)) \
-	   $(wildcard $(addsuffix .map,$(extra-libs))) $(+sysdeps)
-foo:=$(shell echo 'made +tsrcs=$(+tsrcs)'>&2)
-foo:=$(shell echo generated='$(generated)' >&2)
-#generated := $(sort $(generated) $(generated:.S=.c) $(generated:.s=.c))
-#foo:=$(shell echo now generated='$(generated)' >&2)
-+tsrcs := $(sort $(filter-out $(generated),$(+tsrcs)))
-foo:=$(shell echo '+tsrcs=$(+tsrcs)'>&2)
-foo:=$(shell echo foobie, dammit! >&2)
-
-ifndef tardir
-export tardir := glibc-$(version)
-endif
-
-$(..)glibc-$(version):
-	ln -s . $@
-
-#+tsrcs := $(+tsrcs) \
-#	  TAGS
-.PHONY: TAGS
-TAGS: $(..)MakeTAGS
-	$(MAKE) -f $< $@ -o subdir_TAGS
-
-ifdef	   subdir
-
-foo:=$(shell echo subdir foo >&2)
-
-+tsrcs := Makefile $(+tsrcs) \
-	  $(addsuffix .c,$(others) $(tests) $(tests-static) $(test-srcs)) \
-	  $(wildcard $(addsuffix .input,$(tests) (tests-static) $(test-srcs)) \
-	  $(addsuffix .args,$(tests) $(tests-static) $(test-srcs)))
-+tardeps := $(strip $(+tsrcs))
-
-verbose = v
-
-.PHONY: dist
-dist: $(..)$(tardir) $(+tardeps)
-	@cd ..; if test -f dist.tar; then c=u; else c=c; fi;	\
-	$(+cmdecho) "cd ..; tar $${c}h$(verbose)f dist.tar ...";	\
-	tar $${c}h$(verbose)f dist.tar \
-	    $(addprefix $(tardir)/$(subdir)/,$(filter-out $<,$^))
-
-else	# Parent makefile.
-
-# Find what other things sysdep directories want to distribute.
-
-foo:=$(shell echo parent foobie>&2)
-+sysdep-distfiles := $(wildcard $(addsuffix /Dist,$(sysdep_dirs)))
-foo:=$(shell echo +sysdep-distfiles='$(+sysdep-distfiles)'>&2)
-+sysdep-dist := $(foreach file,$(+sysdep-distfiles),\
-			  $(addprefix $(dir $(file)), \
-				      $(shell sed -e 's/\#.*$$//' $(file)))) \
-		$(+sysdep-distfiles) \
-		$(sysdep-Subdir-files)
-foo:=$(shell echo '+sysdep-dist=$(+sysdep-dist)' >&2)
-
-+sysdep-tsrcs := $(wildcard $(foreach file,Makefile Implies syscalls.list\
-				           configure configure.in,\
-				      $(addsuffix /$(file),$(sysdep_dirs)))) \
-		 $(+sysdep-dist)
-
-+tsrcs := $(+tsrcs) $(+sysdep-tsrcs)
-
-ifeq ($(with-cvs),yes)
-define autoconf-it
-autoconf $(ACFLAGS) $< > $@.new
-mv -f $@.new $@
-test ! -d CVS || cvs $(CVSOPTS) commit -m'Regenerated: autoconf $(ACFLAGS) $<' $@
-endef
-else
-define autoconf-it
-autoconf $(ACFLAGS) $< > $@.new
-mv -f $@.new $@
-endef
-endif
-
-configure: configure.in aclocal.m4; $(autoconf-it)
-%/configure: %/configure.in aclocal.m4; $(autoconf-it)
-
-dist: $(tardir).tar.gz
-
-subdir_dist: dist.tar
-dist.tar: README $(tardir) $(+tsrcs)
-	tar chvf $@ $(addprefix $(tardir)/,$(filter-out $(tardir),$^))
-
-$(tardir).tar: dist.tar subdir_dist
-	@echo Files listed here have names exceeding 14 chars.
-	tar xfv $< -C $${TMPDIR-/tmp} | sed -n '/[^/]\{15,\}/p'
-	tar covf $@ -C $${TMPDIR-/tmp} $(tardir)
-	-rm -fr $${TMPDIR-/tmp}/$(tardir) dist.tar &
-
-%.Z: %
-	compress -c $< > $@
-
-%.gz: %
-	gzip -9 -v -c $< > $@
-
-foo:=$(shell echo subdirs=$(subdirs) >&2)
-dist-subdirs := $(addprefix dist-,$(subdirs)) # dist-manual
-.PHONY: subdir_dist $(dist-subdirs)
-subdir_dist: $(dist-subdirs)
-$(dist-subdirs):
-	$(MAKE) -C $(patsubst dist-%,%,$@) dist
-
-# This is here instead of in Makefile so it can use $(release) and $(version).
-README: README.template version.h
-	-rm -f $@
-	sed -e 's/RELEASE/$(release)/' -e 's/VERSION/$(version)/' < $< > $@
-# Make it unwritable so I won't change it by mistake.
-	chmod 444 $@
-ifeq ($(with-cvs),yes)
-	test ! -d CVS || cvs $(CVSOPTS) commit -m'Remade for $(release)-$(version)' $@
-endif
-
-
-endif	# Subdirectory vs. parent makefile
-
-# Get these things out of the environment because they take up lots of space.
-unexport distribute generated
-
-# Fnord.
-export inhibit_mach_syscalls=t
-export no_deps=t
-export inhibit_interface_rules=t
============================================================
Index: MakeTAGS
--- MakeTAGS	Thu May 14 23:51:13 1998
+++ /dev/null	Tue May 27 20:49:58 1997
@@ -1,183 +0,0 @@
-# Make the TAGS files.
-
-# Copyright (C) 1992, 1994, 1995, 1996, 1998 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public License
-# as published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# 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., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# Make this the default goal.
-TAGS:
-
-ifdef subdir
-.. := ../
-endif
-
-include $(..)Makeconfig
-
-ifndef tags_sources
-ifeq ($(subdir),ctype)
-# In most cases, we want the C source files to come before
-# the header files so tags for optimizing #define's in the
-# headers won't be put in the tags files, but for ctype,
-# the functions are just backup for the #define's in the header.
-tags_sources = $(all-headers) $(all-sources) $(all-dist)
-else	# Not ctype.
-tags_sources = $(all-sources) $(all-headers) $(all-dist)
-endif	# ctype
-endif	# No tags_sources
-
-sysdep-dirs := $(full-config-sysdirs)
-
-ifndef sysdep_dirs
-# Find all sysdep directories.
-sysdep_dirs := $(shell find $(..)sysdeps \
-			    $(wildcard \
-				$(patsubst %,$(..)%/sysdeps,$(add-ons))) \
-			    -type d ! -name RCS ! -name CVS -print)
-endif
-
-# Find all sysdep dirs there are, but putting the ones
-# we are configured to use first and preserving their order.
-all-dirs := $(subdir-dirs) \
-	    $(objdir) \
-	    $(sysdep-dirs) \
-	    $(source_dirs) \
-	    $(filter-out $(sysdep-dirs),$(sysdep_dirs))
-
-# Find all the subdirs there are, but putting the ones
-# we are configured to use first and preserving their order.
-ifndef subdir
-subdirs := $(subdirs) \
-	   $(filter-out $(subdirs),\
-			$(shell sed -e 's/\#.*$$//' \
-				    $(wildcard $(addsuffix /Subdirs,\
-							   $(all-dirs)))\
-				    /dev/null))
-all-dist = $(foreach Dist,$(wildcard $(all-dirs:%=%/Dist)),\
-		     $(addprefix $(Dist:%/Dist=%)/,\
-				 $(filter %.c %.h %.S %.s,\
-					  $(shell cat $(Dist)))))
-tags_sources = $(all-sources) $(all-headers) $(all-dist)
-else
-all-dist = $(distribute)
-endif
-
-# sources and headers must be simply expanded variables
-sources := $(sources) $(filter %.c %.s %.S,$(all-dist))
-headers := $(headers) $(filter %.h,$(all-dist))
-all-dist := $(filter-out %.h %.c %.s %.S,$(all-dist))
-
-sources += $(foreach lib,$(extra-libs),$($(lib)-routines:=.c))
-
-# All different versions of $(sources), preserving the configured sysdep
-# directory order.
-# Files that are found in the current directory cannot occur in
-# sysdep directories, so don't bother searching them.
-sysdep-sources := $(filter-out $(wildcard $(sources)), $(sources))
-all-sources = $(wildcard $(sort $(sources) $(sources:.c=.S) $(sources:.c=.s)  \
-				$(others:=.c) $(tests:=.c) $(test-srcs:=.c))) \
-	      $(foreach dir,$(all-dirs),\
-			$(wildcard \
-			   $(addprefix $(dir)/,\
-				       $(sort $(sysdep-sources) \
-					      $(sysdep-sources:.c=.S) \
-					      $(sysdep-sources:.c=.s)))))
-
-sysdep-headers := $(filter-out $(wildcard $(headers)), $(headers))
-all-headers = $(wildcard $(headers)) \
-	      $(foreach dir,$(all-dirs),\
-			$(wildcard $(addprefix $(dir)/,$(sysdep-headers))))
-
-tags_sources := $(strip $(tags_sources))
-
-TAGS: $(tags_sources)
-ifdef subdir
-ifdef tags_sources
-	$(ETAGS) -o $@ $^
-else
-# No sources.  Create a dummy file.
-	touch $@
-endif # tags_sources
-else # parent
-TAGS: subdir_TAGS
-# Note that this uses the -i switch, and thus requires v19 etags.
-	$(ETAGS) -o $@ \
-		 $(subdirs:%=-i %/TAGS) \
-		 $(filter-out subdir_TAGS,$^)
-
-.PHONY: subdir_TAGS $(subdirs:%=%/TAGS)
-subdir_TAGS: $(subdirs:%=%/TAGS)
-$(subdirs:%=%/TAGS):
-	$(MAKE) -C $(@D) no_deps=t $(@F)
-
-endif # subdir
-
-ifndef XGETTEXT
-XGETTEXT = xgettext
-endif
-
-P = $(..)po
-
-ifdef subdir
-domain = $(subdir)
-else
-domain = libc-top
-endif
-
-define extract
-@rm -f $@.new
-$(XGETTEXT) --keyword=_ --keyword=N_ --add-comments=TRANS  --sort-output \
-	    --omit-header -n -d - $(XGETTEXTFLAGS-$(@F)) > $@.new $^
-mv -f $@.new $@
-endef
-
-text-srcs := $(filter %.c %.h %.cc %.C,$(tags_sources))
-$P/$(domain).pot: $(text-srcs)
-ifeq (,$(text-srcs))
-	cp /dev/null $@
-else
-	$(extract)
-endif
-
-all-pot = $P/libc-top.pot $P/subdirs.pot
-
-ifndef subdir
-# Collect all the subdir messages, massaging the file names in comments
-# to include the subdir name.
-$P/subdirs.pot: $(subdirs:%=$P/%.pot)
-	@rm -f $@.new
-	(for d in $(subdirs); \
-	 do sed "/^#:/s% % $$d/%g" $P/$$d.pot; done) > $@.new
-	mv -f $@.new $@
-
-# Combine all the messages into the final sorted template translation file.
-# The following code requires GNU date.
-$P/libc.pot: $(all-pot)
-	@rm -f $@.new
-	set `date -R`; disp="$$6"; \
-	sed -e 's/VERSION/$(version)/' \
-	    -e "s/DATE/`date +'%Y-%m-%d %H:%M'$$disp`/" \
-	    po/header.pot > $@.new
-	$(XGETTEXT) -d - --omit-header -n -s $^ >> $@.new
-	mv -f $@.new $@
-ifeq ($(with-cvs),yes)
-	test ! -d CVS || cvs $(CVSOPTS) ci -m'Regenerated from source files' $@
-endif
-
-$(subdirs:%=$P/%.pot): $P/%.pot: FORCE
-	$(MAKE) -C $* no_deps=t ../$@
-FORCE:
-endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]