[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: autoconf macros and C++



On Thu, 15 Feb 2001, Jaldhar H. Vyas wrote:

[C++ libraries and autoconf]

> I hope this helps anyone who has faced the problem themselves.  I have a
> question too, is there anyway to use the unmangled name?  AFAIK, mangling
> isn't portable and unportability kind of defeats the whole purpose of
> using autoconf don't you think?

I've been using the following code for libapt-pkg:

AC_LANG_CPLUSPLUS
AC_CHECK_HEADER(apt-pkg/init.h,,
 AC_MSG_ERROR([*** You need libapt-pkg]))
AC_CACHE_CHECK([for libapt-pkg],ac_cv_have_libapt_pkg,[
 ac_save_LIBS=$LIBS
 LIBS=-lapt-pkg
 AC_TRY_LINK(
  [#include <apt-pkg/init.h>],
  [(void)pkgInitialize(*new Configuration())],
  [ac_cv_have_libapt_pkg=yes],
  [
   ac_cv_have_libapt_pkg=no
   AC_MSG_ERROR([*** You need libapt-pkg])])
 LIBS="$ac_save_LIBS"])
# since we weren't here if the test failed, we can assume HAVE_LIBAPT_PKG
APTPKGLIBS="-lapt-pkg"
AC_SUBST(APTPKGLIBS)

   Simon

-- 
GPG public key available from http://phobos.fs.tum.de/pgp/Simon.Richter.asc
 Fingerprint: DC26 EB8D 1F35 4F44 2934  7583 DBB6 F98D 9198 3292
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!



Reply to: