This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Clearing the standard search path
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: Harvey Chapman <hchapman-gcc-help at 3gfp dot com>
- Cc: gcc <gcc-help at gcc dot gnu dot org>
- Date: Mon, 30 Mar 2009 19:14:38 -0400
- Subject: Re: Clearing the standard search path
- References: <49D12377.1090005@3gfp.com>
On Mon, Mar 30, 2009 at 03:54:31PM -0400, Harvey Chapman wrote:
> 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?
You typically want to configure the compiler with:
--with-sysroot=<dir>
If you are using a newlib based library, you probably also want:
--with-newlib
--with-headers or --with-headers=<dir>
Other switches to think about include:
--with-build-sysroot=<dir>
--without-headers
--with-libs
--with-build-time-tools=<dir>
This should all be covered in the installation directions under the section
'Cross-Compiler-Specific Options'.
--
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com