autoconf
[Top][All Lists]
Advanced

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

Re: linking small programs with AC_LINK_IFELSE


From: Bob Rossi
Subject: Re: linking small programs with AC_LINK_IFELSE
Date: Thu, 18 Jan 2007 15:54:24 -0500
User-agent: Mutt/1.5.12-2006-07-14

On Tue, Jan 09, 2007 at 08:58:24PM +0100, Ralf Wildenhues wrote:
> Hello Bob,
> 
> * Bob Rossi wrote on Wed, Dec 20, 2006 at 09:00:47PM CET:
> > 
> > I'm wondering. I'm trying to use AC_LINK_IFELSE to link a small program
> > against libexpat. I set the flags 
> >   LIBS="$LIBS $EXPAT_LDADD"
> >   CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
> >   LDFLAGS="$LDFLAGS $EXPAT_LDFLAGS"
> > appropriatly. 
> > 
> > The problem is, I use the program to determine if libexpat has been
> > compiled already. If that doesn't work, I go ahead and ./configure &&
> > make the libexpat that i've packed in my distro. Now, if libexpat is
> > already installed on the system, this test always passes, because gcc
> > finds it in the standard location. Is there anything I can do to force
> > gcc and autoconf to link that program and only use the libraries and
> > headers that I give it?
> 
> I'm wondering why you don't like this: either the libexpat from the
> standard locations is acceptable for you, then you could just accept
> the answer, or it isn't for some reason.  So tell us about the reason.
> It provides the clue for how to write a test that differentiates between
> those two questions.

Well, lets say I modified libexpat and it's now different than the one
on the system. When you configure my software, it'll configure and
install the packaged libexpat into a temporary build location. Then my
software will set the -L and -I there and use the -l from there when
doing a test to see if it can link to libexpat.

However, if for some reason the local expat build fails, my check to 
compile a small program still works because it picks up the installed 
one on the system.

I was just wondering if there is a way to get around this. Thinking
about it a little more, I'm thinking there isn't a way. Any ideas?

Thanks,
Bob Rossi




reply via email to

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