This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Clearing the standard search path
- From: Harvey Chapman <hchapman-gcc-help at 3gfp dot com>
- To: gcc <gcc-help at gcc dot gnu dot org>
- Date: Mon, 30 Mar 2009 15:54:31 -0400
- Subject: Clearing the standard search path
I've looked through the manuals for gcc and ld, but would like some
advice regarding ignoring standard search paths for headers and
libraries. I've found "-nostdinc" for gcc and "-z nodefaultlib
-nostdlib" for ld.
I'm trying to build an embedded OS in a separate directory and I want to
ensure that missing dependencies (in my destination directory) are not
automatically found in Ubuntu's standard paths (/usr/include, /usr/lib,
etc.). I figured that if I could clear the standard search paths, the
compiles would fail alerting me instantly about a missing dependency.
I need to find the most portable way to do this that will work with as
many "./configure; make; make install" style packages. Should I use the
flags above inside CFLAGS and LDFLAGS variables? Or should I set CPATH
equal to nothing?
Thanks for the help,
Harvey