Permalink
Browse files

Use the right compiler invocation in the last test in p5test.pl

  • Loading branch information...
1 parent e0b4e76 commit f54066a6e7317caa32c724b8e6c8ff4467f8655b @pmurias pmurias committed Jan 27, 2012
Showing with 12 additions and 7 deletions.
  1. +12 −7 p5test/p5test.pl
View
@@ -9,7 +9,7 @@
my $cc = $Config{cc};
my $csc = "gmcs";
-diag($Config{osname});
+diag('osname = '.$Config{osname});
system($cc,"test1.c","-o","test1");
my $ok1 = `./test1`;
@@ -36,13 +36,18 @@
</configuration>
END
-for my $invocation ("$cc -shared ","$cc -m32 -shared","$cc -m32 -shared -fPIC","gcc -dynamiclib -current_version 1.0") {
+my $cc_with_opts;
+my $ok4;
+for my $invocation ("$cc -m32 -shared ","$cc -shared") {
unlink("test4lib.$Config{so}");
system($csc,"test4.cs");
system("$invocation -o test4lib.$Config{so} test4lib.c");
- my $ok4 = `mono test4.exe`;
- diag('resulting library: '.`file test4lib.$Config{so}`);
- is $ok4,"OK 4\n","We call C code from mono using $invocation";
+ $ok4 = `mono test4.exe`;
+ is $ok4,"OK 4\n","We can call C code from mono using $invocation";
+ if ($ok4 =~ 'OK 4') {
+ $cc_with_opts = $invocation;
+ last;
+ }
}
my $lib_path5 = rel2abs("test5lib.$Config{so}");
@@ -54,9 +59,9 @@ END
END
system($csc,"test5.cs");
-system("$cc -shared -o test5lib.$Config{so} test5lib.c $ccopts $ldopts");
+system("$cc_with_opts -o test5lib.$Config{so} test5lib.c $ccopts $ldopts");
my $ok5 = `mono test5.exe`;
-is $ok5,"OK 5\n","We call P5 code from mono";
+is $ok5,"OK 5\n","We can call P5 code from mono";
done_testing;

0 comments on commit f54066a

Please sign in to comment.