From 513072209fa17a1f3a3a55f3305673664a923b20 Mon Sep 17 00:00:00 2001 From: "nicolson%netscape.com" Date: Tue, 10 Jul 2001 01:59:44 +0000 Subject: [PATCH] Fix 87807: Add library version info to the JSS shared library. --- security/jss/lib/config.mk | 4 +- security/jss/lib/jss.rc | 98 +++++++++++++++++++ security/jss/org/mozilla/jss/util/jssutil.c | 9 ++ security/jss/org/mozilla/jss/util/jssver.c | 54 ++++++++++ security/jss/org/mozilla/jss/util/jssver.h | 50 ++++++++++ security/jss/org/mozilla/jss/util/manifest.mn | 2 + 6 files changed, 215 insertions(+), 2 deletions(-) create mode 100644 security/jss/lib/jss.rc create mode 100644 security/jss/org/mozilla/jss/util/jssver.c create mode 100644 security/jss/org/mozilla/jss/util/jssver.h diff --git a/security/jss/lib/config.mk b/security/jss/lib/config.mk index 8caeddad7321..ad0e57ef6bd5 100644 --- a/security/jss/lib/config.mk +++ b/security/jss/lib/config.mk @@ -49,8 +49,8 @@ SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).dll IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).lib DLLFLAGS += -DEF:jss.def -#RES = $(OBJDIR)/jss.res -#RESNAME = jss.rc +RES = $(OBJDIR)/jss.res +RESNAME = jss.rc EXTRA_SHARED_LIBS += \ $(DIST)/lib/nss3.lib \ diff --git a/security/jss/lib/jss.rc b/security/jss/lib/jss.rc new file mode 100644 index 000000000000..4e9ef5c915e1 --- /dev/null +++ b/security/jss/lib/jss.rc @@ -0,0 +1,98 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Netscape Java security libraries. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 2001 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU General Public License Version 2 or later (the + * "GPL"), in which case the provisions of the GPL are applicable + * instead of those above. If you wish to allow use of your + * version of this file only under the terms of the GPL and not to + * allow others to use your version of this file under the MPL, + * indicate your decision by deleting the provisions above and + * replace them with the notice and other provisions required by + * the GPL. If you do not delete the provisions above, a recipient + * may use your version of this file under either the MPL or the + * GPL. + */ + +#include "jssver.h" +#include + +#define MY_LIBNAME "jss" +#define MY_FILEDESCRIPTION "JSS Library" + +#define STRINGIZE(x) #x +#define STRINGIZE2(x) STRINGIZE(x) +#define JSS_VMAJOR_STR STRINGIZE2(JSS_VMAJOR) + +#ifdef _DEBUG +#define MY_DEBUG_STR " (debug)" +#define MY_FILEFLAGS_1 VS_FF_DEBUG +#else +#define MY_DEBUG_STR "" +#define MY_FILEFLAGS_1 0x0L +#endif +#if JSS_BETA +#define MY_FILEFLAGS_2 MY_FILEFLAGS_1|VS_FF_PRERELEASE +#else +#define MY_FILEFLAGS_2 MY_FILEFLAGS_1 +#endif + +#ifdef WINNT +#define MY_FILEOS VOS_NT_WINDOWS32 +#else +#define MY_FILEOS VOS__WINDOWS32 +#endif + +#define MY_INTERNAL_NAME MY_LIBNAME JSS_VMAJOR_STR + +///////////////////////////////////////////////////////////////////////////// +// +// Version-information resource +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION JSS_VMAJOR,JSS_VMINOR,JSS_VPATCH,0 + PRODUCTVERSION JSS_VMAJOR,JSS_VMINOR,JSS_VPATCH,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS MY_FILEFLAGS_2 + FILEOS MY_FILEOS + FILETYPE VFT_DLL + FILESUBTYPE 0x0L // not used + +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" // Lang=US English, CharSet=Unicode + BEGIN + VALUE "CompanyName", "Netscape Communications Corporation\0" + VALUE "FileDescription", MY_FILEDESCRIPTION MY_DEBUG_STR "\0" + VALUE "FileVersion", JSS_VERSION "\0" + VALUE "InternalName", MY_INTERNAL_NAME "\0" + VALUE "LegalCopyright", "Copyright \251 1994-2001 Netscape Communications Corporation\0" + VALUE "OriginalFilename", MY_INTERNAL_NAME ".dll\0" + VALUE "ProductName", "Network Security Services for Java\0" + VALUE "ProductVersion", JSS_VERSION "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/security/jss/org/mozilla/jss/util/jssutil.c b/security/jss/org/mozilla/jss/util/jssutil.c index 35a279f5fd4a..138f44c30997 100644 --- a/security/jss/org/mozilla/jss/util/jssutil.c +++ b/security/jss/org/mozilla/jss/util/jssutil.c @@ -800,3 +800,12 @@ JSS_ByteArrayToSECItem(JNIEnv *env, jbyteArray byteArray) finish: return item; } + + +/* + * External references to the rcs and sccsc ident information in + * jssver.c. These are here to prevent the compiler from optimizing + * away the symbols in jssver.c + */ +extern const char __jss_base_rcsid[]; +extern const char __jss_base_sccsid[]; diff --git a/security/jss/org/mozilla/jss/util/jssver.c b/security/jss/org/mozilla/jss/util/jssver.c new file mode 100644 index 000000000000..5a575fa244a6 --- /dev/null +++ b/security/jss/org/mozilla/jss/util/jssver.c @@ -0,0 +1,54 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Netscape security libraries. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 2001 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU General Public License Version 2 or later (the + * "GPL"), in which case the provisions of the GPL are applicable + * instead of those above. If you wish to allow use of your + * version of this file only under the terms of the GPL and not to + * allow others to use your version of this file under the MPL, + * indicate your decision by deleting the provisions above and + * replace them with the notice and other provisions required by + * the GPL. If you do not delete the provisions above, a recipient + * may use your version of this file under either the MPL or the + * GPL. + */ + +#include "jssver.h" + +/* Library identity and versioning */ + + +#if defined(DEBUG) +#define _DEBUG_STRING " (debug)" +#else +#define _DEBUG_STRING "" +#endif + +/* + * Version information for the 'ident' and 'what commands + * + * NOTE: the first component of the concatenated rcsid string + * must not end in a '$' to prevent rcs keyword substitution. + */ +const char __jss_base_rcsid[] = "$Header: JSS " JSS_VERSION _DEBUG_STRING + " " __DATE__ " " __TIME__ " $"; +const char __jss_base_sccsid[] = "@(#)JSS " JSS_VERSION _DEBUG_STRING + " " __DATE__ " " __TIME__; diff --git a/security/jss/org/mozilla/jss/util/jssver.h b/security/jss/org/mozilla/jss/util/jssver.h new file mode 100644 index 000000000000..8e2784449577 --- /dev/null +++ b/security/jss/org/mozilla/jss/util/jssver.h @@ -0,0 +1,50 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Netscape security libraries. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 2001 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU General Public License Version 2 or later (the + * "GPL"), in which case the provisions of the GPL are applicable + * instead of those above. If you wish to allow use of your + * version of this file only under the terms of the GPL and not to + * allow others to use your version of this file under the MPL, + * indicate your decision by deleting the provisions above and + * replace them with the notice and other provisions required by + * the GPL. If you do not delete the provisions above, a recipient + * may use your version of this file under either the MPL or the + * GPL. + */ + +#ifndef JSSVER_H +#define JSSVER_H + +/* + * JSS's major version, minor version, patch level, and whether + * this is a beta release. + * + * The format of the version string should be + * ".[.] []" + */ +#define JSS_VERSION "3.1 Beta" +#define JSS_VMAJOR 3 +#define JSS_VMINOR 1 +#define JSS_VPATCH 0 +#define JSS_BETA PR_TRUE + +#endif diff --git a/security/jss/org/mozilla/jss/util/manifest.mn b/security/jss/org/mozilla/jss/util/manifest.mn index c100d035cedb..3431f1fa0fbc 100644 --- a/security/jss/org/mozilla/jss/util/manifest.mn +++ b/security/jss/org/mozilla/jss/util/manifest.mn @@ -45,6 +45,7 @@ PRIVATE_EXPORTS = jssutil.h \ jss_exceptions.h \ java_ids.h \ jss_bigint.h \ + jssver.h \ $(NULL) JNI_GEN = \ @@ -91,6 +92,7 @@ CLASSES = \ $(NULL) CSRCS = jssutil.c \ + jssver.c \ $(NULL) LIBRARY_NAME = jssutil