Re: Clearing the standard search path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux