Remove config.cache files when reconfiguring at top level

Nick Clifton nickc@redhat.com
Tue Feb 16 11:04:00 GMT 2010


Hi Andreas,

>> Is that OK with you ?
>
> Why can't you just put the config.cache removal into distclean?  That's
> what the bug is all about anyway.

Because distclean is a Makefile target and the reconfigure deletes the 
Makefiles, so there are no distclean targets to be run.  What used to 
happens was:

  1. User runs configure.
     Top level files are created but no sub-directories.

  2. User runs make.
     Sub-directories are created.  Makefile and config.cache files
     are created in the sub-directories.

  3. User runs configure again, with different flags.
     The configure script deletes the Makefiles that were created
     in the sub-directories, but leaves the config.cache files alone.

  4. User runs make distclean.
     There are no Makefiles present in the sub-directories so
     the config.cache files are left intact.

  5. User runs make.
     The build fails because the values in the config.cache files
     in the sub-directories no longer match up with the values
     specified in the reconfigure.

My patch made step 3 delete the config.cache files in directories where 
a Makefile was being deleted so that step 5 would then execute successfully.

Cheers
   Nick



More information about the Gcc-patches mailing list