about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/test-installation.pl14
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/test-installation.pl b/scripts/test-installation.pl
index 067da472b2..b2e4ba7646 100755
--- a/scripts/test-installation.pl
+++ b/scripts/test-installation.pl
@@ -79,10 +79,12 @@ arglist: while (@ARGV) {
 
 # We expect none or one argument.
 if ($#ARGV == -1) {
+    $dir = ".";
     $soversions="soversions.mk";
     $config="config.make";
 } elsif ($#ARGV == 0) {
     if (-d $ARGV[0]) {
+      $dir = $ARGV[0];
       $soversions = "$ARGV[0]/soversions.mk";
       $config = "$ARGV[0]/config.make";
     } else {
@@ -141,8 +143,8 @@ close SOVERSIONS;
 # Create test program and link it against all
 # shared libraries
 
-open PRG, ">/tmp/test-prg$$.c"
-  or die ("Couldn't write test file /tmp/test-prg$$.c");
+open PRG, ">$dir/test-prg$$.c"
+  or die ("Couldn't write test file $dir/test-prg$$.c");
 
 print PRG '
 #include <stdio.h>
@@ -154,7 +156,7 @@ int main(void) {
 ';
 close PRG;
 
-open GCC, "$CC /tmp/test-prg$$.c $link_libs -o /tmp/test-prg$$ 2>&1 |"
+open GCC, "$CC $dir/test-prg$$.c $link_libs -o $dir/test-prg$$ 2>&1 |"
   or die ("Couldn't execute $CC!");
 
 while (<GCC>) {
@@ -172,7 +174,7 @@ if ($?) {
 $ok = 1;
 %found = ();
 
-open LDD, "ldd /tmp/test-prg$$ |"
+open LDD, "ldd $dir/test-prg$$ |"
   or die ("Couldn't execute ldd");
 while (<LDD>) {
   if (/^\s*lib/) {
@@ -212,8 +214,8 @@ foreach (keys %versions) {
 &installation_problem unless $ok;
 
 # Finally execute the test program
-system ("/tmp/test-prg$$") == 0
+system ("$dir/test-prg$$") == 0
   or die ("Execution of test program failed");
 
 # Clean up after ourselves
-unlink ("/tmp/test-prg$$", "/tmp/test-prg$$.c");
+unlink ("$dir/test-prg$$", "$dir/test-prg$$.c");