Sometimes when I build a package from source, the resulting binaries seem to contain a reference to the build flags I'm using.
The example I'm working with is the fftw library. Here's how to download and build it.
FWIW, these lines take about ~30 seconds to execute, so give it a try.
cd /tmp
wget http://www.fftw.org/fftw-3.3.4.tar.gz
tar xf fftw-3.3.4.tar.gz
cd fftw-3.3.4
CFLAGS="-I/foo/bar" ./configure --prefix=/tmp # We aren't going to run 'make install',
# so the --prefix is unimportant.
make -j4
Now let's inspect the compiled output. Notice that the silly -I/foo/bar
flag ended up in the binary itself!
$ strings .libs/libfftw3.a | grep gcc
gcc -I/foo/bar
For technical reasons not worth mentioning here (related to a package management tool), I would like to prevent that, or at least understand why it is happening, and if it is important.
BTW: This seems to happen on both Linux and OS X, for both shared and static libraries.