Bob Friesenhahn <bfriesen@xxxxxxxxxxxxxxxxxxx> writes: > On Mon, 5 Oct 2009, Ben Pfaff wrote: >> >> 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. > > This is a rather complex issue since the problem can be corrected by > LD_LIBRARY_LFLAGS, ldconfig/crle, by formally installing the library, > or by libtool at link time. Since autoconf does not use libtool in > its testing, it does not benefit from the extra smarts provided by > libtool, and so autoconf tests are more fragile. For example, > autoconf can't know about library dependencies that libtool may be > able to figure out later (via installed .la files) and so the > configure script developer needs to provide way to add all of these > dependencies to LIBS. > > In summary, your idea seems nice, but it might block builds which > would otherwise succeed and work. If your advice is correct, then any use of AC_RUN_IFELSE (if any libraries are added to LIBS) must be incorrect, because Autoconf does not have the correct knowledge to run a program. It's hard for me to believe that, because the Autoconf manual only mentions problems with AC_RUN_IFELSE when cross-compiling and doesn't say anything about other pitfalls. -- Ben Pfaff http://benpfaff.org _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf