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]

small change, groundwork for larger one



I'm planning to redo the makefiles so the top level rules and the subdir
rules are disjoint.  This will make them much simpler and less incestuous. 
It can only be done if there is no compilation at top level, so this patch
moves all the code that used to be built at top level into the gnulib
directory (which isn't being used for anything in particular right now). 

Tested to complete make and make check with no errors.

zw

Sun May  3 15:58:48 1998  Zack Weinberg  <zack@rabi.phys.columbia.edu>

	* interp.c: Moved to gnulib.
	* munch-tmpl.c: Likewise.
	* munch.awk: Likewise.
	* set-init.c: Likewise.
	* version.c: Likewise.

	* gnulib/Makefile: Build libc-init, sysdep, version
	as libc modules.  Build interp.os.  Generate version-info.h.

	* Makefile (aux): Deleted.
	(before-compile): Deleted.
	(libc-init): Deleted.
	(version-info.h): Deleted.
	(distribute): Take out munch-tmpl.c, munch.awk, and interp.c.

	* Makerules (interp-obj): Look for it in gnulib.  Delete rule.

Index: Makefile
===================================================================
RCS file: /egcs/carton/cvsfiles/libc/Makefile,v
retrieving revision 1.161
diff -u -r1.161 Makefile
--- Makefile	1998/05/01 21:58:11	1.161
+++ Makefile	1998/05/03 19:57:02
@@ -94,8 +94,6 @@
 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
-aux	 = sysdep $(libc-init) version
-before-compile += $(objpfx)version-info.h
 
 echo-headers: subdir_echo-headers
 
@@ -111,17 +109,6 @@
 install-others += $(inst_includedir)/gnu/lib-names.h
 endif
 
-ifeq (yes,$(gnu-ld))
-libc-init = set-init
-else
-libc-init = munch-init
-$(objpfx)munch-init.c: munch.awk munch-tmpl.c $(+subdir_inits)
-	$(AWK) -f $< subdirs='$(+init_subdirs)' $(word 2,$^) > $@-t
-	mv -f $@-t $@
-generated := $(generated) munch-init.c
-endif
-
-
 include Makerules
 
 # Install from subdirectories too.
@@ -166,35 +153,6 @@
 	 echo endef) > $@-tmp
 	mv -f $@-tmp $@
 
-all-Banner-files = $(wildcard $(addsuffix /Banner, $(subdirs)))
-$(objpfx)version-info.h: $(+sysdir_pfx)config.make $(all-Banner-files)
-	(case $(config-os) in \
-	   linux*) version=`(echo -e "#include <linux/version.h>\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<</' \
-				< /proc/version`; \
-		     else \
-		       version=`uname -r`; \
-		     fi; \
-		   fi; \
-		   echo -n "\"Compiled on a Linux $$version system "; \
-		   echo "on `date +%Y-%m-%d`.\\n\"" ;; \
-	   *) ;; \
-	 esac; \
-	 files="$(all-Banner-files)";				\
-	 if test -n "$$files"; then				\
-	   echo "\"Available extensions:";			\
-	   sed -e '/^#/d' -e 's/^[[:space:]]*/	/' $$files;	\
-	   echo "\"";						\
-	 fi) > $@T
-	mv -f $@T $@
-
-version.c-objects := $(addprefix $(objpfx)version,$(object-suffixes))
-$(version.c-objects): $(objpfx)version-info.h
-
 # Makerules creates a file `stubs' in each subdirectory, which
 # contains `#define __stub_FUNCTION' for each function defined in that
 # directory which is a stub.
@@ -318,18 +276,17 @@
 distribute  := README README.libm INSTALL FAQ NOTES NEWS PROJECTS BUGS	\
 	       COPYING.LIB COPYING ChangeLog ChangeLog.[0-9]		\
 	       Makefile Makeconfig Makerules Rules Make-dist MakeTAGS	\
