This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: automatically determining location of internal header files



>   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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]