lib/autobuild/packages/autotools.rb in autobuild-1.5.9 vs lib/autobuild/packages/autotools.rb in autobuild-1.5.10

- old
+ new

@@ -108,10 +108,11 @@ FileUtils.rm_f configurestamp end def prepare super + autodetect_needed_stages # Check if config.status has been generated with the # same options than the ones in configureflags # # If it is not the case, remove it to force reconfiguration @@ -122,12 +123,22 @@ raise "invalid output of config.status --version" unless output =~ /with options "(.*)"$/ options = Shellwords.shellwords($1) # Add the --prefix option to the configureflags array testflags = ["--prefix=#{prefix}"] + Array[*configureflags] - old_opt = options.find { |o| !testflags.include?(o) } + old_opt = options.find do |o| + if testflags.include?(o) + false + else + name, value = o.split("=") + ENV[name] != value + end + end new_opt = testflags.find { |o| !options.include?(o) } if old_opt || new_opt + if Autobuild.verbose + STDERR.puts " forcing reconfiguration of #{name} (#{old_opt} != #{new_opt})" + end FileUtils.rm_f configurestamp # to force reconfiguration end end regen_target = create_regen_target