How to find the –configure string once the software has been installed and the source code is still laying around?

Peter Krumins asked:

Here’s a typical scenario – you install software from source, spend an hour figuring out the configure options, and finally run:

./configure --prefix=/a/b/c --with-X --with-Y=/usr/local/Y/lib \
            --disable-Z --with-extension=foo --build=bar ...

A year passes by, a new software version has come out, and you want to upgrade. To do that you need to run configure again on the new source code. However you’ve forgotten what the configure flags were, but you still do have the old source code and the old build somewhere in your home directory.

How to recover the configure string a year later when you’ve forgotten what the original configure string was?

My answer:

Run in the old directory:

./config.status --config

Or to make things really easy, run in the new directory:

./configure `../old-version-directory/config.status --config`

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.