Update WIN32 nasm build to use new asm files.
[openssl.git] / util / mk1mf.pl
index 4a00100f3fef33809fe83af816d0de9de949448d..a76199cf58e588de2c1d033aa87d81f8ec04f8d4 100755 (executable)
@@ -44,6 +44,7 @@ $infile="MINFO";
        "FreeBSD","FreeBSD distribution",
        "OS2-EMX", "EMX GCC OS/2",
        "netware-clib", "CodeWarrior for NetWare - CLib - with WinSock Sockets",
+       "netware-clib-bsdsock", "CodeWarrior for NetWare - CLib - with BSD Sockets",
        "netware-libc", "CodeWarrior for NetWare - LibC - with WinSock Sockets",
        "netware-libc-bsdsock", "CodeWarrior for NetWare - LibC - with BSD Sockets",
        "default","cc under unix",
@@ -78,7 +79,7 @@ and [options] can be one of
        no-hw                                   - No hw
        nasm                                    - Use NASM for x86 asm
        nw-nasm                                 - Use NASM x86 asm for NetWare
-       nw-mwasm                                        - Use Metrowerks x86 asm for NetWare
+       nw-mwasm                                - Use Metrowerks x86 asm for NetWare
        gaswin                                  - Use GNU as with Mingw32
        no-socks                                - No socket code
        no-err                                  - No error strings
@@ -175,10 +176,10 @@ elsif ($platform eq "OS2-EMX")
        require 'OS2-EMX.pl';
        }
 elsif (($platform eq "netware-clib") || ($platform eq "netware-libc") ||
-       ($platform eq "netware-libc-bsdsock"))
+       ($platform eq "netware-clib-bsdsock") || ($platform eq "netware-libc-bsdsock"))
        {
        $LIBC=1 if $platform eq "netware-libc" || $platform eq "netware-libc-bsdsock";
-       $BSDSOCK=1 if $platform eq "netware-libc-bsdsock";
+       $BSDSOCK=1 if ($platform eq "netware-libc-bsdsock") || ($platform eq "netware-clib-bsdsock");
        require 'netware.pl';
        }
 else
@@ -221,6 +222,7 @@ $cflags.=" -DOPENSSL_NO_WHIRLPOOL"   if $no_whirlpool;
 $cflags.=" -DOPENSSL_NO_SOCK" if $no_sock;
 $cflags.=" -DOPENSSL_NO_SSL2" if $no_ssl2;
 $cflags.=" -DOPENSSL_NO_SSL3" if $no_ssl3;
+$cflags.=" -DOPENSSL_NO_TLSEXT" if $no_tlsext;
 $cflags.=" -DOPENSSL_NO_ERR"  if $no_err;
 $cflags.=" -DOPENSSL_NO_KRB5" if $no_krb5;
 $cflags.=" -DOPENSSL_NO_EC"   if $no_ec;
@@ -336,24 +338,24 @@ close(IN);
 if ($shlib)
        {
        $extra_install= <<"EOF";
-       \$(CP) \$(O_SSL) \$(INSTALLTOP)${o}bin
-       \$(CP) \$(O_CRYPTO) \$(INSTALLTOP)${o}bin
-       \$(CP) \$(L_SSL) \$(INSTALLTOP)${o}lib
-       \$(CP) \$(L_CRYPTO) \$(INSTALLTOP)${o}lib
+       \$(CP) \"\$(O_SSL)\" \"\$(INSTALLTOP)${o}bin\"
+       \$(CP) \"\$(O_CRYPTO)\" \"\$(INSTALLTOP)${o}bin\"
+       \$(CP) \"\$(L_SSL)\" \"\$(INSTALLTOP)${o}lib\"
+       \$(CP) \"\$(L_CRYPTO)\" \"\$(INSTALLTOP)${o}lib\"
 EOF
        if ($no_static_engine)
                {
                $extra_install .= <<"EOF"
-       \$(MKDIR) \$(INSTALLTOP)${o}lib${o}engines
-       \$(CP) \$(E_SHLIB) \$(INSTALLTOP)${o}lib${o}engines
+       \$(MKDIR) \"\$(INSTALLTOP)${o}lib${o}engines\"
+       \$(CP) \"\$(E_SHLIB)\" \"\$(INSTALLTOP)${o}lib${o}engines\"
 EOF
                }
        }
 else
        {
        $extra_install= <<"EOF";
-       \$(CP) \$(O_SSL) \$(INSTALLTOP)${o}lib
-       \$(CP) \$(O_CRYPTO) \$(INSTALLTOP)${o}lib
+       \$(CP) \"\$(O_SSL)\" \"\$(INSTALLTOP)${o}lib\"
+       \$(CP) \"\$(O_CRYPTO)\" \"\$(INSTALLTOP)${o}lib\"
 EOF
        $ex_libs .= " $zlib_lib" if $zlib_opt == 1;
        }
