slightly72
August 17th, 2006, 01:21 AM
This is probably not a strictly Ubuntu topic, but here it goes.
I'm working on some software (call it "foo") that'll be integrated with a public domain CAD tool (call it "bar"). "bar" installs both some binaries and a static library (say, "libbar.a") in its directory (/usr/local/bar).
I'm using the autoconf and automake tools to generate the makefiles and whatnot for "foo", but have a problem with making autoconf automatically generate the appropriate compiler flags for linking libbar.a with foo. I've tried AC_CHECK_LIB, but it either cannot find libbar.a (I've set up LD_LIBRARY_PATH to /usr/local/bar/lib, where libbar.a is installed) or cannot process static libraries.
My current solution is to add to Makefile.am
foo_LDFLAGS = -L/usr/local/bar/lib
but it's not a good solution -- since foo's going to be public domain, cannot predict where the users might have installed bar.
So, is there a way to have autoconf (or the "configure") script detect the location of libbar.a? I've searched in autoconf manuals, but all examples seem to refer to dynamic libraries.
I'm using autoconf 2.59, automake 1.9.6 -- working on Dapper.
Thank you.
I'm working on some software (call it "foo") that'll be integrated with a public domain CAD tool (call it "bar"). "bar" installs both some binaries and a static library (say, "libbar.a") in its directory (/usr/local/bar).
I'm using the autoconf and automake tools to generate the makefiles and whatnot for "foo", but have a problem with making autoconf automatically generate the appropriate compiler flags for linking libbar.a with foo. I've tried AC_CHECK_LIB, but it either cannot find libbar.a (I've set up LD_LIBRARY_PATH to /usr/local/bar/lib, where libbar.a is installed) or cannot process static libraries.
My current solution is to add to Makefile.am
foo_LDFLAGS = -L/usr/local/bar/lib
but it's not a good solution -- since foo's going to be public domain, cannot predict where the users might have installed bar.
So, is there a way to have autoconf (or the "configure") script detect the location of libbar.a? I've searched in autoconf manuals, but all examples seem to refer to dynamic libraries.
I'm using autoconf 2.59, automake 1.9.6 -- working on Dapper.
Thank you.