X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=util%2Fmk1mf.pl;h=a550523b624a53a0c5ca71e286c48ae26d046bcd;hp=599a192b664b9a4e858a68b00d31c06788f041ae;hb=03c075e572d75d4a6410351f4637ec494bac9b61;hpb=fed45e18795fc52900c578132862b10ae4e78b25 diff --git a/util/mk1mf.pl b/util/mk1mf.pl index 599a192b66..a550523b62 100755 --- a/util/mk1mf.pl +++ b/util/mk1mf.pl @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl +#!/usr/bin/env perl # A bit of an evil hack but it post processes the file ../MINFO which # is generated by `make files` in the top directory. # This script outputs one mega makefile that has no shell stuff or any @@ -192,7 +192,7 @@ $mkdir="-mkdir" unless defined $mkdir; $ranlib="echo ranlib"; $cc=(defined($VARS{'CC'}))?$VARS{'CC'}:'cc'; -$src_dir=(defined($VARS{'SRC'}))?$VARS{'SRC'}:getcwd(); +$src_dir=(defined($VARS{'SRC'}))?$VARS{'SRC'}: $platform eq 'copy' ? getcwd() : '.'; $bin_dir=(defined($VARS{'BIN'}))?$VARS{'BIN'}:''; # $bin_dir.=$o causes a core dump on my sparc :-( @@ -455,6 +455,14 @@ for (;;) } close(IN); +if ($orig_platform eq 'copy') + { + # Remove opensslconf.h so it doesn't get updated if we configure a + # different branch. + $exheader =~ s/[^ ]+\/opensslconf.h//; + $header =~ s/[^ ]+\/opensslconf.h//; + } + if ($fips) { @@ -609,6 +617,8 @@ EOF $ex_libs .= " $zlib_lib" if $zlib_opt == 1; } +my $asm_def = $orig_platform eq 'copy' ? "" : "ASM=$bin_dir$asm"; + $defs= <<"EOF"; # N.B. You MUST use -j on FreeBSD. # This makefile has been automatically generated from the OpenSSL distribution. @@ -669,7 +679,7 @@ RANLIB=$ranlib MKDIR=$mkdir MKLIB=$bin_dir$mklib MLFLAGS=$mlflags -ASM=$bin_dir$asm +$asm_def # FIPS validated module and support file locations @@ -756,6 +766,7 @@ $banner # This needs to be invoked once, when the makefile is first constructed, or # after cleaning. init: \$(TMP_D) \$(LIB_D) \$(INC_D) \$(INCO_D) \$(BIN_D) \$(TEST_D) headers + \$(PERL) \$(SRC_D)/util/copy-if-different.pl "\$(SRC_D)/crypto/opensslconf.h" "\$(INCO_D)/opensslconf.h" headers: \$(HEADER) \$(EXHEADER) @@ -1269,15 +1280,15 @@ sub perlasm_compile_target my($ret); $bname =~ s/(.*)\.[^\.]$/$1/; - $ret ="\$(TMP_D)$o$bname.asm: $source\n"; + $ret ="\$(TMP_D)$o$bname$asm_suffix: $source\n"; $ret.="\t\$(PERL) $source $asmtype \$(CFLAG) >\$\@\n"; if ($fipscanisteronly) { - $ret .= "\t\$(PERL) util\\fipsas.pl . \$@ norunasm \$(CFLAG)\n"; + $ret .= "\t\$(PERL) util$o.pl . \$@ norunasm \$(CFLAG)\n"; } $ret .= "\n"; - $ret.="$target: \$(TMP_D)$o$bname.asm\n"; - $ret.="\t\$(ASM) $afile\$\@ \$(TMP_D)$o$bname.asm\n\n"; + $ret.="$target: \$(TMP_D)$o$bname$asm_suffix\n"; + $ret.="\t\$(ASM) $afile\$\@ \$(TMP_D)$o$bname$asm_suffix\n\n"; return($ret); } @@ -1305,7 +1316,7 @@ sub cc_compile_target $target =~ s/\//$o/g if $o ne "/"; $source =~ s/\//$o/g if $o ne "/"; $ret ="$target: \$(SRC_D)$o$source\n\t"; - $ret.="\$(CC)" + $ret.="\$(CC)"; $ret.= " -MMD" if $orig_platform eq "copy"; $ret.= " ${ofile}$target $ex_flags -c \$(SRC_D)$o$source\n\n"; $target =~ s/\.o$/.d/;