Bugzilla bug #4741: add lib version info to libplds3 and libprstrms3.
authorwtc%netscape.com
Mon, 19 Apr 1999 22:17:08 +0000
changeset 558 c43b77c7936911079a0f06282f1e36d4e401a8a8
parent 557 49f23e187e5c4b26765ef20954fd225c2de5ad96
child 559 515c590aee051b82bf7f0b67952b33fe03b8aa8a
push idunknown
push userunknown
push dateunknown
bugs4741, 5284
Bugzilla bug #4741: add lib version info to libplds3 and libprstrms3. Bugzilla bug #5284: the lib version structures for libnspr3 and libplc3 are incorrectly named (still referring to libnspr21 and libplc21). Modified files: lib/ds/Makefile, lib/prstreams/Makefile, lib/libc/src/Makefile, lib/libc/src/plvrsion.c, pr/src/Makefile, pr/src/prvrsion.c Added files: lib/ds/plvrsion.c, lib/prstreams/plvrsion.c
lib/ds/Makefile
lib/ds/plvrsion.c
lib/libc/src/Makefile
lib/libc/src/plvrsion.c
lib/prstreams/Makefile
lib/prstreams/plvrsion.c
pr/src/Makefile
pr/src/prvrsion.c
--- a/lib/ds/Makefile
+++ b/lib/ds/Makefile
@@ -29,16 +29,17 @@ endif
 endif
 
 INCLUDES = -I$(DIST)/include/private -I$(DIST)/include
 
 CSRCS = \
 	plarena.c \
 	plevent.c \
 	plhash.c \
+	plvrsion.c \
 	$(NULL)
 
 HEADERS = \
 	plarenas.h \
 	plarena.h \
 	plevent.h \
 	plhash.h \
 	$(NULL)
@@ -100,16 +101,61 @@ LIBRARY_VERSION	= $(MOD_VERSION)
 
 RELEASE_HEADERS = $(HEADERS)
 RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
 RELEASE_LIBS	= $(TARGETS)
 
 include $(MOD_DEPTH)/config/rules.mk
 
 #
+# Version information generation (begin)
+#
+ECHO = echo
+TINC = $(OBJDIR)/_pl_bld.h
+PROD = $(notdir $(SHARED_LIBRARY))
+NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
+SH_DATE = $(shell date)
+SH_NOW = $(shell $(NOW))
+
+ifeq ($(OS_ARCH), WINNT)
+ifeq ($(OS_TARGET),OS2)
+	SUF =
+else
+	SUF = i64
+endif
+else
+	SUF = LL
+endif
+
+$(TINC):
+	@$(MAKE_OBJDIR)
+	@$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
+	@if test ! -z "$(SH_NOW)"; then \
+	    $(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
+	else \
+	    true; \
+	fi
+	@$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
+
+
+$(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
+ifeq ($(OS_ARCH), WINNT)
+ifdef XP_OS2_EMX
+	$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) plvrsion.c
+else
+	$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) plvrsion.c
+endif
+else
+	$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) plvrsion.c
+endif
+#
+# Version information generation (end)
+#
+
+#
 # The Client build wants the shared libraries in $(DIST)/bin,
 # so we also install them there.
 #
 
 export:: $(TARGETS)
 	$(INSTALL) -m 444 $(HEADERS) $(DIST)/include
 	$(INSTALL) -m 444 $(TARGETS) $(DIST)/lib
 ifdef SHARED_LIBRARY
