summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2014-01-27 18:19:48 +0100
committerAndreas Schwab <schwab@linux-m68k.org>2014-01-27 18:43:22 +0100
commit1c0d11bce56f61aa0aeedf244b95b1dfe3713359 (patch)
tree12ce314a2a85c4b355922b8f87478f37745a18a6 /math
parent7329c17bcbfd4b7e73479126e3fe706096f1a6dc (diff)
downloadglibc-1c0d11bce56f61aa0aeedf244b95b1dfe3713359.tar.gz
glibc-1c0d11bce56f61aa0aeedf244b95b1dfe3713359.tar.xz
glibc-1c0d11bce56f61aa0aeedf244b95b1dfe3713359.zip
Let gen-libm-test.pl find itself when run outside source directory
Diffstat (limited to 'math')
-rwxr-xr-xmath/gen-libm-test.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/math/gen-libm-test.pl b/math/gen-libm-test.pl
index d5fb278d41..a1c528d970 100755
--- a/math/gen-libm-test.pl
+++ b/math/gen-libm-test.pl
@@ -42,7 +42,7 @@ use strict;
 use vars qw ($input $output $auto_input);
 use vars qw (%results);
 use vars qw (%beautify @all_floats);
-use vars qw ($output_dir $ulps_file);
+use vars qw ($output_dir $ulps_file $srcdir);
 use vars qw (%auto_tests);
 
 # all_floats is sorted and contains all recognised float types
@@ -75,6 +75,7 @@ getopts('u:o:nh');
 
 $ulps_file = 'libm-test-ulps';
 $output_dir = '';
+($srcdir = $0) =~ s{[^/]*$}{};
 
 if ($opt_h) {
   print "Usage: gen-libm-test.pl [OPTIONS]\n";
@@ -89,7 +90,7 @@ $ulps_file = $opt_u if ($opt_u);
 $output_dir = $opt_o if ($opt_o);
 
 $input = "libm-test.inc";
-$auto_input = "auto-libm-test-out";
+$auto_input = "${srcdir}auto-libm-test-out";
 $output = "${output_dir}libm-test.c";
 
 &parse_ulps ($ulps_file);