views:

42

answers:

3

I have made a toolchain using this script: http://gist.github.com/403608 (more or less modified to get it to work)

Everything is installed and now when I try to compile using it I get an error when I ./configure it says that my C compiler cannot create exeicutables. I'm thinking that my compiler just doesn't know where to look for all the headers and libs... cause they are not in /usr/ they are in /var/sdk/usr/

is there a way to tell my compiler to always look in /var/sdk/usr/ also?

A: 

Go into your target settings (control-click on a target and choose Info). Select the Build tab, then fill in Header Search Paths for headers, Library Search Paths for libraries.

Simon Whitaker
this is all command line in linux :( no tabs...
Jeremy Iglehart
Ah. Have you tried ./configure --help? configure normally has command-line options for specifying non-standard dependency locations.
Simon Whitaker
A: 

For gcc, use the directory search options

    gcc -L/foo/bar/baz
    gcc -I/foo/bar/quux

The first one adds the directory /foo/bar/baz to the linker search path (libs will be found here). The second one adds the directory /foo/bar/quux to the front on the list of directories to search for headers. Mixed and multiple -I and -L options can occur in a single invocation. If you use multiple "-I"s, they are searched in left to right order and then the system directories are searched.

Eric Towers
is this only for that ONE compile or does it "stick" - as in configure GCC to always look there in the future?
Jeremy Iglehart
@Jeremy Iglehart: Just works the once. But you're making a compile script or using make or some other method to automate this step so you only have to figure it out once. I strongly recommend against changing your all-the-time environment since it makes a strong difference between development and production environments.
Eric Towers
+1  A: 

Most configure scripts use LDFLAGS and CPPFLAGS environment variables to modify directory search paths for includes and libs.

LDFLAGS="-L/other/libs" CPPFLAGS="-I/other/includes" ./configure

You can also look at the compiler documentation as they usually have environment variables they look at as well. For example gcc looks in directories listed LIBRARY_PATH for libs. It will also look directories CPATH for includes.

dietbuddha
can i just change the environment variable and then compile like normal and it will look there so long as those environment variables are set to that?
Jeremy Iglehart
Those variables are only used and configure and compile time respectively. You may need to update ldconfig and/or LD_LIBRARY_PATH for runtime modification of the directories examined for shared libs.
dietbuddha