diff --git a/mozilla/security/jss/cmd/jssjava/GenNativesToRegister.pl b/mozilla/security/jss/cmd/jssjava/GenNativesToRegister.pl deleted file mode 100644 index 56794b3a563..00000000000 --- a/mozilla/security/jss/cmd/jssjava/GenNativesToRegister.pl +++ /dev/null @@ -1,252 +0,0 @@ -#!/usr/bin/perl -# -# 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 Netscape are -# Copyright (C) 1998-2000 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the -# terms of the GNU General Public License Version 2 or later (the -# "GPL"), in which case the provisions of the GPL are applicable -# instead of those above. If you wish to allow use of your -# version of this file only under the terms of the GPL and not to -# allow others to use your version of this file under the MPL, -# indicate your decision by deleting the provisions above and -# replace them with the notice and other provisions required by -# the GPL. If you do not delete the provisions above, a recipient -# may use your version of this file under either the MPL or the -# GPL. -# - -############################################################################ -# (I) Offer a standard "Usage:" statement and process command line options # -############################################################################ - - # (A) Print out the "Usage:" statement since there must always - # be at least TWO command line arguments to $0. - - if ( "$ARGV[1]" eq "" ) - { -USAGE: - print( STDERR "Usage: perl " ); - print( STDERR $0 ); - print( STDERR " " ); - print( STDERR " " ); - print( STDERR " [jni_header_2] . . ." ); - print( STDERR " [jni_header_n]\n" ); - exit( -1 ); - } - - # (B) Initialize array index - - $index = 0; - - # (C) Process all command line options - - while( $_ = $ARGV[0] ) - { - if( ( "$ARGV[0]" eq "help" ) || ( "$ARGV[0]" eq "?" ) ) - { - # (1) print Usage: message - goto USAGE; - } - elsif( "$ARGV[0]" =~ /^(.*).h$/ ) - { - # (2) retrieve name of generated file - $generated_header_filename = $ARGV[0]; - } - else - { - # (3) retrieve name of jni file - $jni_header_filename[$index] = "_jni/"; - $jni_header_filename[$index] .= $ARGV[0]; - $jni_header_filename[$index] =~ s/\./_/g; - $jni_header_filename[$index] .= ".h"; - - # (4) store class "path" of jni - $jni_class_path[$index] = $ARGV[0]; - $jni_class_path[$index] =~ s/\./\//g; - - # (5) compose native "name" of jni array entry - $jni_native_methods[$index] = "&"; - $jni_native_methods[$index] .= $ARGV[0]; - $jni_native_methods[$index] =~ s/\./_/g; - $jni_native_methods[$index] .= "_natives[0]"; - - $index++; - } - - shift; - } - -############################################################################ -# (II) Generate header file containing native method registration material # -############################################################################ - - # (A) If it exists, remove the old header file - # prior to regenerating a new header file - - if( -e $generated_header_filename ) - { - unlink $generated_header_filename; - } - - # (B) Create a new file that will contain all - # native method registration material - - open( FD, ">>$generated_header_filename" ); - - # (C) Compose header section of new file - - # (1) print the static portion - print( FD "/**-- DO NOT EDIT THIS FILE. IT IS MACHINE GENERATED --**/\n" ); - print( FD "#include \n\n" ); - - # (2) print the computed portion - for( $index = 0; $index < scalar( @jni_header_filename ); $index++ ) - { - print( FD "#include \"$jni_header_filename[$index]\"\n" ); - } - - print( FD "\n" ); - - # (D) Process all jni files - - for( $index = 0; $index < scalar( @jni_header_filename ); $index++ ) - { - # (1) initialize $class, $method, $signature, - # $jnimethod, and $jnimethod_count - $class = ""; - $method = ""; - $signature = ""; - $jnimethod = ""; - - $jnimethod_count[$index] = 0; - - # (2) open this jni file - open( JNIFD, $jni_header_filename[$index] ); - - # (3) process first value of "Class:" in this jni file - while( $line = ) - { - if( $line =~ /Class:/ ) - { - # (a) remove all trailing white space - $line =~ s/\s*$//; - - # (b) assign relevant portion of "Class:" string - $class = substr( $line, rindex( $line, " " ) + 1 ); - - # (c) print "Class:" string to file as an array name - print( FD "const JNINativeMethod ", $class, "_natives[] =\n" ); - print( FD "{\n" ); - - # (d) break - last; - } - } - - # (4) process each value of "Method:", "Signature:", - # and "JNIEXPORT" in this jni file - while( $line = ) - { - if( $line =~ /Method:/ ) - { - # (a) remove all trailing white space - $line =~ s/\s*$//; - - # (b) assign relevant portion of "Method:" string - $method = substr( $line, rindex( $line, " " ) + 1 ); - } - elsif( $line =~ /Signature:/ ) - { - # (c) remove all trailing white space - $line =~ s/\s*$//; - - # (d) assign relevant portion of "Signature:" string - $signature = substr( $line, rindex( $line, " " ) + 1 ); - } - elsif( $line =~ /JNIEXPORT/ ) - { - # (e) remove all trailing white space - $line =~ s/\s*$//; - - # (f) assign relevant portion of "JNIEXPORT" string - $jnimethod = substr( $line, rindex( $line, " " ) + 1 ); - } - - # (5) construct array entry from $method, - # $signature, and $jnimethod - if( ( $method ne "" ) && - ( $signature ne "" ) && - ( $jnimethod ne "" ) ) - { - # (a) print an array value - print( FD " {\"", $method, "\", " ); - print( FD "\"", $signature, "\", " ); - print( FD "(void *)", $jnimethod, "},\n" ); - - # (b) increment the total number of - # JNI methods for this file - $jnimethod_count[$index]++; - - # (c) reset $method, $signature, - # and $jnimethod to be empty - $method = ""; - $signature = ""; - $jnimethod = ""; - } - } - - # (5) terminate this native JNI methods array - print( FD " 0\n" ); - print( FD "};\n\n" ); - - # (6) close this jni file - close( JNIFD ); - - # (7) move to next jni file - shift; - } - - # (E) Compose footer section of new file - - # (1) print the static portion - print( FD "struct native_methods {\n" ); - print( FD " char *classname;\n" ); - print( FD " int nmethods;\n" ); - print( FD " const JNINativeMethod *nat_methods;\n" ); - print( FD "} nativeMethods[] =\n" ); - print( FD "{\n" ); - - # (2) print the computed portion - for( $index = 0; $index < scalar( @jni_header_filename ); $index++ ) - { - print( FD " {\"$jni_class_path[$index]\", " ); - print( FD "$jnimethod_count[$index], " ); - print( FD "$jni_native_methods[$index]},\n" ); - } - - # (3) terminate the footer - print( FD " 0\n" ); - print( FD "};\n\n" ); - - # (F) Close the new file that now contains all - # native method registration material - - close( FD ); - diff --git a/mozilla/security/jss/cmd/jssjava/Makefile b/mozilla/security/jss/cmd/jssjava/Makefile deleted file mode 100644 index c68bd604c77..00000000000 --- a/mozilla/security/jss/cmd/jssjava/Makefile +++ /dev/null @@ -1,103 +0,0 @@ -#! gmake -# -# 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 Netscape are -# Copyright (C) 1998-2000 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the -# terms of the GNU General Public License Version 2 or later (the -# "GPL"), in which case the provisions of the GPL are applicable -# instead of those above. If you wish to allow use of your -# version of this file only under the terms of the GPL and not to -# allow others to use your version of this file under the MPL, -# indicate your decision by deleting the provisions above and -# replace them with the notice and other provisions required by -# the GPL. If you do not delete the provisions above, a recipient -# may use your version of this file under either the MPL or the -# GPL. -# - -all:: - gmake -f jnigen.mk - gmake -f csrcs.mk - -import:: - gmake -f jnigen.mk import - gmake -f csrcs.mk import - -clean:: - gmake -f jnigen.mk clean - gmake -f csrcs.mk clean - -export:: - gmake -f jnigen.mk export - gmake -f csrcs.mk export - -private_export:: - gmake -f jnigen.mk private_export - gmake -f csrcs.mk private_export - -libs:: - gmake -f jnigen.mk libs - gmake -f csrcs.mk libs - -program:: - gmake -f jnigen.mk program - gmake -f csrcs.mk program - -install:: - gmake -f jnigen.mk install - gmake -f csrcs.mk install - -release:: - gmake -f jnigen.mk release - gmake -f csrcs.mk release - -release_clean:: - gmake -f jnigen.mk release_clean - gmake -f csrcs.mk release_clean - -release_export:: - gmake -f jnigen.mk release_export - gmake -f csrcs.mk release_export - -release_classes:: - gmake -f jnigen.mk release_classes - gmake -f csrcs.mk release_classes - -ifneq ($(POLICY),) -release_policy:: - gmake -f jnigen.mk release_policy - gmake -f csrcs.mk release_policy -endif - -release_md:: - gmake -f jnigen.mk release_md - gmake -f csrcs.mk release_md - -release_jars:: - gmake -f jnigen.mk release_jars - gmake -f csrcs.mk release_jars - -release_cpdistdir:: - gmake -f jnigen.mk release_cpdistdir - gmake -f csrcs.mk release_cpdistdir - -tests:: - gmake -f jnigen.mk tests - gmake -f csrcs.mk tests diff --git a/mozilla/security/jss/cmd/jssjava/README b/mozilla/security/jss/cmd/jssjava/README deleted file mode 100644 index 779f8c605e6..00000000000 --- a/mozilla/security/jss/cmd/jssjava/README +++ /dev/null @@ -1,387 +0,0 @@ -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 Netscape Security Services for Java. - -The Initial Developer of the Original Code is Netscape -Communications Corporation. Portions created by Netscape are -Copyright (C) 1998-2000 Netscape Communications Corporation. All -Rights Reserved. - -Contributor(s): - -Alternatively, the contents of this file may be used under the -terms of the GNU General Public License Version 2 or later (the -"GPL"), in which case the provisions of the GPL are applicable -instead of those above. If you wish to allow use of your -version of this file only under the terms of the GPL and not to -allow others to use your version of this file under the MPL, -indicate your decision by deleting the provisions above and -replace them with the notice and other provisions required by -the GPL. If you do not delete the provisions above, a recipient -may use your version of this file under either the MPL or the -GPL. -**************************************************************** - -Ninja 1.5 -Build 1998???? - -**************************************************************** -** -** Directory organization of this release -** -**************************************************************** - -The domestic version of this release is located under: -- /m/dist/ninja/domestic/JSS_1_5 - -The export version of this release is located under: -- /m/dist/ninja/export/JSS_1_5 - -Each version of the release consists of the following: -- a JAR file, xpclass.jar, that contains all of the public class files. - -- a JAR file, xpclass_g.jar, that contains all of the debuggable public class - files. - -- directories: where is of the form - [_][_]_.OBJ - For example, - IRIX6.2_DBG.OBJ (debug build) - SunOS5.5.1_OPT.OBJ (optimized build) - SunOS5.5.1_gcc_DBG.OBJ (built using the non-native compiler gcc) - OSF1V4.0_PTH_DBG.OBJ (PTH means the implementation uses pthreads.) - AIX4.1_PTH_USER_DBG.OBJ (PTH_USER means the implementation is - a combination of user-level threads and pthreads.) - - Under each directory is the file, mdbinary.jar. This is a - JAR file containing the compiled programs and libraries. - -************************************************************ -** -** Java Cross-platform code -** (Debug and Optimized, Domestic and Export) -** -************************************************************ - -All java code is built once per tree instance, and MUST be -built using the latest JDK available on all of the platforms. -At the current time, this is JDK 1.1.6. - -************************************************************ -** -** Platforms supported for Native JNI code -** (Debug and Optimized, Domestic and Export) -** -************************************************************ - -The following platforms are supported: -- Solaris on sparc: 2.5.1 (built with cc and JDK 1.1.6 libraries - running on native threads [Sun threads]) -- Solaris on sparc: 2.6 (symbolically linked to corresponding - Solaris 2.5.1 releases) -- WIN95: 4.0 (built with Visual C++ 5.0 and JDK 1.1.6 - libraries running on non-fiberous threads) -- WINNT: 4.0 (symbolically linked to corresponding - Windows 95 4.0 releases) -- HP-UX: B.11.00 (built with cc and JDK 1.1.5 libraries - running on native threads [pthreads]) - -************************************************************ -** -** Future platforms supported for Native JNI code -** (Debug and Optimized, Domestic and Export) -** -************************************************************ - -The following platforms will be supported in the near future: -- AIX: 4.3 (built with cc and JDK 1.1.6 libraries - running on native threads [pthreads]) -- IRIX: 6.2 (built with cc with "-n32" and JDK 1.1.5 - libraries running on native threads [pthreads]) -- OSF/1: 4.0D (built with cc and JDK 1.1.6 libraries - running on native threads [pthreads]) -- Linux: 2.1 (built with gcc and JDK 1.1.3 libraries - running on native threads [pthreads]) - -************************************************************ -** -** How to build Ninja yourself -** -************************************************************ - -To build this version of Ninja yourself, execute the following -instructions: - -On UNIX machines (assuming tcsh): - - For the FIRST INSTANCE of Ninja in your build tree: - - 1) IMPORTANT: If you have NOT built Ninja in your current tree, and - this is the FIRST platform that you are building it on, - then you MUST set the following environment variable - in order to build JAVA and JNI headers!!! Additionally, - this platform MUST utilize the latest "approved" version - of the JDK, since JAVA and JNI headers are only ever - built ONCE per instance of build tree!!! Note that at - the time of this writing, the only acceptible INITIAL - UNIX build platforms are Sun, AIX, and OSF/1. - - setenv NS_USE_JDK_TOOLSET 1 - - 2) You MAY need to set the following environment variables for this - platform: - - setenv CVSROOT /m/src - setenv USE_PTHREADS 1 - setenv USE_N32 1 - setenv JAVA_HOME [...] - - 3) You MAY need to unset the following environment variables for this - platform: - - unsetenv CVSREAD - unsetenv JAVAC - unsetenv JAVAH - unsetenv JMC - unsetenv USE_PTHREADS - unsetenv USE_N32 - - 4) Check out the following source code directories (FIRST TIME ONLY!) - - cvs co ns/coreconf - cvs co -r JSS_1_5 ns/ninja - cvs co ns/security/lib - cvs co -r JSS_1_5 ns/security/lib/manifest.mn - - 5) Setup ns/coreconf to reference the correct compiler paths for this - platform - - cd ns/coreconf - source ./.cshrc - - 6) Build "nsinstall" executable for this platform - - gmake - gmake BUILD_OPT=1 - - 7) Import Ninja support files for this platform - - cd ../ninja - gmake import - gmake BUILD_OPT=1 import - - 8) Change to the security directory - - cd ../security/lib - - 9) Build the security library - - gmake private_export - gmake - gmake BUILD_OPT=1 - - 10) Change back to the ninja directory - - cd ../../ninja - - 11) Create Ninja private exports (FIRST TIME ONLY!) - - gmake private_export - - 12) Begin building Ninja from a "fresh" tree (FIRST TIME ONLY!) - - gmake clean - gmake BUILD_OPT=1 clean - - 13) Build "standard debuggable" version for this UNIX - (e. g. - SunOS5.5.1_DBG.OBJ) - - gmake - - 14) Build "standard optimized" version for this UNIX - (e. g. - SunOS5.5.1_OPT.OBJ) - - gmake BUILD_OPT=1 - - 15) You MUST always ensure that the following environment variable - is UNSET for ALL of the remaining builds!!!: - - unsetenv NS_USE_JDK_TOOLSET - - 16) Build "_g debuggable" version for this UNIX - (e. g. - SunOS5.5.1_DBG.OBJ) - - gmake JDK_DEBUG=1 - - - For the FOLLOWING INSTANCES of Ninja in your build tree: - - 17) You MUST always ensure that the following environment variables - are UNSET for ALL of the remaining builds!!!: - - unsetenv NS_USE_JDK_TOOLSET - unsetenv USE_PTHREADS - unsetenv USE_N32 - - 18) You MAY need to set the following environment variables for this - platform: - - setenv CVSROOT /m/src - setenv USE_PTHREADS 1 (this MUST be set on IRIX ONLY!!!) - setenv USE_N32 1 (this MUST be set on IRIX ONLY!!!) - setenv JAVA_HOME [...] - - 19) You MAY need to unset the following environment variables for this - platform: - - unsetenv CVSREAD - unsetenv JAVAC - unsetenv JAVAH - unsetenv JMC - - 20) Setup ns/coreconf to reference the correct compiler paths for this - platform - - cd ns/coreconf - source ./.cshrc - - 21) Build "nsinstall" executable for this platform - - gmake - gmake BUILD_OPT=1 - - 22) Import Ninja support files for this platform - - cd ../ninja - gmake import - gmake BUILD_OPT=1 import - - 23) Change to the security directory - - cd ../security/lib - - 24) Build the security library - - gmake private_export - gmake - gmake BUILD_OPT=1 - - 25) Change back to the ninja directory - - cd ../../ninja - - 26) Build "standard debuggable" version for this UNIX - (e. g. - SunOS5.5.1_DBG.OBJ) - - gmake - - 27) Build "standard optimized" version for this UNIX - (e. g. - SunOS5.5.1_OPT.OBJ) - - gmake BUILD_OPT=1 - - 28) Build "_g debuggable" version for this UNIX - (e. g. - SunOS5.5.1_DBG.OBJ) - - gmake JDK_DEBUG=1 - - - -On Windows NT machines (assuming DOS shell): - - For the FIRST INSTANCE of Ninja in your build tree: - - 1) IMPORTANT: If you have NOT built Ninja in your current tree, and - this is the FIRST platform that you are building it on, - then you MUST set the following environment variable - in order to build JAVA and JNI headers!!! Additionally, - this platform MUST utilize the latest "approved" version - of the JDK, since JAVA and JNI headers are only ever - built ONCE per instance of build tree!!! - - set NS_USE_JDK_TOOLSET=1 - - 2) Set the following environment variables for this platform: - - set OS_TARGET=WIN95 - set CVSROOT=:pserver:@cvsserver:/m/src - set JAVA_HOME=[location of local JDK] (use UNIX forward slashes!) - - 3) You MAY need to unset the following environment variables for this - platform: - - unset CVSREAD - unset JAVAC - unset JAVAH - unset JMC - - 4) Check out the following source code directories (FIRST TIME ONLY!) - - cvs login - cvs co ns/coreconf - cvs co -r JSS_1_5 ns/ninja - cvs co ns/security/lib - cvs co -r JSS_1_5 ns/security/lib/manifest.mn - - 5) Import Ninja support files for this platform - - cd ..\ninja - gmake import - gmake BUILD_OPT=1 import - - 6) Change to the security directory - - cd ..\security\lib - - 7) Build the security library - - gmake private_export - gmake - gmake BUILD_OPT=1 - - 8) Change back to the ninja directory - - cd ..\..\ninja - - 9) Create Ninja private exports (FIRST TIME ONLY!) - - gmake private_export - - 10) HACK: Use the MKS toolkit shell (sh.exe) instead of shmsdos.exe!!! - - copy shmsdos.exe shmsdos.sav - copy [MKS home]\sh.exe shmsdos.exe - - 11) Begin building Ninja from a "fresh" tree (FIRST TIME ONLY!) - - gmake clean - gmake BUILD_OPT=1 clean - - 12) Build "standard debuggable" WIN954.0_DBG.OBJ version - - gmake - - 13) Build "standard optimized" WIN954.0_OPT.OBJ version - - gmake BUILD_OPT=1 - - 14) You MUST always ensure that the following environment variable - is UNSET for ALL of the remaining builds!!!: - - unset NS_USE_JDK_TOOLSET - - 15) Build "_g debuggable" WIN954.0_DBG.OBJ version - - gmake JDK_DEBUG=1 - - 16) IMPORTANT: Restore original shmsdos.exe!!! - - copy shmsdos.sav shmsdos.exe diff --git a/mozilla/security/jss/cmd/jssjava/README.NSS b/mozilla/security/jss/cmd/jssjava/README.NSS deleted file mode 100644 index 261e748cd66..00000000000 --- a/mozilla/security/jss/cmd/jssjava/README.NSS +++ /dev/null @@ -1,67 +0,0 @@ -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 Netscape Security Services for Java. - -The Initial Developer of the Original Code is Netscape -Communications Corporation. Portions created by Netscape are -Copyright (C) 1998-2000 Netscape Communications Corporation. All -Rights Reserved. - -Contributor(s): - -Alternatively, the contents of this file may be used under the -terms of the GNU General Public License Version 2 or later (the -"GPL"), in which case the provisions of the GPL are applicable -instead of those above. If you wish to allow use of your -version of this file only under the terms of the GPL and not to -allow others to use your version of this file under the MPL, -indicate your decision by deleting the provisions above and -replace them with the notice and other provisions required by -the GPL. If you do not delete the provisions above, a recipient -may use your version of this file under either the MPL or the -GPL. - -********************************************************************** - -README.ninja contains instructions for building Ninja normally. -The following addenda tell how to build the version of Ninja that -is included with NSS 2.0. - -1. Checkout ns/ninja with the tag NSS2_0_RELEASE instead of JSS_1_3. - -2. Before building, do "setenv STANDALONE_LIBJSS 1". This will cause -libjss.so/jss.dll to have NSPR embedded in it. Normal Ninja builds do -not embed NSPR. - -3. To release to /m/dist, do NOT do "gmake release". First set the release -version to something suitable by doing something like -"setenv RELEASE_VERSION NSS_2_0". Then, in the top level directory of -ninja (ns/ninja), do "gmake nss_release". This will create one of the -following outputs in /m/dist/ninja/: - -UNIX -==== -unixjss.tar - - jss.zip - - contains JSS classes for SSL and initialization - - libjss.so - - native implementation library, consists of security, NSPR, DBM, - and the native JSS code. - -WINDOWS -======= -winjss.zip - - jss.zip - - same as in the UNIX version, contains JSS classes for SSL - and initialization - - jss.dll - - native implementation library, consists of security, NSPR, DBM, - and the native JSS code. diff --git a/mozilla/security/jss/cmd/jssjava/config.mk b/mozilla/security/jss/cmd/jssjava/config.mk deleted file mode 100644 index 2c2b4825c43..00000000000 --- a/mozilla/security/jss/cmd/jssjava/config.mk +++ /dev/null @@ -1,109 +0,0 @@ -# -# 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 Netscape are -# Copyright (C) 1998-2000 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the -# terms of the GNU General Public License Version 2 or later (the -# "GPL"), in which case the provisions of the GPL are applicable -# instead of those above. If you wish to allow use of your -# version of this file only under the terms of the GPL and not to -# allow others to use your version of this file under the MPL, -# indicate your decision by deleting the provisions above and -# replace them with the notice and other provisions required by -# the GPL. If you do not delete the provisions above, a recipient -# may use your version of this file under either the MPL or the -# GPL. -# -####################################################################### -# Adjust specific variables for specific platforms # -####################################################################### - -# We don't need static, import, or purify libraries -LIBRARY= -IMPORT_LIBRARY= -PURE_LIBRARY= - -# Get rid of embedded "32" in library names on Windows -ifeq ($(OS_ARCH),WINNT) -SHARED_LIBRARY := $(subst 32,,$(SHARED_LIBRARY)) -SHARED_LIBRARY_G := $(subst 32,,$(SHARED_LIBRARY_G)) -endif - -####################################################################### -# Adjust specific variables for all platforms # -####################################################################### - -OS_CFLAGS += -DNSPR20=1 - -ifeq ($(OS_ARCH),WINNT) -LDOPTS += -PDB:NONE -endif - -# Only used for "sanitizing" the release -STATIC_LIB_EXTENSION= -DYNAMIC_LIB_EXTENSION= -PURE_LIB_EXTENSION= - -# Include "funky" link path to pick up ALL native libraries for OSF/1. -ifeq ($(OS_ARCH), OSF1) - JAVA_LIBS += -L$(JAVA_HOME)/$(JAVA_LIBDIR).no -endif - -####################################################################### -# Set the LDFLAGS value to encompass all normal link options and all # -# special system linking options # -####################################################################### -ifneq ($(STANDALONE_LIBJSS),0) -LDFLAGS += $(LDOPTS) $(LIBJSSSSL) $(LIBJSSMANAGE) $(LIBSVRPLCY) $(LIBJSSPOLICY) $(LIBJSSPKCS11) $(LIBJSSMANAGE) $(LIBJSSCRYPTO) $(LIBJSSPKCS11) $(LIBJSSUTIL) $(LIBJSSMANAGE) $(LIBSSL) $(LIBPKCS7) $(LIBCERT) $(LIBKEY) $(LIBSECMOD) $(LIBJSSHCLHACKS) $(LIBCRYPTO) $(LIBSECUTIL) $(LIBSECMOD) $(LIBSSL) $(LIBPKCS12) $(LIBPKCS7) $(LIBCERT) $(LIBKEY) $(LIBCRYPTO) $(LIBSECUTIL) $(LIBHASH) $(LIBDBM) $(LIBPLDS) $(LIBPLC) $(LIBPR) $(JAVA_LIBS) $(DLLSYSTEM) -else -LDFLAGS += $(LDOPTS) $(LIBJSSSSL) $(LIBJSSMANAGE) $(LIBSVRPLCY) $(LIBJSSPOLICY) $(LIBJSSPKCS11) $(LIBJSSMANAGE) $(LIBJSSCRYPTO) $(LIBJSSPKCS11) $(LIBJSSUTIL) $(LIBJSSMANAGE) $(LIBSSL) $(LIBPKCS7) $(LIBCERT) $(LIBKEY) $(LIBSECMOD) $(LIBJSSHCLHACKS) $(LIBCRYPTO) $(LIBSECUTIL) $(LIBSECMOD) $(LIBSSL) $(LIBPKCS12) $(LIBPKCS7) $(LIBCERT) $(LIBKEY) $(LIBCRYPTO) $(LIBSECUTIL) $(LIBHASH) $(LIBDBM) $(DLLPLDS) $(DLLPLC) $(DLLPR) $(JAVA_LIBS) $(DLLSYSTEM) -endif - -####################################################################### -# Set the LD_LIBS value to encompass all static JSS, security, and # -# dbm libraries # -####################################################################### - -ifeq ($(OS_ARCH), OSF1) - LD_LIBS += $(LIBJSSSSL) $(LIBJSSMANAGE) $(LIBSVRPLCY) $(LIBJSSPOLICY) $(LIBJSSPKCS11) $(LIBJSSCRYPTO) $(LIBJSSUTIL) $(LIBJSSHCLHACKS) $(LIBSSL) $(LIBSECMOD) $(LIBPKCS12) $(LIBCERT) $(LIBPKCS7) $(LIBKEY) $(LIBCRYPTO) $(LIBHASH) $(LIBSECUTIL) $(LIBDBM) -else - LD_LIBS += $(LIBJSSSSL) $(LIBJSSMANAGE) $(LIBSVRPLCY) $(LIBJSSPOLICY) $(LIBJSSPKCS11) $(LIBJSSMANAGE) $(LIBJSSCRYPTO) $(LIBJSSUTIL) $(LIBJSSHCLHACKS) $(LIBJSSMANAGE) $(LIBSSL) $(LIBSECMOD) $(LIBPKCS12) $(LIBCERT) $(LIBPKCS7) $(LIBKEY) $(LIBCRYPTO) $(LIBHASH) $(LIBSECUTIL) $(LIBDBM) -endif - -####################################################################### -# Append additional LD_LIBS value to encompass all dynamic NSPR 2.0, # -# java, and system libraries # -####################################################################### -ifneq ($(STANDALONE_LIBJSS),0) -# NSPR is included in libjss -ifeq ($(OS_ARCH), WINNT) - LD_LIBS += $(LIBPLDS) $(LIBPLC) $(LIBPR) $(JAVA_LIBS) $(DLLSYSTEM) -else - LD_LIBS += -L$(SOURCE_LIB_DIR) $(LIBPLDS) $(LIBPLC) $(LIBPR) $(JAVA_LIBS) $(DLLSYSTEM) -endif - -else -# NSPR is not included in libjss -ifeq ($(OS_ARCH), WINNT) - LD_LIBS += $(DLLPLDS) $(DLLPLC) $(DLLPR) $(JAVA_LIBS) $(DLLSYSTEM) -else - LD_LIBS += -L$(SOURCE_LIB_DIR) -lplds3 -lplc3 -lnspr3 $(JAVA_LIBS) $(DLLSYSTEM) -endif - -endif diff --git a/mozilla/security/jss/cmd/jssjava/csrcs.mk b/mozilla/security/jss/cmd/jssjava/csrcs.mk deleted file mode 100644 index 56b7d37f340..00000000000 --- a/mozilla/security/jss/cmd/jssjava/csrcs.mk +++ /dev/null @@ -1,96 +0,0 @@ -#! gmake -# -# 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 Netscape are -# Copyright (C) 1998-2000 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the -# terms of the GNU General Public License Version 2 or later (the -# "GPL"), in which case the provisions of the GPL are applicable -# instead of those above. If you wish to allow use of your -# version of this file only under the terms of the GPL and not to -# allow others to use your version of this file under the MPL, -# indicate your decision by deleting the provisions above and -# replace them with the notice and other provisions required by -# the GPL. If you do not delete the provisions above, a recipient -# may use your version of this file under either the MPL or the -# GPL. -# - -####################################################################### -# (1) Include initial platform-independent assignments (MANDATORY). # -####################################################################### - -include manifest.mn - -PRIVATE_EXPORTS = registerNatives.h \ - $(NULL) - -REQUIRES = dbm \ - security \ - svrcore \ - $(NULL) - -CSRCS = registerNatives.c \ - jssjava.c \ - $(NULL) - -XP_FILES = README - -# NOTE: Beginning with JSS_2_1, we now ONLY create dynamic libraries . . . -# (e. g. - we no longer build the "jssjava" executable) - -LIBRARY_NAME = jss21 - -# PROGRAM = jssjava - -####################################################################### -# (2) Include "global" configuration information. (OPTIONAL) # -####################################################################### - -include $(CORE_DEPTH)/coreconf/config.mk - -####################################################################### -# (3) Include "component" configuration information. (OPTIONAL) # -####################################################################### - -include $(CORE_DEPTH)/$(MODULE)/config/config.mk - -####################################################################### -# (4) Include "local" platform-dependent assignments (OPTIONAL). # -####################################################################### - -include config.mk - -####################################################################### -# (5) Execute "global" rules. (OPTIONAL) # -####################################################################### - -include $(CORE_DEPTH)/coreconf/rules.mk - -####################################################################### -# (6) Execute "component" rules. (OPTIONAL) # -####################################################################### - -include $(CORE_DEPTH)/$(MODULE)/config/rules.mk - -####################################################################### -# (7) Execute "local" rules. (OPTIONAL). # -####################################################################### - -include rules.mk diff --git a/mozilla/security/jss/cmd/jssjava/jnigen.mk b/mozilla/security/jss/cmd/jssjava/jnigen.mk deleted file mode 100644 index 3019a246e7a..00000000000 --- a/mozilla/security/jss/cmd/jssjava/jnigen.mk +++ /dev/null @@ -1,126 +0,0 @@ -#! gmake -# -# 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 Netscape are -# Copyright (C) 1998-2000 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the -# terms of the GNU General Public License Version 2 or later (the -# "GPL"), in which case the provisions of the GPL are applicable -# instead of those above. If you wish to allow use of your -# version of this file only under the terms of the GPL and not to -# allow others to use your version of this file under the MPL, -# indicate your decision by deleting the provisions above and -# replace them with the notice and other provisions required by -# the GPL. If you do not delete the provisions above, a recipient -# may use your version of this file under either the MPL or the -# GPL. -# - -####################################################################### -# (1) Include initial platform-independent assignments (MANDATORY). # -####################################################################### - -include manifest.mn - -JNI_GEN += org.mozilla.jss.ssl.SSLInputStream \ - org.mozilla.jss.ssl.SSLOutputStream \ - org.mozilla.jss.ssl.SSLSocketImpl \ - org.mozilla.jss.pkcs11.PrivateKeyProxy \ - org.mozilla.jss.pkcs11.PublicKeyProxy \ - org.mozilla.jss.CryptoManager \ - org.mozilla.jss.NSSInit \ - org.mozilla.jss.DatabaseCloser \ - org.mozilla.jss.crypto.Algorithm \ - org.mozilla.jss.crypto.EncryptionAlgorithm \ - org.mozilla.jss.crypto.PQGParams \ - org.mozilla.jss.pkcs11.PK11Token \ - org.mozilla.jss.pkcs11.CertProxy \ - org.mozilla.jss.pkcs11.CipherContextProxy \ - org.mozilla.jss.pkcs11.ModuleProxy \ - org.mozilla.jss.pkcs11.PK11RSAPublicKey \ - org.mozilla.jss.pkcs11.PK11DSAPublicKey \ - org.mozilla.jss.pkcs11.PK11KeyPairGenerator \ - org.mozilla.jss.pkcs11.PK11KeyGenerator \ - org.mozilla.jss.pkcs11.PK11Cert \ - org.mozilla.jss.pkcs11.PK11Cipher \ - org.mozilla.jss.pkcs11.PK11MessageDigest \ - org.mozilla.jss.pkcs11.PK11Module \ - org.mozilla.jss.pkcs11.PK11PrivKey \ - org.mozilla.jss.pkcs11.PK11PubKey \ - org.mozilla.jss.pkcs11.PK11SymKey \ - org.mozilla.jss.pkcs11.SymKeyProxy \ - org.mozilla.jss.pkcs11.SigContextProxy \ - org.mozilla.jss.pkcs11.PK11Signature \ - org.mozilla.jss.pkcs11.PK11Store \ - org.mozilla.jss.pkcs11.PK11KeyWrapper \ - org.mozilla.jss.util.Password \ - org.mozilla.jss.util.Debug \ - org.mozilla.jss.pkcs11.PK11SecureRandom \ - $(NULL) - -####################################################################### -# (2) Include "global" configuration information. (OPTIONAL) # -####################################################################### - -include $(CORE_DEPTH)/coreconf/config.mk - -####################################################################### -# (3) Include "component" configuration information. (OPTIONAL) # -####################################################################### - -include $(CORE_DEPTH)/$(MODULE)/config/config.mk - -####################################################################### -# (4) Include "local" platform-dependent assignments (OPTIONAL). # -####################################################################### - -ALL_TRASH += nativeMethods.h - -####################################################################### -# (5) Execute "global" rules. (OPTIONAL) # -####################################################################### - -include $(CORE_DEPTH)/coreconf/rules.mk - -####################################################################### -# (6) Execute "component" rules. (OPTIONAL) # -####################################################################### - -include $(CORE_DEPTH)/$(MODULE)/config/rules.mk - -####################################################################### -# (7) Execute "local" rules. (OPTIONAL). # -####################################################################### - -export:: - @if test ! -d nativeMethods.h; then \ - echo perl GenNativesToRegister.pl nativeMethods.h $(JNI_GEN) ; \ - perl GenNativesToRegister.pl nativeMethods.h $(JNI_GEN) ; \ - else \ - echo "Checking to see if nativeMethods.h file is out of date" ; \ - cmd="perl regen_nativeMethods.pl $(PERLARG) \ - -d $(JNI_GEN_DIR) nativeMethods.h $(JNI_GEN)"; \ - echo $$cmd; \ - list=`$$cmd`; \ - if test "$${list}x" != "x"; then \ - echo perl GenNativesToRegister.pl nativeMethods.h $(JNI_GEN) ; \ - perl GenNativesToRegister.pl nativeMethods.h $(JNI_GEN) ; \ - fi \ - fi - diff --git a/mozilla/security/jss/cmd/jssjava/jssjava.c b/mozilla/security/jss/cmd/jssjava/jssjava.c deleted file mode 100644 index 0e9bc7085e5..00000000000 --- a/mozilla/security/jss/cmd/jssjava/jssjava.c +++ /dev/null @@ -1,489 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1998-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -/* - * Crypto VM - Java VM with statically linked crypto aka libsec routines. - * - * static routines are registered to VM using JNI API. - */ - -#include -#include "registerNatives.h" -#include "nspr.h" - -#include -#include -#include -#include - -PR_IMPLEMENT( SVRPLCYPolicyType ) -JSS_getExportControlPolicyType( void ); - -#if defined(_WINDOWS) -#define USAGE "Usage: %s [-version] [-debug] [-nojit] [-classpath classpath] [-ms] [-mx] [-D property] \n" -#else -#define USAGE "Usage: %s [-version] [-debug] [-classpath classpath] [-ms] [-mx] [-D property] \n" -#endif - -/* Unique "jssjava" version information */ -/* NOTE: Must be changed for ALL new releases!!! */ -#define JSSJAVA_MAJOR_VERSION "2" -#define JSSJAVA_MINOR_VERSION "1" -#define JDK_MAJOR_VERSION "1.2" -#define JDK_MINOR_VERSION "2" - -/* args & options */ -char * prog_name = 0; -char * classpath = 0; -char * javaclass = 0; -char ** javaArgs = 0; -int numJavaArgs = 0; -int debug = 0; -int jssjava_version = 0; - -/* set property to not load jdkcertsec10 from the beg */ -char ** userProps = 0; -int numUserProps = 0; -static int maxUserProps = 0; - - -static void errExit(int exitCode) -{ -#if defined(DEBUG) && defined(_WINDOWS) - _sleep(10); -#endif - exit(exitCode); -} - -static void addUserProp(char *keyval) -{ - char **newUserProps = 0; - char *val = 0; - - if (maxUserProps < numUserProps+2) { - newUserProps = (char **)calloc(numUserProps+4, sizeof(char *)); - maxUserProps = numUserProps+4; - memcpy(newUserProps, userProps, numUserProps*sizeof(char *)); - userProps = newUserProps; - } - if (val = (char *)strtok(keyval, (const char *)"=")) - *val++ = 0; - userProps[numUserProps++] = keyval; - userProps[numUserProps++] = val; -} - - -static void getArgs (int argc, char *argv[]) -{ - int i,j; - char* msptr; - char* mxptr; - -#ifdef DEBUG_nelsonb - for (i = 0; i < argc; ++i) - puts(argv[i]); -#endif - - prog_name = *argv++; argc--; - - for (i = 0; i < argc; i++) { - if (!strcmp(argv[i], "-version")) { - jssjava_version = 1; - } - else if (!strcmp(argv[i], "-debug")) { - debug = 1; - } - else if (!strcmp(argv[i], "-classpath")) { - if (++i == argc) - break; - classpath = argv[i]; - } - else if (!strcmp(argv[i], "-D")) { - if (++i == argc) - break; - addUserProp(argv[i]); - } -#if defined(_WINDOWS) - else if (!strcmp(argv[i], "-nojit")) { - addUserProp(argv[i]); - } -#endif - else if (!strncmp(argv[i], "-ms", 3)) { - msptr = (char*)malloc(strlen(argv[i]) + 5); - sprintf(msptr, "-X%s", argv[i] + 1); /* skip '-' */ - addUserProp(msptr); - } - else if (!strncmp(argv[i], "-mx", 3)) { - mxptr = (char*)malloc(strlen(argv[i]) + 5); - sprintf(mxptr, "-X%s", argv[i] + 1); /* skip '-' */ - addUserProp(mxptr); - } else if(!strcmp(argv[i], "-info")) { - /* -info is a dummy argument where information can be placed - * that will show up in a ps listing. Its argument is - * ignored. */ - if( i+1 < argc ) { - ++i; - } - } else { - javaclass = argv[i++]; - break; - } - } - if (jssjava_version == 1) { - SVRPLCYPolicyType policy; - char policyString[50]; - - /* First, initialize export control policy information. */ - if( SVRPLCY_InstallUtilityPolicy() != PR_SUCCESS ) { - errExit(-1); - } - - /* Second, establish which export control policy is being used. */ - policy = JSS_getExportControlPolicyType(); - - switch( policy ) { - case SVRPLCYNull: - strcpy( policyString, "null" ); - break; - case SVRPLCYDomestic: - strcpy( policyString, "domestic" ); - break; - case SVRPLCYExport: - strcpy( policyString, "export" ); - break; - case SVRPLCYFrance: - strcpy( policyString, "france" ); - break; - default: - strcpy( policyString, "none" ); - break; - } - - /* Third, print the export control policy & version information: */ - printf( "%s version \"%s.%s\" [%s]\n" - " (uses JDK \"%s.%s\")\n", - prog_name, JSSJAVA_MAJOR_VERSION, JSSJAVA_MINOR_VERSION, - policyString, JDK_MAJOR_VERSION, JDK_MINOR_VERSION ); - errExit(0); - } - if (javaclass == 0) { - printf(USAGE, prog_name); - errExit(1); - } - numJavaArgs = argc - i; - if (numJavaArgs > 0) - javaArgs = &argv[i]; - - for (j = strlen(javaclass)-1; j >= 0; j--) { - if (javaclass[j] == '.') - javaclass[j] = '/'; - } - -} - - -static int setUserProps(JNIEnv *env) -{ - jclass system_cls; - jobject system_props; - jmethodID getprop_mid; - jmethodID setprop_mid; - jclass prop_cls; - jmethodID put_mid; - jstring key, val; - jthrowable exc; - int i; - - /* get java.lang.System class and its get/setProperties methods */ - system_cls = (*env)->FindClass(env, "java/lang/System"); - if (system_cls == 0) { - fprintf(stderr, "Can't find java/lang/System.\n"); - return -1; - } - getprop_mid = (*env)->GetStaticMethodID(env, system_cls, "getProperties", - "()Ljava/util/Properties;"); - if (getprop_mid == 0) { - fprintf(stderr,"Can't find getProperties method in java.lang.System\n"); - return -1; - } - setprop_mid = (*env)->GetStaticMethodID(env, system_cls, "setProperties", - "(Ljava/util/Properties;)V"); - if (setprop_mid == 0) { - fprintf(stderr,"Can't find setProperties method in java.lang.System\n"); - return -1; - } - - /* get system properties, java.util.Properties class and its put method */ - system_props = (*env)->CallStaticObjectMethod(env, system_cls, getprop_mid); - exc = (*env)->ExceptionOccurred(env); - if (exc) { - (*env)->ExceptionDescribe(env); - return -1; - } - prop_cls = (*env)->GetObjectClass(env, system_props); - put_mid = (*env)->GetMethodID(env, prop_cls, "put", - "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - if (put_mid == 0) { - fprintf(stderr, "Can't find put method in java.util.Properties\n"); - return -1; - } - - /* add default prop to not load JSS library */ - key = (*env)->NewStringUTF(env, "jss.load"); - if (key == 0) { - fprintf(stderr, "Out of memory\n"); - return -1; - } - val = (*env)->NewStringUTF(env, "no"); - if (val == 0) { - fprintf(stderr, "Out of memory\n"); - return -1; - } - (void)(*env)->CallObjectMethod(env, system_props, put_mid, - (jobject)key, (jobject)val); - exc = (*env)->ExceptionOccurred(env); - if (exc) { - (*env)->ExceptionDescribe(env); - return -1; - } - - /* add user properties */ - i = 0; - while (i < numUserProps) { - key = (*env)->NewStringUTF(env, userProps[i++]); - if (key == 0) { - fprintf(stderr, "Out of memory\n"); - errExit(1); - } - val = (*env)->NewStringUTF(env, userProps[i++]); - if (val == 0) { - fprintf(stderr, "Out of memory\n"); - errExit(1); - } - (void)(*env)->CallObjectMethod(env, system_props, put_mid, - (jobject)key, (jobject)val); - exc = (*env)->ExceptionOccurred(env); - if (exc) { - (*env)->ExceptionDescribe(env); - return -1; - } - } - - /* set new set of system properties */ - (*env)->CallStaticVoidMethod(env, system_cls, setprop_mid, system_props); - exc = (*env)->ExceptionOccurred(env); - if (exc) { - (*env)->ExceptionDescribe(env); - errExit(1); - } - - return 0; -} - - -static jobjectArray setJavaArgs(JNIEnv *env) -{ - jclass jstr_cls; - jstring jstr; - jobjectArray java_args; - int i; - - jstr_cls = (*env)->FindClass(env, "java/lang/String"); - if (numJavaArgs != 0) { - jstr = (*env)->NewStringUTF(env, javaArgs[0]); - if (jstr == 0) { - fprintf(stderr, "Out of memory\n"); - return 0; - } - java_args = (*env)->NewObjectArray(env, numJavaArgs, jstr_cls, jstr); - if (java_args == 0) { - fprintf(stderr, "Out of memory\n"); - return 0; - } - for (i=1; i < numJavaArgs; i++) { - jstr = (*env)->NewStringUTF(env, javaArgs[i]); - if (jstr == 0) { - fprintf(stderr, "Out of memory\n"); - return 0; - } - (*env)->SetObjectArrayElement(env, java_args, i, jstr); - } - } - else { - java_args = (*env)->NewObjectArray(env, 0, jstr_cls, 0); - if (java_args == 0) { - fprintf(stderr, "Out of memory\n"); - return 0; - } - } - return java_args; -} - - -int main (int argc, char *argv[]) -{ - JDK1_1InitArgs vm_args; - JNIEnv * env; - JavaVM * jvm; - jclass cls; - jmethodID mid; - jobjectArray java_args; - jthrowable exc; - jint res; - - /* get options, check usage */ - getArgs(argc, argv); - - /* initialize VM args */ - /* IMPORTANT: specify vm_args version # for JDK1.1.2 and beyond */ - vm_args.version = 0x00010001; - JNI_GetDefaultJavaVMInitArgs(&vm_args); - - /* set VM args from options */ - if (classpath || (classpath = getenv("CLASSPATH"))) - vm_args.classpath = classpath; - if (debug) - vm_args.debugging = JNI_TRUE; - - /* create Java VM */ - res = JNI_CreateJavaVM(&jvm, &env, &vm_args); - if (res < 0) { - fprintf(stderr, "Can't create Java VM\n"); - errExit(1); - } - - /* set additional system properties */ - if (setUserProps(env) < 0) { - fprintf(stderr, "Error setting system properties.\n"); - errExit(1); - } - - /* register all statically linked native methods. */ - if (registerNatives(env) < 0) { - fprintf(stderr,"Error registering statically linked native methods\n"); - errExit(1); - } - - /* set up java args */ - java_args = setJavaArgs(env); - if (java_args == 0) { - fprintf(stderr, "Error setting up arguments to Java class"); - errExit(1); - } - - PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 0); - - /* find the java class & main method to invoke */ - cls = (*env)->FindClass(env, javaclass); - if (cls == 0) { - fprintf(stderr, "Can't find %s class\n", javaclass); - errExit(1); - } - mid = (*env)->GetStaticMethodID(env,cls,"main","([Ljava/lang/String;)V"); - if (mid == 0) { - fprintf(stderr, "Can't find %s.main\n", javaclass); - errExit(1); - } - - /* call java main */ - (*env)->CallStaticVoidMethod(env, cls, mid, java_args); - exc = (*env)->ExceptionOccurred(env); - if (exc) { - (*env)->ExceptionDescribe(env); - } - -#ifdef DEBUG - /* Garbage collect to run finalizers before exiting. Also, try to - * verify the NativeProxy class, but keep in mind that it might not - * be loaded at all. */ - { - jclass systemClass; - jclass nativeProxyClass; - jmethodID gc; - jmethodID finalize; - jmethodID assertRegistryEmpty; - - /* - * garbage collect - */ - systemClass = (*env)->FindClass(env, "java/lang/System"); - PR_ASSERT(systemClass != NULL); - - /* This is hanging on Solaris for some reason :( */ -#if 0 - gc = (*env)->GetStaticMethodID(env, systemClass, "gc", "()V"); - PR_ASSERT( gc != NULL); - - (*env)->CallStaticVoidMethod(env, systemClass, gc); - PR_ASSERT( (*env)->ExceptionOccurred(env) == NULL ); -#endif - - finalize = (*env)->GetStaticMethodID(env, systemClass, "runFinalization", - "()V"); - PR_ASSERT( finalize != NULL ); - - (*env)->CallStaticVoidMethod(env, systemClass, finalize); - PR_ASSERT( (*env)->ExceptionOccurred(env) == NULL ); - - /* - * Make sure the registry is empty - */ - nativeProxyClass = (*env)->FindClass(env, - "org/mozilla/jss/util/NativeProxy"); - /* If it's NULL, don't worry, maybe they just aren't using the class */ - (*env)->ExceptionClear(env); - - if(nativeProxyClass != NULL) { - /* OK, the class is loaded, so we should validate it */ - assertRegistryEmpty = (*env)->GetStaticMethodID(env, nativeProxyClass, - "assertRegistryEmpty", "()V"); - PR_ASSERT(assertRegistryEmpty != NULL); - (*env)->CallStaticVoidMethod(env, nativeProxyClass, - assertRegistryEmpty); - if( (*env)->ExceptionOccurred(env) != NULL ) { - (*env)->ExceptionDescribe(env); - } - } - - } -#endif - - (*jvm)->DestroyJavaVM(jvm); - - -#if defined(DEBUG) && defined(WIN32) - _sleep(10 * 1000); // milliseconds -#endif - return 0; -} - diff --git a/mozilla/security/jss/cmd/jssjava/manifest.mn b/mozilla/security/jss/cmd/jssjava/manifest.mn deleted file mode 100644 index d96a3c3940f..00000000000 --- a/mozilla/security/jss/cmd/jssjava/manifest.mn +++ /dev/null @@ -1,39 +0,0 @@ -# -# 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 Netscape are -# Copyright (C) 1998-2000 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the -# terms of the GNU General Public License Version 2 or later (the -# "GPL"), in which case the provisions of the GPL are applicable -# instead of those above. If you wish to allow use of your -# version of this file only under the terms of the GPL and not to -# allow others to use your version of this file under the MPL, -# indicate your decision by deleting the provisions above and -# replace them with the notice and other provisions required by -# the GPL. If you do not delete the provisions above, a recipient -# may use your version of this file under either the MPL or the -# GPL. -# - -CORE_DEPTH = ../../.. - -MODULE = ninja - -NS_USE_JDK = 1 - diff --git a/mozilla/security/jss/cmd/jssjava/regen_nativeMethods.pl b/mozilla/security/jss/cmd/jssjava/regen_nativeMethods.pl deleted file mode 100644 index 8bfc00e651f..00000000000 --- a/mozilla/security/jss/cmd/jssjava/regen_nativeMethods.pl +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/local/bin/perl -# -# 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 Netscape are -# Copyright (C) 1998-2000 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the -# terms of the GNU General Public License Version 2 or later (the -# "GPL"), in which case the provisions of the GPL are applicable -# instead of those above. If you wish to allow use of your -# version of this file only under the terms of the GPL and not to -# allow others to use your version of this file under the MPL, -# indicate your decision by deleting the provisions above and -# replace them with the notice and other provisions required by -# the GPL. If you do not delete the provisions above, a recipient -# may use your version of this file under either the MPL or the -# GPL. -# - -# Input: -d dir generated_file foo1 foo2 . . . -# Compares generated file with "_jni/foo1.h", and -# generated file with "_jni/foo2.h", etc. -# -# (NOTE: unlike its closely related cousin, outofdate.pl, -# the "-d dir" must always be specified; also, unlike -# its closely related cousin, jniregen.pl, if the generated file -# is older than ANY "_jni/foo?.h", then the generated file will -# be regenerated in its entirety, rather than just the portions -# associated with the list of files returned by this script) -# -# Returns: list of headers which are NEWER than corresponding class -# files (non-existant header files are considered to be real old :-) - -$found = 1; - -if ($ARGV[0] eq '-d') -{ - $headerdir = $ARGV[1]; - $headerdir .= "/"; - shift; - shift; -} -else -{ - print STDERR "Usage: perl ", $0, " -d dir generated_file foo1 foo2 . . .\n"; - exit -1; -} - -$generatedfilename = $ARGV[0]; -shift; - -foreach $filename (@ARGV) -{ - $headerfilename = $headerdir; - $headerfilename .= $filename; - $headerfilename =~ s/\./_/g; - $headerfilename .= ".h"; - - ( $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $generatedmtime, - $ctime, $blksize, $blocks ) = stat( $generatedfilename ); - - ( $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $headermtime, - $ctime, $blksize, $blocks ) = stat( $headerfilename ); - - if( $headermtime > $generatedmtime ) - { - print $filename, " "; - $found = 0; - } -} - -print "\n"; -exit 0; - diff --git a/mozilla/security/jss/cmd/jssjava/registerNatives.c b/mozilla/security/jss/cmd/jssjava/registerNatives.c deleted file mode 100644 index 2457e06b2d6..00000000000 --- a/mozilla/security/jss/cmd/jssjava/registerNatives.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1998-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - - /* - * registerNatives.c - - * registers statically linked native methods with the VM. - */ - -#include -#include -#include - -#include "registerNatives.h" -#include "nativeMethods.h" - -int -registerNatives(JNIEnv *env) -{ - jclass c; - jint res; - jthrowable exc; - int j; - - if( (*env)->ExceptionOccurred(env) != NULL ) { - fprintf(stderr, - "ERROR: exception occurred before registering natives\n"); - exit(-1); - } - - for (j = 0; nativeMethods[j].classname != 0; j++) { - c = (*env)->FindClass(env, nativeMethods[j].classname); - if (c == 0) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - fprintf(stderr, "Can't find %s class\n", - nativeMethods[j].classname); - continue; - } - res = (*env)->RegisterNatives(env, c, - nativeMethods[j].nat_methods, - nativeMethods[j].nmethods); - exc = (*env)->ExceptionOccurred(env); - if (exc) { - (*env)->ExceptionDescribe(env); - return -1; - } - if (res < 0) { - fprintf(stderr, "Error in register statically linked native methods" - "for %s\n", nativeMethods[j].classname); - return -1; - } - } - - return 0; -} - diff --git a/mozilla/security/jss/cmd/jssjava/registerNatives.h b/mozilla/security/jss/cmd/jssjava/registerNatives.h deleted file mode 100644 index 6eadcfcc503..00000000000 --- a/mozilla/security/jss/cmd/jssjava/registerNatives.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1998-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - - /* - * registerNatives.h - */ - -int registerNatives(JNIEnv *env); diff --git a/mozilla/security/jss/cmd/jssjava/rules.mk b/mozilla/security/jss/cmd/jssjava/rules.mk deleted file mode 100644 index 30b4ac76e21..00000000000 --- a/mozilla/security/jss/cmd/jssjava/rules.mk +++ /dev/null @@ -1,67 +0,0 @@ -# -# 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 Netscape are -# Copyright (C) 1998-2000 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the -# terms of the GNU General Public License Version 2 or later (the -# "GPL"), in which case the provisions of the GPL are applicable -# instead of those above. If you wish to allow use of your -# version of this file only under the terms of the GPL and not to -# allow others to use your version of this file under the MPL, -# indicate your decision by deleting the provisions above and -# replace them with the notice and other provisions required by -# the GPL. If you do not delete the provisions above, a recipient -# may use your version of this file under either the MPL or the -# GPL. -# - -release_md:: release_sanitize - -release_sanitize:: - -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(LIB_PREFIX)jsscrypto$(STATIC_LIB_EXTENSION)$(STATIC_LIB_SUFFIX) - -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(LIB_PREFIX)jsshclhacks$(STATIC_LIB_EXTENSION)$(STATIC_LIB_SUFFIX) - -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(LIB_PREFIX)jssmanage$(STATIC_LIB_EXTENSION)$(STATIC_LIB_SUFFIX) - -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(LIB_PREFIX)jsspkcs11$(STATIC_LIB_EXTENSION)$(STATIC_LIB_SUFFIX) - -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(LIB_PREFIX)jsspolicy$(STATIC_LIB_EXTENSION)$(STATIC_LIB_SUFFIX) - -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(LIB_PREFIX)jssssl$(STATIC_LIB_EXTENSION)$(STATIC_LIB_SUFFIX) - -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(LIB_PREFIX)jssutil$(STATIC_LIB_EXTENSION)$(STATIC_LIB_SUFFIX) - -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)jsshclhacks$(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)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) -ifeq ($(OS_ARCH),WINNT) - -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)jsshclhacks$(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)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) -else - -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(PURE_LIB_PREFIX)jsscrypto$(PURE_LIB_EXTENSION)$(PURE_LIB_SUFFIX) - -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(PURE_LIB_PREFIX)jsshclhacks$(PURE_LIB_EXTENSION)$(PURE_LIB_SUFFIX) - -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(PURE_LIB_PREFIX)jssmanage$(PURE_LIB_EXTENSION)$(PURE_LIB_SUFFIX) - -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(PURE_LIB_PREFIX)jsspkcs11$(PURE_LIB_EXTENSION)$(PURE_LIB_SUFFIX) - -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(PURE_LIB_PREFIX)jsspolicy$(PURE_LIB_EXTENSION)$(PURE_LIB_SUFFIX) - -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(PURE_LIB_PREFIX)jssssl$(PURE_LIB_EXTENSION)$(PURE_LIB_SUFFIX) - -rm $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR)/$(PURE_LIB_PREFIX)jssutil$(PURE_LIB_EXTENSION)$(PURE_LIB_SUFFIX) -endif