new file mode 100644
--- /dev/null
+++ b/lib/ds/plvrsion.c
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL.  You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ * 
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ * 
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation.  Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
+ * Reserved.
+ */
+
+#include "prinit.h"
+#include "prvrsion.h"
+
+/************************************************************************/
+/**************************IDENTITY AND VERSIONING***********************/
+/************************************************************************/
+#include "_pl_bld.h"
+#if !defined(_BUILD_TIME)
+#ifdef HAVE_LONG_LONG
+#define _BUILD_TIME 0
+#else
+#define _BUILD_TIME {0, 0}
+#endif
+#endif
+#if !defined(_BUILD_STRING)
+#define _BUILD_STRING ""
+#endif
+#if !defined(_PRODUCTION)
+#define _PRODUCTION ""
+#endif
+
+static PRVersionDescription prVersionDescription_libplds3 =
+{
+    /* version          */  2,                  /* this is the only one supported */
+    /* buildTime        */  _BUILD_TIME,        /* usecs since midnight 1/1/1970 GMT */
+    /* buildTimeString  */  _BUILD_STRING,       /*    ditto, but human readable */
+    /* vMajor           */  PR_VMAJOR,          /* NSPR's version number */
+    /* vMinor           */  PR_VMINOR,          /*  and minor version */
+    /* vPatch           */  PR_VPATCH,          /*  and patch */
+    /* beta             */  PR_BETA,            /* beta build boolean */
+#if defined(DEBUG)
+    /* debug            */  PR_TRUE,            /* a debug build */
+#else
+    /* debug            */  PR_FALSE,           /* an optomized build */
+#endif
+    /* special          */  PR_FALSE,           /* they're all special, but ... */
+    /* filename         */  _PRODUCTION,        /* the produced library name */
+    /* description      */ "Portable runtime",  /* what we are */
+    /* security         */ "N/A",               /* not applicable here */
+    /* copywrite        */  "Copyright (c) 1998 Netscape Communications Corporation. All Rights Reserved",
+    /* comment          */  "http://www.mozilla.org/NPL/",
+    /* specialString    */ ""
+};
+
+#ifdef XP_UNIX
+
+/*
+ * Version information for the 'ident' and 'what commands
+ */
+static char rcsid[] = "$Version: NSPR " PR_VERSION "  " _BUILD_STRING " $";
+static char sccsid[] = "@(#)NSPR " PR_VERSION "  " _BUILD_STRING;
+
+#endif /* XP_UNIX */
+
+PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint()
+{
+#ifdef XP_UNIX
+    /*
+     * Add dummy references to rcsid and sccsid to prevent them
+     * from being optimized away as unused variables.
+     */
+    const char *dummy;
+    
+    dummy = rcsid;
+    dummy = sccsid;
+#endif
+    return &prVersionDescription_libplds3;
+}  /* versionEntryPointType */
+
+/* plvrsion.c */
+
--- a/lib/libc/src/Makefile
+++ b/lib/libc/src/Makefile
@@ -104,37 +104,31 @@ endif
 
 include $(MOD_DEPTH)/config/rules.mk
 
 #
 # Version information generation (begin)
 #
 ECHO = echo
 TINC = $(OBJDIR)/_pl_bld.h
-ifeq ($(OS_TARGET),OS2)
-PROD = nspr$(MOD_VERSION).$(DLL_SUFFIX)
-else
-PROD = plc$(MOD_VERSION).$(DLL_SUFFIX)
-endif
+PROD = $(notdir $(SHARED_LIBRARY))
 NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
 SH_DATE = $(shell date)
 SH_NOW = $(shell $(NOW))
 
 ifeq ($(OS_ARCH), WINNT)
 ifeq ($(OS_TARGET),OS2)
-        SUF =
+	SUF =
 else
 	SUF = i64
 endif
 else
 	SUF = LL
 endif
 
