Mikael Lindqvist
Mikael Lindqvist

Reputation: 807

configure.ac not finding dependencies under cygwin

I'm using an autoconf/automake configure script on cygwin, and I have the problem that it doesn't fin my dependencies.

For example I do, in my configure.ac:

AC_CHECK_LIB(mp3lame,lame_init,,AC_MSG_ERROR(Required library LAME not found.)) AC_CHECK_HEADER(lame/lame.h,,AC_MSG_ERROR(Headers for LAME not found.))

To find lame. Lame is installed, if I do locate lame.h I find it in /usr/local/include/lame/lame.h. Now, if I set LIBRARY_PATH and INCLUDE_PATH with

export INCLUDE_PATH=/usr/local/include/ export LIBRARY_PATH=/usr/local/lib/

It works as expected. I have installed lame by downloading it and running:

./configure
make
make install 

So I would think that it should end up in a "standard enough" path for my configure script to find it. In a similar way, I'm checking for the json parser jansson using:

PKG_CHECK_MODULES(JANSSON,jansson)

And it doesn't find it unless I do:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/

Is this a problem with cygwin (I wouldn't think so) or a problem with my configure.ac script?

Upvotes: 0

Views: 1694

Answers (1)

William Pursell
William Pursell

Reputation: 212564

This is not a problem with cygwin, nor with your configure.ac. It is a "feature" of PKG_CHECK_MODULES and is one of the reasons I recommend against using it. If a configure script generated from a configure.ac that uses PKG_CHECK_MODULES is used, it is necessary that the user set PKG_CONFIG_PATH. The best approach is to use AC_CHECK_LIB instead of PKG_CHECK_MODULES. You are absolutely correct that ./configure && make && make install gives you a standard installation that should work. The problem is that PKG_CHECK_MODULES does not play well with standard installations.

Upvotes: 1

Related Questions