[Mono-list] Martin's debugger in CVS

Peter Williams peterw@ximian.com
16 Jan 2003 22:30:08 -0500


On Thu, 2003-01-16 at 14:52, Martin Baulig wrote:

> Well, these symbols come from -liberty.
> 
> However, do not add a check for it to configure.in, that is wrong.  I was previously
> checking for it, but intentionally removed the check.
> 
> What we need to do is having a check in configure.in which checks whether you can link
> against -lbfd alone (without specifying -liberty !) and have it explicitly abort if it
> cannot find _sch_istable.
> 
> We can probably do this by checking whether you can get _sch_istable just by linking
> against -lbfd, for instance
> 
>         extern void _sch_istable (void);
>         int main () { void *ptr = &_sch_istable; }
> 
> must work.
> 
> If this doesn't work, then your libbfd is unusable and you must manually compile it.

This sounds like it calls for AC_TRY_LINK. Is there a reason that this
won't work?

LIBS="-lbfd"

AC_TRY_LINK(,,[
        BFD_DEPLIBS="-lbfd"
        ],[
                LIBS="$LIBS -liberty"
                AC_TRY_LINK(,,[
                        BFD_DEPLIBS="-lbfd -liberty"
                ],[
                        AC_MSG_ERROR([Cannot figure out how to link with
the BFD library; see config.log for more information])
                ])
])

(This is just an analogue of the current readline check.)

Or at the least we could do

LIBS="-lbfd"
AC_TRY_LINK(,,,
[
	AC_MSG_ERROR([Your BFD library is borked and you're ugly, too.])
])

?

Peter

-- 
Peter Williams     peter@newton.cx / peterw@ximian.com

"[Ninjas] are cool; and by cool, I mean totally sweet."
                              -- REAL Ultimate Power