I'm working on a C++ project on GNU/Linux and I'm looking for a way to test the existence and usability of IBM Informix's library with the Autotools - namely, editing a configure.in
. I don't have experience with Autotools, so basically I'm picking up from the project's configure.in
et al. scripts and copying&changing where I feel needs to be changed. IOW, I've been adapting from the existing text in configure.in
.
So far I've been using successfully the AC_CHECK_LIB
in configure.in
to test whether a certain library both exists and is usable. But this only seems to work with libraries with functions, not e.g. classes. Namely, this fails when testing Informix's libifc++.so
library:
AC_CHECK_LIB(ifc++, ITString,
INFORMIX_LIB="-L$INFORMIX_LIB_LOCATION/c++ -lifc++ -L$INFORMIX_LIB_LOCATION -L$INFORMIX_LIB_LOCATION/dmi -L$INFORMIX_LIB_LOCATION/esql -lifdmi -lifsql -lifasf -lifgen -lifos -lifgls -lifglx $INFORMIX_LIB_LOCATION/esql/checkapi.o -lm -ldl -lcrypt -lnsl",
echo "* WARNING: libifc++.so not found!"
INFORMIX_INC=""
INFORMIX_LIB=""
)
I've also tried using other combinations, like ITString::ITString
, etc.
I haven't found a "pure" function in Informix's API (i.e., one that isn't contexted in a C++ class). So I'm hoping that either there's a way to use AC_CHECK_LIB
in this context, or there's another autoconf
/configure.in
"command" for this specific use.
Thanks in advance for your feedback.