bug-gnulib
[Top][All Lists]
Advanced

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

Re: xvasprintf: don't depend directly on xalloc-die


From: Simon Josefsson
Subject: Re: xvasprintf: don't depend directly on xalloc-die
Date: Thu, 11 Aug 2005 12:08:52 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

Bruno Haible <address@hidden> writes:

>> Wasn't the point of separating xalloc-die from the xmalloc module to
>> allow applications to supply its own xalloc_die function?
>
> Such applications can now use
>
>     gnulib-tool --avoid=xalloc-die 
>
> See http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00082.html

Thanks!

I installed the patch below, to make it easier to specify such modules
inside configure.ac.

Index: gnulib-tool
===================================================================
RCS file: /cvsroot/gnulib/gnulib/gnulib-tool,v
retrieving revision 1.48
diff -u -p -r1.48 gnulib-tool
--- gnulib-tool 11 Jul 2005 11:37:09 -0000      1.48
+++ gnulib-tool 11 Aug 2005 10:08:07 -0000
@@ -720,6 +720,9 @@ func_import ()
     echo "dnl Usage: gl_MODULES(module1 module2 ...)"
     echo "AC_DEFUN([gl_MODULES], [])"
     echo
+    echo "dnl Usage: gl_AVOID(module1 module2 ...)"
+    echo "AC_DEFUN([gl_AVOID], [])"
+    echo
     echo "dnl Usage: gl_SOURCE_BASE(DIR)"
     echo "AC_DEFUN([gl_SOURCE_BASE], [])"
     echo
@@ -952,6 +955,9 @@ case $mode in
       /gl_MODULES[^_]/  {
         s,^.*gl_MODULES([[   ]*\([^])]*\).*$,ac_modules="\1",; p;
       };
+      /gl_AVOID[^_]/  {
+        s,^.*gl_AVOID([[   ]*\([^])]*\).*$,ac_avoidlist="\1",; p;
+      };
       /gl_SOURCE_BASE/   {
         s,^.*gl_SOURCE_BASE([[         ]*\([^])]*\).*$,ac_sourcebase="\1",; p;
       };
@@ -1007,6 +1013,9 @@ case $mode in
     else
       modules="$*"
     fi
+
+    # Which modules to avoid?
+    avoidlist="$avoidlist $ac_avoidlist"
 
     func_import "$modules"
     ;;
Index: doc/ChangeLog
===================================================================
RCS file: /cvsroot/gnulib/gnulib/doc/ChangeLog,v
retrieving revision 1.18
diff -u -p -r1.18 ChangeLog
--- doc/ChangeLog       30 Jul 2005 13:47:19 -0000      1.18
+++ doc/ChangeLog       11 Aug 2005 10:08:07 -0000
@@ -1,3 +1,8 @@
+2005-08-11  Simon Josefsson  <address@hidden>
+
+       * gnulib.texi (Initial import, Finishing touches): Mention
+       gl_AVOID.
+
 2005-07-30  Karl Berry  <address@hidden>
 
        * gnulib.texi (Initial import): mention -I$(top_builddir)/lib.
Index: doc/gnulib.texi
===================================================================
RCS file: /cvsroot/gnulib/gnulib/doc/gnulib.texi,v
retrieving revision 1.15
diff -u -p -r1.15 gnulib.texi
--- doc/gnulib.texi     30 Jul 2005 13:47:19 -0000      1.15
+++ doc/gnulib.texi     11 Aug 2005 10:08:07 -0000
@@ -413,12 +413,15 @@ By default, the source code is copied in
 macros in @file{m4/}.  You can override these paths by using
 @code{--source-base=DIRECTORY} and @code{--m4-base=DIRECTORY}, or by
 adding @samp{gl_SOURCE_BASE(DIRECTORY)} and
address@hidden(DIRECTORY)} to your @file{configure.ac}.
-Some modules also provide other files necessary
-for building. These files are copied into the directory specified
-by @samp{AC_CONFIG_AUX_DIR} in @file{configure.ac} or by the
address@hidden option. If neither is specified, the
-current directory is assumed.
address@hidden(DIRECTORY)} to your @file{configure.ac}.  Some
+modules also provide other files necessary for building. These files
+are copied into the directory specified by @samp{AC_CONFIG_AUX_DIR} in
address@hidden or by the @code{--aux-dir=DIRECTORY} option.  If
+neither is specified, the current directory is assumed.  If a module
+is automatically added as a dependency is added, that you wish to
+avoid, you may use @code{--avoid=MODULE}, possibly several times.  Of
+course, you will then need to implement the same interface as the
+removed module.
 
 @code{gnulib-tool} can make symbolic links instead
 of copying the source files. Use the @code{--symbolic}
@@ -608,7 +611,8 @@ gl_EARLY
 gl_SOURCE_BASE(gl)
 gl_M4_BASE(gl/m4)
 gl_LIB(libgl)
-gl_MODULES(getopt progname strdup dummy exit error getpass-gnu getaddrinfo)
+gl_MODULES(xmalloc progname strdup dummy exit error getpass-gnu getaddrinfo)
+gl_AVOID(xalloc-die)
 gl_INIT
 ...
 @end example
@@ -622,7 +626,8 @@ The macros @code{gl_EARLY}, @code{gl_INI
 macro can be used if you wish to change the library name (by default
 @file{libgnu.a} or @file{libgnu.la} if you use libtool).  The
 @code{gl_MODULES} macro is used to specify which modules to import.
-
address@hidden macro is used to specify which modules, that are
+normally automatically added as a dependency, to avoid.
 
 @node Copying This Manual
 @appendix Copying This Manual




reply via email to

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