-GARBAGE += $(TINC)
-
 $(TINC):
 	@$(MAKE_OBJDIR)
 	@$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
 	@if test ! -z "$(SH_NOW)"; then \
 	    $(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
 	else \
 	    true; \
 	fi
--- a/lib/libc/src/plvrsion.c
+++ b/lib/libc/src/plvrsion.c
@@ -32,17 +32,17 @@
 #endif
 #if !defined(_BUILD_STRING)
 #define _BUILD_STRING ""
 #endif
 #if !defined(_PRODUCTION)
 #define _PRODUCTION ""
 #endif
 
-static PRVersionDescription prVersionDescription_libplc21 =
+static PRVersionDescription prVersionDescription_libplc3 =
 {
     /* version          */  2,                  /* this is the only one supported */
     /* buildTime        */  _BUILD_TIME,        /* usecs since midnight 1/1/1970 GMT */
     /* buildTimeString  */  _BUILD_STRING,       /*    ditto, but human readable */
     /* vMajor           */  PR_VMAJOR,          /* NSPR's version number */
     /* vMinor           */  PR_VMINOR,          /*  and minor version */
     /* vPatch           */  PR_VPATCH,          /*  and patch */
     /* beta             */  PR_BETA,            /* beta build boolean */
@@ -77,13 +77,13 @@ PR_IMPLEMENT(const PRVersionDescription*
      * Add dummy references to rcsid and sccsid to prevent them
      * from being optimized away as unused variables.
      */
     const char *dummy;
     
     dummy = rcsid;
     dummy = sccsid;
 #endif
-    return &prVersionDescription_libplc21;
+    return &prVersionDescription_libplc3;
 }  /* versionEntryPointType */
 
 /* plvrsion.c */
 
--- a/lib/prstreams/Makefile
+++ b/lib/prstreams/Makefile
@@ -40,21 +40,25 @@ ifeq ($(OS_ARCH),HP-UX)
         CCCFLAGS += +DA2.0W
     endif
 endif
 
 INCLUDES = -I$(DIST)/include -I../../../include
 
 HEADERS = *.h
 
+CSRCS = \
+	plvrsion.c \
+	$(NULL)
+
 CXXSRCS = \
 	prstrms.cpp \
 	$(NULL)
 
-OBJS = $(addprefix $(OBJDIR)/,$(CXXSRCS:.cpp=.$(OBJ_SUFFIX)))
+OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX)) $(CXXSRCS:.cpp=.$(OBJ_SUFFIX)))
 
 ifeq ($(OS_ARCH), WINNT)
     ifeq (,$(filter-out WIN16 OS2,$(OS_TARGET)))
         EXTRA_LIBS = $(DIST)/lib/nspr$(MOD_VERSION).lib
     else
         DLLBASE=/BASE:0x30000000
         RES=$(OBJDIR)/prstrms.res
         RESNAME=$(MOD_DEPTH)/pr/src/nspr.rc
@@ -110,13 +114,58 @@ LIBRARY_NAME    = prstrms
 LIBRARY_VERSION = $(MOD_VERSION)
 
 RELEASE_HEADERS = $(HEADERS)
 RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
 RELEASE_LIBS    = $(TARGETS)
 
 include $(MOD_DEPTH)/config/rules.mk
 
+#
+# Version information generation (begin)
+#
+ECHO = echo
+TINC = $(OBJDIR)/_pl_bld.h
+PROD = $(notdir $(SHARED_LIBRARY))
+NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
+SH_DATE = $(shell date)
+SH_NOW = $(shell $(NOW))
+
+ifeq ($(OS_ARCH), WINNT)
+ifeq ($(OS_TARGET),OS2)
+	SUF =
+else
+	SUF = i64
+endif
+else
+	SUF = LL
+endif
+
+$(TINC):
+	@$(MAKE_OBJDIR)
+	@$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
+	@if test ! -z "$(SH_NOW)"; then \
+	    $(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
+	else \
+	    true; \
+	fi
+	@$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
+
+
+$(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
+ifeq ($(OS_ARCH), WINNT)
+ifdef XP_OS2_EMX
+	$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) plvrsion.c
+else
+	$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) plvrsion.c
+endif
+else
+	$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) plvrsion.c
+endif
+#
+# Version information generation (end)
+#
+
 export:: $(TARGETS) $(HEADERS)
 	$(INSTALL) -m 444 $(HEADERS) $(DIST)/include
 	$(INSTALL) -m 444 $(TARGETS) $(DIST)/lib
 
 install:: export
