2

How do I specify the location of a library when running ./configure ?

I have searched around and think the answer lies in setting LDFLAGS and CPPFLAGS, but I,m not sure how to do it.

Specifically, I have compiled libx264 and I now want to compile libav and enable libx264 support, but dont know how to point ./configure to my libx264 include and lib folders.

Thanks.

2 Answers 2

0

There are two ways to pass configuration variables to ./configure, and it depends quite a bit on the specific project, so you have to check the documentation.

The first one is to use the --with... options that the author of the script have decided to provide. For example, xcircuit has to be configured like this in 14.04:

./configure --with-tcl --with-tk --with-tcllibs=/usr/lib/x86_64-linux-gnu/ --with-tklibs=/usr/lib/x86_64-linux-gnu/ 

The other way is passing an environment variable to the script (in configuration stage) or to the Makefile (in the compilation phase):

CPPFLAGS=-Wall ./configure 

or

CPPLAGS=-Wall make 

In summary, it's really up to how the author wrote the software. You should refer to the specific documentation, in you case, of libav.

0

Thanks for the pointer. I did more reading and discovered how to do this. The solution is two-fold.

  1. Compile x264 with '--enable-shared' as well as '--enable-static'. Without specifying '--enable-shared', the library was never found.

  2. Specify the location of the 'lib' and 'include' files generated by the x264 make process like this :-

    ./configure --extra-ldflags="-L/path/to/extra/lib" --extra-cflags="-I/path/to/extra/includes" --enable-x264 ..etc ..etc

I have now successfully compiled libav, with x264 support, and have the following binaries :-

avconv, avplay, avprobe, avserver, ffmpeg.

Off course I am sure if I had just installed libav using apt-get I would have saved myself a lot of trouble, but as this was a learning process I think I have learned a lot.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .