2

Possible Duplicate:
How to fetch ./configure parameters used at last time?

Some time ago under Centos, Bash I've compiled a program from source files. Now I need to compile with again with a new flag.

Is there any way to find out what command i used last time to compile this program under Linux Centos?

0

2 Answers 2

2

You could just check your bash history if it is not long since you compiled the program. Some C programs embed the configuration in the binary PHP is one of those you can use strings to see that.

strings /usr/bin/php | grep configure
2

In general, you can't, that information isn't stored anywhere.

Some programs' build systems are designed to store a copy of the configure script invocation used to set up the build environment, but that behavior has to be written into the program. It doesn't get done automatically.

If you're desperate I suppose you could always try compiling the program with different combinations of flags and just hope to find one that reproduces the program you have. Or, if you have access to the source code and know what the different options and their effects are, you could invoke the program in ways that will get it to show you those effects. (e.g. if your program had an "enable-help" compilation option you could try running it with the -h option to see if help had been enabled)

4
  • You're not exactly correct.
    – Warner
    Jul 14, 2010 at 13:19
  • @Warner: How so?
    – David Z
    Jul 15, 2010 at 2:51
  • It is stored somewhere, as demonstrated in the post linked as duplicate. Some software stores it in the binary and will output it, such as with PHP. And all software built with automake includes the configure parameters in the build directory. You provide a good recommendation but your statements are too strong, which makes them pushing incorrect.
    – Warner
    Jul 15, 2010 at 4:23
  • The duplicate post states that the configure command may be stored in config.status or config.log, but those are part of the source directory which is typically deleted after the program is installed. That doesn't count as being stored somewhere. And I did mention the existence of programs like PHP that store the configuration information in the binary, but as I said, that is not done automatically.
    – David Z
    Jul 15, 2010 at 4:55

Not the answer you're looking for? Browse other questions tagged .