[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AC_CHECK_LIB and C++ libraries
From: |
Magnus Fromreide |
Subject: |
AC_CHECK_LIB and C++ libraries |
Date: |
Wed, 29 Mar 2006 18:26:08 +0200 |
User-agent: |
Mutt/1.4i |
Hello.
I have a C++ program and a library written in C++ that I wish to AC_CHECK_LIB
for, when trying that AC_CHECK_LIB fails miserably since the name mangling
hides the function name. It would be nice if the following were true:
a) AC_CHECK_LIB takes a PROLOGUE argument, just like AC_LANG_CALL and
AC_LANG_PROGRAM does so that includes can be sent along.
b) AC_LANG_CALL(C++) doesn't try to redeclare functions
By changing AC_LANG_CALL(C++) from
# AC_LANG_CALL(C++)(PROLOGUE, FUNCTION)
# -------------------------------------
m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(C++)])
to
# AC_LANG_CALL(C++)(PROLOGUE, FUNCTION)
# -------------------------------------
m4_define([AC_LANG_CALL(C++)], [AC_LANG_PROGRAM([$1], [$2 () ;])])
objective b) is done.
Objective a) can be done by adding a sixth parameter to AC_CHECK_LIB and
AC_SEARCH_LIBS that is forwarded to the first parameter of AC_LANG_CALL in both
macros, but I am not certain if this is the best path forward on this issue.
On another note it could be that AC_CHECK_LIB shouldn't use AC_LANG_CALL but
AC_LANG_PROGRAM if there are any parentheses in the functon name - this makes
it possible to link against functions that takes arguments as well even when
name mangling is present.
/MF
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- AC_CHECK_LIB and C++ libraries,
Magnus Fromreide <=