01.09.2014 Views

The Linux Development Platform Configuring, Using, and ... - Classes

The Linux Development Platform Configuring, Using, and ... - Classes

The Linux Development Platform Configuring, Using, and ... - Classes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CH03.fm Page 55 Monday, October 7, 2002 8:33 PM<br />

Installing GNU Compiler 55<br />

GCC_EXEC_PREFIX<br />

COMPILER_PATH<br />

LIBRARY_PATH<br />

C_INCLUDE_PATH<br />

OBJC_INCLUDE_PATH<br />

CPLUS_INCLUDE_PAT<br />

H<br />

LD_LIBRARY_PATH<br />

If this variable is set, GCC will look into the directory to find sub<br />

programs.<br />

This is a colon-separated list of directories that GCC uses to find<br />

out sub programs if search fails using GCC_EXEC_PREFIX variable.<br />

This is a colon-separated list of directories that is used to find out<br />

libraries for linking process.<br />

Colon separated list of directories to find out header files for C<br />

programs.<br />

Colon separated list of directories to find out header files for<br />

Objective C programs.<br />

Colon separated list of directories to find out header files for C++<br />

programs.<br />

Path for shared libraries.<br />

<strong>The</strong>re are other environment variables <strong>and</strong> settings that GCC uses while building a target.<br />

You can display these using the –v comm<strong>and</strong> line switch with the gcc comm<strong>and</strong> when you<br />

compile a program. This will show you the path including files, programs used during the compilation<br />

process, <strong>and</strong> comm<strong>and</strong> line arguments <strong>and</strong> switches passed to each of these programs.<br />

<strong>The</strong> following is the output of the comm<strong>and</strong> when you compile the hello.c program.<br />

[rr@conformix 4]$ gcc -v hello.c<br />

Reading specs from /opt/gcc-3.0.4/lib/gcc-lib/i686-pc-linuxgnu/3.0.4/specs<br />

Configured with: ../gcc-3.0.4/configure --prefix=/opt/gcc-<br />

3.0.4 --enable-threads=posix<br />

Thread model: posix<br />

gcc version 3.0.4<br />

/opt/gcc-3.0.4/lib/gcc-lib/i686-pc-linux-gnu/3.0.4/cc1 -langc<br />

-v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=4 -<br />

D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -<br />

D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -<br />

D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -<br />

D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ hello.c -quiet<br />

-dumpbase hello.c -version -o /tmp/ccJsUmYa.s<br />

GNU CPP version 3.0.4 (cpplib) (i386 <strong>Linux</strong>/ELF)<br />

GNU C version 3.0.4 (i686-pc-linux-gnu)<br />

compiled by GNU C version 3.0.4.<br />

ignoring nonexistent directory "/opt/gcc-3.0.4/i686-pc-linuxgnu/include"<br />

#include "..." search starts here:<br />

#include search starts here:<br />

/usr/local/include

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!