Skip to content

Commit 8a23ef6

Browse files
Use strict/warnings in the build script to uncover bugs.
1 parent 107a009 commit 8a23ef6

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

external/buildscripts/build.pl

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
use File::Basename;
55
use File::Path;
66
use lib ('external/buildscripts', "../../Tools/perl_lib","perl_lib", 'external/buildscripts/perl_lib');
7+
use strict;
8+
use warnings;
79
use Tools qw(InstallNameTool);
810

911
print ">>> PATH in Build All = $ENV{PATH}\n\n";
1012

1113
my $currentdir = getcwd();
1214

1315
my $monoroot = File::Spec->rel2abs(dirname(__FILE__) . "/../..");
14-
my $monoroot = abs_path($monoroot);
16+
$monoroot = abs_path($monoroot);
1517

1618
my $buildscriptsdir = "$monoroot/external/buildscripts";
1719
my $addtoresultsdistdir = "$buildscriptsdir/add_to_build_results/monodistribution";
@@ -294,7 +296,7 @@
294296
}
295297
else
296298
{
297-
if (not $checkoutonthefly)
299+
if (not $checkoutOnTheFly)
298300
{
299301
print(">>> No external build deps found. Might as well try to check them out. If it fails, we'll continue and trust mono is in your PATH\n");
300302
}
@@ -681,7 +683,6 @@
681683
my $platformRootPostfix = "";
682684
my $useKraitPatch = 1;
683685
my $kraitPatchPath = "$monoroot/../../android_krait_signal_handler/build";
684-
my $toolChainExtension = "";
685686

686687
$ENV{ANDROID_PLATFORM} = "android-$apiLevel";
687688

@@ -759,8 +760,6 @@
759760

760761
if ($runningOnWindows)
761762
{
762-
$toolChainExtension = ".exe";
763-
764763
$androidPlatformRoot = `cygpath -w $androidPlatformRoot`;
765764
# clean up trailing new lines that end up in the output from cygpath.
766765
$androidPlatformRoot =~ s/\n+$//;
@@ -968,8 +967,6 @@
968967

969968
if ($runningOnWindows)
970969
{
971-
$toolChainExtension = ".exe";
972-
973970
$tizenPlatformRoot = `cygpath -w $tizenPlatformRoot`;
974971
# clean up trailing new lines that end up in the output from cygpath.
975972
$tizenPlatformRoot =~ s/\n+$//;
@@ -1598,7 +1595,7 @@
15981595
system("ln","-f", "$monoroot/mono/mini/.libs/libmonosgen-2.0.dylib","$embedDirArchDestination/libmonosgen-2.0.dylib") eq 0 or die ("failed symlinking libmonosgen-2.0.dylib\n");
15991596

16001597
print "Hardlinking libMonoPosixHelper.dylib\n";
1601-
system("ln","-f", "$monoroot/support/.libs/libMonoPosixHelper.dylib","$embedDirArchDestination/libMonoPosixHelper.dylib") eq 0 or die ("failed symlinking $libtarget/libMonoPosixHelper.dylib\n");
1598+
system("ln","-f", "$monoroot/support/.libs/libMonoPosixHelper.dylib","$embedDirArchDestination/libMonoPosixHelper.dylib") eq 0 or die ("failed symlinking $embedDirArchDestination/libMonoPosixHelper.dylib\n");
16021599

16031600
InstallNameTool("$embedDirArchDestination/libmonobdwgc-2.0.dylib", "\@executable_path/../Frameworks/MonoEmbedRuntime/osx/libmonobdwgc-2.0.dylib");
16041601
InstallNameTool("$embedDirArchDestination/libmonosgen-2.0.dylib", "\@executable_path/../Frameworks/MonoEmbedRuntime/osx/libmonosgen-2.0.dylib");
@@ -1691,9 +1688,9 @@
16911688

16921689
if ($test)
16931690
{
1691+
my $runtimeTestsDir = "$monoroot/mono/mini";
16941692
if ($runRuntimeTests)
16951693
{
1696-
my $runtimeTestsDir = "$monoroot/mono/mini";
16971694
chdir("$runtimeTestsDir") eq 1 or die ("failed to chdir");
16981695
print("\n>>> Calling make check in $runtimeTestsDir\n\n");
16991696
system("make","check") eq 0 or die ("runtime tests failed\n");

0 commit comments

Comments
 (0)