Hello Chris, thanks for the bug report and the analysis you have already done.
* Chris Pickett wrote on Sun, Dec 28, 2008 at 07:19:43AM CET: > > It turns out that I can fix my problem by adding @LTLIBOBJS@ to > libcheck_la_DEPENDENCIES, which is something I set explicitly but > neglected to mention earlier. > > Ralf Wildenhues wrote: >> mkdir src >> cat >configure.ac <<\END >> AC_INIT(a,1) >> AM_INIT_AUTOMAKE(foreign) >> AC_CONFIG_FILES(Makefile src/Makefile) >> AC_PROG_CC >> AC_PROG_LIBTOOL >> AC_REPLACE_FUNCS([strsignal]) >> AC_OUTPUT >> END >> echo 'SUBDIRS = src' > Makefile.am >> cat >src/Makefile.am <<\END > > However, if you simply add > > libcheck_la_DEPENDENCIES = > > at this point (at the top of the src/Makefile.am) to your minimal > example, then strsignal.lo is produced under OS X, but not under > msys/gcc. Wait a minute. Even if I add libcheck_la_DEPENDENCIES = libcheckinternal_la_DEPENDENCIES = then automake 1.10.2 still fails with | src/Makefile.am:1: required file `src/strsignal.c' not found Do you not see that happen? Now, let's assume you have src/strsignal.c. Then automake will succeed. You say that things work OK under OS X but not with MSYS/MinGW. Can you please look what configure decides about strsignal there, and show the failing 'make' output, best in a clean build tree? > However, if you then take out the libcheckinternal bits it > fails (correctly) on OS X again. It looks like libcheckinternal is > causing strsignal.lo to get built on OS X but not on sys/gcc. Aside, why do you even need to touch the *_DEPENDENCIES variables at all? * Chris Pickett wrote on Sun, Dec 28, 2008 at 07:31:22AM CET: > >> In tracking this down, I found out that neither @LTLIBOBJS@ nor >> @LTALLOCA@ are mentioned in either the "Linking the Program" manual >> section or the "Program and Library Variables" section in the >> paragraphs talking about _DEPENDENCIES, although @LIBOBJS@ and @ALLOCA@ >> are. Well, but that node deals with linking a program only, not linking a library. LTLIBOBJS and LTALLOCA are dealt with when Libtool libraries are discussed, see info Automake "A Shared Libary" and info Automake LTLIBOBJS While I agree that it might not be obvious, I don't think the "Linking" node should be filled with those details. Also, the LIBOBJS node already hints at LTLIBOBJS. > Also, it's probably worth fixing this paragraph: > > `Using these variables is very similar to doing conditional > compilation using `AC_SUBST' variables, as described in *note > Conditional Sources::. That is, when building a program, `$(LIBOBJS)' > and `$(ALLOCA)' should be added to the associated `*_LDADD' variable, > or to the `*_LIBADD' variable when building a library. However there > is no need to list the corresponding sources in `EXTRA_*_SOURCES' nor > to define `*_DEPENDENCIES'. Automake automatically adds `$(LIBOBJS)' > and `$(ALLOCA)' to the dependencies, and it will discover the list of > corresponding source files automatically (by tracing the invocations of > the `AC_LIBSOURCE' Autoconf macros).' > > to replace the last `.' with `, unless you have already defined > *_DEPENDENCIES explicitly for another purpose, in which case you must > add these variables manually.' This is consistent with the logic in the > previously mentioned sections about *_DEPENDENCIES. Thanks, I am pushing this, slightly reworded change, both branches, and adding you to THANKS. Cheers, Ralf 2008-12-29 Chris Pickett <chris.pick...@mail.mcgill.ca> (tiny change) * doc/automake.texi (LIBOBJS): Clarify overriding of `*_DEPENDENCIES'. * THANKS: Update. diff --git a/doc/automake.texi b/doc/automake.texi index 92b2a09..122a62a 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -5738,7 +5738,9 @@ However there is no need to list the corresponding sources in automatically adds @samp{$(LIBOBJS)} and @samp{$(ALLOCA)} to the dependencies, and it will discover the list of corresponding source files automatically (by tracing the invocations of the -...@code{ac_libsource} Autoconf macros). +...@code{ac_libsource} Autoconf macros). However, if you have already +defined @samp{*_DEPENDENCIES} explicitly for an unrelated reason, then +you have to add these variables manually. These variables are usually used to build a portability library that is linked with all the programs of the project. We now review a