d15af57336ba0cbab0889cf3705223ab1f612130
[platform/upstream/build.git] / getmacros
1 #!/usr/bin/perl -w
2
3 BEGIN {
4   unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
5 }
6
7 use Build;
8 use strict;
9
10 my ($dist, $configdir, $archs);
11
12 while (@ARGV)  {
13   if ($ARGV[0] eq '--dist') {
14     shift @ARGV;
15     $dist = shift @ARGV;
16     next;
17   }
18   if ($ARGV[0] eq '--archpath') {
19     shift @ARGV;
20     $archs = shift @ARGV;
21     next;
22   }
23   if ($ARGV[0] eq '--configdir') {
24     shift @ARGV;
25     $configdir = shift @ARGV;
26     next;
27   }
28   last;
29 }
30 die("Usage: getmacros --dist <dist> [--configdir <configdir>]\n") if @ARGV;
31 my $cf = Build::read_config_dist($dist, $archs, $configdir);
32 print $cf->{'rawmacros'} if exists $cf->{'rawmacros'};
33 exit(0);