debian/0000755000000000000000000000000011772627144007201 5ustar debian/control0000644000000000000000000000152011772551110010567 0ustar Source: jss Section: java Maintainer: Debian 389ds Team Uploaders: Timo Aaltonen , Priority: optional Build-Depends: debhelper (>= 8.0.0), default-jdk, libnss3-dev, pkg-config, quilt, Standards-Version: 3.9.3 Vcs-Git: git://git.debian.org/git/pkg-fedora-ds/jss.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-fedora-ds/jss.git Homepage: http://www.mozilla.org/projects/security/pki/jss/ Package: libjss-java Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Network Security Services for Java Network Security Services for Java (JSS) is a Java interface to NSS. It supports most of the security standards and encryption technologies supported by NSS. JSS also provides a pure Java interface for ASN.1 types and BER/DER encoding. debian/source/0000755000000000000000000000000011772530746010502 5ustar debian/source/format0000644000000000000000000000001411772530746011710 0ustar 3.0 (quilt) debian/watch0000644000000000000000000000016611772530746010236 0ustar version=3 http://ftp.mozilla.org/pub/mozilla.org/security/jss/releases/JSS_(\d_\d_\d)_RTM/src/jss-(\d\.\d.\d).tar.bz2 debian/changelog0000644000000000000000000000373011772627144011056 0ustar jss (4.3.1-4) unstable; urgency=low [ Timo Aaltonen ] * Update pull_coreconf.patch and match Linux3.0* during clean. * rules: - Remove dist/ on clean. - Use openjdk-6 instead of gcj. * patches: Add a bunch of patches from Fedora. * control: Change the VCS header to point to the git repository. * compat: Bump to 8. * control: Build-depend on default-jdk. * control: Update the maintainer address. * control: Drop jre dependency per current java policy. * patches: More patches from Fedora. * rules: Install the library in /usr/lib/jss. * control: Bump standards to 3.9.3, no changes. * control: Update the uploaders field. * rules: Added build-arch and build-indep targets. * rules: Replace dh_clean -k with dh_prep. [ Ghe Rivero ] * Fixed JAVA_HOME default path -- Timo Aaltonen Wed, 27 Jun 2012 18:00:53 +0200 jss (4.3.1-3) unstable; urgency=low * Update my email address -- Michele Baldessari Sun, 17 Oct 2010 23:41:15 +0200 jss (4.3.1-2) unstable; urgency=low * Bump policy to 3.9.1 * Update to quilt 3.0 source package -- Michele Baldessari Sat, 04 Sep 2010 20:48:04 +0200 jss (4.3.1-1) unstable; urgency=low * New upstream * Bump policy to 3.8.3 * Patch in coreconf build system for the time being * Add ${misc:Depends} as we depend on debhelper * Fix jar links to the right version -- Michele Baldessari Sun, 24 Jan 2010 23:36:55 +0100 jss (4.2.5-2) unstable; urgency=low * Bump to policy 3.8.0 * debian/control: - Build-Depend on default-jdk-builddep instead of java-gcj-compat-dev * Add VCS-* fields * Fixed build-deps (added libnss3-dev and pkg-config) * Changed section to "java" -- Michele Baldessari Wed, 22 Apr 2009 21:31:06 +0200 jss (4.2.5-1) unstable; urgency=low * Initial release (Closes: #474489) -- Michele Baldessari Wed, 09 Apr 2008 16:09:59 +0200 debian/compat0000644000000000000000000000000211772530746010400 0ustar 8 debian/patches/0000755000000000000000000000000011772551110010615 5ustar debian/patches/jss-VerifyCertificate.patch0000644000000000000000000002213511772530746016061 0ustar Index: jss/security/jss/lib/jss.def =================================================================== --- jss.orig/security/jss/lib/jss.def 2011-10-04 21:18:14.642026259 +0300 +++ jss/security/jss/lib/jss.def 2011-10-04 21:18:14.674026260 +0300 @@ -330,6 +330,7 @@ Java_org_mozilla_jss_pkcs11_PK11KeyPairGenerator_generateDSAKeyPairWithOpFlags; Java_org_mozilla_jss_CryptoManager_OCSPCacheSettingsNative; Java_org_mozilla_jss_CryptoManager_setOCSPTimeoutNative; +Java_org_mozilla_jss_CryptoManager_verifyCertificateNowNative; ;+ local: ;+ *; ;+}; Index: jss/security/jss/org/mozilla/jss/CryptoManager.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/CryptoManager.java 2011-10-04 21:18:14.642026259 +0300 +++ jss/security/jss/org/mozilla/jss/CryptoManager.java 2011-10-04 21:18:14.674026260 +0300 @@ -61,6 +61,7 @@ public final class CryptoManager implements TokenSupplier { /** + * note: this is obsolete in NSS * CertUsage options for validation */ public final static class CertUsage { @@ -103,6 +104,63 @@ public static final CertUsage AnyCA = new CertUsage(11, "AnyCA"); } + /** + * CertificateUsage options for validation + */ + public final static class CertificateUsage { + private int usage; + private String name; + + // certificateUsage, these must be kept in sync with nss/lib/certdb/certt.h + private static final int certificateUsageCheckAllUsages = 0x0000; + private static final int certificateUsageSSLClient = 0x0001; + private static final int certificateUsageSSLServer = 0x0002; + private static final int certificateUsageSSLServerWithStepUp = 0x0004; + private static final int certificateUsageSSLCA = 0x0008; + private static final int certificateUsageEmailSigner = 0x0010; + private static final int certificateUsageEmailRecipient = 0x0020; + private static final int certificateUsageObjectSigner = 0x0040; + private static final int certificateUsageUserCertImport = 0x0080; + private static final int certificateUsageVerifyCA = 0x0100; + private static final int certificateUsageProtectedObjectSigner = 0x0200; + private static final int certificateUsageStatusResponder = 0x0400; + private static final int certificateUsageAnyCA = 0x0800; + + static private ArrayList list = new ArrayList(); + private CertificateUsage() {}; + private CertificateUsage(int usage, String name) { + this.usage = usage; + this.name = name; + this.list.add(this); + + } + public int getUsage() { + return usage; + } + + static public Iterator getCertificateUsages() { + return list.iterator(); + + } + public String toString() { + return name; + } + + public static final CertificateUsage CheckAllUsages = new CertificateUsage(certificateUsageCheckAllUsages, "CheckAllUsages"); + public static final CertificateUsage SSLClient = new CertificateUsage(certificateUsageSSLClient, "SSLClient"); + public static final CertificateUsage SSLServer = new CertificateUsage(certificateUsageSSLServer, "SSLServer"); + public static final CertificateUsage SSLServerWithStepUp = new CertificateUsage(certificateUsageSSLServerWithStepUp, "SSLServerWithStepUp"); + public static final CertificateUsage SSLCA = new CertificateUsage(certificateUsageSSLCA, "SSLCA"); + public static final CertificateUsage EmailSigner = new CertificateUsage(certificateUsageEmailSigner, "EmailSigner"); + public static final CertificateUsage EmailRecipient = new CertificateUsage(certificateUsageEmailRecipient, "EmailRecipient"); + public static final CertificateUsage ObjectSigner = new CertificateUsage(certificateUsageObjectSigner, "ObjectSigner"); + public static final CertificateUsage UserCertImport = new CertificateUsage(certificateUsageUserCertImport, "UserCertImport"); + public static final CertificateUsage VerifyCA = new CertificateUsage(certificateUsageVerifyCA, "VerifyCA"); + public static final CertificateUsage ProtectedObjectSigner = new CertificateUsage(certificateUsageProtectedObjectSigner, "ProtectedObjectSigner"); + public static final CertificateUsage StatusResponder = new CertificateUsage(certificateUsageStatusResponder, "StatusResponder"); + public static final CertificateUsage AnyCA = new CertificateUsage(certificateUsageAnyCA, "AnyCA"); + } + public final static class NotInitializedException extends Exception {} public final static class NicknameConflictException extends Exception {} public final static class UserCertConflictException extends Exception {} @@ -1508,6 +1566,39 @@ * against Now. * @param nickname The nickname of the certificate to verify. * @param checkSig verify the signature of the certificate + * @param certificateUsage see exposed certificateUsage defines to verify Certificate; null will bypass usage check + * @return true for success; false otherwise + * + * @exception InvalidNicknameException If the nickname is null + * @exception ObjectNotFoundException If no certificate could be found + * with the given nickname. + */ + + public boolean isCertValid(String nickname, boolean checkSig, + CertificateUsage certificateUsage) + throws ObjectNotFoundException, InvalidNicknameException + { + if (nickname==null) { + throw new InvalidNicknameException("Nickname must be non-null"); + } + // 0 certificate usage was supposed to get current usage, however, + // it is not exposed at this point + return verifyCertificateNowNative(nickname, + checkSig, + (certificateUsage == null) ? 0:certificateUsage.getUsage()); + } + + private native boolean verifyCertificateNowNative(String nickname, + boolean checkSig, int certificateUsage) throws ObjectNotFoundException; + + /** + * note: this method calls obsolete function in NSS + * + * Verify a certificate that exists in the given cert database, + * check if is valid and that we trust the issuer. Verify time + * against Now. + * @param nickname The nickname of the certificate to verify. + * @param checkSig verify the signature of the certificate * @param certUsage see exposed certUsage defines to verify Certificate * @return true for success; false otherwise * @@ -1526,6 +1617,9 @@ return verifyCertNowNative(nickname, checkSig, certUsage.getUsage()); } + /* + * Obsolete in NSS + */ private native boolean verifyCertNowNative(String nickname, boolean checkSig, int cUsage) throws ObjectNotFoundException; Index: jss/security/jss/org/mozilla/jss/PK11Finder.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/PK11Finder.c 2011-10-04 20:07:40.137891731 +0300 +++ jss/security/jss/org/mozilla/jss/PK11Finder.c 2011-10-04 21:18:14.674026260 +0300 @@ -1575,11 +1575,62 @@ } /*********************************************************************** - * CryptoManager.verifyCertNowNative + * CryptoManager.verifyCertificateNowNative * * Returns JNI_TRUE if success, JNI_FALSE otherwise */ JNIEXPORT jboolean JNICALL +Java_org_mozilla_jss_CryptoManager_verifyCertificateNowNative(JNIEnv *env, + jobject self, jstring nickString, jboolean checkSig, jint required_certificateUsage) +{ + SECStatus rv = SECFailure; + SECCertificateUsage certificateUsage; + SECCertificateUsage currUsage; /* unexposed for now */ + CERTCertificate *cert=NULL; + char *nickname=NULL; + + nickname = (char *) (*env)->GetStringUTFChars(env, nickString, NULL); + if( nickname == NULL ) { + goto finish; + } + + certificateUsage = required_certificateUsage; + + cert = CERT_FindCertByNickname(CERT_GetDefaultCertDB(), nickname); + + if (cert == NULL) { + JSS_throw(env, OBJECT_NOT_FOUND_EXCEPTION); + goto finish; + } else { + /* 0 for certificateUsage in call to CERT_VerifyCertificateNow to + * just get the current usage (which we are not passing back for now + * but will bypass the certificate usage check + */ + rv = CERT_VerifyCertificateNow(CERT_GetDefaultCertDB(), cert, + checkSig, certificateUsage, NULL, &currUsage ); + } + +finish: + if(nickname != NULL) { + (*env)->ReleaseStringUTFChars(env, nickString, nickname); + } + if(cert != NULL) { + CERT_DestroyCertificate(cert); + } + if( rv == SECSuccess) { + return JNI_TRUE; + } else { + return JNI_FALSE; + } +} + + +/*********************************************************************** + * CryptoManager.verifyCertNowNative + * note: this calls obsolete NSS function + * Returns JNI_TRUE if success, JNI_FALSE otherwise + */ +JNIEXPORT jboolean JNICALL Java_org_mozilla_jss_CryptoManager_verifyCertNowNative(JNIEnv *env, jobject self, jstring nickString, jboolean checkSig, jint cUsage) { debian/patches/jss-ECC-Phase2KeyArchivalRecovery.patch0000644000000000000000000004053311772551110020014 0ustar --- a/security/jss/build_java.pl +++ b/security/jss/build_java.pl @@ -19,6 +19,7 @@ org.mozilla.jss.crypto.EncryptionAlgorithm org.mozilla.jss.crypto.PQGParams org.mozilla.jss.crypto.SecretDecoderRing +org.mozilla.jss.asn1.ASN1Util org.mozilla.jss.pkcs11.CertProxy org.mozilla.jss.pkcs11.CipherContextProxy org.mozilla.jss.pkcs11.PK11Module --- a/security/jss/lib/config.mk +++ b/security/jss/lib/config.mk @@ -44,6 +44,7 @@ ../org/mozilla/jss/SecretDecoderRing \ ../org/mozilla/jss \ ../org/mozilla/jss/pkcs11 \ + ../org/mozilla/jss/asn1 \ ../org/mozilla/jss/ssl \ ../org/mozilla/jss/util \ ../org/mozilla/jss/provider/java/security \ --- a/security/jss/lib/jss.def +++ b/security/jss/lib/jss.def @@ -332,6 +332,7 @@ Java_org_mozilla_jss_CryptoManager_setOCSPTimeoutNative; Java_org_mozilla_jss_CryptoManager_verifyCertificateNowNative; Java_org_mozilla_jss_CryptoManager_verifyCertificateNowCUNative; +Java_org_mozilla_jss_asn1_ASN1Util_getTagDescriptionByOid; ;+ local: ;+ *; ;+}; --- a/security/jss/lib/rules.mk +++ b/security/jss/lib/rules.mk @@ -41,6 +41,7 @@ -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(DLL_PREFIX)jsscrypto$(DYNAMIC_LIB_EXTENSION)$(DYNAMIC_LIB_SUFFIX) -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(DLL_PREFIX)jssmanage$(DYNAMIC_LIB_EXTENSION)$(DYNAMIC_LIB_SUFFIX) -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(DLL_PREFIX)jsspkcs11$(DYNAMIC_LIB_EXTENSION)$(DYNAMIC_LIB_SUFFIX) + -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(DLL_PREFIX)jssasn1$(DYNAMIC_LIB_EXTENSION)$(DYNAMIC_LIB_SUFFIX) -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(DLL_PREFIX)jsspolicy$(DYNAMIC_LIB_EXTENSION)$(DYNAMIC_LIB_SUFFIX) -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(DLL_PREFIX)jssssl$(DYNAMIC_LIB_EXTENSION)$(DYNAMIC_LIB_SUFFIX) -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(DLL_PREFIX)jssutil$(DYNAMIC_LIB_EXTENSION)$(DYNAMIC_LIB_SUFFIX) @@ -48,6 +49,7 @@ -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(IMPORT_LIB_PREFIX)jsscrypto$(IMPORT_LIB_EXTENSION)$(IMPORT_LIB_SUFFIX) -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(IMPORT_LIB_PREFIX)jssmanage$(IMPORT_LIB_EXTENSION)$(IMPORT_LIB_SUFFIX) -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(IMPORT_LIB_PREFIX)jsspkcs11$(IMPORT_LIB_EXTENSION)$(IMPORT_LIB_SUFFIX) + -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(IMPORT_LIB_PREFIX)jssasn1$(IMPORT_LIB_EXTENSION)$(IMPORT_LIB_SUFFIX) -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(IMPORT_LIB_PREFIX)jsspolicy$(IMPORT_LIB_EXTENSION)$(IMPORT_LIB_SUFFIX) -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(IMPORT_LIB_PREFIX)jssssl$(IMPORT_LIB_EXTENSION)$(IMPORT_LIB_SUFFIX) -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(IMPORT_LIB_PREFIX)jssutil$(IMPORT_LIB_EXTENSION)$(IMPORT_LIB_SUFFIX) --- /dev/null +++ b/security/jss/org/mozilla/jss/asn1/ASN1Util.c @@ -0,0 +1,97 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * 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 Services for Java. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +#include "_jni/org_mozilla_jss_asn1_ASN1Util.h" +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/*********************************************************************** + * + * Java_org_mozilla_jss_asn1_ASN1Util_getTagDescriptionByOid + * retrieves OID description by NSS's OID Tag identifier + * the OID byte array is expected to be without the OID Tag (6) and size + * (together 2 bytes) + */ +JNIEXPORT jstring JNICALL +Java_org_mozilla_jss_asn1_ASN1Util_getTagDescriptionByOid(JNIEnv *env, jobject this, jbyteArray oidBA) +{ + SECItem *oid = NULL; + SECOidTag oidTag = SEC_OID_UNKNOWN; + char *oidDesc = NULL; + jstring description= ""; + + if (oidBA == NULL) { + JSS_throwMsg(env, INVALID_PARAMETER_EXCEPTION, + "JSS getTagDescriptionByOid: oidBA null"); + goto finish; + } else { + /************************************************** + * Setup the parameters + *************************************************/ + oid = JSS_ByteArrayToSECItem(env, oidBA); + if (oid == NULL) { + JSS_throwMsg(env, INVALID_PARAMETER_EXCEPTION, + "JSS getTagDescriptionByOid: JSS_ByteArrayToSECItem failed"); + goto finish; + } + + /* + * SECOID_FindOIDTag() returns SEC_OID_UNKNOWN if no match + */ + oidTag = SECOID_FindOIDTag(oid); + if (oidTag == SEC_OID_UNKNOWN) { + JSS_throwMsg(env, INVALID_PARAMETER_EXCEPTION, + "JSS getTagDescriptionByOid: OID UNKNOWN"); + goto finish; + } + + oidDesc = SECOID_FindOIDTagDescription(oidTag); + if (oidDesc == NULL) { + oidDesc = ""; + } + description = (*env)->NewStringUTF(env, oidDesc); + } + +finish: + return description; +} --- a/security/jss/org/mozilla/jss/asn1/ASN1Util.java +++ b/security/jss/org/mozilla/jss/asn1/ASN1Util.java @@ -36,6 +36,8 @@ package org.mozilla.jss.asn1; import java.io.*; +import java.util.Arrays; + import org.mozilla.jss.asn1.InvalidBERException; import org.mozilla.jss.util.Assert; @@ -114,4 +116,71 @@ numRead += nr; } } + + /** + * returns the ECC curve byte array given the X509 public key byte array + * + * @param X509PubKeyBytes byte array of an X509PubKey + * @param withHeader tells if the return byes should inclulde the tag and size header or not + */ + public static byte[] getECCurveBytesByX509PublicKeyBytes(byte[] X509PubKeyBytes, + boolean withHeader) + throws IllegalArgumentException, ArrayIndexOutOfBoundsException, + NullPointerException + { + if ((X509PubKeyBytes == null) || (X509PubKeyBytes.length == 0)) { + throw new IllegalArgumentException("X509PubKeyBytes null"); + } + + /* EC public key OID complete with tag and size */ + byte[] EC_PubOIDBytes_full = + ASN1Util.encode(OBJECT_IDENTIFIER.EC_PUBKEY_OID); + + /* EC public key OID without tag and size */ + byte[] EC_PubOIDBytes = + Arrays.copyOfRange(EC_PubOIDBytes_full, 2, EC_PubOIDBytes_full.length); + + int curveBeginIndex = 0; + for (int idx = 0; idx<= X509PubKeyBytes.length; idx++) { + byte[] tmp = + Arrays.copyOfRange(X509PubKeyBytes, idx, idx+EC_PubOIDBytes.length); + if (Arrays.equals(tmp, EC_PubOIDBytes)) { + curveBeginIndex = idx+ EC_PubOIDBytes.length; + break; + } + } + + int curveByteArraySize = (int) X509PubKeyBytes[curveBeginIndex+ 1]; + + if (withHeader) { + /* actual curve with tag and size */ + byte curve[] = Arrays.copyOfRange(X509PubKeyBytes, curveBeginIndex, curveBeginIndex + curveByteArraySize + 2); + return curve; + } else { + /* actual curve without tag and size */ + byte curve[] = + Arrays.copyOfRange(X509PubKeyBytes, curveBeginIndex + 2, + curveBeginIndex + 2 + curveByteArraySize); + return curve; + } + } + + /** + * getOIDdescription() returns a text description of the OID + * from OID byte array + * the OID byte array is expected to be without the OID Tag (6) and size + * (together 2 bytes) + */ + public static String + getOIDdescription(byte[] oidBA) { + return getTagDescriptionByOid(oidBA); + } + + /** + * get OID description JNI method + */ + private native static String + getTagDescriptionByOid(byte[] oidBA); + + } --- a/security/jss/org/mozilla/jss/asn1/Makefile +++ b/security/jss/org/mozilla/jss/asn1/Makefile @@ -57,7 +57,7 @@ ####################################################################### # (4) Include "local" platform-dependent assignments (OPTIONAL). # ####################################################################### -#include config.mk +include config.mk ####################################################################### --- a/security/jss/org/mozilla/jss/asn1/OBJECT_IDENTIFIER.java +++ b/security/jss/org/mozilla/jss/asn1/OBJECT_IDENTIFIER.java @@ -52,6 +52,12 @@ /////////////////////////////////////////////////////////////////////// /** + * The OID space for EC + */ + public static final OBJECT_IDENTIFIER EC_PUBKEY_OID = + new OBJECT_IDENTIFIER( new long[]{1, 2, 840, 10045, 2, 1} ); + + /** * The OID space for RSA Data Security, Inc. */ public static final OBJECT_IDENTIFIER RSADSI = --- /dev/null +++ b/security/jss/org/mozilla/jss/asn1/config.mk @@ -0,0 +1,41 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 Services for Java. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +TARGETS=$(LIBRARY) +SHARED_LIBRARY= +IMPORT_LIBRARY= + +NO_MD_RELEASE = 1 --- a/security/jss/org/mozilla/jss/asn1/manifest.mn +++ b/security/jss/org/mozilla/jss/asn1/manifest.mn @@ -41,6 +41,8 @@ NS_USE_JDK = 1 +REQUIRES = nspr20 nss + PACKAGE = org/mozilla/jss/asn1 CLASSES = \ @@ -112,3 +114,9 @@ UTCTime.java \ UTF8String.java \ $(NULL) + +CSRCS = \ + ASN1Util.c \ + $(NULL) + +LIBRARY_NAME = jssasn1 --- a/security/jss/org/mozilla/jss/manifest.mn +++ b/security/jss/org/mozilla/jss/manifest.mn @@ -48,6 +48,7 @@ crypto \ SecretDecoderRing \ pkcs11 \ + asn1 \ ssl \ provider \ $(NULL) --- a/security/jss/org/mozilla/jss/pkcs11/PK11ECPublicKey.java +++ b/security/jss/org/mozilla/jss/pkcs11/PK11ECPublicKey.java @@ -61,15 +61,29 @@ // } // } // -// public BigInteger getW() { -// try { -// return new BigInteger( getWByteArray() ); -// } catch(NumberFormatException e) { -// Assert.notReached("Unable to decode DSA public value"); -// return null; -// } -// } -// -// private native byte[] getCurveByteArray(); -// private native byte[] getWByteArray(); + + public BigInteger getCurve() { + try { + return new BigInteger( getCurveByteArray() ); + } catch(NumberFormatException e) { + Assert.notReached("Unable to decode EC curve"); + return null; + } + } + + public byte[] getCurveBA() { + return getCurveByteArray(); + } + + public BigInteger getW() { + try { + return new BigInteger( getWByteArray() ); + } catch(NumberFormatException e) { + Assert.notReached("Unable to decode EC public value"); + return null; + } + } + + private native byte[] getCurveByteArray(); + private native byte[] getWByteArray(); } --- a/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c +++ b/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c @@ -450,6 +450,14 @@ numAttribs = 4; } break; + case CKK_EC: + numAttribs = 1; + attribs[0] = CKA_SIGN; + if (isExtractable) { + attribs[1] = CKA_EXTRACTABLE; + numAttribs = 2; + } + break; case CKK_DSA: attribs[0] = CKA_SIGN; numAttribs = 1; @@ -460,11 +468,6 @@ attribs[0] = CKA_DERIVE; numAttribs = 1; break; - case CKK_EC: - attribs[0] = CKA_SIGN; - attribs[1] = CKA_DERIVE; - numAttribs = 2; - break; default: /* unknown key type */ PR_ASSERT(PR_FALSE); @@ -479,7 +482,7 @@ attribs, numAttribs, NULL /*wincx*/); if( privk == NULL ) { char err[256] = {0}; - PR_snprintf(err, 256, "Key Unwrap failed on token:%d", PR_GetError()); + PR_snprintf(err, 256, "Key Unwrap failed on token:error=%d, keyType=%d", PR_GetError(), keyType); JSS_throwMsg(env, TOKEN_EXCEPTION, err); goto finish; } --- a/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.java +++ b/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.java @@ -459,13 +459,19 @@ if( type == PrivateKey.RSA ) { if( !(publicKey instanceof RSAPublicKey)) { throw new InvalidKeyException("Type of public key does not "+ - "match type of private key"); + "match type of private key which is RSA"); } return ((RSAPublicKey)publicKey).getModulus().toByteArray(); + } else if(type == PrivateKey.EC) { + if( !(publicKey instanceof PK11ECPublicKey) ) { + throw new InvalidKeyException("Type of public key does not "+ + "match type of private key which is EC"); + } + return ((PK11ECPublicKey)publicKey).getW().toByteArray(); } else if(type == PrivateKey.DSA) { if( !(publicKey instanceof DSAPublicKey) ) { throw new InvalidKeyException("Type of public key does not "+ - "match type of private key"); + "match type of private key which is DSA"); } return ((DSAPublicKey)publicKey).getY().toByteArray(); } else { debian/patches/jss-eliminate-java-compiler-warnings.patch0000644000000000000000000005511211772530746020777 0ustar Index: jss/security/jss/org/mozilla/jss/CryptoManager.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/CryptoManager.java 2011-10-04 21:41:14.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/CryptoManager.java 2011-10-04 22:00:46.978107345 +0300 @@ -1231,7 +1231,7 @@ * Imports a single certificate into the permanent certificate * database. * - * @param derCert the certificate you want to add + * @param cert the certificate you want to add * @param nickname the nickname you want to refer to the certificate as * (must not be null) */ @@ -1497,11 +1497,11 @@ public static final String JAR_JDK_VERSION = "JDK_VERSION = N/A"; public static final String - JAR_NSS_VERSION = "NSS_VERSION = NSS_3_12_RTM"; + JAR_NSS_VERSION = "NSS_VERSION = N/A"; public static final String JAR_DBM_VERSION = "DBM_VERSION = N/A"; public static final String - JAR_NSPR_VERSION = "NSPR_VERSION = NSPR_4_7_RTM"; + JAR_NSPR_VERSION = "NSPR_VERSION = N/A"; /** * Loads the JSS dynamic library if necessary. @@ -1539,8 +1539,8 @@ * this thread's token to null will also cause the * InternalKeyStorageToken to be used. * - * @param The token to use for crypto operations. Specifying null - * will cause the InternalKeyStorageToken to be used. + * @param token The token to use for crypto operations. Specifying + * null will cause the InternalKeyStorageToken to be used. */ public void setThreadToken(CryptoToken token) { if( token != null ) { @@ -1684,7 +1684,7 @@ * Verify a certificate in memory. Check if * valid and that we trust the issuer. Verify time * against Now. - * @param certificate in memory + * @param certPackage certificate in memory * @param checkSig verify the signature of the certificate * @param certUsage see exposed certUsage defines to verify Certificate * @return true for success; false otherwise Index: jss/security/jss/org/mozilla/jss/crypto/Cipher.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/Cipher.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/crypto/Cipher.java 2011-10-04 22:00:46.978107345 +0300 @@ -144,8 +144,8 @@ * B is the block size, the padding string consists of * B - (M mod B) octets, each having the value * B - (M mod B). - * @param The block size of the encryption algorithm. Must be greater - * than zero. + * @param blockSize The block size of the encryption algorithm. + * Must be greater than zero. * @see #unPad */ public static byte[] Index: jss/security/jss/org/mozilla/jss/crypto/CryptoToken.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/CryptoToken.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/crypto/CryptoToken.java 2011-10-04 22:00:46.978107345 +0300 @@ -194,7 +194,7 @@ * Login to the token. If a token is logged in, it will not trigger * password callbacks. * - * @param password The password for this token. + * @param pwcb The password callback for this token. * @exception IncorrectPasswordException If the supplied password is * incorrect. * @see #setLoginMode Index: jss/security/jss/org/mozilla/jss/crypto/JSSMessageDigest.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/JSSMessageDigest.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/crypto/JSSMessageDigest.java 2011-10-04 22:00:46.978107345 +0300 @@ -88,7 +88,7 @@ * Completes digestion. * * @return The, ahem, output of the digest operation. - * @param If an error occurs while digesting. + * @exception DigestException If an error occurs while digesting. */ public byte[] digest() throws DigestException { byte[] output = new byte[getOutputSize()]; Index: jss/security/jss/org/mozilla/jss/crypto/PBEKeyGenParams.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/PBEKeyGenParams.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/crypto/PBEKeyGenParams.java 2011-10-04 22:00:46.978107345 +0300 @@ -60,7 +60,7 @@ * Must not be null. It is the responsibility of the caller to * use the right salt length for the algorithm. Most algorithms * use 8 bytes of salt. - * @param The iteration count for the PBE algorithm. + * @param iterations The iteration count for the PBE algorithm. */ public PBEKeyGenParams(Password pass, byte[] salt, int iterations) { if(pass==null || salt==null) { @@ -80,7 +80,7 @@ * Must not be null. It is the responsibility of the caller to * use the right salt length for the algorithm. Most algorithms * use 8 bytes of salt. - * @param The iteration count for the PBE algorithm. + * @param iterations The iteration count for the PBE algorithm. */ public PBEKeyGenParams(char[] pass, byte[] salt, int iterations) { if(pass==null || salt==null) { Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11Token.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11Token.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11Token.java 2011-10-04 22:00:46.978107345 +0300 @@ -228,8 +228,8 @@ * Initialize PIN. This sets the user's new PIN, using the current * security officer PIN for authentication. * - * @param ssopw The security officer's current password. - * @param userpw The user's new password. + * @param ssopwcb The security officer's current password callback. + * @param userpwcb The user's new password callback. * @exception IncorrectPinException If the security officer PIN is * incorrect. * @exception TokenException If the PIN was already initialized, @@ -322,8 +322,8 @@ * Change password. This changes the user's PIN after it has already * been initialized. * - * @param oldPIN The user's old PIN. - * @param newPIN The new PIN. + * @param oldPINcb The user's old PIN callback. + * @param newPINcb The new PIN callback. * @exception IncorrectPasswordException If the old PIN is incorrect. * @exception TokenException If some other error occurs on the token. * Index: jss/security/jss/org/mozilla/jss/pkcs12/SafeBag.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs12/SafeBag.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs12/SafeBag.java 2011-10-04 22:00:46.978107345 +0300 @@ -288,7 +288,7 @@ * as the nickname of the associated cert. * @param localKeyID The localKeyID for the key; should be the same as * the localKeyID of the associated cert. - * @param The password used to encrypt the private key. + * @param password The password used to encrypt the private key. */ public static SafeBag createEncryptedPrivateKeyBag(PrivateKeyInfo privk, String friendlyName, Index: jss/security/jss/org/mozilla/jss/pkcs7/SignerInfo.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs7/SignerInfo.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs7/SignerInfo.java 2011-10-04 22:00:46.978107345 +0300 @@ -430,7 +430,6 @@ * SignerInfo. * @param contentType The type of the content that is signed by this * SignerInfo. - * @param pubkey The public key to use to verify the signature. * @exception NoSuchObjectException If no certificate matching the * the issuer name and serial number can be found. */ Index: jss/security/jss/org/mozilla/jss/pkix/cmc/CMCStatusInfo.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkix/cmc/CMCStatusInfo.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkix/cmc/CMCStatusInfo.java 2011-10-04 22:00:46.978107345 +0300 @@ -108,7 +108,7 @@ * @param status A CMCStatus constant. * @param bodyList The sequence of bodyPartID. * @param statusString A String. - * @param OtherInfo The OtherInfo choice. + * @param otherInfo The OtherInfo choice. */ public CMCStatusInfo(int status, SEQUENCE bodyList, String statusString, OtherInfo otherInfo) { Index: jss/security/jss/org/mozilla/jss/pkix/cmmf/PKIStatusInfo.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkix/cmmf/PKIStatusInfo.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkix/cmmf/PKIStatusInfo.java 2011-10-04 22:00:46.982107345 +0300 @@ -88,7 +88,6 @@ /** * Create a PKIStatusInfo with no failure info. * @param status A PKIStatus constant. - * @param failInfo The bitwise AND of the PKIFailureInfo constants. */ public PKIStatusInfo(int status) { this.status = new INTEGER(status); Index: jss/security/jss/org/mozilla/jss/pkix/primitive/DirectoryString.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkix/primitive/DirectoryString.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkix/primitive/DirectoryString.java 2011-10-04 22:00:46.982107345 +0300 @@ -115,10 +115,6 @@ /** * Converts an ASN.1 DirectoryString to a Java string. - * - * @param dirstr An ANY containing a BER-encoded DirectoryString. - * @exception InvalidBERException If the encoding does not contain a - * valid DirectoryString. */ public String toString() { return asn1String.toString(); @@ -176,6 +172,8 @@ /** * @param implicitTag This parameter is ignored, because * DirectoryStrings (being CHOICEs) cannot have implicit tags. + * @exception InvalidBERException If the encoding does not contain a + * valid DirectoryString. */ public ASN1Value decode(Tag implicitTag, InputStream istream) throws IOException, InvalidBERException Index: jss/security/jss/org/mozilla/jss/provider/javax/crypto/JSSSecretKeyFactorySpi.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/provider/javax/crypto/JSSSecretKeyFactorySpi.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/provider/javax/crypto/JSSSecretKeyFactorySpi.java 2011-10-04 22:00:46.982107345 +0300 @@ -91,14 +91,18 @@ // versions is to use the reflection API. Class specClass = spec.getClass(); try { - Method getSaltMethod = specClass.getMethod("getSalt", null); + Method getSaltMethod = specClass.getMethod("getSalt", + (java.lang.Class) null); Method getIterationMethod = - specClass.getMethod("getIterationCount", null); + specClass.getMethod("getIterationCount", + (java.lang.Class) null); - byte[] salt = (byte[]) getSaltMethod.invoke(spec, null); + byte[] salt = (byte[]) getSaltMethod.invoke(spec, + (java.lang.Class) null); Integer itCountObj = - (Integer) getIterationMethod.invoke(spec,null); + (Integer) getIterationMethod.invoke(spec, + (java.lang.Class) null); int iterationCount = itCountObj.intValue(); Password pass = new Password(spec.getPassword()); Index: jss/security/jss/org/mozilla/jss/ssl/SSLSocket.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/ssl/SSLSocket.java 2011-10-04 21:41:14.810070106 +0300 +++ jss/security/jss/org/mozilla/jss/ssl/SSLSocket.java 2011-10-04 22:00:46.982107345 +0300 @@ -188,11 +188,11 @@ } /** - * Creates an SSL client socket and connects to the specified host and + * Creates an SSL client socket and connects to the specified address and * port. Binds to the given local address and port. Installs the given * callbacks for certificate approval and client certificate selection. * - * @param host The hostname to connect to. + * @param address The IP address to connect to. * @param port The port to connect to. * @param localAddr The local address to bind to. It can be null, in which * case an unspecified local address will be chosen. Index: jss/security/jss/org/mozilla/jss/tests/HMACTest.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/tests/HMACTest.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/tests/HMACTest.java 2011-10-04 22:00:46.982107345 +0300 @@ -155,7 +155,7 @@ /** * Main test method. - * @params args[] + * @param argv */ public static void main(String[] argv) { Index: jss/security/jss/org/mozilla/jss/tests/JCASymKeyGen.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/tests/JCASymKeyGen.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/tests/JCASymKeyGen.java 2011-10-04 22:00:46.982107345 +0300 @@ -116,9 +116,9 @@ } /** * - * @param key - * @param kg - * @return + * @param keyType + * @param provider + * @return javax.crypto.SecretKey key */ public javax.crypto.SecretKey genSecretKey(String keyType, String provider){ javax.crypto.SecretKey key = null; @@ -155,7 +155,7 @@ * * @param keyType * @param provider - * @return + * @return javax.crypto.SecretKey key */ public javax.crypto.SecretKey genPBESecretKey(String keyType, String provider){ @@ -197,8 +197,10 @@ /** * * @param sKey - * @param AlgType - * @param provider + * @param algFamily + * @param algType + * @param providerForEncrypt + * @param providerForDecrypt */ public void testCipher(javax.crypto.SecretKey sKey, String algFamily, String algType, String providerForEncrypt, String providerForDecrypt) @@ -304,8 +306,10 @@ /** * * @param sKey - * @param AlgType - * @param provider + * @param algFamily + * @param algType + * @param providerForEncrypt + * @param providerForDecrypt */ public void testMultiPartCipher(javax.crypto.SecretKey sKey, String algFamily, String algType, String providerForEncrypt, String providerForDecrypt) Index: jss/security/jss/org/mozilla/jss/tests/JSSE_SSLClient.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/tests/JSSE_SSLClient.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/tests/JSSE_SSLClient.java 2011-10-04 22:00:46.982107345 +0300 @@ -78,7 +78,7 @@ /** * Set the protocol type and revision - * @param String sslRevision + * @param fSslRevision */ public void setSslRevision(String fSslRevision) { @@ -91,7 +91,7 @@ /** * Set the host name to connect to. - * @param String hostname + * @param fHost */ public void setHost(String fHost) { this.host = fHost; @@ -99,7 +99,7 @@ /** * Set the port number to connect to. - * @param int portnumber + * @param fPort */ public void setPort(int fPort) { this.port = fPort; @@ -107,7 +107,7 @@ /** * Set the cipher suite name to use. - * @param String cipherSuiteName + * @param fCipherSuite */ public void setCipherSuite(String fCipherSuite) { this.cipherName = fCipherSuite; @@ -115,7 +115,7 @@ /** * Set the location of rsa.pfx - * @param String fKeystoreLoc + * @param fKeystoreLoc */ public void setKeystoreLoc(String fKeystoreLoc) { keystoreLoc = fKeystoreLoc + "/" + keystoreLoc; Index: jss/security/jss/org/mozilla/jss/tests/JSSE_SSLServer.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/tests/JSSE_SSLServer.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/tests/JSSE_SSLServer.java 2011-10-04 22:00:46.982107345 +0300 @@ -75,7 +75,7 @@ /** * Set the provider to use. - * @param String p + * @param p */ public void setProvider(String p) { provider = p; @@ -90,7 +90,7 @@ } /** * Set the location of keystore file. - * @param String fconfigDir + * @param fconfigDir */ public void setKeystore(String fconfigDir) { configDir = fconfigDir; @@ -117,7 +117,7 @@ /** * Start SSLServer and accept connections. - * @param args[] + * @param args */ public void startSSLServer(String[] args) throws Exception { String configDir = ""; Index: jss/security/jss/org/mozilla/jss/tests/JSS_FileUploadClient.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/tests/JSS_FileUploadClient.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/tests/JSS_FileUploadClient.java 2011-10-04 22:00:46.982107345 +0300 @@ -75,7 +75,7 @@ /** * Initialize the desired cipher to be set * on the socket. - * @param int Cipher + * @param aCipher */ public void setCipher(int aCipher) { fCipher = aCipher; @@ -83,7 +83,7 @@ /** * Initialize the hostname to run the server - * @param String ServerName + * @param aHostName */ public void setHostName(String aHostName) { serverHost = aHostName; @@ -91,7 +91,7 @@ /** * Initialize the port to run the server - * @param int port + * @param aPort */ public void setPort(int aPort) { port = aPort; @@ -99,7 +99,7 @@ /** * Initialize the passwords file name - * @param String passwords + * @param aPasswordFile */ public void setPasswordFile(String aPasswordFile) { fPasswordFile = aPasswordFile; @@ -107,7 +107,7 @@ /** * Initialize the cert db path name - * @param String CertDbPath + * @param aCertDbPath */ public void setCertDbPath(String aCertDbPath) { fCertDbPath = aCertDbPath; @@ -116,7 +116,7 @@ /** * Initialize the name of the file to * be used for testing along with full path. - * @param String UploadFile + * @param aUploadFile */ public void setUploadFile(String aUploadFile) { fUploadFile = aUploadFile; @@ -124,7 +124,7 @@ /** * Enable/disable Test Cert Callback. - * @param boolean + * @param aTestCertCallback */ public void setTestCertCallback(boolean aTestCertCallback) { TestCertCallBack = aTestCertCallback; @@ -132,7 +132,7 @@ /** * Set client certificate - * @param String Certificate Nick Name + * @param aClientCertNick Certificate Nick Name */ public void setClientCertNick(String aClientCertNick) { clientCertNick = aClientCertNick; @@ -166,7 +166,7 @@ /** * Set EOF for closing server socket - * @param null for closing server socket + * @param fEof null for closing server socket */ public void setEOF(String fEof) { this.EOF = fEof; Index: jss/security/jss/org/mozilla/jss/tests/JSS_SelfServClient.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/tests/JSS_SelfServClient.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/tests/JSS_SelfServClient.java 2011-10-04 22:00:46.982107345 +0300 @@ -327,7 +327,7 @@ /** * Initialize the desired ciphersuite to be set * on the socket. - * @param int Cipher + * @param aCipher */ public void setCipher(int aCipher) { @@ -379,7 +379,7 @@ /** * Initialize the hostname to run the server - * @param String ServerName + * @param aHostName */ public void setHostName(String aHostName) { serverHost = aHostName; @@ -387,7 +387,7 @@ /** * Initialize the port to run the server - * @param int port + * @param aPort */ public void setPort(int aPort) { port = aPort; @@ -395,7 +395,7 @@ /** * Initialize the passwords file name - * @param String passwords + * @param aPasswordFile */ public void setPasswordFile(String aPasswordFile) { fPasswordFile = aPasswordFile; @@ -403,7 +403,7 @@ /** * Initialize the cert db path name - * @param String CertDbPath + * @param aCertDbPath */ public void setCertDbPath(String aCertDbPath) { fCertDbPath = aCertDbPath; @@ -411,7 +411,7 @@ /** * Enable/disable Test Cert Callback. - * @param boolean + * @param aTestCertCallback */ public void setTestCertCallback(boolean aTestCertCallback) { TestCertCallBack = aTestCertCallback; @@ -419,7 +419,7 @@ /** * Set client certificate - * @param String Certificate Nick Name + * @param aClientCertNick Certificate Nick Name */ public void setClientCertNick(String aClientCertNick) { clientCertNick = aClientCertNick; Index: jss/security/jss/org/mozilla/jss/tests/SSLClientAuth.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/tests/SSLClientAuth.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/tests/SSLClientAuth.java 2011-10-04 22:00:46.986107345 +0300 @@ -71,7 +71,7 @@ * @param rand * @param extensions * @throws java.lang.Exception - * @return + * @return Certificate */ public static Certificate makeCert(String issuerName, String subjectName, int serialNumber, PrivateKey privKey, PublicKey pubKey, int rand, debian/patches/jss-loadlibrary.patch0000644000000000000000000000247711772530746014765 0ustar Index: jss/security/jss/org/mozilla/jss/CryptoManager.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/CryptoManager.java 2011-10-04 20:56:13.937984301 +0300 +++ jss/security/jss/org/mozilla/jss/CryptoManager.java 2011-10-04 20:56:52.085985513 +0300 @@ -1438,11 +1438,20 @@ */ synchronized static void loadNativeLibraries() { - if( ! mNativeLibrariesLoaded ) - { - System.loadLibrary("jss4"); - Debug.trace(Debug.VERBOSE, "jss library loaded"); - mNativeLibrariesLoaded = true; + if( ! mNativeLibrariesLoaded ) { + try { + System.load( "/usr/lib64/jss/libjss4.so" ); + Debug.trace(Debug.VERBOSE, "jss library loaded"); + mNativeLibrariesLoaded = true; + } catch( UnsatisfiedLinkError e ) { + try { + System.load( "/usr/lib/jss/libjss4.so" ); + Debug.trace(Debug.VERBOSE, "jss library loaded"); + mNativeLibrariesLoaded = true; + } catch( UnsatisfiedLinkError f ) { + Debug.trace(Debug.VERBOSE, "jss library load failed"); + } + } } } static private boolean mNativeLibrariesLoaded = false; debian/patches/jss-undo-JCA-deprecations.patch0000644000000000000000000001473411772551110016462 0ustar --- a/security/jss/org/mozilla/jss/crypto/Cipher.java +++ b/security/jss/org/mozilla/jss/crypto/Cipher.java @@ -49,7 +49,6 @@ * it is not necessary to call update if all of the data is * available at once. In this case, all of the input can be processed with one * call to doFinal. - * @deprecated Use the JCA interface instead ({@link javax.crypto.Cipher}) */ public abstract class Cipher { --- a/security/jss/org/mozilla/jss/crypto/CryptoToken.java +++ b/security/jss/org/mozilla/jss/crypto/CryptoToken.java @@ -60,7 +60,6 @@ * @param algorithm The algorithm used for the signing/verification. * @exception java.security.NoSuchAlgorithmException If the given * algorithm is not supported by this provider. - * @deprecated Use the JCA interface instead ({@link java.security.Signature}) */ public abstract org.mozilla.jss.crypto.Signature getSignatureContext(SignatureAlgorithm algorithm) @@ -73,7 +72,6 @@ * @param algorithm The algorithm used for digesting. * @exception java.security.NoSuchAlgorithmException If this provider * does not support the given algorithm. - * @deprecated Use the JCA interface instead ({@link java.security.MessageDigest}) */ public abstract JSSMessageDigest getDigestContext(DigestAlgorithm algorithm) @@ -89,15 +87,11 @@ * @param algorithm The algorithm used for encryption/decryption. * @exception java.security.NoSuchAlgorithmException If this provider * does not support the given algorithm. - * @deprecated Use the JCA interface instead ({@link javax.crypto.Cipher}) */ public abstract Cipher getCipherContext(EncryptionAlgorithm algorithm) throws java.security.NoSuchAlgorithmException, TokenException; - /** - * @deprecated Use the JCA interface instead ({@link javax.crypto.Cipher}) - */ public abstract KeyWrapper getKeyWrapper(KeyWrapAlgorithm algorithm) throws java.security.NoSuchAlgorithmException, TokenException; @@ -123,7 +117,6 @@ * @param algorithm The algorithm that the keys will be used with. * @exception java.security.NoSuchAlgorithmException If this token does not * support the given algorithm. - * @deprecated Use the JCA interface instead ({@link javax.crypto.KeyGenerator}) */ public abstract KeyGenerator getKeyGenerator(KeyGenAlgorithm algorithm) @@ -136,7 +129,6 @@ * cannot be extracted from the current token. * @exception InvalidKeyException If the owning token cannot process * the key to be cloned. - * @deprecated Use the JCA interface instead ({@link javax.crypto.SecretKeyFactory}) */ public SymmetricKey cloneKey(SymmetricKey key) throws SymmetricKey.NotExtractableException, @@ -151,7 +143,6 @@ * DSA, EC, etc.) * @exception java.security.NoSuchAlgorithmException If this token does * not support the given algorithm. - * @deprecated Use the JCA interface instead ({@link java.security.KeyPairGenerator}) */ public abstract KeyPairGenerator getKeyPairGenerator(KeyPairAlgorithm algorithm) --- a/security/jss/org/mozilla/jss/crypto/JSSMessageDigest.java +++ b/security/jss/org/mozilla/jss/crypto/JSSMessageDigest.java @@ -41,7 +41,6 @@ /** * A class for performing message digesting (hashing) and MAC operations. - * @deprecated Use the JCA interface instead ({@link java.security.MessageDigest}) */ public abstract class JSSMessageDigest { --- a/security/jss/org/mozilla/jss/crypto/JSSSecureRandom.java +++ b/security/jss/org/mozilla/jss/crypto/JSSSecureRandom.java @@ -38,7 +38,6 @@ /** * An interface for secure random numbers. - * @deprecated Use the JCA interface instead ({@link java.security.SecureRandom}) */ public interface JSSSecureRandom { --- a/security/jss/org/mozilla/jss/crypto/KeyGenerator.java +++ b/security/jss/org/mozilla/jss/crypto/KeyGenerator.java @@ -43,7 +43,6 @@ /** * Generates symmetric keys for encryption and decryption. - * @deprecated Use the JCA interface instead ({@link javax.crypto.KeyGenerator}) */ public interface KeyGenerator { --- a/security/jss/org/mozilla/jss/crypto/KeyPairGenerator.java +++ b/security/jss/org/mozilla/jss/crypto/KeyPairGenerator.java @@ -49,7 +49,6 @@ * keygenOnInternalToken to find out if this is happening. * * @see org.mozilla.jss.crypto.CryptoToken#getKeyPairGenerator - * @deprecated Use the JCA interface instead ({@link java.security.KeyPairGenerator}) */ public class KeyPairGenerator { --- a/security/jss/org/mozilla/jss/crypto/KeyWrapper.java +++ b/security/jss/org/mozilla/jss/crypto/KeyWrapper.java @@ -40,9 +40,6 @@ import java.security.PublicKey; import java.security.InvalidKeyException; -/** - * @deprecated Use the JCA interface instead ({@link javax.crypto.Cipher}) - */ public interface KeyWrapper { public void initWrap(SymmetricKey wrappingKey, --- a/security/jss/org/mozilla/jss/crypto/Signature.java +++ b/security/jss/org/mozilla/jss/crypto/Signature.java @@ -44,7 +44,6 @@ * Instances of this class can be obtain from CryptoTokens. * * @see org.mozilla.jss.crypto.CryptoToken#getSignatureContext - * @deprecated Use the JCA interface instead ({@link java.security.Signature}) */ public class Signature { --- a/security/jss/org/mozilla/jss/tests/SigTest.java +++ b/security/jss/org/mozilla/jss/tests/SigTest.java @@ -35,8 +35,6 @@ * ***** END LICENSE BLOCK ***** */ /* This program demonstrates how to sign data with keys from JSS * - * Most of this code is deprecated look at JCASigTest.java - * * java -cp ./jss4.jar org.mozilla.jss.tests.SigTest . * passwords "Internal Key Storage Token" * @@ -45,8 +43,6 @@ * Internal Crypto Services Token * Internal Key Storage Token (keys stored in key4.db) * - * @see org.mozilla.jss.tests.JCASigTest - * @deprecated Use the JCA interface instead */ package org.mozilla.jss.tests; --- a/security/jss/org/mozilla/jss/tests/all.pl +++ b/security/jss/org/mozilla/jss/tests/all.pl @@ -541,6 +541,10 @@ $command = "$java -cp $jss_classpath org.mozilla.jss.tests.SigTest $testdir $pwfile"; run_test($testname, $command); +$testname = "Mozilla-JSS NSS Signature "; +$command = "$java -cp $jss_classpath org.mozilla.jss.tests.SigTest $testdir $pwfile"; +run_test($testname, $command); + $testname = "Secret Decoder Ring"; $command = "$java -cp $jss_classpath org.mozilla.jss.tests.TestSDR $testdir $pwfile"; run_test($testname, $command); debian/patches/jss-eliminate-native-compiler-warnings.patch0000644000000000000000000005237211772530746021351 0ustar Index: jss/security/jss/org/mozilla/jss/CryptoManager.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/CryptoManager.c 2011-10-04 21:35:23.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/CryptoManager.c 2011-10-04 21:38:22.226064623 +0300 @@ -55,7 +55,7 @@ #include "pk11util.h" -#if defined(AIX) || defined(HPUX) || defined(LINUX) +#if defined(AIX) || defined(HPUX) #include #endif @@ -106,13 +106,13 @@ getPWFromCallback(PK11SlotInfo *slot, PRBool retry, void *arg); /************************************************************* - * AIX, HP, and Linux signal handling madness + * AIX and HP signal handling madness * * In order for the JVM, kernel, and NSPR to work together, we setup * a signal handler for SIGCHLD that does nothing. This is only done - * on AIX, HP, and Linux. + * on AIX and HP. *************************************************************/ -#if defined(AIX) || defined(HPUX) || defined(LINUX) +#if defined(AIX) || defined(HPUX) static PRStatus handleSigChild(JNIEnv *env) { @@ -300,8 +300,6 @@ jboolean cooperate) { SECStatus rv = SECFailure; - JavaVM *VMs[5]; - jint numVMs; char *szConfigDir = NULL; char *szCertPrefix = NULL; char *szKeyPrefix = NULL; Index: jss/security/jss/org/mozilla/jss/PK11Finder.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/PK11Finder.c 2011-10-04 21:35:23.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/PK11Finder.c 2011-10-04 21:38:22.230064623 +0300 @@ -263,7 +263,7 @@ Java_org_mozilla_jss_CryptoManager_findPrivKeyByCertNative (JNIEnv *env, jobject this, jobject Cert) { - PRThread *pThread; + PRThread * VARIABLE_MAY_NOT_BE_USED pThread=NULL; CERTCertificate *cert; PK11SlotInfo *slot; SECKEYPrivateKey *privKey=NULL; @@ -458,7 +458,7 @@ Java_org_mozilla_jss_CryptoManager_buildCertificateChainNative (JNIEnv *env, jobject this, jobject leafCert) { - PRThread *pThread; + PRThread * VARIABLE_MAY_NOT_BE_USED pThread=NULL; CERTCertificate *leaf; jobjectArray chainArray=NULL; CERTCertDBHandle *certdb; @@ -812,7 +812,7 @@ SECItem *derCerts=NULL; int certi= -1; SECItem theDerCert; - int numCerts; + int numCerts = 0; jbyte *packageBytes=NULL; jsize packageLen; SECStatus status; @@ -1486,7 +1486,7 @@ CERTSignedCrl *crl = NULL; SECItem *packageItem = NULL; int status = SECFailure; - char *url; + char *url = NULL; char *errmsg = NULL; /*************************************************** @@ -1651,7 +1651,7 @@ Java_org_mozilla_jss_CryptoManager_verifyCertificateNowCUNative(JNIEnv *env, jobject self, jstring nickString, jboolean checkSig) { - SECStatus rv = SECFailure; + SECStatus VARIABLE_MAY_NOT_BE_USED rv = SECFailure; SECCertificateUsage currUsage = 0x0000; rv = verifyCertificateNow(env, self, nickString, checkSig, 0, &currUsage); @@ -1736,7 +1736,6 @@ SECStatus rv = SECFailure; SECCertUsage certUsage; SECItem *derCerts[2]; - SECStatus status; CERTCertificate **certArray = NULL; CERTCertDBHandle *certdb = CERT_GetDefaultCertDB(); Index: jss/security/jss/org/mozilla/jss/SecretDecoderRing/KeyManager.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/SecretDecoderRing/KeyManager.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/SecretDecoderRing/KeyManager.c 2011-10-04 21:38:22.230064623 +0300 @@ -358,7 +358,6 @@ { PK11SlotInfo *slot = NULL; PK11SymKey *symk = NULL; - SECStatus status; /* get the slot */ if( JSS_PK11_getTokenSlotPtr(env, tokenObj, &slot) != PR_SUCCESS ) { Index: jss/security/jss/org/mozilla/jss/crypto/PQGParams.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/PQGParams.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/crypto/PQGParams.c 2011-10-04 21:38:22.230064623 +0300 @@ -371,7 +371,7 @@ /*********************************************************************** * Perform the verification. */ - if( PK11_PQG_VerifyParams(pParams, pVfy, &verifyResult) != PR_SUCCESS) { + if( PK11_PQG_VerifyParams(pParams, pVfy, &verifyResult) != SECSuccess) { JSS_throw(env, OUT_OF_MEMORY_ERROR); goto finish; } Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11Cert.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11Cert.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11Cert.c 2011-10-04 21:38:22.230064623 +0300 @@ -62,7 +62,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_mozilla_jss_pkcs11_PK11Cert_getEncoded (JNIEnv *env, jobject this) { - PRThread *pThread; + PRThread * VARIABLE_MAY_NOT_BE_USED pThread; CERTCertificate *cert; SECItem *derCert; jbyteArray derArray=NULL; @@ -118,9 +118,9 @@ JNIEXPORT jint JNICALL Java_org_mozilla_jss_pkcs11_PK11Cert_getVersion (JNIEnv *env, jobject this) { - PRThread *pThread; + PRThread * VARIABLE_MAY_NOT_BE_USED pThread; CERTCertificate *cert; - long lVersion; + long lVersion = 0; pThread = PR_AttachThread(PR_SYSTEM_THREAD, 0, NULL); PR_ASSERT(pThread != NULL); @@ -165,7 +165,7 @@ { CERTCertificate *cert; SECKEYPublicKey *pubk=NULL; - PRThread *pThread; + PRThread * VARIABLE_MAY_NOT_BE_USED pThread; jobject pubKey=NULL; PR_ASSERT(env!=NULL && this!=NULL); @@ -210,7 +210,7 @@ (JNIEnv *env, jobject this) { CERTCertificate *cert; - PRThread *pThread; + PRThread * VARIABLE_MAY_NOT_BE_USED pThread; PR_ASSERT(env!=NULL && this!=NULL); Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11Cipher.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11Cipher.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11Cipher.c 2011-10-04 21:38:22.230064623 +0300 @@ -73,7 +73,7 @@ SECItem *iv=NULL; PK11Context *context=NULL; CK_ATTRIBUTE_TYPE op; - jobject contextObj; + jobject contextObj = NULL; PR_ASSERT(env!=NULL && clazz!=NULL && keyObj!=NULL && algObj!=NULL); Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyGenerator.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11KeyGenerator.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyGenerator.c 2011-10-04 21:38:22.230064623 +0300 @@ -196,7 +196,7 @@ } #endif -static void +static void FUNCTION_MAY_NOT_BE_USED print_secitem(SECItem *item) { int i; int online; Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyPairGenerator.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11KeyPairGenerator.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyPairGenerator.c 2011-10-04 21:38:22.230064623 +0300 @@ -452,7 +452,7 @@ for (i=0; i < item->len; i++) { printf(" %02x",data[i]); } - printf(" : 0x%08x %d\n", data, item->len); + printf(" : %8p %d\n", data, item->len); } /********************************************************************** Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c 2011-10-04 21:38:22.230064623 +0300 @@ -562,7 +562,7 @@ jint keyLen, jbyteArray ivBA, jint usageEnum) { PK11SymKey *symKey=NULL; - CK_MECHANISM_TYPE wrappingMech, keyTypeMech; + CK_MECHANISM_TYPE wrappingMech=0, keyTypeMech=0; SECItem *wrappedKey=NULL, *iv=NULL, *param=NULL; jobject keyObj=NULL; SECKEYPrivateKey *wrappingKey=NULL; Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11MessageDigest.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11MessageDigest.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11MessageDigest.c 2011-10-04 21:38:22.230064623 +0300 @@ -88,7 +88,6 @@ PK11Context *context = NULL; CK_MECHANISM_TYPE mech; SECItem param; - PK11SlotInfo *slot=NULL; jobject contextObj=NULL; mech = JSS_getPK11MechFromAlg(env, algObj); Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11Module.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11Module.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11Module.c 2011-10-04 21:38:22.230064623 +0300 @@ -254,7 +254,7 @@ { SECMODModule *module; - if (JSS_getPtrFromProxy(env, this, &module) != PR_SUCCESS) { + if (JSS_getPtrFromProxy(env, this, (void **)&module) != PR_SUCCESS) { ASSERT_OUTOFMEM(env); goto finish; } Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11PrivKey.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11PrivKey.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11PrivKey.c 2011-10-04 21:38:22.234064623 +0300 @@ -174,7 +174,7 @@ Java_org_mozilla_jss_pkcs11_PK11PrivKey_getKeyType (JNIEnv *env, jobject this) { - PRThread *pThread; + PRThread * VARIABLE_MAY_NOT_BE_USED pThread; SECKEYPrivateKey *privk; KeyType keyType; char* keyTypeFieldName; @@ -259,7 +259,7 @@ (JNIEnv *env, jobject this) { SECKEYPrivateKey *privk; - PRThread *pThread; + PRThread * VARIABLE_MAY_NOT_BE_USED pThread; PR_ASSERT(env!=NULL && this!=NULL); @@ -358,7 +358,6 @@ (JNIEnv *env, jobject this) { SECKEYPrivateKey *key = NULL; - PK11SlotInfo *slot = NULL; SECItem *idItem = NULL; jbyteArray byteArray = NULL; Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11PubKey.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11PubKey.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11PubKey.c 2011-10-04 21:38:22.234064623 +0300 @@ -62,7 +62,7 @@ (JNIEnv *env, jobject this) { SECKEYPublicKey *pubk; - PRThread *pThread; + PRThread * VARIABLE_MAY_NOT_BE_USED pThread; PR_ASSERT(env!=NULL && this!=NULL); @@ -179,7 +179,7 @@ Java_org_mozilla_jss_pkcs11_PK11PubKey_verifyKeyIsOnToken (JNIEnv *env, jobject this, jobject token) { - PRThread *pThread; + PRThread * VARIABLE_MAY_NOT_BE_USED pThread; SECKEYPublicKey *key = NULL; PK11SlotInfo *slot = NULL; PK11SlotInfo *keySlot = NULL; @@ -231,7 +231,7 @@ Java_org_mozilla_jss_pkcs11_PK11PubKey_getKeyType (JNIEnv *env, jobject this) { - PRThread *pThread; + PRThread * VARIABLE_MAY_NOT_BE_USED pThread; SECKEYPublicKey *pubk; KeyType keyType; char* keyTypeFieldName; @@ -454,7 +454,7 @@ { SECKEYPublicKey *pubk; jbyteArray byteArray=NULL; - SECItem *item; + SECItem *item=NULL; PR_ASSERT(env!=NULL && this!=NULL); @@ -526,7 +526,6 @@ { jobject pubkObj=NULL; SECKEYPublicKey *pubk=NULL; - SECStatus rv; SECItem *pubkDER=NULL; /* validate args */ Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11SecureRandom.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11SecureRandom.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11SecureRandom.c 2011-10-04 21:38:22.234064623 +0300 @@ -112,7 +112,7 @@ * "C" data members */ - PRThread* pThread = NULL; + PRThread* VARIABLE_MAY_NOT_BE_USED pThread = NULL; SECStatus status = PR_FALSE; PK11SlotInfo* slot = NULL; @@ -262,7 +262,7 @@ * "C" data members */ - PRThread* pThread = NULL; + PRThread* VARIABLE_MAY_NOT_BE_USED pThread = NULL; SECStatus status = PR_FALSE; Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11Store.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11Store.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11Store.c 2011-10-04 21:38:22.234064623 +0300 @@ -319,7 +319,7 @@ (JNIEnv *env, jobject this, jobject certObject) { CERTCertificate *cert; - SECStatus status; + SECStatus VARIABLE_MAY_NOT_BE_USED status; PR_ASSERT(env!=NULL && this!=NULL); if(certObject == NULL) { @@ -349,7 +349,7 @@ (JNIEnv *env, jobject this, jobject certObject) { CERTCertificate *cert; - SECStatus status; + SECStatus VARIABLE_MAY_NOT_BE_USED status; PR_ASSERT(env!=NULL && this!=NULL); if(certObject == NULL) { Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11SymKey.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11SymKey.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11SymKey.c 2011-10-04 21:38:22.234064623 +0300 @@ -233,7 +233,7 @@ jfieldID typeField=NULL; jobject typeObject=NULL; - if( JSS_PK11_getSymKeyPtr(env, this, &key) != SECSuccess ) { + if( JSS_PK11_getSymKeyPtr(env, this, &key) != PR_SUCCESS ) { ASSERT_OUTOFMEM(env); goto finish; } Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11Token.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11Token.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11Token.c 2011-10-04 21:38:22.234064623 +0300 @@ -961,9 +961,9 @@ jstring keyType, jbyteArray P, jbyteArray Q, jbyteArray G) { PK11SlotInfo *slot; - const char* c_subject; + const char* c_subject=NULL; jboolean isCopy; - unsigned char *b64request; + unsigned char *b64request=NULL; SECItem p, q, g; PQGParams *dsaParams=NULL; const char* c_keyType; @@ -1080,7 +1080,7 @@ SECStatus rv; PRArenaPool *arena; SECItem result_der, result; - SECItem *blob; + SECItem * VARIABLE_MAY_NOT_BE_USED blob; CK_MECHANISM_TYPE signMech; CK_MECHANISM_TYPE keygenMech; Index: jss/security/jss/org/mozilla/jss/provider/java/security/JSSKeyStoreSpi.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/provider/java/security/JSSKeyStoreSpi.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/provider/java/security/JSSKeyStoreSpi.c 2011-10-04 21:38:22.234064623 +0300 @@ -89,7 +89,6 @@ SECKEYPublicKeyList* pubkList = NULL; PK11SymKey *symKey = NULL; CERTCertList *certList = NULL; - SECStatus secstat; /* * Get all private keys @@ -508,7 +507,6 @@ { PK11SlotInfo *slot; EngineGetCertificateCBInfo cbinfo = {NULL,NULL}; - jbyteArray derCertBA = NULL; PRStatus status = PR_FAILURE; if( alias == NULL ) goto finish; @@ -813,7 +811,6 @@ PK11SlotInfo *slot; EngineGetCertificateCBInfo cbinfo = {NULL,NULL}; jboolean retVal = JNI_FALSE; - SECKEYPrivateKey *privk = NULL; if( alias == NULL ) goto finish; Index: jss/security/jss/org/mozilla/jss/ssl/SSLSocket.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/ssl/SSLSocket.c 2011-10-04 21:35:23.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/ssl/SSLSocket.c 2011-10-04 21:38:22.234064623 +0300 @@ -397,7 +397,7 @@ { PRSocketOptionData sockOptions; JSSL_SocketData *sock = NULL; - jint retval; + jint retval=-1; PRStatus status; if( JSSL_getSockData(env, self, &sock) != PR_SUCCESS ) { @@ -874,7 +874,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_socketAvailable( JNIEnv *env, jobject self) { - jint available; + jint available=0; JSSL_SocketData *sock = NULL; if( JSSL_getSockData(env, self, &sock) != PR_SUCCESS ) { Index: jss/security/jss/org/mozilla/jss/ssl/common.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/ssl/common.c 2011-10-04 21:35:23.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/ssl/common.c 2011-10-04 21:38:22.234064623 +0300 @@ -64,7 +64,7 @@ jmethodID excepCons; jobject excepObj; jstring msgString; - jint result; + jint VARIABLE_MAY_NOT_BE_USED result; /* * get the error code and error string @@ -149,8 +149,8 @@ jbyteArray sdArray = NULL; JSSL_SocketData *sockdata = NULL; SECStatus status; - PRFileDesc *newFD; - PRFileDesc *tmpFD; + PRFileDesc *newFD = NULL; + PRFileDesc *tmpFD = NULL; PRFilePrivate *priv = NULL; int socketFamily = 0; @@ -633,7 +633,7 @@ SECStatus status = SECSuccess; PRBool bOption = PR_FALSE; - if( JSSL_getSockData(env, self, &sock) != SECSuccess ) { + if( JSSL_getSockData(env, self, &sock) != PR_SUCCESS ) { goto finish; } @@ -655,7 +655,7 @@ (JNIEnv *env, jobject self, PRNetAddr *addr, LocalOrPeer localOrPeer) { JSSL_SocketData *sock = NULL; - PRStatus status; + PRStatus status=PR_FAILURE; /* get my fd */ if( JSSL_getSockData(env, self, &sock) != PR_SUCCESS ) { @@ -899,7 +899,7 @@ finish: if( currentExcep != NULL && (*env)->ExceptionOccurred(env) == NULL) { - int ret = (*env)->Throw(env, currentExcep); + int VARIABLE_MAY_NOT_BE_USED ret = (*env)->Throw(env, currentExcep); PR_ASSERT(ret == 0); } } Index: jss/security/jss/org/mozilla/jss/ssl/javasock.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/ssl/javasock.c 2011-10-04 21:35:23.274058938 +0300 +++ jss/security/jss/org/mozilla/jss/ssl/javasock.c 2011-10-04 21:38:22.238064623 +0300 @@ -92,7 +92,7 @@ jmethodID getOutputStream, writeMethod; jclass sockClass, osClass; jobject outputStream; - jint arrayLen; + jint arrayLen=-1; PRInt32 retval; /* @@ -211,7 +211,7 @@ jobject sockObj; JNIEnv *env; jbyteArray outbufArray; - PRInt32 retval; + PRInt32 retval=-1; if( GET_ENV(fd->secret->javaVM, env) ) goto finish; @@ -500,7 +500,7 @@ jsock_recv(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRIntervalTime timeout) { - PRInt32 retval; + PRInt32 retval=-1; JNIEnv *env; jobject sockObj; jbyteArray byteArray; @@ -637,7 +637,7 @@ { jclass sockClass; jmethodID method; - jint retval; + jint retval=0; sockClass = (*env)->GetObjectClass(env, sock); if( sockClass == NULL ) goto finish; @@ -1001,12 +1001,6 @@ (PRReservedFN) invalidInt }; -static const PRIOMethods* -getJsockMethods() -{ - return &jsockMethods; -} - static void jsockDestructor(PRFileDesc *fd) { Index: jss/security/jss/org/mozilla/jss/util/jssutil.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/util/jssutil.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/util/jssutil.c 2011-10-04 21:38:22.238064623 +0300 @@ -115,7 +115,7 @@ JSS_throwMsg(JNIEnv *env, char *throwableClassName, char *message) { jclass throwableClass; - jint result; + jint VARIABLE_MAY_NOT_BE_USED result; /* validate arguments */ PR_ASSERT(env!=NULL && throwableClassName!=NULL && message!=NULL); @@ -156,7 +156,7 @@ jclass throwableClass; jobject throwable; jmethodID constructor; - jint result; + jint VARIABLE_MAY_NOT_BE_USED result; PR_ASSERT( (*env)->ExceptionOccurred(env) == NULL ); @@ -222,7 +222,9 @@ PRStatus JSS_getPtrFromProxy(JNIEnv *env, jobject nativeProxy, void **ptr) { +#ifdef DEBUG jclass nativeProxyClass; +#endif jclass proxyClass; jfieldID byteArrayField; jbyteArray byteArray; @@ -745,7 +747,7 @@ void JSS_assertOutOfMem(JNIEnv *env) { - jclass memErrClass; + jclass VARIABLE_MAY_NOT_BE_USED memErrClass; jthrowable excep; PR_ASSERT(env != NULL); @@ -804,7 +806,7 @@ goto finish; } - (*env)->SetByteArrayRegion(env, array, 0, item->len, item->data); + (*env)->SetByteArrayRegion(env, array, 0, item->len, (jbyte*)item->data); finish: return array; Index: jss/security/jss/org/mozilla/jss/util/jssutil.h =================================================================== --- jss.orig/security/jss/org/mozilla/jss/util/jssutil.h 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/util/jssutil.h 2011-10-04 21:38:22.238064623 +0300 @@ -36,6 +36,19 @@ #ifndef JSS_NATIVE_UTIL_H #define JSS_NATIVE_UTIL_H +/* The following #defines are used to suppress undesired compiler warnings + * that have been deemed inappropriate. + * + * IMPORTANT: These are ONLY used on an "as-needed" basis! + */ +#ifdef __GNUC__ +#define FUNCTION_MAY_NOT_BE_USED __attribute__ ((unused)) +#define VARIABLE_MAY_NOT_BE_USED __attribute__ ((unused)) +#else +#define FUNCTION_MAY_NOT_BE_USED +#define VARIABLE_MAY_NOT_BE_USED +#endif + /* Need to include these first. * #include * #include debian/patches/jss-HSM-manufacturerID.patch0000644000000000000000000000525711772551110016002 0ustar diff -up jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyPairGenerator.c.cfu jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyPairGenerator.c --- a/security/jss/org/mozilla/jss/pkcs11/PK11KeyPairGenerator.c.cfu 2011-11-10 17:18:02.706421000 -0800 +++ b/security/jss/org/mozilla/jss/pkcs11/PK11KeyPairGenerator.c 2011-11-10 17:18:23.370442000 -0800 @@ -195,7 +195,8 @@ JSS_PK11_generateKeyPairWithOpFlags(JNIE } PR_GetErrorText(errBuf); } - msgBuf = PR_smprintf("Keypair Generation failed on token: %s", + msgBuf = PR_smprintf("Keypair Generation failed on token with error: %d : %s", + PR_GetError(), errLength>0? errBuf : ""); if(errLength>0) { PR_Free(errBuf); diff -up jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c.cfu jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c --- a/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c.cfu 2011-11-10 17:18:10.767429000 -0800 +++ b/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c 2011-11-10 17:52:34.703491000 -0800 @@ -334,32 +334,36 @@ Java_org_mozilla_jss_pkcs11_PK11KeyWrapp PRBool isExtractable = PR_FALSE; /* special case nethsm and lunasa*/ - CK_UTF8CHAR nethsmLabel[4] = {'N','H','S','M'}; - CK_UTF8CHAR lunasaLabel[4] = {'l','u','n','a'}; + const int numManufacturerIDchars = 7; + CK_UTF8CHAR nethsmManufacturerID[] = {'n','C','i','p','h','e','r'}; + CK_UTF8CHAR lunasaManufacturerID[] = {'S','a','f','e','n','e','t'}; PRBool isNethsm = PR_TRUE; PRBool isLunasa = PR_TRUE; + tokenInfo.manufacturerID[0] = 0; + if( JSS_PK11_getTokenSlotPtr(env, tokenObj, &slot) != PR_SUCCESS) { /* exception was thrown */ goto finish; } - if ( PK11_GetTokenInfo(slot, &tokenInfo) == PR_SUCCESS) { + if ( (PK11_GetTokenInfo(slot, &tokenInfo) == PR_SUCCESS) && + (tokenInfo.manufacturerID[0] != 0)) { int ix = 0; - for(ix=0; ix < 4; ix++) { - if (tokenInfo.label[ix] != nethsmLabel[ix]) { + + for(ix=0; ix < numManufacturerIDchars; ix++) { + if (tokenInfo.manufacturerID[ix] != nethsmManufacturerID[ix]) { isNethsm = PR_FALSE; break; } } - ix = 0; - for(ix=0; ix < 4; ix++) { - if (tokenInfo.label[ix] != lunasaLabel[ix]) { + + for(ix=0; ix < numManufacturerIDchars; ix++) { + if (tokenInfo.manufacturerID[ix] != lunasaManufacturerID[ix]) { isLunasa = PR_FALSE; break; } } - } else { isNethsm = PR_FALSE; isLunasa = PR_FALSE; debian/patches/series0000644000000000000000000000111311772551110012026 0ustar pull_coreconf jss-ipv6.patch jss-loadlibrary.patch jss-ocspSettings.patch jss-ECC_keygen_byCurveName.patch jss-VerifyCertificate.patch jss-bad-error-string-pointer.patch jss-VerifyCertificateReturnCU.patch jss-ECC-HSM-FIPS.patch jss-eliminate-native-compiler-warnings.patch jss-eliminate-java-compiler-warnings.patch jss-PKCS12-FIPS.patch jss-eliminate-native-coverity-defects.patch jss-PBE-PKCS5-V2-secure-P12.patch jss-wrapInToken.patch jss-HSM-manufacturerID.patch jss-ECC-Phase2KeyArchivalRecovery.patch jss-undo-JCA-deprecations.patch jss-undo-BadPaddingException-deprecation.patch debian/patches/jss-eliminate-native-coverity-defects.patch0000644000000000000000000002376111772530746021170 0ustar diff -rupN jss-4.2.6.orig/mozilla/security/coreconf/nsinstall/pathsub.c jss-4.2.6/mozilla/security/coreconf/nsinstall/pathsub.c --- a/security/coreconf/nsinstall/pathsub.c 2004-04-25 08:02:18.000000000 -0700 +++ b/security/coreconf/nsinstall/pathsub.c 2011-09-17 18:37:39.875900000 -0700 @@ -275,9 +275,11 @@ diagnosePath(const char * path) rv = readlink(myPath, buf, sizeof buf); if (rv < 0) { perror("readlink"); - buf[0] = 0; - } else { + buf[0] = 0; + } else if ( rv < BUFSIZ ) { buf[rv] = 0; + } else { + buf[BUFSIZ-1] = 0; } fprintf(stderr, "%s is a link to %s\n", myPath, buf); } else if (S_ISDIR(sb.st_mode)) { diff -rupN jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/CryptoManager.c jss-4.2.6/mozilla/security/jss/org/mozilla/jss/CryptoManager.c --- a/security/jss/org/mozilla/jss/CryptoManager.c 2011-09-17 17:33:08.823975000 -0700 +++ b/security/jss/org/mozilla/jss/CryptoManager.c 2011-09-17 20:09:35.446977000 -0700 @@ -728,14 +728,14 @@ getPWFromCallback(PK11SlotInfo *slot, PR } finish: - if( (exception=(*env)->ExceptionOccurred(env)) != NULL) { #ifdef DEBUG + if( (exception=(*env)->ExceptionOccurred(env)) != NULL) { jclass giveupClass; jmethodID printStackTrace; jclass excepClass; -#endif + (*env)->ExceptionClear(env); -#ifdef DEBUG + giveupClass = (*env)->FindClass(env, GIVE_UP_EXCEPTION); PR_ASSERT(giveupClass != NULL); if( ! (*env)->IsInstanceOf(env, exception, giveupClass) ) { @@ -746,8 +746,12 @@ finish: PR_ASSERT( PR_FALSE ); } PR_ASSERT(returnchars==NULL); -#endif } +#else + if( ((*env)->ExceptionOccurred(env)) != NULL) { + (*env)->ExceptionClear(env); + } +#endif return returnchars; } diff -rupN jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/PK11Finder.c jss-4.2.6/mozilla/security/jss/org/mozilla/jss/PK11Finder.c --- a/security/jss/org/mozilla/jss/PK11Finder.c 2011-09-17 17:33:08.834976000 -0700 +++ b/security/jss/org/mozilla/jss/PK11Finder.c 2011-09-19 16:51:46.438021000 -0700 @@ -768,6 +768,10 @@ static int find_leaf_cert( int *linked = NULL; linked = PR_Malloc( sizeof(int) * numCerts ); + if (linked == NULL) { + status = 0; + goto finish; + } /* initialize the bitmap */ for (i = 0; i < numCerts; i++) { @@ -1735,7 +1739,7 @@ Java_org_mozilla_jss_CryptoManager_verif { SECStatus rv = SECFailure; SECCertUsage certUsage; - SECItem *derCerts[2]; + SECItem *derCerts[2] = { NULL, NULL }; CERTCertificate **certArray = NULL; CERTCertDBHandle *certdb = CERT_GetDefaultCertDB(); @@ -1749,7 +1753,6 @@ Java_org_mozilla_jss_CryptoManager_verif } PR_ASSERT(certdb != NULL); - derCerts[0] = NULL; derCerts[0] = JSS_ByteArrayToSECItem(env, packageArray); derCerts[1] = NULL; diff -rupN jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/crypto/Algorithm.c jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/Algorithm.c --- a/security/jss/org/mozilla/jss/crypto/Algorithm.c 2011-09-17 17:33:08.708976000 -0700 +++ b/security/jss/org/mozilla/jss/crypto/Algorithm.c 2011-09-17 19:37:52.834292000 -0700 @@ -235,7 +235,7 @@ static PRStatus getAlgInfo(JNIEnv *env, jobject alg, JSS_AlgInfo *info) { jint index; - PRStatus status; + PRStatus status = PR_FAILURE; PR_ASSERT(env!=NULL && alg!=NULL && info!=NULL); diff -rupN jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11MessageDigest.c jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11MessageDigest.c --- a/security/jss/org/mozilla/jss/pkcs11/PK11MessageDigest.c 2011-09-17 17:33:08.970975000 -0700 +++ b/security/jss/org/mozilla/jss/pkcs11/PK11MessageDigest.c 2011-09-17 19:47:21.850722000 -0700 @@ -181,7 +181,7 @@ Java_org_mozilla_jss_pkcs11_PK11MessageD PK11Context *context=NULL; jbyte *bytes=NULL; SECStatus status; - unsigned int outLen; + unsigned int outLen = 0; if( JSS_PK11_getCipherContext(env, proxyObj, &context) != PR_SUCCESS) { /* exception was thrown */ diff -rupN jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11PubKey.c jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11PubKey.c --- a/security/jss/org/mozilla/jss/pkcs11/PK11PubKey.c 2011-09-17 17:33:09.013977000 -0700 +++ b/security/jss/org/mozilla/jss/pkcs11/PK11PubKey.c 2011-09-17 18:16:40.231161000 -0700 @@ -273,6 +273,7 @@ Java_org_mozilla_jss_pkcs11_PK11PubKey_g break; case keaKey: keyTypeFieldName = KEA_KEYTYPE_FIELD; + break; default: PR_ASSERT(PR_FALSE); keyTypeFieldName = NULL_KEYTYPE_FIELD; diff -rupN jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Store.c jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Store.c --- a/security/jss/org/mozilla/jss/pkcs11/PK11Store.c 2011-09-17 17:33:09.032977000 -0700 +++ b/security/jss/org/mozilla/jss/pkcs11/PK11Store.c 2011-09-17 19:48:57.776628000 -0700 @@ -390,12 +390,6 @@ importPrivateKey SECStatus status; SECItem nickname; - keyType = JSS_PK11_getKeyType(env, keyTypeObj); - if( keyType == nullKey ) { - /* exception was thrown */ - goto finish; - } - /* * initialize so we can goto finish */ @@ -403,6 +397,12 @@ importPrivateKey derPK.len = 0; + keyType = JSS_PK11_getKeyType(env, keyTypeObj); + if( keyType == nullKey ) { + /* exception was thrown */ + goto finish; + } + PR_ASSERT(env!=NULL && this!=NULL); if(keyArray == NULL) { diff -rupN jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Token.c jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Token.c --- a/security/jss/org/mozilla/jss/pkcs11/PK11Token.c 2011-09-17 17:33:09.050976000 -0700 +++ b/security/jss/org/mozilla/jss/pkcs11/PK11Token.c 2011-09-17 19:53:46.184339000 -0700 @@ -962,12 +962,12 @@ JNIEXPORT jstring JNICALL Java_org_mozil { PK11SlotInfo *slot; const char* c_subject=NULL; - jboolean isCopy; + jboolean isCopy = JNI_FALSE; unsigned char *b64request=NULL; SECItem p, q, g; PQGParams *dsaParams=NULL; const char* c_keyType; - jboolean k_isCopy; + jboolean k_isCopy = JNI_FALSE; SECOidTag signType = SEC_OID_UNKNOWN; PK11RSAGenParams rsaParams; void *params = NULL; diff -rupN jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/ssl/SSLSocket.c jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/SSLSocket.c --- a/security/jss/org/mozilla/jss/ssl/SSLSocket.c 2011-09-17 17:33:09.073977000 -0700 +++ b/security/jss/org/mozilla/jss/ssl/SSLSocket.c 2011-09-17 19:56:20.428184000 -0700 @@ -516,11 +516,6 @@ Java_org_mozilla_jss_ssl_SSLSocket_socke goto finish; } - if( addrBAelems == NULL ) { - ASSERT_OUTOFMEM(env); - goto finish; - } - if(addrBALen != 4 && addrBALen != 16) { JSSL_throwSSLSocketException(env, "Invalid address in connect!"); goto finish; @@ -720,7 +715,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_getCi { JSSL_SocketData *sock=NULL; SECStatus status; - PRBool enabled; + PRBool enabled = PR_FAILURE; /* get the fd */ if( JSSL_getSockData(env, sockObj, &sock) != PR_SUCCESS) { diff -rupN jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/ssl/callbacks.c jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/callbacks.c --- a/security/jss/org/mozilla/jss/ssl/callbacks.c 2004-09-03 11:32:03.000000000 -0700 +++ b/security/jss/org/mozilla/jss/ssl/callbacks.c 2011-09-17 18:15:07.825252000 -0700 @@ -684,17 +684,13 @@ JSSL_ConfirmExpiredPeerCert(void *arg, P * Now check the name field in the cert against the desired hostname. * NB: This is our only defense against Man-In-The-Middle (MITM) attacks! */ - if( peerCert == NULL ) { - rv = SECFailure; + char* hostname = NULL; + hostname = SSL_RevealURL(fd); /* really is a hostname, not a URL */ + if (hostname && hostname[0]) { + rv = CERT_VerifyCertName(peerCert, hostname); + PORT_Free(hostname); } else { - char* hostname = NULL; - hostname = SSL_RevealURL(fd); /* really is a hostname, not a URL */ - if (hostname && hostname[0]) { - rv = CERT_VerifyCertName(peerCert, hostname); - PORT_Free(hostname); - } else { - rv = SECFailure; - } + rv = SECFailure; } } diff -rupN jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/ssl/javasock.c jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/javasock.c --- a/security/jss/org/mozilla/jss/ssl/javasock.c 2011-09-17 17:33:09.094977000 -0700 +++ b/security/jss/org/mozilla/jss/ssl/javasock.c 2011-09-17 19:16:38.546566000 -0700 @@ -95,6 +95,10 @@ writebuf(JNIEnv *env, PRFileDesc *fd, jo jint arrayLen=-1; PRInt32 retval; + if( env == NULL ) { + goto finish; + } + /* * get the OutputStream */ diff -rupN jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/util/NativeErrcodes.c jss-4.2.6/mozilla/security/jss/org/mozilla/jss/util/NativeErrcodes.c --- a/security/jss/org/mozilla/jss/util/NativeErrcodes.c 2002-07-03 17:25:46.000000000 -0700 +++ b/security/jss/org/mozilla/jss/util/NativeErrcodes.c 2011-09-18 23:02:28.130883000 -0700 @@ -427,6 +427,7 @@ JSS_ConvertNativeErrcodeToJava(PRErrorCo #endif key.native = nativeErrcode; + key.java = -1; target = bsearch( &key, errcodeTable, numErrcodes, sizeof(Errcode), errcodeCompare ); diff -rupN jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/util/jssutil.c jss-4.2.6/mozilla/security/jss/org/mozilla/jss/util/jssutil.c --- a/security/jss/org/mozilla/jss/util/jssutil.c 2011-09-17 17:33:09.103977000 -0700 +++ b/security/jss/org/mozilla/jss/util/jssutil.c 2011-09-19 16:38:19.428634000 -0700 @@ -529,7 +529,7 @@ JSS_wipeCharArray(char* array) */ static char* getPWFromConsole() { - char c; + int c; char *ret; int i; char buf[200]; /* no buffer overflow: we bail after 200 chars */ debian/patches/jss-ocspSettings.patch0000644000000000000000000000761311772530746015143 0ustar Index: jss/security/jss/lib/jss.def =================================================================== --- jss.orig/security/jss/lib/jss.def 2011-10-04 21:05:04.170001146 +0300 +++ jss/security/jss/lib/jss.def 2011-10-04 21:05:04.190001146 +0300 @@ -328,6 +328,8 @@ Java_org_mozilla_jss_pkcs11_PK11KeyPairGenerator_generateECKeyPairWithOpFlags; Java_org_mozilla_jss_pkcs11_PK11KeyPairGenerator_generateRSAKeyPairWithOpFlags; Java_org_mozilla_jss_pkcs11_PK11KeyPairGenerator_generateDSAKeyPairWithOpFlags; +Java_org_mozilla_jss_CryptoManager_OCSPCacheSettingsNative; +Java_org_mozilla_jss_CryptoManager_setOCSPTimeoutNative; ;+ local: ;+ *; ;+}; Index: jss/security/jss/org/mozilla/jss/CryptoManager.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/CryptoManager.c 2011-10-04 20:32:37.021939286 +0300 +++ jss/security/jss/org/mozilla/jss/CryptoManager.c 2011-10-04 21:05:04.190001146 +0300 @@ -985,3 +985,45 @@ } } + +/********************************************************************** +* OCSPCacheSettingsNative +* +* Allows configuration of the OCSP responder cache during runtime. +*/ +JNIEXPORT void JNICALL +Java_org_mozilla_jss_CryptoManager_OCSPCacheSettingsNative( + JNIEnv *env, jobject this, + jint ocsp_cache_size, + jint ocsp_min_cache_entry_duration, + jint ocsp_max_cache_entry_duration) +{ + SECStatus rv = SECFailure; + + rv = CERT_OCSPCacheSettings( + ocsp_cache_size, ocsp_min_cache_entry_duration, + ocsp_max_cache_entry_duration); + + if (rv != SECSuccess) { + JSS_throwMsgPrErr(env, + GENERAL_SECURITY_EXCEPTION, + "Failed to set OCSP cache: error "+ PORT_GetError()); + } +} + +JNIEXPORT void JNICALL +Java_org_mozilla_jss_CryptoManager_setOCSPTimeoutNative( + JNIEnv *env, jobject this, + jint ocsp_timeout ) +{ + SECStatus rv = SECFailure; + + rv = CERT_SetOCSPTimeout(ocsp_timeout); + + if (rv != SECSuccess) { + JSS_throwMsgPrErr(env, + GENERAL_SECURITY_EXCEPTION, + "Failed to set OCSP timeout: error "+ PORT_GetError()); + } +} + Index: jss/security/jss/org/mozilla/jss/CryptoManager.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/CryptoManager.java 2011-10-04 21:05:04.182001146 +0300 +++ jss/security/jss/org/mozilla/jss/CryptoManager.java 2011-10-04 21:05:04.190001146 +0300 @@ -1592,4 +1592,41 @@ String ocspResponderCertNickname ) throws GeneralSecurityException; + /** + * change OCSP cache settings + * * @param ocsp_cache_size max cache entries + * * @param ocsp_min_cache_entry_duration minimum seconds to next fetch attempt + * * @param ocsp_max_cache_entry_duration maximum seconds to next fetch attempt + */ + public void OCSPCacheSettings( + int ocsp_cache_size, + int ocsp_min_cache_entry_duration, + int ocsp_max_cache_entry_duration) + throws GeneralSecurityException + { + OCSPCacheSettingsNative(ocsp_cache_size, + ocsp_min_cache_entry_duration, + ocsp_max_cache_entry_duration); + } + + private native void OCSPCacheSettingsNative( + int ocsp_cache_size, + int ocsp_min_cache_entry_duration, + int ocsp_max_cache_entry_duration) + throws GeneralSecurityException; + + /** + * set OCSP timeout value + * * @param ocspTimeout OCSP timeout in seconds + */ + public void setOCSPTimeout( + int ocsp_timeout ) + throws GeneralSecurityException + { + setOCSPTimeoutNative( ocsp_timeout); + } + + private native void setOCSPTimeoutNative( + int ocsp_timeout ) + throws GeneralSecurityException; } debian/patches/jss-bad-error-string-pointer.patch0000644000000000000000000000247311772530746017314 0ustar --- jss-4.2.6.orig/security/jss/org/mozilla/jss/ssl/SSLServerSocket.c 2010-11-17 18:54:56.000000000 -0500 +++ jss-4.2.6/security/jss/org/mozilla/jss/ssl/SSLServerSocket.c 2010-11-18 09:46:34.000000000 -0500 @@ -124,20 +124,16 @@ /* Clean up after PR_interrupt. */ PR_NT_CancelIo(sock->fd); #endif - JSSL_throwSSLSocketException(env, - "Accept operation interrupted with error code " + err); + JSSL_throwSSLSocketException(env, "Accept operation interrupted"); } else if( err == PR_IO_TIMEOUT_ERROR ) { #ifdef WINNT PR_NT_CancelIo(sock->fd); #endif - JSSL_throwSSLSocketException(env, - "Accept operation timed out with error code " + err); + JSSL_throwSSLSocketException(env, "Accept operation timed out"); } else if( err == PR_IO_ERROR ) { - JSSL_throwSSLSocketException(env, - "Accept operation received IO error with error code " + err); + JSSL_throwSSLSocketException(env, "Accept operation received IO error"); } else { - JSSL_throwSSLSocketException(env, - "Accept operation failed with error code " + err); + JSSL_throwSSLSocketException(env, "Accept operation failed"); } goto finish; } debian/patches/jss-ECC_keygen_byCurveName.patch0000644000000000000000000005077311772530746016717 0ustar Index: jss/security/jss/org/mozilla/jss/crypto/KeyPairGeneratorSpi.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/KeyPairGeneratorSpi.java 2011-10-04 20:38:47.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/crypto/KeyPairGeneratorSpi.java 2011-10-04 21:12:27.866015242 +0300 @@ -99,4 +99,6 @@ */ public abstract void setKeyPairUsages(KeyPairGeneratorSpi.Usage[] usages, KeyPairGeneratorSpi.Usage[] usages_mask); + + public abstract int getCurveCodeByName(String curveName) throws InvalidParameterException; } Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyPairGenerator.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11KeyPairGenerator.java 2011-10-04 20:38:47.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyPairGenerator.java 2011-10-04 21:12:27.866015242 +0300 @@ -44,6 +44,7 @@ import java.security.SecureRandom; import java.security.spec.AlgorithmParameterSpec; import java.security.spec.DSAParameterSpec; +import java.util.Hashtable; /** @@ -55,6 +56,246 @@ extends org.mozilla.jss.crypto.KeyPairGeneratorSpi { + // curve code for getting the actual EC curve + private enum ECCurve_Code { + // NIST, SEC2 Prime curves + secp521r1 , // == nistp521 + nistp521 , + secp384r1 , // == nistp384 + nistp384 , + secp256r1 , // == nistp256 + nistp256 , + secp256k1 , + secp224r1 , // == nistp224 + nistp224 , + secp224k1 , + secp192r1 , // == nistp192 + nistp192 , + secp192k1 , + secp160r2 , + secp160r1 , + secp160k1 , + secp128r2 , + secp128r1 , + secp112r2 , + secp112r1 , + // NIST, SEC2 Binary curves + sect571r1 , // == nistb571 + nistb571 , + sect571k1 , // == nistk571 + nistk571 , + sect409r1 , // == nistb409 + nistb409 , + sect409k1 , // == nistk409 + nistk409 , + sect283r1 , // == nistb283 + nistb283 , + sect283k1 , // == nistk283 + nistk283 , + sect239k1 , + sect233r1 , // == nistb233 + nistb233 , + sect233k1 , // == nistk233 + nistk233 , + sect193r2 , + sect193r1 , + nistb163 , + sect163r2 , // == nistb163 + sect163r1 , + sect163k1 , // == nistk163 + nistk163 , + sect131r2 , + sect131r1 , + sect113r2 , + sect113r1 , + // ANSI X9.62 Prime curves + prime239v3 , + prime239v2 , + prime239v1 , + prime192v3 , + prime192v2 , + prime192v1 , // == nistp192 + // prime256v1 == nistp256 + // ANSI X9.62 Binary curves + c2pnb163v1 , + c2pnb163v2 , + c2pnb163v3 , + c2pnb176v1 , + c2tnb191v1 , + c2tnb191v2 , + c2tnb191v3 , + //c2onb191v4 , + //c2onb191v5 , + c2pnb208w1 , + c2tnb239v1 , + c2tnb239v2 , + c2tnb239v3 , + //c2onb239v4 , + //c2onb239v5 , + c2pnb272w1 , + c2pnb304w1 , + c2tnb359v1 , + c2pnb368w1 , + c2tnb431r1 + // no WTLS curves fo now + }; + + private static Hashtable ECCurve_NameToCode = new Hashtable(); + static { + // NIST, SEC2 Prime curves + ECCurve_NameToCode.put( + "secp521r1", ECCurve_Code.secp521r1); + ECCurve_NameToCode.put( + "nistp521", ECCurve_Code.nistp521); + ECCurve_NameToCode.put( + "secp384r1", ECCurve_Code.secp384r1); + ECCurve_NameToCode.put( + "nistp384", ECCurve_Code.nistp384); + ECCurve_NameToCode.put( + "secp256r1", ECCurve_Code.secp256r1); + ECCurve_NameToCode.put( + "nistp256", ECCurve_Code.nistp256); + ECCurve_NameToCode.put( + "secp256k1", ECCurve_Code.secp256k1); + ECCurve_NameToCode.put( + "secp224r1", ECCurve_Code.secp224r1); + ECCurve_NameToCode.put( + "nistp224", ECCurve_Code.nistp224); + ECCurve_NameToCode.put( + "secp224k1", ECCurve_Code.secp224k1); + ECCurve_NameToCode.put( + "secp192r1", ECCurve_Code.secp192r1); + ECCurve_NameToCode.put( + "nistp192", ECCurve_Code.nistp192); + ECCurve_NameToCode.put( + "secp192k1", ECCurve_Code.secp192k1); + ECCurve_NameToCode.put( + "secp160r2", ECCurve_Code.secp160r2); + ECCurve_NameToCode.put( + "secp160r1", ECCurve_Code.secp160r1); + ECCurve_NameToCode.put( + "secp160k1", ECCurve_Code.secp160k1); + ECCurve_NameToCode.put( + "secp128r2", ECCurve_Code.secp128r2); + ECCurve_NameToCode.put( + "secp128r1", ECCurve_Code.secp128r1); + ECCurve_NameToCode.put( + "secp112r2", ECCurve_Code.secp112r2); + ECCurve_NameToCode.put( + "secp112r1", ECCurve_Code.secp112r1); + // NIST, SEC2 Binary curves + ECCurve_NameToCode.put( + "sect571r1", ECCurve_Code.sect571r1); + ECCurve_NameToCode.put( + "nistb571", ECCurve_Code.nistb571); + ECCurve_NameToCode.put( + "sect571k1", ECCurve_Code.sect571k1); + ECCurve_NameToCode.put( + "nistk571", ECCurve_Code.nistk571); + ECCurve_NameToCode.put( + "sect409r1", ECCurve_Code.sect409r1); + ECCurve_NameToCode.put( + "nistb409", ECCurve_Code.nistb409); + ECCurve_NameToCode.put( + "sect409k1", ECCurve_Code.sect409k1); + ECCurve_NameToCode.put( + "nistk409", ECCurve_Code.nistk409); + ECCurve_NameToCode.put( + "sect283r1", ECCurve_Code.sect283r1); + ECCurve_NameToCode.put( + "nistb283", ECCurve_Code.nistb283); + ECCurve_NameToCode.put( + "sect283k1", ECCurve_Code.sect283k1); + ECCurve_NameToCode.put( + "nistk283", ECCurve_Code.nistk283); + ECCurve_NameToCode.put( + "sect239k1", ECCurve_Code.sect239k1); + ECCurve_NameToCode.put( + "sect233r1", ECCurve_Code.sect233r1); + ECCurve_NameToCode.put( + "nistb233", ECCurve_Code.nistb233); + ECCurve_NameToCode.put( + "sect233k1", ECCurve_Code.sect233k1); + ECCurve_NameToCode.put( + "nistk233", ECCurve_Code.nistk233); + ECCurve_NameToCode.put( + "sect193r2", ECCurve_Code.sect193r2); + ECCurve_NameToCode.put( + "sect193r1", ECCurve_Code.sect193r1); + ECCurve_NameToCode.put( + "nistb163", ECCurve_Code.nistb163); + ECCurve_NameToCode.put( + "sect163r2", ECCurve_Code.sect163r2); + ECCurve_NameToCode.put( + "sect163r1", ECCurve_Code.sect163r1); + ECCurve_NameToCode.put( + "sect163k1", ECCurve_Code.sect163k1); + ECCurve_NameToCode.put( + "nistk163", ECCurve_Code.nistk163); + ECCurve_NameToCode.put( + "sect131r2", ECCurve_Code.sect131r2); + ECCurve_NameToCode.put( + "sect131r1", ECCurve_Code.sect131r1); + ECCurve_NameToCode.put( + "sect113r2", ECCurve_Code.sect113r2); + ECCurve_NameToCode.put( + "sect113r1", ECCurve_Code.sect113r1); + // ANSI Prime curves + ECCurve_NameToCode.put( + "prime239v3", ECCurve_Code.prime239v3); + ECCurve_NameToCode.put( + "prime239v2", ECCurve_Code.prime239v2); + ECCurve_NameToCode.put( + "prime239v1", ECCurve_Code.prime239v1); + ECCurve_NameToCode.put( + "prime192v3", ECCurve_Code.prime192v3); + ECCurve_NameToCode.put( + "prime192v2", ECCurve_Code.prime192v2); + ECCurve_NameToCode.put( + "prime192v1", ECCurve_Code.prime192v1); + // ANSI Binary curves + ECCurve_NameToCode.put( + "c2pnb163v1", ECCurve_Code.c2pnb163v1); + ECCurve_NameToCode.put( + "c2pnb163v2", ECCurve_Code.c2pnb163v2); + ECCurve_NameToCode.put( + "c2pnb163v3", ECCurve_Code.c2pnb163v3); + ECCurve_NameToCode.put( + "c2pnb176v1", ECCurve_Code.c2pnb176v1); + ECCurve_NameToCode.put( + "c2tnb191v1", ECCurve_Code.c2tnb191v1); + ECCurve_NameToCode.put( + "c2tnb191v2", ECCurve_Code.c2tnb191v2); + ECCurve_NameToCode.put( + "c2tnb191v3", ECCurve_Code.c2tnb191v3); + //ECCurve_NameToCode.put( + // "c2onb191v4", ECCurve_Code.c2onb191v4); + //ECCurve_NameToCode.put( + // "c2onb191v5", ECCurve_Code.c2onb191v5); + ECCurve_NameToCode.put( + "c2pnb208w1", ECCurve_Code.c2pnb208w1); + ECCurve_NameToCode.put( + "c2tnb239v1", ECCurve_Code.c2tnb239v1); + ECCurve_NameToCode.put( + "c2tnb239v2", ECCurve_Code.c2tnb239v2); + ECCurve_NameToCode.put( + "c2tnb239v3", ECCurve_Code.c2tnb239v3); + //ECCurve_NameToCode.put( + // "c2onb239v4", ECCurve_Code.c2onb239v4); + //ECCurve_NameToCode.put( + // "c2onb239v5", ECCurve_Code.c2onb239v5); + ECCurve_NameToCode.put( + "c2pnb272w1", ECCurve_Code.c2pnb272w1); + ECCurve_NameToCode.put( + "c2pnb304w1", ECCurve_Code.c2pnb304w1); + ECCurve_NameToCode.put( + "c2tnb359v1", ECCurve_Code.c2tnb359v1); + ECCurve_NameToCode.put( + "c2pnb368w1", ECCurve_Code.c2pnb368w1); + ECCurve_NameToCode.put( + "c2tnb431r1", ECCurve_Code.c2tnb431r1); + } + // opFlag constants: each of these flags specifies a crypto operation // the key will support. Their values must match the same-named C // preprocessor macros defined in the PKCS #11 header pkcs11t.h. @@ -167,7 +408,15 @@ } } else { Assert._assert( algorithm == KeyPairAlgorithm.EC ); - params = getCurve(strength); + if (strength < 112) { + // for EC, "strength" is actually a code for curves defined in + // ECCurve_Code + params = getECCurve(strength); + } else { + // this is the old method of strength to curve mapping, + // which is somewhat defective + params = getCurve(strength); + } } } @@ -646,6 +895,189 @@ static final OBJECT_IDENTIFIER CURVE_SECG_T571R1 = SECG_EC_CURVE.subBranch(39); + // the EC curvecode to oid hash table + private static Hashtable mECCurve_CodeToCurve = new Hashtable(); + static { + // SEG Prime curves + mECCurve_CodeToCurve.put( + ECCurve_Code.secp521r1.ordinal(), (Object) CURVE_SECG_P521R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistp521.ordinal(), (Object) CURVE_SECG_P521R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.secp384r1.ordinal(), (Object) CURVE_SECG_P384R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistp384.ordinal(), (Object) CURVE_SECG_P384R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.secp256r1.ordinal(), (Object) CURVE_ANSI_P256V1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistp256.ordinal(), (Object) CURVE_ANSI_P256V1); + mECCurve_CodeToCurve.put( + ECCurve_Code.secp256k1.ordinal(), (Object) CURVE_SECG_P256K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.secp224r1.ordinal(), (Object) CURVE_SECG_P224R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistp224.ordinal(), (Object) CURVE_SECG_P224R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.secp224k1.ordinal(), (Object) CURVE_SECG_P224K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.secp192r1.ordinal(), (Object) CURVE_ANSI_P192V1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistp192.ordinal(), (Object) CURVE_ANSI_P192V1); + mECCurve_CodeToCurve.put( + ECCurve_Code.secp192k1.ordinal(), (Object) CURVE_SECG_P192K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.secp160r2.ordinal(), (Object) CURVE_SECG_P160R2); + mECCurve_CodeToCurve.put( + ECCurve_Code.secp160r1.ordinal(), (Object) CURVE_SECG_P160R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.secp160k1.ordinal(), (Object) CURVE_SECG_P160K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.secp128r2.ordinal(), (Object) CURVE_SECG_P128R2); + mECCurve_CodeToCurve.put( + ECCurve_Code.secp128r1.ordinal(), (Object) CURVE_SECG_P128R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.secp112r2.ordinal(), (Object) CURVE_SECG_P112R2); + mECCurve_CodeToCurve.put( + ECCurve_Code.secp112r1.ordinal(), (Object) CURVE_SECG_P112R1); + // SEG Binary curves + mECCurve_CodeToCurve.put( + ECCurve_Code.sect571r1.ordinal(), (Object) CURVE_SECG_T571R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistb571.ordinal(), (Object) CURVE_SECG_T571R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect571k1.ordinal(), (Object) CURVE_SECG_T571K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistk571.ordinal(), (Object) CURVE_SECG_T571K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect409r1.ordinal(), (Object) CURVE_SECG_T409R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistb409.ordinal(), (Object) CURVE_SECG_T409R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect409k1.ordinal(), (Object) CURVE_SECG_T409K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistk409.ordinal(), (Object) CURVE_SECG_T409K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect283r1.ordinal(), (Object) CURVE_SECG_T283R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistb283.ordinal(), (Object) CURVE_SECG_T283R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect283k1.ordinal(), (Object) CURVE_SECG_T283K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistk283.ordinal(), (Object) CURVE_SECG_T283K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect239k1.ordinal(), (Object) CURVE_SECG_T239K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect233r1.ordinal(), (Object) CURVE_SECG_T233R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistb233.ordinal(), (Object) CURVE_SECG_T233R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect233k1.ordinal(), (Object) CURVE_SECG_T233K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistk233.ordinal(), (Object) CURVE_SECG_T233K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect193r2.ordinal(), (Object) CURVE_SECG_T193R2); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect193r1.ordinal(), (Object) CURVE_SECG_T193R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistb163.ordinal(), (Object) CURVE_SECG_T163K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect163r2.ordinal(), (Object) CURVE_SECG_T163R2); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect163r1.ordinal(), (Object) CURVE_SECG_T163R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect163k1.ordinal(), (Object) CURVE_SECG_T163K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.nistk163.ordinal(), (Object) CURVE_SECG_T163K1); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect131r2.ordinal(), (Object) CURVE_SECG_T131R2); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect131r1.ordinal(), (Object) CURVE_SECG_T131R1); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect113r2.ordinal(), (Object) CURVE_SECG_T113R2); + mECCurve_CodeToCurve.put( + ECCurve_Code.sect113r1.ordinal(), (Object) CURVE_SECG_T113R1); + // ANSI Prime curves + mECCurve_CodeToCurve.put( + ECCurve_Code.prime239v3.ordinal(), (Object) CURVE_ANSI_P239V3); + mECCurve_CodeToCurve.put( + ECCurve_Code.prime239v2.ordinal(), (Object) CURVE_ANSI_P239V2); + mECCurve_CodeToCurve.put( + ECCurve_Code.prime239v1.ordinal(), (Object) CURVE_ANSI_P239V1); + mECCurve_CodeToCurve.put( + ECCurve_Code.prime192v3.ordinal(), (Object) CURVE_ANSI_P192V3); + mECCurve_CodeToCurve.put( + ECCurve_Code.prime192v2.ordinal(), (Object) CURVE_ANSI_P192V2); + mECCurve_CodeToCurve.put( + ECCurve_Code.prime192v1.ordinal(), (Object) CURVE_ANSI_P192V1); + // ANSI Binary curves + mECCurve_CodeToCurve.put( + ECCurve_Code.c2pnb163v1.ordinal(), (Object) CURVE_ANSI_PNB163V1); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2pnb163v2.ordinal(), (Object) CURVE_ANSI_PNB163V2); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2pnb163v3.ordinal(), (Object) CURVE_ANSI_PNB163V3); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2pnb176v1.ordinal(), (Object) CURVE_ANSI_PNB176V1); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2tnb191v1.ordinal(), (Object) CURVE_ANSI_TNB191V1); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2tnb191v2.ordinal(), (Object) CURVE_ANSI_TNB191V2); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2tnb191v3.ordinal(), (Object) CURVE_ANSI_TNB191V3); + //mECCurve_CodeToCurve.put( + // ECCurve_Code.c2onb191v4.ordinal(), (Object) CURVE_ANSI_ONB191V4); + //mECCurve_CodeToCurve.put( + // ECCurve_Code.c2onb191v5.ordinal(), (Object) CURVE_ANSI_ONB191V5); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2pnb208w1.ordinal(), (Object) CURVE_ANSI_PNB208W1); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2tnb239v1.ordinal(), (Object) CURVE_ANSI_TNB239V1); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2tnb239v2.ordinal(), (Object) CURVE_ANSI_TNB239V2); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2tnb239v3.ordinal(), (Object) CURVE_ANSI_TNB239V3); + //mECCurve_CodeToCurve.put( + // ECCurve_Code.c2onb239v4.ordinal(), (Object) CURVE_ANSI_ONB239V4); + //mECCurve_CodeToCurve.put( + // ECCurve_Code.c2onb239v5.ordinal(), (Object) CURVE_ANSI_ONB239V5); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2pnb272w1.ordinal(), (Object) CURVE_ANSI_PNB272W1); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2pnb304w1.ordinal(), (Object) CURVE_ANSI_PNB304W1); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2tnb359v1.ordinal(), (Object) CURVE_ANSI_TNB359V1); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2pnb368w1.ordinal(), (Object) CURVE_ANSI_PNB368W1); + mECCurve_CodeToCurve.put( + ECCurve_Code.c2tnb431r1.ordinal(), (Object) CURVE_ANSI_TNB431R1); + } + + public int getCurveCodeByName(String curveName) + throws InvalidParameterException { + if (curveName == null) + throw new InvalidParameterException(); + ECCurve_Code c = (ECCurve_Code) ECCurve_NameToCode.get(curveName); + if (c == null) + throw new InvalidParameterException(curveName); + return c.ordinal(); + } + + /* + * getECCurve + * maps curvecode to the actual oid of the curve and + * returns the PK11ParameterSpec + */ + private AlgorithmParameterSpec getECCurve(int curvecode) + throws InvalidParameterException + { + OBJECT_IDENTIFIER oid; + + oid = (OBJECT_IDENTIFIER) mECCurve_CodeToCurve.get(curvecode); + if (oid == null) + throw new IllegalArgumentException("curvecode ="+curvecode); + return new PK11ParameterSpec(ASN1Util.encode(oid)); + } + private AlgorithmParameterSpec getCurve(int strength) throws InvalidParameterException { Index: jss/security/jss/org/mozilla/jss/crypto/KeyPairGenerator.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/KeyPairGenerator.java 2011-10-04 21:11:05.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/crypto/KeyPairGenerator.java 2011-10-04 21:13:02.314016336 +0300 @@ -199,6 +199,11 @@ engine.setKeyPairUsages(usages,usages_mask); } + public int getCurveCodeByName(String curveName) + throws InvalidParameterException { + return engine.getCurveCodeByName(curveName); + } + protected KeyPairAlgorithm algorithm; protected KeyPairGeneratorSpi engine; } debian/patches/pull_coreconf0000644000000000000000000177015711772530746013430 0ustar Use the coreconf Makefile mechanism diff -Naur security/coreconf/AIX.mk mozilla/security/coreconf/AIX.mk --- a/security/coreconf/AIX.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/AIX.mk 2005-09-16 20:09:23.000000000 +0300 @@ -0,0 +1,99 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# Config stuff for AIX. + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +# +# There are two implementation strategies available on AIX: +# pthreads, and pthreads-user. The default is pthreads. +# In both strategies, we need to use pthread_user.c, instead of +# aix.c. The fact that aix.c is never used is somewhat strange. +# +# So we need to do the following: +# - Default (PTHREADS_USER not defined in the environment or on +# the command line): +# Set PTHREADS_USER=1, USE_PTHREADS=1 +# - PTHREADS_USER=1 set in the environment or on the command line: +# Do nothing. +# +ifeq ($(PTHREADS_USER),1) + USE_PTHREADS = # just to be safe + IMPL_STRATEGY = _PTH_USER +else + USE_PTHREADS = 1 + PTHREADS_USER = 1 +endif + +DEFAULT_COMPILER = xlc_r + +CC = xlc_r +CCC = xlC_r + +CPU_ARCH = rs6000 + +RANLIB = ranlib + +OS_CFLAGS = -DAIX -DSYSV +OS_LIBS += -blibpath:/usr/lib:/lib -lc -lm + +DSO_LDOPTS = -brtl -bnortllib -bM:SRE -bnoentry +MKSHLIB = $(LD) $(DSO_LDOPTS) -blibpath:/usr/lib:/lib -lc -lm + +AIX_WRAP = $(DIST)/lib/aixwrap.o +AIX_TMP = $(OBJDIR)/_aix_tmp.o + +ifdef MAPFILE +DSO_LDOPTS += -bexport:$(MAPFILE) +else +DSO_LDOPTS += -bexpall +endif + +PROCESS_MAP_FILE = grep -v ';+' $< | grep -v ';-' | \ + sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' > $@ + +ifdef BUILD_OPT + OPTIMIZER += -qmaxmem=-1 +endif + +ifeq ($(USE_64), 1) + OS_CFLAGS += -DAIX_64BIT + OBJECT_MODE=64 + export OBJECT_MODE +endif + diff -Naur security/coreconf/arch.mk mozilla/security/coreconf/arch.mk --- a/security/coreconf/arch.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/arch.mk 2009-06-05 05:14:49.000000000 +0300 @@ -0,0 +1,341 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Howard Chu +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +####################################################################### +# Master "Core Components" macros for getting the OS architecture # +# defines these symbols: +# 64BIT_TAG +# OS_ARCH (from uname -r) +# OS_TEST (from uname -m) +# OS_RELEASE (from uname -v and/or -r) +# OS_TARGET User defined, or set to OS_ARCH +# CPU_ARCH (from unmame -m or -p, ONLY on WINNT) +# OS_CONFIG OS_TARGET + OS_RELEASE +# OBJDIR_TAG +# OBJDIR_NAME +####################################################################### + +# +# Macros for getting the OS architecture +# + +ifeq ($(USE_64), 1) + 64BIT_TAG=_64 +else + 64BIT_TAG= +endif + +OS_ARCH := $(subst /,_,$(shell uname -s)) + +# +# Attempt to differentiate between sparc and x86 Solaris +# + +OS_TEST := $(shell uname -m) +ifeq ($(OS_TEST),i86pc) + OS_RELEASE := $(shell uname -r)_$(OS_TEST) +else + OS_RELEASE := $(shell uname -r) +endif + +# +# Force the IRIX64 machines to use IRIX. +# + +ifeq ($(OS_ARCH),IRIX64) + OS_ARCH = IRIX +endif + +# +# Force the older BSD/OS versions to use the new arch name. +# + +ifeq ($(OS_ARCH),BSD_386) + OS_ARCH = BSD_OS +endif + +# +# Catch Deterim if SVR4 is NCR or UNIXWARE +# + +ifeq ($(OS_ARCH),UNIX_SV) + ifneq ($(findstring NCR, $(shell grep NCR /etc/bcheckrc | head -1 )),) + OS_ARCH = NCR + else + # Make UnixWare something human readable + OS_ARCH = UNIXWARE + endif + + # Get the OS release number, not 4.2 + OS_RELEASE := $(shell uname -v) +endif + +ifeq ($(OS_ARCH),UNIX_System_V) + OS_ARCH = NEC +endif + +ifeq ($(OS_ARCH),AIX) + OS_RELEASE := $(shell uname -v).$(shell uname -r) +endif + +# +# Distinguish between OSF1 V4.0B and V4.0D +# + +ifeq ($(OS_ARCH)$(OS_RELEASE),OSF1V4.0) + OS_VERSION := $(shell uname -v) + ifeq ($(OS_VERSION),564) + OS_RELEASE := V4.0B + endif + ifeq ($(OS_VERSION),878) + OS_RELEASE := V4.0D + endif +endif + +# +# SINIX changes name to ReliantUNIX with 5.43 +# + +ifeq ($(OS_ARCH),ReliantUNIX-N) + OS_ARCH = ReliantUNIX + OS_RELEASE = 5.4 +endif + +ifeq ($(OS_ARCH),SINIX-N) + OS_ARCH = ReliantUNIX + OS_RELEASE = 5.4 +endif + +# +# Handle FreeBSD 2.2-STABLE, Linux 2.0.30-osfmach3, and +# IRIX 6.5-ALPHA-1289139620. +# + +ifeq (,$(filter-out Linux FreeBSD IRIX,$(OS_ARCH))) + OS_RELEASE := $(shell echo $(OS_RELEASE) | sed 's/-.*//') +endif + +ifeq ($(OS_ARCH),Linux) + OS_RELEASE := $(subst ., ,$(OS_RELEASE)) + ifneq ($(words $(OS_RELEASE)),1) + OS_RELEASE := $(word 1,$(OS_RELEASE)).$(word 2,$(OS_RELEASE)) + endif +endif + +# +# For OS/2 +# +ifeq ($(OS_ARCH),OS_2) + OS_ARCH = OS2 + OS_RELEASE := $(shell uname -v) +endif + +####################################################################### +# Master "Core Components" macros for getting the OS target # +####################################################################### + +# +# Note: OS_TARGET should be specified on the command line for gmake. +# When OS_TARGET=WIN95 is specified, then a Windows 95 target is built. +# The difference between the Win95 target and the WinNT target is that +# the WinNT target uses Windows NT specific features not available +# in Windows 95. The Win95 target will run on Windows NT, but (supposedly) +# at lesser performance (the Win95 target uses threads; the WinNT target +# uses fibers). +# +# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no +# cross-compilation. +# + +# +# The following hack allows one to build on a WIN95 machine (as if +# s/he were cross-compiling on a WINNT host for a WIN95 target). +# It also accomodates for MKS's and Cygwin's uname.exe. +# +ifeq ($(OS_ARCH),WIN95) + OS_ARCH = WINNT + OS_TARGET = WIN95 +endif +ifeq ($(OS_ARCH),Windows_95) + OS_ARCH = Windows_NT + OS_TARGET = WIN95 +endif +ifeq ($(OS_ARCH),CYGWIN_95-4.0) + OS_ARCH = CYGWIN_NT-4.0 + OS_TARGET = WIN95 +endif +ifeq ($(OS_ARCH),CYGWIN_98-4.10) + OS_ARCH = CYGWIN_NT-4.0 + OS_TARGET = WIN95 +endif +ifeq ($(OS_ARCH),CYGWIN_ME-4.90) + OS_ARCH = CYGWIN_NT-4.0 + OS_TARGET = WIN95 +endif + +# +# On WIN32, we also define the variable CPU_ARCH, if it isn't already. +# +ifndef CPU_ARCH + ifeq ($(OS_ARCH), WINNT) + CPU_ARCH := $(shell uname -p) + ifeq ($(CPU_ARCH),I386) + CPU_ARCH = x386 + endif + endif +endif + +# If uname -s returns "Windows_NT", we assume that we are using +# the uname.exe in MKS toolkit. +# +# The -r option of MKS uname only returns the major version number. +# So we need to use its -v option to get the minor version number. +# Moreover, it doesn't have the -p option, so we need to use uname -m. +# +ifeq ($(OS_ARCH), Windows_NT) + OS_ARCH = WINNT + OS_MINOR_RELEASE := $(shell uname -v) + # strip leading 0 + OS_MINOR_RELEASE := $(patsubst 0%,%,$(OS_MINOR_RELEASE)) + OS_RELEASE := $(OS_RELEASE).$(OS_MINOR_RELEASE) + ifndef CPU_ARCH + CPU_ARCH := $(shell uname -m) + # + # MKS's uname -m returns "586" on a Pentium machine. + # + ifneq (,$(findstring 86,$(CPU_ARCH))) + CPU_ARCH = x386 + endif + endif +endif +# +# If uname -s returns "CYGWIN_NT-4.0", we assume that we are using +# the uname.exe in the Cygwin tools. +# +ifeq (CYGWIN_NT,$(findstring CYGWIN_NT,$(OS_ARCH))) + OS_RELEASE := $(patsubst CYGWIN_NT-%,%,$(OS_ARCH)) + OS_ARCH = WINNT + ifndef CPU_ARCH + ifeq (WOW64,$(findstring WOW64,$(OS_RELEASE))) + OS_RELEASE := $(patsubst %-WOW64,%,$(OS_RELEASE)) + endif + CPU_ARCH := $(shell uname -m) + # + # Cygwin's uname -m returns "i686" on a Pentium Pro machine. + # + ifneq (,$(findstring 86,$(CPU_ARCH))) + CPU_ARCH = x386 + endif + endif +endif +# +# If uname -s returns "MINGW32_NT-5.1", we assume that we are using +# the uname.exe in the MSYS toolkit. +# +ifeq (MINGW32_NT,$(findstring MINGW32_NT,$(OS_ARCH))) + OS_RELEASE := $(patsubst MINGW32_NT-%,%,$(OS_ARCH)) + OS_ARCH = WINNT + USE_MSYS = 1 + ifndef CPU_ARCH + CPU_ARCH := $(shell uname -m) + # + # MSYS's uname -m returns "i686" on a Pentium Pro machine. + # + ifneq (,$(findstring 86,$(CPU_ARCH))) + CPU_ARCH = x386 + endif + endif +endif + +ifndef OS_TARGET + OS_TARGET = $(OS_ARCH) +endif + +ifeq ($(OS_TARGET), WIN95) + OS_RELEASE = 4.0 +endif + +ifdef OS_TARGET_RELEASE + OS_RELEASE = $(OS_TARGET_RELEASE) +endif + +# +# This variable is used to get OS_CONFIG.mk. +# + +OS_CONFIG = $(OS_TARGET)$(OS_RELEASE) + +# +# OBJDIR_TAG depends on the predefined variable BUILD_OPT, +# to distinguish between debug and release builds. +# + +ifdef BUILD_OPT + OBJDIR_TAG = $(64BIT_TAG)_OPT +else + ifdef BUILD_IDG + OBJDIR_TAG = $(64BIT_TAG)_IDG + else + OBJDIR_TAG = $(64BIT_TAG)_DBG + endif +endif + +# +# The following flags are defined in the individual $(OS_CONFIG).mk +# files. +# +# CPU_TAG is defined if the CPU is not the most common CPU. +# COMPILER_TAG is defined if the compiler is not the default compiler. +# IMPL_STRATEGY may be defined too. +# + +OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ + +ifeq (,$(filter-out WIN%,$(OS_TARGET))) +ifndef BUILD_OPT +# +# Define USE_DEBUG_RTL if you want to use the debug runtime library +# (RTL) in the debug build +# +ifdef USE_DEBUG_RTL + OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJD +endif +endif +endif + +MK_ARCH = included diff -Naur security/coreconf/BeOS.mk mozilla/security/coreconf/BeOS.mk --- a/security/coreconf/BeOS.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/BeOS.mk 2009-09-03 07:56:59.000000000 +0300 @@ -0,0 +1,79 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 2002 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +XP_DEFINE := $(XP_DEFINE:-DXP_UNIX=-DXP_BEOS) + +USE_PTHREADS = + +ifeq ($(USE_PTHREADS),1) + IMPL_STRATEGY = _PTH +endif + +CC = gcc +CCC = g++ +RANLIB = ranlib + +DEFAULT_COMPILER = gcc + +ifeq ($(OS_TEST),ppc) + OS_REL_CFLAGS = -Dppc + CPU_ARCH = ppc +else + OS_REL_CFLAGS = -Di386 + CPU_ARCH = x86 +endif + +MKSHLIB = $(CC) -nostart -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) +ifdef BUILD_OPT + OPTIMIZER = -O2 +endif + +OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wall -Wno-switch -pipe +OS_LIBS = -lbe + +DEFINES += -DBEOS + +ifdef USE_PTHREADS + DEFINES += -D_REENTRANT +endif + +ARCH = beos + +DSO_CFLAGS = -fPIC +DSO_LDOPTS = diff -Naur security/coreconf/BSD_OS.mk mozilla/security/coreconf/BSD_OS.mk --- a/security/coreconf/BSD_OS.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/BSD_OS.mk 2009-09-03 07:56:59.000000000 +0300 @@ -0,0 +1,89 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Kurt J. Lidl +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DEFAULT_COMPILER = gcc +CC = gcc +CCC = g++ +RANLIB = ranlib + +ifeq ($(OS_TEST),i386) + OS_REL_CFLAGS = -D__i386__ + CPU_ARCH = x86 +else +ifeq ($(OS_TEST),ppc) + OS_REL_CFLAGS = -D__ppc__ + CPU_ARCH = ppc +else +ifeq ($(OS_TEST),sparc) + OS_REL_CFLAGS = -D__sparc__ + CPU_ARCH = sparc +else +# treat the ultrasparc like a regular sparc, at least for now! +ifeq ($(OS_TEST),sparc_v9) + OS_REL_CFLAGS = -D__sparc__ + CPU_ARCH = sparc +endif +endif +endif +endif + +DLL_SUFFIX = so + +OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wall -Wno-switch -DBSD_OS -DBSDI -Dunix -DHAVE_STRERROR -DHAVE_BSD_FLOCK + +ARCH = bsdos + +DSO_CFLAGS = -fPIC -DPIC +DSO_LDOPTS = -shared -Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) + +ifdef LIBRUNPATH +DSO_LDOPTS += -Wl,-R$(LIBRUNPATH) +endif + +MKSHLIB = $(CC) $(DSO_LDOPTS) +ifdef MAPFILE +# Add LD options to restrict exported symbols to those in the map file +endif +# Change PROCESS to put the mapfile in the correct format for this platform +PROCESS_MAP_FILE = cp $< $@ + +G++INCLUDES = -I/usr/include/g++ + +INCLUDES += -I/usr/X11R6/include diff -Naur security/coreconf/command.mk mozilla/security/coreconf/command.mk --- a/security/coreconf/command.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/command.mk 2007-10-24 00:55:00.000000000 +0300 @@ -0,0 +1,72 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +####################################################################### +# Master "Core Components" default command macros; # +# can be overridden in .mk # +####################################################################### + +AS = $(CC) +ASFLAGS += $(CFLAGS) +CCF = $(CC) $(CFLAGS) +LINK_DLL = $(LINK) $(OS_DLLFLAGS) $(DLLFLAGS) +LINK_EXE = $(LINK) $(OS_LFLAGS) $(LFLAGS) +CFLAGS = $(OPTIMIZER) $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) \ + $(XCFLAGS) +PERL = perl +RANLIB = echo +TAR = /bin/tar +# +# For purify +# +NOMD_CFLAGS += $(OPTIMIZER) $(NOMD_OS_CFLAGS) $(XP_DEFINE) $(DEFINES) \ + $(INCLUDES) $(XCFLAGS) + +# Optimization of code for size +# OPT_CODE_SIZE +# =1: The code can be optimized for size. +# The code is actually optimized for size only if ALLOW_OPT_CODE_SIZE=1 +# in a given source code directory (in manifest.mn) +# =0: Never optimize the code for size. +# +# Default value = 0 +# Can be overridden from the make command line. +ifndef OPT_CODE_SIZE +OPT_CODE_SIZE = 0 +endif + +MK_COMMAND = included diff -Naur security/coreconf/config.mk mozilla/security/coreconf/config.mk --- a/security/coreconf/config.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/config.mk 2011-07-03 09:13:29.000000000 +0300 @@ -0,0 +1,209 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# Configuration information for building in the "Core Components" source module + +####################################################################### +# [1.0] Master "Core Components" source and release # +# tags # +####################################################################### +ifndef MK_ARCH +include $(CORE_DEPTH)/coreconf/arch.mk +endif + +####################################################################### +# [2.0] Master "Core Components" default command macros # +# (NOTE: may be overridden in $(OS_TARGET)$(OS_RELEASE).mk) # +####################################################################### +ifndef MK_COMMAND +include $(CORE_DEPTH)/coreconf/command.mk +endif + +####################################################################### +# [3.0] Master "Core Components" -specific macros # +# (dependent upon tags) # +# # +# We are moving towards just having a $(OS_TARGET).mk file # +# as opposed to multiple $(OS_TARGET)$(OS_RELEASE).mk files, # +# one for each OS release. # +####################################################################### + +TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \ + AIX RISCOS WINNT WIN95 WINCE Linux + +ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET))) +include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk +else +include $(CORE_DEPTH)/coreconf/$(OS_TARGET)$(OS_RELEASE).mk +endif + +####################################################################### +# [4.0] Master "Core Components" source and release tags # +# (dependent upon tags) # +####################################################################### +PLATFORM = $(OBJDIR_NAME) + +####################################################################### +# [5.0] Master "Core Components" release tags # +# (dependent upon tags) # +####################################################################### +ifndef MK_TREE +include $(CORE_DEPTH)/coreconf/tree.mk +endif + +####################################################################### +# [6.0] Master "Core Components" source and release tags # +# NOTE: A component is also called a module or a subsystem. # +# (dependent upon $(MODULE) being defined on the # +# command line, as an environment variable, or in individual # +# makefiles, or more appropriately, manifest.mn) # +####################################################################### +ifndef MK_MODULE +include $(CORE_DEPTH)/coreconf/module.mk +endif + +####################################################################### +# [7.0] Master "Core Components" release tags # +# (dependent upon $(MODULE) being defined on the # +# command line, as an environment variable, or in individual # +# makefiles, or more appropriately, manifest.mn) # +####################################################################### +ifndef MK_VERSION +include $(CORE_DEPTH)/coreconf/version.mk +endif + +####################################################################### +# [8.0] Master "Core Components" macros to figure out # +# binary code location # +# (dependent upon tags) # +####################################################################### +ifndef MK_LOCATION +include $(CORE_DEPTH)/coreconf/location.mk +endif + +####################################################################### +# [9.0] Master "Core Components" -specific source path # +# (dependent upon , , # +# , and tags) # +####################################################################### +ifndef MK_SOURCE +include $(CORE_DEPTH)/coreconf/source.mk +endif + +####################################################################### +# [10.0] Master "Core Components" include switch for support header # +# files # +# (dependent upon , , , # +# and tags) # +####################################################################### +ifndef MK_HEADERS +include $(CORE_DEPTH)/coreconf/headers.mk +endif + +####################################################################### +# [11.0] Master "Core Components" for computing program prefixes # +####################################################################### +ifndef MK_PREFIX +include $(CORE_DEPTH)/coreconf/prefix.mk +endif + +####################################################################### +# [12.0] Master "Core Components" for computing program suffixes # +# (dependent upon tags) # +####################################################################### +ifndef MK_SUFFIX +include $(CORE_DEPTH)/coreconf/suffix.mk +endif + +####################################################################### +# [13.0] Master "Core Components" for defining JDK # +# (dependent upon , , and tags)# +####################################################################### +ifdef NS_USE_JDK +include $(CORE_DEPTH)/coreconf/jdk.mk +endif + +####################################################################### +# [14.0] Master "Core Components" rule set # +####################################################################### +ifndef MK_RULESET +include $(CORE_DEPTH)/coreconf/ruleset.mk +endif + +####################################################################### +# [15.0] Dependencies. +####################################################################### + +-include $(MKDEPENDENCIES) + +####################################################################### +# [16.0] Global environ ment defines +####################################################################### + +ifdef NSS_ENABLE_ECC +DEFINES += -DNSS_ENABLE_ECC +endif + +ifdef NSS_ECC_MORE_THAN_SUITE_B +DEFINES += -DNSS_ECC_MORE_THAN_SUITE_B +endif + +ifdef NSS_ALLOW_UNSUPPORTED_CRITICAL +DEFINES += -DNSS_ALLOW_UNSUPPORTED_CRITICAL +endif + +ifdef BUILD_LIBPKIX_TESTS +DEFINES += -DBUILD_LIBPKIX_TESTS +endif + +ifdef NSS_DISABLE_DBM +DEFINES += -DNSS_DISABLE_DBM +endif + +# Avoid building object leak test code for optimized library +ifndef BUILD_OPT +ifdef PKIX_OBJECT_LEAK_TEST +DEFINES += -DPKIX_OBJECT_LEAK_TEST +endif +endif + +# This allows all library and tools code to use the util function +# implementations directly from libnssutil3, rather than the wrappers +# in libnss3 which are present for binary compatibility only +DEFINES += -DUSE_UTIL_DIRECTLY +USE_UTIL_DIRECTLY = 1 + diff -Naur security/coreconf/coreconf.dep mozilla/security/coreconf/coreconf.dep --- a/security/coreconf/coreconf.dep 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/coreconf.dep 2009-07-30 00:50:47.000000000 +0300 @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * 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 the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/* + * A dummy header file that is a dependency for all the object files. + * Used to force a full recompilation of NSS in Mozilla's Tinderbox + * depend builds. See comments in rules.mk. + */ + +#error "Do not include this header file." + diff -Naur security/coreconf/coreconf.pl mozilla/security/coreconf/coreconf.pl --- a/security/coreconf/coreconf.pl 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/coreconf.pl 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,160 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +sub recursive_copy { + local($fromdir); + local($todir); + local(@dirlist); + $fromdir = shift; + $todir = shift; + + print STDERR "recursive copy called with $fromdir, $todir\n"; + +#remove any trailing slashes. + $fromdir =~ s/\/$//; + $todir =~ s/\/$//; + + opendir(DIR, $fromdir); + @dirlist = readdir DIR; + close DIR; + + + foreach $file (@dirlist) { + if (! (($file eq "." ) || ($file eq "..") )) { + + if (-d "$fromdir/$file") { + print STDERR "handling directory $todir/$file\n"; + &rec_mkdir("$todir/$file"); + &recursive_copy("$fromdir/$file","$todir/$file"); + } + else { + print STDERR "handling file $fromdir/$file\n"; + &my_copy("$fromdir/$file","$todir/$file"); + } + } + } +} + +sub parse_argv { + +# print STDERR "Parsing Variables\n"; + + foreach $q ( @ARGV ) { + if (! ($q =~ /=/)) { + $var{$lastassigned} .= " $q"; + } + else { + $q =~ /^([^=]*)=(.*)/; + $left = $1; + $right = $2; + + $right =~ s/ *$//; + $var{$left} = $right; + + $lastassigned = $left; + + } + print STDERR "Assigned $lastassigned = $var{$lastassigned}\n"; + } +} + + +# usage: &my_copy("dir/fromfile","dir2/tofile"); +# do a 'copy' - files only, 'to' MUST be a filename, not a directory. + +# fix this to be able to use copy on win nt. + +sub my_copy { + local($from); + local($to); + local($cpcmd); + + $from = shift; + $to = shift; + + if ( ! defined $var{OS_ARCH}) { + die "OS_ARCH not defined!"; + } + else { + if ($var{OS_ARCH} eq 'WINNT') { + $cpcmd = 'cp'; + } + else { + $cpcmd = 'cp'; + } + print STDERR "COPYING: $cpcmd $from $to\n"; + system("$cpcmd $from $to"); + } +} + + +sub old_my_copy { + local($from); + local($to); + + $from = shift; + $to = shift; + open(FIN, "<$from") || die("Can't read from file $from\n"); + if ( ! open(FOUT,">$to")) { + close FIN; + die "Can't write to file $to\n"; + } + while (read(FIN, $buf, 100000)) { + print FOUT $buf; + } + close (FIN); + close (FOUT); +} + +sub rec_mkdir { + local($arg); + local($t); + local($q); + + $arg = shift; + $t = ""; + foreach $q (split(/\//,$arg)) { + $t .= $q; + if (! ($t =~ /\.\.$/)) { + if ($t =~ /./) { + mkdir($t,0775); + } + } + $t.= '/'; + } +} + +1; diff -Naur security/coreconf/cpdist.pl mozilla/security/coreconf/cpdist.pl --- a/security/coreconf/cpdist.pl 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/cpdist.pl 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,199 @@ +#! /usr/local/bin/perl +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +require('coreconf.pl'); + +#######-- read in variables on command line into %var + +&parse_argv; + +### do the copy + +print STDERR "RELEASE TREE / MODULE = $var{RELEASE_TREE} $var{MODULE}\n"; + + + +# 1 +if ($var{RELEASE} eq "") { exit; } # Can't do release here, so exit. + +# 2 +#if (! ($var{RELEASE} =~ /\//)) { # if no specific version is specified in RELEASE variable +# $component = $var{RELEASE}; +#} +#else { # if a subcomponent/version is given in the RELEASE variable +# $var{RELEASE} =~ m|^([^/]*)/|; +# $component = $1; # everything before the first slash; +# } + +# 3 +$path = $var{RELEASE}; + + +# 4 +# find out what directory we would create for 'today' + +$year = (localtime)[5] + 1900; +$month = (localtime)[4] + 1; +$day = (localtime)[3]; +$today = sprintf( "%d%02d%02d", $year, $month, $day ); + +# 5 +# if version is null, then set the version to today. +if ($var{"RELEASE_VERSION"} eq "") { + $var{"RELEASE_VERSION"} = $today; +} + +#6 +$version = $var{"RELEASE_VERSION"}; # set RELEASE_VERSION to passed in variable + +#7 +# if version is today, then we will want to make a 'current' link. + +if ($version eq $today) { + $create_current = 1; +} + +#8 +# version can be a) passed in value from command line, b) value in manifest.mn +# or c) computed value such as '19970909' + + +$dir = "$var{'RELEASE_TREE'}/$path"; + +#9 +if (! (-e "$dir/$version" && -d "$dir/$version")) { + print "making dir $dir \n"; + &rec_mkdir("$dir/$version"); +} + + + +print "version = $version\n"; +print "path = $path\n"; +print "var{release_tree} = $var{'RELEASE_TREE'}\n"; +print "dir = $dir = RELEASE_TREE/path\n"; + + +#10 +if ($create_current == 1) { + +# unlinking and linking always occurs, even if the link is correct + print "unlinking $dir/current\n"; + unlink("$dir/current"); + + print "putting version number $today into 'current' file.."; + + open(FILE,">$dir/current") || die " couldn't open current\n"; + print FILE "$today\n"; + close(FILE); + print " ..done\n" + +} + +&rec_mkdir("$dir/$version/$var{'RELEASE_MD_DIR'}"); +&rec_mkdir("$dir/$version/$var{'RELEASE_XP_DIR'}"); + + + + +foreach $jarfile (split(/ /,$var{FILES}) ) { + print STDERR "---------------------------------------------\n"; + + $jarinfo = $var{$jarfile}; + + ($jardir,$jaropts) = split(/\|/,$jarinfo); + + if ($jaropts =~ /f/) { + print STDERR "Copying files $jardir....\n"; + } + else { + print STDERR "Copying jar file $jarfile....\n"; + } + + print "jaropts = $jaropts\n"; + + if ($jaropts =~ /m/) { + $destdir = $var{"RELEASE_MD_DIR"}; + print "found m, using MD dir $destdir\n"; + } + elsif ($jaropts =~ /x/) { + $destdir = $var{"RELEASE_XP_DIR"}; + print "found x, using XP dir $destdir\n"; + } + else { + die "Error: must specify m or x in jar options in $jarinfo line\n"; + } + + + $distdir = "$dir/$version/$destdir"; + + + + if ($jaropts =~ /f/) { + + print "splitting: \"$jardir\"\n"; + for $srcfile (split(/ /,$jardir)) { + +#if srcfile has a slash + if ($srcfile =~ m|/|) { +#pull out everything before the last slash into $1 + $srcfile =~ m|(.*)/|; + $distsubdir = "/$1"; + print "making dir $distdir$distsubdir\n"; + &rec_mkdir("$distdir$distsubdir"); + } + print "copy: from $srcfile\n"; + print " to $distdir$distsubdir\n"; + $srcprefix = ""; + if ($jaropts =~/m/) { + $srcprefix = "$var{'PLATFORM'}/"; + } + system("cp $srcprefix$srcfile $distdir$distsubdir"); + } + } + else { + $srcfile = "$var{SOURCE_RELEASE_PREFIX}/$jardir/$jarfile"; + + print "copy: from $srcfile\n"; + print " to $distdir\n"; + + system("cp $srcfile $distdir"); + + } + + } + diff -Naur security/coreconf/Darwin.mk mozilla/security/coreconf/Darwin.mk --- a/security/coreconf/Darwin.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/Darwin.mk 2011-08-25 02:57:43.000000000 +0300 @@ -0,0 +1,147 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DEFAULT_COMPILER = gcc + +CC = gcc +CCC = g++ +RANLIB = ranlib + +ifndef CPU_ARCH +# When cross-compiling, CPU_ARCH should already be defined as the target +# architecture, set to powerpc or i386. +CPU_ARCH := $(shell uname -p) +endif + +ifeq (,$(filter-out i%86,$(CPU_ARCH))) +ifdef USE_64 +CC += -arch x86_64 +override CPU_ARCH = x86_64 +else +OS_REL_CFLAGS = -Di386 +CC += -arch i386 +override CPU_ARCH = x86 +endif +else +ifeq (arm,$(CPU_ARCH)) +# Nothing set for arm currently. +else +OS_REL_CFLAGS = -Dppc +CC += -arch ppc +endif +endif + +ifneq (,$(MACOS_SDK_DIR)) + GCC_VERSION_FULL := $(shell $(CC) -dumpversion) + GCC_VERSION_MAJOR := $(shell echo $(GCC_VERSION_FULL) | awk -F. '{ print $$1 }') + GCC_VERSION_MINOR := $(shell echo $(GCC_VERSION_FULL) | awk -F. '{ print $$2 }') + GCC_VERSION = $(GCC_VERSION_MAJOR).$(GCC_VERSION_MINOR) + + ifeq (,$(filter-out 2 3,$(GCC_VERSION_MAJOR))) + # GCC <= 3 + DARWIN_SDK_FRAMEWORKS = -F$(MACOS_SDK_DIR)/System/Library/Frameworks + ifneq (,$(shell find $(MACOS_SDK_DIR)/Library/Frameworks -maxdepth 0)) + DARWIN_SDK_FRAMEWORKS += -F$(MACOS_SDK_DIR)/Library/Frameworks + endif + DARWIN_SDK_CFLAGS = -nostdinc -isystem $(MACOS_SDK_DIR)/usr/include/gcc/darwin/$(GCC_VERSION) -isystem $(MACOS_SDK_DIR)/usr/include $(DARWIN_SDK_FRAMEWORKS) + DARWIN_SDK_LDFLAGS = -L$(MACOS_SDK_DIR)/usr/lib/gcc/darwin -L$(MACOS_SDK_DIR)/usr/lib/gcc/darwin/$(GCC_VERSION_FULL) -L$(MACOS_SDK_DIR)/usr/lib + DARWIN_SDK_SHLIBFLAGS = $(DARWIN_SDK_LDFLAGS) $(DARWIN_SDK_FRAMEWORKS) + NEXT_ROOT = $(MACOS_SDK_DIR) + export NEXT_ROOT + else + # GCC >= 4 + DARWIN_SDK_CFLAGS = -isysroot $(MACOS_SDK_DIR) + ifneq (4.0.0,$(GCC_VERSION_FULL)) + # gcc > 4.0.0 passes -syslibroot to ld based on -isysroot. + # Don't add -isysroot to DARWIN_SDK_LDFLAGS, because the programs + # that are linked with those flags also get DARWIN_SDK_CFLAGS. + DARWIN_SDK_SHLIBFLAGS = -isysroot $(MACOS_SDK_DIR) + else + # gcc 4.0.0 doesn't pass -syslibroot to ld, it needs to be + # explicit. + DARWIN_SDK_LDFLAGS = -Wl,-syslibroot,$(MACOS_SDK_DIR) + DARWIN_SDK_SHLIBFLAGS = $(DARWIN_SDK_LDFLAGS) + endif + endif + + LDFLAGS += $(DARWIN_SDK_LDFLAGS) +endif + +# "Commons" are tentative definitions in a global scope, like this: +# int x; +# The meaning of a common is ambiguous. It may be a true definition: +# int x = 0; +# or it may be a declaration of a symbol defined in another file: +# extern int x; +# Use the -fno-common option to force all commons to become true +# definitions so that the linker can catch multiply-defined symbols. +# Also, common symbols are not allowed with Darwin dynamic libraries. + +OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wall -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK $(DARWIN_SDK_CFLAGS) + +ifdef BUILD_OPT +ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE)) + OPTIMIZER = -Oz +else + OPTIMIZER = -O2 +endif +ifdef MOZ_DEBUG_SYMBOLS + ifdef MOZ_DEBUG_FLAGS + OPTIMIZER += $(MOZ_DEBUG_FLAGS) + else + OPTIMIZER += -gdwarf-2 -gfull + endif +endif +endif + +ARCH = darwin + +DSO_CFLAGS = -fPIC +# May override this with different compatibility and current version numbers. +DARWIN_DYLIB_VERSIONS = -compatibility_version 1 -current_version 1 +# May override this with -bundle to create a loadable module. +DSO_LDOPTS = -dynamiclib $(DARWIN_DYLIB_VERSIONS) -install_name @executable_path/$(notdir $@) -headerpad_max_install_names + +MKSHLIB = $(CC) $(DSO_LDOPTS) $(DARWIN_SDK_SHLIBFLAGS) +DLL_SUFFIX = dylib +PROCESS_MAP_FILE = grep -v ';+' $< | grep -v ';-' | \ + sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,^,_,' > $@ + +USE_SYSTEM_ZLIB = 1 +ZLIB_LIBS = -lz diff -Naur security/coreconf/FreeBSD.mk mozilla/security/coreconf/FreeBSD.mk --- a/security/coreconf/FreeBSD.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/FreeBSD.mk 2009-08-22 08:33:09.000000000 +0300 @@ -0,0 +1,90 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DEFAULT_COMPILER = gcc +CC = gcc +CCC = g++ +RANLIB = ranlib + +CPU_ARCH = $(OS_TEST) +ifeq ($(CPU_ARCH),i386) +CPU_ARCH = x86 +endif +ifeq ($(CPU_ARCH),pc98) +CPU_ARCH = x86 +endif +ifeq ($(CPU_ARCH),amd64) +CPU_ARCH = x86_64 +endif + +OS_CFLAGS = $(DSO_CFLAGS) -ansi -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK + +DSO_CFLAGS = -fPIC +DSO_LDOPTS = -shared -Wl,-soname -Wl,$(notdir $@) + +# +# The default implementation strategy for FreeBSD is pthreads. +# +ifndef CLASSIC_NSPR +USE_PTHREADS = 1 +DEFINES += -D_THREAD_SAFE -D_REENTRANT +OS_LIBS += -pthread +DSO_LDOPTS += -pthread +endif + +ARCH = freebsd + +MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo elf) + +ifeq ($(MOZ_OBJFORMAT),elf) +DLL_SUFFIX = so +else +DLL_SUFFIX = so.1.0 +endif + +MKSHLIB = $(CC) $(DSO_LDOPTS) +ifdef MAPFILE + MKSHLIB += -Wl,--version-script,$(MAPFILE) +endif +PROCESS_MAP_FILE = grep -v ';-' $< | \ + sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ + +G++INCLUDES = -I/usr/include/g++ + +INCLUDES += -I/usr/X11R6/include diff -Naur security/coreconf/headers.mk mozilla/security/coreconf/headers.mk --- a/security/coreconf/headers.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/headers.mk 2010-07-30 05:25:55.000000000 +0300 @@ -0,0 +1,56 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +####################################################################### +# Master "Core Components" include switch for support header files # +####################################################################### + +# +# Always append source-side machine-dependent (md) and cross-platform +# (xp) include paths +# + +INCLUDES += -I$(SOURCE_MDHEADERS_DIR) -I$(SOURCE_XPHEADERS_DIR) + +# +# Only append source-side private cross-platform include paths for +# sectools +# + +INCLUDES += -I$(SOURCE_XPPRIVATE_DIR) + +MK_HEADERS = included diff -Naur security/coreconf/HP-UXA.09.03.mk mozilla/security/coreconf/HP-UXA.09.03.mk --- a/security/coreconf/HP-UXA.09.03.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UXA.09.03.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,49 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# +# On HP-UX 9, the default (and only) implementation strategy is +# classic nspr. +# +ifeq ($(OS_RELEASE),A.09.03) + DEFAULT_IMPL_STRATEGY = _CLASSIC +endif + +# +# Config stuff for HP-UXA.09.03 +# +include $(CORE_DEPTH)/coreconf/HP-UXA.09.mk diff -Naur security/coreconf/HP-UXA.09.07.mk mozilla/security/coreconf/HP-UXA.09.07.mk --- a/security/coreconf/HP-UXA.09.07.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UXA.09.07.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,48 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# On HP-UX 9, the default (and only) implementation strategy is +# classic nspr. + +ifeq ($(OS_RELEASE),A.09.07) + DEFAULT_IMPL_STRATEGY = _CLASSIC +endif + +# +# Config stuff for HP-UXA.09.07 +# +include $(CORE_DEPTH)/coreconf/HP-UXA.09.mk diff -Naur security/coreconf/HP-UXA.09.mk mozilla/security/coreconf/HP-UXA.09.mk --- a/security/coreconf/HP-UXA.09.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UXA.09.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,43 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# +# Config stuff for HP-UXA.09 +# +include $(CORE_DEPTH)/coreconf/HP-UX.mk + +OS_CFLAGS += -DHPUX9 diff -Naur security/coreconf/HP-UXB.10.01.mk mozilla/security/coreconf/HP-UXB.10.01.mk --- a/security/coreconf/HP-UXB.10.01.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UXB.10.01.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,44 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +ifeq ($(OS_RELEASE),B.10.01) + DEFAULT_IMPL_STRATEGY = _CLASSIC +endif + +# +# Config stuff for HP-UXB.10.01 +# +include $(CORE_DEPTH)/coreconf/HP-UXB.10.mk diff -Naur security/coreconf/HP-UXB.10.10.mk mozilla/security/coreconf/HP-UXB.10.10.mk --- a/security/coreconf/HP-UXB.10.10.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UXB.10.10.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,54 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# On HP-UX 10.10 and 10.20, the default implementation strategy is +# pthreads (actually DCE threads). Classic nspr is also available. + +ifeq ($(OS_RELEASE),B.10.10) + DEFAULT_IMPL_STRATEGY = _PTH +endif + +# +# Config stuff for HP-UXB.10.10 +# +include $(CORE_DEPTH)/coreconf/HP-UXB.10.mk + +OS_CFLAGS += -DHPUX10_10 + +ifeq ($(USE_PTHREADS),1) + OS_CFLAGS += -D_REENTRANT +endif diff -Naur security/coreconf/HP-UXB.10.20.mk mozilla/security/coreconf/HP-UXB.10.20.mk --- a/security/coreconf/HP-UXB.10.20.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UXB.10.20.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,54 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# On HP-UX 10.10 and 10.20, the default implementation strategy is +# pthreads (actually DCE threads). Classic nspr is also available. + +ifeq ($(OS_RELEASE),B.10.20) + DEFAULT_IMPL_STRATEGY = _PTH +endif + +# +# Config stuff for HP-UXB.10.20 +# +include $(CORE_DEPTH)/coreconf/HP-UXB.10.mk + +OS_CFLAGS += -DHPUX10_20 + +ifeq ($(USE_PTHREADS),1) + OS_CFLAGS += -D_REENTRANT +endif diff -Naur security/coreconf/HP-UXB.10.30.mk mozilla/security/coreconf/HP-UXB.10.30.mk --- a/security/coreconf/HP-UXB.10.30.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UXB.10.30.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,60 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# On HP-UX 10.30 and 11.00, the default implementation strategy is +# pthreads. Classic nspr and pthreads-user are also available. + +ifeq ($(OS_RELEASE),B.10.30) + DEFAULT_IMPL_STRATEGY = _PTH +endif + +# +# Config stuff for HP-UXB.10.30. +# +include $(CORE_DEPTH)/coreconf/HP-UXB.10.mk + +OS_CFLAGS += -DHPUX10_30 + +# +# To use the true pthread (kernel thread) library on 10.30 and +# 11.00, we should define _POSIX_C_SOURCE to be 199506L. +# The _REENTRANT macro is deprecated. +# + +ifdef USE_PTHREADS + OS_CFLAGS += -D_POSIX_C_SOURCE=199506L +endif diff -Naur security/coreconf/HP-UXB.10.mk mozilla/security/coreconf/HP-UXB.10.mk --- a/security/coreconf/HP-UXB.10.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UXB.10.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,40 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +include $(CORE_DEPTH)/coreconf/HP-UX.mk + +OS_CFLAGS += -DHPUX10 +OS_LIBS += -lpthread -lm diff -Naur security/coreconf/HP-UXB.11.00.mk mozilla/security/coreconf/HP-UXB.11.00.mk --- a/security/coreconf/HP-UXB.11.00.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UXB.11.00.mk 2006-12-07 20:28:40.000000000 +0200 @@ -0,0 +1,49 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# On HP-UX 10.30 and 11.00, the default implementation strategy is +# pthreads. Classic nspr and pthreads-user are also available. + +ifeq ($(OS_RELEASE),B.11.00) +OS_CFLAGS += -DHPUX10 +DEFAULT_IMPL_STRATEGY = _PTH +endif + +# +# Config stuff for HP-UXB.11.00. +# +include $(CORE_DEPTH)/coreconf/HP-UXB.11.mk diff -Naur security/coreconf/HP-UXB.11.11.mk mozilla/security/coreconf/HP-UXB.11.11.mk --- a/security/coreconf/HP-UXB.11.11.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UXB.11.11.mk 2006-12-07 20:28:40.000000000 +0200 @@ -0,0 +1,49 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 2001 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# On HP-UX 10.30 and 11.x, the default implementation strategy is +# pthreads. Classic nspr and pthreads-user are also available. + +ifeq ($(OS_RELEASE),B.11.11) +OS_CFLAGS += -DHPUX10 +DEFAULT_IMPL_STRATEGY = _PTH +endif + +# +# Config stuff for HP-UXB.11.11. +# +include $(CORE_DEPTH)/coreconf/HP-UXB.11.mk diff -Naur security/coreconf/HP-UXB.11.20.mk mozilla/security/coreconf/HP-UXB.11.20.mk --- a/security/coreconf/HP-UXB.11.20.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UXB.11.20.mk 2006-12-07 20:28:40.000000000 +0200 @@ -0,0 +1,49 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 2002 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# On HP-UX 10.30 and 11.x, the default implementation strategy is +# pthreads. Classic nspr and pthreads-user are also available. + +ifeq ($(OS_RELEASE),B.11.20) +OS_CFLAGS += -DHPUX10 +DEFAULT_IMPL_STRATEGY = _PTH +endif + +# +# Config stuff for HP-UXB.11.x. +# +include $(CORE_DEPTH)/coreconf/HP-UXB.11.mk diff -Naur security/coreconf/HP-UXB.11.22.mk mozilla/security/coreconf/HP-UXB.11.22.mk --- a/security/coreconf/HP-UXB.11.22.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UXB.11.22.mk 2006-12-07 20:28:40.000000000 +0200 @@ -0,0 +1,49 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 2002 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# On HP-UX 10.30 and 11.x, the default implementation strategy is +# pthreads. Classic nspr and pthreads-user are also available. + +ifeq ($(OS_RELEASE),B.11.22) +OS_CFLAGS += -DHPUX10 +DEFAULT_IMPL_STRATEGY = _PTH +endif + +# +# Config stuff for HP-UXB.11.x. +# +include $(CORE_DEPTH)/coreconf/HP-UXB.11.mk diff -Naur security/coreconf/HP-UXB.11.23.mk mozilla/security/coreconf/HP-UXB.11.23.mk --- a/security/coreconf/HP-UXB.11.23.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UXB.11.23.mk 2006-12-07 20:28:40.000000000 +0200 @@ -0,0 +1,49 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 2002 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# On HP-UX 10.30 and 11.x, the default implementation strategy is +# pthreads. Classic nspr and pthreads-user are also available. + +ifeq ($(OS_RELEASE),B.11.23) +OS_CFLAGS += -DHPUX10 +DEFAULT_IMPL_STRATEGY = _PTH +endif + +# +# Config stuff for HP-UXB.11.x. +# +include $(CORE_DEPTH)/coreconf/HP-UXB.11.mk diff -Naur security/coreconf/HP-UXB.11.mk mozilla/security/coreconf/HP-UXB.11.mk --- a/security/coreconf/HP-UXB.11.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UXB.11.mk 2006-12-07 20:31:49.000000000 +0200 @@ -0,0 +1,80 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +include $(CORE_DEPTH)/coreconf/HP-UX.mk + +ifndef NS_USE_GCC + CCC = /opt/aCC/bin/aCC -ext + ifeq ($(USE_64), 1) + ifeq ($(OS_TEST), ia64) + ARCHFLAG = -Aa +e +p +DD64 + else + # Our HP-UX build machine has a strange problem. If + # a 64-bit PA-RISC executable calls getcwd() in a + # network-mounted directory, it fails with ENOENT. + # We don't know why. Since nsinstall calls getcwd(), + # this breaks our 64-bit HP-UX nightly builds. None + # of our other HP-UX machines have this problem. + # + # We worked around this problem by building nsinstall + # as a 32-bit PA-RISC executable for 64-bit PA-RISC + # builds. -- wtc 2003-06-03 + ifdef INTERNAL_TOOLS + ARCHFLAG = +DAportable +DS2.0 + else + ARCHFLAG = -Aa +e +DA2.0W +DS2.0 +DChpux + endif + endif + else + ifeq ($(OS_TEST), ia64) + ARCHFLAG = -Aa +e +p +DD32 + else + ARCHFLAG = +DAportable +DS2.0 + endif + endif +else + CCC = aCC +endif + +# +# To use the true pthread (kernel thread) library on HP-UX +# 11.x, we should define _POSIX_C_SOURCE to be 199506L. +# The _REENTRANT macro is deprecated. +# + +OS_CFLAGS += $(ARCHFLAG) -DHPUX11 -D_POSIX_C_SOURCE=199506L +OS_LIBS += -lpthread -lm -lrt +HPUX11 = 1 diff -Naur security/coreconf/HP-UX.mk mozilla/security/coreconf/HP-UX.mk --- a/security/coreconf/HP-UX.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/HP-UX.mk 2010-05-01 22:07:17.000000000 +0300 @@ -0,0 +1,116 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# +# Config stuff for HP-UX +# + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DEFAULT_COMPILER = cc + +ifeq ($(OS_TEST),ia64) + CPU_ARCH = ia64 + CPU_TAG = _$(CPU_ARCH) + ifneq ($(USE_64),1) + 64BIT_TAG = _32 + endif + DLL_SUFFIX = so +else + CPU_ARCH = hppa + DLL_SUFFIX = sl +endif +CC = cc +CCC = CC +ifndef NS_USE_GCC +OS_CFLAGS += -Ae +endif +OS_CFLAGS += $(DSO_CFLAGS) -DHPUX -D$(CPU_ARCH) -D_HPUX_SOURCE -D_USE_BIG_FDS + +ifeq ($(DEFAULT_IMPL_STRATEGY),_PTH) + USE_PTHREADS = 1 + ifeq ($(CLASSIC_NSPR),1) + USE_PTHREADS = + IMPL_STRATEGY = _CLASSIC + endif + ifeq ($(PTHREADS_USER),1) + USE_PTHREADS = + IMPL_STRATEGY = _PTH_USER + endif +endif + +ifdef PTHREADS_USER + OS_CFLAGS += -D_POSIX_C_SOURCE=199506L +endif + +LDFLAGS = -z -Wl,+s + +ifdef NS_USE_GCC +LD = $(CC) +endif +MKSHLIB = $(LD) $(DSO_LDOPTS) $(RPATH) +ifdef MAPFILE +ifndef NS_USE_GCC +MKSHLIB += -c $(MAPFILE) +else +MKSHLIB += -Wl,-c,$(MAPFILE) +endif +endif +PROCESS_MAP_FILE = grep -v ';+' $< | grep -v ';-' | \ + sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,^,+e ,' > $@ + +ifndef NS_USE_GCC +DSO_LDOPTS = -b +h $(notdir $@) +RPATH = +b '$$ORIGIN' +else +DSO_LDOPTS = -shared -Wl,+h,$(notdir $@) +RPATH = -Wl,+b,'$$ORIGIN' +endif +ifneq ($(OS_TEST),ia64) +# pa-risc +ifndef USE_64 +RPATH = +endif +endif + +# +Z generates position independent code for use in shared libraries. +ifndef NS_USE_GCC +DSO_CFLAGS = +Z +else +DSO_CFLAGS = -fPIC +ASFLAGS += -x assembler-with-cpp +endif diff -Naur security/coreconf/import.pl mozilla/security/coreconf/import.pl --- a/security/coreconf/import.pl 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/import.pl 2005-09-16 03:33:23.000000000 +0300 @@ -0,0 +1,221 @@ +#! /usr/local/bin/perl +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +print STDERR "import.pl\n"; + +require('coreconf.pl'); + + +$returncode =0; + + +#######-- read in variables on command line into %var + +$var{UNZIP} = "unzip -o"; + +&parse_argv; + +if (! ($var{IMPORTS} =~ /\w/)) { + print STDERR "nothing to import\n"; +} + +######-- Do the import! + +foreach $import (split(/ /,$var{IMPORTS}) ) { + + print STDERR "\n\nIMPORTING .... $import\n-----------------------------\n"; + + +# if a specific version specified in IMPORT variable +# (if $import has a slash in it) + + if ($import =~ /\//) { + # $component=everything before the first slash of $import + + $import =~ m|^([^/]*)/|; + $component = $1; + + $import =~ m|^(.*)/([^/]*)$|; + + # $path=everything before the last slash of $import + $path = $1; + + # $version=everything after the last slash of $import + $version = $2; + + if ($var{VERSION} ne "current") { + $version = $var{VERSION}; + } + } + else { + $component = $import; + $path = $import; + $version = $var{VERSION}; + } + + $releasejardir = "$var{RELEASE_TREE}/$path"; + if ($version eq "current") { + print STDERR "Current version specified. Reading 'current' file ... \n"; + + open(CURRENT,"$releasejardir/current") || die "NO CURRENT FILE\n"; + $version = ; + $version =~ s/(\r?\n)*$//; # remove any trailing [CR/]LF's + close(CURRENT); + print STDERR "Using version $version\n"; + if ( $version eq "") { + die "Current version file empty. Stopping\n"; + } + } + + $releasejardir = "$releasejardir/$version"; + if ( ! -d $releasejardir) { + die "$releasejardir doesn't exist (Invalid Version?)\n"; + } + foreach $jarfile (split(/ /,$var{FILES})) { + + ($relpath,$distpath,$options) = split(/\|/, $var{$jarfile}); + + if ($var{'OVERRIDE_IMPORT_CHECK'} eq 'YES') { + $options =~ s/v//g; + } + + if ( $relpath ne "") { $releasejarpathname = "$releasejardir/$relpath";} + else { $releasejarpathname = $releasejardir; } + +# If a component doesn't have IDG versions, import the DBG ones + if( ! -e "$releasejarpathname/$jarfile" ) { + if( $relpath =~ /IDG\.OBJ$/ ) { + $relpath =~ s/IDG.OBJ/DBG.OBJ/; + $releasejarpathname = "$releasejardir/$relpath"; + } elsif( $relpath =~ /IDG\.OBJD$/ ) { + $relpath =~ s/IDG.OBJD/DBG.OBJD/; + $releasejarpathname = "$releasejardir/$relpath"; + } + } + + if (-e "$releasejarpathname/$jarfile") { + print STDERR "\nWorking on jarfile: $jarfile\n"; + + if ($distpath =~ m|/$|) { + $distpathname = "$distpath$component"; + } + else { + $distpathname = "$distpath"; + } + + +#the block below is used to determine whether or not the xp headers have +#already been imported for this component + + $doimport = 1; + if ($options =~ /v/) { # if we should check the imported version + print STDERR "Checking if version file exists $distpathname/version\n"; + if (-e "$distpathname/version") { + open( VFILE, "<$distpathname/version") || + die "Cannot open $distpathname/version for reading. Permissions?\n"; + $importversion = ; + close (VFILE); + $importversion =~ s/\r?\n$//; # Strip off any trailing CR/LF + if ($version eq $importversion) { + print STDERR "$distpathname version '$importversion' already imported. Skipping...\n"; + $doimport =0; + } + } + } + + if ($doimport == 1) { + if (! -d "$distpathname") { + &rec_mkdir("$distpathname"); + } + # delete the stuff in there already. + # (this should really be recursive delete.) + + if ($options =~ /v/) { + $remheader = "\nREMOVING files in '$distpathname/' :"; + opendir(DIR,"$distpathname") || + die ("Cannot read directory $distpathname\n"); + @filelist = readdir(DIR); + closedir(DIR); + foreach $file ( @filelist ) { + if (! ($file =~ m!/.?.$!) ) { + if (! (-d $file)) { + $file =~ m!([^/]*)$!; + print STDERR "$remheader $1"; + $remheader = " "; + unlink "$distpathname/$file"; + } + } + } + } + + + print STDERR "\n\n"; + + print STDERR "\nExtracting jarfile '$jarfile' to local directory $distpathname/\n"; + + print STDERR "$var{UNZIP} $releasejarpathname/$jarfile -d $distpathname\n"; + system("$var{UNZIP} $releasejarpathname/$jarfile -d $distpathname"); + + $r = $?; + + if ($options =~ /v/) { + if ($r == 0) { + unlink ("$distpathname/version"); + if (open(VFILE,">$distpathname/version")) { + print VFILE "$version\n"; + close(VFILE); + } + } + else { + print STDERR "Could not create '$distpathname/version'. Permissions?\n"; + $returncode ++; + } + } + } # if (doimport) + } # if (-e releasejarpathname/jarfile) + } # foreach jarfile) +} # foreach IMPORT + + + +exit($returncode); + + + + + diff -Naur security/coreconf/IRIX5.2.mk mozilla/security/coreconf/IRIX5.2.mk --- a/security/coreconf/IRIX5.2.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/IRIX5.2.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,37 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +include $(CORE_DEPTH)/coreconf/IRIX5.mk diff -Naur security/coreconf/IRIX5.3.mk mozilla/security/coreconf/IRIX5.3.mk --- a/security/coreconf/IRIX5.3.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/IRIX5.3.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,39 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +include $(CORE_DEPTH)/coreconf/IRIX5.mk + +OS_CFLAGS += -DIRIX5_3 diff -Naur security/coreconf/IRIX5.mk mozilla/security/coreconf/IRIX5.mk --- a/security/coreconf/IRIX5.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/IRIX5.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,42 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/IRIX.mk + +ifndef NS_USE_GCC + ODD_CFLAGS += -xgot +endif diff -Naur security/coreconf/IRIX6.2.mk mozilla/security/coreconf/IRIX6.2.mk --- a/security/coreconf/IRIX6.2.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/IRIX6.2.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,45 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + + +# catch unresolved symbols + +SHLIB_LD_OPTS += -no_unresolved + +include $(CORE_DEPTH)/coreconf/IRIX6.mk + +OS_CFLAGS += -DIRIX6_2 diff -Naur security/coreconf/IRIX6.3.mk mozilla/security/coreconf/IRIX6.3.mk --- a/security/coreconf/IRIX6.3.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/IRIX6.3.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,44 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# catch unresolved symbols + +SHLIB_LD_OPTS += -no_unresolved + +include $(CORE_DEPTH)/coreconf/IRIX6.mk + +OS_CFLAGS += -DIRIX6_3 diff -Naur security/coreconf/IRIX6.5.mk mozilla/security/coreconf/IRIX6.5.mk --- a/security/coreconf/IRIX6.5.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/IRIX6.5.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,47 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# catch unresolved symbols + +SHLIB_LD_OPTS += -no_unresolved + +include $(CORE_DEPTH)/coreconf/IRIX6.mk + +OS_CFLAGS += -DIRIX6_5 +ifndef NS_USE_GCC +OS_CFLAGS += -mips3 +endif diff -Naur security/coreconf/IRIX6.mk mozilla/security/coreconf/IRIX6.mk --- a/security/coreconf/IRIX6.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/IRIX6.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,49 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/IRIX.mk + +ifndef NS_USE_GCC + ifneq ($(USE_N32),1) + OS_CFLAGS += -32 + endif + ODD_CFLAGS += -multigot +endif + +ifeq ($(USE_PTHREADS),1) +OS_LIBS += -lpthread +endif diff -Naur security/coreconf/IRIX.mk mozilla/security/coreconf/IRIX.mk --- a/security/coreconf/IRIX.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/IRIX.mk 2007-11-22 06:39:56.000000000 +0200 @@ -0,0 +1,126 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +# +# The default implementation strategy for Irix is classic nspr. +# +ifeq ($(USE_PTHREADS),1) + ifeq ($(USE_N32),1) + IMPL_STRATEGY = _n32_PTH + else + IMPL_STRATEGY = _PTH + endif +endif + +DEFAULT_COMPILER = cc + +ifdef NS_USE_GCC + CC = gcc + AS = $(CC) -x assembler-with-cpp + ODD_CFLAGS = -Wall -Wno-format -Wno-switch + ifdef BUILD_OPT + OPTIMIZER = -O6 + endif +else + CC = cc + CCC = CC + ODD_CFLAGS = -fullwarn -xansi -woff 1209 + ifdef BUILD_OPT + ifeq ($(USE_N32),1) + OPTIMIZER = -O -OPT:Olimit=4000 + else + OPTIMIZER = -O -Olimit 4000 + endif + endif + + # For 6.x machines, include this flag + ifeq (6., $(findstring 6., $(OS_RELEASE))) + ifeq ($(USE_N32),1) + ODD_CFLAGS += -n32 -mips3 -exceptions + else + ODD_CFLAGS += -32 -multigot + endif + else + ODD_CFLAGS += -xgot + endif + ifeq ($(USE_N32),1) + OS_CFLAGS += -dollar + endif +endif + +ODD_CFLAGS += -DSVR4 -DIRIX + +CPU_ARCH = mips + +RANLIB = /bin/true +# For purify +# NOTE: should always define _SGI_MP_SOURCE +NOMD_OS_CFLAGS += $(ODD_CFLAGS) -D_SGI_MP_SOURCE + +OS_CFLAGS += $(NOMD_OS_CFLAGS) +ifdef USE_MDUPDATE + OS_CFLAGS += -MDupdate $(DEPENDENCIES) +endif + +ifeq ($(USE_N32),1) + SHLIB_LD_OPTS += -n32 -mips3 +endif + +MKSHLIB += $(LD) $(SHLIB_LD_OPTS) -shared -soname $(@:$(OBJDIR)/%.so=%.so) +ifdef MAPFILE +# Add LD options to restrict exported symbols to those in the map file +endif +# Change PROCESS to put the mapfile in the correct format for this platform +PROCESS_MAP_FILE = cp $< $@ + +DSO_LDOPTS = -elf -shared -all + +ifdef DSO_BACKEND + DSO_LDOPTS += -soname $(DSO_NAME) +endif + +# +# Revision notes: +# +# In the IRIX compilers prior to version 7.2, -n32 implied -mips3. +# Beginning in the 7.2 compilers, -n32 implies -mips4 when the compiler +# is running on a system with a mips4 CPU (e.g. R8K, R10K). +# We want our code to explicitly be mips3 code, so we now explicitly +# set -mips3 whenever we set -n32. +# diff -Naur security/coreconf/jdk.mk mozilla/security/coreconf/jdk.mk --- a/security/coreconf/jdk.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/jdk.mk 2006-08-05 04:27:37.000000000 +0300 @@ -0,0 +1,536 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +ifdef NS_USE_JDK +####################################################################### +# [1] Define preliminary JDK "Core Components" toolset options # +####################################################################### + +# set default JDK java threading model +ifeq ($(JDK_THREADING_MODEL),) + JDK_THREADING_MODEL = native_threads +# no such thing as -native flag + JDK_THREADING_MODEL_OPT = +endif + +####################################################################### +# [2] Define platform-independent JDK "Core Components" options # +####################################################################### + +# set default location of the java classes repository +ifeq ($(JAVA_DESTPATH),) +ifdef BUILD_OPT + JAVA_DESTPATH = $(SOURCE_CLASSES_DIR) +else + JAVA_DESTPATH = $(SOURCE_CLASSES_DBG_DIR) +endif +endif + +# set default location of the package under the java classes repository +# note that this overrides the default package value in ruleset.mk +ifeq ($(PACKAGE),) + PACKAGE = . +endif + +# set default location of the java source code repository +ifeq ($(JAVA_SOURCEPATH),) + JAVA_SOURCEPATH = . +endif + +# add JNI directory to default include search path +ifneq ($(JNI_GEN),) + ifdef NSBUILDROOT + INCLUDES += -I$(JNI_GEN_DIR) -I$(SOURCE_XP_DIR) + else + INCLUDES += -I$(JNI_GEN_DIR) + endif +endif + +####################################################################### +# [3] Define platform-dependent JDK "Core Components" options # +####################################################################### + +# set [Microsoft Windows] platforms +ifeq ($(OS_ARCH), WINNT) + JAVA_CLASSES = $(JAVA_HOME)/jre/lib/rt.jar + + ifeq ($(JRE_HOME),) + JRE_HOME = $(JAVA_HOME) + JRE_CLASSES = $(JAVA_CLASSES) + else + ifeq ($(JRE_CLASSES),) + JRE_CLASSES = $(JRE_HOME)/lib/rt.jar + endif + endif + + PATH_SEPARATOR = ; + + # (2) specify "header" information + JAVA_ARCH = win32 + + INCLUDES += -I$(JAVA_HOME)/include + INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) + + # currently, disable JIT option on this platform + JDK_JIT_OPT = -nojit +endif + +# set [Sun Solaris] platforms +ifeq ($(OS_ARCH), SunOS) + JAVA_CLASSES = $(JAVA_HOME)/jre/lib/rt.jar + + ifeq ($(JRE_HOME),) + JRE_HOME = $(JAVA_HOME) + JRE_CLASSES = $(JAVA_CLASSES) + else + ifeq ($(JRE_CLASSES),) + JRE_CLASSES = $(JRE_HOME)/lib/rt.jar + endif + endif + + PATH_SEPARATOR = : + + # (2) specify "header" information + JAVA_ARCH = solaris + + INCLUDES += -I$(JAVA_HOME)/include + INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) + + # currently, disable JIT option on this platform + JDK_JIT_OPT = +endif + +# set [Hewlett Packard HP-UX] platforms +ifeq ($(OS_ARCH), HP-UX) + JAVA_CLASSES = $(JAVA_HOME)/jre/lib/rt.jar + + ifeq ($(JRE_HOME),) + JRE_HOME = $(JAVA_HOME) + JRE_CLASSES = $(JAVA_CLASSES) + else + ifeq ($(JRE_CLASSES),) + JRE_CLASSES = $(JRE_HOME)/lib/rt.jar + endif + endif + + PATH_SEPARATOR = : + + # (2) specify "header" information + JAVA_ARCH = hp-ux + + INCLUDES += -I$(JAVA_HOME)/include + INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) + + # no JIT option available on this platform + JDK_JIT_OPT = +endif + +# set [Redhat Linux] platforms +ifeq ($(OS_ARCH), Linux) + JAVA_CLASSES = $(JAVA_HOME)/jre/lib/rt.jar + + ifeq ($(JRE_HOME),) + JRE_HOME = $(JAVA_HOME) + JRE_CLASSES = $(JAVA_CLASSES) + else + ifeq ($(JRE_CLASSES),) + JRE_CLASSES = $(JRE_HOME)/lib/rt.jar + endif + endif + + PATH_SEPARATOR = : + + # (2) specify "header" information + JAVA_ARCH = linux + + INCLUDES += -I$(JAVA_HOME)/include + INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) + + # no JIT option available on this platform + JDK_JIT_OPT = +endif + +# set [Mac OS X] platforms +ifeq ($(OS_ARCH), Darwin) + JAVA_CLASSES = $(JAVA_HOME)/../Classes/classes.jar + + ifeq ($(JRE_HOME),) + JRE_HOME = $(JAVA_HOME) + JRE_CLASSES = $(JAVA_CLASSES) + else + ifeq ($(JRE_CLASSES),) + JRE_CLASSES = $(JRE_HOME)/../Classes/classes.jar + endif + endif + + PATH_SEPARATOR = : + + # (2) specify "header" information + JAVA_ARCH = darwin + + INCLUDES += -I$(JAVA_HOME)/include + INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) + + # no JIT option available on this platform + JDK_JIT_OPT = +endif + +# set [IBM AIX] platforms +ifeq ($(OS_ARCH), AIX) + JAVA_CLASSES = $(JAVA_HOME)/jre/lib/rt.jar + + ifeq ($(JRE_HOME),) + JRE_HOME = $(JAVA_HOME) + JRE_CLASSES = $(JAVA_CLASSES) + else + ifeq ($(JRE_CLASSES),) + JRE_CLASSES = $(JRE_HOME)/lib/rt.jar + endif + endif + + PATH_SEPARATOR = : + + # (2) specify "header" information + JAVA_ARCH = aix + + INCLUDES += -I$(JAVA_HOME)/include + INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) + + # no JIT option available on this platform + JDK_JIT_OPT = +endif + +# set [Digital UNIX] platforms +ifeq ($(OS_ARCH), OSF1) + JAVA_CLASSES = $(JAVA_HOME)/jre/lib/rt.jar + + ifeq ($(JRE_HOME),) + JRE_HOME = $(JAVA_HOME) + JRE_CLASSES = $(JAVA_CLASSES) + else + ifeq ($(JRE_CLASSES),) + JRE_CLASSES = $(JRE_HOME)/lib/rt.jar + endif + endif + + PATH_SEPARATOR = : + + # (2) specify "header" information + JAVA_ARCH = alpha + + INCLUDES += -I$(JAVA_HOME)/include + INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) + + # no JIT option available on this platform + JDK_JIT_OPT = +endif + +# set [Silicon Graphics IRIX] platforms +ifeq ($(OS_ARCH), IRIX) + JAVA_CLASSES = $(JAVA_HOME)/lib/dev.jar:$(JAVA_HOME)/lib/rt.jar + + ifeq ($(JRE_HOME),) + JRE_HOME = $(JAVA_HOME) + JRE_CLASSES = $(JAVA_CLASSES) + else + ifeq ($(JRE_CLASSES),) + JRE_CLASSES = $(JRE_HOME)/lib/dev.jar:$(JRE_HOME)/lib/rt.jar + endif + endif + + PATH_SEPARATOR = : + + # (2) specify "header" information + JAVA_ARCH = irix + + INCLUDES += -I$(JAVA_HOME)/include + INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) + + # no JIT option available on this platform + JDK_JIT_OPT = +endif + +####################################################################### +# [4] Define remaining JDK "Core Components" default toolset options # +####################################################################### + +# set JDK optimization model +ifeq ($(BUILD_OPT),1) + JDK_OPTIMIZER_OPT = -O +else + JDK_OPTIMIZER_OPT = -g +endif + +# set minimal JDK debugging model +ifeq ($(JDK_DEBUG),1) + JDK_DEBUG_OPT = -debug +else + JDK_DEBUG_OPT = +endif + +# set default path to repository for JDK classes +ifeq ($(JDK_CLASS_REPOSITORY_OPT),) + JDK_CLASS_REPOSITORY_OPT = -d $(JAVA_DESTPATH) +endif + +# define a default JDK classpath +ifeq ($(JDK_CLASSPATH),) + JDK_CLASSPATH = '$(JAVA_DESTPATH)$(PATH_SEPARATOR)$(JAVA_SOURCEPATH)$(PATH_SEPARATOR)$(JAVA_CLASSES)' +endif + +# by default, override CLASSPATH environment variable using the JDK classpath option with $(JDK_CLASSPATH) +ifeq ($(JDK_CLASSPATH_OPT),) + JDK_CLASSPATH_OPT = -classpath $(JDK_CLASSPATH) +endif + +ifeq ($(USE_64), 1) + JDK_USE_64 = -d64 +endif + +endif + + +####################################################################### +# [5] Define JDK "Core Components" toolset; # +# (always allow a user to override these values) # +####################################################################### + +# +# (1) appletviewer +# + +ifeq ($(APPLETVIEWER),) + APPLETVIEWER_PROG = $(JAVA_HOME)/bin/appletviewer$(PROG_SUFFIX) + APPLETVIEWER_FLAGS = $(JDK_THREADING_MODEL_OPT) + APPLETVIEWER_FLAGS += $(JDK_DEBUG_OPT) + APPLETVIEWER_FLAGS += $(JDK_JIT_OPT) + APPLETVIEWER = $(APPLETVIEWER_PROG) $(APPLETVIEWER_FLAGS) +endif + +# +# (2) jar +# + +ifeq ($(JAR),) + JAR_PROG = $(JAVA_HOME)/bin/jar$(PROG_SUFFIX) + JAR_FLAGS = $(JDK_THREADING_MODEL_OPT) + JAR = $(JAR_PROG) $(JAR_FLAGS) +endif + +# +# (3) java +# + +ifeq ($(JAVA),) + JAVA_PROG = $(JAVA_HOME)/bin/java$(PROG_SUFFIX) + JAVA_FLAGS = $(JDK_THREADING_MODEL_OPT) + JAVA_FLAGS += $(JDK_DEBUG_OPT) + JAVA_FLAGS += $(JDK_CLASSPATH_OPT) + JAVA_FLAGS += $(JDK_JIT_OPT) + JAVA_FLAGS += $(JDK_USE_64) + JAVA = $(JAVA_PROG) $(JAVA_FLAGS) +endif + +# +# (4) javac +# + +ifeq ($(JAVAC),) + JAVAC_PROG = $(JAVA_HOME)/bin/javac$(PROG_SUFFIX) + JAVAC_FLAGS = $(JDK_THREADING_MODEL_OPT) + JAVAC_FLAGS += $(JDK_OPTIMIZER_OPT) + JAVAC_FLAGS += $(JDK_DEBUG_OPT) + JAVAC_FLAGS += $(JDK_CLASSPATH_OPT) + JAVAC_FLAGS += $(JDK_CLASS_REPOSITORY_OPT) + JAVAC_FLAGS += $(JDK_USE_64) + JAVAC = $(JAVAC_PROG) $(JAVAC_FLAGS) +endif + +# +# (5) javadoc +# + +ifeq ($(JAVADOC),) + JAVADOC_PROG = $(JAVA_HOME)/bin/javadoc$(PROG_SUFFIX) + JAVADOC_FLAGS = $(JDK_THREADING_MODEL_OPT) + JAVADOC_FLAGS += $(JDK_CLASSPATH_OPT) + JAVADOC = $(JAVADOC_PROG) $(JAVADOC_FLAGS) +endif + +# +# (6) javah +# + +ifeq ($(JAVAH),) + JAVAH_PROG = $(JAVA_HOME)/bin/javah$(PROG_SUFFIX) + JAVAH_FLAGS = $(JDK_THREADING_MODEL_OPT) + JAVAH_FLAGS += $(JDK_CLASSPATH_OPT) + JAVAH = $(JAVAH_PROG) $(JAVAH_FLAGS) +endif + +# +# (7) javakey +# + +ifeq ($(JAVAKEY),) + JAVAKEY_PROG = $(JAVA_HOME)/bin/javakey$(PROG_SUFFIX) + JAVAKEY_FLAGS = $(JDK_THREADING_MODEL_OPT) + JAVAKEY = $(JAVAKEY_PROG) $(JAVAKEY_FLAGS) +endif + +# +# (8) javap +# + +ifeq ($(JAVAP),) + JAVAP_PROG = $(JAVA_HOME)/bin/javap$(PROG_SUFFIX) + JAVAP_FLAGS = $(JDK_THREADING_MODEL_OPT) + JAVAP_FLAGS += $(JDK_CLASSPATH_OPT) + JAVAP = $(JAVAP_PROG) $(JAVAP_FLAGS) +endif + +# +# (9) javat +# + +ifeq ($(JAVAT),) + JAVAT_PROG = $(JAVA_HOME)/bin/javat$(PROG_SUFFIX) + JAVAT_FLAGS = $(JDK_THREADING_MODEL_OPT) + JAVAT = $(JAVAT_PROG) $(JAVAT_FLAGS) +endif + +# +# (10) javaverify +# + +ifeq ($(JAVAVERIFY),) + JAVAVERIFY_PROG = $(JAVA_HOME)/bin/javaverify$(PROG_SUFFIX) + JAVAVERIFY_FLAGS = $(JDK_THREADING_MODEL_OPT) + JAVAVERIFY = $(JAVAVERIFY_PROG) $(JAVAVERIFY_FLAGS) +endif + +# +# (11) javaw +# + +ifeq ($(JAVAW),) + jJAVAW_PROG = $(JAVA_HOME)/bin/javaw$(PROG_SUFFIX) + jJAVAW_FLAGS = $(JDK_THREADING_MODEL_OPT) + jJAVAW_FLAGS += $(JDK_DEBUG_OPT) + jJAVAW_FLAGS += $(JDK_CLASSPATH_OPT) + jJAVAW_FLAGS += $(JDK_JIT_OPT) + jJAVAW = $(JAVAW_PROG) $(JAVAW_FLAGS) +endif + +# +# (12) jdb +# + +ifeq ($(JDB),) + JDB_PROG = $(JAVA_HOME)/bin/jdb$(PROG_SUFFIX) + JDB_FLAGS = $(JDK_THREADING_MODEL_OPT) + JDB_FLAGS += $(JDK_DEBUG_OPT) + JDB_FLAGS += $(JDK_CLASSPATH_OPT) + JDB_FLAGS += $(JDK_JIT_OPT) + JDB = $(JDB_PROG) $(JDB_FLAGS) +endif + +# +# (13) jre +# + +ifeq ($(JRE),) + JRE_PROG = $(JAVA_HOME)/bin/jre$(PROG_SUFFIX) + JRE_FLAGS = $(JDK_THREADING_MODEL_OPT) + JRE_FLAGS += $(JDK_CLASSPATH_OPT) + JRE_FLAGS += $(JDK_JIT_OPT) + JRE = $(JRE_PROG) $(JRE_FLAGS) +endif + +# +# (14) jrew +# + +ifeq ($(JREW),) + JREW_PROG = $(JAVA_HOME)/bin/jrew$(PROG_SUFFIX) + JREW_FLAGS = $(JDK_THREADING_MODEL_OPT) + JREW_FLAGS += $(JDK_CLASSPATH_OPT) + JREW_FLAGS += $(JDK_JIT_OPT) + JREW = $(JREW_PROG) $(JREW_FLAGS) +endif + +# +# (15) native2ascii +# + +ifeq ($(NATIVE2ASCII),) + NATIVE2ASCII_PROG = $(JAVA_HOME)/bin/native2ascii$(PROG_SUFFIX) + NATIVE2ASCII_FLAGS = $(JDK_THREADING_MODEL_OPT) + NATIVE2ASCII = $(NATIVE2ASCII_PROG) $(NATIVE2ASCII_FLAGS) +endif + +# +# (16) rmic +# + +ifeq ($(RMIC),) + RMIC_PROG = $(JAVA_HOME)/bin/rmic$(PROG_SUFFIX) + RMIC_FLAGS = $(JDK_THREADING_MODEL_OPT) + RMIC_FLAGS += $(JDK_OPTIMIZER_OPT) + RMIC_FLAGS += $(JDK_CLASSPATH_OPT) + RMIC = $(RMIC_PROG) $(RMIC_FLAGS) +endif + +# +# (17) rmiregistry +# + +ifeq ($(RMIREGISTRY),) + RMIREGISTRY_PROG = $(JAVA_HOME)/bin/rmiregistry$(PROG_SUFFIX) + RMIREGISTRY_FLAGS = $(JDK_THREADING_MODEL_OPT) + RMIREGISTRY = $(RMIREGISTRY_PROG) $(RMIREGISTRY_FLAGS) +endif + +# +# (18) serialver +# + +ifeq ($(SERIALVER),) + SERIALVER_PROG = $(JAVA_HOME)/bin/serialver$(PROG_SUFFIX) + SERIALVER_FLAGS = $(JDK_THREADING_MODEL_OPT) + SERIALVER = $(SERIALVER_PROG) $(SERIALVER_FLAGS) +endif diff -Naur security/coreconf/jniregen.pl mozilla/security/coreconf/jniregen.pl --- a/security/coreconf/jniregen.pl 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/jniregen.pl 2010-04-26 02:37:40.000000000 +0300 @@ -0,0 +1,111 @@ +#!/usr/local/bin/perl +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# Input: -d dir -j javahcmd foo1 foo2 . . . +# Compares generated "_jni/foo1.h" file with "foo1.class", and +# generated "_jni/foo2.h" file with "foo2.class", etc. +# (NOTE: unlike its closely related cousin, outofdate.pl, +# the "-d dir" must always be specified) +# Runs the javahcmd on all files that are different. +# +# Returns: list of headers which are OLDER than corresponding class +# files (non-existent class files are considered to be real old :-) + +my $javah = ""; +my $classdir = ""; + +while(1) { + if ($ARGV[0] eq '-d') { + $classdir = $ARGV[1]; + $classdir .= "/"; + shift; + shift; + } elsif($ARGV[0] eq '-j') { + $javah = $ARGV[1]; + shift; + shift; + } else { + last; + } +} + +if( $javah eq "") { + die "Must specify -j "; +} +if( $classdir eq "") { + die "Must specify -d "; +} + +foreach $filename (@ARGV) +{ + $headerfilename = "_jni/"; + $headerfilename .= $filename; + $headerfilename =~ s/\./_/g; + $headerfilename .= ".h"; + + $classfilename = $filename; + $classfilename =~ s|\.|/|g; + $classfilename .= ".class"; + + $classfilename = $classdir . $classfilename; + + + ( $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $headermtime, + $ctime, $blksize, $blocks ) = stat( $headerfilename ); + + ( $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $classmtime, + $ctime, $blksize, $blocks ) = stat( $classfilename ); + + if( $headermtime < $classmtime ) + { + # NOTE: Since this is used by "javah", and "javah" refuses to overwrite + # an existing file, we force an unlink from this script, since + # we actually want to regenerate the header file at this time. + unlink $headerfilename; + push @filelist, $filename; + } +} + +if( @filelist ) { + $cmd = "$javah " . join(" ",@filelist); + $cmd =~ s/\'/\"/g; # because windows doesn't understand single quote + print "$cmd\n"; + exit (system($cmd) >> 8); +} else { + print "All JNI header files up to date.\n" +} diff -Naur security/coreconf/Linux.mk mozilla/security/coreconf/Linux.mk --- a/security/coreconf/Linux.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/Linux.mk 2011-07-03 09:13:29.000000000 +0300 @@ -0,0 +1,206 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +# +# The default implementation strategy for Linux is now pthreads +# +USE_PTHREADS = 1 + +ifeq ($(USE_PTHREADS),1) + IMPL_STRATEGY = _PTH +endif + +CC = gcc +CCC = g++ +RANLIB = ranlib + +DEFAULT_COMPILER = gcc + +ifeq ($(OS_TEST),ppc64) + CPU_ARCH = ppc +ifeq ($(USE_64),1) + ARCHFLAG = -m64 +endif +else +ifeq ($(OS_TEST),alpha) + OS_REL_CFLAGS = -D_ALPHA_ + CPU_ARCH = alpha +else +ifeq ($(OS_TEST),x86_64) +ifeq ($(USE_64),1) + CPU_ARCH = x86_64 +else + OS_REL_CFLAGS = -Di386 + CPU_ARCH = x86 + ARCHFLAG = -m32 +endif +else +ifeq ($(OS_TEST),sparc64) + CPU_ARCH = sparc +else +ifeq (,$(filter-out arm% sa110,$(OS_TEST))) + CPU_ARCH = arm +else +ifeq (,$(filter-out parisc%,$(OS_TEST))) + CPU_ARCH = hppa +else +ifeq (,$(filter-out i%86,$(OS_TEST))) + OS_REL_CFLAGS = -Di386 + CPU_ARCH = x86 +else +ifeq ($(OS_TEST),sh4a) + CPU_ARCH = sh4 +else +# $(OS_TEST) == m68k, ppc, ia64, sparc, s390, s390x, mips, sh3, sh4 + CPU_ARCH = $(OS_TEST) +endif +endif +endif +endif +endif +endif +endif +endif + + +LIBC_TAG = _glibc + +ifeq ($(OS_RELEASE),2.0) + OS_REL_CFLAGS += -DLINUX2_0 + MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) + ifdef MAPFILE + MKSHLIB += -Wl,--version-script,$(MAPFILE) + endif + PROCESS_MAP_FILE = grep -v ';-' $< | \ + sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ +endif + +ifdef BUILD_OPT +ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE)) + OPTIMIZER = -Os +else + OPTIMIZER = -O2 +endif +ifdef MOZ_DEBUG_SYMBOLS + ifdef MOZ_DEBUG_FLAGS + OPTIMIZER += $(MOZ_DEBUG_FLAGS) + else + OPTIMIZER += -gdwarf-2 + endif +endif +endif + + +ifeq ($(USE_PTHREADS),1) +OS_PTHREAD = -lpthread +endif + +# See bug 537829, in particular comment 23. +# Place -ansi and *_SOURCE before $(DSO_CFLAGS) so DSO_CFLAGS can override +# -ansi on platforms like Android where the system headers are C99 and do +# not build with -ansi. +STANDARDS_CFLAGS = -ansi -D_POSIX_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE +OS_CFLAGS = $(STANDARDS_CFLAGS) $(DSO_CFLAGS) $(OS_REL_CFLAGS) $(ARCHFLAG) -Wall -Werror-implicit-function-declaration -Wno-switch -pipe -DLINUX -Dlinux -DHAVE_STRERROR +OS_LIBS = $(OS_PTHREAD) -ldl -lc + +ifdef USE_PTHREADS + DEFINES += -D_REENTRANT +endif + +ARCH = linux + +DSO_CFLAGS = -fPIC +DSO_LDOPTS = -shared $(ARCHFLAG) +# The linker on Red Hat Linux 7.2 and RHEL 2.1 (GNU ld version 2.11.90.0.8) +# incorrectly reports undefined references in the libraries we link with, so +# we don't use -z defs there. +ZDEFS_FLAG = -Wl,-z,defs +DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG)) +LDFLAGS += $(ARCHFLAG) + +# On Maemo, we need to use the -rpath-link flag for even the standard system +# library directories. +ifdef _SBOX_DIR +LDFLAGS += -Wl,-rpath-link,/usr/lib:/lib +endif + +# INCLUDES += -I/usr/include -Y/usr/include/linux +G++INCLUDES = -I/usr/include/g++ + +# +# Always set CPU_TAG on Linux, WINCE. +# +CPU_TAG = _$(CPU_ARCH) + +# +# On Linux 2.6 or later, build libfreebl3.so with no NSPR and libnssutil3.so +# dependencies by default. Set FREEBL_NO_DEPEND to 0 in the environment to +# override this. +# +ifeq (2.6,$(firstword $(sort 2.6 $(OS_RELEASE)))) +ifndef FREEBL_NO_DEPEND +FREEBL_NO_DEPEND = 1 +endif +endif + +USE_SYSTEM_ZLIB = 1 +ZLIB_LIBS = -lz + +# The -rpath '$$ORIGIN' linker option instructs this library to search for its +# dependencies in the same directory where it resides. +ifeq ($(BUILD_SUN_PKG), 1) +ifeq ($(USE_64), 1) +RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/private/lib64:/opt/sun/private/lib' +else +RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/private/lib' +endif +endif + +OS_REL_CFLAGS += -DLINUX2_1 +MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH) + +ifdef MAPFILE + MKSHLIB += -Wl,--version-script,$(MAPFILE) +endif +PROCESS_MAP_FILE = grep -v ';-' $< | \ + sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ + +ifeq ($(OS_RELEASE),2.4) +DEFINES += -DNO_FORK_CHECK +endif diff -Naur security/coreconf/location.mk mozilla/security/coreconf/location.mk --- a/security/coreconf/location.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/location.mk 2010-06-12 03:58:32.000000000 +0300 @@ -0,0 +1,106 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +####################################################################### +# Master "Core Components" macros to figure out binary code location # +####################################################################### + +# +# Figure out where the binary code lives. +# + +ifdef BUILD_TREE +ifdef LIBRARY_NAME +BUILD = $(BUILD_TREE)/nss/$(LIBRARY_NAME) +OBJDIR = $(BUILD_TREE)/nss/$(LIBRARY_NAME) +DEPENDENCIES = $(BUILD_TREE)/nss/$(LIBRARY_NAME)/.md +else +BUILD = $(BUILD_TREE)/nss +OBJDIR = $(BUILD_TREE)/nss +DEPENDENCIES = $(BUILD_TREE)/nss/.md +endif +else +BUILD = $(PLATFORM) +OBJDIR = $(PLATFORM) +DEPENDENCIES = $(PLATFORM)/.md +endif + +DIST = $(SOURCE_PREFIX)/$(PLATFORM) + +ifdef BUILD_DEBUG_GC + DEFINES += -DDEBUG_GC +endif + +GARBAGE += $(DEPENDENCIES) core $(wildcard core.[0-9]*) + +ifdef NSPR_INCLUDE_DIR + INCLUDES += -I$(NSPR_INCLUDE_DIR) +endif + +ifndef NSPR_LIB_DIR + NSPR_LIB_DIR = $(DIST)/lib +endif + +ifdef NSS_INCLUDE_DIR + INCLUDES += -I$(NSS_INCLUDE_DIR) +endif + +ifndef NSS_LIB_DIR + NSS_LIB_DIR = $(DIST)/lib +endif + +ifdef NSSUTIL_INCLUDE_DIR + INCLUDES += -I$(NSSUTIL_INCLUDE_DIR) +endif + +ifndef NSSUTIL_LIB_DIR + NSSUTIL_LIB_DIR = $(DIST)/lib +endif + +ifdef SOFTOKEN_INCLUDE_DIR + INCLUDES += -I$(SOFTOKEN_INCLUDE_DIR) +endif + +ifndef SOFTOKEN_LIB_DIR + SOFTOKEN_LIB_DIR = $(DIST)/lib +endif + +ifndef SQLITE_LIB_NAME + SQLITE_LIB_NAME = sqlite3 +endif + +MK_LOCATION = included diff -Naur security/coreconf/Makefile mozilla/security/coreconf/Makefile --- a/security/coreconf/Makefile 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/Makefile 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,47 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +DEPTH = .. +CORE_DEPTH = .. + +MODULE = coreconf + +DIRS = nsinstall + +include $(DEPTH)/coreconf/config.mk +include $(DEPTH)/coreconf/rules.mk + +export:: libs diff -Naur security/coreconf/mkdepend/cppsetup.c mozilla/security/coreconf/mkdepend/cppsetup.c --- a/security/coreconf/mkdepend/cppsetup.c 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/mkdepend/cppsetup.c 2009-02-14 02:37:00.000000000 +0200 @@ -0,0 +1,233 @@ +/* $Xorg: cppsetup.c,v 1.5 2001/02/09 02:03:16 xorgcvs Exp $ */ +/* + +Copyright (c) 1993, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/config/makedepend/cppsetup.c,v 3.11 2001/12/17 20:52:22 dawes Exp $ */ + +#include "def.h" + +#ifdef CPP +/* + * This file is strictly for the sake of cpy.y and yylex.c (if + * you indeed have the source for cpp). + */ +#define IB 1 +#define SB 2 +#define NB 4 +#define CB 8 +#define QB 16 +#define WB 32 +#define SALT '#' +#if defined(pdp11) || defined(vax) || defined(ns16000) || defined(mc68000) || defined(ibm032) +#define COFF 128 +#else +#define COFF 0 +#endif +/* + * These variables used by cpy.y and yylex.c + */ +extern char *outp, *inp, *newp, *pend; +extern char *ptrtab; +extern char fastab[]; +extern char slotab[]; + +/* + * cppsetup + */ +struct filepointer *currentfile; +struct inclist *currentinc; + +int +cppsetup(char *line, struct filepointer *filep, struct inclist *inc) +{ + char *p, savec; + static boolean setupdone = FALSE; + boolean value; + + if (!setupdone) { + cpp_varsetup(); + setupdone = TRUE; + } + + currentfile = filep; + currentinc = inc; + inp = newp = line; + for (p=newp; *p; p++) + ; + + /* + * put a newline back on the end, and set up pend, etc. + */ + *p++ = '\n'; + savec = *p; + *p = '\0'; + pend = p; + + ptrtab = slotab+COFF; + *--inp = SALT; + outp=inp; + value = yyparse(); + *p = savec; + return(value); +} + +struct symtab **lookup(symbol) + char *symbol; +{ + static struct symtab *undefined; + struct symtab **sp; + + sp = isdefined(symbol, currentinc, NULL); + if (sp == NULL) { + sp = &undefined; + (*sp)->s_value = NULL; + } + return (sp); +} + +pperror(tag, x0,x1,x2,x3,x4) + int tag,x0,x1,x2,x3,x4; +{ + warning("\"%s\", line %d: ", currentinc->i_file, currentfile->f_line); + warning(x0,x1,x2,x3,x4); +} + + +yyerror(s) + register char *s; +{ + fatalerr("Fatal error: %s\n", s); +} +#else /* not CPP */ + +#include "ifparser.h" +struct _parse_data { + struct filepointer *filep; + struct inclist *inc; + char *filename; + const char *line; +}; + +static const char * +my_if_errors (IfParser *ip, const char *cp, const char *expecting) +{ + struct _parse_data *pd = (struct _parse_data *) ip->data; + int lineno = pd->filep->f_line; + char *filename = pd->filename; + char prefix[300]; + int prefixlen; + int i; + + sprintf (prefix, "\"%s\":%d", filename, lineno); + prefixlen = strlen(prefix); + fprintf (stderr, "%s: %s", prefix, pd->line); + i = cp - pd->line; + if (i > 0 && pd->line[i-1] != '\n') { + putc ('\n', stderr); + } + for (i += prefixlen + 3; i > 0; i--) { + putc (' ', stderr); + } + fprintf (stderr, "^--- a/expecting %s\n", expecting); + return NULL; +} + + +#define MAXNAMELEN 256 + +static struct symtab ** +lookup_variable (IfParser *ip, const char *var, int len) +{ + char tmpbuf[MAXNAMELEN + 1]; + struct _parse_data *pd = (struct _parse_data *) ip->data; + + if (len > MAXNAMELEN) + return 0; + + strncpy (tmpbuf, var, len); + tmpbuf[len] = '\0'; + return isdefined (tmpbuf, pd->inc, NULL); +} + + +static int +my_eval_defined (IfParser *ip, const char *var, int len) +{ + if (lookup_variable (ip, var, len)) + return 1; + else + return 0; +} + +#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_') + +static long +my_eval_variable (IfParser *ip, const char *var, int len) +{ + long val; + struct symtab **s; + + s = lookup_variable (ip, var, len); + if (!s) + return 0; + do { + var = (*s)->s_value; + if (!isvarfirstletter(*var) || !strcmp((*s)->s_name, var)) + break; + s = lookup_variable (ip, var, strlen(var)); + } while (s); + + var = ParseIfExpression(ip, var, &val); + if (var && *var) debug(4, ("extraneous: '%s'\n", var)); + return val; +} + +int +cppsetup(char *filename, + char *line, + struct filepointer *filep, + struct inclist *inc) +{ + IfParser ip; + struct _parse_data pd; + long val = 0; + + pd.filep = filep; + pd.inc = inc; + pd.line = line; + pd.filename = filename; + ip.funcs.handle_error = my_if_errors; + ip.funcs.eval_defined = my_eval_defined; + ip.funcs.eval_variable = my_eval_variable; + ip.data = (char *) &pd; + + (void) ParseIfExpression (&ip, line, &val); + if (val) + return IF; + else + return IFFALSE; +} +#endif /* CPP */ + diff -Naur security/coreconf/mkdepend/def.h mozilla/security/coreconf/mkdepend/def.h --- a/security/coreconf/mkdepend/def.h 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/mkdepend/def.h 2009-02-14 02:37:00.000000000 +0200 @@ -0,0 +1,184 @@ +/* $Xorg: def.h,v 1.4 2001/02/09 02:03:16 xorgcvs Exp $ */ +/* + +Copyright (c) 1993, 1994, 1998 The Open Group. + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/config/makedepend/def.h,v 3.14 2003/01/17 17:09:49 tsi Exp $ */ + +#ifndef NO_X11 +#include +#include +#endif +#include +#include +#include +#include +#if 0 +#ifndef X_NOT_POSIX +#ifndef _POSIX_SOURCE +#define _POSIX_SOURCE +#endif +#endif +#endif +#include +#include +#include + +#define MAXDEFINES 512 +#define MAXFILES 1024 +#define MAXINCFILES 256 /* "-include" files */ +#define MAXDIRS 1024 +#define SYMTABINC 10 /* must be > 1 for define() to work right */ +#define TRUE 1 +#define FALSE 0 + +/* the following must match the directives table in main.c */ +#define IF 0 +#define IFDEF 1 +#define IFNDEF 2 +#define ELSE 3 +#define ENDIF 4 +#define DEFINE 5 +#define UNDEF 6 +#define INCLUDE 7 +#define LINE 8 +#define PRAGMA 9 +#define ERROR 10 +#define IDENT 11 +#define SCCS 12 +#define ELIF 13 +#define EJECT 14 +#define WARNING 15 +#define INCLUDENEXT 16 +#define IFFALSE 17 /* pseudo value --- a/never matched */ +#define ELIFFALSE 18 /* pseudo value --- a/never matched */ +#define INCLUDEDOT 19 /* pseudo value --- a/never matched */ +#define IFGUESSFALSE 20 /* pseudo value --- a/never matched */ +#define ELIFGUESSFALSE 21 /* pseudo value --- a/never matched */ +#define INCLUDENEXTDOT 22 /* pseudo value --- a/never matched */ + +#ifdef DEBUG +extern int _debugmask; +/* + * debug levels are: + * + * 0 show ifn*(def)*,endif + * 1 trace defined/!defined + * 2 show #include + * 3 show #include SYMBOL + * 4-6 unused + */ +#define debug(level,arg) { if (_debugmask & (1 << level)) warning arg; } +#else +#define debug(level,arg) /**/ +#endif /* DEBUG */ + +typedef unsigned char boolean; + +struct symtab { + char *s_name; + char *s_value; +}; + +/* possible i_flag */ +#define DEFCHECKED (1<<0) /* whether defines have been checked */ +#define NOTIFIED (1<<1) /* whether we have revealed includes */ +#define MARKED (1<<2) /* whether it's in the makefile */ +#define SEARCHED (1<<3) /* whether we have read this */ +#define FINISHED (1<<4) /* whether we are done reading this */ +#define INCLUDED_SYM (1<<5) /* whether #include SYMBOL was found + Can't use i_list if TRUE */ +struct inclist { + char *i_incstring; /* string from #include line */ + char *i_file; /* path name of the include file */ + struct inclist **i_list; /* list of files it itself includes */ + int i_listlen; /* length of i_list */ + struct symtab **i_defs; /* symbol table for this file and its + children when merged */ + int i_ndefs; /* current # defines */ + boolean *i_merged; /* whether we have merged child + defines */ + unsigned char i_flags; +}; + +struct filepointer { + char *f_name; + char *f_p; + char *f_base; + char *f_end; + long f_len; + long f_line; + long cmdinc_count; + char **cmdinc_list; + long cmdinc_line; +}; + +#include +#if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */ +char *malloc(), *realloc(); +#endif /* macII */ + +char *copy(char *str); +int match(char *str, char **list); +char *base_name(char *file); +char *getnextline(struct filepointer *fp); +struct symtab **slookup(char *symbol, struct inclist *file); +struct symtab **isdefined(char *symbol, struct inclist *file, + struct inclist **srcfile); +struct symtab **fdefined(char *symbol, struct inclist *file, + struct inclist **srcfile); +struct filepointer *getfile(char *file); +void included_by(struct inclist *ip, + struct inclist *newfile); +struct inclist *newinclude(char *newfile, char *incstring); +void inc_clean (void); +struct inclist *inc_path(char *file, char *include, int type); + +void freefile(struct filepointer *fp); + +void define2(char *name, char *val, struct inclist *file); +void define(char *def, struct inclist *file); +void undefine(char *symbol, struct inclist *file); +int find_includes(struct filepointer *filep, + struct inclist *file, + struct inclist *file_red, + int recursion, boolean failOK); + +void recursive_pr_include(struct inclist *head, + char *file, char *base); +void add_include(struct filepointer *filep, + struct inclist *file, + struct inclist *file_red, + char *include, int type, + boolean failOK); + +int cppsetup(char *filename, + char *line, + struct filepointer *filep, + struct inclist *inc); + + +extern void fatalerr(char *, ...); +extern void warning(char *, ...); +extern void warning1(char *, ...); diff -Naur security/coreconf/mkdepend/ifparser.c mozilla/security/coreconf/mkdepend/ifparser.c --- a/security/coreconf/mkdepend/ifparser.c 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/mkdepend/ifparser.c 2009-02-14 21:40:54.000000000 +0200 @@ -0,0 +1,551 @@ +/* + * $Xorg: ifparser.c,v 1.3 2000/08/17 19:41:50 cpqbld Exp $ + * + * Copyright 1992 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Network Computing Devices may not be + * used in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. Network Computing Devices makes + * no representations about the suitability of this software for any purpose. + * It is provided ``as is'' without express or implied warranty. + * + * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, + * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Author: Jim Fulton + * Network Computing Devices, Inc. + * + * Simple if statement processor + * + * This module can be used to evaluate string representations of C language + * if constructs. It accepts the following grammar: + * + * EXPRESSION := VALUE + * | VALUE BINOP EXPRESSION + * | VALUE '?' EXPRESSION ':' EXPRESSION + * + * VALUE := '(' EXPRESSION ')' + * | '!' VALUE + * | '-' VALUE + * | '+' VALUE + * | '~' VALUE + * | 'defined' '(' variable ')' + * | 'defined' variable + * | # variable '(' variable-list ')' + * | variable + * | number + * + * BINOP := '*' | '/' | '%' + * | '+' | '-' + * | '<<' | '>>' + * | '<' | '>' | '<=' | '>=' + * | '==' | '!=' + * | '&' | '^' | '|' + * | '&&' | '||' + * + * The normal C order of precedence is supported. + * + * + * External Entry Points: + * + * ParseIfExpression parse a string for #if + */ +/* $XFree86: xc/config/makedepend/ifparser.c,v 3.11 2002/09/23 01:48:08 tsi Exp $ */ + +#include "ifparser.h" +#include +#include +#include + +/**************************************************************************** + Internal Macros and Utilities for Parser + ****************************************************************************/ + +#define DO(val) if (!(val)) return NULL +#define CALLFUNC(ggg,fff) (*((ggg)->funcs.fff)) +#define SKIPSPACE(ccc) while (isspace(*ccc)) ccc++ +#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_') + + +static const char * +parse_variable (IfParser *g, const char *cp, const char **varp) +{ + SKIPSPACE (cp); + + if (!isvarfirstletter (*cp)) + return CALLFUNC(g, handle_error) (g, cp, "variable name"); + + *varp = cp; + /* EMPTY */ + for (cp++; isalnum(*cp) || *cp == '_'; cp++) ; + return cp; +} + + +static const char * +parse_number (IfParser *g, const char *cp, long *valp) +{ + long base = 10; + SKIPSPACE (cp); + + if (!isdigit(*cp)) + return CALLFUNC(g, handle_error) (g, cp, "number"); + + *valp = 0; + + if (*cp == '0') { + cp++; + if ((*cp == 'x') || (*cp == 'X')) { + base = 16; + cp++; + } else { + base = 8; + } + } + + /* Ignore overflows and assume ASCII, what source is usually written in */ + while (1) { + int increment = -1; + if (base == 8) { + if ((*cp >= '0') && (*cp <= '7')) + increment = *cp++ - '0'; + } else if (base == 16) { + if ((*cp >= '0') && (*cp <= '9')) + increment = *cp++ - '0'; + else if ((*cp >= 'A') && (*cp <= 'F')) + increment = *cp++ - ('A' - 10); + else if ((*cp >= 'a') && (*cp <= 'f')) + increment = *cp++ - ('a' - 10); + } else { /* Decimal */ + if ((*cp >= '0') && (*cp <= '9')) + increment = *cp++ - '0'; + } + if (increment < 0) + break; + *valp = (*valp * base) + increment; + } + + /* Skip trailing qualifiers */ + while (*cp == 'U' || *cp == 'u' || *cp == 'L' || *cp == 'l') cp++; + return cp; +} + +static const char * +parse_character (IfParser *g, const char *cp, long *valp) +{ + char val; + + SKIPSPACE (cp); + if (*cp == '\\') + switch (cp[1]) { + case 'n': val = '\n'; break; + case 't': val = '\t'; break; + case 'v': val = '\v'; break; + case 'b': val = '\b'; break; + case 'r': val = '\r'; break; + case 'f': val = '\f'; break; + case 'a': val = '\a'; break; + case '\\': val = '\\'; break; + case '?': val = '\?'; break; + case '\'': val = '\''; break; + case '\"': val = '\"'; break; + case 'x': val = (char) strtol (cp + 2, NULL, 16); break; + default: val = (char) strtol (cp + 1, NULL, 8); break; + } + else + val = *cp; + while (*cp != '\'') cp++; + *valp = (long) val; + return cp; +} + +static const char * +parse_value (IfParser *g, const char *cp, long *valp) +{ + const char *var, *varend; + + *valp = 0; + + SKIPSPACE (cp); + if (!*cp) + return cp; + + switch (*cp) { + case '(': + DO (cp = ParseIfExpression (g, cp + 1, valp)); + SKIPSPACE (cp); + if (*cp != ')') + return CALLFUNC(g, handle_error) (g, cp, ")"); + + return cp + 1; /* skip the right paren */ + + case '!': + DO (cp = parse_value (g, cp + 1, valp)); + *valp = !(*valp); + return cp; + + case '-': + DO (cp = parse_value (g, cp + 1, valp)); + *valp = -(*valp); + return cp; + + case '+': + DO (cp = parse_value (g, cp + 1, valp)); + return cp; + + case '~': + DO (cp = parse_value (g, cp + 1, valp)); + *valp = ~(*valp); + return cp; + + case '#': + DO (cp = parse_variable (g, cp + 1, &var)); + SKIPSPACE (cp); + if (*cp != '(') + return CALLFUNC(g, handle_error) (g, cp, "("); + do { + DO (cp = parse_variable (g, cp + 1, &var)); + SKIPSPACE (cp); + } while (*cp && *cp != ')'); + if (*cp != ')') + return CALLFUNC(g, handle_error) (g, cp, ")"); + *valp = 1; /* XXX */ + return cp + 1; + + case '\'': + DO (cp = parse_character (g, cp + 1, valp)); + if (*cp != '\'') + return CALLFUNC(g, handle_error) (g, cp, "'"); + return cp + 1; + + case 'd': + if (strncmp (cp, "defined", 7) == 0 && !isalnum(cp[7])) { + int paren = 0; + int len; + + cp += 7; + SKIPSPACE (cp); + if (*cp == '(') { + paren = 1; + cp++; + } + DO (cp = parse_variable (g, cp, &var)); + len = cp - var; + SKIPSPACE (cp); + if (paren && *cp != ')') + return CALLFUNC(g, handle_error) (g, cp, ")"); + *valp = (*(g->funcs.eval_defined)) (g, var, len); + return cp + paren; /* skip the right paren */ + } + /* fall out */ + } + + if (isdigit(*cp)) { + DO (cp = parse_number (g, cp, valp)); + } else if (!isvarfirstletter(*cp)) + return CALLFUNC(g, handle_error) (g, cp, "variable or number"); + else { + DO (cp = parse_variable (g, cp, &var)); + varend = cp; + SKIPSPACE(cp); + if (*cp != '(') { + *valp = (*(g->funcs.eval_variable)) (g, var, varend - var); + } else { + do { + long dummy; + DO (cp = ParseIfExpression (g, cp + 1, &dummy)); + SKIPSPACE(cp); + if (*cp == ')') + break; + if (*cp != ',') + return CALLFUNC(g, handle_error) (g, cp, ","); + } while (1); + + *valp = 1; /* XXX */ + cp++; + } + } + + return cp; +} + + + +static const char * +parse_product (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_value (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '*': + DO (cp = parse_product (g, cp + 1, &rightval)); + *valp = (*valp * rightval); + break; + + case '/': + DO (cp = parse_product (g, cp + 1, &rightval)); + if (rightval == 0) + return CALLFUNC(g, handle_error) (g, cp, "0"); + *valp = (*valp / rightval); + break; + + case '%': + DO (cp = parse_product (g, cp + 1, &rightval)); + *valp = (*valp % rightval); + break; + } + return cp; +} + + +static const char * +parse_sum (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_product (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '+': + DO (cp = parse_sum (g, cp + 1, &rightval)); + *valp = (*valp + rightval); + break; + + case '-': + DO (cp = parse_sum (g, cp + 1, &rightval)); + *valp = (*valp - rightval); + break; + } + return cp; +} + + +static const char * +parse_shift (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_sum (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '<': + if (cp[1] == '<') { + DO (cp = parse_shift (g, cp + 2, &rightval)); + *valp = (*valp << rightval); + } + break; + + case '>': + if (cp[1] == '>') { + DO (cp = parse_shift (g, cp + 2, &rightval)); + *valp = (*valp >> rightval); + } + break; + } + return cp; +} + + +static const char * +parse_inequality (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_shift (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '<': + if (cp[1] == '=') { + DO (cp = parse_inequality (g, cp + 2, &rightval)); + *valp = (*valp <= rightval); + } else { + DO (cp = parse_inequality (g, cp + 1, &rightval)); + *valp = (*valp < rightval); + } + break; + + case '>': + if (cp[1] == '=') { + DO (cp = parse_inequality (g, cp + 2, &rightval)); + *valp = (*valp >= rightval); + } else { + DO (cp = parse_inequality (g, cp + 1, &rightval)); + *valp = (*valp > rightval); + } + break; + } + return cp; +} + + +static const char * +parse_equality (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_inequality (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '=': + if (cp[1] == '=') + cp++; + DO (cp = parse_equality (g, cp + 1, &rightval)); + *valp = (*valp == rightval); + break; + + case '!': + if (cp[1] != '=') + break; + DO (cp = parse_equality (g, cp + 2, &rightval)); + *valp = (*valp != rightval); + break; + } + return cp; +} + + +static const char * +parse_band (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_equality (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '&': + if (cp[1] != '&') { + DO (cp = parse_band (g, cp + 1, &rightval)); + *valp = (*valp & rightval); + } + break; + } + return cp; +} + + +static const char * +parse_bxor (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_band (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '^': + DO (cp = parse_bxor (g, cp + 1, &rightval)); + *valp = (*valp ^ rightval); + break; + } + return cp; +} + + +static const char * +parse_bor (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_bxor (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '|': + if (cp[1] != '|') { + DO (cp = parse_bor (g, cp + 1, &rightval)); + *valp = (*valp | rightval); + } + break; + } + return cp; +} + + +static const char * +parse_land (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_bor (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '&': + if (cp[1] != '&') + return CALLFUNC(g, handle_error) (g, cp, "&&"); + DO (cp = parse_land (g, cp + 2, &rightval)); + *valp = (*valp && rightval); + break; + } + return cp; +} + + +static const char * +parse_lor (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_land (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '|': + if (cp[1] != '|') + return CALLFUNC(g, handle_error) (g, cp, "||"); + DO (cp = parse_lor (g, cp + 2, &rightval)); + *valp = (*valp || rightval); + break; + } + return cp; +} + + +static const char * +parse_cond(IfParser *g, const char *cp, long *valp) +{ + long trueval, falseval; + + DO (cp = parse_lor (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '?': + DO (cp = parse_cond (g, cp + 1, &trueval)); + SKIPSPACE (cp); + if (*cp != ':') + return CALLFUNC(g, handle_error) (g, cp, ":"); + DO (cp = parse_cond (g, cp + 1, &falseval)); + *valp = (*valp ? trueval : falseval); + break; + } + return cp; +} + + +/**************************************************************************** + External Entry Points + ****************************************************************************/ + +const char * +ParseIfExpression (IfParser *g, const char *cp, long *valp) +{ + return parse_cond (g, cp, valp); +} diff -Naur security/coreconf/mkdepend/ifparser.h mozilla/security/coreconf/mkdepend/ifparser.h --- a/security/coreconf/mkdepend/ifparser.h 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/mkdepend/ifparser.h 2009-02-14 02:37:01.000000000 +0200 @@ -0,0 +1,83 @@ +/* + * $Xorg: ifparser.h,v 1.3 2000/08/17 19:41:51 cpqbld Exp $ + * + * Copyright 1992 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Network Computing Devices may not be + * used in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. Network Computing Devices makes + * no representations about the suitability of this software for any purpose. + * It is provided ``as is'' without express or implied warranty. + * + * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, + * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Author: Jim Fulton + * Network Computing Devices, Inc. + * + * Simple if statement processor + * + * This module can be used to evaluate string representations of C language + * if constructs. It accepts the following grammar: + * + * EXPRESSION := VALUE + * | VALUE BINOP EXPRESSION + * | VALUE '?' EXPRESSION ':' EXPRESSION + * + * VALUE := '(' EXPRESSION ')' + * | '!' VALUE + * | '-' VALUE + * | '~' VALUE + * | 'defined' '(' variable ')' + * | variable + * | number + * + * BINOP := '*' | '/' | '%' + * | '+' | '-' + * | '<<' | '>>' + * | '<' | '>' | '<=' | '>=' + * | '==' | '!=' + * | '&' | '^' | '|' + * | '&&' | '||' + * + * The normal C order of precedence is supported. + * + * + * External Entry Points: + * + * ParseIfExpression parse a string for #if + */ + +/* $XFree86: xc/config/makedepend/ifparser.h,v 3.5 2001/07/25 15:04:40 dawes Exp $ */ + +#include + +typedef int Bool; +#define False 0 +#define True 1 + +typedef struct _if_parser { + struct { /* functions */ + const char *(*handle_error) (struct _if_parser *, const char *, + const char *); + long (*eval_variable) (struct _if_parser *, const char *, int); + int (*eval_defined) (struct _if_parser *, const char *, int); + } funcs; + char *data; +} IfParser; + +const char *ParseIfExpression ( + IfParser *, + const char *, + long * +); + diff -Naur security/coreconf/mkdepend/imakemdep.h mozilla/security/coreconf/mkdepend/imakemdep.h --- a/security/coreconf/mkdepend/imakemdep.h 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/mkdepend/imakemdep.h 2009-02-14 03:06:13.000000000 +0200 @@ -0,0 +1,782 @@ + +/* $XConsortium: imakemdep.h,v 1.83 95/04/07 19:47:46 kaleb Exp $ */ +/* $XFree86: xc/config/imake/imakemdep.h,v 3.12 1995/07/08 10:22:17 dawes Exp $ */ +/* + +Copyright (c) 1993, 1994 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the X Consortium. + +*/ + + +/* + * This file contains machine-dependent constants for the imake utility. + * When porting imake, read each of the steps below and add in any necessary + * definitions. In general you should *not* edit ccimake.c or imake.c! + */ + +#ifdef CCIMAKE +/* + * Step 1: imake_ccflags + * Define any special flags that will be needed to get imake.c to compile. + * These will be passed to the compile along with the contents of the + * make variable BOOTSTRAPCFLAGS. + */ +#ifdef hpux +#ifdef hp9000s800 +#define imake_ccflags "-DSYSV" +#else +#define imake_ccflags "-Wc,-Nd4000,-Ns3000 -DSYSV" +#endif +#endif + +#if defined(macII) || defined(_AUX_SOURCE) +#define imake_ccflags "-DmacII -DSYSV" +#endif + +#ifdef stellar +#define imake_ccflags "-DSYSV" +#endif + +#if defined(USL) || defined(Oki) || defined(NCR) +#define imake_ccflags "-Xc -DSVR4" +#endif + +#ifdef sony +#if defined(SYSTYPE_SYSV) || defined(_SYSTYPE_SYSV) +#define imake_ccflags "-DSVR4" +#else +#include +#if NEWSOS < 41 +#define imake_ccflags "-Dbsd43 -DNOSTDHDRS" +#else +#if NEWSOS < 42 +#define imake_ccflags "-Dbsd43" +#endif +#endif +#endif +#endif + +#ifdef _CRAY +#define imake_ccflags "-DSYSV -DUSG" +#endif + +#if defined(_IBMR2) || defined(aix) +#define imake_ccflags "-Daix -DSYSV" +#endif + +#ifdef Mips +# if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43) +# define imake_ccflags "-DBSD43" +# else +# define imake_ccflags "-DSYSV" +# endif +#endif + +#ifdef is68k +#define imake_ccflags "-Dluna -Duniosb" +#endif + +#ifdef SYSV386 +# ifdef SVR4 +# define imake_ccflags "-Xc -DSVR4" +# else +# define imake_ccflags "-DSYSV" +# endif +#endif + +#ifdef SVR4 +# ifdef i386 +# define imake_ccflags "-Xc -DSVR4" +# endif +#endif + +#ifdef SYSV +# ifdef i386 +# define imake_ccflags "-DSYSV" +# endif +#endif + +#ifdef __convex__ +#define imake_ccflags "-fn -tm c1" +#endif + +#ifdef apollo +#define imake_ccflags "-DX_NOT_POSIX" +#endif + +#ifdef WIN32 +#define imake_ccflags "-nologo -batch -D__STDC__" +#endif + +#ifdef __uxp__ +#define imake_ccflags "-DSVR4 -DANSICPP" +#endif + +#ifdef __sxg__ +#define imake_ccflags "-DSYSV -DUSG -DNOSTDHDRS" +#endif + +#ifdef sequent +#define imake_ccflags "-DX_NOT_STDC_ENV -DX_NOT_POSIX" +#endif + +#ifdef _SEQUENT_ +#define imake_ccflags "-DSYSV -DUSG" +#endif + +#if defined(SX) || defined(PC_UX) +#define imake_ccflags "-DSYSV" +#endif + +#ifdef nec_ews_svr2 +#define imake_ccflags "-DUSG" +#endif + +#if defined(nec_ews_svr4) || defined(_nec_ews_svr4) || defined(_nec_up) || defined(_nec_ft) +#define imake_ccflags "-DSVR4" +#endif + +#ifdef MACH +#define imake_ccflags "-DNOSTDHDRS" +#endif + +/* this is for OS/2 under EMX. This won't work with DOS */ +#if defined(__EMX__) +#define imake_ccflags "-DBSD43" +#endif + +#else /* not CCIMAKE */ +#ifndef MAKEDEPEND +/* + * Step 2: dup2 + * If your OS doesn't have a dup2() system call to duplicate one file + * descriptor onto another, define such a mechanism here (if you don't + * already fall under the existing category(ies). + */ +#if defined(SYSV) && !defined(_CRAY) && !defined(Mips) && !defined(_SEQUENT_) +#define dup2(fd1,fd2) ((fd1 == fd2) ? fd1 : (close(fd2), \ + fcntl(fd1, F_DUPFD, fd2))) +#endif + + +/* + * Step 3: FIXUP_CPP_WHITESPACE + * If your cpp collapses tabs macro expansions into a single space and + * replaces escaped newlines with a space, define this symbol. This will + * cause imake to attempt to patch up the generated Makefile by looking + * for lines that have colons in them (this is why the rules file escapes + * all colons). One way to tell if you need this is to see whether or not + * your Makefiles have no tabs in them and lots of @@ strings. + */ +#if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || (defined(AMOEBA) && defined(CROSS_COMPILE)) +#define FIXUP_CPP_WHITESPACE +#endif +#ifdef WIN32 +#define REMOVE_CPP_LEADSPACE +#define INLINE_SYNTAX +#define MAGIC_MAKE_VARS +#endif +#ifdef __minix_vmd +#define FIXUP_CPP_WHITESPACE +#endif + +/* + * Step 4: USE_CC_E, DEFAULT_CC, DEFAULT_CPP + * If you want to use cc -E instead of cpp, define USE_CC_E. + * If use cc -E but want a different compiler, define DEFAULT_CC. + * If the cpp you need is not in /lib/cpp, define DEFAULT_CPP. + */ +#ifdef hpux +#define USE_CC_E +#endif +#ifdef WIN32 +#define USE_CC_E +#define DEFAULT_CC "cl" +#endif +#ifdef apollo +#define DEFAULT_CPP "/usr/lib/cpp" +#endif +#if defined(_IBMR2) && !defined(DEFAULT_CPP) +#define DEFAULT_CPP "/usr/lpp/X11/Xamples/util/cpp/cpp" +#endif +#if defined(sun) && defined(SVR4) +#define DEFAULT_CPP "/usr/ccs/lib/cpp" +#endif +#ifdef __bsdi__ +#define DEFAULT_CPP "/usr/bin/cpp" +#endif +#ifdef __uxp__ +#define DEFAULT_CPP "/usr/ccs/lib/cpp" +#endif +#ifdef __sxg__ +#define DEFAULT_CPP "/usr/lib/cpp" +#endif +#ifdef _CRAY +#define DEFAULT_CPP "/lib/pcpp" +#endif +#if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) +#define DEFAULT_CPP "/usr/libexec/cpp" +#endif +#ifdef MACH +#define USE_CC_E +#endif +#ifdef __minix_vmd +#define DEFAULT_CPP "/usr/lib/cpp" +#endif +#if defined(__EMX__) +/* expects cpp in PATH */ +#define DEFAULT_CPP "cpp" +#endif + +/* + * Step 5: cpp_argv + * The following table contains the flags that should be passed + * whenever a Makefile is being generated. If your preprocessor + * doesn't predefine any unique symbols, choose one and add it to the + * end of this table. Then, do the following: + * + * a. Use this symbol in Imake.tmpl when setting MacroFile. + * b. Put this symbol in the definition of BootstrapCFlags in your + * .cf file. + * c. When doing a make World, always add "BOOTSTRAPCFLAGS=-Dsymbol" + * to the end of the command line. + * + * Note that you may define more than one symbol (useful for platforms + * that support multiple operating systems). + */ + +#define ARGUMENTS 50 /* number of arguments in various arrays */ +char *cpp_argv[ARGUMENTS] = { + "cc", /* replaced by the actual program to exec */ + "-I.", /* add current directory to include path */ +#ifdef unix + "-Uunix", /* remove unix symbol so that filename unix.c okay */ +#endif +#if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(MACH) +# ifdef __i386__ + "-D__i386__", +# endif +# ifdef __x86_64__ + "-D__x86_64__", +# endif +# ifdef __GNUC__ + "-traditional", +# endif +#endif +#ifdef M4330 + "-DM4330", /* Tektronix */ +#endif +#ifdef M4310 + "-DM4310", /* Tektronix */ +#endif +#if defined(macII) || defined(_AUX_SOURCE) + "-DmacII", /* Apple A/UX */ +#endif +#ifdef USL + "-DUSL", /* USL */ +#endif +#ifdef sony + "-Dsony", /* Sony */ +#if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV) && NEWSOS < 42 + "-Dbsd43", +#endif +#endif +#ifdef _IBMR2 + "-D_IBMR2", /* IBM RS-6000 (we ensured that aix is defined above */ +#ifndef aix +#define aix /* allow BOOTSTRAPCFLAGS="-D_IBMR2" */ +#endif +#endif /* _IBMR2 */ +#ifdef aix + "-Daix", /* AIX instead of AOS */ +#ifndef ibm +#define ibm /* allow BOOTSTRAPCFLAGS="-Daix" */ +#endif +#endif /* aix */ +#ifdef ibm + "-Dibm", /* IBM PS/2 and RT under both AOS and AIX */ +#endif +#ifdef luna + "-Dluna", /* OMRON luna 68K and 88K */ +#ifdef luna1 + "-Dluna1", +#endif +#ifdef luna88k /* need not on UniOS-Mach Vers. 1.13 */ + "-traditional", /* for some older version */ +#endif /* instead of "-DXCOMM=\\#" */ +#ifdef uniosb + "-Duniosb", +#endif +#ifdef uniosu + "-Duniosu", +#endif +#endif /* luna */ +#ifdef _CRAY /* Cray */ + "-Ucray", +#endif +#ifdef Mips + "-DMips", /* Define and use Mips for Mips Co. OS/mach. */ +# if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43) + "-DBSD43", /* Mips RISCOS supports two environments */ +# else + "-DSYSV", /* System V environment is the default */ +# endif +#endif /* Mips */ +#ifdef MOTOROLA + "-DMOTOROLA", /* Motorola Delta Systems */ +# ifdef SYSV + "-DSYSV", +# endif +# ifdef SVR4 + "-DSVR4", +# endif +#endif /* MOTOROLA */ +#ifdef i386 + "-Di386", +# ifdef SVR4 + "-DSVR4", +# endif +# ifdef SYSV + "-DSYSV", +# ifdef ISC + "-DISC", +# ifdef ISC40 + "-DISC40", /* ISC 4.0 */ +# else +# ifdef ISC202 + "-DISC202", /* ISC 2.0.2 */ +# else +# ifdef ISC30 + "-DISC30", /* ISC 3.0 */ +# else + "-DISC22", /* ISC 2.2.1 */ +# endif +# endif +# endif +# endif +# ifdef SCO + "-DSCO", +# ifdef SCO324 + "-DSCO324", +# endif +# endif +# endif +# ifdef ESIX + "-DESIX", +# endif +# ifdef ATT + "-DATT", +# endif +# ifdef DELL + "-DDELL", +# endif +#endif +#ifdef SYSV386 /* System V/386 folks, obsolete */ + "-Di386", +# ifdef SVR4 + "-DSVR4", +# endif +# ifdef ISC + "-DISC", +# ifdef ISC40 + "-DISC40", /* ISC 4.0 */ +# else +# ifdef ISC202 + "-DISC202", /* ISC 2.0.2 */ +# else +# ifdef ISC30 + "-DISC30", /* ISC 3.0 */ +# else + "-DISC22", /* ISC 2.2.1 */ +# endif +# endif +# endif +# endif +# ifdef SCO + "-DSCO", +# ifdef SCO324 + "-DSCO324", +# endif +# endif +# ifdef ESIX + "-DESIX", +# endif +# ifdef ATT + "-DATT", +# endif +# ifdef DELL + "-DDELL", +# endif +#endif +#ifdef __osf__ + "-D__osf__", +# ifdef __mips__ + "-D__mips__", +# endif +# ifdef __alpha + "-D__alpha", +# endif +# ifdef __i386__ + "-D__i386__", +# endif +# ifdef __GNUC__ + "-traditional", +# endif +#endif +#ifdef Oki + "-DOki", +#endif +#ifdef sun +#ifdef SVR4 + "-DSVR4", +#endif +#endif +#ifdef WIN32 + "-DWIN32", + "-nologo", + "-batch", + "-D__STDC__", +#endif +#ifdef NCR + "-DNCR", /* NCR */ +#endif +#ifdef linux + "-traditional", + "-Dlinux", +#endif +#ifdef __uxp__ + "-D__uxp__", +#endif +#ifdef __sxg__ + "-D__sxg__", +#endif +#ifdef nec_ews_svr2 + "-Dnec_ews_svr2", +#endif +#ifdef AMOEBA + "-DAMOEBA", +# ifdef CROSS_COMPILE + "-DCROSS_COMPILE", +# ifdef CROSS_i80386 + "-Di80386", +# endif +# ifdef CROSS_sparc + "-Dsparc", +# endif +# ifdef CROSS_mc68000 + "-Dmc68000", +# endif +# else +# ifdef i80386 + "-Di80386", +# endif +# ifdef sparc + "-Dsparc", +# endif +# ifdef mc68000 + "-Dmc68000", +# endif +# endif +#endif +#ifdef __minix_vmd + "-Dminix", +#endif + +#if defined(__EMX__) + "-traditional", + "-Demxos2", +#endif + +}; +#else /* else MAKEDEPEND */ +/* + * Step 6: predefs + * If your compiler and/or preprocessor define any specific symbols, add + * them to the the following table. The definition of struct symtab is + * in util/makedepend/def.h. + */ +#define QUOTEIT(x) #x +#define QUOTEEXPANSION(x) QUOTEIT(x) + +struct symtab predefs[] = { +#ifdef apollo + {"apollo", "1"}, +#endif +#ifdef ibm032 + {"ibm032", "1"}, +#endif +#ifdef ibm + {"ibm", "1"}, +#endif +#ifdef aix + {"aix", "1"}, +#endif +#ifdef sun + {"sun", "1"}, +#endif +#ifdef sun2 + {"sun2", "1"}, +#endif +#ifdef sun3 + {"sun3", "1"}, +#endif +#ifdef sun4 + {"sun4", "1"}, +#endif +#ifdef sparc + {"sparc", "1"}, +#endif +#ifdef __sparc__ + {"__sparc__", "1"}, +#endif +#ifdef hpux + {"hpux", "1"}, +#endif +#ifdef __hpux + {"__hpux", "1"}, +#endif +#ifdef __hp9000s800 + {"__hp9000s800", "1"}, +#endif +#ifdef __hp9000s700 + {"__hp9000s700", "1"}, +#endif +#ifdef vax + {"vax", "1"}, +#endif +#ifdef VMS + {"VMS", "1"}, +#endif +#ifdef cray + {"cray", "1"}, +#endif +#ifdef CRAY + {"CRAY", "1"}, +#endif +#ifdef _CRAY + {"_CRAY", "1"}, +#endif +#ifdef att + {"att", "1"}, +#endif +#ifdef mips + {"mips", "1"}, +#endif +#ifdef __mips__ + {"__mips__", "1"}, +#endif +#ifdef ultrix + {"ultrix", "1"}, +#endif +#ifdef stellar + {"stellar", "1"}, +#endif +#ifdef mc68000 + {"mc68000", "1"}, +#endif +#ifdef mc68020 + {"mc68020", "1"}, +#endif +#ifdef __GNUC__ + {"__GNUC__", "1"}, +#endif +#if __STDC__ + {"__STDC__", "1"}, +#endif +#ifdef __HIGHC__ + {"__HIGHC__", "1"}, +#endif +#ifdef CMU + {"CMU", "1"}, +#endif +#ifdef luna + {"luna", "1"}, +#ifdef luna1 + {"luna1", "1"}, +#endif +#ifdef luna2 + {"luna2", "1"}, +#endif +#ifdef luna88k + {"luna88k", "1"}, +#endif +#ifdef uniosb + {"uniosb", "1"}, +#endif +#ifdef uniosu + {"uniosu", "1"}, +#endif +#endif +#ifdef ieeep754 + {"ieeep754", "1"}, +#endif +#ifdef is68k + {"is68k", "1"}, +#endif +#ifdef m68k + {"m68k", "1"}, +#endif +#ifdef m88k + {"m88k", "1"}, +#endif +#ifdef __m88k__ + {"__m88k__", "1"}, +#endif +#ifdef bsd43 + {"bsd43", "1"}, +#endif +#ifdef hcx + {"hcx", "1"}, +#endif +#ifdef sony + {"sony", "1"}, +#ifdef SYSTYPE_SYSV + {"SYSTYPE_SYSV", "1"}, +#endif +#ifdef _SYSTYPE_SYSV + {"_SYSTYPE_SYSV", "1"}, +#endif +#endif +#ifdef __OSF__ + {"__OSF__", "1"}, +#endif +#ifdef __osf__ + {"__osf__", "1"}, +#endif +#ifdef __alpha + {"__alpha", "1"}, +#endif +#ifdef __DECC + {"__DECC", "1"}, +#endif +#ifdef __decc + {"__decc", "1"}, +#endif +#ifdef __uxp__ + {"__uxp__", "1"}, +#endif +#ifdef __sxg__ + {"__sxg__", "1"}, +#endif +#ifdef _SEQUENT_ + {"_SEQUENT_", "1"}, + {"__STDC__", "1"}, +#endif +#ifdef __bsdi__ + {"__bsdi__", "1"}, +#endif +#ifdef nec_ews_svr2 + {"nec_ews_svr2", "1"}, +#endif +#ifdef nec_ews_svr4 + {"nec_ews_svr4", "1"}, +#endif +#ifdef _nec_ews_svr4 + {"_nec_ews_svr4", "1"}, +#endif +#ifdef _nec_up + {"_nec_up", "1"}, +#endif +#ifdef SX + {"SX", "1"}, +#endif +#ifdef nec + {"nec", "1"}, +#endif +#ifdef _nec_ft + {"_nec_ft", "1"}, +#endif +#ifdef PC_UX + {"PC_UX", "1"}, +#endif +#ifdef sgi + {"sgi", "1"}, +#endif +#ifdef __sgi + {"__sgi", "1"}, +#endif +#ifdef __FreeBSD__ + {"__FreeBSD__", "1"}, +#endif +#ifdef __NetBSD__ + {"__NetBSD__", "1"}, +#endif +#ifdef __OpenBSD__ + {"__OpenBSD__", "1"}, +#endif +#ifdef __EMX__ + {"__EMX__", "1"}, +#endif + /* ADDED THE FOLLOWING SYMBOLS FOR WINDOWS */ +#ifdef _WIN32 + {"_WIN32", QUOTEEXPANSION(_WIN32) }, +#endif +#ifdef _WIN64 + {"_WIN64", QUOTEEXPANSION(_WIN64) }, +#endif +#ifdef _X86 + {"_X86", QUOTEEXPANSION(_X86) }, +#endif +#ifdef _X86_ + {"_X86_", QUOTEEXPANSION(_X86_) }, +#endif +#ifdef _X86_64 + {"_X86_64", QUOTEEXPANSION(_X86_64) }, +#endif +#ifdef _X86_64_ + {"_X86_64_", QUOTEEXPANSION(_X86_64_) }, +#endif +#ifdef _DEBUG + {"_DEBUG", QUOTEEXPANSION(_DEBUG) }, +#endif +#ifdef _DLL + {"_DLL", QUOTEEXPANSION(_DLL) }, +#endif +#ifdef _M_IX86 + {"_M_IX86", QUOTEEXPANSION(_M_IX86) }, +#endif +#ifdef _M_X64 + {"_M_X64", QUOTEEXPANSION(_M_X64) }, +#endif +#ifdef _MSC_FULL_VER + {"_MSC_FULL_VER", QUOTEEXPANSION(_MSC_FULL_VER) }, +#endif +#ifdef _MSC_VER + {"_MSC_VER", QUOTEEXPANSION(_MSC_VER) }, +#endif +#ifdef _MSVC_RUNTIME_CHECKS + {"_MSVC_RUNTIME_CHECKS", QUOTEEXPANSION(_MSVC_RUNTIME_CHECKS) }, +#endif +#ifdef _MT + {"_MT", QUOTEEXPANSION(_MT) }, +#endif +#ifdef _CHAR_UNSIGNED + {"_CHAR_UNSIGNED", QUOTEEXPANSION(_CHAR_UNSIGNED) }, +#endif + /* add any additional symbols before this line */ + {NULL, NULL} +}; + +#endif /* MAKEDEPEND */ +#endif /* CCIMAKE */ diff -Naur security/coreconf/mkdepend/include.c mozilla/security/coreconf/mkdepend/include.c --- a/security/coreconf/mkdepend/include.c 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/mkdepend/include.c 2009-02-14 02:37:01.000000000 +0200 @@ -0,0 +1,337 @@ +/* $Xorg: include.c,v 1.4 2001/02/09 02:03:16 xorgcvs Exp $ */ +/* + +Copyright (c) 1993, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/config/makedepend/include.c,v 3.7 2001/12/14 19:53:20 dawes Exp $ */ + + +#include "def.h" + +#ifdef _MSC_VER +#include +static int +does_file_exist(char *file) +{ + WIN32_FILE_ATTRIBUTE_DATA data; + BOOL b = GetFileAttributesExA(file, GetFileExInfoStandard, &data); + if (!b) + return 0; + return (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0; +} +#else +static int +does_file_exist(char *file) +{ + struct stat sb; + return stat(file, &sb) == 0 && !S_ISDIR(sb.st_mode); +} +#endif + +extern struct inclist inclist[ MAXFILES ], + *inclistp, *inclistnext; +extern char *includedirs[ ], + **includedirsnext; +extern char *notdotdot[ ]; +extern boolean show_where_not; +extern boolean warn_multiple; + +static boolean +isdot(char *p) +{ + if(p && *p++ == '.' && *p++ == '\0') + return(TRUE); + return(FALSE); +} + +static boolean +isdotdot(char *p) +{ + if(p && *p++ == '.' && *p++ == '.' && *p++ == '\0') + return(TRUE); + return(FALSE); +} + +static boolean +issymbolic(char *dir, char *component) +{ +#ifdef S_IFLNK + struct stat st; + char buf[ BUFSIZ ], **pp; + + sprintf(buf, "%s%s%s", dir, *dir ? "/" : "", component); + for (pp=notdotdot; *pp; pp++) + if (strcmp(*pp, buf) == 0) + return (TRUE); + if (lstat(buf, &st) == 0 + && (st.st_mode & S_IFMT) == S_IFLNK) { + *pp++ = copy(buf); + if (pp >= ¬dotdot[ MAXDIRS ]) + fatalerr("out of .. dirs, increase MAXDIRS\n"); + return(TRUE); + } +#endif + return(FALSE); +} + +/* + * Occasionally, pathnames are created that look like .../x/../y + * Any of the 'x/..' sequences within the name can be eliminated. + * (but only if 'x' is not a symbolic link!!) + */ +static void +remove_dotdot(char *path) +{ + register char *end, *from, *to, **cp; + char *components[ MAXFILES ], + newpath[ BUFSIZ ]; + boolean component_copied; + + /* + * slice path up into components. + */ + to = newpath; + if (*path == '/') + *to++ = '/'; + *to = '\0'; + cp = components; + for (from=end=path; *end; end++) + if (*end == '/') { + while (*end == '/') + *end++ = '\0'; + if (*from) + *cp++ = from; + from = end; + } + *cp++ = from; + *cp = NULL; + + /* + * Recursively remove all 'x/..' component pairs. + */ + cp = components; + while(*cp) { + if (!isdot(*cp) && !isdotdot(*cp) && isdotdot(*(cp+1)) + && !issymbolic(newpath, *cp)) + { + char **fp = cp + 2; + char **tp = cp; + + do + *tp++ = *fp; /* move all the pointers down */ + while (*fp++); + if (cp != components) + cp--; /* go back and check for nested ".." */ + } else { + cp++; + } + } + /* + * Concatenate the remaining path elements. + */ + cp = components; + component_copied = FALSE; + while(*cp) { + if (component_copied) + *to++ = '/'; + component_copied = TRUE; + for (from = *cp; *from; ) + *to++ = *from++; + *to = '\0'; + cp++; + } + *to++ = '\0'; + + /* + * copy the reconstituted path back to our pointer. + */ + strcpy(path, newpath); +} + +/* + * Add an include file to the list of those included by 'file'. + */ +struct inclist * +newinclude(char *newfile, char *incstring) +{ + register struct inclist *ip; + + /* + * First, put this file on the global list of include files. + */ + ip = inclistp++; + if (inclistp == inclist + MAXFILES - 1) + fatalerr("out of space: increase MAXFILES\n"); + ip->i_file = copy(newfile); + + if (incstring == NULL) + ip->i_incstring = ip->i_file; + else + ip->i_incstring = copy(incstring); + + inclistnext = inclistp; + return(ip); +} + +void +included_by(struct inclist *ip, struct inclist *newfile) +{ + register int i; + + if (ip == NULL) + return; + /* + * Put this include file (newfile) on the list of files included + * by 'file'. If 'file' is NULL, then it is not an include + * file itself (i.e. was probably mentioned on the command line). + * If it is already on the list, don't stick it on again. + */ + if (ip->i_list == NULL) { + ip->i_list = (struct inclist **) + malloc(sizeof(struct inclist *) * ++ip->i_listlen); + ip->i_merged = (boolean *) + malloc(sizeof(boolean) * ip->i_listlen); + } else { + for (i=0; ii_listlen; i++) + if (ip->i_list[ i ] == newfile) { + i = strlen(newfile->i_file); + if (!(ip->i_flags & INCLUDED_SYM) && + !(i > 2 && + newfile->i_file[i-1] == 'c' && + newfile->i_file[i-2] == '.')) + { + /* only bitch if ip has */ + /* no #include SYMBOL lines */ + /* and is not a .c file */ + if (warn_multiple) + { + warning("%s includes %s more than once!\n", + ip->i_file, newfile->i_file); + warning1("Already have\n"); + for (i=0; ii_listlen; i++) + warning1("\t%s\n", ip->i_list[i]->i_file); + } + } + return; + } + ip->i_list = (struct inclist **) realloc(ip->i_list, + sizeof(struct inclist *) * ++ip->i_listlen); + ip->i_merged = (boolean *) + realloc(ip->i_merged, sizeof(boolean) * ip->i_listlen); + } + ip->i_list[ ip->i_listlen-1 ] = newfile; + ip->i_merged[ ip->i_listlen-1 ] = FALSE; +} + +void +inc_clean (void) +{ + register struct inclist *ip; + + for (ip = inclist; ip < inclistp; ip++) { + ip->i_flags &= ~MARKED; + } +} + +struct inclist * +inc_path(char *file, char *include, int type) +{ + static char path[ BUFSIZ ]; + register char **pp, *p; + register struct inclist *ip; + + /* + * Check all previously found include files for a path that + * has already been expanded. + */ + if ((type == INCLUDE) || (type == INCLUDEDOT)) + inclistnext = inclist; + ip = inclistnext; + + for (; ip->i_file; ip++) { + if ((strcmp(ip->i_incstring, include) == 0) && + !(ip->i_flags & INCLUDED_SYM)) { + inclistnext = ip + 1; + return ip; + } + } + + if (inclistnext == inclist) { + /* + * If the path was surrounded by "" or is an absolute path, + * then check the exact path provided. + */ + if ((type == INCLUDEDOT) || + (type == INCLUDENEXTDOT) || + (*include == '/')) { + if (does_file_exist(include)) + return newinclude(include, include); + if (show_where_not) + warning1("\tnot in %s\n", include); + } + + /* + * If the path was surrounded by "" see if this include file is + * in the directory of the file being parsed. + */ + if ((type == INCLUDEDOT) || (type == INCLUDENEXTDOT)) { + for (p=file+strlen(file); p>file; p--) + if (*p == '/') + break; + if (p == file) { + strcpy(path, include); + } else { + strncpy(path, file, (p-file) + 1); + path[ (p-file) + 1 ] = '\0'; + strcpy(path + (p-file) + 1, include); + } + remove_dotdot(path); + if (does_file_exist(path)) + return newinclude(path, include); + if (show_where_not) + warning1("\tnot in %s\n", path); + } + } + + /* + * Check the include directories specified. Standard include dirs + * should be at the end. + */ + if ((type == INCLUDE) || (type == INCLUDEDOT)) + includedirsnext = includedirs; + pp = includedirsnext; + + for (; *pp; pp++) { + sprintf(path, "%s/%s", *pp, include); + remove_dotdot(path); + if (does_file_exist(path)) { + includedirsnext = pp + 1; + return newinclude(path, include); + } + if (show_where_not) + warning1("\tnot in %s\n", path); + } + + return NULL; +} diff -Naur security/coreconf/mkdepend/main.c mozilla/security/coreconf/mkdepend/main.c --- a/security/coreconf/mkdepend/main.c 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/mkdepend/main.c 2009-02-14 21:40:55.000000000 +0200 @@ -0,0 +1,870 @@ +/* $Xorg: main.c,v 1.5 2001/02/09 02:03:16 xorgcvs Exp $ */ +/* + +Copyright (c) 1993, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/config/makedepend/main.c,v 3.32 2003/03/26 20:43:48 tsi Exp $ */ + +#include "def.h" +#ifdef hpux +#define sigvec sigvector +#endif /* hpux */ + +#ifdef X_POSIX_C_SOURCE +#define _POSIX_C_SOURCE X_POSIX_C_SOURCE +#include +#undef _POSIX_C_SOURCE +#else +#if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE) +#include +#else +#define _POSIX_SOURCE +#include +#undef _POSIX_SOURCE +#endif +#endif + +#include +#ifdef _WIN32 +#include +#endif + +#ifdef MINIX +#define USE_CHMOD 1 +#endif + +#ifdef DEBUG +int _debugmask; +#endif + +/* #define DEBUG_DUMP */ +#ifdef DEBUG_DUMP +#define DBG_PRINT(file, fmt, args) fprintf(file, fmt, args) +#else +#define DBG_PRINT(file, fmt, args) /* empty */ +#endif + +#define DASH_INC_PRE "#include \"" +#define DASH_INC_POST "\"" + +char *ProgramName; + +char *directives[] = { + "if", + "ifdef", + "ifndef", + "else", + "endif", + "define", + "undef", + "include", + "line", + "pragma", + "error", + "ident", + "sccs", + "elif", + "eject", + "warning", + "include_next", + NULL +}; + +#define MAKEDEPEND +#include "imakemdep.h" /* from config sources */ +#undef MAKEDEPEND + +struct inclist inclist[ MAXFILES ], + *inclistp = inclist, + *inclistnext = inclist, + maininclist; + +static char *filelist[ MAXFILES ]; +char *includedirs[ MAXDIRS + 1 ], + **includedirsnext = includedirs; +char *notdotdot[ MAXDIRS ]; +static int cmdinc_count = 0; +static char *cmdinc_list[ 2 * MAXINCFILES ]; +char *objprefix = ""; +char *objsuffix = OBJSUFFIX; +static char *startat = "# DO NOT DELETE"; +int width = 78; +static boolean append = FALSE; +boolean printed = FALSE; +boolean verbose = FALSE; +boolean show_where_not = FALSE; +/* Warn on multiple includes of same file */ +boolean warn_multiple = FALSE; + +static void setfile_cmdinc(struct filepointer *filep, long count, char **list); +static void redirect(char *line, char *makefile); + +static +#ifdef SIGNALRETURNSINT +int +#else +void +#endif +catch (int sig) +{ + fflush (stdout); + fatalerr ("got signal %d\n", sig); +} + +#if defined(USG) || (defined(i386) && defined(SYSV)) || defined(WIN32) || defined(__UNIXOS2__) || defined(Lynx_22) || defined(__CYGWIN__) +#define USGISH +#endif + +#ifndef USGISH +#ifdef X_NOT_POSIX +#define sigaction sigvec +#define sa_handler sv_handler +#define sa_mask sv_mask +#define sa_flags sv_flags +#endif +struct sigaction sig_act; +#endif /* USGISH */ + +int +main(int argc, char *argv[]) +{ + char **fp = filelist; + char **incp = includedirs; + char *p; + struct inclist *ip; + char *makefile = NULL; + struct filepointer *filecontent; + struct symtab *psymp = predefs; + char *endmarker = NULL; + char *defincdir = NULL; + char **undeflist = NULL; + int numundefs = 0, i; + register char offset; + + ProgramName = argv[0]; + + while (psymp->s_name) + { + define2(psymp->s_name, psymp->s_value, &maininclist); + psymp++; + } + if (argc == 2 && argv[1][0] == '@') { + struct stat ast; + int afd; + char *args; + char **nargv; + int nargc; + char quotechar = '\0'; + + nargc = 1; + if ((afd = open(argv[1]+1, O_RDONLY)) < 0) + fatalerr("cannot open \"%s\"\n", argv[1]+1); + fstat(afd, &ast); + args = (char *)malloc(ast.st_size + 1); + if ((ast.st_size = read(afd, args, ast.st_size)) < 0) + fatalerr("failed to read %s\n", argv[1]+1); + args[ast.st_size] = '\0'; + close(afd); + for (p = args; *p; p++) { + if (quotechar) { + if (quotechar == '\\' || + (*p == quotechar && p[-1] != '\\')) + quotechar = '\0'; + continue; + } + switch (*p) { + case '\\': + case '"': + case '\'': + quotechar = *p; + break; + case ' ': + case '\n': + *p = '\0'; + if (p > args && p[-1]) + nargc++; + break; + } + } + if (p[-1]) + nargc++; + nargv = (char **)malloc(nargc * sizeof(char *)); + nargv[0] = argv[0]; + argc = 1; + for (p = args; argc < nargc; p += strlen(p) + 1) + if (*p) nargv[argc++] = p; + argv = nargv; + } + for(argc--, argv++; argc; argc--, argv++) { + /* if looking for endmarker then check before parsing */ + if (endmarker && strcmp (endmarker, *argv) == 0) { + endmarker = NULL; + continue; + } + if (**argv != '-') { + /* treat +thing as an option for C++ */ + if (endmarker && **argv == '+') + continue; + *fp++ = argv[0]; + continue; + } + switch(argv[0][1]) { + case '-': + endmarker = &argv[0][2]; + if (endmarker[0] == '\0') endmarker = "--"; + break; + case 'D': + offset = 2; + if (argv[0][2] == '\0') { + argv++; + argc--; + offset = 0; + } + /* offset +1 here since first def letter + * cannot be `=` + */ + for (p = argv[0] + offset + 1; *p; p++) + if (*p == '=') { + *p = ' '; + break; + } + define(argv[0] + offset, &maininclist); + break; + case 'I': + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many -I flags.\n"); + *incp++ = argv[0]+2; + if (**(incp-1) == '\0') { + *(incp-1) = *(++argv); + argc--; + } + break; + case 'U': + /* Undef's override all -D's so save them up */ + numundefs++; + if (numundefs == 1) + undeflist = malloc(sizeof(char *)); + else + undeflist = realloc(undeflist, + numundefs * sizeof(char *)); + offset = 2; + if (argv[0][2] == '\0') { + argv++; + argc--; + offset = 0; + } + undeflist[numundefs - 1] = argv[0] + offset; + break; + case 'Y': + defincdir = argv[0]+2; + break; + /* do not use if endmarker processing */ + case 'a': + if (endmarker) break; + append = TRUE; + break; + case 'w': + if (endmarker) break; + if (argv[0][2] == '\0') { + argv++; + argc--; + width = atoi(argv[0]); + } else + width = atoi(argv[0]+2); + break; + case 'o': + if (endmarker) break; + if (argv[0][2] == '\0') { + argv++; + argc--; + objsuffix = argv[0]; + } else + objsuffix = argv[0]+2; + break; + case 'p': + if (endmarker) break; + if (argv[0][2] == '\0') { + argv++; + argc--; + objprefix = argv[0]; + } else + objprefix = argv[0]+2; + break; + case 'v': + if (endmarker) break; + verbose = TRUE; +#ifdef DEBUG + if (argv[0][2]) + _debugmask = atoi(argv[0]+2); +#endif + break; + case 's': + if (endmarker) break; + startat = argv[0]+2; + if (*startat == '\0') { + startat = *(++argv); + argc--; + } + if (*startat != '#') + fatalerr("-s flag's value should start %s\n", + "with '#'."); + break; + case 'f': + if (endmarker) break; + makefile = argv[0]+2; + if (*makefile == '\0') { + makefile = *(++argv); + argc--; + } + break; + + case 'm': + warn_multiple = TRUE; + break; + + /* Ignore -O, -g so we can just pass ${CFLAGS} to + makedepend + */ + case 'O': + case 'g': + break; + case 'i': + if (strcmp(&argv[0][1],"include") == 0) { + char *buf; + if (argc<2) + fatalerr("option -include is a " + "missing its parameter\n"); + if (cmdinc_count >= MAXINCFILES) + fatalerr("Too many -include flags.\n"); + argc--; + argv++; + buf = malloc(strlen(DASH_INC_PRE) + + strlen(argv[0]) + + strlen(DASH_INC_POST) + 1); + if(!buf) + fatalerr("out of memory at " + "-include string\n"); + cmdinc_list[2 * cmdinc_count + 0] = argv[0]; + cmdinc_list[2 * cmdinc_count + 1] = buf; + cmdinc_count++; + break; + } + /* intentional fall through */ + default: + if (endmarker) break; + /* fatalerr("unknown opt = %s\n", argv[0]); */ + warning("ignoring option %s\n", argv[0]); + } + } + /* Now do the undefs from the command line */ + for (i = 0; i < numundefs; i++) + undefine(undeflist[i], &maininclist); + if (numundefs > 0) + free(undeflist); + + if (!defincdir) { +#ifdef PREINCDIR + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many -I flags.\n"); + *incp++ = PREINCDIR; +#endif +#if defined(__UNIXOS2__) || defined(_MSC_VER) + { +#if defined(_MSC_VER) + char *includepath = getenv("INCLUDE"); +#else + char *includepath = getenv("C_INCLUDE_PATH"); +#endif + /* can have more than one component */ + if (includepath) { + char *beg, *end; + beg= (char*)strdup(includepath); + for (;;) { + end = (char*)strchr(beg,';'); + if (end) *end = 0; + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many include dirs\n"); + *incp++ = beg; + if (!end) break; + beg = end+1; + } + } + } +#else /* !__UNIXOS2__ && !_MSC_VER, does not use INCLUDEDIR at all */ + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many -I flags.\n"); + *incp++ = INCLUDEDIR; +#endif + +#ifdef EXTRAINCDIR + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many -I flags.\n"); + *incp++ = EXTRAINCDIR; +#endif + +#ifdef POSTINCDIR + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many -I flags.\n"); + *incp++ = POSTINCDIR; +#endif + } else if (*defincdir) { + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many -I flags.\n"); + *incp++ = defincdir; + } + + redirect(startat, makefile); + + /* + * catch signals. + */ +#ifdef USGISH +/* should really reset SIGINT to SIG_IGN if it was. */ +#ifdef SIGHUP + signal (SIGHUP, catch); +#endif + signal (SIGINT, catch); +#ifdef SIGQUIT + signal (SIGQUIT, catch); +#endif + signal (SIGILL, catch); +#ifdef SIGBUS + signal (SIGBUS, catch); +#endif + signal (SIGSEGV, catch); +#ifdef SIGSYS + signal (SIGSYS, catch); +#endif +#else + sig_act.sa_handler = catch; +#if defined(_POSIX_SOURCE) || !defined(X_NOT_POSIX) + sigemptyset(&sig_act.sa_mask); + sigaddset(&sig_act.sa_mask, SIGINT); + sigaddset(&sig_act.sa_mask, SIGQUIT); +#ifdef SIGBUS + sigaddset(&sig_act.sa_mask, SIGBUS); +#endif + sigaddset(&sig_act.sa_mask, SIGILL); + sigaddset(&sig_act.sa_mask, SIGSEGV); + sigaddset(&sig_act.sa_mask, SIGHUP); + sigaddset(&sig_act.sa_mask, SIGPIPE); +#ifdef SIGSYS + sigaddset(&sig_act.sa_mask, SIGSYS); +#endif +#else + sig_act.sa_mask = ((1<<(SIGINT -1)) + |(1<<(SIGQUIT-1)) +#ifdef SIGBUS + |(1<<(SIGBUS-1)) +#endif + |(1<<(SIGILL-1)) + |(1<<(SIGSEGV-1)) + |(1<<(SIGHUP-1)) + |(1<<(SIGPIPE-1)) +#ifdef SIGSYS + |(1<<(SIGSYS-1)) +#endif + ); +#endif /* _POSIX_SOURCE */ + sig_act.sa_flags = 0; + sigaction(SIGHUP, &sig_act, (struct sigaction *)0); + sigaction(SIGINT, &sig_act, (struct sigaction *)0); + sigaction(SIGQUIT, &sig_act, (struct sigaction *)0); + sigaction(SIGILL, &sig_act, (struct sigaction *)0); +#ifdef SIGBUS + sigaction(SIGBUS, &sig_act, (struct sigaction *)0); +#endif + sigaction(SIGSEGV, &sig_act, (struct sigaction *)0); +#ifdef SIGSYS + sigaction(SIGSYS, &sig_act, (struct sigaction *)0); +#endif +#endif /* USGISH */ + + /* + * now peruse through the list of files. + */ + for(fp=filelist; *fp; fp++) { + DBG_PRINT(stderr,"file: %s\n",*fp); + filecontent = getfile(*fp); + setfile_cmdinc(filecontent, cmdinc_count, cmdinc_list); + ip = newinclude(*fp, (char *)NULL); + + find_includes(filecontent, ip, ip, 0, FALSE); + freefile(filecontent); + recursive_pr_include(ip, ip->i_file, base_name(*fp)); + inc_clean(); + } + if (printed) + printf("\n"); + return 0; +} + +#ifdef __UNIXOS2__ +/* + * eliminate \r chars from file + */ +static int +elim_cr(char *buf, int sz) +{ + int i,wp; + for (i= wp = 0; if_name = file; + if ((fd = open(file, O_RDONLY)) < 0) { + warning("cannot open \"%s\"\n", file); + content->f_p = content->f_base = content->f_end = (char *)malloc(1); + *content->f_p = '\0'; + return(content); + } + fstat(fd, &st); + content->f_base = (char *)malloc(st.st_size+1); + if (content->f_base == NULL) + fatalerr("cannot allocate mem\n"); + if ((st.st_size = read(fd, content->f_base, st.st_size)) < 0) + fatalerr("failed to read %s\n", file); +#ifdef __UNIXOS2__ + st.st_size = elim_cr(content->f_base,st.st_size); +#endif + close(fd); + content->f_len = st.st_size+1; + content->f_p = content->f_base; + content->f_end = content->f_base + st.st_size; + *content->f_end = '\0'; + content->f_line = 0; + content->cmdinc_count = 0; + content->cmdinc_list = NULL; + content->cmdinc_line = 0; + return(content); +} + +void +setfile_cmdinc(struct filepointer* filep, long count, char** list) +{ + filep->cmdinc_count = count; + filep->cmdinc_list = list; + filep->cmdinc_line = 0; +} + +void +freefile(struct filepointer *fp) +{ + free(fp->f_base); + free(fp); +} + +char *copy(char *str) +{ + char *p = (char *)malloc(strlen(str) + 1); + + strcpy(p, str); + return(p); +} + +int +match(char *str, char **list) +{ + int i; + + for (i=0; *list; i++, list++) + if (strcmp(str, *list) == 0) + return(i); + return(-1); +} + +/* + * Get the next line. We only return lines beginning with '#' since that + * is all this program is ever interested in. + */ +char *getnextline(struct filepointer *filep) +{ + char *p, /* walking pointer */ + *eof, /* end of file pointer */ + *bol; /* beginning of line pointer */ + int lineno; /* line number */ + boolean whitespace = FALSE; + + /* + * Fake the "-include" line files in form of #include to the + * start of each file. + */ + if (filep->cmdinc_line < filep->cmdinc_count) { + char *inc = filep->cmdinc_list[2 * filep->cmdinc_line + 0]; + char *buf = filep->cmdinc_list[2 * filep->cmdinc_line + 1]; + filep->cmdinc_line++; + sprintf(buf,"%s%s%s",DASH_INC_PRE,inc,DASH_INC_POST); + DBG_PRINT(stderr,"%s\n",buf); + return(buf); + } + + p = filep->f_p; + eof = filep->f_end; + if (p >= eof) + return((char *)NULL); + lineno = filep->f_line; + + for (bol = p--; ++p < eof; ) { + if ((bol == p) && ((*p == ' ') || (*p == '\t'))) + { + /* Consume leading white-spaces for this line */ + while (((p+1) < eof) && ((*p == ' ') || (*p == '\t'))) + { + p++; + bol++; + } + whitespace = TRUE; + } + + if (*p == '/' && (p+1) < eof && *(p+1) == '*') { + /* Consume C comments */ + *(p++) = ' '; + *(p++) = ' '; + while (p < eof && *p) { + if (*p == '*' && (p+1) < eof && *(p+1) == '/') { + *(p++) = ' '; + *(p++) = ' '; + break; + } + if (*p == '\n') + lineno++; + *(p++) = ' '; + } + --p; + } + else if (*p == '/' && (p+1) < eof && *(p+1) == '/') { + /* Consume C++ comments */ + *(p++) = ' '; + *(p++) = ' '; + while (p < eof && *p) { + if (*p == '\\' && (p+1) < eof && + *(p+1) == '\n') { + *(p++) = ' '; + lineno++; + } + else if (*p == '?' && (p+3) < eof && + *(p+1) == '?' && + *(p+2) == '/' && + *(p+3) == '\n') { + *(p++) = ' '; + *(p++) = ' '; + *(p++) = ' '; + lineno++; + } + else if (*p == '\n') + break; /* to process end of line */ + *(p++) = ' '; + } + --p; + } + else if (*p == '\\' && (p+1) < eof && *(p+1) == '\n') { + /* Consume backslash line terminations */ + *(p++) = ' '; + *p = ' '; + lineno++; + } + else if (*p == '?' && (p+3) < eof && + *(p+1) == '?' && *(p+2) == '/' && *(p+3) == '\n') { + /* Consume trigraph'ed backslash line terminations */ + *(p++) = ' '; + *(p++) = ' '; + *(p++) = ' '; + *p = ' '; + lineno++; + } + else if (*p == '\n') { + lineno++; + if (*bol == '#') { + char *cp; + + *(p++) = '\0'; + /* punt lines with just # (yacc generated) */ + for (cp = bol+1; + *cp && (*cp == ' ' || *cp == '\t'); cp++); + if (*cp) goto done; + --p; + } + bol = p+1; + whitespace = FALSE; + } + } + if (*bol != '#') + bol = NULL; +done: +#if !defined(__UNIXOS2__) && !defined(_MSC_VER) && !defined(_WIN32) + /* Don't print warnings for system header files */ + if (bol && whitespace && !strstr(filep->f_name, INCLUDEDIR)) { + warning("%s: non-portable whitespace encountered at line %d\n", + filep->f_name, lineno); + } +#endif + filep->f_p = p; + filep->f_line = lineno; +#ifdef DEBUG_DUMP + if (bol) + DBG_PRINT(stderr,"%s\n",bol); +#endif + return(bol); +} + +/* + * Strip the file name down to what we want to see in the Makefile. + * It will have objprefix and objsuffix around it. + */ +char *base_name(char *file) +{ + char *p; + + file = copy(file); + for(p=file+strlen(file); p>file && *p != '.'; p--) ; + + if (*p == '.') + *p = '\0'; + return(file); +} + +#if defined(USG) && !defined(CRAY) && !defined(SVR4) && !defined(__UNIXOS2__) && !defined(clipper) && !defined(__clipper__) +int rename (char *from, char *to) +{ + (void) unlink (to); + if (link (from, to) == 0) { + unlink (from); + return 0; + } else { + return -1; + } +} +#endif /* USGISH */ + +void +redirect(char *line, char *makefile) +{ + struct stat st; + FILE *fdin, *fdout; + char backup[ BUFSIZ ], + buf[ BUFSIZ ]; + boolean found = FALSE; + int len; + + /* + * if makefile is "-" then let it pour onto stdout. + */ + if (makefile && *makefile == '-' && *(makefile+1) == '\0') { + puts(line); + return; + } + + /* + * use a default makefile is not specified. + */ + if (!makefile) { + if (stat("Makefile", &st) == 0) + makefile = "Makefile"; + else if (stat("makefile", &st) == 0) + makefile = "makefile"; + else + fatalerr("[mM]akefile is not present\n"); + } + else + stat(makefile, &st); + if ((fdin = fopen(makefile, "r")) == NULL) + fatalerr("cannot open \"%s\"\n", makefile); + sprintf(backup, "%s.bak", makefile); + unlink(backup); +#if defined(WIN32) || defined(__UNIXOS2__) || defined(__CYGWIN__) + fclose(fdin); +#endif + if (rename(makefile, backup) < 0) + fatalerr("cannot rename %s to %s\n", makefile, backup); +#if defined(WIN32) || defined(__UNIXOS2__) || defined(__CYGWIN__) + if ((fdin = fopen(backup, "r")) == NULL) + fatalerr("cannot open \"%s\"\n", backup); +#endif + if ((fdout = freopen(makefile, "w", stdout)) == NULL) + fatalerr("cannot open \"%s\"\n", backup); + len = strlen(line); + while (!found && fgets(buf, BUFSIZ, fdin)) { + if (*buf == '#' && strncmp(line, buf, len) == 0) + found = TRUE; + fputs(buf, fdout); + } + if (!found) { + if (verbose) + warning("Adding new delimiting line \"%s\" and dependencies...\n", + line); + puts(line); /* same as fputs(fdout); but with newline */ + } else if (append) { + while (fgets(buf, BUFSIZ, fdin)) { + fputs(buf, fdout); + } + } + fflush(fdout); +#if defined(USGISH) || defined(_SEQUENT_) || defined(USE_CHMOD) + chmod(makefile, st.st_mode); +#else + fchmod(fileno(fdout), st.st_mode); +#endif /* USGISH */ +} + +void +fatalerr(char *msg, ...) +{ + va_list args; + fprintf(stderr, "%s: error: ", ProgramName); + va_start(args, msg); + vfprintf(stderr, msg, args); + va_end(args); + exit (1); +} + +void +warning(char *msg, ...) +{ + va_list args; + fprintf(stderr, "%s: warning: ", ProgramName); + va_start(args, msg); + vfprintf(stderr, msg, args); + va_end(args); +} + +void +warning1(char *msg, ...) +{ + va_list args; + va_start(args, msg); + vfprintf(stderr, msg, args); + va_end(args); +} diff -Naur security/coreconf/mkdepend/Makefile mozilla/security/coreconf/mkdepend/Makefile --- a/security/coreconf/mkdepend/Makefile 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/mkdepend/Makefile 2009-02-14 03:06:13.000000000 +0200 @@ -0,0 +1,93 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +DEPTH = ../.. +CORE_DEPTH = ../.. + +MODULE = coreconf + +CSRCS = \ + cppsetup.c \ + ifparser.c \ + include.c \ + main.c \ + parse.c \ + pr.c + +PROGRAM = mkdepend + +# Indicate that this directory builds build tools. +INTERNAL_TOOLS = 1 + + +include $(DEPTH)/coreconf/config.mk + +TARGETS = $(PROGRAM) +ifeq (,$(filter-out OS2 WIN%,$(OS_TARGET))) +DEFINES += -DNO_X11 +else +INSTALL = true +endif + +ifdef NATIVE_CC +CC=$(NATIVE_CC) +endif + +ifdef NATIVE_FLAGS +OS_CFLAGS=$(NATIVE_FLAGS) +endif + +include $(DEPTH)/coreconf/rules.mk + +ifdef GNU_CC +OPTIMIZER = -O3 +else +ifeq ($(OS_ARCH),SunOS) +OPTIMIZER = -fast +endif +ifeq ($(OS_ARCH),WINNT) +OPTIMIZER = -Ox +endif +endif + +DEFINES += -DINCLUDEDIR=\"/usr/include\" -DOBJSUFFIX=\".$(OBJ_SUFFIX)\" + +# Redefine MAKE_OBJDIR for just this directory +define MAKE_OBJDIR +if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); fi +endef + diff -Naur security/coreconf/mkdepend/mkdepend.man mozilla/security/coreconf/mkdepend/mkdepend.man --- a/security/coreconf/mkdepend/mkdepend.man 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/mkdepend/mkdepend.man 2009-02-14 02:37:01.000000000 +0200 @@ -0,0 +1,382 @@ +.\" $Xorg: mkdepend.man,v 1.5 2001/02/09 02:03:16 xorgcvs Exp $ +.\" Copyright (c) 1993, 1994, 1998 The Open Group +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and its +.\" documentation for any purpose is hereby granted without fee, provided that +.\" the above copyright notice appear in all copies and that both that +.\" copyright notice and this permission notice appear in supporting +.\" documentation. +.\" +.\" The above copyright notice and this permission notice shall be included in +.\" all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +.\" THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +.\" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +.\" OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +.\" SOFTWARE. +.\" +.\" Except as contained in this notice, the name of The Open Group shall not +.\" be used in advertising or otherwise to promote the sale, use or other +.\" dealing in this Software without prior written authorization from The +.\" Open Group. +.\" +.\" $XFree86: xc/config/makedepend/mkdepend.man,v 1.7 2002/12/14 02:39:45 dawes Exp $ +.\" +.TH MAKEDEPEND 1 __xorgversion__ +.UC 4 +.SH NAME +makedepend \- create dependencies in makefiles +.SH SYNOPSIS +.B makedepend +[ +.BI \-D name\fB=\fPdef +] [ +.BI \-D name +] [ +.BI \-I includedir +] [ +.BI \-Y includedir +] [ +.B \-a +] [ +.BI \-f makefile +] [ +.BI \-include \ file +] [ +.BI \-o objsuffix +] [ +.BI \-p objprefix +] [ +.BI \-s string +] [ +.BI \-w width +] [ +.B \-v +] [ +.B \-m +] [ +\-\^\- +.I otheroptions +\-\^\- +] +.I sourcefile +\&.\|.\|. +.br +.SH DESCRIPTION +The +.B makedepend +program reads each +.I sourcefile +in sequence and parses it like a C-preprocessor, +processing all +.I #include, +.I #define, +.I #undef, +.I #ifdef, +.I #ifndef, +.I #endif, +.I #if, +.I #elif +and +.I #else +directives so that it can correctly tell which +.I #include, +directives would be used in a compilation. +Any +.I #include, +directives can reference files having other +.I #include +directives, and parsing will occur in these files as well. +.PP +Every file that a +.I sourcefile +includes, +directly or indirectly, +is what +.B makedepend +calls a \fIdependency.\fP +These dependencies are then written to a +.I makefile +in such a way that +.B make(1) +will know which object files must be recompiled when a dependency has changed. +.PP +By default, +.B makedepend +places its output in the file named +.I makefile +if it exists, otherwise +.I Makefile. +An alternate makefile may be specified with the +.B \-f +option. +It first searches the makefile for +the line +.sp +\& # DO NOT DELETE THIS LINE \-\^\- make depend depends on it. +.sp +or one provided with the +.B \-s +option, +as a delimiter for the dependency output. +If it finds it, it will delete everything +following this to the end of the makefile +and put the output after this line. +If it doesn't find it, the program +will append the string to the end of the makefile +and place the output following that. +For each +.I sourcefile +appearing on the command line, +.B makedepend +puts lines in the makefile of the form +.sp + sourcefile.o:\0dfile .\|.\|. +.sp +Where \fIsourcefile.o\fP is the name from the command +line with its suffix replaced with ``.o'', +and \fIdfile\fP is a dependency discovered in a +.I #include +directive while parsing +.I sourcefile +or one of the files it included. +.SH EXAMPLE +Normally, +.B makedepend +will be used in a makefile target so that typing ``make depend'' will +bring the dependencies up to date for the makefile. +For example, +.nf + SRCS\0=\0file1.c\0file2.c\0.\|.\|. + CFLAGS\0=\0\-O\0\-DHACK\0\-I\^.\^.\^/foobar\0\-xyz + depend: + makedepend\0\-\^\-\0$(CFLAGS)\0\-\^\-\0$(SRCS) +.fi +.SH OPTIONS +The program +will ignore any option that it does not understand so that you may use +the same arguments that you would for +.B cc(1). +.TP 5 +.B \-D\fIname\fP=\fIdef\fP \fRor\fP \-D\fIname\fP +Define. +This places a definition for +.I name +in +.B makedepend's +symbol table. +Without +.I =def\| +the symbol becomes defined as ``1''. +.TP 5 +.B \-I\fIincludedir\fP +Include directory. +This option tells +.B makedepend +to prepend +.I includedir +to its list of directories to search when it encounters +a +.I #include +directive. +By default, +.B makedepend +only searches the standard include directories (usually /usr/include +and possibly a compiler-dependent directory). +.TP 5 +.B \-Y\fIincludedir\fP +Replace all of the standard include directories with the single specified +include directory; you can omit the +.I includedir +to simply prevent searching the standard include directories. +.TP 5 +.B \-a +Append the dependencies to the end of the file instead of replacing them. +.TP 5 +.B \-f\fImakefile\fP +Filename. +This allows you to specify an alternate makefile in which +.B makedepend +can place its output. +Specifying ``\-'' as the file name (i.e., \fB\-f\-\fP) sends the +output to standard output instead of modifying an existing file. +.TP 5 +.B \-include \fIfile\fP +Process file as input, and include all the resulting output +before processing the regular input file. This has the same +affect as if the specified file is an include statement that +appears before the very first line of the regular input file. +.TP 5 +.B \-o\fIobjsuffix\fP +Object file suffix. +Some systems may have object files whose suffix is something other +than ``.o''. +This option allows you to specify another suffix, such as +``.b'' with +.I \-o.b +or ``:obj'' +with +.I \-o:obj +and so forth. +.TP 5 +.B \-p\fIobjprefix\fP +Object file prefix. +The prefix is prepended to the name of the object file. This is +usually used to designate a different directory for the object file. +The default is the empty string. +.TP 5 +.B \-s\fIstring\fP +Starting string delimiter. +This option permits you to specify +a different string for +.B makedepend +to look for in the makefile. +.TP 5 +.B \-w\fIwidth\fP +Line width. +Normally, +.B makedepend +will ensure that every output line that it writes will be no wider than +78 characters for the sake of readability. +This option enables you to change this width. +.TP 5 +.B \-v +Verbose operation. +This option causes +.B makedepend +to emit the list of files included by each input file. +.TP 5 +.B \-m +Warn about multiple inclusion. +This option causes +.B makedepend +to produce a warning if any input file includes another file more than +once. In previous versions of +.B makedepend +this was the default behavior; the default has been changed to better +match the behavior of the C compiler, which does not consider multiple +inclusion to be an error. This option is provided for backward +compatibility, and to aid in debugging problems related to multiple +inclusion. +.TP 5 +.B "\-\^\- \fIoptions\fP \-\^\-" +If +.B makedepend +encounters a double hyphen (\-\^\-) in the argument list, +then any unrecognized argument following it +will be silently ignored; a second double hyphen terminates this +special treatment. +In this way, +.B makedepend +can be made to safely ignore esoteric compiler arguments that might +normally be found in a CFLAGS +.B make +macro (see the +.B EXAMPLE +section above). +All options that +.B makedepend +recognizes and appear between the pair of double hyphens +are processed normally. +.SH ALGORITHM +The approach used in this program enables it to run an order of magnitude +faster than any other ``dependency generator'' I have ever seen. +Central to this performance are two assumptions: +that all files compiled by a single +makefile will be compiled with roughly the same +.I \-I +and +.I \-D +options; +and that most files in a single directory will include largely the +same files. +.PP +Given these assumptions, +.B makedepend +expects to be called once for each makefile, with +all source files that are maintained by the +makefile appearing on the command line. +It parses each source and include +file exactly once, maintaining an internal symbol table +for each. +Thus, the first file on the command line will take an amount of time +proportional to the amount of time that a normal C preprocessor takes. +But on subsequent files, if it encounters an include file +that it has already parsed, it does not parse it again. +.PP +For example, +imagine you are compiling two files, +.I file1.c +and +.I file2.c, +they each include the header file +.I header.h, +and the file +.I header.h +in turn includes the files +.I def1.h +and +.I def2.h. +When you run the command +.sp + makedepend\0file1.c\0file2.c +.sp +.B makedepend +will parse +.I file1.c +and consequently, +.I header.h +and then +.I def1.h +and +.I def2.h. +It then decides that the dependencies for this file are +.sp + file1.o:\0header.h\0def1.h\0def2.h +.sp +But when the program parses +.I file2.c +and discovers that it, too, includes +.I header.h, +it does not parse the file, +but simply adds +.I header.h, +.I def1.h +and +.I def2.h +to the list of dependencies for +.I file2.o. +.SH "SEE ALSO" +cc(1), make(1) +.SH BUGS +.B makedepend +parses, but does not currently evaluate, the SVR4 #predicate(token-list) +preprocessor expression; such expressions are simply assumed to be true. +This may cause the wrong +.I #include +directives to be evaluated. +.PP +Imagine you are parsing two files, +say +.I file1.c +and +.I file2.c, +each includes the file +.I def.h. +The list of files that +.I def.h +includes might truly be different when +.I def.h +is included by +.I file1.c +than when it is included by +.I file2.c. +But once +.B makedepend +arrives at a list of dependencies for a file, +it is cast in concrete. +.SH AUTHOR +Todd Brunhoff, Tektronix, Inc. and MIT Project Athena diff -Naur security/coreconf/mkdepend/parse.c mozilla/security/coreconf/mkdepend/parse.c --- a/security/coreconf/mkdepend/parse.c 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/mkdepend/parse.c 2009-02-14 02:37:01.000000000 +0200 @@ -0,0 +1,686 @@ +/* $Xorg: parse.c,v 1.6 2001/02/09 02:03:16 xorgcvs Exp $ */ +/* + +Copyright (c) 1993, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/config/makedepend/parse.c,v 1.12 2002/02/26 05:09:10 tsi Exp $ */ + +#include "def.h" + +extern char *directives[]; +extern struct inclist inclist[ MAXFILES ], + *inclistnext, + maininclist; +extern char *includedirs[ ], + **includedirsnext; + +static int deftype (char *line, struct filepointer *filep, + struct inclist *file_red, struct inclist *file, + int parse_it); +static int zero_value(char *filename, char *exp, struct filepointer *filep, + struct inclist *file_red); +static int merge2defines(struct inclist *file1, struct inclist *file2); + +static int +gobble(struct filepointer *filep, struct inclist *file, + struct inclist *file_red) +{ + char *line; + int type; + + while ((line = getnextline(filep))) { + switch(type = deftype(line, filep, file_red, file, FALSE)) { + case IF: + case IFFALSE: + case IFGUESSFALSE: + case IFDEF: + case IFNDEF: + type = gobble(filep, file, file_red); + while ((type == ELIF) || (type == ELIFFALSE) || + (type == ELIFGUESSFALSE)) + type = gobble(filep, file, file_red); + if (type == ELSE) + (void)gobble(filep, file, file_red); + break; + case ELSE: + case ENDIF: + debug(0,("%s, line %d: #%s\n", + file->i_file, filep->f_line, + directives[type])); + return(type); + case DEFINE: + case UNDEF: + case INCLUDE: + case INCLUDEDOT: + case PRAGMA: + case ERROR: + case IDENT: + case SCCS: + case EJECT: + case WARNING: + case INCLUDENEXT: + case INCLUDENEXTDOT: + break; + case ELIF: + case ELIFFALSE: + case ELIFGUESSFALSE: + return(type); + case -1: + warning("%s", file_red->i_file); + if (file_red != file) + warning1(" (reading %s)", file->i_file); + warning1(", line %d: unknown directive == \"%s\"\n", + filep->f_line, line); + break; + } + } + return(-1); +} + +/* + * Decide what type of # directive this line is. + */ +static int +deftype (char *line, struct filepointer *filep, + struct inclist *file_red, struct inclist *file, int parse_it) +{ + register char *p; + char *directive, savechar, *q; + register int ret; + + /* + * Parse the directive... + */ + directive=line+1; + while (*directive == ' ' || *directive == '\t') + directive++; + + p = directive; + while ((*p == '_') || (*p >= 'a' && *p <= 'z')) + p++; + savechar = *p; + *p = '\0'; + ret = match(directive, directives); + *p = savechar; + + /* If we don't recognize this compiler directive or we happen to just + * be gobbling up text while waiting for an #endif or #elif or #else + * in the case of an #elif we must check the zero_value and return an + * ELIF or an ELIFFALSE. + */ + + if (ret == ELIF && !parse_it) + { + while (*p == ' ' || *p == '\t') + p++; + /* + * parse an expression. + */ + debug(0,("%s, line %d: #elif %s ", + file->i_file, filep->f_line, p)); + ret = zero_value(file->i_file, p, filep, file_red); + if (ret != IF) + { + debug(0,("false...\n")); + if (ret == IFFALSE) + return(ELIFFALSE); + else + return(ELIFGUESSFALSE); + } + else + { + debug(0,("true...\n")); + return(ELIF); + } + } + + if (ret < 0 || ! parse_it) + return(ret); + + /* + * now decide how to parse the directive, and do it. + */ + while (*p == ' ' || *p == '\t') + p++; + q = p + strlen(p); + do { + q--; + } while (*q == ' ' || *q == '\t'); + q[1] = '\0'; + switch (ret) { + case IF: + /* + * parse an expression. + */ + ret = zero_value(file->i_file, p, filep, file_red); + debug(0,("%s, line %d: %s #if %s\n", + file->i_file, filep->f_line, ret?"false":"true", p)); + break; + case IFDEF: + case IFNDEF: + debug(0,("%s, line %d: #%s %s\n", + file->i_file, filep->f_line, directives[ret], p)); + case UNDEF: + /* + * separate the name of a single symbol. + */ + while (isalnum(*p) || *p == '_') + *line++ = *p++; + *line = '\0'; + break; + case INCLUDE: + case INCLUDENEXT: + debug(2,("%s, line %d: #include%s %s\n", + file->i_file, filep->f_line, + (ret == INCLUDE) ? "" : "_next", p)); + + /* Support ANSI macro substitution */ + while (1) { + struct symtab **sym; + + if (!*p || *p == '"' || *p == '<') + break; + + sym = isdefined(p, file_red, NULL); + if (!sym) + break; + + p = (*sym)->s_value; + debug(3,("%s : #includes SYMBOL %s = %s\n", + file->i_incstring, + (*sym) -> s_name, + (*sym) -> s_value)); + /* mark file as having included a 'soft include' */ + file->i_flags |= INCLUDED_SYM; + } + + /* + * Separate the name of the include file. + */ + while (*p && *p != '"' && *p != '<') + p++; + if (! *p) + return(-2); + if (*p++ == '"') { + if (ret == INCLUDE) + ret = INCLUDEDOT; + else + ret = INCLUDENEXTDOT; + while (*p && *p != '"') + *line++ = *p++; + } else + while (*p && *p != '>') + *line++ = *p++; + *line = '\0'; + break; + case DEFINE: + /* + * copy the definition back to the beginning of the line. + */ + strcpy (line, p); + break; + case ELSE: + case ENDIF: + case ELIF: + case PRAGMA: + case ERROR: + case IDENT: + case SCCS: + case EJECT: + case WARNING: + debug(0,("%s, line %d: #%s\n", + file->i_file, filep->f_line, directives[ret])); + /* + * nothing to do. + */ + break; + } + return(ret); +} + +struct symtab ** +fdefined(char *symbol, struct inclist *file, struct inclist **srcfile) +{ + struct inclist **ip; + struct symtab **val; + int i; + static int recurse_lvl = 0; + + if (file->i_flags & DEFCHECKED) + return(NULL); + debug(2,("Looking for %s in %s\n", symbol, file->i_file)); + file->i_flags |= DEFCHECKED; + if ((val = slookup(symbol, file))) + debug(1,("%s defined in %s as %s\n", + symbol, file->i_file, (*val)->s_value)); + if (val == NULL && file->i_list) + { + for (ip = file->i_list, i=0; i < file->i_listlen; i++, ip++) + if (file->i_merged[i]==FALSE) { + val = fdefined(symbol, *ip, srcfile); + file->i_merged[i]=merge2defines(file,*ip); + if (val!=NULL) break; + } + } + else if (val != NULL && srcfile != NULL) *srcfile = file; + recurse_lvl--; + file->i_flags &= ~DEFCHECKED; + + return(val); +} + +struct symtab ** +isdefined(char *symbol, struct inclist *file, struct inclist **srcfile) +{ + struct symtab **val; + + if ((val = slookup(symbol, &maininclist))) { + debug(1,("%s defined on command line\n", symbol)); + if (srcfile != NULL) *srcfile = &maininclist; + return(val); + } + if ((val = fdefined(symbol, file, srcfile))) + return(val); + debug(1,("%s not defined in %s\n", symbol, file->i_file)); + return(NULL); +} + +/* + * Return type based on if the #if expression evaluates to 0 + */ +static int +zero_value(char *filename, + char *exp, + struct filepointer *filep, + struct inclist *file_red) +{ + if (cppsetup(filename, exp, filep, file_red)) + return(IFFALSE); + else + return(IF); +} + +void +define2(char *name, char *val, struct inclist *file) +{ + int first, last, below; + register struct symtab **sp = NULL, **dest; + struct symtab *stab; + + /* Make space if it's needed */ + if (file->i_defs == NULL) + { + file->i_defs = (struct symtab **) + malloc(sizeof (struct symtab*) * SYMTABINC); + file->i_ndefs = 0; + } + else if (!(file->i_ndefs % SYMTABINC)) + file->i_defs = (struct symtab **) + realloc(file->i_defs, + sizeof(struct symtab*)*(file->i_ndefs+SYMTABINC)); + + if (file->i_defs == NULL) + fatalerr("malloc()/realloc() failure in insert_defn()\n"); + + below = first = 0; + last = file->i_ndefs - 1; + while (last >= first) + { + /* Fast inline binary search */ + register char *s1; + register char *s2; + register int middle = (first + last) / 2; + + /* Fast inline strchr() */ + s1 = name; + s2 = file->i_defs[middle]->s_name; + while (*s1++ == *s2++) + if (s2[-1] == '\0') break; + + /* If exact match, set sp and break */ + if (*--s1 == *--s2) + { + sp = file->i_defs + middle; + break; + } + + /* If name > i_defs[middle] ... */ + if (*s1 > *s2) + { + below = first; + first = middle + 1; + } + /* else ... */ + else + { + below = last = middle - 1; + } + } + + /* Search is done. If we found an exact match to the symbol name, + just replace its s_value */ + if (sp != NULL) + { + debug(1,("redefining %s from %s to %s in file %s\n", + name, (*sp)->s_value, val, file->i_file)); + free((*sp)->s_value); + (*sp)->s_value = copy(val); + return; + } + + sp = file->i_defs + file->i_ndefs++; + dest = file->i_defs + below + 1; + while (sp > dest) + { + *sp = sp[-1]; + sp--; + } + stab = (struct symtab *) malloc(sizeof (struct symtab)); + if (stab == NULL) + fatalerr("malloc()/realloc() failure in insert_defn()\n"); + + debug(1,("defining %s to %s in file %s\n", name, val, file->i_file)); + stab->s_name = copy(name); + stab->s_value = copy(val); + *sp = stab; +} + +void +define(char *def, struct inclist *file) +{ + char *val; + + /* Separate symbol name and its value */ + val = def; + while (isalnum(*val) || *val == '_') + val++; + if (*val) + *val++ = '\0'; + while (*val == ' ' || *val == '\t') + val++; + + if (!*val) + val = "1"; + define2(def, val, file); +} + +struct symtab ** +slookup(char *symbol, struct inclist *file) +{ + register int first = 0; + register int last = file->i_ndefs - 1; + + if (file) while (last >= first) + { + /* Fast inline binary search */ + register char *s1; + register char *s2; + register int middle = (first + last) / 2; + + /* Fast inline strchr() */ + s1 = symbol; + s2 = file->i_defs[middle]->s_name; + while (*s1++ == *s2++) + if (s2[-1] == '\0') break; + + /* If exact match, we're done */ + if (*--s1 == *--s2) + { + return file->i_defs + middle; + } + + /* If symbol > i_defs[middle] ... */ + if (*s1 > *s2) + { + first = middle + 1; + } + /* else ... */ + else + { + last = middle - 1; + } + } + return(NULL); +} + +static int +merge2defines(struct inclist *file1, struct inclist *file2) +{ + int i; + + if ((file1==NULL) || (file2==NULL) || + !(file2->i_flags & FINISHED)) + return 0; + + for (i=0; i < file2->i_listlen; i++) + if (file2->i_merged[i]==FALSE) + return 0; + + { + int first1 = 0; + int last1 = file1->i_ndefs - 1; + + int first2 = 0; + int last2 = file2->i_ndefs - 1; + + int first=0; + struct symtab** i_defs = NULL; + int deflen=file1->i_ndefs+file2->i_ndefs; + + debug(2,("merging %s into %s\n", + file2->i_file, file1->i_file)); + + if (deflen>0) + { + /* make sure deflen % SYMTABINC == 0 is still true */ + deflen += (SYMTABINC - deflen % SYMTABINC) % SYMTABINC; + i_defs=(struct symtab**) + malloc(deflen*sizeof(struct symtab*)); + if (i_defs==NULL) return 0; + } + + while ((last1 >= first1) && (last2 >= first2)) + { + char *s1=file1->i_defs[first1]->s_name; + char *s2=file2->i_defs[first2]->s_name; + + if (strcmp(s1,s2) < 0) + i_defs[first++]=file1->i_defs[first1++]; + else if (strcmp(s1,s2) > 0) + i_defs[first++]=file2->i_defs[first2++]; + else /* equal */ + { + i_defs[first++]=file2->i_defs[first2++]; + first1++; + } + } + while (last1 >= first1) + { + i_defs[first++]=file1->i_defs[first1++]; + } + while (last2 >= first2) + { + i_defs[first++]=file2->i_defs[first2++]; + } + + if (file1->i_defs) free(file1->i_defs); + file1->i_defs=i_defs; + file1->i_ndefs=first; + + return 1; + } +} + +void +undefine(char *symbol, struct inclist *file) +{ + register struct symtab **ptr; + struct inclist *srcfile; + while ((ptr = isdefined(symbol, file, &srcfile)) != NULL) + { + srcfile->i_ndefs--; + for (; ptr < srcfile->i_defs + srcfile->i_ndefs; ptr++) + *ptr = ptr[1]; + } +} + +int +find_includes(struct filepointer *filep, struct inclist *file, + struct inclist *file_red, int recursion, boolean failOK) +{ + struct inclist *inclistp; + char **includedirsp; + register char *line; + register int type; + boolean recfailOK; + + while ((line = getnextline(filep))) { + switch(type = deftype(line, filep, file_red, file, TRUE)) { + case IF: + doif: + type = find_includes(filep, file, + file_red, recursion+1, failOK); + while ((type == ELIF) || (type == ELIFFALSE) || + (type == ELIFGUESSFALSE)) + type = gobble(filep, file, file_red); + if (type == ELSE) + gobble(filep, file, file_red); + break; + case IFFALSE: + case IFGUESSFALSE: + doiffalse: + if (type == IFGUESSFALSE || type == ELIFGUESSFALSE) + recfailOK = TRUE; + else + recfailOK = failOK; + type = gobble(filep, file, file_red); + if (type == ELSE) + find_includes(filep, file, + file_red, recursion+1, recfailOK); + else + if (type == ELIF) + goto doif; + else + if ((type == ELIFFALSE) || (type == ELIFGUESSFALSE)) + goto doiffalse; + break; + case IFDEF: + case IFNDEF: + if ((type == IFDEF && isdefined(line, file_red, NULL)) + || (type == IFNDEF && !isdefined(line, file_red, NULL))) { + debug(1,(type == IFNDEF ? + "line %d: %s !def'd in %s via %s%s\n" : "", + filep->f_line, line, + file->i_file, file_red->i_file, ": doit")); + type = find_includes(filep, file, + file_red, recursion+1, failOK); + while (type == ELIF || type == ELIFFALSE || type == ELIFGUESSFALSE) + type = gobble(filep, file, file_red); + if (type == ELSE) + gobble(filep, file, file_red); + } + else { + debug(1,(type == IFDEF ? + "line %d: %s !def'd in %s via %s%s\n" : "", + filep->f_line, line, + file->i_file, file_red->i_file, ": gobble")); + type = gobble(filep, file, file_red); + if (type == ELSE) + find_includes(filep, file, + file_red, recursion+1, failOK); + else if (type == ELIF) + goto doif; + else if (type == ELIFFALSE || type == ELIFGUESSFALSE) + goto doiffalse; + } + break; + case ELSE: + case ELIFFALSE: + case ELIFGUESSFALSE: + case ELIF: + if (!recursion) + gobble(filep, file, file_red); + case ENDIF: + if (recursion) + return(type); + case DEFINE: + define(line, file); + break; + case UNDEF: + if (!*line) { + warning("%s", file_red->i_file); + if (file_red != file) + warning1(" (reading %s)", file->i_file); + warning1(", line %d: incomplete undef == \"%s\"\n", + filep->f_line, line); + break; + } + undefine(line, file_red); + break; + case INCLUDE: + case INCLUDEDOT: + case INCLUDENEXT: + case INCLUDENEXTDOT: + inclistp = inclistnext; + includedirsp = includedirsnext; + debug(2,("%s, reading %s, includes %s\n", + file_red->i_file, file->i_file, line)); + add_include(filep, file, file_red, line, type, failOK); + inclistnext = inclistp; + includedirsnext = includedirsp; + break; + case ERROR: + case WARNING: + warning("%s", file_red->i_file); + if (file_red != file) + warning1(" (reading %s)", file->i_file); + warning1(", line %d: %s\n", + filep->f_line, line); + break; + + case PRAGMA: + case IDENT: + case SCCS: + case EJECT: + break; + case -1: + warning("%s", file_red->i_file); + if (file_red != file) + warning1(" (reading %s)", file->i_file); + warning1(", line %d: unknown directive == \"%s\"\n", + filep->f_line, line); + break; + case -2: + warning("%s", file_red->i_file); + if (file_red != file) + warning1(" (reading %s)", file->i_file); + warning1(", line %d: incomplete include == \"%s\"\n", + filep->f_line, line); + break; + } + } + file->i_flags |= FINISHED; + debug(2,("finished with %s\n", file->i_file)); + return(-1); +} diff -Naur security/coreconf/mkdepend/pr.c mozilla/security/coreconf/mkdepend/pr.c --- a/security/coreconf/mkdepend/pr.c 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/mkdepend/pr.c 2009-02-14 02:37:01.000000000 +0200 @@ -0,0 +1,124 @@ +/* $Xorg: pr.c,v 1.4 2001/02/09 02:03:16 xorgcvs Exp $ */ +/* + +Copyright (c) 1993, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/config/makedepend/pr.c,v 1.5 2001/12/14 19:53:21 dawes Exp $ */ + +#include "def.h" + +extern struct inclist inclist[ MAXFILES ], + *inclistp; +extern char *objprefix; +extern char *objsuffix; +extern int width; +extern boolean printed; +extern boolean verbose; +extern boolean show_where_not; + +void +add_include(struct filepointer *filep, struct inclist *file, + struct inclist *file_red, char *include, int type, + boolean failOK) +{ + register struct inclist *newfile; + register struct filepointer *content; + + /* + * First decide what the pathname of this include file really is. + */ + newfile = inc_path(file->i_file, include, type); + if (newfile == NULL) { + if (failOK) + return; + if (file != file_red) + warning("%s (reading %s, line %d): ", + file_red->i_file, file->i_file, filep->f_line); + else + warning("%s, line %d: ", file->i_file, filep->f_line); + warning1("cannot find include file \"%s\"\n", include); + show_where_not = TRUE; + newfile = inc_path(file->i_file, include, type); + show_where_not = FALSE; + } + + if (newfile) { + included_by(file, newfile); + if (!(newfile->i_flags & SEARCHED)) { + newfile->i_flags |= SEARCHED; + content = getfile(newfile->i_file); + find_includes(content, newfile, file_red, 0, failOK); + freefile(content); + } + } +} + +static void +pr(struct inclist *ip, char *file, char *base) +{ + static char *lastfile; + static int current_len; + register int len, i; + char buf[ BUFSIZ ]; + + printed = TRUE; + len = strlen(ip->i_file)+1; + if (current_len + len > width || file != lastfile) { + lastfile = file; + sprintf(buf, "\n%s%s%s: %s", objprefix, base, objsuffix, + ip->i_file); + len = current_len = strlen(buf); + } + else { + buf[0] = ' '; + strcpy(buf+1, ip->i_file); + current_len += len; + } + fwrite(buf, len, 1, stdout); + + /* + * If verbose is set, then print out what this file includes. + */ + if (! verbose || ip->i_list == NULL || ip->i_flags & NOTIFIED) + return; + ip->i_flags |= NOTIFIED; + lastfile = NULL; + printf("\n# %s includes:", ip->i_file); + for (i=0; ii_listlen; i++) + printf("\n#\t%s", ip->i_list[ i ]->i_incstring); +} + +void +recursive_pr_include(struct inclist *head, char *file, char *base) +{ + int i; + + if (head->i_flags & MARKED) + return; + head->i_flags |= MARKED; + if (head->i_file != file) + pr(head, file, base); + for (i=0; ii_listlen; i++) + recursive_pr_include(head->i_list[ i ], file, base); +} diff -Naur security/coreconf/module.mk mozilla/security/coreconf/module.mk --- a/security/coreconf/module.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/module.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,69 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +####################################################################### +# The master "Core Components" source and release component directory # +# names are ALWAYS identical and are the value of $(MODULE). # +# NOTE: A component is also called a module or a subsystem. # +####################################################################### + +# +# All "Core Components" -specific source-side tags must +# always be identified for compiling/linking purposes +# + +ifndef JAVA_SOURCE_COMPONENT + JAVA_SOURCE_COMPONENT = java +endif + +ifndef NETLIB_SOURCE_COMPONENT + NETLIB_SOURCE_COMPONENT = netlib +endif + +ifndef NSPR_SOURCE_COMPONENT + NSPR_SOURCE_COMPONENT = nspr20 +endif + +ifndef SECTOOLS_SOURCE_COMPONENT + SECTOOLS_SOURCE_COMPONENT = sectools +endif + +ifndef SECURITY_SOURCE_COMPONENT + SECURITY_SOURCE_COMPONENT = security +endif + +MK_MODULE = included diff -Naur security/coreconf/NCR3.0.mk mozilla/security/coreconf/NCR3.0.mk --- a/security/coreconf/NCR3.0.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/NCR3.0.mk 2007-11-22 06:39:56.000000000 +0200 @@ -0,0 +1,97 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DEFAULT_COMPILER = cc + +### +NS_USE_NATIVE = 1 + +# NS_USE_GCC = 1 + +export PATH:=$(PATH):/opt/ncc/bin +### + +RANLIB = true +GCC_FLAGS_EXTRA += -pipe + +DEFINES += -DSVR4 -DSYSV -DHAVE_STRERROR -DNCR + +OS_CFLAGS += -Hnocopyr -DSVR4 -DSYSV -DHAVE_STRERROR -DNCR -DPRFSTREAMS_BROKEN + +ifdef NS_USE_NATIVE + CC = cc + CCC = ncc + CXX = ncc +# OS_LIBS += -L/opt/ncc/lib +else +# OS_LIBS += +endif + +#OS_LIBS += -lsocket -lnsl -ldl -lc + +MKSHLIB += $(LD) $(DSO_LDOPTS) +#DSO_LDOPTS += -G -z defs +DSO_LDOPTS += -G +ifdef MAPFILE +# Add LD options to restrict exported symbols to those in the map file +endif +# Change PROCESS to put the mapfile in the correct format for this platform +PROCESS_MAP_FILE = cp $< $@ + +CPU_ARCH = x86 +ARCH = ncr + +NOSUCHFILE = /solaris-rm-f-sucks + +# now take care of default GCC (rus@5/5/97) + +ifdef NS_USE_GCC + # if gcc-settings are redefined already - don't touch it + # + ifeq (,$(findstring gcc, $(CC))) + CC = gcc + CCC = g++ + CXX = g++ + # always use -fPIC - some makefiles are still broken and don't distinguish + # situation when they build shared and static libraries + CFLAGS += -fPIC -Wall -Wno-switch $(GCC_FLAGS_EXTRA) +# OS_LIBS += -L/usr/local/lib -lstdc++ -lg++ -lgcc + endif +endif +### diff -Naur security/coreconf/NEC4.2.mk mozilla/security/coreconf/NEC4.2.mk --- a/security/coreconf/NEC4.2.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/NEC4.2.mk 2005-09-16 20:09:23.000000000 +0300 @@ -0,0 +1,68 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DEFAULT_COMPILER = $(CORE_DEPTH)/build/hcc + +CPU_ARCH = mips + +ifdef NS_USE_GCC +CC = gcc +CCC = g++ +else +CC = $(CORE_DEPTH)/build/hcc +OS_CFLAGS = -Xa -KGnum=0 -KOlimit=4000 +CCC = g++ +endif + +MKSHLIB = $(LD) $(DSO_LDOPTS) +ifdef MAPFILE +# Add LD options to restrict exported symbols to those in the map file +endif +# Change PROCESS to put the mapfile in the correct format for this platform +PROCESS_MAP_FILE = cp $< $@ + +RANLIB = /bin/true + +OS_CFLAGS += $(ODD_CFLAGS) -DSVR4 -D__SVR4 -DNEC -Dnec_ews -DHAVE_STRERROR +OS_LIBS = -lsocket -lnsl -ldl $(LDOPTIONS) +LDOPTIONS = -lc -L/usr/ucblib -lucb + +NOSUCHFILE = /nec-rm-f-sucks + +DSO_LDOPTS = -G diff -Naur security/coreconf/NetBSD.mk mozilla/security/coreconf/NetBSD.mk --- a/security/coreconf/NetBSD.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/NetBSD.mk 2009-09-03 07:57:00.000000000 +0300 @@ -0,0 +1,87 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DEFAULT_COMPILER = gcc +CC = gcc +CCC = g++ +RANLIB = ranlib + +CPU_ARCH := $(shell uname -p) +ifeq ($(CPU_ARCH),i386) +OS_REL_CFLAGS = -Di386 +CPU_ARCH = x86 +endif + +ifndef OBJECT_FMT +OBJECT_FMT := $(shell if echo __ELF__ | $${CC:-cc} -E - | grep -q __ELF__ ; then echo a.out ; else echo ELF ; fi) +endif + +ifeq ($(OBJECT_FMT),ELF) +DLL_SUFFIX = so +else +DLL_SUFFIX = so.1.0 +endif + +OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -Wno-switch -pipe -DNETBSD -Dunix -DHAVE_STRERROR -DHAVE_BSD_FLOCK + +OS_LIBS = -lcompat + +ARCH = netbsd + +DSO_CFLAGS = -fPIC -DPIC +DSO_LDOPTS = -shared +ifeq ($(OBJECT_FMT),ELF) +DSO_LDOPTS += -Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) +endif + +ifdef LIBRUNPATH +DSO_LDOPTS += -Wl,-R$(LIBRUNPATH) +endif + +MKSHLIB = $(CC) $(DSO_LDOPTS) +ifdef MAPFILE +# Add LD options to restrict exported symbols to those in the map file +endif +# Change PROCESS to put the mapfile in the correct format for this platform +PROCESS_MAP_FILE = cp $< $@ + + +G++INCLUDES = -I/usr/include/g++ + +INCLUDES += -I/usr/X11R6/include diff -Naur security/coreconf/nsinstall/Makefile mozilla/security/coreconf/nsinstall/Makefile --- a/security/coreconf/nsinstall/Makefile 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/nsinstall/Makefile 2005-10-06 01:25:37.000000000 +0300 @@ -0,0 +1,74 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +DEPTH = ../.. +CORE_DEPTH = ../.. + +MODULE = coreconf + +CSRCS = nsinstall.c pathsub.c + +PROGRAM = nsinstall + +# Indicate that this directory builds build tools. +INTERNAL_TOOLS = 1 + + +include $(DEPTH)/coreconf/config.mk + +ifeq (,$(filter-out OS2 WIN%,$(OS_TARGET))) +PROGRAM = +else +TARGETS = $(PROGRAM) +INSTALL = true +endif + +ifdef NATIVE_CC +CC=$(NATIVE_CC) +endif + +ifdef NATIVE_FLAGS +OS_CFLAGS=$(NATIVE_FLAGS) +endif + +include $(DEPTH)/coreconf/rules.mk + +# Redefine MAKE_OBJDIR for just this directory +define MAKE_OBJDIR +if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); fi +endef + diff -Naur security/coreconf/nsinstall/nsinstall.c mozilla/security/coreconf/nsinstall/nsinstall.c --- a/security/coreconf/nsinstall/nsinstall.c 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/nsinstall/nsinstall.c 2009-06-05 05:15:15.000000000 +0300 @@ -0,0 +1,439 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * 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 the Initial Developer are Copyright (C) 1994-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/* +** Netscape portable install command. +*/ +#include /* OSF/1 requires this before grp.h, so put it first */ +#include +#include +#include +#if defined(_WINDOWS) +#include +typedef unsigned int mode_t; +#else +#include +#include +#include +#include +#include +#include +#endif +#include +#include +#include "pathsub.h" + +#define HAVE_LCHOWN + +#if defined(AIX) || defined(BSDI) || defined(HPUX) || defined(LINUX) || defined(SUNOS4) || defined(SCO) || defined(UNIXWARE) || defined(NTO) || defined(DARWIN) || defined(BEOS) || defined(__riscos__) +#undef HAVE_LCHOWN +#endif + +#define HAVE_FCHMOD + +#if defined(BEOS) +#undef HAVE_FCHMOD +#endif + +#ifdef LINUX +#include +#endif + +#if defined(SCO) || defined(UNIXWARE) || defined(SNI) || defined(NCR) || defined(NEC) +#if !defined(S_ISLNK) && defined(S_IFLNK) +#define S_ISLNK(a) (((a) & S_IFMT) == S_IFLNK) +#endif +#endif + +#if defined(SNI) +extern int fchmod(int fildes, mode_t mode); +#endif + + +#ifdef GETCWD_CANT_MALLOC +/* + * this should probably go into a utility library in case other applications + * need it. + */ +static char * +getcwd_do_malloc(char *path, int len) { + + if (!path) { + path = malloc(PATH_MAX +1); + if (!path) return NULL; + } + return getcwd(path, PATH_MAX); +} +#define GETCWD getcwd_do_malloc +#else +#define GETCWD getcwd +#endif + + +static void +usage(void) +{ + fprintf(stderr, + "usage: %s [-C cwd] [-L linkprefix] [-m mode] [-o owner] [-g group]\n" + " %*s [-DdltR] file [file ...] directory\n", + program, (int)strlen(program), ""); + exit(2); +} + +/* this is more-or-less equivalent to mkdir -p */ +static int +mkdirs(char *path, mode_t mode) +{ + char * cp; + int rv; + struct stat sb; + + if (!path || !path[0]) + fail("Null pointer or empty string passed to mkdirs()"); + while (*path == '/' && path[1] == '/') + path++; + for (cp = strrchr(path, '/'); cp && cp != path && *(cp - 1) == '/'; cp--); + if (cp && cp != path) { + *cp = '\0'; + if ((stat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) && + mkdirs(path, mode) < 0) { + return -1; + } + *cp = '/'; + } + rv = mkdir(path, mode); + if (rv) { + if (errno != EEXIST) + fail("mkdirs cannot make %s", path); + fprintf(stderr, "directory creation race: %s\n", path); + if (!stat(path, &sb) && S_ISDIR(sb.st_mode)) + rv = 0; + } + return rv; +} + +static uid_t +touid(char *owner) +{ + struct passwd *pw; + uid_t uid; + char *cp; + + if (!owner || !owner[0]) + fail("Null pointer or empty string passed to touid()"); + pw = getpwnam(owner); + if (pw) + return pw->pw_uid; + uid = strtol(owner, &cp, 0); + if (uid == 0 && cp == owner) + fail("cannot find uid for %s", owner); + return uid; +} + +static gid_t +togid(char *group) +{ + struct group *gr; + gid_t gid; + char *cp; + + if (!group || !group[0]) + fail("Null pointer or empty string passed to togid()"); + gr = getgrnam(group); + if (gr) + return gr->gr_gid; + gid = strtol(group, &cp, 0); + if (gid == 0 && cp == group) + fail("cannot find gid for %s", group); + return gid; +} + +void * const uninit = (void *)0xdeadbeef; + +int +main(int argc, char **argv) +{ + char * base = uninit; + char * bp = uninit; + char * cp = uninit; + char * cwd = 0; + char * group = 0; + char * linkname = 0; + char * linkprefix = 0; + char * name = uninit; + char * owner = 0; + char * todir = uninit; + char * toname = uninit; + + int bnlen = -1; + int cc = 0; + int dodir = 0; + int dolink = 0; + int dorelsymlink = 0; + int dotimes = 0; + int exists = 0; + int fromfd = -1; + int len = -1; + int lplen = 0; + int onlydir = 0; + int opt = -1; + int tdlen = -1; + int tofd = -1; + int wc = -1; + + mode_t mode = 0755; + + uid_t uid = -1; + gid_t gid = -1; + + struct stat sb; + struct stat tosb; + struct utimbuf utb; + char buf[BUFSIZ]; + + program = strrchr(argv[0], '/'); + if (!program) + program = strrchr(argv[0], '\\'); + program = program ? program+1 : argv[0]; + + + while ((opt = getopt(argc, argv, "C:DdlL:Rm:o:g:t")) != EOF) { + switch (opt) { + case 'C': cwd = optarg; break; + case 'D': onlydir = 1; break; + case 'd': dodir = 1; break; + case 'l': dolink = 1; break; + case 'L': + linkprefix = optarg; + lplen = strlen(linkprefix); + dolink = 1; + break; + case 'R': dolink = dorelsymlink = 1; break; + case 'm': + mode = strtoul(optarg, &cp, 8); + if (mode == 0 && cp == optarg) + usage(); + break; + case 'o': owner = optarg; break; + case 'g': group = optarg; break; + case 't': dotimes = 1; break; + default: usage(); + } + } + + argc -= optind; + argv += optind; + if (argc < 2 - onlydir) + usage(); + + todir = argv[argc-1]; + if ((stat(todir, &sb) < 0 || !S_ISDIR(sb.st_mode)) && + mkdirs(todir, 0777) < 0) { + fail("cannot mkdir -p %s", todir); + } + if (onlydir) + return 0; + + if (!cwd) { + cwd = GETCWD(0, PATH_MAX); + if (!cwd) + fail("could not get CWD"); + } + + /* make sure we can get into todir. */ + xchdir(todir); + todir = GETCWD(0, PATH_MAX); + if (!todir) + fail("could not get CWD in todir"); + tdlen = strlen(todir); + + /* back to original directory. */ + xchdir(cwd); + + uid = owner ? touid(owner) : -1; + gid = group ? togid(group) : -1; + + while (--argc > 0) { + name = *argv++; + len = strlen(name); + base = xbasename(name); + bnlen = strlen(base); + toname = (char*)xmalloc(tdlen + 1 + bnlen + 1); + sprintf(toname, "%s/%s", todir, base); +retry: + exists = (lstat(toname, &tosb) == 0); + + if (dodir) { + /* -d means create a directory, always */ + if (exists && !S_ISDIR(tosb.st_mode)) { + int rv = unlink(toname); + if (rv) + fail("cannot unlink %s", toname); + exists = 0; + } + if (!exists && mkdir(toname, mode) < 0) { + /* we probably have two nsinstall programs in a race here. */ + if (errno == EEXIST && !stat(toname, &sb) && + S_ISDIR(sb.st_mode)) { + fprintf(stderr, "directory creation race: %s\n", toname); + goto retry; + } + fail("cannot make directory %s", toname); + } + if ((owner || group) && chown(toname, uid, gid) < 0) + fail("cannot change owner of %s", toname); + } else if (dolink) { + if (*name == '/') { + /* source is absolute pathname, link to it directly */ + linkname = 0; + } else { + if (linkprefix) { + /* -L implies -l and prefixes names with a $cwd arg. */ + len += lplen + 1; + linkname = (char*)xmalloc(len + 1); + sprintf(linkname, "%s/%s", linkprefix, name); + } else if (dorelsymlink) { + /* Symlink the relative path from todir to source name. */ + linkname = (char*)xmalloc(PATH_MAX); + + if (*todir == '/') { + /* todir is absolute: skip over common prefix. */ + lplen = relatepaths(todir, cwd, linkname); + strcpy(linkname + lplen, name); + } else { + /* todir is named by a relative path: reverse it. */ + reversepath(todir, name, len, linkname); + xchdir(cwd); + } + + len = strlen(linkname); + } + name = linkname; + } + + /* Check for a pre-existing symlink with identical content. */ + if (exists && + (!S_ISLNK(tosb.st_mode) || + readlink(toname, buf, sizeof buf) != len || + strncmp(buf, name, len) != 0)) { + int rmrv; + rmrv = (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname); + if (rmrv < 0) { + fail("destination exists, cannot remove %s", toname); + } + exists = 0; + } + if (!exists && symlink(name, toname) < 0) { + if (errno == EEXIST) { + fprintf(stderr, "symlink creation race: %s\n", toname); + fail("symlink was attempted in working directory %s " + "from %s to %s.\n", cwd, name, toname); + goto retry; + } + diagnosePath(toname); + fail("cannot make symbolic link %s", toname); + } +#ifdef HAVE_LCHOWN + if ((owner || group) && lchown(toname, uid, gid) < 0) + fail("cannot change owner of %s", toname); +#endif + + if (linkname) { + free(linkname); + linkname = 0; + } + } else { + /* Copy from name to toname, which might be the same file. */ + fromfd = open(name, O_RDONLY); + if (fromfd < 0 || fstat(fromfd, &sb) < 0) + fail("cannot access %s", name); + if (exists && + (!S_ISREG(tosb.st_mode) || access(toname, W_OK) < 0)) { + int rmrv; + rmrv = (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname); + if (rmrv < 0) { + fail("destination exists, cannot remove %s", toname); + } + } + tofd = open(toname, O_CREAT | O_WRONLY, 0666); + if (tofd < 0) + fail("cannot create %s", toname); + + bp = buf; + while ((cc = read(fromfd, bp, sizeof buf)) > 0) { + while ((wc = write(tofd, bp, cc)) > 0) { + if ((cc -= wc) == 0) + break; + bp += wc; + } + if (wc < 0) + fail("cannot write to %s", toname); + } + if (cc < 0) + fail("cannot read from %s", name); + + if (ftruncate(tofd, sb.st_size) < 0) + fail("cannot truncate %s", toname); + if (dotimes) { + utb.actime = sb.st_atime; + utb.modtime = sb.st_mtime; + if (utime(toname, &utb) < 0) + fail("cannot set times of %s", toname); + } +#ifdef HAVE_FCHMOD + if (fchmod(tofd, mode) < 0) +#else + if (chmod(toname, mode) < 0) +#endif + fail("cannot change mode of %s", toname); + + if ((owner || group) && fchown(tofd, uid, gid) < 0) + fail("cannot change owner of %s", toname); + + /* Must check for delayed (NFS) write errors on close. */ + if (close(tofd) < 0) + fail("close reports write error on %s", toname); + close(fromfd); + } + + free(toname); + } + + free(cwd); + free(todir); + return 0; +} + diff -Naur security/coreconf/nsinstall/pathsub.c mozilla/security/coreconf/nsinstall/pathsub.c --- a/security/coreconf/nsinstall/pathsub.c 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/nsinstall/pathsub.c 2004-04-25 18:02:18.000000000 +0300 @@ -0,0 +1,306 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * 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 the Initial Developer are Copyright (C) 1994-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/* +** Pathname subroutines. +*/ +#include +#if defined(FREEBSD) || defined(BSDI) || defined(DARWIN) +#include +#endif /* FREEBSD */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "pathsub.h" +#ifdef USE_REENTRANT_LIBC +#include "libc_r.h" +#endif /* USE_REENTRANT_LIBC */ + +char *program; + +void +fail(char *format, ...) +{ + int error; + va_list ap; + +#ifdef USE_REENTRANT_LIBC + R_STRERROR_INIT_R(); +#endif + + error = errno; + fprintf(stderr, "%s: ", program); + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); + if (error) { + +#ifdef USE_REENTRANT_LIBC + R_STRERROR_R(errno); + fprintf(stderr, ": %s", r_strerror_r); +#else + fprintf(stderr, ": %s", strerror(errno)); +#endif + } + + putc('\n', stderr); + abort(); + exit(1); +} + +char * +getcomponent(char *path, char *name) +{ + if (*path == '\0') + return 0; + if (*path == '/') { + *name++ = '/'; + } else { + do { + *name++ = *path++; + } while (*path != '/' && *path != '\0'); + } + *name = '\0'; + while (*path == '/') + path++; + return path; +} + +#ifdef UNIXWARE +/* The static buffer in Unixware's readdir is too small. */ +struct dirent * readdir(DIR *d) +{ + static struct dirent *buf = NULL; +#define MAX_PATH_LEN 1024 + + if (buf == NULL) + buf = (struct dirent *)xmalloc(sizeof(struct dirent) + MAX_PATH_LEN) ; + return readdir_r(d, buf); +} +#endif + +/* APPARENT BUG - ignores argument "dir", uses ".." instead. */ +char * +ino2name(ino_t ino, char *dir) +{ + DIR *dp; + struct dirent *ep; + char *name; + + dp = opendir(".."); /* XXX */ + if (!dp) + fail("cannot read parent directory"); + for (;;) { + if (!(ep = readdir(dp))) + fail("cannot find current directory"); + if (ep->d_ino == ino) + break; + } + name = xstrdup(ep->d_name); + closedir(dp); + return name; +} + +void * +xmalloc(size_t size) +{ + void *p; + + if (size <= 0) + fail("attempted to allocate %u bytes", size); + p = malloc(size); + if (!p) + fail("cannot allocate %u bytes", size); + return p; +} + +char * +xstrdup(char *s) +{ + if (!s || !s[0]) + fail("Null pointer or empty string passed to xstrdup()"); + return strcpy((char*)xmalloc(strlen(s) + 1), s); +} + +char * +xbasename(char *path) +{ + char *cp; + + if (!path || !path[0]) + fail("Null pointer or empty string passed to xbasename()"); + while ((cp = strrchr(path, '/')) && cp[1] == '\0') + *cp = '\0'; + if (!cp) return path; + return cp + 1; +} + +void +xchdir(char *dir) +{ + if (!dir || !dir[0]) + fail("Null pointer or empty string passed to xchdir()"); + if (chdir(dir) < 0) + fail("cannot change directory to %s", dir); +} + +int +relatepaths(char *from, char *to, char *outpath) +{ + char *cp, *cp2; + int len; + char buf[NAME_MAX]; + + assert(*from == '/' && *to == '/'); + if (!from || *from != '/') + fail("relatepaths: from path does not start with /"); + if (!to || *to != '/') + fail("relatepaths: to path does not start with /"); + + for (cp = to, cp2 = from; *cp == *cp2; cp++, cp2++) + if (*cp == '\0') + break; + while (cp[-1] != '/') + cp--, cp2--; + if (cp - 1 == to) { + /* closest common ancestor is /, so use full pathname */ + len = strlen(strcpy(outpath, to)); + if (outpath[len] != '/') { + outpath[len++] = '/'; + outpath[len] = '\0'; + } + } else { + len = 0; + while ((cp2 = getcomponent(cp2, buf)) != 0) { + strcpy(outpath + len, "../"); + len += 3; + } + while ((cp = getcomponent(cp, buf)) != 0) { + sprintf(outpath + len, "%s/", buf); + len += strlen(outpath + len); + } + } + return len; +} + +void +reversepath(char *inpath, char *name, int len, char *outpath) +{ + char *cp, *cp2; + char buf[NAME_MAX]; + struct stat sb; + + cp = strcpy(outpath + PATH_MAX - (len + 1), name); + cp2 = inpath; + while ((cp2 = getcomponent(cp2, buf)) != 0) { + if (strcmp(buf, ".") == 0) + continue; + if (strcmp(buf, "..") == 0) { + if (stat(".", &sb) < 0) + fail("cannot stat current directory"); + name = ino2name(sb.st_ino, ".."); + len = strlen(name); + cp -= len + 1; + strcpy(cp, name); + cp[len] = '/'; + free(name); + xchdir(".."); + } else { + cp -= 3; + strncpy(cp, "../", 3); + xchdir(buf); + } + } + strcpy(outpath, cp); +} + +void +diagnosePath(const char * path) +{ + char * myPath; + char * slash; + int rv; + struct stat sb; + char buf[BUFSIZ]; + + if (!path || !path[0]) + fail("Null pointer or empty string passed to mkdirs()"); + myPath = strdup(path); + if (!myPath) + fail("strdup() failed!"); + do { + rv = lstat(myPath, &sb); + if (rv < 0) { + perror(myPath); + } else if (S_ISLNK(sb.st_mode)) { + rv = readlink(myPath, buf, sizeof buf); + if (rv < 0) { + perror("readlink"); + buf[0] = 0; + } else { + buf[rv] = 0; + } + fprintf(stderr, "%s is a link to %s\n", myPath, buf); + } else if (S_ISDIR(sb.st_mode)) { + fprintf(stderr, "%s is a directory\n", myPath); + rv = access(myPath, X_OK); + if (rv < 0) { + fprintf(stderr, "%s: no search permission\n", myPath); + } + } else { + fprintf(stderr, "%s is a file !?!\n", myPath); + rv = access(myPath, F_OK); + if (rv < 0) { + fprintf(stderr, "%s does not exist\n", myPath); + } + } + + /* chop path off one level. */ + slash = strrchr(myPath, '/'); + if (!slash) + slash = strrchr(myPath, '\\'); + if (!slash) + slash = myPath; + *slash = 0; + } while (myPath[0]); + free(myPath); +} diff -Naur security/coreconf/nsinstall/pathsub.h mozilla/security/coreconf/nsinstall/pathsub.h --- a/security/coreconf/nsinstall/pathsub.h 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/nsinstall/pathsub.h 2004-04-25 18:02:18.000000000 +0300 @@ -0,0 +1,80 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * 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 the Initial Developer are Copyright (C) 1994-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef pathsub_h___ +#define pathsub_h___ +/* +** Pathname subroutines. +** +** Brendan Eich, 8/29/95 +*/ +#include +#include + +#if SUNOS4 +#include "sunos4.h" +#endif + +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif + +/* + * Just keep sane lengths + */ +#undef NAME_MAX +#define NAME_MAX 256 + +extern char *program; + +extern void fail(char *format, ...); +extern char *getcomponent(char *path, char *name); +extern char *ino2name(ino_t ino, char *dir); +extern void *xmalloc(size_t size); +extern char *xstrdup(char *s); +extern char *xbasename(char *path); +extern void xchdir(char *dir); + +/* Relate absolute pathnames from and to returning the result in outpath. */ +extern int relatepaths(char *from, char *to, char *outpath); + +/* NOTE: changes current working directory -- caveat emptor */ +extern void reversepath(char *inpath, char *name, int len, char *outpath); + +/* stats every directory in path, reports results. */ +extern void diagnosePath(const char * path); + +#endif /* pathsub_h___ */ diff -Naur security/coreconf/nsinstall/sunos4.h mozilla/security/coreconf/nsinstall/sunos4.h --- a/security/coreconf/nsinstall/sunos4.h 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/nsinstall/sunos4.h 2005-02-03 00:27:59.000000000 +0200 @@ -0,0 +1,166 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * 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 the Initial Developer are Copyright (C) 1994-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef pr_sunos4_h___ +#define pr_sunos4_h___ + +#ifndef SVR4 + +/* +** Hodge podge of random missing prototypes for the Sunos4 system +*/ +#include +#include +#include +#include +#include + +#define PATH_MAX _POSIX_PATH_MAX + +struct timeval; +struct timezone; +struct itimerval; +struct sockaddr; +struct stat; +struct tm; + +/* ctype.h */ +extern int tolower(int); +extern int toupper(int); + +/* errno.h */ +extern char *sys_errlist[]; +extern int sys_nerr; + +#define strerror(e) sys_errlist[((unsigned)(e) < sys_nerr) ? e : 0] + +extern void perror(const char *); + +/* getopt */ +extern char *optarg; +extern int optind; +extern int getopt(int argc, char **argv, char *spec); + +/* math.h */ +extern int srandom(long val); +extern long random(void); + +/* memory.h */ +#define memmove(to,from,len) bcopy((char*)(from),(char*)(to),len) + +extern void bcopy(const char *, char *, int); + +/* signal.h */ +/* +** SunOS4 sigaction hides interrupts by default, so we can safely define +** SA_RESTART to 0 (HP-UX is a counter-example -- its sigaction does not +** hide interrupts but lacks an SA_RESTART option; you must use sigvector +** and tweak the sigcontext from within each signal handler!). +*/ +#define SA_RESTART 0 +#define SA_SIGINFO 0 + +/* stdio.h */ +extern int printf(const char *, ...); +extern int fprintf(FILE *, const char *, ...); +extern int vprintf(const char *, va_list); +extern int vfprintf(FILE *, const char *, va_list); +extern char *vsprintf(char *, const char *, va_list); +extern int scanf(const char *, ...); +extern int sscanf(const char *, const char *, ...); +extern int fscanf(FILE *, const char *, ...); +extern int fgetc(FILE *); +extern int fputc(int, FILE *); +extern int fputs(const char *, FILE *); +extern int puts(const char *); +extern int fread(void *, size_t, size_t, FILE *); +extern int fwrite(const char *, int, int, FILE *); +extern int fseek(FILE *, long, int); +extern long ftell(FILE *); +extern int rewind(FILE *); +extern int fflush(FILE *); +extern int _flsbuf(unsigned char, FILE *); +extern int fclose(FILE *); +extern int remove(const char *); +extern int setvbuf(FILE *, char *, int, size_t); +extern int system(const char *); +extern FILE *popen(const char *, const char *); +extern int pclose(FILE *); + +/* stdlib.h */ +#define strtoul strtol + +extern int isatty(int fildes); +extern long strtol(const char *, char **, int); +extern int putenv(const char *); +extern void srand48(long); +extern long lrand48(void); +extern double drand48(void); + +/* string.h */ +extern int strcasecmp(const char *, const char *); +extern int strncasecmp(const char *, const char *, size_t); +extern int strcoll(const char *, const char *); + +/* time.h */ +extern time_t mktime(struct tm *); +extern size_t strftime(char *, size_t, const char *, const struct tm *); +extern int gettimeofday(struct timeval *, struct timezone *); +extern int setitimer(int, struct itimerval *, struct itimerval *); +extern time_t time(time_t *); +extern time_t timegm(struct tm *); +extern struct tm *localtime(const time_t *); +extern struct tm *gmtime(const time_t *); + +/* unistd.h */ +extern int rename(const char *, const char *); +extern int ioctl(int, int, int *arg); +extern int connect(int, struct sockaddr *, int); +extern int readlink(const char *, char *, int); +extern int symlink(const char *, const char *); +extern int ftruncate(int, off_t); +extern int fchmod(int, mode_t); +extern int fchown(int, uid_t, gid_t); +extern int lstat(const char *, struct stat *); +extern int fstat(int, struct stat *); +extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); +extern int gethostname(char *, int); +extern char *getwd(char *); +extern int getpagesize(void); + +#endif /* SVR4 */ + +#endif /* pr_sunos4_h___ */ diff -Naur security/coreconf/OpenBSD.mk mozilla/security/coreconf/OpenBSD.mk --- a/security/coreconf/OpenBSD.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/OpenBSD.mk 2009-09-03 07:57:00.000000000 +0300 @@ -0,0 +1,73 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +CC ?= gcc +CXX ?= g++ +DEFAULT_COMPILER = ${CC} +CCC = ${CXX} +RANLIB = ranlib + +CPU_ARCH := $(shell arch -s) +ifeq ($(CPU_ARCH),i386) +OS_REL_CFLAGS = -Di386 +CPU_ARCH = x86 +endif + +ifndef CLASSIC_NSPR +USE_PTHREADS = 1 +DEFINES += -pthread +OS_LIBS += -pthread +DSO_LDOPTS += -pthread +endif + +DLL_SUFFIX = so.1.0 + +OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -Wno-switch -pipe -DOPENBSD + +OS_LIBS = + +ARCH = openbsd + +DSO_CFLAGS = -fPIC -DPIC +DSO_LDOPTS = -shared -fPIC -Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) + +MKSHLIB = $(CC) $(DSO_LDOPTS) + +USE_SYSTEM_ZLIB = 1 +ZLIB_LIBS = -lz diff -Naur security/coreconf/OpenUNIX.mk mozilla/security/coreconf/OpenUNIX.mk --- a/security/coreconf/OpenUNIX.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/OpenUNIX.mk 2009-09-03 07:57:00.000000000 +0300 @@ -0,0 +1,92 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DEFAULT_COMPILER = gcc + +CC = gcc +OS_CFLAGS += -fPIC +CCC = g++ +CCC += -DPRFSTREAMS_BROKEN -I/usr/gnu/lib/g++-include +# CCC = $(CORE_DEPTH)/build/hcpp +# CCC += +.cpp +w +RANLIB = /bin/true + +# +# -DSCO_PM - Policy Manager AKA: SCO Licensing +# -DSCO - Changes to Netscape source (consistent with AIX, LINUX, etc..) +# -Dsco - Needed for /usr/include/X11/* +# +OS_CFLAGS += -DSCO_SV -DSYSV -D_SVID3 -DHAVE_STRERROR -DSW_THREADS -DSCO_PM -DSCO -Dsco +#OS_LIBS += -lpmapi -lsocket -lc +MKSHLIB = $(LD) +MKSHLIB += $(DSO_LDOPTS) +XINC = /usr/include/X11 +MOTIFLIB += -lXm +INCLUDES += -I$(XINC) +CPU_ARCH = x86 +GFX_ARCH = x +ARCH = sco +LOCALE_MAP = $(CORE_DEPTH)/cmd/xfe/intl/sco.lm +EN_LOCALE = C +DE_LOCALE = de_DE.ISO8859-1 +FR_LOCALE = fr_FR.ISO8859-1 +JP_LOCALE = ja +SJIS_LOCALE = ja_JP.SJIS +KR_LOCALE = ko_KR.EUC +CN_LOCALE = zh +TW_LOCALE = zh +I2_LOCALE = i2 +LOC_LIB_DIR = /usr/lib/X11 +NOSUCHFILE = /solaris-rm-f-sucks +BSDECHO = /bin/echo +ifdef MAPFILE +# Add LD options to restrict exported symbols to those in the map file +endif +# Change PROCESS to put the mapfile in the correct format for this platform +PROCESS_MAP_FILE = cp $< $@ + +# +# These defines are for building unix plugins +# +BUILD_UNIX_PLUGINS = 1 +#DSO_LDOPTS += -b elf -G -z defs +DSO_LDOPTS += -G + +# Used for Java compiler +EXPORT_FLAGS += -W l,-Bexport diff -Naur security/coreconf/OS2.mk mozilla/security/coreconf/OS2.mk --- a/security/coreconf/OS2.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/OS2.mk 2009-05-16 03:31:47.000000000 +0300 @@ -0,0 +1,188 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +MOZ_WIDGET_TOOLKIT = os2 + +# XP_PC is for Window and OS2 on Intel X86 +# XP_OS2 is strictly for OS2 only +XP_DEFINE += -DXP_PC=1 -DXP_OS2=1 + +# Override prefix +LIB_PREFIX = $(NULL) + +# Override suffix in suffix.mk +LIB_SUFFIX = lib +# the DLL_SUFFIX must be uppercase for FIPS mode to work. bugzilla 240784 +DLL_SUFFIX = DLL +PROG_SUFFIX = .exe + + +CCC = gcc +LINK = gcc +AR = emxomfar r $@ +# Keep AR_FLAGS blank so that we do not have to change rules.mk +AR_FLAGS = +RANLIB = @echo OS2 RANLIB +BSDECHO = @echo OS2 BSDECHO +IMPLIB = emximp -o +FILTER = emxexp -o + +# GCC for OS/2 currently predefines these, but we don't want them +DEFINES += -Uunix -U__unix -U__unix__ + +DEFINES += -DTCPV40HDRS + +ifeq ($(MOZ_OS2_HIGH_MEMORY),1) +HIGHMEM_LDFLAG = -Zhigh-mem +endif + +ifndef NO_SHARED_LIB +WRAP_MALLOC_LIB = +WRAP_MALLOC_CFLAGS = +DSO_CFLAGS = +DSO_PIC_CFLAGS = +MKSHLIB = $(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@ +MKCSHLIB = $(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@ +MKSHLIB_FORCE_ALL = +MKSHLIB_UNFORCE_ALL = +DSO_LDOPTS = -Zomf -Zdll -Zmap $(HIGHMEM_LDFLAG) +SHLIB_LDSTARTFILE = +SHLIB_LDENDFILE = +ifdef MAPFILE +MKSHLIB += $(MAPFILE) +endif +PROCESS_MAP_FILE = \ + echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@; \ + echo PROTMODE >> $@; \ + echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@; \ + echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@; \ + echo EXPORTS >> $@; \ + grep -v ';+' $< | grep -v ';-' | \ + sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,\([\t ]*\),\1_,' | \ + awk 'BEGIN {ord=1;} { print($$0 " @" ord " RESIDENTNAME"); ord++;}' >> $@ + +endif #NO_SHARED_LIB + +OS_CFLAGS = -Wall -Wno-unused -Wpointer-arith -Wcast-align -Wno-switch -Zomf -DDEBUG -DTRACING -g + +ifdef BUILD_OPT +ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE)) + OPTIMIZER += -Os -s +else + OPTIMIZER += -O2 -s +endif +DEFINES += -UDEBUG -U_DEBUG -DNDEBUG +DLLFLAGS = -DLL -OUT:$@ -MAP:$(@:.dll=.map) $(HIGHMEM_LDFLAG) +EXEFLAGS = -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE $(HIGHMEM_LDFLAG) +OBJDIR_TAG = _OPT +else +#OPTIMIZER = -O+ -Oi +DEFINES += -DDEBUG -D_DEBUG -DDEBUGPRINTS #HCT Need += to avoid overidding manifest.mn +DLLFLAGS = -DEBUG -DLL -OUT:$@ -MAP:$(@:.dll=.map) $(HIGHMEM_LDFLAG) +EXEFLAGS = -DEBUG -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE $(HIGHMEM_LDFLAG) +OBJDIR_TAG = _DBG +LDFLAGS = -DEBUG $(HIGHMEM_LDFLAG) +endif # BUILD_OPT + +# OS/2 use nsinstall that is included in the toolkit. +# since we do not wish to support and maintain 3 version of nsinstall in mozilla, nspr and nss + +ifdef BUILD_TREE +NSINSTALL_DIR = $(BUILD_TREE)/nss +else +NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall +endif +# NSINSTALL = $(NSINSTALL_DIR)/$(OBJDIR_NAME)/nsinstall +NSINSTALL = nsinstall # HCT4OS2 +INSTALL = $(NSINSTALL) + +MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend +MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend +MKDEPENDENCIES = $(OBJDIR_NAME)/depend.mk + +#################################################################### +# +# One can define the makefile variable NSDISTMODE to control +# how files are published to the 'dist' directory. If not +# defined, the default is "install using relative symbolic +# links". The two possible values are "copy", which copies files +# but preserves source mtime, and "absolute_symlink", which +# installs using absolute symbolic links. +# - THIS IS NOT PART OF THE NEW BINARY RELEASE PLAN for 9/30/97 +# - WE'RE KEEPING IT ONLY FOR BACKWARDS COMPATIBILITY +#################################################################### + +ifeq ($(NSDISTMODE),copy) + # copy files, but preserve source mtime + INSTALL = $(NSINSTALL) + INSTALL += -t +else + ifeq ($(NSDISTMODE),absolute_symlink) + # install using absolute symbolic links + INSTALL = $(NSINSTALL) + INSTALL += -L `pwd` + else + # install using relative symbolic links + INSTALL = $(NSINSTALL) + INSTALL += -R + endif +endif + +define MAKE_OBJDIR +if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi +endef + +# +# override the definition of DLL_PREFIX in prefix.mk +# + +ifndef DLL_PREFIX + DLL_PREFIX = $(NULL) +endif + +# +# override the TARGETS defined in ruleset.mk, adding IMPORT_LIBRARY +# +ifndef TARGETS + TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(PROGRAM) +endif + + +ifdef LIBRARY_NAME + IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)$(JDK_DEBUG_SUFFIX).lib +endif + diff -Naur security/coreconf/OSF1.mk mozilla/security/coreconf/OSF1.mk --- a/security/coreconf/OSF1.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/OSF1.mk 2009-04-10 01:25:09.000000000 +0300 @@ -0,0 +1,80 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# +# The Bourne shell (sh) on OSF1 doesn't handle "set -e" correctly, +# which we use to stop LOOP_OVER_DIRS submakes as soon as any +# submake fails. So we use the Korn shell instead. +# +SHELL = /usr/bin/ksh + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DEFAULT_COMPILER = cc + +CC = cc +OS_CFLAGS += $(NON_LD_FLAGS) -std1 +CCC = cxx +RANLIB = /bin/true +CPU_ARCH = alpha + +ifdef BUILD_OPT + OPTIMIZER += -Olimit 4000 +endif + +NON_LD_FLAGS += -ieee_with_inexact +OS_CFLAGS += -DOSF1 -D_REENTRANT + +ifeq ($(USE_PTHREADS),1) + OS_CFLAGS += -pthread +endif + +# The command to build a shared library on OSF1. +MKSHLIB += ld -shared -expect_unresolved "*" -soname $(notdir $@) +ifdef MAPFILE +MKSHLIB += -hidden -input $(MAPFILE) +endif +PROCESS_MAP_FILE = grep -v ';+' $< | grep -v ';-' | \ + sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,^,-exported_symbol ,' > $@ + +DSO_LDOPTS += -shared + +# required for freebl +USE_64=1 +# this platform name does not use a bit tag due to only having a 64-bit ABI +64BIT_TAG= + diff -Naur security/coreconf/OSF1V2.0.mk mozilla/security/coreconf/OSF1V2.0.mk --- a/security/coreconf/OSF1V2.0.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/OSF1V2.0.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,37 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +include $(CORE_DEPTH)/coreconf/OSF1.mk diff -Naur security/coreconf/OSF1V3.0.mk mozilla/security/coreconf/OSF1V3.0.mk --- a/security/coreconf/OSF1V3.0.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/OSF1V3.0.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,37 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +include $(CORE_DEPTH)/coreconf/OSF1.mk diff -Naur security/coreconf/OSF1V3.2.mk mozilla/security/coreconf/OSF1V3.2.mk --- a/security/coreconf/OSF1V3.2.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/OSF1V3.2.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,48 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# On OSF1 V3.2, classic nspr is the default (and only) implementation +# strategy. + +# +# Config stuff for DEC OSF/1 V3.2 +# +include $(CORE_DEPTH)/coreconf/OSF1.mk + +ifeq ($(OS_RELEASE),V3.2) + OS_CFLAGS += -DOSF1V3 +endif diff -Naur security/coreconf/OSF1V4.0B.mk mozilla/security/coreconf/OSF1V4.0B.mk --- a/security/coreconf/OSF1V4.0B.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/OSF1V4.0B.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,37 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +include $(CORE_DEPTH)/coreconf/OSF1V4.0.mk diff -Naur security/coreconf/OSF1V4.0D.mk mozilla/security/coreconf/OSF1V4.0D.mk --- a/security/coreconf/OSF1V4.0D.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/OSF1V4.0D.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,41 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +include $(CORE_DEPTH)/coreconf/OSF1V4.0.mk +DEFINES += -DOSF1V4D + +OS_LIBS += -lpthread -lrt + diff -Naur security/coreconf/OSF1V4.0.mk mozilla/security/coreconf/OSF1V4.0.mk --- a/security/coreconf/OSF1V4.0.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/OSF1V4.0.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,56 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# On OSF1 V4.0, pthreads is the default implementation strategy. +# Classic nspr is also available. + +ifneq ($(OS_RELEASE),V3.2) + USE_PTHREADS = 1 + ifeq ($(CLASSIC_NSPR), 1) + USE_PTHREADS = + IMPL_STRATEGY := _CLASSIC + endif +endif + +# +# Config stuff for DEC OSF/1 V4.0 +# +include $(CORE_DEPTH)/coreconf/OSF1.mk + +ifeq ($(OS_RELEASE),V4.0) + OS_CFLAGS += -DOSF1V4 +endif diff -Naur security/coreconf/OSF1V5.0.mk mozilla/security/coreconf/OSF1V5.0.mk --- a/security/coreconf/OSF1V5.0.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/OSF1V5.0.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,52 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# On OSF1 V5.0, pthreads is the default implementation strategy. +# Classic nspr is also available. + +ifneq ($(OS_RELEASE),V3.2) + USE_PTHREADS = 1 + ifeq ($(CLASSIC_NSPR), 1) + USE_PTHREADS = + IMPL_STRATEGY := _CLASSIC + endif +endif + +# +# Config stuff for DEC OSF/1 V5.0 +# +include $(CORE_DEPTH)/coreconf/OSF1.mk diff -Naur security/coreconf/OSF1V5.1.mk mozilla/security/coreconf/OSF1V5.1.mk --- a/security/coreconf/OSF1V5.1.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/OSF1V5.1.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,52 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 2001 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# On OSF1 V5.0, pthreads is the default implementation strategy. +# Classic nspr is also available. + +ifneq ($(OS_RELEASE),V3.2) + USE_PTHREADS = 1 + ifeq ($(CLASSIC_NSPR), 1) + USE_PTHREADS = + IMPL_STRATEGY := _CLASSIC + endif +endif + +# +# Config stuff for DEC OSF/1 V5.1 +# +include $(CORE_DEPTH)/coreconf/OSF1.mk diff -Naur security/coreconf/outofdate.pl mozilla/security/coreconf/outofdate.pl --- a/security/coreconf/outofdate.pl 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/outofdate.pl 2010-04-26 02:37:40.000000000 +0300 @@ -0,0 +1,71 @@ +#!/usr/local/bin/perl +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +#Input: [-d dir] foo1.java foo2.java +#Compares with: foo1.class foo2.class (if -d specified, checks in 'dir', +# otherwise assumes .class files in same directory as .java files) +#Returns: list of input arguments which are newer than corresponding class +#files (non-existent class files are considered to be real old :-) + +$found = 1; + +if ($ARGV[0] eq '-d') { + $classdir = $ARGV[1]; + $classdir .= "/"; + shift; + shift; +} else { + $classdir = "./"; +} + +foreach $filename (@ARGV) { + $classfilename = $classdir; + $classfilename .= $filename; + $classfilename =~ s/.java$/.class/; + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime, + $ctime,$blksize,$blocks) = stat($filename); + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$classmtime, + $ctime,$blksize,$blocks) = stat($classfilename); +# print $filename, " ", $mtime, ", ", $classfilename, " ", $classmtime, "\n"; + if ($mtime > $classmtime) { + print $filename, " "; + $found = 0; + } +} + +print "\n"; diff -Naur security/coreconf/prefix.mk mozilla/security/coreconf/prefix.mk --- a/security/coreconf/prefix.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/prefix.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,76 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +####################################################################### +# Master "Core Components" for computing program prefixes # +####################################################################### + +# +# Object prefixes +# + +ifndef OBJ_PREFIX + OBJ_PREFIX = +endif + +# +# Library suffixes +# + +ifndef LIB_PREFIX + LIB_PREFIX = lib +endif + + +ifndef DLL_PREFIX + DLL_PREFIX = lib +endif + + +ifndef IMPORT_LIB_PREFIX + IMPORT_LIB_PREFIX = +endif + +# +# Program prefixes +# + +ifndef PROG_PREFIX + PROG_PREFIX = +endif + +MK_PREFIX = included diff -Naur security/coreconf/QNX.mk mozilla/security/coreconf/QNX.mk --- a/security/coreconf/QNX.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/QNX.mk 2009-09-03 07:57:00.000000000 +0300 @@ -0,0 +1,71 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 2001 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +USE_PTHREADS = 1 + +ifeq ($(USE_PTHREADS),1) + IMPL_STRATEGY = _PTH +endif + +CC = qcc +CCC = qcc +RANLIB = ranlib + +DEFAULT_COMPILER = qcc +ifeq ($(OS_TEST),mips) + CPU_ARCH = mips +else + CPU_ARCH = x86 +endif + +MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) +ifdef BUILD_OPT + OPTIMIZER = -O2 +endif + +OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Vgcc_ntox86 -Wall -pipe -DNTO -DHAVE_STRERROR -D_QNX_SOURCE -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE=500 + +ifdef USE_PTHREADS + DEFINES += -D_REENTRANT +endif + +ARCH = QNX + +DSO_CFLAGS = -Wc,-fPIC +DSO_LDOPTS = -shared diff -Naur security/coreconf/README mozilla/security/coreconf/README --- a/security/coreconf/README 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/README 2005-01-27 21:14:15.000000000 +0200 @@ -0,0 +1,561 @@ +OVERVIEW of "ns/coreconf": + + This README file is an attempt to provide the reader with a simple + synopsis of the "ns/coreconf" build system which was originally + fundamentally designed and built to accomodate Netscape's binary + release model. Wherever possible, an attempt has been made to + comply with the NSPR 2.0 build system, including mimicing the + compiler/linker flags, and directory naming structure. The reader + should keep in mind that the system builds binary releases of + header files, class files, libraries, and executables on numerous + flavors of UNIX and Windows operating systems. Unfortunately, + no serious attempt has ever been made to incorporate an ability to + generate cross-platform binaries on an Apple MacIntosh platform. + + Note that this file will not attempt to redefine or document the + architecture of this system. However, documents on this subject + are available at the following URL: + + http://warp/hardcore/prj-ttools/specs/release/index.html + + + +DEPENDENCIES of "ns/coreconf": + + The "ns/coreconf" build system requires the specified versions of + the following platform-dependent tools: + + UNIX Platforms: + -------------- + gmake (version 3.74 or later) + perl 4.0 (NOTE: perl 5.003 or later recommended) + uname + + Windows Platforms: + ----------------- + gmake 3.74 (must use hacked Netscape version) + shmsdos.exe (contained in Netscape gmake.exe) + nsinstall.exe (contained in Netscape gmake.exe) + perl.exe (version 4.0 for everything except testing; + NOTE: MKS toolkit perl 5.002 is broken) + perl5.exe (for testing; + NOTE: perl 5.003 or later recommended; + MKS toolkit perl 5.002 is broken) + uname.exe (use nstools version) + +ENHANCEMENTS to "ns/coreconf": + + With the advent of Certificate Server 4.0 using the ns/coreconf + build system, several changes had to be made to enhance + ns/coreconf support for building Java/JNI classes/programs, as + well as libraries slated to be released as binaries. While the + following may not represent an exhaustive list of these changes, + it does attempt to be at least somewhat comprehensive: + + (1) During the course of these enhancements, a total of + four files have been modified, and four new files have + been added. + + The following files have been modified: + + - command.mk: removed old definition of JAR + + - config.mk: added include statement of new + "jdk.mk" file + + - ruleset.mk: allowed the $(MKPROG) variable to be + overridden by supplying it with a + default value of $(CC); augmented + numerous definitions to enhance + ability of ns/coreconf to produce + a more robust set of libraries; + added some JNI definitions; PACKAGE + definition may be overridden by new + "jdk.mk" file + + - rules.mk: separated the compile phase of a + program from the link phase of a + program such that a developer can + now strictly override program linkage + by simply supplying a $(MKPROG) + variable; augmented NETLIBDEPTH + to use CORE_DEPTH but retain backward + compatibility; added JNI section; + modified .PRECIOUS rule; + + The following files have been added: + + - README: this file; an ASCII-based text + document used to summarize the + ns/coreconf build system and + suitable (paginated) for printing + + - jdk.mk: a file comprising most (if not all) + of the default Java related build + information; the definitions in this + file are only included if NS_USE_JDK + has been defined + + - jniregen.pl: a perl script used to create a + dependency for when JNI files should + be regenerated (based upon any change + to the ".class" file from which the + ".h" file was originally generated) + + - outofdate.pl: a perl script used to create a + dependency for when ".class" files + should be regenerated (based upon + any change to the ".java" file + from which the ".class" file was + originally generated) + + (2) As stated above, the ns/coreconf build system now separates + the link phase of a program from its compilation phase. + While ns/coreconf still works exactly as it used to because + the $(MKPROG) variable is assigned $(CC) by default, a developer + may now override this behavior by simply supplying their + own unique value for $(MKPROG) on every platform. This allows + a program compiled with $(CC) to link with external libraries + that may contain "C++" linkage. Before this change, a + programmer would need to reference their own local copy of + rules.mk (see the ns/sectools/cmd/pk12util program for + an example of how this used to be accomplished). + + (3) Currently, the ns/coreconf build system differs from the + NSPR 2.0 build system which utilizes an "_s" to denote + static libraries from import libraries. In fact, the + ns/coreconf build system adds no prefixes or suffixes to + distinguish one version of static libraries from another. + Note that both the ns/coreconf build system as well as the + NSPR 2.0 build system do nothing to provide a method of + distinguishing 16-bit from 32-bit static libraries on the + same machine, either, since: + + a) this might only provide difficulty during + development, since static libraries always + need to be embedded within a program + (note this is highly unlikely, since libraries + for different platforms are subdivided via + a well-known subdirectory structure, and + a developer may use multiple trees for + development), + + b) this maintains backwards compatibility, + something very important since no legacy + programs will need to change their link phase, and + + c) Netscape as a company has dropped any plans + of future development of 16-bit products. + + (4) Since several members of the Hardcore Security group did + not favor NSPR 2.0's solution of adding an "_s" to static + libraries on Windows platforms as a method to distinguish + them from their import library cousins, a different solution + was proposed and has been recently implemented for ns/coreconf: + + - a 16 has been added as a suffix to both dynamic and + import libraries built on 16-bit Windows platforms + + - a 32 has been added as a suffix to both dynamic and + import libraries built on 32-bit Windows platforms + + Since the HCL release process currently only contains a + single instance of building a dynamic library, + ns/security/lib/fortcrypt/fort12.dll, the impact of this + change should be relatively small. (Note: HCL was the + old name of NSS.) + + It should be noted that although this would additionally + limit the 8.3 namespace on 16-bit platforms, it is highly + unlikely that any future development will be performed on + this platform. + + (5) The $(LIBRARY_VERSION) tag has been added to all non-static + libraries created on UNIX operating systems to alleviate + any future confusion for binary releases which utilize this + tag. Again, it should be noted that this tag is only + utilized on non-static libraries, since more than one + version of the library may need to exist simultaneously + if multiple products are utilized. + + Currently, only one HCL released library utilizes this tag: + + ns/security/lib/fortcrypt/fort12.a + (e. g. - in this library, the tag has been set to '12') + + Again, it should be noted that although this would + additionally limit the 8.3 namespace on 16-bit platforms, + it is highly unlikely that any future development will be + performed on this platform. + + (6) The $(JDK_DEBUG_SUFFIX) extension has been added to all + library and program names to support debug versions of + Java programs (e. g. - java_g, javac_g, etc). + + Once again, it should be noted that although this would + additionally limit the 8.3 namespace on 16-bit platforms, + it is highly unlikely that any future Java development + will be performed on this platform. + + (7) Most (if not all) default definitions for java have been + encapsulated within their own file, jdk.mk, which is + always included by default in ns/coreconf/config.mk. + However, the definitions within this file are only ever + activated if NS_USE_JDK has been set to be 1. + + + (8) Two perl scripts (jniregen.pl and outofdate.pl) have been + added to the system to foster a more robust development + environment for composing Java and JNI programs + utilizing the ns/coreconf build system. Both of these + perl scripts are related to resolving dependencies which + can not be accomplished through normal makefile dependencies. + + (9) This file, README, was created in an attempt to allow + developers who have familiarity with ns/coreconf a simple + roadmap for what has changed, as well as a top-level view of + what comprises ns/coreconf. This file was written in + ASCII (rather than HTML) primarily to promote simple + paginated printing. + +OVERVIEW of "config.mk": + + This file contains the configuration information necessary to + build each "Core Components" source module: + + include file name Purpose + =================== ======================================= + arch.mk source and release tags + + command.mk default command macros + (NOTE: may be overridden in $(OS_CONFIG).mk) + + $(OS_CONFIG).mk -specific macros + (dependent upon tags) + + tree.mk release tags + (dependent upon tags) + + module.mk source and release tags + (NOTE: A component is also called a module + or a subsystem. This file is dependent upon + $(MODULE) being defined on the command + line, as an environment variable, or in + individual makefiles, or more + appropriately, manifest.mn) + + version.mk release tags + (dependent upon $(MODULE) being defined on + the command line, as an environment variable, + or in individual makefiles, or more + appropriately, manifest.mn) + + location.mk macros to figure out binary code location + (dependent upon tags) + + source.mk -specific source path + (dependent upon , + , , and + tags) + + headers.mk include switch for support header files + (dependent upon , , , + and tags) + + prefix.mk compute program prefixes + + suffix.mk compute program suffixes + (dependent upon tags) + + jdk.mk define JDK + (dependent upon , + , and tags) + + ruleset.mk Master "Core Components" rule set + (should always be the last file + included by config.mk) + + + +OVERVIEW of "rules.mk": + + The "rules.mk" file consists of four sections. The first section + contains the "master" build rules for all binary releases. While + this section can (and should) largely be thought of as "language" + independent, it does utilize the "perl" scripting language to + perform both the "import" and "release" of binary modules. + + The rules which dwell in this section and their purpose: + + + CATEGORY/rule:: Purpose + =================== ======================================= + + GENERAL + ------- + all:: "default" all-encompassing rule which + performs "export libs program install" + + export:: recursively copy specified + cross-platform header files to the + $(SOURCE_XPHEADERS_DIR) directory; + recursively copy specified + machine-dependent header files to the + $(SOURCE_MDHEADERS_DIR) directory; + although all rules can be written to + repetively "chain" into other sections, + this rule is the most commonly used + rule to "chain" into other sections + such as Java providing a simple + mechanism which allows no need for + developers to memorize specialized + rules + + libs:: recursively build + static (archival) $(LIBRARY), shared + (dynamic link) $(SHARED_LIBRARY), + and/or import $(IMPORT_LIBRARY) + libraries + + program:: recursively build $(PROGRAM) + executable + + install:: recursively copy all libraries to + $(SOURCE_LIB_DIR) directory; + recursively copy all executables to + $(SOURCE_BIN_DIR) directory + + clean:: remove all files specified in the + $(ALL_TRASH) variable + + clobber:: synonym for "clean::" rule + + realclean:: remove all files specified by + $(wildcard *.OBJ), dist, and in + the $(ALL_TRASH) variable + + clobber_all:: synonym for "realclean::" rule + + private_export:: recursively copy specified + cross-platform header files to the + $(SOURCE_XPPRIVATE_DIR) directory + + + IMPORT + ------ + import:: uses perl script to retrieve specified + VERSION of the binary release from + $(RELEASE_TREE) + + RELEASE + ------- + release_clean:: remove all files from the + $(SOURCE_RELEASE_PREFIX) directory + + release:: place specified VERSION of the + binary release in the appropriate + $(RELEASE_TREE) directory + + release_export:: recursively copy specified + cross-platform header files to the + $(SOURCE_XPHEADERS_DIR)/include + directory + + release_md:: recursively copy all libraries to + $(SOURCE_RELEASE_PREFIX)/ + $(SOURCE_RELEASE_LIB_DIR) directory; + recursively copy all executables to + $(SOURCE_RELEASE_PREFIX)/ + $(SOURCE_RELEASE_BIN_DIR) directory + + release_jars:: use perl script to package appropriate + files in the $(XPCLASS_JAR), + $(XPHEADER_JAR), $(MDHEADER_JAR), and + $(MDBINARY_JAR) jar files + + release_cpdistdir:: use perl script to copy the + $(XPCLASS_JAR), $(XPHEADER_JAR), + $(MDHEADER_JAR), and $(MDBINARY_JAR) + jar files to the specified VERSION + of the $(RELEASE_TREE) directory + + + + TOOLS and AUTOMATION + -------------------- + platform:: tool used to display the platform name + as composed within the "arch.mk" file + + autobuild:: automation rule used by "Bonsai" and + "Tinderbox" to automatically generate + binary releases on various platforms + + tests:: automation tool used to run the + "regress" and "reporter" tools + on various regression test suites + + The second section of "rules.mk" primarily contains several + "language" dependent build rules for binary releases. These are + generally "computed" rules (created on the "fly"), and include + rules used by "C", "C++", assembly, the preprocessor, perl, and + the shell. + + The rules which dwell in this section and their purpose: + + + CATEGORY/rule:: Purpose + =================== ============================= + + LIBRARIES + --------- + $(LIBRARY): build the static library + specified by the $(LIBRARY) + variable + + $(IMPORT_LIBRARY): build the import library + specified by the + $(IMPORT_LIBRARY) variable + + $(SHARED_LIBRARY): build the shared + (dynamic link) library + specified by the + $(SHARED_LIBRARY) variable + + + PROGRAMS + -------- + $(PROGRAM): build the binary executable + specified by the $(PROGRAM) + rule + + $(OBJDIR)/ + $(PROG_PREFIX)%.pure: build the "purified" binary + executable specified by this + rule + + + OBJECTS + ------- + $(OBJDIR)/ + $(PROG_PREFIX)%$(OBJ_SUFFIX): build the object file + associated with the + makefile rule dependency: + + %.c = C file + %.cpp = C++ file + %.cc = C++ file + %.s = assembly file + %.S = assembly file + + $(OBJDIR)/ + $(PROG_PREFIX)%: (NOTE: deprecated rule) + build the object file + associated with the + makefile rule dependency: + + %.cpp = C++ file + + MISCELLANEOUS + ------------- + $(DIRS):: specifies a helper method + used by $(LOOP_THROUGH_DIRS) + to recursively change + directories and invoke + $(MAKE) + + %.i: build the preprocessor file + associated with the + makefile rule dependency: + + %.c = C file + %.cpp = C++ file + + %: process the specified file + using the method associated + with the makefile rule + dependency: + + %.pl = perl script + %.sh = shell script + + alltags: tool used to recursively + create a "ctags"-style + file for reference + + The third section of "rules.mk' primarily contains several JAVA + "language" build rules for binary releases. These are also + generally "computed" rules (created on the "fly"). + + The rules which dwell in this section and their purpose: + + + CATEGORY/rule:: Purpose + =================== ============================= + $(JAVA_DESTPATH):: create directory specified + as the Java destination path + for where classes are + deposited + + $(JAVA_DESTPATH)/$(PACKAGE):: create directories specified + within the $(PACKAGE) + variable + + $(JMCSRCDIR):: create directory specified + as the JMC destination path + + $(JRI_HEADER_CFILES): used to generate/regenerate + JRI header files for "C" + + $(JRI_STUB_CFILES): used to generate/regenerate + JRI stub files for "C" + + $(JNI_HEADERS): used to generate/regenerate + JNI header files for "C" + + The fourth section of "rules.mk" primarily contains miscellaneous + build rules for binary releases. Many of these rules are here to + create new subdirectories, manage dependencies, and/or override + standard gmake "Makefile" rules. + + The rules which dwell in this section and their purpose: + + + CATEGORY/rule:: Purpose + =================== ============================= + + $(PUBLIC_EXPORT_DIR):: create directory used to + house public "C" header files + + $(PRIVATE_EXPORT_DIR):: create directory used to + house private "C" header + files + + $(SOURCE_XP_DIR)/ + release/include:: create directory used to + house "C" header files + contained in a release + + $(MKDEPENDENCIES):: for UNIX systems, create + a directory used to house + dependencies and utilize + the $(MKDEPEND) rule to + create them + + $(MKDEPEND):: cd to the dependency + directory and create them + + depend:: if $(OBJS) exist, perform the + $(MKDEPEND) rule followed by + the $(MKDEPENDENCIES) rule + + dependclean:: remove all files contained + in the dependency repository + + .DEFAULT: standard gmake rule + + .SUFFIXES: standard gmake rule + + .PRECIOUS: standard gmake rule + + .PHONY: standard gmake rule + diff -Naur security/coreconf/release.pl mozilla/security/coreconf/release.pl --- a/security/coreconf/release.pl 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/release.pl 2005-09-16 03:33:23.000000000 +0300 @@ -0,0 +1,144 @@ +#! /usr/local/bin/perl +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + + +require('coreconf.pl'); + +#######-- read in variables on command line into %var + +$use_jar = 1; +$ZIP = "$ENV{JAVA_HOME}/bin/jar"; + +if ( $ENV{JAVA_HOME} eq "" ) { + $ZIP = "zip"; + $use_jar = 0; +} + + +&parse_argv; + + +######-- Do the packaging of jars. + +foreach $jarfile (split(/ /,$var{FILES}) ) { + print STDERR "---------------------------------------------\n"; + print STDERR "Packaging jar file $jarfile....\n"; + + $jarinfo = $var{$jarfile}; + + ($jardir,$jaropts) = split(/\|/,$jarinfo); + + if ( $use_jar ) { + $zipoptions = "-cvf"; + } else { + $zipoptions = "-T -r"; + if ($jaropts =~ /a/) { + if ($var{OS_ARCH} eq 'WINNT') { + $zipoptions .= ' -ll'; + } + } + } + +# just in case the directory ends in a /, remove it + if ($jardir =~ /\/$/) { + chop $jardir; + } + + $dirdepth --; + + print STDERR "jardir = $jardir\n"; + system("ls $jardir"); + + if (-d $jardir) { + + +# count the number of slashes + + $slashes =0; + + foreach $i (split(//,$jardir)) { + if ($i =~ /\//) { + $slashes++; + } + } + + $dotdots =0; + + foreach $i (split(m|/|,$jardir)) { + if ($i eq '..') { + $dotdots ++; + } + } + + $dirdepth = ($slashes +1) - (2*$dotdots); + + print STDERR "changing dir $jardir\n"; + chdir($jardir); + print STDERR "making dir META-INF\n"; + mkdir("META-INF",0755); + + $filelist = ""; + opendir(DIR,"."); + while ($_ = readdir(DIR)) { + if (! ( ($_ eq '.') || ($_ eq '..'))) { + if ( $jaropts =~ /i/) { + if (! /^include$/) { + $filelist .= "$_ "; + } + } + else { + $filelist .= "$_ "; + } + } + } + closedir(DIR); + + print STDERR "$ZIP $zipoptions $jarfile $filelist\n"; + system("$ZIP $zipoptions $jarfile $filelist"); + rmdir("META-INF"); + for $i (1 .. $dirdepth) { + chdir(".."); + print STDERR "chdir ..\n"; + } + } + else { + print STDERR "Directory $jardir doesn't exist\n"; + } + +} + diff -Naur security/coreconf/ReliantUNIX5.4.mk mozilla/security/coreconf/ReliantUNIX5.4.mk --- a/security/coreconf/ReliantUNIX5.4.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/ReliantUNIX5.4.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,37 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +include $(CORE_DEPTH)/coreconf/ReliantUNIX.mk diff -Naur security/coreconf/ReliantUNIX.mk mozilla/security/coreconf/ReliantUNIX.mk --- a/security/coreconf/ReliantUNIX.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/ReliantUNIX.mk 2007-11-22 06:39:56.000000000 +0200 @@ -0,0 +1,90 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DEFAULT_COMPILER = cc + +ifdef NS_USE_GCC + ## gcc-2.7.2 homebrewn + CC = gcc + CCC = g++ + AS = $(CC) + ASFLAGS += -x assembler-with-cpp + LD = gld + ODD_CFLAGS = -pipe -Wall -Wno-format -Wno-switch + ifdef BUILD_OPT + OPTIMIZER += -O6 + endif + MKSHLIB = $(LD) + MKSHLIB += -G -h $(@:$(OBJDIR)/%.so=%.so) + DSO_LDOPTS += -G -Xlinker -Blargedynsym +else + ## native compiler (CDS++ 1.0) +# CC = /usr/bin/cc + CC = cc + CCC = /usr/bin/CC + AS = /usr/bin/cc + ODD_CFLAGS = + ifdef BUILD_OPT + OPTIMIZER += -O -F Olimit,4000 + endif + MKSHLIB = $(CC) + MKSHLIB += -G -h $(@:$(OBJDIR)/%.so=%.so) + DSO_LDOPTS += -G -W l,-Blargedynsym +endif +ifdef MAPFILE +# Add LD options to restrict exported symbols to those in the map file +endif +# Change PROCESS to put the mapfile in the correct format for this platform +PROCESS_MAP_FILE = cp $< $@ + +NOSUCHFILE = /sni-rm-f-sucks +ODD_CFLAGS += -DSVR4 -DSNI -DRELIANTUNIX +CPU_ARCH = mips +RANLIB = /bin/true + +# For purify +NOMD_OS_CFLAGS += $(ODD_CFLAGS) + +# we do not have -MDupdate ... +OS_CFLAGS += $(NOMD_OS_CFLAGS) +OS_LIBS += -lsocket -lnsl -lresolv -lgen -ldl -lc /usr/ucblib/libucb.a + +ifdef DSO_BACKEND + DSO_LDOPTS += -h $(DSO_NAME) +endif diff -Naur security/coreconf/RISCOS.mk mozilla/security/coreconf/RISCOS.mk --- a/security/coreconf/RISCOS.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/RISCOS.mk 2009-09-03 07:57:00.000000000 +0300 @@ -0,0 +1,55 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Peter Naulls +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +LIB_SUFFIX = a +DLL_SUFFIX = so +AR = ar cr $@ +LDOPTS += -L$(SOURCE_LIB_DIR) +MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) + +OS_RELEASE = +OS_TARGET = RISCOS + +DSO_CFLAGS = -fPIC +DSO_LDOPTS = -shared + +ifdef BUILD_OPT + OPTIMIZER = -O3 +endif diff -Naur security/coreconf/ruleset.mk mozilla/security/coreconf/ruleset.mk --- a/security/coreconf/ruleset.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/ruleset.mk 2009-07-08 21:15:21.000000000 +0300 @@ -0,0 +1,250 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +####################################################################### +# # +# Parameters to this makefile (set these in this file): # +# # +# a) # +# TARGETS -- the target to create # +# (defaults to $LIBRARY $PROGRAM) # +# b) # +# DIRS -- subdirectories for make to recurse on # +# (the 'all' rule builds $TARGETS $DIRS) # +# c) # +# CSRCS, CPPSRCS -- .c and .cpp files to compile # +# (used to define $OBJS) # +# d) # +# PROGRAM -- the target program name to create from $OBJS # +# ($OBJDIR automatically prepended to it) # +# e) # +# LIBRARY -- the target library name to create from $OBJS # +# ($OBJDIR automatically prepended to it) # +# f) # +# JSRCS -- java source files to compile into class files # +# (if you don't specify this it will default # +# to *.java) # +# g) # +# PACKAGE -- the package to put the .class files into # +# (e.g. netscape/applet) # +# (NOTE: the default definition for this may be # +# overridden if "jdk.mk" is included) # +# h) # +# JMC_EXPORT -- java files to be exported for use by JMC_GEN # +# (this is a list of Class names) # +# i) # +# JRI_GEN -- files to run through javah to generate headers # +# and stubs # +# (output goes into the _jri sub-dir) # +# j) # +# JMC_GEN -- files to run through jmc to generate headers # +# and stubs # +# (output goes into the _jmc sub-dir) # +# k) # +# JNI_GEN -- files to run through javah to generate headers # +# (output goes into the _jni sub-dir) # +# # +####################################################################### + +# +# CPU_TAG is now defined in the $(TARGET).mk files +# + +ifndef COMPILER_TAG + ifneq ($(DEFAULT_COMPILER), $(notdir $(firstword $(CC)))) +# +# Temporary define for the Client; to be removed when binary release is used +# + ifdef MOZILLA_CLIENT + COMPILER_TAG = + else + COMPILER_TAG = _$(notdir $(firstword $(CC))) + endif + else + COMPILER_TAG = + endif +endif + +ifeq ($(MKPROG),) + MKPROG = $(CC) +endif + +# +# This makefile contains rules for building the following kinds of +# objects: +# - (1) LIBRARY: a static (archival) library +# - (2) SHARED_LIBRARY: a shared (dynamic link) library +# - (3) IMPORT_LIBRARY: an import library, defined in $(OS_TARGET).mk +# - (4) PROGRAM: an executable binary +# +# NOTE: The names of libraries can be generated by simply specifying +# LIBRARY_NAME (and LIBRARY_VERSION in the case of non-static libraries). +# LIBRARY and SHARED_LIBRARY may be defined differently in $(OS_TARGET).mk +# + +ifdef LIBRARY_NAME + ifndef LIBRARY + LIBRARY = $(OBJDIR)/$(LIB_PREFIX)$(LIBRARY_NAME).$(LIB_SUFFIX) + endif + ifndef SHARED_LIBRARY + SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(JDK_DEBUG_SUFFIX).$(DLL_SUFFIX) + endif + ifndef MAPFILE_SOURCE + MAPFILE_SOURCE = $(LIBRARY_NAME).def + endif +endif + +# +# Common rules used by lots of makefiles... +# + +ifdef PROGRAM + PROGRAM := $(addprefix $(OBJDIR)/, $(PROGRAM)$(JDK_DEBUG_SUFFIX)$(PROG_SUFFIX)) +endif + +ifdef PROGRAMS + PROGRAMS := $(addprefix $(OBJDIR)/, $(PROGRAMS:%=%$(JDK_DEBUG_SUFFIX)$(PROG_SUFFIX))) +endif + +ifndef TARGETS + TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) +endif + +ifndef OBJS + SIMPLE_OBJS = $(JRI_STUB_CFILES) \ + $(addsuffix $(OBJ_SUFFIX), $(JMC_GEN)) \ + $(CSRCS:.c=$(OBJ_SUFFIX)) \ + $(CPPSRCS:.cpp=$(OBJ_SUFFIX)) \ + $(ASFILES:$(ASM_SUFFIX)=$(OBJ_SUFFIX)) \ + $(BUILT_CSRCS:.c=$(OBJ_SUFFIX)) \ + $(BUILT_CPPSRCS:.cpp=$(OBJ_SUFFIX)) \ + $(BUILT_ASFILES:$(ASM_SUFFIX)=$(OBJ_SUFFIX)) + OBJS = $(addprefix $(OBJDIR)/$(PROG_PREFIX), $(SIMPLE_OBJS)) +endif + +ifndef BUILT_SRCS + BUILT_SRCS = $(addprefix $(OBJDIR)/$(PROG_PREFIX), \ + $(BUILT_CSRCS) $(BUILT_CPPSRCS) $(BUILT_ASFILES)) +endif + + +ifeq (,$(filter-out WIN%,$(OS_TARGET))) + MAKE_OBJDIR = $(INSTALL) -D $(OBJDIR) +else + define MAKE_OBJDIR + if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi + endef +endif + +ifndef PACKAGE + PACKAGE = . +endif + +ifdef NSBUILDROOT + JDK_GEN_DIR = $(SOURCE_XP_DIR)/_gen + JMC_GEN_DIR = $(SOURCE_XP_DIR)/_jmc + JNI_GEN_DIR = $(SOURCE_XP_DIR)/_jni + JRI_GEN_DIR = $(SOURCE_XP_DIR)/_jri + JDK_STUB_DIR = $(SOURCE_XP_DIR)/_stubs +else + JDK_GEN_DIR = _gen + JMC_GEN_DIR = _jmc + JNI_GEN_DIR = _jni + JRI_GEN_DIR = _jri + JDK_STUB_DIR = _stubs +endif + +ALL_TRASH = $(TARGETS) $(OBJS) $(OBJDIR) LOGS TAGS $(GARBAGE) \ + so_locations $(BUILT_SRCS) $(NOSUCHFILE) + +ifdef NS_USE_JDK + ALL_TRASH += $(JDK_HEADER_CFILES) $(JDK_STUB_CFILES) \ + $(JMC_HEADERS) $(JMC_STUBS) $(JMC_EXPORT_FILES) \ + $(JNI_HEADERS) \ + $(JRI_HEADER_CFILES) $(JRI_STUB_CFILES) \ + $(JDK_GEN_DIR) $(JMC_GEN_DIR) $(JNI_GEN_DIR) \ + $(JRI_GEN_DIR) $(JDK_STUB_DIR) + +ifdef JAVA_DESTPATH + ALL_TRASH += $(wildcard $(JAVA_DESTPATH)/$(PACKAGE)/*.class) +ifdef JDIRS + ALL_TRASH += $(addprefix $(JAVA_DESTPATH)/,$(JDIRS)) +endif +else # !JAVA_DESTPATH + ALL_TRASH += $(wildcard $(PACKAGE)/*.class) $(JDIRS) +endif + +endif #NS_USE_JDK + +ifdef NSS_BUILD_CONTINUE_ON_ERROR +# Try to build everything. I.e., don't exit on errors. + EXIT_ON_ERROR = +e + CLICK_STOPWATCH = date +else + EXIT_ON_ERROR = -e + CLICK_STOPWATCH = true +endif + +ifdef REQUIRES + MODULE_INCLUDES := $(addprefix -I$(SOURCE_XP_DIR)/public/, $(REQUIRES)) + INCLUDES += $(MODULE_INCLUDES) + ifeq ($(MODULE), sectools) + PRIVATE_INCLUDES := $(addprefix -I$(SOURCE_XP_DIR)/private/, $(REQUIRES)) + INCLUDES += $(PRIVATE_INCLUDES) + endif +endif + +ifdef SYSTEM_INCL_DIR + YOPT = -Y$(SYSTEM_INCL_DIR) +endif + +ifdef DIRS + LOOP_OVER_DIRS = \ + @for directory in $(DIRS); do \ + if test -d $$directory; then \ + set $(EXIT_ON_ERROR); \ + echo "cd $$directory; $(MAKE) $@"; \ + $(MAKE) -C $$directory $@; \ + set +e; \ + else \ + echo "Skipping non-directory $$directory..."; \ + fi; \ + $(CLICK_STOPWATCH); \ + done +endif + +MK_RULESET = included diff -Naur security/coreconf/rules.mk mozilla/security/coreconf/rules.mk --- a/security/coreconf/rules.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/rules.mk 2010-04-26 02:37:40.000000000 +0300 @@ -0,0 +1,994 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +####################################################################### +### ### +### R U L E S O F E N G A G E M E N T ### +### ### +####################################################################### + +####################################################################### +# Double-Colon rules for utilizing the binary release model. # +####################################################################### + +all:: export libs + +ifeq ($(AUTOCLEAN),1) +autobuild:: clean export private_export libs program install +else +autobuild:: export private_export libs program install +endif + +platform:: + @echo $(OBJDIR_NAME) + +ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) +USE_NT_C_SYNTAX=1 +endif + +# +# IMPORTS will always be associated with a component. Therefore, +# the "import" rule will always change directory to the top-level +# of a component, and traverse the IMPORTS keyword from the +# "manifest.mn" file located at this level only. +# +# note: if there is a trailing slash, the component will be appended +# (see import.pl - only used for xpheader.jar) + +import:: + @echo "== import.pl ==" + @$(PERL) -I$(CORE_DEPTH)/coreconf $(CORE_DEPTH)/coreconf/import.pl \ + "RELEASE_TREE=$(RELEASE_TREE)" \ + "IMPORTS=$(IMPORTS)" \ + "VERSION=$(VERSION)" \ + "OS_ARCH=$(OS_ARCH)" \ + "PLATFORM=$(PLATFORM)" \ + "OVERRIDE_IMPORT_CHECK=$(OVERRIDE_IMPORT_CHECK)" \ + "ALLOW_VERSION_OVERRIDE=$(ALLOW_VERSION_OVERRIDE)" \ + "SOURCE_RELEASE_PREFIX=$(SOURCE_RELEASE_XP_DIR)" \ + "SOURCE_MD_DIR=$(SOURCE_MD_DIR)" \ + "SOURCE_XP_DIR=$(SOURCE_XP_DIR)" \ + "FILES=$(IMPORT_XPCLASS_JAR) $(XPHEADER_JAR) $(MDHEADER_JAR) $(MDBINARY_JAR)" \ + "$(IMPORT_XPCLASS_JAR)=$(IMPORT_XP_DIR)|$(IMPORT_XPCLASS_DIR)|" \ + "$(XPHEADER_JAR)=$(IMPORT_XP_DIR)|$(SOURCE_XP_DIR)/public/|v" \ + "$(MDHEADER_JAR)=$(IMPORT_MD_DIR)|$(SOURCE_MD_DIR)/include|" \ + "$(MDBINARY_JAR)=$(IMPORT_MD_DIR)|$(SOURCE_MD_DIR)|" +# On Mac OS X ranlib needs to be rerun after static libs are moved. +ifeq ($(OS_TARGET),Darwin) + find $(SOURCE_MD_DIR)/lib -name "*.a" -exec $(RANLIB) {} \; +endif + +export:: + +$(LOOP_OVER_DIRS) + +private_export:: + +$(LOOP_OVER_DIRS) + +release_export:: + +$(LOOP_OVER_DIRS) + +release_classes:: + +$(LOOP_OVER_DIRS) + +libs program install:: $(TARGETS) +ifdef LIBRARY + $(INSTALL) -m 664 $(LIBRARY) $(SOURCE_LIB_DIR) +endif +ifdef SHARED_LIBRARY + $(INSTALL) -m 775 $(SHARED_LIBRARY) $(SOURCE_LIB_DIR) +ifdef MOZ_DEBUG_SYMBOLS +ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) + $(INSTALL) -m 644 $(SHARED_LIBRARY:$(DLL_SUFFIX)=pdb) $(SOURCE_LIB_DIR) +endif +endif +endif +ifdef IMPORT_LIBRARY + $(INSTALL) -m 775 $(IMPORT_LIBRARY) $(SOURCE_LIB_DIR) +endif +ifdef PROGRAM + $(INSTALL) -m 775 $(PROGRAM) $(SOURCE_BIN_DIR) +ifdef MOZ_DEBUG_SYMBOLS +ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) + $(INSTALL) -m 644 $(PROGRAM:$(PROG_SUFFIX)=.pdb) $(SOURCE_BIN_DIR) +endif +endif +endif +ifdef PROGRAMS + $(INSTALL) -m 775 $(PROGRAMS) $(SOURCE_BIN_DIR) +endif + +$(LOOP_OVER_DIRS) + +tests:: + +$(LOOP_OVER_DIRS) + +clean clobber:: + rm -rf $(ALL_TRASH) + +$(LOOP_OVER_DIRS) + +realclean clobber_all:: + rm -rf $(wildcard *.OBJ) dist $(ALL_TRASH) + +$(LOOP_OVER_DIRS) + +####################################################################### +# Double-Colon rules for populating the binary release model. # +####################################################################### + + +release_clean:: + rm -rf $(SOURCE_XP_DIR)/release/$(RELEASE_MD_DIR) + +release:: release_clean release_export release_classes release_policy release_md release_jars release_cpdistdir + +release_cpdistdir:: + @echo "== cpdist.pl ==" + @$(PERL) -I$(CORE_DEPTH)/coreconf $(CORE_DEPTH)/coreconf/cpdist.pl \ + "RELEASE_TREE=$(RELEASE_TREE)" \ + "CORE_DEPTH=$(CORE_DEPTH)" \ + "MODULE=${MODULE}" \ + "OS_ARCH=$(OS_ARCH)" \ + "RELEASE=$(RELEASE)" \ + "PLATFORM=$(PLATFORM)" \ + "RELEASE_VERSION=$(RELEASE_VERSION)" \ + "SOURCE_RELEASE_PREFIX=$(SOURCE_RELEASE_XP_DIR)" \ + "RELEASE_XP_DIR=$(RELEASE_XP_DIR)" \ + "RELEASE_MD_DIR=$(RELEASE_MD_DIR)" \ + "FILES=$(XPCLASS_JAR) $(XPCLASS_DBG_JAR) $(XPHEADER_JAR) $(MDHEADER_JAR) $(MDBINARY_JAR) XP_FILES MD_FILES" \ + "$(XPCLASS_JAR)=$(SOURCE_RELEASE_CLASSES_DIR)|x"\ + "$(XPCLASS_DBG_JAR)=$(SOURCE_RELEASE_CLASSES_DBG_DIR)|x"\ + "$(XPHEADER_JAR)=$(SOURCE_RELEASE_XPHEADERS_DIR)|x" \ + "$(MDHEADER_JAR)=$(SOURCE_RELEASE_MDHEADERS_DIR)|m" \ + "$(MDBINARY_JAR)=$(SOURCE_RELEASE_MD_DIR)|m" \ + "XP_FILES=$(XP_FILES)|xf" \ + "MD_FILES=$(MD_FILES)|mf" + + +# $(SOURCE_RELEASE_xxx_JAR) is a name like yyy.jar +# $(SOURCE_RELEASE_xx_DIR) is a name like + +release_jars:: + @echo "== release.pl ==" + @$(PERL) -I$(CORE_DEPTH)/coreconf $(CORE_DEPTH)/coreconf/release.pl \ + "RELEASE_TREE=$(RELEASE_TREE)" \ + "PLATFORM=$(PLATFORM)" \ + "OS_ARCH=$(OS_ARCH)" \ + "RELEASE_VERSION=$(RELEASE_VERSION)" \ + "SOURCE_RELEASE_DIR=$(SOURCE_RELEASE_DIR)" \ + "FILES=$(XPCLASS_JAR) $(XPCLASS_DBG_JAR) $(XPHEADER_JAR) $(MDHEADER_JAR) $(MDBINARY_JAR)" \ + "$(XPCLASS_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_CLASSES_DIR)|b"\ + "$(XPCLASS_DBG_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_CLASSES_DBG_DIR)|b"\ + "$(XPHEADER_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_XPHEADERS_DIR)|a" \ + "$(MDHEADER_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_MDHEADERS_DIR)|a" \ + "$(MDBINARY_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_MD_DIR)|bi" + +# Rules for releasing classes. +# We have to do some REALLY gross stuff to deal with multiple classes in one +# file, as well as nested classes, which have a filename of the form +# ContainingClass$NestedClass.class. +# RELEASE_CLASSES simply performs a required patsubst on CLASSES +# RELEASE_CLASS_PATH is RELEASE_CLASSES with the path (in ns/dist) prepended +# RELEASE_NESTED is all the nested classes in RELEASE_CLASS_PATH. We use a +# foreach and wildcard to get all the files that start out like one of the +# class files, then have a $. So, for each class file, we look for file$* +# RELEASE_FILES is the combination of RELEASE_NESTED and the class files +# specified by RELEASE_CLASSES which have .class appended to them. Note that +# the RELEASE_NESTED don't need to have .class appended because they were +# read in from the wildcard as complete filenames. +# +# The _DBG versions are the debuggable ones. +ifneq ($(CLASSES),) + +RELEASE_CLASSES := $(patsubst %,%,$(CLASSES)) + +ifdef BUILD_OPT + RELEASE_CLASS_PATH := $(patsubst %,$(SOURCE_CLASSES_DIR)/$(PACKAGE)/%, $(RELEASE_CLASSES)) + RELEASE_NESTED := $(foreach file,$(RELEASE_CLASS_PATH),$(wildcard $(file)$$*)) + RELEASE_FILES := $(patsubst %,%.class,$(RELEASE_CLASS_PATH)) $(RELEASE_NESTED) +else + RELEASE_DBG_CLASS_PATH:= $(patsubst %,$(SOURCE_CLASSES_DBG_DIR)/$(PACKAGE)/%, $(RELEASE_CLASSES)) + RELEASE_DBG_NESTED := $(foreach file,$(RELEASE_DBG_CLASS_PATH),$(wildcard $(file)$$*)) + RELEASE_DBG_FILES := $(patsubst %,%.class,$(RELEASE_DBG_CLASS_PATH)) $(RELEASE_DBG_NESTED) +endif + +# Substitute \$ for $ so the shell doesn't choke +ifdef BUILD_OPT +release_classes:: + $(INSTALL) -m 444 $(subst $$,\$$,$(RELEASE_FILES)) $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_CLASSES_DIR)/$(PACKAGE) +else +release_classes:: + $(INSTALL) -m 444 $(subst $$,\$$,$(RELEASE_DBG_FILES)) $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_CLASSES_DBG_DIR)/$(PACKAGE) +endif + +endif + +release_policy:: + +$(LOOP_OVER_DIRS) + +ifndef NO_MD_RELEASE + ifdef LIBRARY + MD_LIB_RELEASE_FILES += $(LIBRARY) + endif + ifdef SHARED_LIBRARY + MD_LIB_RELEASE_FILES += $(SHARED_LIBRARY) + endif + ifdef IMPORT_LIBRARY + MD_LIB_RELEASE_FILES += $(IMPORT_LIBRARY) + endif + ifdef PROGRAM + MD_BIN_RELEASE_FILES += $(PROGRAM) + endif + ifdef PROGRAMS + MD_BIN_RELEASE_FILES += $(PROGRAMS) + endif +endif + +release_md:: +ifneq ($(MD_LIB_RELEASE_FILES),) + $(INSTALL) -m 444 $(MD_LIB_RELEASE_FILES) $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR) +endif +ifneq ($(MD_BIN_RELEASE_FILES),) + $(INSTALL) -m 555 $(MD_BIN_RELEASE_FILES) $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_BIN_DIR) +endif + +$(LOOP_OVER_DIRS) + + +alltags: + rm -f TAGS + find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs etags -a + find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs ctags -a + +$(PROGRAM): $(OBJS) $(EXTRA_LIBS) + @$(MAKE_OBJDIR) +ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) + $(MKPROG) $(subst /,\\,$(OBJS)) -Fe$@ -link $(LDFLAGS) $(subst /,\\,$(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)) $(EXTRA_EXE_LD_FLAGS) +ifdef MT + if test -f $@.manifest; then \ + $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \ + rm -f $@.manifest; \ + fi +endif # MSVC with manifest tool +else + $(MKPROG) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) +endif + +get_objs: + @echo $(OBJS) + +$(LIBRARY): $(OBJS) + @$(MAKE_OBJDIR) + rm -f $@ +ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) + $(AR) $(subst /,\\,$(OBJS)) +else + $(AR) $(OBJS) +endif + $(RANLIB) $@ + + +ifeq ($(OS_TARGET),OS2) +$(IMPORT_LIBRARY): $(MAPFILE) + rm -f $@ + $(IMPLIB) $@ $< + $(RANLIB) $@ +endif + +ifdef SHARED_LIBRARY_LIBS +ifdef BUILD_TREE +SUB_SHLOBJS = $(foreach dir,$(SHARED_LIBRARY_DIRS),$(shell $(MAKE) -C $(dir) --no-print-directory get_objs)) +else +SUB_SHLOBJS = $(foreach dir,$(SHARED_LIBRARY_DIRS),$(addprefix $(dir)/,$(shell $(MAKE) -C $(dir) --no-print-directory get_objs))) +endif +endif + +$(SHARED_LIBRARY): $(OBJS) $(RES) $(MAPFILE) $(SUB_SHLOBJS) + @$(MAKE_OBJDIR) + rm -f $@ +ifeq ($(OS_TARGET)$(OS_RELEASE), AIX4.1) + echo "#!" > $(OBJDIR)/lib$(LIBRARY_NAME)_syms + nm -B -C -g $(OBJS) \ + | awk '/ [T,D] / {print $$3}' \ + | sed -e 's/^\.//' \ + | sort -u >> $(OBJDIR)/lib$(LIBRARY_NAME)_syms + $(LD) $(XCFLAGS) -o $@ $(OBJS) -bE:$(OBJDIR)/lib$(LIBRARY_NAME)_syms \ + -bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) +else +ifeq (,$(filter-out WIN%,$(OS_TARGET))) +ifdef NS_USE_GCC + $(LINK_DLL) $(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES) +else + $(LINK_DLL) -MAP $(DLLBASE) $(subst /,\\,$(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES)) +ifdef MT + if test -f $@.manifest; then \ + $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;2; \ + rm -f $@.manifest; \ + fi +endif # MSVC with manifest tool +endif +else + $(MKSHLIB) -o $@ $(OBJS) $(SUB_SHLOBJS) $(LD_LIBS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) + chmod +x $@ +ifeq ($(OS_TARGET),Darwin) +ifdef MAPFILE + nmedit -s $(MAPFILE) $@ +endif +endif +endif +endif + +ifeq (,$(filter-out WIN%,$(OS_TARGET))) +$(RES): $(RESNAME) + @$(MAKE_OBJDIR) +# The resource compiler does not understand the -U option. +ifdef NS_USE_GCC + $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $< +else + $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $< +endif + @echo $(RES) finished +endif + +$(MAPFILE): $(MAPFILE_SOURCE) + @$(MAKE_OBJDIR) + $(PROCESS_MAP_FILE) + + +$(OBJDIR)/$(PROG_PREFIX)%$(PROG_SUFFIX): $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX) + @$(MAKE_OBJDIR) +ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) + $(MKPROG) $< -Fe$@ -link \ + $(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(EXTRA_EXE_LD_FLAGS) +ifdef MT + if test -f $@.manifest; then \ + $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \ + rm -f $@.manifest; \ + fi +endif # MSVC with manifest tool +else + $(MKPROG) -o $@ $(CFLAGS) $< \ + $(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) +endif + +WCCFLAGS1 := $(subst /,\\,$(CFLAGS)) +WCCFLAGS2 := $(subst -I,-i=,$(WCCFLAGS1)) +WCCFLAGS3 := $(subst -D,-d,$(WCCFLAGS2)) + +# Translate source filenames to absolute paths. This is required for +# debuggers under Windows & OS/2 to find source files automatically + +ifeq (,$(filter-out OS2 AIX,$(OS_TARGET))) +# OS/2 and AIX +NEED_ABSOLUTE_PATH := 1 +PWD := $(shell pwd) + +else +# Windows +ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) +NEED_ABSOLUTE_PATH := 1 +PWD := $(shell pwd) +ifeq (,$(findstring ;,$(PATH))) +ifndef USE_MSYS +PWD := $(subst \,/,$(shell cygpath -w $(PWD))) +endif +endif + +else +# everything else +PWD := $(shell pwd) +endif +endif + +# The quotes allow absolute paths to contain spaces. +core_abspath = "$(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))" + +$(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c + @$(MAKE_OBJDIR) +ifdef USE_NT_C_SYNTAX + $(CC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<) +else +ifdef NEED_ABSOLUTE_PATH + $(CC) -o $@ -c $(CFLAGS) $(call core_abspath,$<) +else + $(CC) -o $@ -c $(CFLAGS) $< +endif +endif + +$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c +ifdef USE_NT_C_SYNTAX + $(CC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<) +else +ifdef NEED_ABSOLUTE_PATH + $(CC) -o $@ -c $(CFLAGS) $(call core_abspath,$<) +else + $(CC) -o $@ -c $(CFLAGS) $< +endif +endif + +ifneq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) +$(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.s + @$(MAKE_OBJDIR) + $(AS) -o $@ $(ASFLAGS) -c $< +endif + +$(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.asm + @$(MAKE_OBJDIR) + $(AS) -Fo$@ $(ASFLAGS) -c $< + +$(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.S + @$(MAKE_OBJDIR) + $(AS) -o $@ $(ASFLAGS) -c $< + +$(OBJDIR)/$(PROG_PREFIX)%: %.cpp + @$(MAKE_OBJDIR) +ifdef USE_NT_C_SYNTAX + $(CCC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<) +else +ifdef NEED_ABSOLUTE_PATH + $(CCC) -o $@ -c $(CFLAGS) $(call core_abspath,$<) +else + $(CCC) -o $@ -c $(CFLAGS) $< +endif +endif + +# +# Please keep the next two rules in sync. +# +$(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.cc + @$(MAKE_OBJDIR) + $(CCC) -o $@ -c $(CFLAGS) $< + +$(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.cpp + @$(MAKE_OBJDIR) +ifdef STRICT_CPLUSPLUS_SUFFIX + echo "#line 1 \"$<\"" | cat - $< > $(OBJDIR)/t_$*.cc + $(CCC) -o $@ -c $(CFLAGS) $(OBJDIR)/t_$*.cc + rm -f $(OBJDIR)/t_$*.cc +else +ifdef USE_NT_C_SYNTAX + $(CCC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<) +else +ifdef NEED_ABSOLUTE_PATH + $(CCC) -o $@ -c $(CFLAGS) $(call core_abspath,$<) +else + $(CCC) -o $@ -c $(CFLAGS) $< +endif +endif +endif #STRICT_CPLUSPLUS_SUFFIX + +%.i: %.cpp + $(CCC) -C -E $(CFLAGS) $< > $@ + +%.i: %.c +ifeq (,$(filter-out WIN%,$(OS_TARGET))) + $(CC) -C /P $(CFLAGS) $< +else + $(CC) -C -E $(CFLAGS) $< > $@ +endif + +ifneq (,$(filter-out WIN%,$(OS_TARGET))) +%.i: %.s + $(CC) -C -E $(CFLAGS) $< > $@ +endif + +%: %.pl + rm -f $@; cp $< $@; chmod +x $@ + +%: %.sh + rm -f $@; cp $< $@; chmod +x $@ + +ifdef DIRS +$(DIRS):: + @if test -d $@; then \ + set $(EXIT_ON_ERROR); \ + echo "cd $@; $(MAKE)"; \ + cd $@; $(MAKE); \ + set +e; \ + else \ + echo "Skipping non-directory $@..."; \ + fi; \ + $(CLICK_STOPWATCH) +endif + +################################################################################ +# Bunch of things that extend the 'export' rule (in order): +################################################################################ + +$(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) $(JMCSRCDIR):: + @if test ! -d $@; then \ + echo Creating $@; \ + rm -rf $@; \ + $(NSINSTALL) -D $@; \ + fi + +################################################################################ +## IDL_GEN + +ifneq ($(IDL_GEN),) + +#export:: +# $(IDL2JAVA) $(IDL_GEN) + +#all:: export + +#clobber:: +# rm -f $(IDL_GEN:.idl=.class) # XXX wrong! + +endif + +################################################################################ +### JSRCS -- for compiling java files +### +### NOTE: For backwards compatibility, if $(NETLIBDEPTH) is defined, +### replace $(CORE_DEPTH) with $(NETLIBDEPTH). +### + +ifneq ($(JSRCS),) +ifneq ($(JAVAC),) +ifdef NETLIBDEPTH + CORE_DEPTH := $(NETLIBDEPTH) +endif + +JAVA_EXPORT_SRCS=$(shell $(PERL) $(CORE_DEPTH)/coreconf/outofdate.pl $(PERLARG) -d $(JAVA_DESTPATH)/$(PACKAGE) $(JSRCS) $(PRIVATE_JSRCS)) + +export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) +ifneq ($(JAVA_EXPORT_SRCS),) + $(JAVAC) $(JAVA_EXPORT_SRCS) +endif + +all:: export + +clobber:: + rm -f $(SOURCE_XP_DIR)/classes/$(PACKAGE)/*.class + +endif +endif + +# +# JDIRS -- like JSRCS, except you can give a list of directories and it will +# compile all the out-of-date java files in those directories. +# +# NOTE: recursing through these can speed things up, but they also cause +# some builds to run out of memory +# +# NOTE: For backwards compatibility, if $(NETLIBDEPTH) is defined, +# replace $(CORE_DEPTH) with $(NETLIBDEPTH). +# +ifdef JDIRS +ifneq ($(JAVAC),) +ifdef NETLIBDEPTH + CORE_DEPTH := $(NETLIBDEPTH) +endif + +# !!!!! THIS WILL CRASH SHMSDOS.EXE !!!!! +# shmsdos does not support shell variables. It will crash when it tries +# to parse the '=' character. A solution is to rewrite outofdate.pl so it +# takes the Javac command as an argument and executes the command itself, +# instead of returning a list of files. +export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) + @echo "!!! THIS COMMAND IS BROKEN ON WINDOWS--SEE rules.mk FOR DETAILS !!!" + return -1 + @for d in $(JDIRS); do \ + if test -d $$d; then \ + set $(EXIT_ON_ERROR); \ + files=`echo $$d/*.java`; \ + list=`$(PERL) $(CORE_DEPTH)/coreconf/outofdate.pl $(PERLARG) \ + -d $(JAVA_DESTPATH)/$(PACKAGE) $$files`; \ + if test "$${list}x" != "x"; then \ + echo Building all java files in $$d; \ + echo $(JAVAC) $$list; \ + $(JAVAC) $$list; \ + fi; \ + set +e; \ + else \ + echo "Skipping non-directory $$d..."; \ + fi; \ + $(CLICK_STOPWATCH); \ + done +endif +endif + +# +# JDK_GEN -- for generating "old style" native methods +# +# Generate JDK Headers and Stubs into the '_gen' and '_stubs' directory +# +# NOTE: For backwards compatibility, if $(NETLIBDEPTH) is defined, +# replace $(CORE_DEPTH) with $(NETLIBDEPTH). +# +ifneq ($(JDK_GEN),) +ifneq ($(JAVAH),) +ifdef NSBUILDROOT + INCLUDES += -I$(JDK_GEN_DIR) -I$(SOURCE_XP_DIR) +else + INCLUDES += -I$(JDK_GEN_DIR) +endif + +ifdef NETLIBDEPTH + CORE_DEPTH := $(NETLIBDEPTH) +endif + +JDK_PACKAGE_CLASSES := $(JDK_GEN) +JDK_PATH_CLASSES := $(subst .,/,$(JDK_PACKAGE_CLASSES)) +JDK_HEADER_CLASSFILES := $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JDK_PATH_CLASSES)) +JDK_STUB_CLASSFILES := $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JDK_PATH_CLASSES)) +JDK_HEADER_CFILES := $(patsubst %,$(JDK_GEN_DIR)/%.h,$(JDK_GEN)) +JDK_STUB_CFILES := $(patsubst %,$(JDK_STUB_DIR)/%.c,$(JDK_GEN)) + +$(JDK_HEADER_CFILES): $(JDK_HEADER_CLASSFILES) +$(JDK_STUB_CFILES): $(JDK_STUB_CLASSFILES) + +export:: + @echo Generating/Updating JDK headers + $(JAVAH) -d $(JDK_GEN_DIR) $(JDK_PACKAGE_CLASSES) + @echo Generating/Updating JDK stubs + $(JAVAH) -stubs -d $(JDK_STUB_DIR) $(JDK_PACKAGE_CLASSES) +ifndef NO_MAC_JAVA_SHIT + @if test ! -d $(CORE_DEPTH)/lib/mac/Java/; then \ + echo "!!! You need to have a ns/lib/mac/Java directory checked out."; \ + echo "!!! This allows us to automatically update generated files for the mac."; \ + echo "!!! If you see any modified files there, please check them in."; \ + fi + @echo Generating/Updating JDK headers for the Mac + $(JAVAH) -mac -d $(CORE_DEPTH)/lib/mac/Java/_gen $(JDK_PACKAGE_CLASSES) + @echo Generating/Updating JDK stubs for the Mac + $(JAVAH) -mac -stubs -d $(CORE_DEPTH)/lib/mac/Java/_stubs $(JDK_PACKAGE_CLASSES) +endif +endif +endif + +# +# JRI_GEN -- for generating "old style" JRI native methods +# +# Generate JRI Headers and Stubs into the 'jri' directory +# +# NOTE: For backwards compatibility, if $(NETLIBDEPTH) is defined, +# replace $(CORE_DEPTH) with $(NETLIBDEPTH). +# +ifneq ($(JRI_GEN),) +ifneq ($(JAVAH),) +ifdef NSBUILDROOT + INCLUDES += -I$(JRI_GEN_DIR) -I$(SOURCE_XP_DIR) +else + INCLUDES += -I$(JRI_GEN_DIR) +endif + +ifdef NETLIBDEPTH + CORE_DEPTH := $(NETLIBDEPTH) +endif + +JRI_PACKAGE_CLASSES := $(JRI_GEN) +JRI_PATH_CLASSES := $(subst .,/,$(JRI_PACKAGE_CLASSES)) +JRI_HEADER_CLASSFILES := $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JRI_PATH_CLASSES)) +JRI_STUB_CLASSFILES := $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JRI_PATH_CLASSES)) +JRI_HEADER_CFILES := $(patsubst %,$(JRI_GEN_DIR)/%.h,$(JRI_GEN)) +JRI_STUB_CFILES := $(patsubst %,$(JRI_GEN_DIR)/%.c,$(JRI_GEN)) + +$(JRI_HEADER_CFILES): $(JRI_HEADER_CLASSFILES) +$(JRI_STUB_CFILES): $(JRI_STUB_CLASSFILES) + +export:: + @echo Generating/Updating JRI headers + $(JAVAH) -jri -d $(JRI_GEN_DIR) $(JRI_PACKAGE_CLASSES) + @echo Generating/Updating JRI stubs + $(JAVAH) -jri -stubs -d $(JRI_GEN_DIR) $(JRI_PACKAGE_CLASSES) +ifndef NO_MAC_JAVA_SHIT + @if test ! -d $(CORE_DEPTH)/lib/mac/Java/; then \ + echo "!!! You need to have a ns/lib/mac/Java directory checked out."; \ + echo "!!! This allows us to automatically update generated files for the mac."; \ + echo "!!! If you see any modified files there, please check them in."; \ + fi + @echo Generating/Updating JRI headers for the Mac + $(JAVAH) -jri -mac -d $(CORE_DEPTH)/lib/mac/Java/_jri $(JRI_PACKAGE_CLASSES) + @echo Generating/Updating JRI stubs for the Mac + $(JAVAH) -jri -mac -stubs -d $(CORE_DEPTH)/lib/mac/Java/_jri $(JRI_PACKAGE_CLASSES) +endif +endif +endif + +# +# JNI_GEN -- for generating JNI native methods +# +# Generate JNI Headers into the 'jni' directory +# +ifneq ($(JNI_GEN),) +ifneq ($(JAVAH),) +JNI_HEADERS := $(patsubst %,$(JNI_GEN_DIR)/%.h,$(JNI_GEN)) + +export:: + @if test ! -d $(JNI_GEN_DIR); then \ + echo $(JAVAH) -jni -d $(JNI_GEN_DIR) $(JNI_GEN); \ + $(JAVAH) -jni -d $(JNI_GEN_DIR) $(JNI_GEN); \ + else \ + echo "Checking for out of date header files" ; \ + $(PERL) $(CORE_DEPTH)/coreconf/jniregen.pl $(PERLARG) \ + -d $(JAVA_DESTPATH) -j "$(JAVAH) -jni -d $(JNI_GEN_DIR)" $(JNI_GEN);\ + fi +endif +endif + +# +# JMC_EXPORT -- for declaring which java classes are to be exported for jmc +# +ifneq ($(JMC_EXPORT),) +JMC_EXPORT_PATHS := $(subst .,/,$(JMC_EXPORT)) +JMC_EXPORT_FILES := $(patsubst %,$(JAVA_DESTPATH)/$(PACKAGE)/%.class,$(JMC_EXPORT_PATHS)) + +# +# We're doing NSINSTALL -t here (copy mode) because calling INSTALL will pick up +# your NSDISTMODE and make links relative to the current directory. This is a +# problem because the source isn't in the current directory: +# +export:: $(JMC_EXPORT_FILES) $(JMCSRCDIR) + $(NSINSTALL) -t -m 444 $(JMC_EXPORT_FILES) $(JMCSRCDIR) +endif + +# +# JMC_GEN -- for generating java modules +# +# Provide default export & install rules when using JMC_GEN +# +ifneq ($(JMC_GEN),) +ifneq ($(JMC),) + INCLUDES += -I$(JMC_GEN_DIR) -I. + JMC_HEADERS := $(patsubst %,$(JMC_GEN_DIR)/%.h,$(JMC_GEN)) + JMC_STUBS := $(patsubst %,$(JMC_GEN_DIR)/%.c,$(JMC_GEN)) + JMC_OBJS := $(patsubst %,$(OBJDIR)/%$(OBJ_SUFFIX),$(JMC_GEN)) + +$(JMC_GEN_DIR)/M%.h: $(JMCSRCDIR)/%.class + $(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=) + +$(JMC_GEN_DIR)/M%.c: $(JMCSRCDIR)/%.class + $(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=) + +$(OBJDIR)/M%$(OBJ_SUFFIX): $(JMC_GEN_DIR)/M%.c $(JMC_GEN_DIR)/M%.h + @$(MAKE_OBJDIR) + $(CC) -o $@ -c $(CFLAGS) $< + +export:: $(JMC_HEADERS) $(JMC_STUBS) +endif +endif + +# +# Copy each element of EXPORTS to $(SOURCE_XP_DIR)/public/$(MODULE)/ +# +PUBLIC_EXPORT_DIR = $(SOURCE_XP_DIR)/public/$(MODULE) + +ifneq ($(EXPORTS),) +$(PUBLIC_EXPORT_DIR):: + @if test ! -d $@; then \ + echo Creating $@; \ + $(NSINSTALL) -D $@; \ + fi + +export:: $(PUBLIC_EXPORT_DIR) + +export:: $(EXPORTS) + $(INSTALL) -m 444 $^ $(PUBLIC_EXPORT_DIR) + +export:: $(BUILT_SRCS) +endif + +# Duplicate export rule for private exports, with different directories + +PRIVATE_EXPORT_DIR = $(SOURCE_XP_DIR)/private/$(MODULE) + +ifneq ($(PRIVATE_EXPORTS),) +$(PRIVATE_EXPORT_DIR):: + @if test ! -d $@; then \ + echo Creating $@; \ + $(NSINSTALL) -D $@; \ + fi + +private_export:: $(PRIVATE_EXPORT_DIR) + +private_export:: $(PRIVATE_EXPORTS) + $(INSTALL) -m 444 $^ $(PRIVATE_EXPORT_DIR) +else +private_export:: + @echo There are no private exports.; +endif + +########################################################################## +### RULES FOR RUNNING REGRESSION SUITE TESTS +### REQUIRES 'REGRESSION_SPEC' TO BE SET TO THE NAME OF A REGRESSION SPECFILE +### AND RESULTS_SUBDIR TO BE SET TO SOMETHING LIKE SECURITY/PKCS5 +########################################################################## + +TESTS_DIR = $(RESULTS_DIR)/$(RESULTS_SUBDIR)/$(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(IMPL_STRATEGY) + +ifneq ($(REGRESSION_SPEC),) + +ifneq ($(BUILD_OPT),) +REGDATE = $(subst \ ,, $(shell $(PERL) $(CORE_DEPTH)/$(MODULE)/scripts/now)) +endif + +tests:: $(REGRESSION_SPEC) + cd $(PLATFORM); \ + ../$(SOURCE_MD_DIR)/bin/regress$(PROG_SUFFIX) specfile=../$(REGRESSION_SPEC) progress $(EXTRA_REGRESS_OPTIONS); \ + if test ! -d $(TESTS_DIR); then \ + echo Creating $(TESTS_DIR); \ + $(NSINSTALL) -D $(TESTS_DIR); \ + fi +ifneq ($(BUILD_OPT),) + $(NSINSTALL) -m 664 $(PLATFORM)/$(REGDATE).sum $(TESTS_DIR); \ + $(NSINSTALL) -m 664 $(PLATFORM)/$(REGDATE).htm $(TESTS_DIR); \ + echo "Please now make sure your results files are copied to $(TESTS_DIR), "; \ + echo "then run 'reporter specfile=$(RESULTS_DIR)/rptspec'" +endif +else +tests:: + @echo Error: you didn't specify REGRESSION_SPEC in your manifest.mn file!; +endif + + +# Duplicate export rule for releases, with different directories + +ifneq ($(EXPORTS),) +$(SOURCE_RELEASE_XP_DIR)/include:: + @if test ! -d $@; then \ + echo Creating $@; \ + $(NSINSTALL) -D $@; \ + fi + +release_export:: $(SOURCE_RELEASE_XP_DIR)/include + +release_export:: $(EXPORTS) + $(INSTALL) -m 444 $^ $(SOURCE_RELEASE_XP_DIR)/include +endif + + + + +################################################################################ + +-include $(DEPENDENCIES) + +ifneq (,$(filter-out OS2 WIN%,$(OS_TARGET))) +# Can't use sed because of its 4000-char line length limit, so resort to perl +PERL_DEPENDENCIES_PROGRAM = \ + open(MD, "< $(DEPENDENCIES)"); \ + while () { \ + if (m@ \.*/*$< @) { \ + $$found = 1; \ + last; \ + } \ + } \ + if ($$found) { \ + print "Removing stale dependency $< from $(DEPENDENCIES)\n"; \ + seek(MD, 0, 0); \ + $$tmpname = "$(OBJDIR)/fix.md" . $$$$; \ + open(TMD, "> " . $$tmpname); \ + while () { \ + s@ \.*/*$< @ @; \ + if (!print TMD "$$_") { \ + unlink(($$tmpname)); \ + exit(1); \ + } \ + } \ + close(TMD); \ + if (!rename($$tmpname, "$(DEPENDENCIES)")) { \ + unlink(($$tmpname)); \ + } \ + } elsif ("$<" ne "$(DEPENDENCIES)") { \ + print "$(MAKE): *** No rule to make target $<. Stop.\n"; \ + exit(1); \ + } + +.DEFAULT: + @$(PERL) -e '$(PERL_DEPENDENCIES_PROGRAM)' +endif + +############################################################################# +# X dependency system +############################################################################# + +ifdef MKDEPENDENCIES + +# For Windows, $(MKDEPENDENCIES) must be -included before including rules.mk + +$(MKDEPENDENCIES):: + @$(MAKE_OBJDIR) + touch $(MKDEPENDENCIES) + chmod u+w $(MKDEPENDENCIES) +#on NT, the preceding touch command creates a read-only file !?!?! +#which is why we have to explicitly chmod it. + $(MKDEPEND) -p$(OBJDIR_NAME)/ -o'$(OBJ_SUFFIX)' -f$(MKDEPENDENCIES) \ +$(NOMD_CFLAGS) $(YOPT) $(CSRCS) $(CPPSRCS) $(ASFILES) + +$(MKDEPEND):: $(MKDEPEND_DIR)/*.c $(MKDEPEND_DIR)/*.h + cd $(MKDEPEND_DIR); $(MAKE) + +ifdef OBJS +depend:: $(MKDEPEND) $(MKDEPENDENCIES) +else +depend:: +endif + +$(LOOP_OVER_DIRS) + +dependclean:: + rm -f $(MKDEPENDENCIES) + +$(LOOP_OVER_DIRS) + +#-include $(NSINSTALL_DIR)/$(OBJDIR)/depend.mk + +else +depend:: +endif + +# +# HACK ALERT +# +# The only purpose of this rule is to pass Mozilla's Tinderbox depend +# builds (http://tinderbox.mozilla.org/showbuilds.cgi). Mozilla's +# Tinderbox builds NSS continuously as part of the Mozilla client. +# Because NSS's make depend is not implemented, whenever we change +# an NSS header file, the depend build does not recompile the NSS +# files that depend on the header. +# +# This rule makes all the objects depend on a dummy header file. +# Check in a change to this dummy header file to force the depend +# build to recompile everything. +# +# This rule should be removed when make depend is implemented. +# + +DUMMY_DEPEND = $(CORE_DEPTH)/coreconf/coreconf.dep + +$(filter $(OBJDIR)/%$(OBJ_SUFFIX),$(OBJS)): $(OBJDIR)/%$(OBJ_SUFFIX): $(DUMMY_DEPEND) + +# END OF HACK + +################################################################################ +# Special gmake rules. +################################################################################ + +# +# Re-define the list of default suffixes, so gmake won't have to churn through +# hundreds of built-in suffix rules for stuff we don't need. +# +.SUFFIXES: +.SUFFIXES: .out .a .ln .o .obj .c .cc .C .cpp .y .l .s .S .h .sh .i .pl .class .java .html .asm .dep + +# +# Don't delete these files if we get killed. +# +.PRECIOUS: .java $(JDK_HEADERS) $(JDK_STUBS) $(JRI_HEADERS) $(JRI_STUBS) $(JMC_HEADERS) $(JMC_STUBS) $(JNI_HEADERS) + +# +# Fake targets. Always run these rules, even if a file/directory with that +# name already exists. +# +.PHONY: all all_platforms alltags boot clean clobber clobber_all export install libs program realclean release $(OBJDIR) $(DIRS) + diff -Naur security/coreconf/SCOOS5.0.mk mozilla/security/coreconf/SCOOS5.0.mk --- a/security/coreconf/SCOOS5.0.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SCOOS5.0.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,38 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/SCO_SV3.2.mk diff -Naur security/coreconf/SCO_SV3.2.mk mozilla/security/coreconf/SCO_SV3.2.mk --- a/security/coreconf/SCO_SV3.2.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SCO_SV3.2.mk 2009-09-03 07:57:00.000000000 +0300 @@ -0,0 +1,92 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DEFAULT_COMPILER = cc + +CC = cc +OS_CFLAGS += -b elf -KPIC +CCC = g++ +CCC += -b elf -DPRFSTREAMS_BROKEN -I/usr/local/lib/g++-include +# CCC = $(CORE_DEPTH)/build/hcpp +# CCC += +.cpp +w +RANLIB = /bin/true + +# +# -DSCO_PM - Policy Manager AKA: SCO Licensing +# -DSCO - Changes to Netscape source (consistent with AIX, LINUX, etc..) +# -Dsco - Needed for /usr/include/X11/* +# +OS_CFLAGS += -DSCO_SV -DSYSV -D_SVID3 -DHAVE_STRERROR -DSW_THREADS -DSCO_PM -DSCO -Dsco +#OS_LIBS += -lpmapi -lsocket -lc +MKSHLIB = $(LD) +MKSHLIB += $(DSO_LDOPTS) +XINC = /usr/include/X11 +MOTIFLIB += -lXm +INCLUDES += -I$(XINC) +CPU_ARCH = x86 +GFX_ARCH = x +ARCH = sco +LOCALE_MAP = $(CORE_DEPTH)/cmd/xfe/intl/sco.lm +EN_LOCALE = C +DE_LOCALE = de_DE.ISO8859-1 +FR_LOCALE = fr_FR.ISO8859-1 +JP_LOCALE = ja +SJIS_LOCALE = ja_JP.SJIS +KR_LOCALE = ko_KR.EUC +CN_LOCALE = zh +TW_LOCALE = zh +I2_LOCALE = i2 +LOC_LIB_DIR = /usr/lib/X11 +NOSUCHFILE = /solaris-rm-f-sucks +BSDECHO = /bin/echo +ifdef MAPFILE +# Add LD options to restrict exported symbols to those in the map file +endif +# Change PROCESS to put the mapfile in the correct format for this platform +PROCESS_MAP_FILE = cp $< $@ + +# +# These defines are for building unix plugins +# +BUILD_UNIX_PLUGINS = 1 +#DSO_LDOPTS += -b elf -G -z defs +DSO_LDOPTS += -b elf -G + +# Used for Java compiler +EXPORT_FLAGS += -W l,-Bexport diff -Naur security/coreconf/source.mk mozilla/security/coreconf/source.mk --- a/security/coreconf/source.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/source.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,194 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +####################################################################### +# Master -specific source import/export directories # +####################################################################### + +# +# master import/export directory prefix +# + +ifndef SOURCE_PREFIX + ifndef BUILD_TREE + SOURCE_PREFIX = $(CORE_DEPTH)/../dist + else + SOURCE_PREFIX = $(BUILD_TREE)/dist + endif +endif + +# +# cross-platform (xp) master import/export directory +# + +ifndef SOURCE_XP_DIR + SOURCE_XP_DIR = $(SOURCE_PREFIX) +endif + +# +# cross-platform (xp) import/export directories +# + +SOURCE_CLASSES_DIR = $(SOURCE_XP_DIR)/classes +SOURCE_CLASSES_DBG_DIR = $(SOURCE_XP_DIR)/classes_DBG +SOURCE_XPHEADERS_DIR = $(SOURCE_XP_DIR)/public/$(MODULE) +SOURCE_XPPRIVATE_DIR = $(SOURCE_XP_DIR)/private/$(MODULE) + +ifdef BUILD_OPT + IMPORT_XPCLASS_DIR = $(SOURCE_CLASSES_DIR) +else + IMPORT_XPCLASS_DIR = $(SOURCE_CLASSES_DBG_DIR) +endif + +# +# machine-dependent (md) master import/export directory +# + +ifndef SOURCE_MD_DIR + SOURCE_MD_DIR = $(SOURCE_PREFIX)/$(PLATFORM) +endif + +# +# machine-dependent (md) import/export directories +# + +#This is where we install built executables and (for Windows only) DLLs. +ifndef SOURCE_BIN_DIR + SOURCE_BIN_DIR = $(SOURCE_MD_DIR)/bin +endif + +#This is where we install built libraries (.a, .so, .lib). +ifndef SOURCE_LIB_DIR + SOURCE_LIB_DIR = $(SOURCE_MD_DIR)/lib +endif + +# This is where NSPR header files are found. +ifndef SOURCE_MDHEADERS_DIR + SOURCE_MDHEADERS_DIR = $(SOURCE_MD_DIR)/include +endif + +####################################################################### +# Master -specific source release directories and files # +####################################################################### + +# +# source-side master release directory prefix +# NOTE: export control policy enforced for XP and MD files released to +# the staging area +# + +ifeq ($(POLICY), domestic) + SOURCE_RELEASE_PREFIX = $(SOURCE_PREFIX)/release/domestic +else + ifeq ($(POLICY), export) + SOURCE_RELEASE_PREFIX = $(SOURCE_PREFIX)/release/export + else + ifeq ($(POLICY), france) + SOURCE_RELEASE_PREFIX = $(SOURCE_PREFIX)/release/france + else +#We shouldn't have to put another directory under here, but without it the perl +#script for releasing doesn't find the directory. It thinks it doesn't exist. +#So we're adding this no-policy directory so that the script for releasing works +#in all casese when policy is not set. This doesn't affect where the final jar +#files land, only where they are placed in the local tree when building the jar +#files. When there is no policy, the jar files will still land in +#/// like they used to. + SOURCE_RELEASE_PREFIX = $(SOURCE_PREFIX)/release/no-policy + endif + endif +endif + +# +# cross-platform (xp) source-side master release directory +# + +SOURCE_RELEASE_XP_DIR = $(SOURCE_RELEASE_PREFIX) + +# +# cross-platform (xp) source-side release directories +# + +SOURCE_RELEASE_CLASSES_DIR = classes +SOURCE_RELEASE_CLASSES_DBG_DIR = classes_DBG +SOURCE_RELEASE_XPHEADERS_DIR = include + +# +# cross-platform (xp) JAR source-side release files +# + +XPCLASS_JAR = xpclass.jar +XPCLASS_DBG_JAR = xpclass_dbg.jar +XPHEADER_JAR = xpheader.jar + +ifdef BUILD_OPT + SOURCE_RELEASE_XP_CLASSES_DIR = $(SOURCE_RELEASE_CLASSES_DIR) + IMPORT_XPCLASS_JAR = $(XPCLASS_JAR) +else + SOURCE_RELEASE_XP_CLASSES_DIR = $(SOURCE_RELEASE_CLASSES_DBG_DIR) + IMPORT_XPCLASS_JAR = $(XPCLASS_DBG_JAR) +endif + +# +# machine-dependent (md) source-side master release directory +# + +SOURCE_RELEASE_MD_DIR = $(PLATFORM) + +# +# machine-dependent (md) source-side release directories +# + +SOURCE_RELEASE_BIN_DIR = $(PLATFORM)/bin +SOURCE_RELEASE_LIB_DIR = $(PLATFORM)/lib +SOURCE_RELEASE_MDHEADERS_DIR = $(PLATFORM)/include +SOURCE_RELEASE_SPEC_DIR = $(SOURCE_RELEASE_MD_DIR) + +# +# machine-dependent (md) JAR/tar source-side release files +# + +MDBINARY_JAR = mdbinary.jar +MDHEADER_JAR = mdheader.jar + + +# Where to put the results + +ifneq ($(RESULTS_DIR),) + RESULTS_DIR = $(RELEASE_TREE)/sectools/results +endif + +MK_SOURCE = included diff -Naur security/coreconf/suffix.mk mozilla/security/coreconf/suffix.mk --- a/security/coreconf/suffix.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/suffix.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,99 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +####################################################################### +# Master "Core Components" suffixes # +####################################################################### + +# +# Object suffixes (OS2 and WIN% override this) +# +ifndef OBJ_SUFFIX + OBJ_SUFFIX = .o +endif + +# +# Assembler source suffixes (OS2 and WIN% override this) +# +ifndef ASM_SUFFIX + ASM_SUFFIX = .s +endif + +# +# Library suffixes +# +STATIC_LIB_EXTENSION = + +ifndef DYNAMIC_LIB_EXTENSION + DYNAMIC_LIB_EXTENSION = +endif + + +ifndef STATIC_LIB_SUFFIX + STATIC_LIB_SUFFIX = .$(LIB_SUFFIX) +endif + + +ifndef DYNAMIC_LIB_SUFFIX + DYNAMIC_LIB_SUFFIX = .$(DLL_SUFFIX) +endif + +# WIN% overridese this +ifndef IMPORT_LIB_SUFFIX + IMPORT_LIB_SUFFIX = +endif + + +ifndef STATIC_LIB_SUFFIX_FOR_LINKING + STATIC_LIB_SUFFIX_FOR_LINKING = $(STATIC_LIB_SUFFIX) +endif + + +# WIN% overridese this +ifndef DYNAMIC_LIB_SUFFIX_FOR_LINKING + DYNAMIC_LIB_SUFFIX_FOR_LINKING = $(DYNAMIC_LIB_SUFFIX) +endif + +# +# Program suffixes (OS2 and WIN% override this) +# + +ifndef PROG_SUFFIX + PROG_SUFFIX = +endif + +MK_SUFFIX = included diff -Naur security/coreconf/SunOS4.1.3_U1.mk mozilla/security/coreconf/SunOS4.1.3_U1.mk --- a/security/coreconf/SunOS4.1.3_U1.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS4.1.3_U1.mk 2007-11-22 06:39:56.000000000 +0200 @@ -0,0 +1,60 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DEFAULT_COMPILER = cc + +INCLUDES += -I/usr/dt/include -I/usr/openwin/include -I/home/motif/usr/include + +# SunOS 4 _requires_ that shared libs have a version number. +# XXX FIXME: Version number should use NSPR_VERSION_NUMBER? +DLL_SUFFIX = so.1.0 +CC = gcc +RANLIB = ranlib +CPU_ARCH = sparc + +# Purify doesn't like -MDupdate +NOMD_OS_CFLAGS += -Wall -Wno-format -Wno-switch -DSUNOS4 +OS_CFLAGS += $(DSO_CFLAGS) $(NOMD_OS_CFLAGS) -MDupdate $(DEPENDENCIES) +MKSHLIB = $(LD) +MKSHLIB += $(DSO_LDOPTS) +NOSUCHFILE = /solaris-rm-f-sucks +DSO_LDOPTS = + +# -fPIC generates position-independent code for use in a shared library. +DSO_CFLAGS += -fPIC diff -Naur security/coreconf/SunOS5.10_i86pc.mk mozilla/security/coreconf/SunOS5.10_i86pc.mk --- a/security/coreconf/SunOS5.10_i86pc.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.10_i86pc.mk 2004-10-11 05:15:42.000000000 +0300 @@ -0,0 +1,53 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS = -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +ifeq ($(USE_64),1) + CPU_ARCH = x86_64 +else + CPU_ARCH = x86 + OS_DEFINES += -Di386 +endif + +ifeq ($(OS_RELEASE),5.10_i86pc) + OS_DEFINES += -DSOLARIS2_10 +endif + +OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc diff -Naur security/coreconf/SunOS5.10.mk mozilla/security/coreconf/SunOS5.10.mk --- a/security/coreconf/SunOS5.10.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.10.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,46 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS += -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +ifeq ($(OS_RELEASE),5.10) + OS_DEFINES += -DSOLARIS2_10 +endif + +OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc diff -Naur security/coreconf/SunOS5.11_i86pc.mk mozilla/security/coreconf/SunOS5.11_i86pc.mk --- a/security/coreconf/SunOS5.11_i86pc.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.11_i86pc.mk 2006-01-04 01:02:11.000000000 +0200 @@ -0,0 +1,53 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS = -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +ifeq ($(USE_64),1) + CPU_ARCH = x86_64 +else + CPU_ARCH = x86 + OS_DEFINES += -Di386 +endif + +ifeq ($(OS_RELEASE),5.11_i86pc) + OS_DEFINES += -DSOLARIS2_11 +endif + +OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc diff -Naur security/coreconf/SunOS5.11.mk mozilla/security/coreconf/SunOS5.11.mk --- a/security/coreconf/SunOS5.11.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.11.mk 2006-01-04 01:02:11.000000000 +0200 @@ -0,0 +1,46 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS += -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +ifeq ($(OS_RELEASE),5.11) + OS_DEFINES += -DSOLARIS2_11 +endif + +OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc diff -Naur security/coreconf/SunOS5.3.mk mozilla/security/coreconf/SunOS5.3.mk --- a/security/coreconf/SunOS5.3.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.3.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,40 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS = + +include $(CORE_DEPTH)/coreconf/SunOS5.mk diff -Naur security/coreconf/SunOS5.4_i86pc.mk mozilla/security/coreconf/SunOS5.4_i86pc.mk --- a/security/coreconf/SunOS5.4_i86pc.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.4_i86pc.mk 2007-11-22 06:39:56.000000000 +0200 @@ -0,0 +1,69 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DEFAULT_COMPILER = cc + +ifdef NS_USE_GCC + CC = gcc + OS_CFLAGS += -Wall -Wno-format -Wno-switch + CCC = g++ + CCC += -Wall -Wno-format + ASFLAGS += -x assembler-with-cpp + OS_CFLAGS += $(NOMD_OS_CFLAGS) + ifdef USE_MDUPDATE + OS_CFLAGS += -MDupdate $(DEPENDENCIES) + endif +else + CC = cc + CCC = CC + ASFLAGS += -Wa,-P + OS_CFLAGS += $(NOMD_OS_CFLAGS) +endif + +CPU_ARCH = x86 + +MKSHLIB = $(LD) +MKSHLIB += $(DSO_LDOPTS) +NOSUCHFILE = /solx86-rm-f-sucks +RANLIB = echo + +# for purify +NOMD_OS_CFLAGS += -DSVR4 -DSYSV -D_REENTRANT -DSOLARIS -D__svr4__ -Di386 + +DSO_LDOPTS += -G diff -Naur security/coreconf/SunOS5.4.mk mozilla/security/coreconf/SunOS5.4.mk --- a/security/coreconf/SunOS5.4.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.4.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,40 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS = + +include $(CORE_DEPTH)/coreconf/SunOS5.mk diff -Naur security/coreconf/SunOS5.5.1_i86pc.mk mozilla/security/coreconf/SunOS5.5.1_i86pc.mk --- a/security/coreconf/SunOS5.5.1_i86pc.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.5.1_i86pc.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,48 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS = -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +CPU_ARCH = x86 +ARCHFLAG = +OS_DEFINES += -Di386 + +ifeq ($(OS_RELEASE),5.5.1_i86pc) + OS_DEFINES += -DSOLARIS2_5 +endif diff -Naur security/coreconf/SunOS5.5.1.mk mozilla/security/coreconf/SunOS5.5.1.mk --- a/security/coreconf/SunOS5.5.1.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.5.1.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,46 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS += -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +ifeq ($(OS_RELEASE),5.5.1) + OS_DEFINES += -DSOLARIS2_5 +endif + +OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc diff -Naur security/coreconf/SunOS5.5.mk mozilla/security/coreconf/SunOS5.5.mk --- a/security/coreconf/SunOS5.5.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.5.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,44 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS += -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +ifeq ($(OS_RELEASE),5.5) + OS_DEFINES += -DSOLARIS2_5 +endif diff -Naur security/coreconf/SunOS5.6_i86pc.mk mozilla/security/coreconf/SunOS5.6_i86pc.mk --- a/security/coreconf/SunOS5.6_i86pc.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.6_i86pc.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,48 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS = -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +CPU_ARCH = x86 +ARCHFLAG = +OS_DEFINES += -Di386 + +ifeq ($(OS_RELEASE),5.6_i86pc) + OS_DEFINES += -DSOLARIS2_6 +endif diff -Naur security/coreconf/SunOS5.6.mk mozilla/security/coreconf/SunOS5.6.mk --- a/security/coreconf/SunOS5.6.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.6.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,46 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS += -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +ifeq ($(OS_RELEASE),5.6) + OS_DEFINES += -DSOLARIS2_6 +endif + +OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc diff -Naur security/coreconf/SunOS5.7_i86pc.mk mozilla/security/coreconf/SunOS5.7_i86pc.mk --- a/security/coreconf/SunOS5.7_i86pc.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.7_i86pc.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,50 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS = -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +CPU_ARCH = x86 +ARCHFLAG = +OS_DEFINES += -Di386 + +ifeq ($(OS_RELEASE),5.7_i86pc) + OS_DEFINES += -DSOLARIS2_7 +endif + +OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc diff -Naur security/coreconf/SunOS5.7.mk mozilla/security/coreconf/SunOS5.7.mk --- a/security/coreconf/SunOS5.7.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.7.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,46 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS += -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +ifeq ($(OS_RELEASE),5.7) + OS_DEFINES += -DSOLARIS2_7 +endif + +OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc diff -Naur security/coreconf/SunOS5.8_i86pc.mk mozilla/security/coreconf/SunOS5.8_i86pc.mk --- a/security/coreconf/SunOS5.8_i86pc.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.8_i86pc.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,50 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS = -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +CPU_ARCH = x86 +ARCHFLAG = +OS_DEFINES += -Di386 + +ifeq ($(OS_RELEASE),5.8_i86pc) + OS_DEFINES += -DSOLARIS2_8 +endif + +OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc diff -Naur security/coreconf/SunOS5.8.mk mozilla/security/coreconf/SunOS5.8.mk --- a/security/coreconf/SunOS5.8.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.8.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,46 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS += -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +ifeq ($(OS_RELEASE),5.8) + OS_DEFINES += -DSOLARIS2_8 +endif + +OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc diff -Naur security/coreconf/SunOS5.9_i86pc.mk mozilla/security/coreconf/SunOS5.9_i86pc.mk --- a/security/coreconf/SunOS5.9_i86pc.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.9_i86pc.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,50 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS = -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +CPU_ARCH = x86 +ARCHFLAG = +OS_DEFINES += -Di386 + +ifeq ($(OS_RELEASE),5.9_i86pc) + OS_DEFINES += -DSOLARIS2_9 +endif + +OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc diff -Naur security/coreconf/SunOS5.9.mk mozilla/security/coreconf/SunOS5.9.mk --- a/security/coreconf/SunOS5.9.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.9.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,46 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +SOL_CFLAGS += -D_SVID_GETTOD + +include $(CORE_DEPTH)/coreconf/SunOS5.mk + +ifeq ($(OS_RELEASE),5.9) + OS_DEFINES += -DSOLARIS2_9 +endif + +OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc diff -Naur security/coreconf/SunOS5.mk mozilla/security/coreconf/SunOS5.mk --- a/security/coreconf/SunOS5.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/SunOS5.mk 2009-06-11 03:55:32.000000000 +0300 @@ -0,0 +1,180 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +# +# Temporary define for the Client; to be removed when binary release is used +# +ifdef MOZILLA_CLIENT + ifndef NS_USE_NATIVE + NS_USE_GCC = 1 + endif +endif + +# Sun's WorkShop defines v8, v8plus and v9 architectures. +# gcc on Solaris defines v8 and v9 "cpus". +# gcc's v9 is equivalent to Workshop's v8plus. +# gcc's -m64 is equivalent to Workshop's v9 + +ifeq ($(USE_64), 1) + ifdef NS_USE_GCC + ARCHFLAG=-m64 + else + ifeq ($(OS_TEST),i86pc) + ARCHFLAG=-xarch=amd64 + else + ARCHFLAG=-xarch=v9 + endif + endif +else + ifneq ($(OS_TEST),i86pc) + ifdef NS_USE_GCC + ARCHFLAG=-mcpu=v8 + else + ARCHFLAG=-xarch=v8 + endif + endif +endif + +DEFAULT_COMPILER = cc + +ifdef NS_USE_GCC + CC = gcc + OS_CFLAGS += -Wall -Wno-format -Werror-implicit-function-declaration -Wno-switch + CCC = g++ + CCC += -Wall -Wno-format + ASFLAGS += -x assembler-with-cpp + OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG) + ifdef USE_MDUPDATE + OS_CFLAGS += -MDupdate $(DEPENDENCIES) + endif + ifdef BUILD_OPT + OPTIMIZER = -O2 + # Enable this for accurate dtrace profiling + # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer + endif +else + CC = cc + CCC = CC + ASFLAGS += -Wa,-P + OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG) + ifndef BUILD_OPT + OS_CFLAGS += -xs + else + OPTIMIZER = -xO4 + endif + ifdef USE_TCOV + CC += -xprofile=tcov + CCC += -xprofile=tcov + endif +endif + +INCLUDES += -I/usr/dt/include -I/usr/openwin/include + +RANLIB = echo +CPU_ARCH = sparc +OS_DEFINES += -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS -D_REENTRANT + +# Purify doesn't like -MDupdate +NOMD_OS_CFLAGS += $(DSO_CFLAGS) $(OS_DEFINES) $(SOL_CFLAGS) + +MKSHLIB = $(CC) $(DSO_LDOPTS) $(RPATH) +ifdef NS_USE_GCC +ifeq (GNU,$(findstring GNU,$(shell `$(CC) -print-prog-name=ld` -v 2>&1))) + GCC_USE_GNU_LD = 1 +endif +endif +ifdef MAPFILE +ifdef NS_USE_GCC +ifdef GCC_USE_GNU_LD + MKSHLIB += -Wl,--version-script,$(MAPFILE) +else + MKSHLIB += -Wl,-M,$(MAPFILE) +endif +else + MKSHLIB += -M $(MAPFILE) +endif +endif +PROCESS_MAP_FILE = grep -v ';-' $< | \ + sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ + + + + +# ld options: +# -G: produce a shared object +# -z defs: no unresolved symbols allowed +ifdef NS_USE_GCC +ifeq ($(USE_64), 1) + DSO_LDOPTS += -m64 +endif + DSO_LDOPTS += -shared -h $(notdir $@) +else +ifeq ($(USE_64), 1) + ifeq ($(OS_TEST),i86pc) + DSO_LDOPTS +=-xarch=amd64 + else + DSO_LDOPTS +=-xarch=v9 + endif +endif + DSO_LDOPTS += -G -h $(notdir $@) +endif +DSO_LDOPTS += -z combreloc -z defs -z ignore + +# -KPIC generates position independent code for use in shared libraries. +# (Similarly for -fPIC in case of gcc.) +ifdef NS_USE_GCC + DSO_CFLAGS += -fPIC +else + DSO_CFLAGS += -KPIC +endif + +NOSUCHFILE = /solaris-rm-f-sucks + +ifeq ($(BUILD_SUN_PKG), 1) +# The -R '$ORIGIN' linker option instructs this library to search for its +# dependencies in the same directory where it resides. +ifeq ($(USE_64), 1) +RPATH = -R '$$ORIGIN:/usr/lib/mps/secv1/64:/usr/lib/mps/64' +else +RPATH = -R '$$ORIGIN:/usr/lib/mps/secv1:/usr/lib/mps' +endif +else +RPATH = -R '$$ORIGIN' +endif + diff -Naur security/coreconf/tree.mk mozilla/security/coreconf/tree.mk --- a/security/coreconf/tree.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/tree.mk 2009-03-10 20:01:49.000000000 +0200 @@ -0,0 +1,84 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +####################################################################### +# Master "Core Components" file system "release" prefixes # +####################################################################### + +# Windows platforms override this. See WIN32.mk. +ifndef RELEASE_TREE + ifdef BUILD_SHIP + ifdef USE_SHIPS + RELEASE_TREE = $(BUILD_SHIP) + else + RELEASE_TREE = /share/builds/components + endif + else + RELEASE_TREE = /share/builds/components + endif +endif + +# +# NOTE: export control policy enforced for XP and MD files +# released to the binary release tree +# + +ifeq ($(POLICY), domestic) + RELEASE_XP_DIR = domestic + RELEASE_MD_DIR = domestic/$(PLATFORM) +else + ifeq ($(POLICY), export) + RELEASE_XP_DIR = export + RELEASE_MD_DIR = export/$(PLATFORM) + else + ifeq ($(POLICY), france) + RELEASE_XP_DIR = france + RELEASE_MD_DIR = france/$(PLATFORM) + else + RELEASE_XP_DIR = + RELEASE_MD_DIR = $(PLATFORM) + endif + endif +endif + + +REPORTER_TREE = $(subst \,\\,$(RELEASE_TREE)) + +IMPORT_XP_DIR = +IMPORT_MD_DIR = $(PLATFORM) + +MK_TREE = included diff -Naur security/coreconf/UNIX.mk mozilla/security/coreconf/UNIX.mk --- a/security/coreconf/UNIX.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/UNIX.mk 2008-10-03 22:12:41.000000000 +0300 @@ -0,0 +1,96 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +XP_DEFINE += -DXP_UNIX +LIB_SUFFIX = a +DLL_SUFFIX = so +AR = ar cr $@ +LDOPTS += -L$(SOURCE_LIB_DIR) + +ifdef BUILD_OPT + OPTIMIZER += -O + DEFINES += -UDEBUG -DNDEBUG +else + OPTIMIZER += -g + USERNAME := $(shell whoami) + USERNAME := $(subst -,_,$(USERNAME)) + DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME) +endif + +ifdef BUILD_TREE +NSINSTALL_DIR = $(BUILD_TREE)/nss +NSINSTALL = $(BUILD_TREE)/nss/nsinstall +else +NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall +NSINSTALL = $(NSINSTALL_DIR)/$(OBJDIR_NAME)/nsinstall +endif + +MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend +MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend +MKDEPENDENCIES = $(OBJDIR_NAME)/depend.mk + +#################################################################### +# +# One can define the makefile variable NSDISTMODE to control +# how files are published to the 'dist' directory. If not +# defined, the default is "install using relative symbolic +# links". The two possible values are "copy", which copies files +# but preserves source mtime, and "absolute_symlink", which +# installs using absolute symbolic links. +# - THIS IS NOT PART OF THE NEW BINARY RELEASE PLAN for 9/30/97 +# - WE'RE KEEPING IT ONLY FOR BACKWARDS COMPATIBILITY +#################################################################### + +ifeq ($(NSDISTMODE),copy) + # copy files, but preserve source mtime + INSTALL = $(NSINSTALL) + INSTALL += -t +else + ifeq ($(NSDISTMODE),absolute_symlink) + # install using absolute symbolic links + INSTALL = $(NSINSTALL) + INSTALL += -L `pwd` + else + # install using relative symbolic links + INSTALL = $(NSINSTALL) + INSTALL += -R + endif +endif + +define MAKE_OBJDIR +if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi +endef diff -Naur security/coreconf/UNIXWARE2.1.mk mozilla/security/coreconf/UNIXWARE2.1.mk --- a/security/coreconf/UNIXWARE2.1.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/UNIXWARE2.1.mk 2005-09-16 20:09:23.000000000 +0300 @@ -0,0 +1,61 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# +# Config stuff for SCO Unixware 2.1 +# + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DEFAULT_COMPILER = $(CORE_DEPTH)/build/hcc + +CC = $(CORE_DEPTH)/build/hcc +CCC = $(CORE_DEPTH)/build/hcpp +RANLIB = true +OS_CFLAGS = -KPIC -DSVR4 -DSYSV -DUNIXWARE +MKSHLIB = $(LD) +MKSHLIB += $(DSO_LDOPTS) +DSO_LDOPTS += -G +CPU_ARCH = x86 +ARCH = sco +NOSUCHFILE = /solaris-rm-f-sucks +ifdef MAPFILE +# Add LD options to restrict exported symbols to those in the map file +endif +# Change PROCESS to put the mapfile in the correct format for this platform +PROCESS_MAP_FILE = cp $< $@ + diff -Naur security/coreconf/version.mk mozilla/security/coreconf/version.mk --- a/security/coreconf/version.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/version.mk 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,109 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +####################################################################### +# Build master "Core Components" release version directory name # +####################################################################### + +# +# Always set CURRENT_VERSION_SYMLINK to the symbolic link. +# + +CURRENT_VERSION_SYMLINK = current + + +# +# For the sake of backwards compatibility (*sigh*) ... +# + +ifndef VERSION + ifdef BUILD_NUM + VERSION = $(BUILD_NUM) + endif +endif + +ifndef RELEASE_VERSION + ifdef BUILD_NUM + RELEASE_VERSION = $(BUILD_NUM) + endif +endif + +# +# If VERSION has still NOT been set on the command line, +# as an environment variable, by the individual Makefile, or +# by the -specific "version.mk" file, set VERSION equal +# to $(CURRENT_VERSION_SYMLINK). + +ifndef VERSION + VERSION = $(CURRENT_VERSION_SYMLINK) +endif + +# If RELEASE_VERSION has still NOT been set on the command line, +# as an environment variable, by the individual Makefile, or +# by the -specific "version.mk" file, automatically +# generate the next available version number via a perl script. +# + +ifndef RELEASE_VERSION + RELEASE_VERSION = +endif + +# +# Set -specific versions for compiliation and linkage. +# + +ifndef JAVA_VERSION + JAVA_VERSION = $(CURRENT_VERSION_SYMLINK) +endif + +ifndef NETLIB_VERSION + NETLIB_VERSION = $(CURRENT_VERSION_SYMLINK) +endif + +ifndef NSPR_VERSION + NSPR_VERSION = $(CURRENT_VERSION_SYMLINK) +endif + +ifndef SECTOOLS_VERSION + SECTOOLS_VERSION = $(CURRENT_VERSION_SYMLINK) +endif + +ifndef SECURITY_VERSION + SECURITY_VERSION = $(CURRENT_VERSION_SYMLINK) +endif + +MK_VERSION = included diff -Naur security/coreconf/version.pl mozilla/security/coreconf/version.pl --- a/security/coreconf/version.pl 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/version.pl 2004-04-25 18:02:17.000000000 +0300 @@ -0,0 +1,80 @@ +#!/usr/sbin/perl +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# Compose lowercase alphabet +@alphabet = ( "a", "b", "c", "d", "e", "f", "g", "h", + "i", "j", "k", "l", "m", "n", "o", "p", + "q", "r", "s", "t", "u", "v", "w", "x", + "y", "z" ); + +# Compute year +$year = (localtime)[5] + 1900; + +# Compute month +$month = (localtime)[4] + 1; + +# Compute day +$day = (localtime)[3]; + +# Compute base build number +$version = sprintf( "%d%02d%02d", $year, $month, $day ); +$directory = sprintf( "%s\/%s\/%d%02d%02d", $ARGV[0], $ARGV[1], $year, $month, $day ); + +# Print out the name of the first version directory which does not exist +#if( ! -e $directory ) +#{ + print $version; +#} +#else +#{ +# # Loop through combinations +# foreach $ch1 (@alphabet) +# { +# foreach $ch2 (@alphabet) +# { +# $version = sprintf( "%d%02d%02d%s%s", $year, $month, $day, $ch1, $ch2 ); +# $directory = sprintf( "%s\/%s\/%d%02d%02d%s%s", $ARGV[0], $ARGV[1], $year, $month, $day, $ch1, $ch2 ); +# if( ! -e $directory ) +# { +# print STDOUT $version; +# exit; +# } +# } +# } +#} + diff -Naur security/coreconf/WIN32.mk mozilla/security/coreconf/WIN32.mk --- a/security/coreconf/WIN32.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/WIN32.mk 2011-09-14 20:59:43.000000000 +0300 @@ -0,0 +1,390 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# +# Configuration common to all versions of Windows NT +# and Windows 95 +# + +DEFAULT_COMPILER = cl + +ifdef NS_USE_GCC + CC = gcc + CCC = g++ + LINK = ld + AR = ar + AR += cr $@ + RANLIB = ranlib + BSDECHO = echo + RC = windres.exe -O coff --use-temp-file + LINK_DLL = $(CC) $(OS_DLLFLAGS) $(DLLFLAGS) +else + CC = cl + CCC = cl + LINK = link + AR = lib + AR += -NOLOGO -OUT:"$@" + RANLIB = echo + BSDECHO = echo + RC = rc.exe + MT = mt.exe + # Determine compiler version + CC_VERSION := $(shell $(CC) 2>&1 | sed -ne \ + 's|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p') + # Change the dots to spaces. + _CC_VERSION_WORDS := $(subst ., ,$(CC_VERSION)) + _CC_VMAJOR := $(word 1,$(_CC_VERSION_WORDS)) + _CC_VMINOR := $(word 2,$(_CC_VERSION_WORDS)) + _CC_RELEASE := $(word 3,$(_CC_VERSION_WORDS)) + _CC_BUILD := $(word 4,$(_CC_VERSION_WORDS)) + _MSC_VER = $(_CC_VMAJOR)$(_CC_VMINOR) + _MSC_VER_6 = 1200 + ifeq ($(_CC_VMAJOR),14) + # -DYNAMICBASE is only supported on VC8SP1 or newer, + # so be very specific here! + # VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762 + ifeq ($(_CC_RELEASE).$(_CC_BUILD),50727.42) + USE_DYNAMICBASE = + else + ifeq ($(_CC_RELEASE).$(_CC_BUILD),50727.762) + USE_DYNAMICBASE = 1 + else + _LOSER := $(error Unknown compiler version $(CC_VERSION)) + endif + endif + endif + # if $(_CC_VMAJOR) >= 15 + # NOTE: 'sort' sorts the words in lexical order, so this test works + # only if $(_CC_VMAJOR) is two digits. + ifeq ($(firstword $(sort $(_CC_VMAJOR) 15)),15) + USE_DYNAMICBASE = 1 + endif +endif + +ifdef BUILD_TREE +NSINSTALL_DIR = $(BUILD_TREE)/nss +else +NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall +endif +NSINSTALL = nsinstall + +MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend +MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend.exe +# Note: MKDEPENDENCIES __MUST__ be a relative pathname, not absolute. +# If it is absolute, gmake will crash unless the named file exists. +MKDEPENDENCIES = $(OBJDIR_NAME)/depend.mk + +INSTALL = $(NSINSTALL) +MAKE_OBJDIR = mkdir +MAKE_OBJDIR += $(OBJDIR) +GARBAGE += $(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb +XP_DEFINE += -DXP_PC +ifdef NS_USE_GCC +LIB_SUFFIX = a +else +LIB_SUFFIX = lib +endif +DLL_SUFFIX = dll + +ifdef NS_USE_GCC + # The -mnop-fun-dllimport flag allows us to avoid a drawback of + # the dllimport attribute that a pointer to a function marked as + # dllimport cannot be used as as a constant address. + OS_CFLAGS += -mwindows -mms-bitfields -mnop-fun-dllimport + _GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY) + DLLFLAGS += -mwindows -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB)) + ifdef BUILD_OPT + ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE)) + OPTIMIZER += -Os + else + OPTIMIZER += -O2 + endif + DEFINES += -UDEBUG -U_DEBUG -DNDEBUG + else + OPTIMIZER += -g + NULLSTRING := + SPACE := $(NULLSTRING) # end of the line + USERNAME := $(subst $(SPACE),_,$(USERNAME)) + USERNAME := $(subst -,_,$(USERNAME)) + DEFINES += -DDEBUG -D_DEBUG -UNDEBUG -DDEBUG_$(USERNAME) + endif +else # !NS_USE_GCC + OS_CFLAGS += -W3 -nologo -D_CRT_SECURE_NO_WARNINGS \ + -D_CRT_NONSTDC_NO_WARNINGS + OS_DLLFLAGS += -nologo -DLL -SUBSYSTEM:WINDOWS + ifeq ($(_MSC_VER),$(_MSC_VER_6)) + ifndef MOZ_DEBUG_SYMBOLS + OS_DLLFLAGS += -PDB:NONE + endif + endif + ifdef USE_DYNAMICBASE + OS_DLLFLAGS += -DYNAMICBASE + endif + ifdef BUILD_OPT + OS_CFLAGS += -MD + ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE)) + OPTIMIZER += -O1 + else + OPTIMIZER += -O2 + endif + DEFINES += -UDEBUG -U_DEBUG -DNDEBUG + DLLFLAGS += -OUT:"$@" + ifdef MOZ_DEBUG_SYMBOLS + ifdef MOZ_DEBUG_FLAGS + OPTIMIZER += $(MOZ_DEBUG_FLAGS) -Fd$(OBJDIR)/ + else + OPTIMIZER += -Zi -Fd$(OBJDIR)/ + endif + DLLFLAGS += -DEBUG -OPT:REF + LDFLAGS += -DEBUG -OPT:REF + endif + else + # + # Define USE_DEBUG_RTL if you want to use the debug runtime library + # (RTL) in the debug build + # + ifdef USE_DEBUG_RTL + OS_CFLAGS += -MDd -D_CRTDBG_MAP_ALLOC + else + OS_CFLAGS += -MD + endif + OPTIMIZER += -Zi -Fd$(OBJDIR)/ -Od + NULLSTRING := + SPACE := $(NULLSTRING) # end of the line + USERNAME := $(subst $(SPACE),_,$(USERNAME)) + USERNAME := $(subst -,_,$(USERNAME)) + DEFINES += -DDEBUG -D_DEBUG -UNDEBUG -DDEBUG_$(USERNAME) + DLLFLAGS += -DEBUG -OUT:"$@" + LDFLAGS += -DEBUG +ifeq ($(_MSC_VER),$(_MSC_VER_6)) +ifndef MOZ_DEBUG_SYMBOLS + LDFLAGS += -PDB:NONE +endif +endif + # Purify requires /FIXED:NO when linking EXEs. + LDFLAGS += /FIXED:NO + endif +ifneq ($(_MSC_VER),$(_MSC_VER_6)) + # Convert certain deadly warnings to errors (see list at end of file) + OS_CFLAGS += -we4002 -we4003 -we4004 -we4006 -we4009 -we4013 \ + -we4015 -we4028 -we4033 -we4035 -we4045 -we4047 -we4053 -we4054 -we4063 \ + -we4064 -we4078 -we4087 -we4098 -we4390 -we4551 -we4553 -we4715 +endif # !MSVC6 +endif # NS_USE_GCC + +ifdef USE_64 +DEFINES += -DWIN64 +else +DEFINES += -DWIN32 +endif + +ifeq (,$(filter-out x386 x86_64,$(CPU_ARCH))) +ifdef USE_64 + DEFINES += -D_AMD64_ +else + DEFINES += -D_X86_ +endif +endif +ifeq ($(CPU_ARCH), ALPHA) + DEFINES += -D_ALPHA_=1 +endif + +ifdef MAPFILE +ifndef NS_USE_GCC +DLLFLAGS += -DEF:$(MAPFILE) +endif +endif +# Change PROCESS to put the mapfile in the correct format for this platform +PROCESS_MAP_FILE = cp $< $@ + + +# +# The following is NOT needed for the NSPR 2.0 library. +# + +DEFINES += -D_WINDOWS + +# override default, which is ASFLAGS = CFLAGS +ifdef NS_USE_GCC + AS = $(CC) + ASFLAGS = $(INCLUDES) +else +ifdef USE_64 + AS = ml64.exe + ASFLAGS = -Cp -Sn -Zi $(INCLUDES) +else + AS = ml.exe + ASFLAGS = -Cp -Sn -Zi -coff $(INCLUDES) +endif +endif + +# +# override the definitions of RELEASE_TREE found in tree.mk +# +ifndef RELEASE_TREE + ifdef BUILD_SHIP + ifdef USE_SHIPS + RELEASE_TREE = $(NTBUILD_SHIP) + else + RELEASE_TREE = //redbuild/components + endif + else + RELEASE_TREE = //redbuild/components + endif +endif + +# +# override the definitions of IMPORT_LIB_PREFIX, LIB_PREFIX, and +# DLL_PREFIX in prefix.mk +# + +ifndef IMPORT_LIB_PREFIX + ifdef NS_USE_GCC + IMPORT_LIB_PREFIX = lib + else + IMPORT_LIB_PREFIX = $(NULL) + endif +endif + +ifndef LIB_PREFIX + ifdef NS_USE_GCC + LIB_PREFIX = lib + else + LIB_PREFIX = $(NULL) + endif +endif + +ifndef DLL_PREFIX + DLL_PREFIX = $(NULL) +endif + +# +# override the definitions of various _SUFFIX symbols in suffix.mk +# + +# +# Object suffixes +# +ifndef OBJ_SUFFIX + ifdef NS_USE_GCC + OBJ_SUFFIX = .o + else + OBJ_SUFFIX = .obj + endif +endif + +# +# Assembler source suffixes +# +ifndef ASM_SUFFIX + ifdef NS_USE_GCC + ASM_SUFFIX = .s + else + ASM_SUFFIX = .asm + endif +endif + +# +# Library suffixes +# + +ifndef IMPORT_LIB_SUFFIX + IMPORT_LIB_SUFFIX = .$(LIB_SUFFIX) +endif + +ifndef DYNAMIC_LIB_SUFFIX_FOR_LINKING + DYNAMIC_LIB_SUFFIX_FOR_LINKING = $(IMPORT_LIB_SUFFIX) +endif + +# +# Program suffixes +# +ifndef PROG_SUFFIX + PROG_SUFFIX = .exe +endif + +# +# When the processor is NOT 386-based on Windows NT, override the +# value of $(CPU_TAG). For WinNT, 95, 16, not CE. +# +ifneq ($(CPU_ARCH),x386) + CPU_TAG = _$(CPU_ARCH) +endif + +# +# override ruleset.mk, removing the "lib" prefix for library names, and +# adding the "32" after the LIBRARY_VERSION. +# +ifdef LIBRARY_NAME + SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)32$(JDK_DEBUG_SUFFIX).dll + IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)32$(JDK_DEBUG_SUFFIX).lib +endif + +# +# override the TARGETS defined in ruleset.mk, adding IMPORT_LIBRARY +# +ifndef TARGETS + TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(PROGRAM) +endif + +# list of MSVC warnings converted to errors above: +# 4002: too many actual parameters for macro 'identifier' +# 4003: not enough actual parameters for macro 'identifier' +# 4004: incorrect construction after 'defined' +# 4006: #undef expected an identifier +# 4009: string too big; trailing characters truncated +# 4015: 'identifier' : type of bit field must be integral +# 4028: formal parameter different from declaration +# 4033: 'function' must return a value +# 4035: 'function' : no return value +# 4045: 'identifier' : array bounds overflow +# 4047: 'function' : 'type 1' differs in levels of indirection from 'type 2' +# 4053: one void operand for '?:' +# 4054: 'conversion' : from function pointer 'type1' to data pointer 'type2' +# 4059: pascal string too big, length byte is length % 256 +# 4063: case 'identifier' is not a valid value for switch of enum 'identifier' +# 4064: switch of incomplete enum 'identifier' +# 4078: case constant 'value' too big for the type of the switch expression +# 4087: 'function' : declared with 'void' parameter list +# 4098: 'function' : void function returning a value +# 4390: ';' : empty controlled statement found; is this the intent? +# 4541: RTTI train wreck +# 4715: not all control paths return a value +# 4013: function undefined; assuming extern returning int +# 4553: '==' : operator has no effect; did you intend '='? +# 4551: function call missing argument list + diff -Naur security/coreconf/WIN95.mk mozilla/security/coreconf/WIN95.mk --- a/security/coreconf/WIN95.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/WIN95.mk 2009-02-14 07:51:10.000000000 +0200 @@ -0,0 +1,47 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# +# Config stuff for OS_TARGET=WIN95 +# + +include $(CORE_DEPTH)/coreconf/WIN32.mk + +DEFINES += -DWIN95 + +# WINNT uses the lib prefix, Win95 and WinCE don't +NSPR31_LIB_PREFIX = $(NULL) diff -Naur security/coreconf/WINCE.mk mozilla/security/coreconf/WINCE.mk --- a/security/coreconf/WINCE.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/WINCE.mk 2009-06-18 02:01:50.000000000 +0300 @@ -0,0 +1,214 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# +# Configuration common to all versions of Windows CE and Pocket PC x. +# + +ifeq ($(CPU_ARCH),x86) + DEFAULT_COMPILER = cl + CC = cl + CCC = cl +else +ifeq ($(CPU_ARCH),ARM) + DEFAULT_COMPILER = clarm + CC = clarm + CCC = clarm +else +include CPU_ARCH_is_not_recognized +include _$(CPU_ARCH) +endif +endif + +LINK = link +AR = lib +AR += -NOLOGO -OUT:"$@" +RANLIB = echo +BSDECHO = echo + +ifdef BUILD_TREE +NSINSTALL_DIR = $(BUILD_TREE)/nss +else +NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall +endif +NSINSTALL = nsinstall + +MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend +MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend.exe +# Note: MKDEPENDENCIES __MUST__ be a relative pathname, not absolute. +# If it is absolute, gmake will crash unless the named file exists. +MKDEPENDENCIES = $(OBJDIR_NAME)/depend.mk + +INSTALL = $(NSINSTALL) +MAKE_OBJDIR = mkdir +MAKE_OBJDIR += $(OBJDIR) +RC = rc.exe +GARBAGE += $(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb +XP_DEFINE += -DXP_PC +LIB_SUFFIX = lib +DLL_SUFFIX = dll +OS_DLLFLAGS += -DLL + +EXTRA_EXE_LD_FLAGS += -ENTRY:mainWCRTStartup + +ifdef BUILD_OPT +# OS_CFLAGS += -MD + OPTIMIZER += -O2 + DEFINES += -UDEBUG -U_DEBUG -DNDEBUG + DLLFLAGS += -OUT:"$@" +else + # + # Define USE_DEBUG_RTL if you want to use the debug runtime library + # (RTL) in the debug build + # + ifdef USE_DEBUG_RTL +# OS_CFLAGS += -MDd + else +# OS_CFLAGS += -MD + endif + OPTIMIZER += -Od -Z7 + #OPTIMIZER += -Zi -Fd$(OBJDIR)/ -Od + DEFINES += -DDEBUG -D_DEBUG -UNDEBUG -DDEBUG_$(USERNAME) + DLLFLAGS += -DEBUG -DEBUGTYPE:CV -OUT:"$@" + LDFLAGS += -DEBUG -DEBUGTYPE:CV +endif + +# DEFINES += -DWIN32 + +ifdef MAPFILE + DLLFLAGS += -DEF:$(MAPFILE) +endif + +# Change PROCESS to put the mapfile in the correct format for this platform +PROCESS_MAP_FILE = cp $< $@ + +# +# The following is NOT needed for the NSPR 2.0 library. +# + +DEFINES += -D_WINDOWS + +# override default, which is ASFLAGS = CFLAGS +AS = ml.exe +ASFLAGS = -Cp -Sn -Zi -coff $(INCLUDES) + +# +# override the definitions of RELEASE_TREE found in tree.mk +# +ifndef RELEASE_TREE + ifdef BUILD_SHIP + ifdef USE_SHIPS + RELEASE_TREE = $(NTBUILD_SHIP) + else + RELEASE_TREE = //redbuild/components + endif + else + RELEASE_TREE = //redbuild/components + endif +endif + +# +# override the definitions of LIB_PREFIX and DLL_PREFIX in prefix.mk +# + +ifndef LIB_PREFIX + LIB_PREFIX = $(NULL) +endif + +ifndef DLL_PREFIX + DLL_PREFIX = $(NULL) +endif + +# +# override the definitions of various _SUFFIX symbols in suffix.mk +# + +# +# Object suffixes +# +ifndef OBJ_SUFFIX + OBJ_SUFFIX = .obj +endif + +# +# Assembler source suffixes +# +ifndef ASM_SUFFIX + ASM_SUFFIX = .asm +endif + +# +# Library suffixes +# + +ifndef IMPORT_LIB_SUFFIX + IMPORT_LIB_SUFFIX = .$(LIB_SUFFIX) +endif + +ifndef DYNAMIC_LIB_SUFFIX_FOR_LINKING + DYNAMIC_LIB_SUFFIX_FOR_LINKING = $(IMPORT_LIB_SUFFIX) +endif + +# +# Program suffixes +# +ifndef PROG_SUFFIX + PROG_SUFFIX = .exe +endif + +# +# override ruleset.mk, removing the "lib" prefix for library names, and +# adding the "32" after the LIBRARY_VERSION. +# +ifdef LIBRARY_NAME + SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)32$(JDK_DEBUG_SUFFIX).dll + IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)32$(JDK_DEBUG_SUFFIX).lib +endif + +# +# override the TARGETS defined in ruleset.mk, adding IMPORT_LIBRARY +# +ifndef TARGETS + TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(PROGRAM) +endif + + +# +# Always set CPU_TAG on Linux, WINCE. +# +CPU_TAG = _$(CPU_ARCH) + diff -Naur security/coreconf/WINNT.mk mozilla/security/coreconf/WINNT.mk --- a/security/coreconf/WINNT.mk 1970-01-01 02:00:00.000000000 +0200 +++ b/security/coreconf/WINNT.mk 2009-02-14 07:51:10.000000000 +0200 @@ -0,0 +1,52 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# 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 the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# +# Config stuff for OS_TARGET=WINNT +# + +include $(CORE_DEPTH)/coreconf/WIN32.mk + +DEFINES += -DWINNT + +# +# Win NT needs -GT so that fibers can work +# +OS_CFLAGS += -GT + +# WINNT uses the lib prefix, Win95 and WinCE don't +NSPR31_LIB_PREFIX = lib debian/patches/jss-PKCS12-FIPS.patch0000644000000000000000000000553311772530746014117 0ustar Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyGenerator.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11KeyGenerator.c 2011-10-04 22:05:35.602116514 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyGenerator.c 2011-10-04 22:05:35.646116515 +0300 @@ -228,40 +228,47 @@ * TokenException if an error occurs. */ static PK11SymKey* -constructSHA1PBAKey(JNIEnv *env, SECItem *pwitem, SECItem *salt, +constructSHA1PBAKey(JNIEnv *env, PK11SlotInfo *slot, SECItem *pwitem, SECItem *salt, int iterationCount) { - PBEBitGenContext* pbeCtxt=NULL; - SECItem *keyBits=NULL; PK11SymKey *key=NULL; - pbeCtxt = PBE_CreateContext( SEC_OID_SHA1, pbeBitGenIntegrityKey, - pwitem, salt, 160 /* SHA1 key length */, iterationCount); - if( pbeCtxt == NULL ) { - JSS_throwMsg(env, TOKEN_EXCEPTION, "Failed to create PBE context"); + unsigned char ivData[8]; + SECItem mechItem; + CK_PBE_PARAMS pbe_params; + + if( pwitem == NULL ) { + JSS_throwMsg(env, TOKEN_EXCEPTION, + "constructSHA1PAKey:" + " pwitem NULL"); goto finish; } - - keyBits = PBE_GenerateBits(pbeCtxt); - if( keyBits == NULL ) { - JSS_throwMsg(env, TOKEN_EXCEPTION, "Failed to generate bits from" - "PBE context"); + if( salt == NULL ) { + JSS_throwMsg(env, TOKEN_EXCEPTION, + "constructSHA1PAKey:" + " salt NULL"); goto finish; } - key = PK11_ImportSymKey( PK11_GetInternalSlot(), CKM_SHA_1, - PK11_OriginGenerated, CKA_SIGN, keyBits, NULL); + pbe_params.pInitVector = ivData; + pbe_params.pPassword = pwitem->data; + pbe_params.ulPasswordLen = pwitem->len; + pbe_params.pSalt = salt->data; + pbe_params.ulSaltLen = salt->len; + pbe_params.ulIteration = iterationCount; + mechItem.data = (unsigned char *) &pbe_params; + mechItem.len = sizeof(pbe_params); + + key = PK11_RawPBEKeyGen(slot, CKM_PBA_SHA1_WITH_SHA1_HMAC, &mechItem, pwitem, PR_FALSE, NULL); + if( key == NULL ) { - JSS_throwMsg(env, TOKEN_EXCEPTION, "Failed to import PBA key from" - " PBA-generated bits"); + JSS_throwMsg(env, TOKEN_EXCEPTION, + "PK11_RawPBEKeyGen:" + " failed to generate key"); goto finish; } finish: - if( pbeCtxt ) { - PBE_DestroyContext(pbeCtxt); - } - /* keyBits == pbeCtxt, so we don't need to free it */ return key; } @@ -313,7 +320,7 @@ /* special case, construct key by hand. Bug #336587 */ - skey = constructSHA1PBAKey(env, pwitem, salt, iterationCount); + skey = constructSHA1PBAKey(env, slot, pwitem, salt, iterationCount); if( skey==NULL ) { /* exception was thrown */ goto finish; debian/patches/jss-undo-BadPaddingException-deprecation.patch0000644000000000000000000000120211772551110021520 0ustar diff -rupN jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/crypto/BadPaddingException.java jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/BadPaddingException.java --- a/security/jss/org/mozilla/jss/crypto/BadPaddingException.java 2004-04-25 08:02:21.000000000 -0700 +++ b/security/jss/org/mozilla/jss/crypto/BadPaddingException.java 2012-03-30 16:17:30.748371000 -0700 @@ -35,9 +35,6 @@ * ***** END LICENSE BLOCK ***** */ package org.mozilla.jss.crypto; -/** - * @deprecated Use javax.crypto.BadPaddingException. - */ public class BadPaddingException extends Exception { public BadPaddingException() { super(); debian/patches/jss-VerifyCertificateReturnCU.patch0000644000000000000000000002302211772530746017505 0ustar Index: jss/security/jss/lib/jss.def =================================================================== --- jss.orig/security/jss/lib/jss.def 2011-10-04 21:21:38.754032743 +0300 +++ jss/security/jss/lib/jss.def 2011-10-04 21:21:38.782032744 +0300 @@ -331,6 +331,7 @@ Java_org_mozilla_jss_CryptoManager_OCSPCacheSettingsNative; Java_org_mozilla_jss_CryptoManager_setOCSPTimeoutNative; Java_org_mozilla_jss_CryptoManager_verifyCertificateNowNative; +Java_org_mozilla_jss_CryptoManager_verifyCertificateNowCUNative; ;+ local: ;+ *; ;+}; Index: jss/security/jss/org/mozilla/jss/CryptoManager.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/CryptoManager.java 2011-10-04 21:21:38.754032743 +0300 +++ jss/security/jss/org/mozilla/jss/CryptoManager.java 2011-10-04 21:21:38.786032744 +0300 @@ -159,6 +159,19 @@ public static final CertificateUsage ProtectedObjectSigner = new CertificateUsage(certificateUsageProtectedObjectSigner, "ProtectedObjectSigner"); public static final CertificateUsage StatusResponder = new CertificateUsage(certificateUsageStatusResponder, "StatusResponder"); public static final CertificateUsage AnyCA = new CertificateUsage(certificateUsageAnyCA, "AnyCA"); + + /* + The folllowing usages cannot be verified: + certUsageAnyCA + certUsageProtectedObjectSigner + certUsageUserCertImport + certUsageVerifyCA + */ + public static final int basicCertificateUsages = /*0x0b80;*/ + certificateUsageUserCertImport | + certificateUsageVerifyCA | + certificateUsageProtectedObjectSigner | + certificateUsageAnyCA ; } public final static class NotInitializedException extends Exception {} @@ -1566,14 +1579,43 @@ * against Now. * @param nickname The nickname of the certificate to verify. * @param checkSig verify the signature of the certificate - * @param certificateUsage see exposed certificateUsage defines to verify Certificate; null will bypass usage check - * @return true for success; false otherwise + * @return currCertificateUsage which contains current usage bit map as defined in CertificateUsage * * @exception InvalidNicknameException If the nickname is null * @exception ObjectNotFoundException If no certificate could be found * with the given nickname. */ + public int isCertValid(String nickname, boolean checkSig) + throws ObjectNotFoundException, InvalidNicknameException + { + if (nickname==null) { + throw new InvalidNicknameException("Nickname must be non-null"); + } + int currCertificateUsage = 0x0000; // initialize it to 0 + currCertificateUsage = verifyCertificateNowCUNative(nickname, + checkSig); + return currCertificateUsage; + } + + private native int verifyCertificateNowCUNative(String nickname, + boolean checkSig) throws ObjectNotFoundException; + ///////////////////////////////////////////////////////////// + // isCertValid + ///////////////////////////////////////////////////////////// + /** + * Verify a certificate that exists in the given cert database, + * check if is valid and that we trust the issuer. Verify time + * against Now. + * @param nickname The nickname of the certificate to verify. + * @param checkSig verify the signature of the certificate + * @param certificateUsage see certificateUsage defined to verify Certificate; to retrieve current certificate usage, call the isCertValid() above + * @return true for success; false otherwise + * + * @exception InvalidNicknameException If the nickname is null + * @exception ObjectNotFoundException If no certificate could be found + * with the given nickname. + */ public boolean isCertValid(String nickname, boolean checkSig, CertificateUsage certificateUsage) throws ObjectNotFoundException, InvalidNicknameException @@ -1581,11 +1623,23 @@ if (nickname==null) { throw new InvalidNicknameException("Nickname must be non-null"); } - // 0 certificate usage was supposed to get current usage, however, - // it is not exposed at this point - return verifyCertificateNowNative(nickname, - checkSig, - (certificateUsage == null) ? 0:certificateUsage.getUsage()); + // 0 certificate usage will get current usage + // should call isCertValid() call above that returns certificate usage + if ((certificateUsage == null) || + (certificateUsage == CertificateUsage.CheckAllUsages)){ + int currCertificateUsage = 0x0000; + currCertificateUsage = verifyCertificateNowCUNative(nickname, + checkSig); + + if (currCertificateUsage == CertificateUsage.basicCertificateUsages){ + // cert is good for nothing + return false; + } else + return true; + } else { + return verifyCertificateNowNative(nickname, checkSig, + certificateUsage.getUsage()); + } } private native boolean verifyCertificateNowNative(String nickname, Index: jss/security/jss/org/mozilla/jss/PK11Finder.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/PK11Finder.c 2011-10-04 21:21:38.754032743 +0300 +++ jss/security/jss/org/mozilla/jss/PK11Finder.c 2011-10-04 21:21:38.786032744 +0300 @@ -1574,18 +1574,16 @@ } } + /*********************************************************************** - * CryptoManager.verifyCertificateNowNative - * - * Returns JNI_TRUE if success, JNI_FALSE otherwise + * CryptoManager.verifyCertificateNow */ -JNIEXPORT jboolean JNICALL -Java_org_mozilla_jss_CryptoManager_verifyCertificateNowNative(JNIEnv *env, - jobject self, jstring nickString, jboolean checkSig, jint required_certificateUsage) +SECStatus verifyCertificateNow(JNIEnv *env, jobject self, jstring nickString, + jboolean checkSig, jint required_certificateUsage, + SECCertificateUsage *currUsage) { SECStatus rv = SECFailure; SECCertificateUsage certificateUsage; - SECCertificateUsage currUsage; /* unexposed for now */ CERTCertificate *cert=NULL; char *nickname=NULL; @@ -1602,12 +1600,28 @@ JSS_throw(env, OBJECT_NOT_FOUND_EXCEPTION); goto finish; } else { - /* 0 for certificateUsage in call to CERT_VerifyCertificateNow to - * just get the current usage (which we are not passing back for now - * but will bypass the certificate usage check + /* 0 for certificateUsage in call to CERT_VerifyCertificateNow will + * retrieve the current valid usage into currUsage */ rv = CERT_VerifyCertificateNow(CERT_GetDefaultCertDB(), cert, - checkSig, certificateUsage, NULL, &currUsage ); + checkSig, certificateUsage, NULL, currUsage ); + if ((rv == SECSuccess) && certificateUsage == 0x0000) { + if (*currUsage == + ( certUsageUserCertImport | + certUsageVerifyCA | + certUsageProtectedObjectSigner | + certUsageAnyCA )) { + + /* the cert is good for nothing + The folllowing usages cannot be verified: + certUsageAnyCA + certUsageProtectedObjectSigner + certUsageUserCertImport + certUsageVerifyCA + (0x0b80) */ + rv =SECFailure; + } + } } finish: @@ -1617,6 +1631,49 @@ if(cert != NULL) { CERT_DestroyCertificate(cert); } + + return rv; +} + +/*********************************************************************** + * CryptoManager.verifyCertificateNowCUNative + * + * Returns jint which contains bits in SECCertificateUsage that reflects + * the cert usage(s) that the cert is good for + * if the cert is good for nothing, returned value is + * (0x0b80): + * certUsageUserCertImport | + * certUsageVerifyCA | + * certUsageProtectedObjectSigner | + * certUsageAnyCA + */ +JNIEXPORT jint JNICALL +Java_org_mozilla_jss_CryptoManager_verifyCertificateNowCUNative(JNIEnv *env, + jobject self, jstring nickString, jboolean checkSig) +{ + SECStatus rv = SECFailure; + SECCertificateUsage currUsage = 0x0000; + + rv = verifyCertificateNow(env, self, nickString, checkSig, 0, &currUsage); + /* rv is ignored */ + + return currUsage; +} + +/*********************************************************************** + * CryptoManager.verifyCertificateNowNative + * + * Returns JNI_TRUE if success, JNI_FALSE otherwise + */ +JNIEXPORT jboolean JNICALL +Java_org_mozilla_jss_CryptoManager_verifyCertificateNowNative(JNIEnv *env, + jobject self, jstring nickString, jboolean checkSig, jint required_certificateUsage) +{ + SECStatus rv = SECFailure; + SECCertificateUsage currUsage = 0x0000; + + rv = verifyCertificateNow(env, self, nickString, checkSig, required_certificateUsage, &currUsage); + if( rv == SECSuccess) { return JNI_TRUE; } else { @@ -1624,7 +1681,6 @@ } } - /*********************************************************************** * CryptoManager.verifyCertNowNative * note: this calls obsolete NSS function debian/patches/jss-ECC-HSM-FIPS.patch0000644000000000000000000000667011772530746014236 0ustar Index: jss/security/jss/org/mozilla/jss/crypto/Algorithm.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/Algorithm.c 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/crypto/Algorithm.c 2011-10-04 21:28:51.810046501 +0300 @@ -113,6 +113,7 @@ /* 50 */ {SEC_OID_HMAC_SHA256, SEC_OID_TAG}, /* 51 */ {SEC_OID_HMAC_SHA384, SEC_OID_TAG}, -/* 52 */ {SEC_OID_HMAC_SHA512, SEC_OID_TAG} +/* 52 */ {SEC_OID_HMAC_SHA512, SEC_OID_TAG}, +/* 53 */ {SEC_OID_ANSIX962_ECDSA_SIGNATURE_SPECIFIED_DIGEST, SEC_OID_TAG}, /* REMEMBER TO UPDATE NUM_ALGS!!! */ }; Index: jss/security/jss/org/mozilla/jss/crypto/Algorithm.h =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/Algorithm.h 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/crypto/Algorithm.h 2011-10-04 21:29:22.378047472 +0300 @@ -56,7 +56,7 @@ JSS_AlgType type; } JSS_AlgInfo; -#define NUM_ALGS 53 +#define NUM_ALGS 54 extern JSS_AlgInfo JSS_AlgTable[]; extern CK_ULONG JSS_symkeyUsage[]; Index: jss/security/jss/org/mozilla/jss/crypto/Algorithm.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/Algorithm.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/crypto/Algorithm.java 2011-10-04 21:32:14.706052947 +0300 @@ -236,5 +236,6 @@ protected static final short SEC_OID_HMAC_SHA256=50; protected static final short SEC_OID_HMAC_SHA384=51; protected static final short SEC_OID_HMAC_SHA512=52; + protected static final short SEC_OID_ANSIX962_ECDSA_SIGNATURE_SPECIFIED_DIGEST=53; } Index: jss/security/jss/org/mozilla/jss/crypto/KeyPairAlgorithm.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/KeyPairAlgorithm.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/crypto/KeyPairAlgorithm.java 2011-10-04 21:28:09.678045162 +0300 @@ -94,7 +94,12 @@ DSAFamily = new Algorithm(SEC_OID_ANSIX9_DSA_SIGNATURE, "DSA"); public static final Algorithm - ECFamily = new Algorithm(SEC_OID_ANSIX962_EC_PUBLIC_KEY, "EC"); + +// To support both ECDSA and ECDH, it is best to provide two EC Families; +// However, since there is no token that does only CKM_DERIVE to +// date, we will just do ECDSA for now as it is sufficient enough today. +// This fix will support tokens that do not do ECDH + ECFamily = new Algorithm(SEC_OID_ANSIX962_ECDSA_SIGNATURE_SPECIFIED_DIGEST, "EC"); public static final KeyPairAlgorithm RSA = new KeyPairAlgorithm(CKM_RSA_PKCS_KEY_PAIR_GEN, "RSA", RSAFamily); Index: jss/security/jss/org/mozilla/jss/crypto/SignatureAlgorithm.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/SignatureAlgorithm.java 2011-10-04 20:07:40.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/crypto/SignatureAlgorithm.java 2011-10-04 21:28:09.678045162 +0300 @@ -124,7 +124,7 @@ * operates on its input, which should be a hash. */ public static final SignatureAlgorithm - ECSignature = new SignatureAlgorithm(SEC_OID_ANSIX962_EC_PUBLIC_KEY, + ECSignature = new SignatureAlgorithm(SEC_OID_ANSIX962_ECDSA_SIGNATURE_SPECIFIED_DIGEST, "EC", null, null, ANSI_X962_OID.subBranch(2).subBranch(1) ); debian/patches/jss-ipv6.patch0000644000000000000000000004730211772530746013341 0ustar Index: jss/security/jss/lib/jss.def =================================================================== --- jss.orig/security/jss/lib/jss.def 2011-10-04 20:32:37.017939286 +0300 +++ jss/security/jss/lib/jss.def 2011-10-04 20:42:47.805958690 +0300 @@ -175,6 +175,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_forceHandshake; Java_org_mozilla_jss_ssl_SSLSocket_getKeepAlive; Java_org_mozilla_jss_ssl_SSLSocket_getLocalAddressNative; +Java_org_mozilla_jss_ssl_SocketBase_getLocalAddressByteArrayNative; Java_org_mozilla_jss_ssl_SSLSocket_getPort; Java_org_mozilla_jss_ssl_SSLSocket_getReceiveBufferSize; Java_org_mozilla_jss_ssl_SSLSocket_getSendBufferSize; @@ -199,6 +200,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_socketWrite; Java_org_mozilla_jss_ssl_SocketBase_getLocalPortNative; Java_org_mozilla_jss_ssl_SocketBase_getPeerAddressNative; +Java_org_mozilla_jss_ssl_SocketBase_getPeerAddressByteArrayNative; Java_org_mozilla_jss_ssl_SocketBase_setClientCertNicknameNative; Java_org_mozilla_jss_ssl_SocketBase_requestClientAuthNoExpiryCheckNative; Java_org_mozilla_jss_ssl_SocketBase_setSSLOption; Index: jss/security/jss/org/mozilla/jss/ssl/SSLServerSocket.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/ssl/SSLServerSocket.java 2011-10-04 20:29:35.909933532 +0300 +++ jss/security/jss/org/mozilla/jss/ssl/SSLServerSocket.java 2011-10-04 20:42:47.805958690 +0300 @@ -36,7 +36,8 @@ package org.mozilla.jss.ssl; -import java.net.InetAddress; +import java.util.*; +import java.net.*; import java.io.IOException; import java.net.Socket; import java.net.SocketException; @@ -138,34 +139,34 @@ super.close(); // create the socket + + int socketFamily = SocketBase.SSL_AF_INET; + if(SocketBase.supportsIPV6()) { + socketFamily = SocketBase.SSL_AF_INET6; + } + sockProxy = new SocketProxy( - base.socketCreate(this, certApprovalCallback, null) ); + base.socketCreate(this, certApprovalCallback, null,socketFamily) ); base.setProxy(sockProxy); setReuseAddress(reuseAddr); - // bind it to the local address and port - if( bindAddr == null ) { - bindAddr = anyLocalAddr; - } byte[] bindAddrBA = null; if( bindAddr != null ) { bindAddrBA = bindAddr.getAddress(); } base.socketBind(bindAddrBA, port); + + String hostName = null; + if(bindAddr != null) { + hostName = bindAddr.getCanonicalHostName(); + } socketListen(backlog); } private native void socketListen(int backlog) throws SocketException; - private static InetAddress anyLocalAddr; - static { - try { - anyLocalAddr = InetAddress.getByName("0.0.0.0"); - } catch (java.net.UnknownHostException e) { } - } - /** * Accepts a connection. This call will block until a connection is made * or the timeout is reached. Index: jss/security/jss/org/mozilla/jss/ssl/SSLSocket.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/ssl/SSLSocket.c 2011-10-04 20:29:35.909933532 +0300 +++ jss/security/jss/org/mozilla/jss/ssl/SSLSocket.c 2011-10-04 20:42:47.809958690 +0300 @@ -460,10 +460,15 @@ JSSL_SocketData *sock; PRNetAddr addr; jbyte *addrBAelems = NULL; + int addrBALen = 0; PRStatus status; int stat; const char *hostnameStr=NULL; + jmethodID supportsIPV6ID; + jclass socketBaseClass; + jboolean supportsIPV6 = 0; + if( JSSL_getSockData(env, self, &sock) != PR_SUCCESS) { /* exception was thrown */ goto finish; @@ -472,16 +477,32 @@ /* * setup the PRNetAddr structure */ - addr.inet.family = AF_INET; - addr.inet.port = htons(port); - PR_ASSERT(sizeof(addr.inet.ip) == 4); - PR_ASSERT( (*env)->GetArrayLength(env, addrBA) == 4); + + socketBaseClass = (*env)->FindClass(env, SOCKET_BASE_NAME); + if( socketBaseClass == NULL ) { + ASSERT_OUTOFMEM(env); + goto finish; + } + supportsIPV6ID = (*env)->GetStaticMethodID(env, socketBaseClass, + SUPPORTS_IPV6_NAME, SUPPORTS_IPV6_SIG); + + if( supportsIPV6ID == NULL ) { + ASSERT_OUTOFMEM(env); + goto finish; + } + + supportsIPV6 = (*env)->CallStaticBooleanMethod(env, socketBaseClass, + supportsIPV6ID); + addrBAelems = (*env)->GetByteArrayElements(env, addrBA, NULL); + addrBALen = (*env)->GetArrayLength(env, addrBA); + + PR_ASSERT(addrBALen != 0); + if( addrBAelems == NULL ) { ASSERT_OUTOFMEM(env); goto finish; } - memcpy(&addr.inet.ip, addrBAelems, 4); /* * Tell SSL the URL we think we want to connect to. @@ -495,6 +516,38 @@ goto finish; } + if( addrBAelems == NULL ) { + ASSERT_OUTOFMEM(env); + goto finish; + } + + if(addrBALen != 4 && addrBALen != 16) { + JSSL_throwSSLSocketException(env, "Invalid address in connect!"); + goto finish; + } + + if( addrBALen == 4) { + addr.inet.family = AF_INET; + addr.inet.port = PR_htons(port); + memcpy(&addr.inet.ip, addrBAelems, 4); + + if(supportsIPV6) { + addr.ipv6.family = AF_INET6; + addr.ipv6.port = PR_htons(port); + PR_ConvertIPv4AddrToIPv6(addr.inet.ip,&addr.ipv6.ip); + } + + } else { /* Must be 16 and ipv6 */ + if(supportsIPV6) { + addr.ipv6.family = AF_INET6; + addr.ipv6.port = PR_htons(port); + memcpy(&addr.ipv6.ip,addrBAelems, 16); + } else { + JSSL_throwSSLSocketException(env, "Invalid address in connect!"); + goto finish; + } + } + /* * make the connect call */ Index: jss/security/jss/org/mozilla/jss/ssl/SSLSocket.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/ssl/SSLSocket.java 2011-10-04 20:29:35.909933532 +0300 +++ jss/security/jss/org/mozilla/jss/ssl/SSLSocket.java 2011-10-04 20:42:47.809958690 +0300 @@ -249,11 +249,16 @@ SSLClientCertificateSelectionCallback clientCertSelectionCallback) throws IOException { + + int socketFamily = SocketBase.SSL_AF_INET; + if(SocketBase.supportsIPV6()) { + socketFamily = SocketBase.SSL_AF_INET6; + } // create the socket sockProxy = new SocketProxy( base.socketCreate( - this, certApprovalCallback, clientCertSelectionCallback) ); + this, certApprovalCallback, clientCertSelectionCallback,socketFamily) ); base.setProxy(sockProxy); @@ -294,7 +299,7 @@ new SocketProxy( base.socketCreate( this, certApprovalCallback, clientCertSelectionCallback, - s, host ) ); + s, host,SocketBase.SSL_AF_INET ) ); base.setProxy(sockProxy); resetHandshake(); Index: jss/security/jss/org/mozilla/jss/ssl/SocketBase.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/ssl/SocketBase.java 2011-10-04 20:29:35.909933532 +0300 +++ jss/security/jss/org/mozilla/jss/ssl/SocketBase.java 2011-10-04 20:42:47.809958690 +0300 @@ -70,16 +70,16 @@ native byte[] socketCreate(Object socketObject, SSLCertificateApprovalCallback certApprovalCallback, SSLClientCertificateSelectionCallback clientCertSelectionCallback, - java.net.Socket javaSock, String host) + java.net.Socket javaSock, String host,int family) throws SocketException; byte[] socketCreate(Object socketObject, SSLCertificateApprovalCallback certApprovalCallback, - SSLClientCertificateSelectionCallback clientCertSelectionCallback) + SSLClientCertificateSelectionCallback clientCertSelectionCallback,int family) throws SocketException { return socketCreate(socketObject, certApprovalCallback, - clientCertSelectionCallback, null, null); + clientCertSelectionCallback, null, null,family); } native void socketBind(byte[] addrBA, int port) throws SocketException; @@ -123,6 +123,10 @@ // constant. // static final int SSL_RENEGOTIATE_RESERVED = 27; + + static final int SSL_AF_INET = 50; + static final int SSL_AF_INET6 = 51; + void close() throws IOException { socketClose(); } @@ -318,13 +322,25 @@ return in; } + private native byte[] getLocalAddressByteArrayNative() throws SocketException; + private native byte[] getPeerAddressByteArrayNative() throws SocketException; /** * @return the InetAddress of the peer end of the socket. */ InetAddress getInetAddress() { try { - return convertIntToInetAddress( getPeerAddressNative() ); + byte[] address = getPeerAddressByteArrayNative(); + + InetAddress iAddr = null; + + try { + + iAddr = InetAddress.getByAddress(address); + } catch(UnknownHostException e) { + } + + return iAddr; } catch(SocketException e) { return null; } @@ -336,7 +352,17 @@ */ InetAddress getLocalAddress() { try { - return convertIntToInetAddress( getLocalAddressNative() ); + byte[] address = getLocalAddressByteArrayNative(); + + InetAddress lAddr = null; + + try { + + lAddr = InetAddress.getByAddress(address); + } catch(UnknownHostException e) { + } + + return lAddr; } catch(SocketException e) { return null; } @@ -415,4 +441,45 @@ return topException; } } + + static private int supportsIPV6 = -1; + static boolean supportsIPV6() { + + if(supportsIPV6 >= 0) { + if(supportsIPV6 > 0) { + return true; + } else { + return false; + } + } + + Enumeration netInter; + try { + netInter = NetworkInterface.getNetworkInterfaces(); + } catch (SocketException e) { + + return false; + } + while ( netInter.hasMoreElements() ) + { + NetworkInterface ni = (NetworkInterface)netInter.nextElement(); + Enumeration addrs = ni.getInetAddresses(); + while ( addrs.hasMoreElements() ) + { + Object o = addrs.nextElement(); + if ( o.getClass() == InetAddress.class || + o.getClass() == Inet4Address.class || + o.getClass() == Inet6Address.class ) + { + InetAddress iaddr = (InetAddress) o; + if(o.getClass() == Inet6Address.class) { + supportsIPV6 = 1; + return true; + } + } + } + } + supportsIPV6 = 0; + return false; + } } Index: jss/security/jss/org/mozilla/jss/ssl/common.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/ssl/common.c 2011-10-04 20:29:35.909933532 +0300 +++ jss/security/jss/org/mozilla/jss/ssl/common.c 2011-10-04 20:42:47.809958690 +0300 @@ -33,7 +33,6 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - #include #include #include @@ -51,6 +50,9 @@ #include #endif +#define SSL_AF_INET 50 +#define SSL_AF_INET6 51 + void JSSL_throwSSLSocketException(JNIEnv *env, char *message) { @@ -142,7 +144,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_mozilla_jss_ssl_SocketBase_socketCreate(JNIEnv *env, jobject self, jobject sockObj, jobject certApprovalCallback, - jobject clientCertSelectionCallback, jobject javaSock, jstring host) + jobject clientCertSelectionCallback, jobject javaSock, jstring host,jint family) { jbyteArray sdArray = NULL; JSSL_SocketData *sockdata = NULL; @@ -150,10 +152,21 @@ PRFileDesc *newFD; PRFileDesc *tmpFD; PRFilePrivate *priv = NULL; + int socketFamily = 0; + + if (family != SSL_AF_INET6 && family != SSL_AF_INET) { + JSSL_throwSSLSocketException(env, + "socketCreate() Invalid family!"); + goto finish; + } + if( family == SSL_AF_INET) + socketFamily = PR_AF_INET; + else + socketFamily = PR_AF_INET6; if( javaSock == NULL ) { /* create a TCP socket */ - newFD = PR_NewTCPSocket(); + newFD = PR_OpenTCPSocket(socketFamily); if( newFD == NULL ) { JSSL_throwSSLSocketException(env, "PR_NewTCPSocket() returned NULL"); @@ -411,8 +424,13 @@ JSSL_SocketData *sock; PRNetAddr addr; jbyte *addrBAelems = NULL; + int addrBALen = 0; PRStatus status; + jmethodID supportsIPV6ID; + jclass socketBaseClass; + jboolean supportsIPV6 = 0; + if( JSSL_getSockData(env, self, &sock) != PR_SUCCESS) { /* exception was thrown */ goto finish; @@ -421,19 +439,72 @@ /* * setup the PRNetAddr structure */ - addr.inet.family = AF_INET; - addr.inet.port = htons(port); + + /* + * Do we support IPV6? + */ + + socketBaseClass = (*env)->FindClass(env, SOCKET_BASE_NAME); + if( socketBaseClass == NULL ) { + ASSERT_OUTOFMEM(env); + goto finish; + } + supportsIPV6ID = (*env)->GetStaticMethodID(env, socketBaseClass, + SUPPORTS_IPV6_NAME, SUPPORTS_IPV6_SIG); + + if( supportsIPV6ID == NULL ) { + ASSERT_OUTOFMEM(env); + goto finish; + } + + supportsIPV6 = (*env)->CallStaticBooleanMethod(env, socketBaseClass, + supportsIPV6ID); + + memset( &addr, 0, sizeof( PRNetAddr )); + if( addrBA != NULL ) { - PR_ASSERT(sizeof(addr.inet.ip) == 4); - PR_ASSERT( (*env)->GetArrayLength(env, addrBA) == 4); addrBAelems = (*env)->GetByteArrayElements(env, addrBA, NULL); + addrBALen = (*env)->GetArrayLength(env, addrBA); + if( addrBAelems == NULL ) { ASSERT_OUTOFMEM(env); goto finish; } - memcpy(&addr.inet.ip, addrBAelems, 4); + + if(addrBALen != 4 && addrBALen != 16) { + JSS_throwMsgPrErr(env, BIND_EXCEPTION, + "Invalid address in bind!"); + goto finish; + } + + if( addrBALen == 4) { + addr.inet.family = PR_AF_INET; + addr.inet.port = PR_htons(port); + memcpy(&addr.inet.ip, addrBAelems, 4); + + if(supportsIPV6) { + addr.inet.family = PR_AF_INET6; + addr.ipv6.port = PR_htons(port); + PR_ConvertIPv4AddrToIPv6(addr.inet.ip,&addr.ipv6.ip); + } + + } else { /* Must be 16 and ipv6 */ + if(supportsIPV6) { + addr.ipv6.family = PR_AF_INET6; + addr.ipv6.port = PR_htons(port); + memcpy(&addr.ipv6.ip,addrBAelems, 16); + } else { + JSS_throwMsgPrErr(env, BIND_EXCEPTION, + "Invalid address in bind!"); + goto finish; + } + } } else { - addr.inet.ip = PR_htonl(INADDR_ANY); + if(supportsIPV6) { + status = PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET6, port, &addr); + } else { + status = PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET, port, &addr); + } } /* do the bind() call */ @@ -607,6 +678,78 @@ return status; } +JNIEXPORT jbyteArray JNICALL +Java_org_mozilla_jss_ssl_SocketBase_getPeerAddressByteArrayNative + (JNIEnv *env, jobject self) +{ + jbyteArray byteArray=NULL; + PRNetAddr addr; + jbyte *address=NULL; + int size=4; + + if( JSSL_getSockAddr(env, self, &addr, PEER_SOCK) != PR_SUCCESS) { + goto finish; + } + + if( PR_NetAddrFamily(&addr) == PR_AF_INET6) { + size = 16; + address = (jbyte *) &addr.ipv6.ip; + } else { + address = (jbyte *) &addr.inet.ip; + } + + byteArray = (*env)->NewByteArray(env,size); + if(byteArray == NULL) { + ASSERT_OUTOFMEM(env); + goto finish; + } + (*env)->SetByteArrayRegion(env, byteArray, 0,size ,address); + if( (*env)->ExceptionOccurred(env) != NULL) { + PR_ASSERT(PR_FALSE); + goto finish; + } + +finish: + return byteArray; +} + +JNIEXPORT jbyteArray JNICALL +Java_org_mozilla_jss_ssl_SocketBase_getLocalAddressByteArrayNative + (JNIEnv *env, jobject self) +{ + jbyteArray byteArray=NULL; + PRNetAddr addr; + jbyte *address=NULL; + int size=4; + + if( JSSL_getSockAddr(env, self, &addr, LOCAL_SOCK) != PR_SUCCESS) { + goto finish; + } + + if( PR_NetAddrFamily(&addr) == PR_AF_INET6) { + size = 16; + address = (jbyte *) &addr.ipv6.ip; + } else { + address = (jbyte *) &addr.inet.ip; + } + + byteArray = (*env)->NewByteArray(env,size); + if(byteArray == NULL) { + ASSERT_OUTOFMEM(env); + goto finish; + } + (*env)->SetByteArrayRegion(env, byteArray, 0,size,address); + if( (*env)->ExceptionOccurred(env) != NULL) { + PR_ASSERT(PR_FALSE); + goto finish; + } + +finish: + return byteArray; +} + +/* Leave the original versions of these functions for compatibility */ + JNIEXPORT jint JNICALL Java_org_mozilla_jss_ssl_SocketBase_getPeerAddressNative (JNIEnv *env, jobject self) Index: jss/security/jss/org/mozilla/jss/ssl/javasock.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/ssl/javasock.c 2011-10-04 20:29:35.913933532 +0300 +++ jss/security/jss/org/mozilla/jss/ssl/javasock.c 2011-10-04 20:42:47.809958690 +0300 @@ -290,6 +290,7 @@ jobject inetAddress; jbyteArray addrByteArray; jint port; + int addrBALen = 0; if( GET_ENV(fd->secret->javaVM, env) ) goto finish; @@ -377,8 +378,9 @@ memset(addr, 0, sizeof(PRNetAddr)); - /* we only handle IPV4 */ - PR_ASSERT( (*env)->GetArrayLength(env, addrByteArray) == 4 ); + addrBALen = (*env)->GetArrayLength(env, addrByteArray); + + PR_ASSERT( (addrBALen == 4) || (addrBALen == 16 ) ); /* make sure you release them later */ addrBytes = (*env)->GetByteArrayElements(env, addrByteArray, NULL); @@ -388,9 +390,16 @@ } /* ip field is in network byte order */ - memcpy( (void*) &addr->inet.ip, addrBytes, 4); - addr->inet.family = PR_AF_INET; - addr->inet.port = port; + + if (addrBALen == 4) { + memcpy( (void*) &addr->inet.ip, addrBytes, 4); + addr->inet.family = PR_AF_INET; + addr->inet.port = port; + } else { + memcpy( (void*) &addr->ipv6.ip,addrBytes, 16); + addr->inet.family = PR_AF_INET6; + addr->inet.port = port; + } (*env)->ReleaseByteArrayElements(env, addrByteArray, addrBytes, JNI_ABORT); Index: jss/security/jss/org/mozilla/jss/util/java_ids.h =================================================================== --- jss.orig/security/jss/org/mozilla/jss/util/java_ids.h 2011-10-04 20:29:35.913933532 +0300 +++ jss/security/jss/org/mozilla/jss/util/java_ids.h 2011-10-04 20:42:47.809958690 +0300 @@ -312,6 +312,8 @@ #define SOCKET_BASE_NAME "org/mozilla/jss/ssl/SocketBase" #define PROCESS_EXCEPTIONS_NAME "processExceptions" #define PROCESS_EXCEPTIONS_SIG "(Ljava/lang/Throwable;Ljava/lang/Throwable;)Ljava/lang/Throwable;" +#define SUPPORTS_IPV6_NAME "supportsIPV6" +#define SUPPORTS_IPV6_SIG "()Z" /* * SSLCertificateApprovalCallback debian/patches/jss-wrapInToken.patch0000644000000000000000000001440411772530746014713 0ustar diff -up jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c.cfu jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c --- a/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c.cfu 2011-10-18 09:16:08.362000000 -0700 +++ b/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c 2011-10-19 17:55:01.162000000 -0700 @@ -283,8 +283,9 @@ Java_org_mozilla_jss_pkcs11_PK11KeyWrapp status = PK11_WrapPrivKey(slot, wrapping, toBeWrapped, mech, param, &wrapped, NULL /* wincx */ ); if(status != SECSuccess) { - JSS_throwMsg(env, TOKEN_EXCEPTION, - "Wrapping operation failed on token"); + char err[256] = {0}; + PR_snprintf(err, 256, "Wrapping operation failed on token:%d", PR_GetError()); + JSS_throwMsg(env, TOKEN_EXCEPTION, err); goto finish; } PR_ASSERT(wrapped.len>0 && wrapped.data!=NULL); @@ -328,11 +329,15 @@ Java_org_mozilla_jss_pkcs11_PK11KeyWrapp int numAttribs = 0; CK_TOKEN_INFO tokenInfo; + /* ideal defaults */ PRBool isSensitive = PR_TRUE; PRBool isExtractable = PR_FALSE; - /* special case nethsm*/ + + /* special case nethsm and lunasa*/ CK_UTF8CHAR nethsmLabel[4] = {'N','H','S','M'}; + CK_UTF8CHAR lunasaLabel[4] = {'l','u','n','a'}; PRBool isNethsm = PR_TRUE; + PRBool isLunasa = PR_TRUE; if( JSS_PK11_getTokenSlotPtr(env, tokenObj, &slot) != PR_SUCCESS) { /* exception was thrown */ @@ -347,9 +352,17 @@ Java_org_mozilla_jss_pkcs11_PK11KeyWrapp break; } } + ix = 0; + for(ix=0; ix < 4; ix++) { + if (tokenInfo.label[ix] != lunasaLabel[ix]) { + isLunasa = PR_FALSE; + break; + } + } } else { isNethsm = PR_FALSE; + isLunasa = PR_FALSE; } /* get unwrapping key */ @@ -412,23 +425,25 @@ Java_org_mozilla_jss_pkcs11_PK11KeyWrapp } keyType = PK11_GetKeyType(keyTypeMech, 0); + /* special case nethsm and lunasa*/ if( isNethsm ) { isSensitive = PR_FALSE; isExtractable = PR_FALSE; + } else if ( isLunasa) { + isSensitive = PR_FALSE; + isExtractable = PR_TRUE; } -setAttrs: /* figure out which operations to enable for this key */ switch (keyType) { case CKK_RSA: + numAttribs = 3; attribs[0] = CKA_SIGN; attribs[1] = CKA_SIGN_RECOVER; attribs[2] = CKA_UNWRAP; if (isExtractable) { attribs[3] = CKA_EXTRACTABLE; numAttribs = 4; - } else { - numAttribs = 3; } break; case CKK_DSA: @@ -459,7 +474,9 @@ setAttrs: &label, pubValue, token, isSensitive /*sensitive*/, keyType, attribs, numAttribs, NULL /*wincx*/); if( privk == NULL ) { - JSS_throwMsg(env, TOKEN_EXCEPTION, "Key Unwrap failed on token"); + char err[256] = {0}; + PR_snprintf(err, 256, "Key Unwrap failed on token:%d", PR_GetError()); + JSS_throwMsg(env, TOKEN_EXCEPTION, err); goto finish; } diff -up jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.java.cfu jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.java --- a/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.java.cfu 2011-10-18 15:29:50.597000000 -0700 +++ b/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.java 2011-10-18 15:49:40.073000000 -0700 @@ -322,10 +322,13 @@ final class PK11KeyWrapper implements Ke throw new InvalidKeyException("key to be wrapped is not a "+ "PKCS #11 key"); } +/* NSS is capable of moving keys appropriately, + so this call is prematurely bailing if( ! symKey.getOwningToken().equals(token) ) { throw new InvalidKeyException("key to be wrapped does not live"+ " on the same token as the wrapping key"); } +*/ } /** @@ -340,10 +343,13 @@ final class PK11KeyWrapper implements Ke throw new InvalidKeyException("key to be wrapped is not a "+ "PKCS #11 key"); } +/* NSS is capable of moving keys appropriately, + so this call is prematurely bailing if( ! privKey.getOwningToken().equals(token) ) { throw new InvalidKeyException("key to be wrapped does not live"+ " on the same token as the wrapping key"); } +*/ } /** diff -up jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Token.java.cfu jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Token.java --- a/security/jss/org/mozilla/jss/pkcs11/PK11Token.java.cfu 2011-10-18 14:34:32.148000000 -0700 +++ b/security/jss/org/mozilla/jss/pkcs11/PK11Token.java 2011-10-18 14:35:20.402000000 -0700 @@ -135,10 +135,13 @@ public final class PK11Token implements getKeyWrapper(KeyWrapAlgorithm algorithm) throws NoSuchAlgorithmException, TokenException { +/* NSS is capable of finding the right token to do algorithm, + so this call is prematurely bailing if( ! doesAlgorithm(algorithm) ) { throw new NoSuchAlgorithmException( algorithm+" is not supported by this token"); } +*/ return new PK11KeyWrapper(this, algorithm); } diff -up jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkix/primitive/EncryptedPrivateKeyInfo.java.cfu jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkix/primitive/EncryptedPrivateKeyInfo.java --- a/security/jss/org/mozilla/jss/pkix/primitive/EncryptedPrivateKeyInfo.java.cfu 2011-10-18 09:24:13.796001000 -0700 +++ b/security/jss/org/mozilla/jss/pkix/primitive/EncryptedPrivateKeyInfo.java 2011-10-18 15:41:24.687000000 -0700 @@ -243,7 +243,7 @@ public class EncryptedPrivateKeyInfo imp } KeyWrapper wrapper = token.getKeyWrapper( - KeyWrapAlgorithm.DES3_CBC); + KeyWrapAlgorithm.DES3_CBC_PAD); wrapper.initWrap(key, params); byte encrypted[] = wrapper.wrap(pri); @@ -260,6 +260,7 @@ public class EncryptedPrivateKeyInfo imp return epki; } catch (Exception e) { + System.out.println("createPBE: exception:"+e.toString()); Assert.notReached("EncryptedPrivateKeyInfo exception:" +".createPBE"); } debian/patches/jss-PBE-PKCS5-V2-secure-P12.patch0000644000000000000000000003151611772530746016017 0ustar Index: jss/security/jss/org/mozilla/jss/crypto/Algorithm.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/Algorithm.c 2012-02-18 12:35:05.000000000 +0200 +++ jss/security/jss/org/mozilla/jss/crypto/Algorithm.c 2012-02-18 12:40:31.899853750 +0200 @@ -114,6 +114,9 @@ /* 51 */ {SEC_OID_HMAC_SHA384, SEC_OID_TAG}, /* 52 */ {SEC_OID_HMAC_SHA512, SEC_OID_TAG}, /* 53 */ {SEC_OID_ANSIX962_ECDSA_SIGNATURE_SPECIFIED_DIGEST, SEC_OID_TAG}, +/* 54 */ {SEC_OID_PKCS5_PBKDF2, SEC_OID_TAG}, +/* 55 */ {SEC_OID_PKCS5_PBES2, SEC_OID_TAG}, +/* 56 */ {SEC_OID_PKCS5_PBMAC1, SEC_OID_TAG}, /* REMEMBER TO UPDATE NUM_ALGS!!! */ }; Index: jss/security/jss/org/mozilla/jss/crypto/Algorithm.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/Algorithm.java 2012-02-18 12:35:05.000000000 +0200 +++ jss/security/jss/org/mozilla/jss/crypto/Algorithm.java 2012-02-18 12:42:14.002917182 +0200 @@ -237,5 +237,8 @@ protected static final short SEC_OID_HMAC_SHA384=51; protected static final short SEC_OID_HMAC_SHA512=52; protected static final short SEC_OID_ANSIX962_ECDSA_SIGNATURE_SPECIFIED_DIGEST=53; + protected static final short SEC_OID_PKCS5_PBKDF2=54; + protected static final short SEC_OID_PKCS5_PBES2=55; + protected static final short SEC_OID_PKCS5_PBMAC1=56; } Index: jss/security/jss/org/mozilla/jss/crypto/PBEAlgorithm.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/crypto/PBEAlgorithm.java 2011-10-05 00:41:22.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/crypto/PBEAlgorithm.java 2012-02-18 12:39:53.438699572 +0200 @@ -93,6 +93,27 @@ /////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// + // PKCS 5 v2 + public static final PBEAlgorithm + PBE_PKCS5_PBKDF2 = new PBEAlgorithm( + SEC_OID_PKCS5_PBKDF2, "PBKDF2", 128, + PKCS5.subBranch(12), EncryptionAlgorithm.AES_128_CBC, 8 ); + + ////////////////////////////////////////////////////////////// + // PKCS 5 v2 + public static final PBEAlgorithm + PBE_PKCS5_PBES2 = new PBEAlgorithm( + SEC_OID_PKCS5_PBES2, "PBES2", 128, + PKCS5.subBranch(13), EncryptionAlgorithm.AES_128_CBC, 8 ); + + ////////////////////////////////////////////////////////////// + // PKCS 5 v2 + public static final PBEAlgorithm + PBE_PKCS5_PBMAC1 = new PBEAlgorithm( + SEC_OID_PKCS5_PBMAC1, "PBMAC1", 128, + PKCS5.subBranch(14), EncryptionAlgorithm.AES_128_CBC, 8 ); + + ////////////////////////////////////////////////////////////// public static final PBEAlgorithm PBE_MD2_DES_CBC = new PBEAlgorithm( SEC_OID_PKCS5_PBE_WITH_MD2_AND_DES_CBC, "PBE/MD2/DES/CBC", 56, Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyGenerator.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11KeyGenerator.c 2012-02-18 12:35:05.774087090 +0200 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyGenerator.c 2012-02-18 12:39:53.438699572 +0200 @@ -313,7 +313,6 @@ } /* print_secitem(pwitem); */ - mech = JSS_getPK11MechFromAlg(env, alg); if( mech == CKM_PBA_SHA1_WITH_SHA1_HMAC ) { @@ -333,7 +332,14 @@ PR_ASSERT(oidTag != SEC_OID_UNKNOWN); /* create algid */ - algid = PK11_CreatePBEAlgorithmID(oidTag, iterationCount, salt); + algid = PK11_CreatePBEV2AlgorithmID( + oidTag, + SEC_OID_DES_EDE3_CBC, + SEC_OID_HMAC_SHA1, + 168/8, + iterationCount, + salt); + if( algid == NULL ) { JSS_throwMsg(env, TOKEN_EXCEPTION, "Unable to process PBE parameters"); Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c 2012-02-18 12:35:05.000000000 +0200 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c 2012-02-18 12:39:53.438699572 +0200 @@ -324,14 +324,34 @@ SECItem *wrapped=NULL, *iv=NULL, *param=NULL, *pubValue=NULL; SECItem label; /* empty secitem, doesn't need to be freed */ PRBool token; - CK_ATTRIBUTE_TYPE attribs[4]; - int numAttribs; + CK_ATTRIBUTE_TYPE attribs[4] = {0, 0, 0, 0}; + int numAttribs = 0; + CK_TOKEN_INFO tokenInfo; + + PRBool isSensitive = PR_TRUE; + PRBool isExtractable = PR_FALSE; + /* special case nethsm*/ + CK_UTF8CHAR nethsmLabel[4] = {'N','H','S','M'}; + PRBool isNethsm = PR_TRUE; if( JSS_PK11_getTokenSlotPtr(env, tokenObj, &slot) != PR_SUCCESS) { /* exception was thrown */ goto finish; } + if ( PK11_GetTokenInfo(slot, &tokenInfo) == PR_SUCCESS) { + int ix = 0; + for(ix=0; ix < 4; ix++) { + if (tokenInfo.label[ix] != nethsmLabel[ix]) { + isNethsm = PR_FALSE; + break; + } + } + + } else { + isNethsm = PR_FALSE; + } + /* get unwrapping key */ if( JSS_PK11_getSymKeyPtr(env, unwrapperObj, &unwrappingKey) != PR_SUCCESS) { @@ -392,14 +412,24 @@ } keyType = PK11_GetKeyType(keyTypeMech, 0); + if( isNethsm ) { + isSensitive = PR_FALSE; + isExtractable = PR_FALSE; + } + +setAttrs: /* figure out which operations to enable for this key */ switch (keyType) { case CKK_RSA: attribs[0] = CKA_SIGN; - attribs[1] = CKA_DECRYPT; - attribs[2] = CKA_SIGN_RECOVER; - attribs[3] = CKA_UNWRAP; - numAttribs = 4; + attribs[1] = CKA_SIGN_RECOVER; + attribs[2] = CKA_UNWRAP; + if (isExtractable) { + attribs[3] = CKA_EXTRACTABLE; + numAttribs = 4; + } else { + numAttribs = 3; + } break; case CKK_DSA: attribs[0] = CKA_SIGN; @@ -426,7 +456,7 @@ /* perform the unwrap */ privk = PK11_UnwrapPrivKey(slot, unwrappingKey, wrapType, param, wrapped, - &label, pubValue, token, PR_TRUE /*sensitive*/, keyType, + &label, pubValue, token, isSensitive /*sensitive*/, keyType, attribs, numAttribs, NULL /*wincx*/); if( privk == NULL ) { JSS_throwMsg(env, TOKEN_EXCEPTION, "Key Unwrap failed on token"); Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.java 2011-10-05 00:41:22.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.java 2012-02-18 12:39:53.438699572 +0200 @@ -190,21 +190,23 @@ if( key==null ) { throw new InvalidKeyException("Key is null"); } - if( ! key.getOwningToken().equals(token) ) { - throw new InvalidKeyException("Key does not reside on the "+ - "current token"); - } - if( ! (key instanceof PK11SymKey) ) { - throw new InvalidKeyException("Key is not a PKCS #11 key"); - } try { + if( ! key.getOwningToken().equals(token) ) { + throw new InvalidKeyException("Key does not reside on the current token: key owning token="+ + key.getOwningToken().getName()); + } + if( ! (key instanceof PK11SymKey) ) { + throw new InvalidKeyException("Key is not a PKCS #11 key"); + } if( ((PK11SymKey)key).getKeyType() != - KeyType.getKeyTypeFromAlgorithm(algorithm) ) { - throw new InvalidKeyException("Key is not the right type for"+ + KeyType.getKeyTypeFromAlgorithm(algorithm) ) { + throw new InvalidKeyException("Key is not the right type for"+ " this algorithm"); } } catch( NoSuchAlgorithmException e ) { Assert.notReached("Unknown algorithm"); + } catch (Exception e) { + Assert.notReached("Exception:"+ e.toString()); } } Index: jss/security/jss/org/mozilla/jss/pkcs11/PK11Token.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkcs11/PK11Token.java 2012-02-18 12:35:05.000000000 +0200 +++ jss/security/jss/org/mozilla/jss/pkcs11/PK11Token.java 2012-02-18 12:39:53.438699572 +0200 @@ -106,10 +106,13 @@ getKeyGenerator(KeyGenAlgorithm algorithm) throws NoSuchAlgorithmException, TokenException { +/* NSS is capable of finding the right token to do algorithm, + so this call is prematurely bailing if( ! doesAlgorithm(algorithm) ) { throw new NoSuchAlgorithmException( algorithm+" is not supported by this token"); } +*/ return new PK11KeyGenerator(this, algorithm); } Index: jss/security/jss/org/mozilla/jss/pkix/primitive/EncryptedPrivateKeyInfo.java =================================================================== --- jss.orig/security/jss/org/mozilla/jss/pkix/primitive/EncryptedPrivateKeyInfo.java 2011-10-05 00:41:22.000000000 +0300 +++ jss/security/jss/org/mozilla/jss/pkix/primitive/EncryptedPrivateKeyInfo.java 2012-02-18 12:39:53.438699572 +0200 @@ -43,6 +43,7 @@ import java.security.*; import org.mozilla.jss.CryptoManager; import org.mozilla.jss.util.Password; +import org.mozilla.jss.crypto.PrivateKey; import java.security.spec.AlgorithmParameterSpec; /** @@ -184,6 +185,89 @@ return null; } + + /** + * Creates a new EncryptedPrivateKeyInfo, where the data is encrypted + * with a password-based key- + * with wrapping/unwrapping happening on token. + * + * @param keyGenAlg The algorithm for generating a symmetric key from + * a password, salt, and iteration count. + * @param password The password to use in generating the key. + * @param salt The salt to use in generating the key. + * @param iterationCount The number of hashing iterations to perform + * while generating the key. + * @param charToByteConverter The mechanism for converting the characters + * in the password into bytes. If null, the default mechanism + * will be used, which is UTF8. + * @param pri The PrivateKey to be encrypted and stored in the + * EncryptedContentInfo. + */ + public static EncryptedPrivateKeyInfo + createPBE(PBEAlgorithm keyGenAlg, Password password, byte[] salt, + int iterationCount, + KeyGenerator.CharToByteConverter charToByteConverter, + PrivateKey pri, CryptoToken token) + throws CryptoManager.NotInitializedException, NoSuchAlgorithmException, + InvalidKeyException, InvalidAlgorithmParameterException, TokenException, + CharConversionException + { + try { + + // check key gen algorithm + + if( ! (keyGenAlg instanceof PBEAlgorithm) ) { + throw new NoSuchAlgorithmException("Key generation algorithm"+ + " is not a PBE algorithm"); + } + + PBEAlgorithm pbeAlg = (PBEAlgorithm) keyGenAlg; + + // generate key + + KeyGenerator kg = token.getKeyGenerator( keyGenAlg ); + PBEKeyGenParams pbekgParams = new PBEKeyGenParams( + password, salt, iterationCount); + if( charToByteConverter != null ) { + kg.setCharToByteConverter( charToByteConverter ); + } + kg.initialize(pbekgParams); + kg.temporaryKeys(true); + SymmetricKey key = kg.generate(); + + // generate IV + EncryptionAlgorithm encAlg = pbeAlg.getEncryptionAlg(); + AlgorithmParameterSpec params=null; + if( encAlg.getParameterClass().equals( IVParameterSpec.class ) ) { + params = new IVParameterSpec( kg.generatePBE_IV() ); + } + + KeyWrapper wrapper = token.getKeyWrapper( + KeyWrapAlgorithm.DES3_CBC); + wrapper.initWrap(key, params); + byte encrypted[] = wrapper.wrap(pri); + + // make encryption algorithm identifier + PBEParameter pbeParam = new PBEParameter( salt, iterationCount ); + AlgorithmIdentifier encAlgID = new AlgorithmIdentifier( + keyGenAlg.toOID(), pbeParam); + + // create EncryptedPrivateKeyInfo + EncryptedPrivateKeyInfo epki = new EncryptedPrivateKeyInfo ( + encAlgID, + new OCTET_STRING(encrypted) ); + + return epki; + + } catch (Exception e) { + Assert.notReached("EncryptedPrivateKeyInfo exception:" + +".createPBE"); + } + + return null; + } + + /** * Decrypts an EncryptedPrivateKeyInfo that was encrypted with a PBE * algorithm. The algorithm and its parameters are extracted from debian/libjss-java.files0000644000000000000000000000006411772544200012421 0ustar usr/share/java/jss-4.3.1.jar usr/lib/jss/libjss4.so debian/rules0000755000000000000000000001027111772626542010263 0ustar #!/usr/bin/make -f include /usr/share/quilt/quilt.make # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) UPSTREAM_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\(.*\)-.*$$/\1/ p' | sed -e 's/~.*//') MOD_MAJOR_VERSION := $(word 1, $(subst ., ,$(UPSTREAM_VERSION))) MOD_MINOR_VERSION := $(word 2, $(subst ., ,$(UPSTREAM_VERSION))) MOD_PATCH_VERSION := $(word 3, $(subst ., ,$(UPSTREAM_VERSION))) export USE_64 := $(shell echo "int main(void) { int assert[(sizeof(long) == 8) ? 1 : -1]; return 0; }" | gcc -o /dev/null -x c - 2> /dev/null && echo "USE_64=1") CFLAGS := -Wall -pipe -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 -fno-strict-aliasing endif CFLAGS += $(USE_64) # Enable compiler optimizations and disable debugging code BUILD_OPT=1 export BUILD_OPT export XCFLAGS="-g" BASEDIR := $(CURDIR)/security/ export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 export NSPR_INCLUDE_DIR=`/usr/bin/pkg-config --cflags-only-I nspr | sed 's/-I//'` export NSPR_LIB_DIR=`/usr/bin/pkg-config --libs-only-L nspr | sed 's/-L//'` export NSS_INCLUDE_DIR=`/usr/bin/pkg-config --cflags-only-I nss | sed 's/-I//'` export NSS_LIB_DIR=`/usr/bin/pkg-config --libs-only-L nss | sed 's/-L//'` export JAVA_HOME=/usr/lib/jvm/default-java # Generate symbolic info for debuggers XCFLAGS="-g" export XCFLAGS export CFLAGS configure: configure-stamp configure-stamp: $(QUILT_STAMPFN) build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: configure dh_testdir make -C $(BASEDIR)/coreconf $(USE_64) make -C $(BASEDIR)/jss $(USE_64) touch build-stamp clean: clean-patched unpatch clean-patched: dh_testdir dh_testroot -[ -f $(BASEDIR)/jss/Makefile ] || $(MAKE) -C $(BASEDIR)/jss clean -[ -f $(BASEDIR)/coreconf/Makefile ] || $(MAKE) -C $(BASEDIR)/coreconf clean -find . -name "*.class" -type f -exec rm -f "{}" \; -find . -name "*.so.*" -type f -exec rm -f "{}" \; -find . -name ".so" -type f -exec rm -f "{}" \; -find . -type d -name "Linux3.0_x86_glibc_PTH_DBG.OBJ" -exec rm -rf "{}" \; -find . -type d -name "Linux3.0_x86_glibc_PTH_OPT.OBJ" -exec rm -rf "{}" \; -find . -type d -name "Linux3.0_x86_64_glibc_PTH_64_DBG.OBJ" -exec rm -rf "{}" \; -find . -type d -name "Linux3.0_x86_64_glibc_PTH_64_OPT.OBJ" -exec rm -rf "{}" \; rm -f $(BASEDIR)/jss/org/mozilla/jss/util/Debug.java rm -rf $(CURDIR)/dist || true dh_clean build-stamp install-stamp install: install-stamp install-stamp: dh_testdir dh_testroot dh_prep dh_installdirs mkdir -p $(CURDIR)/debian/tmp/usr/lib/jss mkdir -p $(CURDIR)/debian/tmp/usr/share/java install -m 644 dist/xpclass.jar $(CURDIR)/debian/tmp/usr/share/java/jss-$(MOD_MAJOR_VERSION).$(MOD_MINOR_VERSION).$(MOD_PATCH_VERSION).jar install -m 0755 dist/Linux*.OBJ/lib/libjss4.so $(CURDIR)/debian/tmp/usr/lib/jss # # FIXME - sign jss4.jar. In order to use JSS as a JCE provider it needs to be # signed with a Sun-issued certificate. Since we would need to make this # certificate and private key public to provide reproducability in the rpm # building we have to ship an unsigned jar. # # Instructions for getting a signing cert can be found here: # http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/HowToImplAProvider.html#Step61 # # This signing is not required by every JVM. gcj ignores the signature and does # not require one. The Sun and IBM JVMs both check and enforce the signature. # Behavior of other JVMs is not known but they probably enforce the signature # as well. touch install-stamp binary-indep: binary-arch: install-stamp dh_testdir dh_testroot dh_installchangelogs -a dh_installdocs -a dh_movefiles --sourcedir=debian/tmp -a -v dh_link -a dh_strip -a dh_compress -a dh_fixperms -a dh_makeshlibs -a dh_installdeb -a dh_shlibdeps -a dh_gencontrol -a dh_md5sums -a dh_builddeb -a binary: binary-arch .PHONY: clean install build clean-patched binary-indep binary-arch binary debian/copyright0000644000000000000000000007621011772530746011143 0ustar X-Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat X-Debianized-By: Michele Baldessari X-Debianized-Date: Thu, 27 Mar 2008 23:36:42 +0200. X-Source-Downloaded-From: ftp://ftp.mozilla.org/pub/mozilla.org/security/jss/releases/ Files: mozilla/security/coreconf/*, mozilla/security/jss/Makefile, mozilla/security/jss/manifest.nm, mozilla/security/jss/config/*, mozilla/security/jss/lib/*, mozilla/security/jss/org/mozilla/jss/*, mozilla/security/jss/samples/* Copyright: © 1998 Netscape Communications Corporation © 1998-2008 The Mozilla Project License: LGPL-2.1+ | GPL-2+ | MPL-1.1 Files: debian/* Copyright: © 2008 Michele Baldessari License: LGPL-2.1+ | GPL-2+ | MPL-1.1 Licence: MPL-1.1 MOZILLA PUBLIC LICENSE Version 1.1 --------------- 1. Definitions. 1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party. 1.1. "Contributor" means each entity that creates or contributes to the creation of Modifications. 1.2. "Contributor Version" means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor. 1.3. "Covered Code" means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof. 1.4. "Electronic Distribution Mechanism" means a mechanism generally accepted in the software development community for the electronic transfer of data. 1.5. "Executable" means Covered Code in any form other than Source Code. 1.6. "Initial Developer" means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A. 1.7. "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. 1.8. "License" means this document. 1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. 1.9. "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications. B. Any new file that contains any part of the Original Code or previous Modifications. 1.10. "Original Code" means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License. 1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. 1.11. "Source Code" means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge. 1.12. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. Source Code License. 2.1. The Initial Developer Grant. The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and (b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof). (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License. (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices. 2.2. Contributor Grant. Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code. (d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor. 3. Distribution Obligations. 3.1. Application of License. The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. 3.2. Availability of Source Code. Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. 3.3. Description of Modifications. You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. 3.4. Intellectual Property Matters (a) Third Party Claims. If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. (b) Contributor APIs. If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file. (c) Representations. Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License. 3.5. Required Notices. You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. 3.6. Distribution of Executable Versions. You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. 3.7. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. 4. Inability to Comply Due to Statute or Regulation. If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Application of this License. This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code. 6. Versions of the License. 6.1. New Versions. Netscape Communications Corporation ("Netscape") may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. 6.2. Effect of New Versions. Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License. 6.3. Derivative Works. If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.) 7. DISCLAIMER OF WARRANTY. COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 8. TERMINATION. 8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. 8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that: (a) such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above. (b) any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant. 8.3. If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. 8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination. 9. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 10. U.S. GOVERNMENT END USERS. The Covered Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein. 11. MISCELLANEOUS. This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. 12. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. 13. MULTIPLE-LICENSED CODE. Initial Developer may designate portions of the Covered Code as "Multiple-Licensed". "Multiple-Licensed" means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the NPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A. EXHIBIT A -Mozilla Public License. ``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 Initial Developer of the Original Code is ________________________. Portions created by ______________________ are Copyright (C) ______ _______________________. All Rights Reserved. Contributor(s): ______________________________________. Alternatively, the contents of this file may be used under the terms of the _____ license (the "[___] License"), in which case the provisions of [______] License are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the [____] License 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 [___] License. If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the [___] License." [NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.] ---------------------------------------------------------------------- AMENDMENTS The Netscape Public License Version 1.1 ("NPL") consists of the Mozilla Public License Version 1.1 with the following Amendments, including Exhibit A-Netscape Public License. Files identified with "Exhibit A-Netscape Public License" are governed by the Netscape Public License Version 1.1. Additional Terms applicable to the Netscape Public License. I. Effect. These additional terms described in this Netscape Public License -- Amendments shall apply to the Mozilla Communicator client code and to all Covered Code under this License. II. "Netscape's Branded Code" means Covered Code that Netscape distributes and/or permits others to distribute under one or more trademark(s) which are controlled by Netscape but which are not licensed for use under this License. III. Netscape and logo. This License does not grant any rights to use the trademarks "Netscape", the "Netscape N and horizon" logo or the "Netscape lighthouse" logo, "Netcenter", "Gecko", "Java" or "JavaScript", "Smart Browsing" even if such marks are included in the Original Code or Modifications. IV. Inability to Comply Due to Contractual Obligation. Prior to licensing the Original Code under this License, Netscape has licensed third party code for use in Netscape's Branded Code. To the extent that Netscape is limited contractually from making such third party code available under this License, Netscape may choose to reintegrate such code into Covered Code without being required to distribute such code in Source Code form, even if such code would otherwise be considered "Modifications" under this License. V. Use of Modifications and Covered Code by Initial Developer. V.1. In General. The obligations of Section 3 apply to Netscape, except to the extent specified in this Amendment, Section V.2 and V.3. V.2. Other Products. Netscape may include Covered Code in products other than the Netscape's Branded Code which are released by Netscape during the two (2) years following the release date of the Original Code, without such additional products becoming subject to the terms of this License, and may license such additional products on different terms from those contained in this License. V.3. Alternative Licensing. Netscape may license the Source Code of Netscape's Branded Code, including Modifications incorporated therein, without such Netscape Branded Code becoming subject to the terms of this License, and may license such Netscape Branded Code on different terms from those contained in this License. VI. Litigation. Notwithstanding the limitations of Section 11 above, the provisions regarding litigation in Section 11(a), (b) and (c) of the License shall apply to all disputes relating to this License. EXHIBIT A-Netscape Public License. "The contents of this file are subject to the Netscape 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/NPL/ 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 Mozilla Communicator client code, released March 31, 1998. The Initial Developer of the Original Code is Netscape Communications Corporation. Portions created by Netscape are Copyright (C) 1998-1999 Netscape Communications Corporation. All Rights Reserved. Contributor(s): ______________________________________. Alternatively, the contents of this file may be used under the terms of the _____ license (the "[___] License"), in which case the provisions of [______] License are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the [____] License and not to allow others to use your version of this file under the NPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the [___] License. If you do not delete the provisions above, a recipient may use your version of this file under either the NPL or the [___] License." On Debian machines, the full text of the GNU Lesser General Public License be found in the file /usr/share/common-licenses/LGPL, the full text of the GNU General Public License in the file /usr/share/common-licenses/GPL. debian/libjss-java.links0000644000000000000000000000024311772530746012450 0ustar # Required by ldapjdk usr/share/java/jss-4.3.1.jar usr/share/java/jss.jar # Required by idm-console-framework usr/share/java/jss-4.3.1.jar usr/share/java/jss4.jar debian/README.source0000644000000000000000000000256611772530746011372 0ustar The original jss-4.3.1 tarball is missing mozilla's security build system called 'coreconf'. Currently I'm patching it in (will ask upstream to include it in their tarballs directly) via the following cvs pull: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot/ co mozilla/security/coreconf This package uses dpatch to manage all modifications to the upstream source. Changes are stored in the source package as diffs in debian/patches and applied during the build. To get the fully patched source after unpacking the source package, cd to the root level of the source package and run: debian/rules patch Removing a patch is as simple as removing its entry from the debian/patches/00list file, and please also remove the patch file itself. Creating a new patch is done with "dpatch-edit-patch patch XX_patchname" where you should replace XX with a new number and patchname with a descriptive shortname of the patch. You can then simply edit all the files your patch wants to edit, and then simply "exit 0" from the shell to actually create the patch file. To tweak an already existing patch, call "dpatch-edit-patch XX_patchname" and replace XX_patchname with the actual filename from debian/patches you want to use. To clean up afterwards again, "debian/rules unpatch" will do the work for you - or you can of course choose to call "fakeroot debian/rules clean" all together.