bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] Describe which environment variables really control the inte


From: Bruno Haible
Subject: Re: [PATCH] Describe which environment variables really control the interpretation of the response to -ok.
Date: Tue, 29 Apr 2008 02:58:05 +0200
User-agent: KMail/1.5.4

Jim Meyering wrote:
> Looks good to me.

Also, Eric was positive. So I applied it.

Also now I added the rpmatch declaration to the <stdlib.h> file (this is
where glibc has it):

2008-04-28  Bruno Haible  <address@hidden>

        Declare rpmatch.
        * lib/stdlib.in.h (rpmatch): New declaration.
        * lib/rpmatch.c: Include <stdlib.h> first.
        * m4/rpmatch.m4 (gl_FUNC_RPMATCH): Require AC_USE_SYSTEM_EXTENSIONS and
        gl_STDLIB_H_DEFAULTS. Set HAVE_RPMATCH.
        * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize GNULIB_RPMATCH,
        HAVE_RPMATCH.
        * modules/rpmatch (Depends-on): Add stdlib, extensions.
        (configure.ac): Invoke gl_STDLIB_MODULE_INDICATOR.
        (Include): Set to <stdlib.h>.
        * modules/stdlib (Makefile.am): Substitute GNULIB_RPMATCH and
        HAVE_RPMATCH.
        * NEWS: Document the change.

*** NEWS.orig   2008-04-29 02:53:08.000000000 +0200
--- NEWS        2008-04-29 02:49:19.000000000 +0200
***************
*** 6,11 ****
--- 6,13 ----
  
  Date        Modules         Changes
  
+ 2008-04-28  rpmatch         The include file is now <stdlib.h>.
+ 
  2008-03-06  freadahead      The return value's computation has changed. It
                              now increases by 1 after ungetc.
  
*** lib/rpmatch.c.orig  2008-04-29 02:53:08.000000000 +0200
--- lib/rpmatch.c       2008-04-29 02:46:36.000000000 +0200
***************
*** 19,27 ****
  
  #include <config.h>
  
  #include <stdbool.h>
  #include <stddef.h>
- #include <stdlib.h>
  
  #if ENABLE_NLS
  # include <sys/types.h>
--- 19,29 ----
  
  #include <config.h>
  
+ /* Specification.  */
+ #include <stdlib.h>
+ 
  #include <stdbool.h>
  #include <stddef.h>
  
  #if ENABLE_NLS
  # include <sys/types.h>
***************
*** 118,126 ****
  #endif
  
  
- /* Test a user response to a question.
-    Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear.  */
- 
  int
  rpmatch (const char *response)
  {
--- 120,125 ----
*** lib/stdlib.in.h.orig        2008-04-29 02:53:08.000000000 +0200
--- lib/stdlib.in.h     2008-04-29 02:44:26.000000000 +0200
***************
*** 176,181 ****
--- 176,196 ----
  #endif
  
  
+ #if @GNULIB_RPMATCH@
+ # if address@hidden@
+ /* Test a user response to a question.
+    Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear.  */
+ extern int rpmatch (const char *response);
+ # endif
+ #elif defined GNULIB_POSIXCHECK
+ # undef rpmatch
+ # define rpmatch(r) \
+     (GL_LINK_WARNING ("rpmatch is unportable - " \
+                       "use gnulib module rpmatch for portability"), \
+      rpmatch (r))
+ #endif
+ 
+ 
  #if @GNULIB_SETENV@
  # if address@hidden@
  /* Set NAME to VALUE in the environment.
*** m4/rpmatch.m4.orig  2008-04-29 02:53:08.000000000 +0200
--- m4/rpmatch.m4       2008-04-29 02:47:13.000000000 +0200
***************
*** 1,4 ****
! # rpmatch.m4 serial 6
  dnl Copyright (C) 2002-2003, 2007-2008 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # rpmatch.m4 serial 7
  dnl Copyright (C) 2002-2003, 2007-2008 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
***************
*** 6,13 ****
--- 6,18 ----
  
  AC_DEFUN([gl_FUNC_RPMATCH],
  [
+   dnl Persuade glibc <stdlib.h> to declare rpmatch().
+   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ 
+   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
    AC_REPLACE_FUNCS(rpmatch)
    if test $ac_cv_func_rpmatch = no; then
+     HAVE_RPMATCH=0
      gl_PREREQ_RPMATCH
    fi
  ])
*** m4/stdlib_h.m4.orig 2008-04-29 02:53:08.000000000 +0200
--- m4/stdlib_h.m4      2008-04-29 02:53:07.000000000 +0200
***************
*** 1,4 ****
! # stdlib_h.m4 serial 6
  dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # stdlib_h.m4 serial 7
  dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
***************
*** 26,31 ****
--- 26,32 ----
    GNULIB_MKDTEMP=0;       AC_SUBST([GNULIB_MKDTEMP])
    GNULIB_MKSTEMP=0;       AC_SUBST([GNULIB_MKSTEMP])
    GNULIB_PUTENV=0;        AC_SUBST([GNULIB_PUTENV])
+   GNULIB_RPMATCH=0;       AC_SUBST([GNULIB_RPMATCH])
    GNULIB_SETENV=0;        AC_SUBST([GNULIB_SETENV])
    GNULIB_STRTOD=0;        AC_SUBST([GNULIB_STRTOD])
    GNULIB_UNSETENV=0;      AC_SUBST([GNULIB_UNSETENV])
***************
*** 35,40 ****
--- 36,42 ----
    HAVE_MALLOC_POSIX=1;    AC_SUBST([HAVE_MALLOC_POSIX])
    HAVE_MKDTEMP=1;         AC_SUBST([HAVE_MKDTEMP])
    HAVE_REALLOC_POSIX=1;   AC_SUBST([HAVE_REALLOC_POSIX])
+   HAVE_RPMATCH=1;         AC_SUBST([HAVE_RPMATCH])
    HAVE_SETENV=1;          AC_SUBST([HAVE_SETENV])
    HAVE_STRTOD=1;          AC_SUBST([HAVE_STRTOD])
    HAVE_UNSETENV=1;        AC_SUBST([HAVE_UNSETENV])
*** modules/rpmatch.orig        2008-04-29 02:53:08.000000000 +0200
--- modules/rpmatch     2008-04-29 02:51:19.000000000 +0200
***************
*** 6,21 ****
--- 6,25 ----
  m4/rpmatch.m4
  
  Depends-on:
+ stdlib
+ extensions
  stdbool
  gettext-h
  regex
  
  configure.ac:
  gl_FUNC_RPMATCH
+ gl_STDLIB_MODULE_INDICATOR([rpmatch])
  
  Makefile.am:
  
  Include:
+ <stdlib.h>
  
  License:
  GPL
*** modules/stdlib.orig 2008-04-29 02:53:08.000000000 +0200
--- modules/stdlib      2008-04-29 02:45:17.000000000 +0200
***************
*** 30,35 ****
--- 30,36 ----
              -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
              -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
              -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
+             -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \
              -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
              -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \
              -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
***************
*** 38,43 ****
--- 39,45 ----
              -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
              -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
              -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
+             -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
              -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
              -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
              -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \





reply via email to

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