This isn't entirely necessary if you do everything right from the
[openssl.git] / util / mk1mf.pl
index 100d76f279336f5efc01da47c3b18faebf0eebda..98ee58719654e2469fa27074988ed0fbf8748d39 100755 (executable)
@@ -65,6 +65,7 @@ and [options] can be one of
        no-err                                  - No error strings
        dll/shlib                               - Build shared libraries (MS)
        debug                                   - Debug build
+        profile                                 - Profiling build
        gcc                                     - Use Gcc (unix)
        rsaref                                  - Build to require RSAref
 
@@ -217,9 +218,10 @@ $cflags.=" -DNO_SSL3" if $no_ssl3;
 $cflags.=" -DNO_ERR"  if $no_err;
 $cflags.=" -DRSAref"  if $rsaref ne "";
 
-if ($unix)
-       { $cflags="$c_flags" if ($c_flags ne ""); }
-else   { $cflags="$c_flags$cflags" if ($c_flags ne ""); }
+## if ($unix)
+##     { $cflags="$c_flags" if ($c_flags ne ""); }
+##else
+       { $cflags="$c_flags$cflags" if ($c_flags ne ""); }
 
 $ex_libs="$l_flags$ex_libs" if ($l_flags ne "");
 
@@ -273,6 +275,8 @@ LFLAGS=$lflags
 
 BN_ASM_OBJ=$bn_asm_obj
 BN_ASM_SRC=$bn_asm_src
+BNCO_ASM_OBJ=$bnco_asm_obj
+BNCO_ASM_SRC=$bnco_asm_src
 DES_ENC_OBJ=$des_enc_obj
 DES_ENC_SRC=$des_enc_src
 BF_ENC_OBJ=$bf_enc_obj
@@ -360,6 +364,10 @@ all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) \$(INCO_D) headers lib exe
 banner:
 $banner
 
+# Generate perlasm output files
+%.cpp:
+       (cd \$(\@D)/..; PERL=perl make -f Makefile.ssl asm/\$(\@F))
+
 \$(TMP_D):
        \$(MKDIR) \$(TMP_D)
 # NB: uncomment out these lines if BIN_D, TEST_D and LIB_D are different
@@ -379,6 +387,7 @@ $banner
        \$(MKDIR) \$(INC_D)
 
 headers: \$(HEADER) \$(EXHEADER)
+       @
 
 lib: \$(LIBS_DEP)
 
@@ -539,6 +548,11 @@ foreach (values %lib_nam)
                $lib_obj =~ s/\s\S*\/bn_asm\S*/ \$(BN_ASM_OBJ)/;
                $rules.=&do_asm_rule($bn_asm_obj,$bn_asm_src);
                }
+       if (($bnco_asm_obj ne "") && ($_ eq "CRYPTO"))
+               {
+               $lib_obj .= "\$(BNCO_ASM_OBJ)";
+               $rules.=&do_asm_rule($bnco_asm_obj,$bnco_asm_src);
+               }
        if (($des_enc_obj ne "") && ($_ eq "CRYPTO"))
                {
                $lib_obj =~ s/\s\S*des_enc\S*/ \$(DES_ENC_OBJ)/;
@@ -717,6 +731,7 @@ sub do_defs
                        { $pf=".c"; }
                else    { $pf=$postfix; }
                if ($_ =~ /BN_ASM/)     { $t="$_ "; }
+               elsif ($_ =~ /BNCO_ASM/){ $t="$_ "; }
                elsif ($_ =~ /DES_ENC/) { $t="$_ "; }
                elsif ($_ =~ /BF_ENC/)  { $t="$_ "; }
                elsif ($_ =~ /CAST_ENC/){ $t="$_ "; }
@@ -865,8 +880,10 @@ sub read_options
        elsif (/^rsaref$/)      { $rsaref=1; }
        elsif (/^gcc$/)         { $gcc=1; }
        elsif (/^debug$/)       { $debug=1; }
+       elsif (/^profile$/)     { $profile=1; }
        elsif (/^shlib$/)       { $shlib=1; }
        elsif (/^dll$/)         { $shlib=1; }
+       elsif (/^shared$/)      { } # We just need to ignore it for now...
        elsif (/^([^=]*)=(.*)$/){ $VARS{$1}=$2; }
        elsif (/^-[lL].*$/)     { $l_flags.="$_ "; }
        elsif ((!/^-help/) && (!/^-h/) && (!/^-\?/) && /^-.*$/)