summaryrefslogtreecommitdiff
path: root/infrastructure/makeparcels.pl.in
diff options
context:
space:
mode:
Diffstat (limited to 'infrastructure/makeparcels.pl.in')
-rwxr-xr-xinfrastructure/makeparcels.pl.in42
1 files changed, 31 insertions, 11 deletions
diff --git a/infrastructure/makeparcels.pl.in b/infrastructure/makeparcels.pl.in
index 0846ef46..125ff346 100755
--- a/infrastructure/makeparcels.pl.in
+++ b/infrastructure/makeparcels.pl.in
@@ -7,6 +7,24 @@ use BoxPlatform;
my @parcels;
my %parcel_contents;
+sub starts_with ($$)
+{
+ my ($string,$expected) = @_;
+ return substr($string, 0, length $expected) eq $expected;
+}
+
+sub os_matches ($)
+{
+ my ($prefix_string) = @_;
+ my @prefixes = split m'\,', $prefix_string;
+ foreach my $prefix (@prefixes)
+ {
+ return 1 if starts_with($build_os, $prefix);
+ return 1 if starts_with($target_os, $prefix);
+ }
+ return 0;
+}
+
open PARCELS,"parcels.txt" or die "Can't open parcels file";
{
my $cur_parcel = '';
@@ -19,7 +37,7 @@ open PARCELS,"parcels.txt" or die "Can't open parcels file";
next if m/\AEND-OMIT/;
if(m/\AOMIT:(.+)/)
{
- if($1 eq $build_os or $1 eq $target_os)
+ if (os_matches($1))
{
while(<PARCELS>)
{
@@ -31,10 +49,7 @@ open PARCELS,"parcels.txt" or die "Can't open parcels file";
if (m'\AONLY:(.+)')
{
- my @only_targets = split m'\,', $1;
-
- if (not grep {$_ eq $build_os or $_ eq $target_os}
- @only_targets)
+ if (not os_matches($1))
{
while (<PARCELS>)
{
@@ -110,14 +125,14 @@ for my $parcel (@parcels)
for(@{$parcel_contents{$parcel}})
{
- my ($type,$name) = split /\s+/;
+ my ($type,$name,$dest) = split /\s+/;
my $optional = '';
if ($type eq 'optional')
{
- ($optional,$type,$name) = split /\s+/;
+ ($optional,$type,$name,$dest) = split /\s+/;
}
-
+
if($type eq 'bin')
{
my $exeext = $platform_exe_ext;
@@ -136,13 +151,18 @@ for my $parcel (@parcels)
print MAKE "\tcp $name $dir\n";
}
# remove path from script name
- $name =~ m~/([^/]+)\Z~;
- $name = $1;
+ $name =~ s{.*/}{};
}
unless ($target_windows)
{
- print SCRIPT "install $name $install_into_dir\n";
+ my $local_install_dir = $install_into_dir;
+ if (defined $dest)
+ {
+ $local_install_dir = "@prefix@/$dest";
+ }
+ print SCRIPT "install $name " .
+ "\$DESTDIR$local_install_dir\n";
}
}