I'm building my first autoconf managed package.
However I can't find any simple examples anywhere of how to specify a required library, and find that library where it might be in various different places.
I've currently got:
AC_CHECK_LIB(['event'], ['event_init'])
but:
- It doesn't find the version installed in
/opt/local/lib
- It doesn't complain if the library isn't actually found
- I need to set the include path to
/opt/local/include
too
any help, or links to decent tutorials much appreciated…
Best Answer
autoconf script cannot guess the "optional" library locations, which may vary from one platform to another. So you can say
For
AC_CHECK_LIB()
you need to specify the fail condition explicitly in "action-if-false" argument:Output:
AC_CHECK_LIB()
does not fail by default on obvious reasons: one may check for several different libraries that provide similar functionality and choose one of them :)Also have a look at this post for similar topic.