summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2011-01-10 01:00:42 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2011-01-10 21:35:29 -0600
commit826659a2f2a00545534b44c552f843c270170095 (patch)
treea80ed94c1503959834c96568b221b4acd16cee38
parentadd a few comment to balance quotes, to make the editor less confused (diff)
downloadcore-826659a2f2a00545534b44c552f843c270170095.tar.gz
core-826659a2f2a00545534b44c552f843c270170095.zip
support for an alternate gbuild.lst to support gmake build
This is to support the possibility of building some modules with gmake instead of dmake, while still maintaining the dmake method fully functional
-rwxr-xr-xsolenv/bin/build.pl40
-rw-r--r--solenv/bin/modules/RepositoryHelper.pm2
-rwxr-xr-xsolenv/bin/modules/SourceConfig.pm18
3 files changed, 45 insertions, 15 deletions
diff --git a/solenv/bin/build.pl b/solenv/bin/build.pl
index 9effb659f011..c00c1c399944 100755
--- a/solenv/bin/build.pl
+++ b/solenv/bin/build.pl
@@ -151,7 +151,7 @@
%platforms = (); # platforms available or being working with
%platforms_to_copy = (); # copy output trees for the platforms when --prepare
$tmp_dir = get_tmp_dir(); # temp directory for checkout and other actions
- @possible_build_lists = ('build.lst', 'build.xlist'); # build lists names
+ @possible_build_lists = ('gbuild.lst', 'build.lst', 'build.xlist'); # build lists names
%build_list_paths = (); # build lists names
%build_lists_hash = (); # hash of arrays $build_lists_hash{$module} = \($path, $xml_list_object)
$pre_job = 'announce'; # job to add for not-single module build
@@ -210,6 +210,8 @@
my $zenity_in = '';
my $zenity_out = '';
my $zenity_err = '';
+ my $allow_gbuild = 0;
+ %is_gbuild = ();
### main ###
get_options();
@@ -546,10 +548,17 @@ sub get_build_list_path {
my $possible_dir_path = $module_paths{$_}.'/prj/';
if (-d $possible_dir_path) {
foreach my $build_list (@possible_build_lists) {
- my $possible_build_list_path = CorrectPath($possible_dir_path . $build_list);
- if (-f $possible_build_list_path) {
- $build_list_paths{$module} = $possible_build_list_path;
- return $possible_build_list_path;
+ # if gbuild are allow we favor gbuild.lst as the build instruction
+ if($build_list ne "gbuild.lst" || $allow_gbuild) {
+ my $possible_build_list_path = CorrectPath($possible_dir_path . $build_list);
+ if (-f $possible_build_list_path) {
+ $build_list_paths{$module} = $possible_build_list_path;
+ if ($build_list eq "gbuild.lst") {
+# print "Using gmake for module $module\n";
+ $is_gbuild{$module} = 1;
+ };
+ return $possible_build_list_path;
+ };
};
}
print_error("There's no build list for $module");
@@ -1469,6 +1478,7 @@ sub get_options {
$arg =~ /^--checkmodules$/ and $checkparents = 1 and $ignore = 1 and next;
$arg =~ /^-s$/ and $show = 1 and next;
$arg =~ /^--deliver$/ and $deliver = 1 and next;
+ $arg =~ /^--gmake$/ and $allow_gbuild = 1 and print "ALLOW GBUILD" and next;
$arg =~ /^(--job=)/ and $custom_job = $' and next;
$arg =~ /^(--pre_job=)/ and $pre_custom_job = $' and next;
$arg =~ /^(--post_job=)/ and $post_custom_job = $' and next; #'
@@ -1619,11 +1629,12 @@ sub get_module_and_buildlist_paths {
$source_config_file = $source_config->get_config_file_path();
$active_modules{$_}++ foreach ($source_config->get_active_modules());
my %active_modules_copy = %active_modules;
- foreach ($source_config->get_all_modules()) {
- delete $active_modules_copy{$_} if defined($active_modules_copy{$_});
- next if ($_ eq $initial_module);
- $module_paths{$_} = $source_config->get_module_path($_);
- $build_list_paths{$_} = $source_config->get_module_build_list($_)
+ foreach my $module ($source_config->get_all_modules()) {
+ delete $active_modules_copy{$module} if defined($active_modules_copy{$module});
+ next if ($module eq $initial_module);
+ $module_paths{$module} = $source_config->get_module_path($module);
+ $build_list_paths{$module} = $source_config->get_module_build_list($module);
+ $is_gbuild{$module} = $source_config->{GBUILD};
}
$dead_parents{$_}++ foreach (keys %active_modules_copy);
};
@@ -3504,7 +3515,14 @@ sub get_job_string {
my $full_job_dir = $job_dir;
if ($job_dir =~ /(\s)/o) {
$job = $'; #'
- $job = $deliver_command if ($job eq $post_job);
+ print $echo . "determine if we need to deliver $job_dir\n";
+ if ($job eq $post_job) {
+ if( $is_gbuild{$job_dir} ) {
+ print "Skip deliver for gmake-built module $job_dir\n";
+ return'';
+ };
+ $job = $deliver_command
+ };
$full_job_dir = $module_paths{$`};
}
my $log_dir = File::Basename::dirname($log_file);
diff --git a/solenv/bin/modules/RepositoryHelper.pm b/solenv/bin/modules/RepositoryHelper.pm
index 9f7bb869e42d..8fea30374669 100644
--- a/solenv/bin/modules/RepositoryHelper.pm
+++ b/solenv/bin/modules/RepositoryHelper.pm
@@ -118,7 +118,7 @@ sub search_for_hg {
sub search_via_build_lst {
my $self = shift;
- my @possible_build_lists = ('build.lst', 'build.xlist'); # build lists names
+ my @possible_build_lists = ('gbuild.lst', 'build.lst', 'build.xlist'); # build lists names
my $previous_dir = '';
my $rep_root_candidate = $self->{INITIAL_DIRECTORY};
do {
diff --git a/solenv/bin/modules/SourceConfig.pm b/solenv/bin/modules/SourceConfig.pm
index dfaa797d8f48..c7aacc1b0efb 100755
--- a/solenv/bin/modules/SourceConfig.pm
+++ b/solenv/bin/modules/SourceConfig.pm
@@ -78,6 +78,14 @@ sub new {
} else {
$source_root = $ENV{SOURCE_ROOT_DIR};
};
+ if ( defined $ENV{USE_GBUILD} and "$ENV{USE_GBUILD}" ne "" )
+ {
+ $self->{POSSIBLE_BUILD_LIST} = ('gbuild.lst', 'build.lst', 'build.xlist'); # build lists names
+ }
+ else
+ {
+ $self->{POSSIBLE_BUILD_LIST} = ('build.lst', 'build.xlist'); # build lists names
+ }
$source_root = Cwd::realpath($source_root);
$self->{SOURCE_ROOT} = $source_root;
$self->{DEBUG} = 0;
@@ -94,6 +102,7 @@ sub new {
$self->{REMOVE_REPOSITORIES} = {};
$self->{NEW_REPOSITORIES} = [];
$self->{WARNINGS} = [];
+ $self->{GBUILD} = 0;
$self->{REPORT_MESSAGES} = [];
$self->{CONFIG_FILE_CONTENT} = [];
if (defined $self->{USER_SOURCE_ROOT}) {
@@ -173,11 +182,14 @@ sub get_module_build_list {
if (defined ${$self->{MODULE_BUILD_LIST_PATHS}}{$module}) {
return ${$self->{MODULE_BUILD_LIST_PATHS}}{$module};
} else {
- my @possible_build_lists = ('build.lst', 'build.xlist'); # build lists names
- foreach (@possible_build_lists) {
- my $possible_path = ${$self->{MODULE_PATHS}}{$module} . "/prj/$_";
+ my @possible_build_lists = $self->{POSSIBLE_BUILD_LIST}; # build lists names
+ foreach my $build_list (@possible_build_lists) {
+ my $possible_path = ${$self->{MODULE_PATHS}}{$module} . "/prj/$build_list";
if (-e $possible_path) {
${$self->{MODULE_BUILD_LIST_PATHS}}{$module} = $possible_path;
+ if ( $build_list eq "gbuild.lst" ) {
+ $self->{GBUILD} = 1;
+ };
return $possible_path;
};
};