This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: automatically determining location of internal header files
- To: bobbyp at llnl dot gov
- Subject: Re: automatically determining location of internal header files
- From: pkurpis at keck dot hawaii dot edu (Peter Kurpis)
- Date: Thu, 8 Nov 2001 14:08:48 -1000 (HST)
- Cc: gcc-help at gcc dot gnu dot org
> As part of a configuration script I need to be able to automatically
> determine where gcc/g++ places its internal header files which it uses
> while compiling programs.
Here's a little exerpt I used to determine all its internal search paths
for headers. HTH.
#!/bin/sh
gcc -v -E - <<eof 2>&1 |
int main(void) { } /* C program */
eof
awk '/^End/ { headers=0 }
headers==1 { print $1 }
/^#include </ { headers=1 }' >>list_of_dirs