Tue Jun 20 02:18:19 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
authorRoland McGrath <roland@gnu.org>
Thu, 22 Jun 1995 09:00:11 +0000 (09:00 +0000)
committerRoland McGrath <roland@gnu.org>
Thu, 22 Jun 1995 09:00:11 +0000 (09:00 +0000)
* Makerules (lib%.so: lib%_pic.a): Pass -soname switch giving the
  library's name including $(libprefix) and major version number.

* locale/locale-ctype.c (allocate_arrays): Use xmalloc and bzero
  in place of xcalloc.

* Makeconfig (prefix, exec_prefix, libprefix): Instead of
  `ifndef', use the $(origin) function to only set these if they are
  undefined, and not if they are defined to empty.

* gnu-versions.h: New file.
* features.h (__GNU_LIBRARY__): Increase value to 5.

ChangeLog
Makeconfig
Makerules
features.h
gnu-versions.h [new file with mode: 0644]
locale/locale-ctype.c

index e9812c8..b133e75 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Tue Jun 20 02:18:19 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
+
+       * Makerules (lib%.so: lib%_pic.a): Pass -soname switch giving the
+       library's name including $(libprefix) and major version number.
+
+       * locale/locale-ctype.c (allocate_arrays): Use xmalloc and bzero
+       in place of xcalloc.
+
+       * Makeconfig (prefix, exec_prefix, libprefix): Instead of
+       `ifndef', use the $(origin) function to only set these if they are
+       undefined, and not if they are defined to empty.
+
+       * gnu-versions.h: New file.
+       * features.h (__GNU_LIBRARY__): Increase value to 5.
+
 Wed Jun 14 03:45:24 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
 
        * stdio/stdio.h (__validfp): Use ({...}) rather than a comma
index 620f23d..b63dabb 100644 (file)
@@ -115,12 +115,12 @@ export sysdep_dir := $(sysdep_dir)
 
 
 # Common prefix for machine-independent installation directories.
-ifndef prefix
+ifeq ($(origin prefix),undefined) # ifndef would override explicit empty value.
 prefix = /usr/local
 endif
 
 # Common prefix for machine-dependent installation directories.
-ifndef exec_prefix
+ifeq ($(origin exec_prefix),undefined)
 exec_prefix = $(prefix)
 endif
 
@@ -133,7 +133,7 @@ endif
 # the prefix is spliced between `lib' and the name, so the linker switch
 # `-l$(libprefix)NAME' finds the library; for other files the prefix is
 # just prepended to the whole file name.
-ifndef libprefix
+ifeq ($(origin libprefix),undefined)
 libprefix =
 endif
 
index 2191251..c6de338 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -554,6 +554,7 @@ ifeq (yes,$(build-shared))
 # on other shared objects.
 lib%.so: lib%_pic.a
        $(LINK.o) -shared -o $@ \
+                 -soname lib$(libprefix)$*.so$($(@F)-version) \
                  $(LDFLAGS.so) $(LDFLAGS-$(notdir $*).so) \
                  -L$(firstword $(objdir) .)  -L$(common-objpfx:%/=%) \
                  $(LDLIBS-$(notdir $*).so) -Wl,--whole-archive $< \
index 0778092..7801bb8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1993, 1995 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
@@ -126,8 +126,14 @@ Cambridge, MA 02139, USA.  */
 #endif
 
 
+/* This macro indicates that the installed library is the GNU C Library.
+   Its value must be incremented whenever any existing library interface
+   changes such that callers must be recompiled with the new header files.
+   This value should always coincide with the major version number used for
+   the shared C library corresponding to this set of header files.  */
+
 #undef __GNU_LIBRARY__
-#define        __GNU_LIBRARY__ 1
+#define        __GNU_LIBRARY__ 5
 
 
 #if    !defined(__GNUC__) || __GNUC__ < 2
diff --git a/gnu-versions.h b/gnu-versions.h
new file mode 100644 (file)
index 0000000..631a0f7
--- /dev/null
@@ -0,0 +1,50 @@
+/* Header with interface version macros for library pieces copied elsewhere.
+Copyright (C) 1995 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., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#ifndef _GNU_VERSIONS_H
+#define        _GNU_VERSIONS_H 1
+
+/* This file exists to define these few macros.  Each specifies a version
+   number associated with the library interface of a piece of the C library
+   which is also distributed with other GNU packages.  These pieces are
+   both part of the GNU C library and also distributed with other GNU
+   packages so those packages may use their facilities on systems lacking
+   the GNU C library.  The source files for each piece surround all their
+   code with `#ifndef ELIDE_CODE' after defining it with this:
+
+   #define OBSTACK_INTERFACE_VERSION 1
+   #if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
+   #include <gnu-versions.h>
+   #if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
+   #define ELIDE_CODE
+   #endif
+   #endif
+
+   This allows those one to avoid compiling those files when part of a GNU
+   package not libc, on a system using a GNU C library that supports the
+   same interface.
+
+   Please preserve the format of the comments after each macro.  And
+   remember, if any of these versions change, the libc.so major version
+   number must change too (so avoid it)!  */
+
+#define _GNU_OBSTACK_INTERFACE_VERSION 1 /* vs malloc/obstack.c */
+#define _GNU_REGEX_INTERFACE_VERSION   1 /* vs posix/regex.c */
+
+#endif /* gnu-versions.h */
index 1ce09ba..e7a1e97 100644 (file)
@@ -534,16 +534,20 @@ allocate_arrays (void)
       char *ptr;
       int size = charmap_data.hash_size * charmap_data.hash_layers;
 
-      ctype_b = (u16 *) xcalloc (size - (-128), sizeof (u16));
+      ctype_b = xmalloc ((size - (-128)) * sizeof (u16));
+      bzero (ctype_b, (size - (-128)) * sizeof (u16));
       ctype_b += 128;
 
 
-      names_b = (i32 *) xcalloc (size, sizeof (i32));
+      names_b = xmalloc (size * sizeof (i32));
+      bzero (names_b, size * sizeof (i32));
 
-      toupper_b = (i32 *) xcalloc ((size - (-128)), sizeof  (i32));
+      toupper_b = xmalloc ((size - (-128)) * sizeof (i32));
+      bzero (toupper_b, (size - (-128)) * sizeof (i32));
       toupper_b += 128;
 
-      tolower_b = (i32 *) xcalloc ((size - (-128)), sizeof (i32));
+      tolower_b = xmalloc ((size - (-128)) * sizeof (i32));
+      bzero (tolower_b, (size - (-128)) * sizeof (i32));
       tolower_b += 128;
 
       ptr = NULL;