@@ -400,6 +402,8 @@ LINK=$link
 LFLAGS=$lflags
 RSC=$rsc
 
+AES_ASM_OBJ=$aes_asm_obj
+AES_ASM_SRC=$aes_asm_src
 BN_ASM_OBJ=$bn_asm_obj
 BN_ASM_SRC=$bn_asm_src
 BNCO_ASM_OBJ=$bnco_asm_obj
@@ -496,7 +500,7 @@ banner:
 $banner
 
 \$(TMP_D):
-       \$(MKDIR) \$(TMP_D)
+       \$(MKDIR) \"\$(TMP_D)\"
 # NB: uncomment out these lines if BIN_D, TEST_D and LIB_D are different
 #\$(BIN_D):
 #      \$(MKDIR) \$(BIN_D)
@@ -505,13 +509,13 @@ $banner
 #      \$(MKDIR) \$(TEST_D)
 
 \$(LIB_D):
-       \$(MKDIR) \$(LIB_D)
+       \$(MKDIR) \"\$(LIB_D)\"
 
 \$(INCO_D): \$(INC_D)
-       \$(MKDIR) \$(INCO_D)
+       \$(MKDIR) \"\$(INCO_D)\"
 
 \$(INC_D):
-       \$(MKDIR) \$(INC_D)
+       \$(MKDIR) \"\$(INC_D)\"
 
 headers: \$(HEADER) \$(EXHEADER)
        @
@@ -521,15 +525,15 @@ lib: \$(LIBS_DEP) \$(E_SHLIB)
 exe: \$(T_EXE) \$(BIN_D)$o\$(E_EXE)$exep
 
 install: all
-       \$(MKDIR) \$(INSTALLTOP)
-       \$(MKDIR) \$(INSTALLTOP)${o}bin
-       \$(MKDIR) \$(INSTALLTOP)${o}include
-       \$(MKDIR) \$(INSTALLTOP)${o}include${o}openssl
-       \$(MKDIR) \$(INSTALLTOP)${o}lib
-       \$(CP) \$(INCO_D)${o}*.\[ch\] \$(INSTALLTOP)${o}include${o}openssl
-       \$(CP) \$(BIN_D)$o\$(E_EXE)$exep \$(INSTALLTOP)${o}bin
-       \$(MKDIR) \$(OPENSSLDIR)
-       \$(CP) apps${o}openssl.cnf \$(OPENSSLDIR)
+       \$(MKDIR) \"\$(INSTALLTOP)\"
+       \$(MKDIR) \"\$(INSTALLTOP)${o}bin\"
+       \$(MKDIR) \"\$(INSTALLTOP)${o}include\"
+       \$(MKDIR) \"\$(INSTALLTOP)${o}include${o}openssl\"
+       \$(MKDIR) \"\$(INSTALLTOP)${o}lib\"
+       \$(CP) \"\$(INCO_D)${o}*.\[ch\]\" \"\$(INSTALLTOP)${o}include${o}openssl\"
+       \$(CP) \"\$(BIN_D)$o\$(E_EXE)$exep \$(INSTALLTOP)${o}bin\"
+       \$(MKDIR) \"\$(OPENSSLDIR)\"
+       \$(CP) apps${o}openssl.cnf \"\$(OPENSSLDIR)\"
 $extra_install
 
 
