summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-04-06 08:48:26 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2011-04-07 14:33:40 +0200
commitc0b9fdfbbaa46e984dbe6ea9e7f5adc943b9f248 (patch)
treef4070059ae5d91a419cdbc0afe1ebcc4ddd5767f /autogen.sh
parent1e5339ec9209a5c89851f79adb1c49f169b6d3e5 (diff)
Migrate the old autogen.lastrun format to the new one automatically.
Signed-off-by: Fridrich Štrba <fridrich.strba@bluewin.ch>
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh20
1 files changed, 17 insertions, 3 deletions
diff --git a/autogen.sh b/autogen.sh
index 20d504c6c6f6..1b26c9a74dc9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -20,7 +20,21 @@ sub read_args($)
open ($fh, $file) || die "can't open file: $file";
while (<$fh>) {
chomp();
- push @lst, $_;
+ # 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, $_;
+ }
}
close ($fh);
# print "read args from file '$file': @lst\n";
@@ -81,11 +95,11 @@ system ("autoconf") && die "Failed to run autoconf";
if (defined $ENV{NOCONFIGURE}) {
print "Skipping configure process.";
} else {
- if (@ARGV > 0) {
+ if ($#cmdline_args > 0) {
print "writing args to autogen.lastrun\n";
my $fh;
open ($fh, ">autogen.lastrun") || die "can't open autogen.lastrun: $!";
- for my $arg (@ARGV) {
+ for my $arg (@cmdline_args) {
print $fh "$arg\n";
}
close ($fh);