I just added the stat module to my project, which pulls in alloca. Now I
get this error during bootstrap:

bootstrap: running: autoreconf --symlink --install
libgnu/Makefile.gnulib:58: error: required file 'lib/alloca.c' not found

I have source_base set to libgnu (not lib). I am also using subdir-objects
in AM_INIT_AUTOMAKE, which might be relevant.

In my case, the offending line of Makefile.gnulib is:

libgnu_la_LIBADD = $(gl_libgnu_LTLIBOBJS)

This list of objects appears to come eventually from
EXTRA_libgnu_la_SOURCES. In my case, this is set by the following lines in
libgnu/Makefile.gnulib:

    60: EXTRA_libgnu_la_SOURCES =
    86: EXTRA_libgnu_la_SOURCES += alloca.c
   536: EXTRA_libgnu_la_SOURCES += relocatable.c
   663: EXTRA_libgnu_la_SOURCES += stat-w32.c

I was already using the relocatable module, so I already had an entry in
this variable, so I don't see what new mechanism is engaged here.

If I copy alloca.c into my lib/ directory, the error is fixed as promised.
So it seems I have failed to configure something, or there is a bug in
gnulib and it's ignoring my source_base.

I have looked for occurrences of alloca.c and I notice the following in
m4/gnulib-comp.m4:

# Like AC_LIBSOURCES, except the directory where the source file is
# expected is derived from the gnulib-tool parameterization,
# and alloca is special cased (for the alloca-opt module).
# We could also entirely rely on EXTRA_lib..._SOURCES.
AC_DEFUN([gltests_LIBSOURCES], [
  m4_foreach([_gl_NAME], [$1], [
    m4_if(_gl_NAME, [alloca.c], [], [
      m4_define([gltests_LIBSOURCES_DIR], [tests])
      m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ])
    ])
  ])
])

But this seems only to be relevant to tests.

I read in the manual about alloca-opt, but I can't see that I'm required to
do anything special because of it; and in any case, I'm not using it
directly.

I would be most grateful for any pointers as to how I might work out what's
going wrong here.

-- 
Web: rrt.sc3d.org

Reply via email to