Migrate the old autogen.lastrun format to the new one automatically.
Signed-off-by: Fridrich Štrba <fridrich.strba@bluewin.ch>
This commit is contained in:
committed by
Fridrich Štrba
parent
1e5339ec92
commit
c0b9fdfbba
18
autogen.sh
18
autogen.sh
@@ -20,8 +20,22 @@ sub read_args($)
|
|||||||
open ($fh, $file) || die "can't open file: $file";
|
open ($fh, $file) || die "can't open file: $file";
|
||||||
while (<$fh>) {
|
while (<$fh>) {
|
||||||
chomp();
|
chomp();
|
||||||
|
# migrate from the old system
|
||||||
|
if ( substr($_, 0, 1) eq "'" ) {
|
||||||
|
print "Migrating options from the old autogen.lastrun format, using:\n";
|
||||||
|
my @opts;
|
||||||
|
@opts = split(/'/);
|
||||||
|
foreach my $opt (@opts) {
|
||||||
|
if ( substr($opt, 0, 1) eq "-" ) {
|
||||||
|
push @lst, $opt;
|
||||||
|
print " $opt\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
push @lst, $_;
|
push @lst, $_;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
close ($fh);
|
close ($fh);
|
||||||
# print "read args from file '$file': @lst\n";
|
# print "read args from file '$file': @lst\n";
|
||||||
return @lst;
|
return @lst;
|
||||||
@@ -81,11 +95,11 @@ system ("autoconf") && die "Failed to run autoconf";
|
|||||||
if (defined $ENV{NOCONFIGURE}) {
|
if (defined $ENV{NOCONFIGURE}) {
|
||||||
print "Skipping configure process.";
|
print "Skipping configure process.";
|
||||||
} else {
|
} else {
|
||||||
if (@ARGV > 0) {
|
if ($#cmdline_args > 0) {
|
||||||
print "writing args to autogen.lastrun\n";
|
print "writing args to autogen.lastrun\n";
|
||||||
my $fh;
|
my $fh;
|
||||||
open ($fh, ">autogen.lastrun") || die "can't open autogen.lastrun: $!";
|
open ($fh, ">autogen.lastrun") || die "can't open autogen.lastrun: $!";
|
||||||
for my $arg (@ARGV) {
|
for my $arg (@cmdline_args) {
|
||||||
print $fh "$arg\n";
|
print $fh "$arg\n";
|
||||||
}
|
}
|
||||||
close ($fh);
|
close ($fh);
|
||||||
|
Reference in New Issue
Block a user