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:
/opt/local/lib
/opt/local/include
tooany help, or links to decent tutorials much appreciated...
You need to manually set CFLAGS
, CXXFLAGS
and LDFLAGS
if you want gcc/g++ to look in non-standard locations.
So, before calling AC_CHECK_LIB()
, do something like
CFLAGS="$CFLAGS -I/opt/local/include"
CXXFLAGS="$CXXFLAGS -I/opt/local/include"
LDFLAGS="$LDFLAGS -L/opt/local/lib"
You don't need CXXFLAGS if you're only using gcc throughout your configure script.