Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

marked as duplicate by Warner, Chopper3 Jul 14 '10 at 15:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Thanks for pointing duplicate –  tomaszs Jul 14 '10 at 19:23
add comment

2 Answers 2

up vote 1 down vote accepted

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
share|improve this answer
add comment

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)

share|improve this answer
    
You're not exactly correct. –  Warner Jul 14 '10 at 13:19
    
@Warner: How so? –  David Z Jul 15 '10 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 '10 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 '10 at 4:55
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.