Make all x86_64 modules independent on current working directory.
[openssl.git] / crypto / whrlpool / asm / wp-x86_64.pl
index 3855382036bc99b1f923710f5bc45b8dc3e63a5e..41bf3b2025bb2e6f9c8ba13e5bc69c67ab9b65b6 100644 (file)
 # operand.
 
 $output=shift;
-open STDOUT,"| $^X ../perlasm/x86_64-xlate.pl $output";
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate;
+( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or
+( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
+die "can't locate x86_64-xlate.pl";
+
+open STDOUT,"| $^X $xlate $output";
 
 sub L() { $code.=".byte        ".join(',',@_)."\n"; }
 sub LL(){ $code.=".byte        ".join(',',@_).",".join(',',@_)."\n"; }