-	       extra-lib.mk o-iterator.mk				\
+	       extra-lib.mk o-iterator.mk autolock.sh rellns-sh 	\
 	       libc.map 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 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 glibcbug.in abi-tags	\
 	       stub-tag.h test-installation.pl test-skeleton.c		\
 	       include/des.h
 
 distribute := $(strip $(distribute))
-generated := $(generated) stubs.h version-info.h
+generated := $(generated) stubs.h
 
 README: README.template version.h ; # Make-dist should update README.
 
Index: Makerules
===================================================================
RCS file: /egcs/carton/cvsfiles/libc/Makerules,v
retrieving revision 1.289
diff -u -r1.289 Makerules
--- Makerules	1998/05/01 21:58:42	1.289
+++ Makerules	1998/05/03 19:57:02
@@ -344,11 +344,7 @@
 no-whole-archive =
 endif
 
-interp-obj = $(common-objpfx)interp.os
-$(interp-obj): $(common-objpfx)%.os: $(..)%.c
-	$(compile-command.c)
-common-generated += interp.os
-CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"'
+interp-obj = $(common-objpfx)gnulib/interp.os
 
 $(common-objpfx)libc.so: $(interp-obj)
 $(patsubst %,$(objpfx)%.so,$(extra-libs)): $(interp-obj)
Index: gnulib/Makefile
===================================================================
RCS file: /egcs/carton/cvsfiles/libc/gnulib/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- gnulib/Makefile	1997/01/20 02:48:23	1.3
+++ gnulib/Makefile	1998/05/03 19:57:02
@@ -1,4 +1,4 @@
-# Copyright (C) 1991, 1997 Free Software Foundation, Inc.
+# Copyright (C) 1991, 1997, 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
@@ -18,6 +18,54 @@
 
 subdir := gnulib
 
-# Which routines are required is machine-dependent.
+include ../Makeconfig
 
+aux = sysdep version $(libc-init)
+before-compile = $(objpfx)version-info.h
+distribute = munch-tmpl.c munch.awk interp.c
+generated = version-info.h interp.os
+
+ifeq (yes,$(gnu-ld))
+libc-init = set-init
+else
+libc-init = munch-init
+$(objpfx)munch-init.c: munch.awk munch-tmpl.c $(+subdir_inits)
+	$(AWK) -f $< subdirs='$(+init_subdirs)' $(word 2,$^) > $@-t
+	mv -f $@-t $@
+generated += munch-init.c
+endif
+
 include ../Rules
