Hi Paul,

Paul Eggert wrote:
> "gnulib-tool --avoid gnulib-i18n ..." is designed to avoid 
> internationalization-related code for apps like gzip that do not do 
> i18n

No, that's not what it is designed to do. All that '--avoid gnulib-i18n'
does is to avoid referencing Gnulib's .mo files. The assumption then
is that the application will list Gnulib's .c files in the po/POTFILES.in,
so as to request translations of the Gnulib messages from the translators
a second time.

> https://www.cs.ucla.edu/~eggert/gzip-1.14.24-6b03.tar.xz
> 
> The latter tarball is sigificantly larger and contains several 
> unnecessary i18n-related files, including the following files. What's a 
> good way to fix this?
> 
> lib/c32isalnum.c
> lib/c32isalpha.c
> lib/c32isblank.c
> lib/c32iscntrl.c
> lib/c32isdigit.c
> lib/c32isgraph.c
> lib/c32is-impl.h
> lib/c32islower.c
> lib/c32isprint.c
> lib/c32ispunct.c
> lib/c32isspace.c
> lib/c32isupper.c
> lib/c32isxdigit.c
> lib/c32to-impl.h
> lib/c32tolower.c
> lib/c32width.c
> lib/glthread
> lib/hard-locale.c
> lib/hard-locale.h
> lib/iswblank.c
> lib/iswdigit.c
> lib/iswpunct.c
> lib/iswxdigit.c
> lib/lc-charset-dispatch.c
> lib/lc-charset-dispatch.h
> lib/localcharset.c
> lib/localcharset.h
> lib/localeconv.c
> lib/locale.in.h
> lib/mbchar.c
> lib/mbchar.h
> lib/mbiterf.c
> lib/mbiterf.h
> lib/mbrtoc32.c
> lib/mbrtowc.c
> lib/mbrtowc-impl.h
> lib/mbrtowc-impl-utf8.h
> lib/mbsinit.c
> lib/mbsnlen.c
> lib/mbtowc-lock.c
> lib/mbtowc-lock.h
> lib/pthread.in.h
> lib/pthread-once.c
> lib/sched.in.h
> lib/setlocale-lock.c
> lib/setlocale_null.c
> lib/setlocale_null.h
> lib/setlocale_null-unlocked.c
> lib/stdio-consolesafe.c
> lib/uchar.in.h
> lib/unicase
> lib/unicase.in.h
> lib/unictype
> lib/unictype.in.h
> lib/uninorm.in.h
> lib/unitypes.in.h
> lib/uniwidth
> lib/uniwidth.in.h
> lib/wctype-h.c
> lib/wctype.in.h
> lib/wcwidth.c
> lib/windows-initguard.h
> lib/windows-mutex.c
> lib/windows-mutex.h
> lib/windows-once.c
> lib/windows-once.h
> lib/windows-recmutex.c
> lib/windows-recmutex.h
> lib/windows-rwlock.c
> lib/windows-rwlock.h
> m4/c32rtomb.m4
> m4/gettext_h.m4
> m4/iswblank.m4
> m4/iswdigit.m4
> m4/iswpunct.m4
> m4/iswxdigit.m4
> m4/libunistring-base.m4
> m4/localcharset.m4
> m4/localeconv.m4
> m4/locale-fr.m4
> m4/locale_h.m4
> m4/lock.m4
> m4/mbchar.m4
> m4/mbiter.m4
> m4/mbrtoc32.m4
> m4/mbsinit.m4
> m4/once.m4
> m4/pthread_h.m4
> m4/pthread-once.m4
> m4/pthread_rwlock_rdlock.m4
> m4/pthread-spin.m4
> m4/sched_h.m4
> m4/setlocale_null.m4
> m4/threadlib.m4
> m4/uchar_h.m4
> m4/unicase_h.m4
> m4/unictype_h.m4
> m4/uninorm_h.m4
> m4/unitypes_h.m4
> m4/wctype_h.m4
> m4/wcwidth.m4

As explained above, this is unrelated to the gnulib-i18n module.

Also, what is the problem? The .c files are only compiled when needed.

In any case, you can use gnulib-tool to determine the reason why a
file is included:

  $ ./gnulib-tool --find lib/iswxdigit.c
  iswxdigit

  $ ./gnulib-tool --extract-dependents iswxdigit | grep -v tests
  c32isxdigit
  wctype

  $ ./gnulib-tool --extract-dependents c32isxdigit | grep -v tests
  c32_get_type_test
  mbchar

  $ ./gnulib-tool --extract-dependents wctype | grep -v tests
  c32_get_type_test
  fnmatch
  regex

  ... and so on ...

Looking at the starting points in gzip/bootstrap.conf, I can see at least
this dependency chain:

  yesno → rpmatch → regex → wctype → iswxdigit

  $ ./gnulib-tool --extract-dependencies yesno
  getline
  rpmatch
  bool

  $ ./gnulib-tool --extract-dependencies rpmatch
  stdlib-h
  extensions
  bool            [test $HAVE_RPMATCH = 0]
  gettext-h       [test $HAVE_RPMATCH = 0]
  gnulib-i18n     [test $HAVE_RPMATCH = 0]
  regex           [test $HAVE_RPMATCH = 0]
  strdup          [test $HAVE_RPMATCH = 0]
  streq           [test $HAVE_RPMATCH = 0]

  $ ./gnulib-tool --extract-dependencies regex
  c99
  extensions
  ssize_t
  vararrays
  attribute               [test $ac_use_included_regex = yes]
  btowc                   [test $ac_use_included_regex = yes]
  builtin-expect          [test $ac_use_included_regex = yes]
  gettext-h               [test $ac_use_included_regex = yes]
  glibc-internal/dynarray [test $ac_use_included_regex = yes]
  gnulib-i18n             [test $ac_use_included_regex = yes]
  intprops                [test $ac_use_included_regex = yes]
  iswctype                [test $ac_use_included_regex = yes]
  langinfo-h              [test $ac_use_included_regex = yes]
  libc-config             [test $ac_use_included_regex = yes]
  limits-h                [test $ac_use_included_regex = yes]
  lock                    [test $ac_use_included_regex = yes]
  malloc-gnu              [test $ac_use_included_regex = yes]
  memcmp                  [test $ac_use_included_regex = yes]
  memmove                 [test $ac_use_included_regex = yes]
  mbrtowc                 [test $ac_use_included_regex = yes]
  mbsinit                 [test $ac_use_included_regex = yes]
  nl_langinfo             [test $ac_use_included_regex = yes]
  bool                    [test $ac_use_included_regex = yes]
  stdckdint-h             [test $ac_use_included_regex = yes]
  stdcountof-h            [test $ac_use_included_regex = yes]
  stdint-h                [test $ac_use_included_regex = yes]
  strncpy                 [test $ac_use_included_regex = yes]
  verify                  [test $ac_use_included_regex = yes]
  wchar-h                 [test $ac_use_included_regex = yes]
  wcrtomb                 [test $ac_use_included_regex = yes]
  wctype-h                [test $ac_use_included_regex = yes]
  wctype                  [test $ac_use_included_regex = yes]

  $ ./gnulib-tool --extract-dependencies wctype
  wctype-h
  iswblank        [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]
  iswdigit        [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]
  iswpunct        [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]
  iswxdigit       [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]
  streq           [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]
  iswctype        [test $REPLACE_WCTYPE = 1]

Bruno




Reply via email to