I have a PHP module written in C++, which relies on a C++ library (Boost Date_Time) being installed.
Currently, in my config.m4 file I'm checking for the library as follows:
LIBNAME=boost_date_time
LIBSYMBOL=_ZN5boost9gregorian9bad_monthD0Ev
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,,
[
AC_MSG_ERROR([lib $LIBNAME not found. Try: sudo apt-get install libboost-dev])
],[
-lstdc++ -ldl
])
Now, this works in my current environment, but I'm painfully aware this will probably break on a different version of the library or compiler.
How can I get automake to understand the non-mangled C++ symbol?
Edit:
I realise that checking on the mangled name is horrible, but is there not some way of checking for the symbol name as returned by "nm -C" (eg boost::gregorian::bad_month etc).
I found some refence to the automake command AC_LANG_CPLUSPLUS(), but I'm not sure how to use it and whether it's applicable here.