new file mode 100644
--- /dev/null
+++ b/lib/prstreams/plvrsion.c
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL.  You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ * 
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ * 
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation.  Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
+ * Reserved.
+ */
+
+#include "prinit.h"
+#include "prvrsion.h"
+
+/************************************************************************/
+/**************************IDENTITY AND VERSIONING***********************/
+/************************************************************************/
+#include "_pl_bld.h"
+#if !defined(_BUILD_TIME)
+#ifdef HAVE_LONG_LONG
+#define _BUILD_TIME 0
+#else
+#define _BUILD_TIME {0, 0}
+#endif
+#endif
+#if !defined(_BUILD_STRING)
+#define _BUILD_STRING ""
+#endif
+#if !defined(_PRODUCTION)
+#define _PRODUCTION ""
+#endif
+
+static PRVersionDescription prVersionDescription_libprstrms3 =
+{
+    /* version          */  2,                  /* this is the only one supported */
+    /* buildTime        */  _BUILD_TIME,        /* usecs since midnight 1/1/1970 GMT */
+    /* buildTimeString  */  _BUILD_STRING,       /*    ditto, but human readable */
+    /* vMajor           */  PR_VMAJOR,          /* NSPR's version number */
+    /* vMinor           */  PR_VMINOR,          /*  and minor version */
+    /* vPatch           */  PR_VPATCH,          /*  and patch */
+    /* beta             */  PR_BETA,            /* beta build boolean */
+#if defined(DEBUG)
+    /* debug            */  PR_TRUE,            /* a debug build */
+#else
+    /* debug            */  PR_FALSE,           /* an optomized build */
+#endif
+    /* special          */  PR_FALSE,           /* they're all special, but ... */
+    /* filename         */  _PRODUCTION,        /* the produced library name */
+    /* description      */ "Portable runtime",  /* what we are */
+    /* security         */ "N/A",               /* not applicable here */
+    /* copywrite        */  "Copyright (c) 1998 Netscape Communications Corporation. All Rights Reserved",
+    /* comment          */  "http://www.mozilla.org/NPL/",
+    /* specialString    */ ""
+};
+
+#ifdef XP_UNIX
+
+/*
+ * Version information for the 'ident' and 'what commands
+ */
+static char rcsid[] = "$Version: NSPR " PR_VERSION "  " _BUILD_STRING " $";
+static char sccsid[] = "@(#)NSPR " PR_VERSION "  " _BUILD_STRING;
+
+#endif /* XP_UNIX */
+
+PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint()
+{
+#ifdef XP_UNIX
+    /*
+     * Add dummy references to rcsid and sccsid to prevent them
+     * from being optimized away as unused variables.
+     */
+    const char *dummy;
+    
+    dummy = rcsid;
+    dummy = sccsid;
+#endif
+    return &prVersionDescription_libprstrms3;
+}  /* versionEntryPointType */
+
+/* plvrsion.c */
+
--- a/pr/src/Makefile
+++ b/pr/src/Makefile
@@ -336,28 +336,24 @@ TARGETS		+= $(AIX_RTL_LIBC)
 endif
 
 #
 # Version information generation (begin)
 #
 ECHO = echo
 INCLUDES = -I$(DIST)/include
 TINC = $(OBJDIR)/_pr_bld.h
-ifeq ($(OS_TARGET),OS2)
-PROD = nspr$(MOD_VERSION).$(DLL_SUFFIX)
-else
-PROD = libnspr$(MOD_VERSION).$(DLL_SUFFIX)
-endif
+PROD = $(notdir $(SHARED_LIBRARY))
 NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
 SH_DATE = $(shell date)
 SH_NOW = $(shell $(NOW))
 
 ifeq ($(OS_ARCH), WINNT)
 ifeq ($(OS_TARGET),OS2)
-        SUF =
+	SUF =
 else
 	SUF = i64
 endif
 else
 	SUF = LL
 endif
 
 $(TINC):
--- a/pr/src/prvrsion.c
+++ b/pr/src/prvrsion.c
@@ -32,17 +32,17 @@
 #endif
 #if !defined(_BUILD_STRING)
 #define _BUILD_STRING ""
 #endif
 #if !defined(_PRODUCTION)
 #define _PRODUCTION ""
 #endif
 
-static PRVersionDescription prVersionDescription_libnsrp21 =
+static PRVersionDescription prVersionDescription_libnspr3 =
 {
     /* version          */  2,                  /* this is the only one supported */
     /* buildTime        */  _BUILD_TIME,        /* usecs since midnight 1/1/1970 GMT */
     /* buildTimeString  */  _BUILD_STRING,       /*    ditto, but human readable */
     /* vMajor           */  PR_VMAJOR,          /* NSPR's version number */
     /* vMinor           */  PR_VMINOR,          /*  and minor version */
     /* vPatch           */  PR_VPATCH,          /*  and patch */
     /* beta             */  PR_BETA,            /* beta build boolean */
@@ -77,13 +77,13 @@ PR_IMPLEMENT(const PRVersionDescription*
      * Add dummy references to rcsid and sccsid to prevent them
      * from being optimized away as unused variables.
      */ 
     const char *dummy;
 
     dummy = rcsid;
     dummy = sccsid;
 #endif
-    return &prVersionDescription_libnsrp21;
+    return &prVersionDescription_libnspr3;
 }  /* versionEntryPointType */
 
 /* prvrsion.c */