Minor MIPS III/IV tune-up.
[openssl.git] / Configure
index 26f029f42488d45bad10f8415473ab33f56ab2c4..fcd7b39cf7cc708dd766d9177b9ad9af07ded8e7 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -98,6 +98,7 @@ my %table=(
 "debug-ben-strict",    "gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown):::::",
 "debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown)::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
 "debug-bodo",  "gcc:-DBIO_PAIR_DEBUG -DL_ENDIAN -DREF_CHECK -DCRYPTO_MDEBUG_ALL -g -m486 -Wall::-D_REENTRANT::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
+"debug-ulf",   "gcc:-DL_ENDIAN -DREF_CHECK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -Wall  -pedantic -Wall -Wshadow -pipe::-D_REENTRANT::$x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
 "dist",                "cc:-O::(unknown):::::",
 
 # Basic configs that should work on any box
@@ -153,11 +154,11 @@ my %table=(
 # Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
 # './Configure irix-[g]cc' manually.
 # -mips4 flag is added by ./config when appropriate.
-"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN::(unknown)::MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:asm/mips3.o::",
-"irix-mips3-cc", "cc:-n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown)::DES_PTR DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:asm/mips3.o::",
+"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::(unknown)::MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:asm/mips3.o::",
+"irix-mips3-cc", "cc:-n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::(unknown)::DES_PTR DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:asm/mips3.o::",
 # N64 ABI builds.
-"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN::(unknown)::DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:asm/mips3.o::",
-"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown)::DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:asm/mips3.o::",
+"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::(unknown)::DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:asm/mips3.o::",
+"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::(unknown)::DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:asm/mips3.o::",
 
 # HPUX 9.X config.
 # Don't use the bundled cc.  It is broken.  Use HP ANSI C if possible, or
@@ -211,7 +212,7 @@ my %table=(
 "NetBSD-sparc",        "gcc:-DTERMIOS -O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:::",
 "NetBSD-m68",  "gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:::",
 "NetBSD-x86",  "gcc:-DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::(unknown)::BN_LLONG $x86_gcc_des $x86_gcc_opts:",
-#"FreeBSD",   "gcc:-DTERMIOS -DL_ENDIAN -D_ANSI_SOURCE -fomit-frame-pointer -O3 -m486 -Wall:(unknown)::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_out_asm",
+"FreeBSD-elf",  "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
 "FreeBSD",      "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_out_asm",
 "bsdi-gcc",     "gcc:-O3 -ffast-math -DL_ENDIAN -DPERL5 -m486::(unknown)::RSA_LLONG $x86_gcc_des $x86_gcc_opts:$x86_bsdi_asm",
 "bsdi-elf-gcc",     "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
@@ -337,7 +338,8 @@ my $ranlib;
 my $perl;
 
 $ranlib=&which("ranlib") or $ranlib="true";
-$perl=&which("perl5") or $perl=&which("perl") or $perl="perl";
+$perl=$ENV{'PERL'} or $perl=&which("perl5") or $perl=&which("perl")
+  or $perl="perl";
 
 &usage if ($#ARGV < 0);
 
@@ -364,6 +366,12 @@ foreach (@ARGV)
                $algo =~ tr/[a-z]/[A-Z]/;
                $flags .= "-DNO_$algo ";
                $depflags .= "-DNO_$algo ";
+               if ($algo eq "DES")
+                       {
+                       $options .= " no-mdc2";
+                       $flags .= "-DNO_MDC2 ";
+                       $depflags .= "-DNO_MDC2 ";
+                       }
                }
        elsif (/^386$/)
                { $processor=386; }
@@ -718,20 +726,8 @@ if($IsWindows) {
 EOF
        close(OUT);
 
-       system "perl crypto/objects/obj_dat.pl <crypto/objects/objects.h >crypto/objects/obj_dat.h";
+       system "perl crypto/objects/obj_dat.pl crypto/objects/objects.h crypto/objects/obj_dat.h";
 } else {
-       open (OUT,">crypto/buildinf.h") || die "Can't open buildinf.h";
-       printf OUT <<EOF;
-#ifndef MK1MF_BUILD
-  /* auto-generated by Configure for crypto/cversion.c:
-   * for Unix builds, crypto/Makefile.ssl generates functional definitions;
-   * Windows builds (and other mk1mf builds) compile cversion.c with
-   * -DMK1MF_BUILD and use definitions added to this file by util/mk1mf.pl. */
-  #error "Windows builds (PLATFORM=$target) use mk1mf.pl-created Makefiles"
-#endif
-EOF
-       close(OUT);
-
        (system "make -f Makefile.ssl PERL=\'$perl\' links") == 0 or exit $?;
        ### (system 'make depend') == 0 or exit $? if $depflags ne "";
        # Run "make depend" manually if you want to be able to delete
@@ -745,38 +741,38 @@ EOF
        }           
 }
 
-my $pwd;
-
-if($IsWindows) {
-       $pwd="(current directory)";
-} else {
-       $pwd =`pwd`;
-       chop($pwd);
-}
-print <<EOF;
-
-NOTE: The OpenSSL header files have been moved from include/*.h
-to include/openssl/*.h.  To include OpenSSL header files, now
-directives of the form
-     #include <openssl/foo.h>
-should be used instead of #include <foo.h>.
-These new file locations allow installing the OpenSSL header
-files in /usr/local/include/openssl/ and should help avoid
-conflicts with other libraries.
-
-To compile programs that use the old form <foo.h>,
-usually an additional compiler option will suffice: E.g., add
-     -I$prefix/include/openssl
-or
-     -I$pwd/include/openssl
-to the CFLAGS in the Makefile of the program that you want to compile
-(and leave all the original -I...'s in place!).
-
-Please make sure that no old OpenSSL header files are around:
-The include directory should now be empty except for the openssl
-subdirectory.
-
-EOF
+my $pwd;
+# 
+if($IsWindows) {
+#      $pwd="(current directory)";
+} else {
+#      $pwd =`pwd`;
+#      chop($pwd);
+}
+print <<EOF;
+# 
+NOTE: The OpenSSL header files have been moved from include/*.h
+to include/openssl/*.h.  To include OpenSSL header files, now
+directives of the form
+     #include <openssl/foo.h>
+should be used instead of #include <foo.h>.
+These new file locations allow installing the OpenSSL header
+files in /usr/local/include/openssl/ and should help avoid
+conflicts with other libraries.
+# 
+To compile programs that use the old form <foo.h>,
+usually an additional compiler option will suffice: E.g., add
+     -I$prefix/include/openssl
+or
+     -I$pwd/include/openssl
+to the CFLAGS in the Makefile of the program that you want to compile
+(and leave all the original -I...'s in place!).
+# 
+Please make sure that no old OpenSSL header files are around:
+The include directory should now be empty except for the openssl
+subdirectory.
+# 
+EOF
 
 print <<\EOF if (!$no_threads && !$threads);