autoconf
[Top][All Lists]
Advanced

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

Re: checking for libraries that link but do not run


From: Ralf Wildenhues
Subject: Re: checking for libraries that link but do not run
Date: Thu, 8 Oct 2009 07:27:47 +0200
User-agent: Mutt/1.5.20 (2009-08-09)

* Ben Pfaff wrote on Mon, Oct 05, 2009 at 06:20:47PM CEST:
> In GNU PSPP, we have had a number of problems with users who pass
> correct "configure" flags to link against a library
> (e.g. LDFLAGS='-L/usr/local/lib') but do not pass the correct
> flags to let binaries linked against those libraries run
> (e.g. LDFLAGS='-Wl,-rpath,/usr/local/lib' or LD_LIBRARY_PATH).
> This means that AC_RUN_IFELSE calls after those libraries are
> added to LIBS always fail.  This causes bizarre symptoms, such as
> build assertion failures in gnulib-generated stdint.h (e.g. see
> http://lists.gnu.org/archive/html/pspp-dev/2009-10/msg00002.html).
> 
> To try to head off the problem, I'm thinking about putting
> something like this after each command that adds to LIBS:
>     AC_RUN_IFELSE([AC_LANG_PROGRAM([], [])], 
>                   [:],
>                   [AC_MSG_FAILURE([Cannot run program linked against 
> $LIBS.])],
>                   [:])
> 
> Am I on the right track?  It seems to me that there should
> already be a mechanism to help with this, but I do not see one.

One possibility is to use the gnulib havelib module.

But apart from that, I also think that Autoconf should make it easier
for the developer to state:

- At this point I require the compile command to be able to link an
  executable (AC_PROG_{CC,..} don't do this consistently enough)

- At this point I require being able to run an executable (in non-
  cross-compile mode).

Thanks,
Ralf




reply via email to

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