Skip to content

Commit

Permalink
[tools/build] suggest when and how Configure.pl needs to be re-run
Browse files Browse the repository at this point in the history
  • Loading branch information
mberends committed Jun 10, 2011
1 parent 3981965 commit 9c4146d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/build/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ HARNESS_WITH_FUDGE = $(PERL) t/harness --fudge --keep-exit-code --icu=$(HAS_ICU)
STAGESTATS = @stagestats@

# the default target, TODO: make libraries in 'lib' a variable.
all: $(PERL6_EXE) $(SETTING)
all: check-versions $(PERL6_EXE) $(SETTING)

# the install target
install: all
Expand Down Expand Up @@ -362,6 +362,9 @@ help:
@echo " help: Print this help message."
@echo ""

check-versions:
@$(PERL) tools/build/check-versions.pl install/bin/nqp

# Makefile: build/Makefile.in build/PARROT_REVISION $(PARROT) Configure.pl
# @echo ""
# @echo "warning: Makefile is out of date... re-run Configure.pl"
Expand Down
41 changes: 41 additions & 0 deletions tools/build/check-versions.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/perl
# Copyright (C) 2008-2011, The Perl Foundation.

use strict;
use warnings;
use 5.008;
use lib 'nqp/tools/lib';
use NQP::Configure qw(slurp cmp_rev read_config);

my @stat_Makefile = stat 'Makefile';
my @stat_Makefile_in = stat 'tools/build/Makefile.in';

if ($stat_Makefile[9] < $stat_Makefile_in[9]) { # 9 => modification time
die <<EOM
Makefile is older than tools/build/Makefile.in, run something like
perl Configure.pl
with --help or options as needed
EOM
}

my %nqp_config = read_config($ARGV[0]);
my $nqp_have = $nqp_config{'nqp::version'} || '';
my ($nqp_want) = split(' ', slurp('tools/build/NQP_REVISION'));

if (!$nqp_have || cmp_rev($nqp_have, $nqp_want) < 0) {
my $parrot_option = '--gen-parrot or --with-parrot=path/to/bin/parrot';
if (-x 'install/bin/parrot') {
$parrot_option = '--with-parrot=install/bin/parrot';
}
die <<EOM
NQP $nqp_have is too old ($nqp_want required), run something like
perl Configure.pl --gen-nqp $parrot_option
EOM
}

0; # versions are OK

0 comments on commit 9c4146d

Please sign in to comment.