bug-gnulib
[Top][All Lists]
Advanced

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

Re: gnulib taking over libobjs?


From: Jim Meyering
Subject: Re: gnulib taking over libobjs?
Date: Thu, 12 Oct 2006 22:26:41 +0200

Bruno Haible <address@hidden> wrote:
> Jim Meyering wrote:
>> coreutils now fails to pass "make
>> distcheck" after a bootstrap.  At least part of the problem is that
>> lib/Makefile's DIST_COMMON ends up being nearly empty.
>
> This should fix it. Now that we bypass automake's LIBOBJS magic, we have
> to declare all distributed files.

But that "cure" feels worse than the disease.

> This might look like a burden for the future, but actually things are
> becoming simpler. Typically, all files from lib/ can now be put into
> lib_SOURCES or all into EXTRA_DIST; it's usually no longer necessary
> to think about whether to mention a file or not. And in the future,
> gnulib will generate these EXTRA_DIST's for lib/* files automatically.
> This was not possible in the past because it collided with automake's
> benevolent error messages.
>
> 2006-10-12  Bruno Haible  <address@hidden>
>
>       * modules/acl (Makefile.am): Destribute all files in lib/ through
>       EXTRA_DIST.
>       * modules/arcfour (Makefile.am): Likewise.

Thanks for proposing that, but all of these additions to EXTRA_DIST
are redundant with existing AC_LIBOBJ and AC_REPLACE_FUNCS directives
in .m4 files.

I would hate to institutionalize a process that requires us to
maintain all of these names in two places -- even temporarily.

How about a change to gnulib-tool, now?  It would extract all
AC_LIBOBJ symbols, derive the corresponding source names, and add
them to the generated Makefile.am.

For example, this command, applied to the imported .m4 files for
coreutils, produces the required list of .c file names:

grep -h 'AC_LIBOBJ(' *.m4 \
  |sed 's/^  *//;/^#/d;/^dnl/d;s/.*AC_LIBOBJ(//;s/^\[//;s/[])].*$/.c \\/' \
  |sort -u

Then do the same, but with AC_REPLACE_FUNCS, and handle the
case when there are two or more arguments.

E.g., use the above to generate something like this:

EXTRA_DIST += \
  acl.c \
  argmatch.c \
  asnprintf.c \
  asprintf.c \
  backupfile.c \
  ...

I actually bootstrapped coreutils with the latest gnulib-tool,
plus your two-line addition to lib/Makefile.in and the above (manual)
addition to coreutils' lib/gnulib.mk.

It passed "make distcheck" with only one additional kludge.
The above mistakenly added lib/tmpfile-safer.c to the list,
even though coreutils doesn't use the file.
It was pulled in due to this unused macro in stdio-safer.m4:

  AC_DEFUN([gl_TMPFILE_SAFER],
  [
    AC_LIBOBJ([tmpfile-safer])
  ])

I know it's not perfect, since it's predicated on parsing
autoconf macros in a very crude manner, but at least in the
case of coreutils, it does work.

> diff -u -r1.7 acl
> --- modules/acl       21 Aug 2006 21:46:31 -0000      1.7
> +++ modules/acl       12 Oct 2006 18:44:07 -0000
> @@ -14,7 +14,7 @@
>  AC_FUNC_ACL
>
>  Makefile.am:
> -EXTRA_DIST += acl.h
> +EXTRA_DIST += acl.h acl.c
...




reply via email to

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