about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--Make-dist2
-rw-r--r--Makeconfig28
-rw-r--r--nscd/Depend1
-rw-r--r--nss/Depend1
-rw-r--r--rt/Depend1
-rwxr-xr-xscripts/gen-sorted.awk52
7 files changed, 95 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a394fd9001..7f76f69b24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+1998-11-19  Ulrich Drepper  <drepper@cygnus.com>
+
+	* Makeconfig: Add comment to all-subdirs definition.
+	Add rule to generate sysd-sorted.  Include this file and and set
+	subdirs value to $(sorted-subdirs).
+	* scripts/gen-sorted.awk: New file.
+	* Make-dist (+tsrcs): Add Depend.
+	* nscd/Depend: New file.
+	* nss/Depend: New file.
+	* rt/Depend: New file.
+
 1998-11-18  Ulrich Drepper  <drepper@cygnus.com>
 
 	* sysdeps/unix/bsd/poll.c (__poll): Add code to extend sets if any
@@ -15,6 +26,9 @@
 
 	* io/Makefile (CFLAGS-ftw.c): Removed.
 
+	* manual/errno.texi> Change the short text for ENODEV to
+	"No such device".
+
 1998-11-18  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
 
 	* io/Makefile (tests): Make sure that the test program has an
diff --git a/Make-dist b/Make-dist
index 576887468e..c1ae46a6cc 100644
--- a/Make-dist
+++ b/Make-dist
@@ -147,7 +147,7 @@ ifdef	   subdir
 
 foo:=$(shell echo subdir foo >&2)
 
-+tsrcs := Makefile $(wildcard Versions) $(+tsrcs) \
++tsrcs := Makefile $(wildcard Versions) $(wildcard Depend) $(+tsrcs) \
 	  $(addsuffix .c,$(others) $(tests) $(tests-static) $(test-srcs)) \
 	  $(wildcard $(addsuffix .input,$(tests) (tests-static) $(test-srcs)) \
 	  $(addsuffix .args,$(tests) $(tests-static) $(test-srcs)))
diff --git a/Makeconfig b/Makeconfig
index 8e5129f2fb..99389276f9 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -750,7 +750,10 @@ sysdep-subdirs := $(subst $(\n), ,$(sysdep-subdirs))
 sysdep-inhibit-subdirs := $(subst $(\n), ,$(sysdep-inhibit-subdirs))
 endif
 
-# These are the subdirectories containing the library source.
+# These are the subdirectories containing the library source.  The order
+# is more or less arbitrary.  The sorting step will take care of the
+# dependencies.  Only the $(binfmt-subdir) should always be kept at the
+# end of the list.
 all-subdirs = csu assert ctype db 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    \
@@ -758,7 +761,9 @@ all-subdirs = csu assert ctype db db2 locale intl catgets math setjmp signal\
 	      $(add-ons) nss localedata timezone rt debug $(sysdep-subdirs) \
 	      $(binfmt-subdir)
 all-subdirs := $(filter-out $(sysdep-inhibit-subdirs),$(all-subdirs))
-subdirs = $(all-subdirs)
+
+-include $(common-objpfx)sysd-sorted
+subdirs = $(sorted-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
@@ -775,10 +780,27 @@ $(common-objpfx)sysd-dirs: $(common-objpfx)config.make $(all-Subdirs-files)
 	 sed 's/[#-].*$$//' $(all-Subdirs-files) /dev/null;		\
 	 echo endef;							\
 	 echo define sysdep-inhibit-subdirs;				\
-	 sed '/-.*$$/!d;s/^-//' $(all-Subdirs-files) /dev/null;	\
+	 sed '/-.*$$/!d;s/^-//' $(all-Subdirs-files) /dev/null;		\
 	 echo endef;							\
 	 echo 'sysd-dirs-done = t';					\
 	) > $@-tmp
 	mv -f $@-tmp $@
 
+all-Depend-files = $(wildcard $(..)*/Depend)
+$(common-objpfx)sysd-sorted: $(..)scripts/gen-sorted.awk $(all-Depend-files) \
+			     $(common-objpfx)sysd-dirs $(..)Makeconfig
+	(if test "$(all-Depend-files)"; then				\
+	   for f in $(all-Depend-files); do				\
+	     dir=$${f%%/*};						\
+	     while read on; do						\
+	       echo "depend $$dir $$on";				\
+	     done < $$f;						\
+	   done;							\
+	 fi;								\
+	 for f in $(all-subdirs); do					\
+	   echo $$f;							\
+	 done								\
+	) | $(AWK) -f $(..)scripts/gen-sorted.awk > $@-tmp
+	mv -f $@-tmp $@
+
 endif # Makeconfig not yet included
diff --git a/nscd/Depend b/nscd/Depend
new file mode 100644
index 0000000000..fe673ba5ec
--- /dev/null
+++ b/nscd/Depend
@@ -0,0 +1 @@
+linuxthreads
diff --git a/nss/Depend b/nss/Depend
new file mode 100644
index 0000000000..4921fe6c85
--- /dev/null
+++ b/nss/Depend
@@ -0,0 +1 @@
+db2
diff --git a/rt/Depend b/rt/Depend
new file mode 100644
index 0000000000..fe673ba5ec
--- /dev/null
+++ b/rt/Depend
@@ -0,0 +1 @@
+linuxthreads
diff --git a/scripts/gen-sorted.awk b/scripts/gen-sorted.awk
new file mode 100755
index 0000000000..a943df6d2f
--- /dev/null
+++ b/scripts/gen-sorted.awk
@@ -0,0 +1,52 @@
+#! /usr/bin/awk -f
+# Generate sorted list of directories.  The sorting is stable but with
+# dependencies between directories resolved by moving dependees in front.
+# (C) Copyright 1998 Free Software Foundation, Inc.
+# Written by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+BEGIN {
+  cnt = 0
+  dnt = 0
+}
+{
+  if ($1 ~ /depend/) {
+    from[dnt] = $2
+    to[dnt] = $3
+    ++dnt
+  } else {
+    all[cnt++] = $1
+  }
+}
+END {
+  do {
+    moved = 0
+    for (i = 0; i < dnt; ++i) {
+      for (j = 0; j < cnt; ++j) {
+	if (all[j] == from[i]) {
+	  for (k = j + 1; k < cnt; ++k) {
+	    if (all[k] == to[i]) {
+	      break;
+	    }
+	  }
+	  if (k < cnt) {
+	    for (l = k - 1; l >= j; --l) {
+	      all[l + 1] = all[l]
+	    }
+	    all[j] = to[i]
+	    break;
+	  }
+	}
+      }
+      if (j < cnt) {
+	moved = 1
+	break
+      }
+    }
+  } while (moved)
+
+  printf "sorted-subdirs = "
+  for (i = 0; i < cnt; ++i) {
+    printf "%s ", all[i];
+  }
+  printf "\n"
+}