Remove pointless diagnostic.
[openssl.git] / util / mk1mf.pl
index e27e81b61000b4a0c035b1cb8f9f8e7054ff7378..5984498c30768584d264fcff98935c7c96549366 100755 (executable)
@@ -44,6 +44,7 @@ my %mf_import = (
        INSTALLTOP     => \$INSTALLTOP,
        OPENSSLDIR     => \$OPENSSLDIR,
        PLATFORM       => \$mf_platform,
+       CC             => \$mf_cc,
        CFLAG          => \$mf_cflag,
        DEPFLAG        => \$mf_depflag,
        CPUID_OBJ      => \$mf_cpuid_asm,
@@ -196,6 +197,7 @@ $NT=0;
 push(@INC,"util/pl","pl");
 
 if ($platform eq "auto") {
+       $orig_platform = $platform;
        $platform = $mf_platform;
        print STDERR "Imported platform $mf_platform\n";
 }
@@ -321,6 +323,9 @@ else
 ##else
        { $cflags="$c_flags$cflags" if ($c_flags ne ""); }
 
+$cflags = $mf_cflag if $orig_platform eq 'auto';
+$cc = $mf_cc if $orig_platform eq 'auto';
+
 $ex_libs="$l_flags$ex_libs" if ($l_flags ne "");
 
 
@@ -347,7 +352,7 @@ open(IN,"<$infile") || die "unable to open $infile:$!\n";
 $_=<IN>;
 for (;;)
        {
-       chop;
+       s/\s*$//; # was chop, didn't work in mixture of perls for Windows...
 
        ($key,$val)=/^([^=]+)=(.*)/;
        if ($key eq "RELATIVE_DIRECTORY")
@@ -639,7 +644,7 @@ LFLAGS=$lflags
 RSC=$rsc
 FIPSLINK=\$(PERL) util${o}fipslink.pl
 
-# The output directory for everything intersting
+# The output directory for everything interesting
 OUT_D=$out_dir
 # The output directory for all the temporary muck
 TMP_D=$tmp_dir
@@ -740,7 +745,6 @@ $banner
        \$(MKDIR) \"\$(INC_D)\"
 
 headers: \$(HEADER) \$(EXHEADER)
-       @
 
 lib: \$(LIBS_DEP) \$(E_SHLIB)
 
@@ -766,6 +770,13 @@ vclean:
        \$(RM) \$(TMP_D)$o*.*
        \$(RM) \$(OUT_D)$o*.*
 
+reallyclean:
+       \$(RM) -rf \$(TMP_D)
+       \$(RM) -rf \$(BIN_D)
+       \$(RM) -rf \$(TEST_D)
+       \$(RM) -rf \$(LIB_D)
+       \$(RM) -rf \$(INC_D)
+
 EOF
     
 my $platform_cpp_symbol = "MK1MF_PLATFORM_$platform";
@@ -804,7 +815,7 @@ printf OUT "  #define DATE \"%s\"\n", scalar gmtime();
 printf OUT "#endif\n";
 close(OUT);
 
-# Strip of trailing ' '
+# Strip off trailing ' '
 foreach (keys %lib_obj) { $lib_obj{$_}=&clean_up_ws($lib_obj{$_}); }
 $test=&clean_up_ws($test);
 $e_exe=&clean_up_ws($e_exe);
@@ -842,10 +853,10 @@ if ($fips)
                }
        $rules.=&cc_compile_target("\$(OBJ_D)${o}fips_standalone_sha1$obj",
                "fips${o}sha${o}fips_standalone_sha1.c",
-               "\$(SHLIB_CFLAGS)");
+               "\$(APP_CFLAGS)");
        $rules.=&cc_compile_target("\$(OBJ_D)${o}\$(E_PREMAIN_DSO)$obj",
                "fips${o}fips_premain.c",
-               "-DFINGERPRINT_PREMAIN_DSO_LOAD \$(SHLIB_CFLAGS)");
+               "-DFINGERPRINT_PREMAIN_DSO_LOAD \$(APP_CFLAGS)");
        }
 
 foreach (values %lib_nam)
@@ -906,9 +917,9 @@ $defs.=&do_defs("E_SHLIB",$engines . $otherlibs,"\$(ENG_D)",$shlibp);
 foreach (split(/\s+/,$engines))
        {
        my $engine = $_;
-       my @objs   = grep(/$engine/,@engines_obj);
+       my @objs   = grep {/e_$engine/} @engines_obj;
        $rules.=&do_compile_rule("\$(OBJ_D)",join(" ",@objs),$lib);
-       map {$_=~s/[^\/]*\/*([^\/]+)/\$(OBJ_D)${o}$1.obj/} @objs;
+       map {$_=~s/.*\/([^\/]+)$/\$(OBJ_D)${o}$1$obj/} @objs;
        $rules.= &do_lib_rule(join(" ",@objs),"\$(ENG_D)$o$engine$shlibp","",$shlib,"");
        }
 
@@ -1223,7 +1234,9 @@ sub Sasm_compile_target
 
        $bname =~ s/(.*)\.[^\.]$/$1/;
        $ret ="\$(TMP_D)$o$bname.asm: $source\n";
-       $ret.="\t\$(CC) -E \$(CFLAG) $source >\$\@\n\n";
+       $ret.="\t\$(CC) -E \$(CFLAG) $source >\$\@\n";
+       $ret.="\t\$(PERL) util\\fipsas.pl . \$@ norunasm \$(CFLAG)\n" if $fipscanisteronly;
+       $ret.="\n";
        $ret.="$target: \$(TMP_D)$o$bname.asm\n";
        $ret.="\t\$(ASM) $afile\$\@ \$(TMP_D)$o$bname.asm\n\n";
        return($ret);
@@ -1237,7 +1250,8 @@ sub cc_compile_target
        $ex_flags.=" -DMK1MF_BUILD -D$platform_cpp_symbol" if ($source =~ /cversion/);
        $target =~ s/\//$o/g if $o ne "/";
        $source =~ s/\//$o/g if $o ne "/";
-       $ret ="$target: \$(SRC_D)$o$source\n\t";
+# FIXME: do dependencies instead of all headers.
+       $ret ="$target: \$(SRC_D)$o$source \$(HEADER) \$(EXHEADER)\n\t";
        $ret.="\$(CC) ${ofile}$target $ex_flags -c \$(SRC_D)$o$source\n\n";
        return($ret);
        }
@@ -1303,7 +1317,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 $to\n\t\$(CP) \"\$(SRC_D)$o$_$pp\" \"$to${o}$n$pp\"\n\n";
                }
        return($ret);
        }
@@ -1374,6 +1388,7 @@ sub read_options
                "shlib" => \$shlib,
                "dll" => \$shlib,
                "shared" => 0,
+               "no-sctp" => 0,
                "no-gmp" => 0,
                "no-rfc3779" => 0,
                "no-montasm" => 0,
@@ -1381,6 +1396,7 @@ sub read_options
                "no-store" => 0,
                "no-zlib" => 0,
                "no-zlib-dynamic" => 0,
+               "no-ssl-trace" => 0,
                "fips" => \$fips,
                "fipscanisterbuild" => [\$fips, \$fipscanisterbuild],
                "fipscanisteronly" => [\$fips, \$fipscanisterbuild, \$fipscanisteronly],