autoconf
[Top][All Lists]
Advanced

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

AC_SEARCH_CLASS_LIBS for C++ libraries


From: Wesley W. Terpstra
Subject: AC_SEARCH_CLASS_LIBS for C++ libraries
Date: Fri, 18 Apr 2003 02:02:05 +0200
User-agent: Mutt/1.5.4i

After reading a lot of the macros in autoconf 2.57, I decided I needed a
new macro: AC_SEARCH_CLASS_LIBS.

Why is this important? Because many C++ libraries export no non-member
functions! There is no symbol to test for without getting into nasty symbol
mangling. So, we need a test which can determine if a class is available in
a library.

These two functions work together like (without error handling):

AC_SEARCH_HEADER_DIRS([mimelib/message.h], [/usr/include/kde])
AC_SEARCH_CLASS_LIBS(DwMessage, mimelib, [#include <mimelib/message.h>])

Here we first locate mimelib/message.h in either a standard include
directory or /usr/include/kde. Then, using this header we try to define
an object of type DwMessage and see if it links against mimelib.

The directoties and libraries checked may have multiple options.
For more information see the comments in the attachment.

These are close copies of AC_SEARCH_LIBS and AC_CHECK_HEADER_NEW.
I have attached my acinclude.m4 which defines them.
If you find these macros useful for upstream inclusion, I waive copyright.

PS. I am not subscribed to this list, so please CC me.

-- 
Wesley W. Terpstra <address@hidden>

Attachment: acinclude.m4
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]