[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnulib] new module gettext-h for programs that don't use i18n
From: |
Bruno Haible |
Subject: |
Re: [bug-gnulib] new module gettext-h for programs that don't use i18n |
Date: |
Mon, 11 Jul 2005 13:34:51 +0200 |
User-agent: |
KMail/1.5 |
Paul Eggert wrote:
> I'm trying to have Emacs use gnulib a bit more (one module at a
> time...) and discovered that many modules currently depend on gettext
> even though they only need the gettext.h file. gettext is a fairly
> heavyweight module, and it's not time yet for me to add it to Emacs
> (it's on the todo list, but Not Yet), so I thought it better to remove
> the dependency of these other modules on gettext. So I introduced a
> new module gettext-h that contains only lib/gettext.h, and modified
> the other modules to depend only on gettext-h if they can be used
> without AM_GNU_GETTEXT and friends.
Fine with the gettext maintainer. (Also because some maintainers will want
to prefer maintaining/upgrading their gettext infrastructure through
autopoint, not gnulib-tool.)
But from the point of view of the gnulib architecture, the same argument
could hold for many of the gnulib modules, not just gettext. The solution
for this is the --avoid option to gnulib-tool, which I've now implemented.
If someone wants, say, regex without gettext, he now specifies
--avoid=gettext.
Similarly, if someone wants xalloc without xalloc-die, he specifies
--avoid=xalloc-die.
I would therefore now suggest to undo the earlier commodity hacks and
return to a state where the modules/* files represent the real dependencies.
Namely, add back 'xalloc-die' as dependency to those modules need it.
Not sure about 'unlocked-io'.
Bruno
2005-07-09 Bruno Haible <address@hidden>
* gnulib-tool (func_usage): Document option --avoid.
(Command line options): Handle --avoid.
(func_acceptable): New function.
(func_modules_transitive_closure): Use it.
*** gnulib-tool.bak 2005-07-06 22:55:48.000000000 +0200
--- gnulib-tool 2005-07-10 04:54:45.000000000 +0200
***************
*** 90,95 ****
--- 90,98 ----
placed (default \"m4\"), for --import.
--aux-dir=DIRECTORY Directory relative --dir where auxiliary build
tools are placed (default \".\"), for --import.
+ --avoid=MODULE Avoid including the given MODULE. Useful if you
+ have code that provides equivalent functionality.
+ This option can be repeated.
--lgpl Abort if modules aren't available under the LGPL.
Also modify license template from GPL to LGPL.
--libtool Use libtool rules, for --import.
***************
*** 181,188 ****
# - sourcebase from --source-base
# - m4base from --m4-base
# - auxdir from --aux-dir
! # - libtool true if --libtool was given, blank otherwise
# - lgpl true if --lgpl was given, blank otherwise
# - do_changelog false if --no-changelog was given, : otherwise
# - dry_run true if --dry-run was given, blank otherwise
{
--- 184,192 ----
# - sourcebase from --source-base
# - m4base from --m4-base
# - auxdir from --aux-dir
! # - avoidlist list of modules to avoid, from --avoid
# - lgpl true if --lgpl was given, blank otherwise
+ # - libtool true if --libtool was given, blank otherwise
# - do_changelog false if --no-changelog was given, : otherwise
# - dry_run true if --dry-run was given, blank otherwise
{
***************
*** 193,204 ****
sourcebase=
m4base=
auxdir=
! libtool=
lgpl=
do_changelog=:
dry_run=
symbolic=
- lgpl=
supplied_opts="$@"
--- 197,208 ----
sourcebase=
m4base=
auxdir=
! avoidlist=
lgpl=
+ libtool=
do_changelog=:
dry_run=
symbolic=
supplied_opts="$@"
***************
*** 277,288 ****
--aux-dir=* )
auxdir=`echo "X$1" | sed -e 's/^X--aux-dir=//'`
shift ;;
! --libtool )
! libtool=true
shift ;;
--lgpl )
lgpl=true
shift ;;
--no-changelog | --no-changelo | --no-changel | --no-change |
--no-chang | --no-chan | --no-cha | --no-ch | --no-c )
do_changelog=false
shift ;;
--- 281,302 ----
--aux-dir=* )
auxdir=`echo "X$1" | sed -e 's/^X--aux-dir=//'`
shift ;;
! --avoid )
! shift
! if test $# = 0; then
! func_fatal_error "missing argument for --avoid"
! fi
! avoidlist="$avoidlist $1"
! shift ;;
! --avoid=* )
! avoidlist="$avoidlist "`echo "X$1" | sed -e 's/^X--avoid=//'`
shift ;;
--lgpl )
lgpl=true
shift ;;
+ --libtool )
+ libtool=true
+ shift ;;
--no-changelog | --no-changelo | --no-changel | --no-change |
--no-chang | --no-chan | --no-cha | --no-ch | --no-c )
do_changelog=false
shift ;;
***************
*** 429,437 ****
--- 443,466 ----
sed -n -e "/^Maintainer$sed_extract_prog" < "$gnulib_dir/modules/$1"
}
+ # func_acceptable module
+ # tests whether a module is acceptable.
+ # Input:
+ # - avoidlist list of modules to avoid
+ func_acceptable ()
+ {
+ for avoid in $avoidlist; do
+ if test "$avoid" = "$1"; then
+ return 1
+ fi
+ done
+ return 0
+ }
+
# func_modules_transitive_closure
# Input:
# - modules list of specified modules
+ # - avoidlist list of modules to avoid
# Output:
# - modules list of modules, including dependencies
func_modules_transitive_closure ()
***************
*** 441,452 ****
for module in $modules; do
func_verify_module
if test -n "$module"; then
! # Duplicate dependenies are harmless, but Jim wants a warning.
duplicated_deps=`func_get_dependencies $module | sort | uniq -d`
if test -n "$duplicated_deps"; then
echo "warning: module $module has duplicated dependencies: "`echo
$duplicated_deps` 1>&2
fi
! xmodules="$xmodules $module "`func_get_dependencies $module`
fi
done
xmodules=`for m in $xmodules; do echo $m; done | sort | uniq`
--- 470,488 ----
for module in $modules; do
func_verify_module
if test -n "$module"; then
! # Duplicate dependencies are harmless, but Jim wants a warning.
duplicated_deps=`func_get_dependencies $module | sort | uniq -d`
if test -n "$duplicated_deps"; then
echo "warning: module $module has duplicated dependencies: "`echo
$duplicated_deps` 1>&2
fi
! if func_acceptable $module; then
! xmodules="$xmodules $module"
! for depmodule in `func_get_dependencies $module`; do
! if func_acceptable $depmodule; then
! xmodules="$xmodules $depmodule"
! fi
! done
! fi
fi
done
xmodules=`for m in $xmodules; do echo $m; done | sort | uniq`
***************
*** 554,561 ****
# - libname library name
# - sourcebase directory relative to destdir where to place source code
# - m4base directory relative to destdir where to place *.m4 macros
! # - libtool true if libtool will be used, blank otherwise
# - lgpl true if library's license shall be LGPL, blank otherwise
# - dry_run true if actions shall only be printed, blank otherwise
# - symbolic true if files should be symlinked, copied otherwise
# - supplied_opts all options passed to gnulib-tool
--- 590,598 ----
# - libname library name
# - sourcebase directory relative to destdir where to place source code
# - m4base directory relative to destdir where to place *.m4 macros
! # - avoidlist list of modules to avoid, from --avoid
# - lgpl true if library's license shall be LGPL, blank otherwise
+ # - libtool true if libtool will be used, blank otherwise
# - dry_run true if actions shall only be printed, blank otherwise
# - symbolic true if files should be symlinked, copied otherwise
# - supplied_opts all options passed to gnulib-tool
Re: new module gettext-h for programs that don't use i18n, Simon Josefsson, 2005/07/11