@@ -617,6 +621,12 @@ foreach (values %lib_nam)
                next;
                }
 
+       if (($aes_asm_obj ne "") && ($_ eq "CRYPTO"))
+               {
+               $lib_obj =~ s/\s(\S*\/aes_core\S*)/ \$(AES_ASM_OBJ)/;
+               $lib_obj =~ s/\s\S*\/aes_cbc\S*//;
+               $rules.=&do_asm_rule($aes_asm_obj,$aes_asm_src);
+               }
        if (($bn_asm_obj ne "") && ($_ eq "CRYPTO"))
                {
                $lib_obj =~ s/\s\S*\/bn_asm\S*/ \$(BN_ASM_OBJ)/;
@@ -646,6 +656,7 @@ foreach (values %lib_nam)
        if (($rc4_enc_obj ne "") && ($_ eq "CRYPTO"))
                {
                $lib_obj =~ s/\s\S*\/rc4_enc\S*/ \$(RC4_ENC_OBJ)/;
+               $lib_obj =~ s/\s\S*\/rc4_skey\S*//;
                $rules.=&do_asm_rule($rc4_enc_obj,$rc4_enc_src);
                }
        if (($rc5_enc_obj ne "") && ($_ eq "CRYPTO"))
@@ -675,7 +686,7 @@ foreach (values %lib_nam)
                }
        if (($cpuid_asm_obj ne "") && ($_ eq "CRYPTO"))
                {
-               $lib_obj =~ s/\s(\S*\/cversion\S*)/ $1 \$(CPUID_ASM_OBJ)/;
+               $lib_obj =~ s/\s\S*\/mem_clr\S*/ \$(CPUID_ASM_OBJ)/;
                $rules.=&do_asm_rule($cpuid_asm_obj,$cpuid_asm_src);
                }
        $defs.=&do_defs(${_}."OBJ",$lib_obj,"\$(OBJ_D)",$obj);
@@ -857,6 +868,7 @@ sub do_defs
                else    { $pf=$postfix; }
                if ($_ =~ /BN_ASM/)     { $t="$_ "; }
                elsif ($_ =~ /BNCO_ASM/){ $t="$_ "; }
+               elsif ($_ =~ /AES_ASM/){ $t="$_ "; }
                elsif ($_ =~ /DES_ENC/) { $t="$_ "; }
                elsif ($_ =~ /BF_ENC/)  { $t="$_ "; }
                elsif ($_ =~ /CAST_ENC/){ $t="$_ "; }
@@ -975,7 +987,7 @@ sub do_copy_rule
                if ($n =~ /bss_file/)
                        { $pp=".c"; }
                else    { $pp=$p; }
-               $ret.="$to${o}$n$pp: \$(SRC_D)$o$_$pp\n\t\$(CP) \$(SRC_D)$o$_$pp $to${o}$n$pp\n\n";
+               $ret.="$to${o}$n$pp: \$(SRC_D)$o$_$pp\n\t\$(CP) \"\$(SRC_D)$o$_$pp\" \"$to${o}$n$pp\"\n\n";
                }
        return($ret);
        }
@@ -1019,6 +1031,7 @@ sub read_options
                "gaswin" => \$gaswin,
                "no-ssl2" => \$no_ssl2,
                "no-ssl3" => \$no_ssl3,
+               "no-tlsext" => \$no_tlsext,
                "no-err" => \$no_err,
                "no-sock" => \$no_sock,
                "no-krb5" => \$no_krb5,