1

Let's say I'm compiling some application (codebase in C, using gcc as default compiler, git cloned from github...) and doing ./configure --flags1 --flags2 ...

And after compiling finish, i want to know the flags i used on ./configure (in this hypothetical case, i can't know that by looking in my shell history as it is lost).

The flags list could be pretty long, and i wouldn't want to waste time hunting down those said flags (especially since some could not be documented in the previously mentioned application).

Any ways to know the flags that were used for a compiled application? maybe by looking at whatever files ./configure generate?

1 Answers1

1

They're in the config.log:

head -n8 config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was generated by GNU Autoconf 2.52.20190901. Invocation command line was

$ ./configure --enable-trace

You can easily parse that with a bit of sed from the Makefile and include that info as a string in your binary. I don't know if any other program does that, though ;-)