Re: checking for libraries that link but do not run

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

 



* 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


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux