Installing GNU Compiler55
There are other environment variables and settings that GCC uses while building a target.
You can display these using the –
v
command line switch with the
gcc
command when you
compile a program. This will show you the path including files, programs used during the com-
pilation process, and command line arguments and switches passed to each of these programs.
The following is the output of the command when you compile the
hello.c
program.
[rr@conformix 4]$ gcc -v hello.c
Reading specs from /opt/gcc-3.0.4/lib/gcc-lib/i686-pc-linux-
gnu/3.0.4/specs
Configured with: ../gcc-3.0.4/configure --prefix=/opt/gcc-
3.0.4 --enable-threads=posix
Thread model: posix
gcc version 3.0.4
/opt/gcc-3.0.4/lib/gcc-lib/i686-pc-linux-gnu/3.0.4/cc1 -lang-
c -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=4 -
D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -
D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -
D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -
D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ hello.c -quiet
-dumpbase hello.c -version -o /tmp/ccJsUmYa.s
GNU CPP version 3.0.4 (cpplib) (i386 Linux/ELF)
GNU C version 3.0.4 (i686-pc-linux-gnu)
compiled by GNU C version 3.0.4.
ignoring nonexistent directory "/opt/gcc-3.0.4/i686-pc-linux-
gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
GCC_EXEC_PREFIX
If this variable is set, GCC will look into the directory to find sub
programs.
COMPILER_PATH
This is a colon-separated list of directories that GCC uses to find
out sub programs if search fails using
GCC_EXEC_PREFIX
vari-
able.
LIBRARY_PATH
This is a colon-separated list of directories that is used to find out
libraries for linking process.
C_INCLUDE_PATH
Colon separated list of directories to find out header files for C
programs.
OBJC_INCLUDE_PATH
Colon separated list of directories to find out header files for
Objective C programs.
CPLUS_INCLUDE_PAT
H
Colon separated list of directories to find out header files for C++
programs.
LD_LIBRARY_PATH
Path for shared libraries.