public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Clearing the standard search path
@ 2009-03-30 19:54 Harvey Chapman
  2009-03-30 23:14 ` Michael Meissner
  0 siblings, 1 reply; 2+ messages in thread
From: Harvey Chapman @ 2009-03-30 19:54 UTC (permalink / raw)
  To: gcc

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Clearing the standard search path
  2009-03-30 19:54 Clearing the standard search path Harvey Chapman
@ 2009-03-30 23:14 ` Michael Meissner
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Meissner @ 2009-03-30 23:14 UTC (permalink / raw)
  To: Harvey Chapman; +Cc: gcc

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-30 23:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-30 19:54 Clearing the standard search path Harvey Chapman
2009-03-30 23:14 ` Michael Meissner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).