I'm trying to compile programs under Solaris in my Home directory.
Ive had experience with simple installs which work with just

   $> CD src
   $> ./configure --prefix=/home/peter
   $> make
   $> make install

But with more involved programs, with dependencies on special libraries, how do I have the system look into my home directory for these? and how would I compile them into my home dir?

link|improve this question
feedback

2 Answers

up vote 1 down vote accepted

I have to do things like that when I cross compile applications. If ./configure supports it, you can check with --help, you can do something like the following

./configure --extra-ldflags=-L/root/Installs/ffmpeg/forWin/usr/lib --extra-cflags=-I/root/Installs/ffmpeg/forWin/usr/include

There's one entry for libraries, and one for includes, however, there is always the old school way of just appending it before either configure or make

LDFLAGS='-L/root/Installs/ffmpeg/forWin/usr/lib' CFLAGS='-I/root/Installs/ffmpeg/forWin/usr/include' ./configure
LDFLAGS='-L/root/Installs/ffmpeg/forWin/usr/lib' CFLAGS='-I/root/Installs/ffmpeg/forWin/usr/include' make

For make I think they can be specified either before or after, however don't quote me on it.

link|improve this answer
feedback

It depends.

If you're building software that uses configure, most configure scripts will allow you to specify paths to third party libs. Do configure --help and look for --with-feature=/path/to/software.

As other answers have mentioned, configure and other scripts tend to look at the environment variables CFLAGS LDFLAGS and LIBS. You can set CFLAGS with -I/include/paths and -L/library/paths and that may help.

Worst case, you may need to edit Makefiles to reset those paths.

If you want the software to live someplace, configure scripts tend to have --prefix= argument to specify install dir. Or you may have to edit a Makefile.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.