bug-gnulib
[Top][All Lists]
Advanced

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

Re: [bug-gnulib] FYI: adding AC_LIBSOURCES/AC_LIBOBJ in coreutils .m4 fi


From: Bruno Haible
Subject: Re: [bug-gnulib] FYI: adding AC_LIBSOURCES/AC_LIBOBJ in coreutils .m4 files
Date: Sat, 29 Jan 2005 17:48:35 +0100
User-agent: KMail/1.5

Jim Meyering wrote:
> I proposed this conversion (adding AC_LIBSOURCES) over a month ago and
> everyone but Bruno seemed to like it.  I never heard back from Bruno
> after this message,
>
>   http://lists.gnu.org/archive/html/bug-gnulib/2004-12/msg00042.html
>
> so maybe he was convinced :)

No, I only figured that you weren't convinced.

You wrote:

> >   - Specifying filenames in autoconf macros makes it hard for two packages
> >     to have different directory layout. For example, the gnulib stuff
> >     goes into gettext-tools/lib/ but into libiconv/srclib/ - because lib/
> >     already holds other stuff.
> 
> Yes, gettext is very different from the majority of packages, so it's
> not surprising that it has unusual requirements.

So what is your answer on this? Are you saying that all packages should
have the same directory layout as coreutils, namely one src/ and one lib/
directory?

IMO it's the package maintainer's responsibility to set out a reasonable
directory structure for the package, and the tools should be able to
obey it. Not the other way around.

> 2005-01-29  Jim Meyering  <address@hidden>
>
>       * hard-locale.m4:

This breaks gettext.

gettext has a different file layout:
  - lib/   for all stuff that is needed by most programs - it goes into a
           shared library,
  - libuniname/    stuff needed by a single program, linked statically
  - libgrep/       stuff needed by a single program, linked statically

lib/ contains many gnulib modules. libgrep/ contains only a few of them:
hard-locale, regex, strdup.

I had already to go through hoops (write m4 code that is likely to break
in future autoconf versions) because of AC_LIBOBJ; now the AC_LIBSOURCES
patch breaks it even more: If I take gettext-0.14-pre2 and apply the appended
patch, I get

   $ sh autogen.sh
   lib/Makefile.am:117: required file `lib/hard-locale.h' not found
   lib/Makefile.am:117: required file `lib/hard-locale.c' not found


The possible workarounds are:

  ? Add a configure.ac file and a lib/ directory to libgrep/.
    - I refuse to do so, because as mentioned above, this would be
      the tool dictating the directory structure to the maintainer.

  ? Move the whole contents of libuniname and libgrep into lib/ and
    merge the three Makefile.am's.
    - I refuse to do so, because as mentioned above, this would be
      the tool dictating the directory structure to the maintainer.
      Also I don't like directories to contain unrelated parts.

  ? Move the hard-locale, regex, strdup modules from libgrep/ to lib/.
    - This would increase the size of the shared library, and thus
      increase the startup time of all programs, just for the sake
      of a single program.

  ? Provide empty files lib/hard-locale.h and lib/hard-locale.c.
    - Would you like to add empty files to coreutils, just to shut up
      autoconf and automake?

None of them is reasonable.

I invite you to download 
http://www.haible.de/bruno/gnu/gettext-0.14.2-pre2.tar.gz
and try yourself.

Bottom line: The AC_LIBSOURCES approach causes unnecessary hassles.

                Bruno


*** gettext-tools/m4/hard-locale.m4     19 Jan 2005 14:24:18 -0000      1.2
--- gettext-tools/m4/hard-locale.m4     29 Jan 2005 16:12:30 -0000
***************
*** 5,8 ****
  dnl with or without modifications, as long as this notice is preserved.
  
  dnl No prerequisites of lib/hard-locale.c.
! AC_DEFUN([gl_HARD_LOCALE], [:])
--- 5,11 ----
  dnl with or without modifications, as long as this notice is preserved.
  
  dnl No prerequisites of lib/hard-locale.c.
! AC_DEFUN([gl_HARD_LOCALE], [
!   AC_LIBSOURCES([hard-locale.h, hard-locale.c])
!   AC_LIBOBJ([hard-locale])
! ])
*** gettext-tools/libgrep/Makefile.am   28 Jan 2005 13:00:39 -0000      1.3
--- gettext-tools/libgrep/Makefile.am   29 Jan 2005 16:12:30 -0000
***************
*** 29,36 ****
    libgrep.h \
    kwset.h kwset.c \
    dfa.h dfa.c \
!   m-common.h m-common.c m-fgrep.c m-regex.c \
!   hard-locale.h hard-locale.c
  
  # Sources that are compiled only on platforms that lack the functions.
  
--- 29,35 ----
    libgrep.h \
    kwset.h kwset.c \
    dfa.h dfa.c \
!   m-common.h m-common.c m-fgrep.c m-regex.c
  
  # Sources that are compiled only on platforms that lack the functions.
  





reply via email to

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