+
+CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"'
+
+all-Banner-files = \
+	$(wildcard $(addsuffix /Banner, $(addprefix $(..), $(subdirs))))
+$(objpfx)version-info.h: $(+sysdir_pfx)config.make $(all-Banner-files)
+	$(make-target-directory)
+	(case $(config-os) in \
+	   linux*) version=`(echo -e "#include <linux/version.h>\nUTS_RELEASE"\
+			     | $(CC) $(sysincludes) -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<</' \
+				< /proc/version`; \
+		     else \
+		       version=`uname -r`; \
+		     fi; \
+		   fi; \
+		   echo -n "\"Compiled on a Linux $$version system "; \
+		   echo "on `date +%Y-%m-%d`.\\n\"" ;; \
+	   *) ;; \
+	 esac; \
+	 files="$(all-Banner-files)";				\
+	 if test -n "$$files"; then				\
+	   echo "\"Available extensions:";			\
+	   sed -e '/^#/d' -e 's/^[[:space:]]*/	/' $$files;	\
+	   echo "\"";						\
+	 fi) > $@T
+	mv -f $@T $@
+
+# So interp.os gets compiled.
+subdir_lib: $(objpfx)interp.os
--- interp.c	Sun May  3 15:25:12 1998
+++ /dev/null	Tue May 27 20:49:58 1997
@@ -1,21 +0,0 @@
-/* interp - add information about dynamic loader to shared library objects.
-   Copyright (C) 1996 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.  */
-
-const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp")))
-  = RUNTIME_LINKER;
--- munch-tmpl.c	Sun May  3 15:25:12 1998
+++ /dev/null	Tue May 27 20:49:58 1997
@@ -1,38 +0,0 @@
-/* Copyright (C) 1991, 1995, 1997 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.  */
-
-#include <stdlib.h>
-
-
-EXTERNS
-
-void
-__libc_init (int argc, char **argv, char **envp)
-{
-  CALLS
-
-#ifdef HAVE_INITFINI
-    {
-      /* These functions are defined in crti.o to run the .init and .fini
-	 sections, which are used for initializers and finalizers.  */
-      extern void _init __P ((void)), _fini __P ((void));
-      atexit (&_fini);		/* Arrange for _fini to run at exit.  */
-      _init ();
-    }
-#endif
-}
--- munch.awk	Sun May  3 15:25:12 1998
+++ /dev/null	Tue May 27 20:49:58 1997
@@ -1,11 +0,0 @@
-BEGIN { special = 0 }
-
-/EXTERNS/ { ndirs = split(subdirs, dirs)
-	    for (i = 1; i <= ndirs; ++i)
-	    	printf "extern void __init_%s __P ((int argc, char **argv, char **envp));\n", dirs[i]
-	    special = 1 }
-/CALLS/ { ndirs = split(subdirs, dirs)
-	  for (i = 1; i <= ndirs; ++i) printf "  __init_%s (argc, argv, envp);\n", dirs[i]
-	  special = 1 }
-
-{ if (special == 0) print $0; special = 0 }
--- set-init.c	Sun May  3 15:25:12 1998
+++ /dev/null	Tue May 27 20:49:58 1997
@@ -1,23 +0,0 @@
-/* Copyright (C) 1991, 1992, 1994, 1995, 1997 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.  */
-
-#include <stdlib.h>
-#include <set-hooks.h>
-
-DEFINE_HOOK_RUNNER (__libc_subinit, __libc_init,
-		    (int argc, char **argv, char **envp), (argc, argv, envp))
--- version.c	Sun May  3 15:25:23 1998
+++ /dev/null	Tue May 27 20:49:58 1997
@@ -1,73 +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.  */
-
-#include "version.h"
-#include <gnu/libc-version.h>
-
-static const char __libc_release[] = RELEASE;
-static const char __libc_version[] = VERSION;
-
-static const char banner[] =
-"GNU C Library "RELEASE" release version "VERSION", by Roland McGrath et al.\n\
-Copyright (C) 1992, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.\n\
-This is free software; see the source for copying conditions.\n\
-There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
-PARTICULAR PURPOSE.\n\
-Compiled by GNU CC version "__VERSION__".\n"
-#include "version-info.h"
-"Report bugs using the `glibcbug' script to <bugs@gnu.org>.\n";
-
-#include <unistd.h>
-
-void
-__libc_print_version (void)
-{
-  __write (STDOUT_FILENO, banner, sizeof banner - 1);
-}
-
-const char *
-__gnu_get_libc_release (void)
-{
-  return __libc_release;
-}
-weak_alias (__gnu_get_libc_release, gnu_get_libc_release)
-
-const char *
-__gnu_get_libc_version (void)
-{
-  return __libc_version;
-}
-weak_alias (__gnu_get_libc_version, gnu_get_libc_version)
-
-#ifdef HAVE_ELF
-/* This function is the entry point for the shared object.
-   Running the library as a program will get here.  */
-
-void
-__libc_main (void)
-{
-  __libc_print_version ();
-  _exit (0);
-}
-#endif
-
-/*
-   Local Variables:
-   version-control: never
-   End:
-*/
--- /dev/null	Tue May 27 20:49:58 1997
+++ gnulib/interp.c	Thu Jan 29 10:00:26 1998
@@ -0,0 +1,21 @@
+/* interp - add information about dynamic loader to shared library objects.
+   Copyright (C) 1996 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.  */
+
+const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp")))
+  = RUNTIME_LINKER;
--- /dev/null	Tue May 27 20:49:58 1997
+++ gnulib/munch-tmpl.c	Thu Jan 29 10:00:27 1998
@@ -0,0 +1,38 @@
+/* Copyright (C) 1991, 1995, 1997 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.  */
+
+#include <stdlib.h>
+
+
+EXTERNS
+
+void
+__libc_init (int argc, char **argv, char **envp)
+{
+  CALLS
+
+#ifdef HAVE_INITFINI
+    {
+      /* These functions are defined in crti.o to run the .init and .fini
+	 sections, which are used for initializers and finalizers.  */
+      extern void _init __P ((void)), _fini __P ((void));
+      atexit (&_fini);		/* Arrange for _fini to run at exit.  */
+      _init ();
+    }
+#endif
+}
--- /dev/null	Tue May 27 20:49:58 1997
+++ gnulib/munch.awk	Thu Jan 29 10:00:27 1998
@@ -0,0 +1,11 @@
+BEGIN { special = 0 }
+
+/EXTERNS/ { ndirs = split(subdirs, dirs)
+	    for (i = 1; i <= ndirs; ++i)
+	    	printf "extern void __init_%s __P ((int argc, char **argv, char **envp));\n", dirs[i]
+	    special = 1 }
+/CALLS/ { ndirs = split(subdirs, dirs)
+	  for (i = 1; i <= ndirs; ++i) printf "  __init_%s (argc, argv, envp);\n", dirs[i]
+	  special = 1 }
+
+{ if (special == 0) print $0; special = 0 }
--- /dev/null	Tue May 27 20:49:58 1997
+++ gnulib/set-init.c	Thu Jan 29 10:00:27 1998
@@ -0,0 +1,23 @@
+/* Copyright (C) 1991, 1992, 1994, 1995, 1997 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.  */
+
+#include <stdlib.h>
+#include <set-hooks.h>
+
+DEFINE_HOOK_RUNNER (__libc_subinit, __libc_init,
+		    (int argc, char **argv, char **envp), (argc, argv, envp))
--- /dev/null	Tue May 27 20:49:58 1997
+++ gnulib/version.c	Mon Mar  2 17:57:43 1998
@@ -0,0 +1,73 @@
+/* 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.  */
+
+#include "version.h"
+#include <gnu/libc-version.h>
+
+static const char __libc_release[] = RELEASE;
+static const char __libc_version[] = VERSION;
+
+static const char banner[] =
+"GNU C Library "RELEASE" release version "VERSION", by Roland McGrath et al.\n\
+Copyright (C) 1992, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.\n\
+This is free software; see the source for copying conditions.\n\
+There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
+PARTICULAR PURPOSE.\n\
+Compiled by GNU CC version "__VERSION__".\n"
+#include "version-info.h"
+"Report bugs using the `glibcbug' script to <bugs@gnu.org>.\n";
+
+#include <unistd.h>
+
+void
+__libc_print_version (void)
+{
+  __write (STDOUT_FILENO, banner, sizeof banner - 1);
+}
+
+const char *
+__gnu_get_libc_release (void)
+{
+  return __libc_release;
+}
+weak_alias (__gnu_get_libc_release, gnu_get_libc_release)
+
+const char *
+__gnu_get_libc_version (void)
+{
+  return __libc_version;
+}
+weak_alias (__gnu_get_libc_version, gnu_get_libc_version)
+
+#ifdef HAVE_ELF
+/* This function is the entry point for the shared object.
+   Running the library as a program will get here.  */
+
+void
+__libc_main (void)
+{
+  __libc_print_version ();
+  _exit (0);
+}
+#endif
+
+/*
+   Local Variables:
+   version-control: never
+   End:
+*/


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