From MAILER-DAEMON Mon Oct 01 12:23:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TIimH-0004jF-HI
	for mharc-bug-cppi@gnu.org; Mon, 01 Oct 2012 12:23:29 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51204)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1TIim9-0004ix-8j
	for bug-cppi@gnu.org; Mon, 01 Oct 2012 12:23:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1TIim3-0006Ff-KG
	for bug-cppi@gnu.org; Mon, 01 Oct 2012 12:23:21 -0400
Received: from mail-wg0-f41.google.com ([74.125.82.41]:64125)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>)
	id 1TIim3-0006FQ-Ad; Mon, 01 Oct 2012 12:23:15 -0400
Received: by mail-wg0-f41.google.com with SMTP id ds1so1601854wgb.0
	for <multiple recipients>; Mon, 01 Oct 2012 09:23:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=subject:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	bh=1yy1PHdTHhXbNWW5dn7MJM5/pd9X7t5fX6PKy2PXPkE=;
	b=EtmIb6eM/QUc0e6jOZkEjRihi1hKOQwSAgCqzlqpLxHt1x12e1Sfex7hMj2Cl5xzg8
	s6VNDKkRXPdZCA3ZpGtTltXv8yLur4TKXOoIOqdLIYYm2sOcl093c64nfwYxoJ+XS9ob
	uHdDG/KH3+hCsIEaSFckdQPYzSVODnxIT8ILCfM/Q5khxp6ngK/k84xm7IJJwv7tC5UY
	mFaDFgXAGDwPTKST1rcVcM+pwsqUbG8tgYLgbk6UusBS+wvkTyQ5ajOWz/zA28XXp5II
	lU3qr0DVGnpRGwxUXOsyfW/gelkiKG60YFdsMrr1CGR0//DnCDZkbFhV32K2wzcztkwi
	QlUQ==
Received: by 10.180.96.164 with SMTP id dt4mr15732595wib.10.1349108594067;
	Mon, 01 Oct 2012 09:23:14 -0700 (PDT)
Received: from erebus.lrde.epita.fr (sao-paulo.lrde.epita.fr. [163.5.55.1])
	by mx.google.com with ESMTPS id v3sm19362710wiy.5.2012.10.01.09.23.12
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 01 Oct 2012 09:23:13 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1283)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim.demaille@gmail.com>
In-Reply-To: <1C15FF5B-912C-4F4C-BA11-9A8F34B8BDB7@gmail.com>
Date: Mon, 1 Oct 2012 18:23:25 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <CE3E178C-F186-47CC-B3A8-87DA0C5E95FB@gmail.com>
References: <87fw6dhprh.fsf@rho.meyering.net>
	<1C15FF5B-912C-4F4C-BA11-9A8F34B8BDB7@gmail.com>
To: Jim Meyering <jim@meyering.net>
X-Mailer: Apple Mail (2.1283)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 74.125.82.41
Cc: bug-cppi@gnu.org, Bison Patches <bison-patches@gnu.org>
Subject: Re: [bug-cppi] [PATCH 1/3] build: use new gnulib module:
	non-recursive-gnulib-prefix-hack
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <bug-cppi.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 01 Oct 2012 16:23:27 -0000

Le 20 sept. 2012 =E0 09:21, Akim Demaille a =E9crit :

> Le 19 sept. 2012 =E0 19:43, Jim Meyering a =E9crit :
>=20
>> [Cc'ing Akim, in case he wants to do this to bison.  If so,
>> with three projects using it, I'll move the module to gnulib. ]
>=20
> Yes, I do want that :)

Installed in Bison's master as follows.  Thanks!

commit 9ec79612e822b39d0ab2ef5c4b9d584884ef61cd
Author: Akim Demaille <akim@lrde.epita.fr>
Date:   Mon Oct 1 17:42:39 2012 +0200

    build: use gnulib's non-recursive-gnulib-prefix-hack
   =20
    Suggested by Jim Meyering.
   =20
    * etc/prefix-gnulib-mk: Remove, as it is now provided by...
    * bootstrap.conf (modules): the non-recursive-gnulib-prefix-hack =
module.
    * build-aux/.gitignore, configure.ac, m4/.gitignore: Adjust.

diff --git a/bootstrap.conf b/bootstrap.conf
index 190327d..3e631a2 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -25,6 +25,7 @@ gnulib_modules=3D'
   gpl-3.0 hash inttypes isnan javacomp-script
   javaexec-script ldexpl malloc-gnu
   mbswidth
+  non-recursive-gnulib-prefix-hack
   obstack
   obstack-printf
   perror progname
@@ -78,7 +79,7 @@ gnulib_tool_option_extras=3D'--symlink =
--makefile-name=3Dgnulib.mk'
 bootstrap_post_import_hook()
 {
   # Massage lib/gnulib.mk before using it later in the bootstrapping =
process.
-  etc/prefix-gnulib-mk --lib-name=3D$gnulib_name lib/$gnulib_mk
+  build-aux/prefix-gnulib-mk --lib-name=3D$gnulib_name lib/$gnulib_mk
=20
   # Ensure that ChangeLog exists, for automake.
   test -f ChangeLog || touch ChangeLog
diff --git a/build-aux/.gitignore b/build-aux/.gitignore
index e2c69c3..2c8b6fe 100644
--- a/build-aux/.gitignore
+++ b/build-aux/.gitignore
@@ -26,3 +26,4 @@
 /vc-list-files
 /warn-on-use.h
 /ylwrap
+/prefix-gnulib-mk
diff --git a/configure.ac b/configure.ac
index 328d929..d6a86a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -187,19 +187,6 @@ AC_SUBST([GCC])
 gt_JAVACOMP([1.3], [1.4])
 gt_JAVAEXEC
=20
-# We use gnulib, but from lib/local.mk instead of lib/Makefile.am.
-# So prefix paths with lib/.  See also etc/prefix-gnulib-mk.
-gl_LIBOBJS=3D`echo "$gl_LIBOBJS" | sed -e 's, , lib/,g'`
-# Listing the names of the variables to prefix is error-prone.
-# Rather, adjust all the AC_SUBST variables whose name ends in '_H',
-# and whose content ends in '.h'.
-for ac_var in $ac_subst_vars
-do
-  eval "ac_val=3D\$$ac_var"
-  case $ac_var=3D$ac_val in
-    (*_H=3D*.h) eval "$ac_var=3Dlib/\$$ac_var";;
-  esac
-done
 AC_CONFIG_FILES([Makefile
                  po/Makefile.in
                  doc/yacc.1])
diff --git a/etc/prefix-gnulib-mk b/etc/prefix-gnulib-mk
deleted file mode 100755
index 81c0924..0000000
--- a/etc/prefix-gnulib-mk
+++ /dev/null
@@ -1,220 +0,0 @@
-#! /usr/bin/perl -w
-
-use strict;
-use IO::File;
-use Getopt::Long;
-use File::Basename; # for dirname
-
-my $VERSION =3D '2012-01-21 17:13'; # UTC
-(my $ME =3D $0) =3D~ s|.*/||;
-
-my $prefix;
-my $lib_name;
-
-sub usage ($)
-{
-  my ($exit_code) =3D @_;
-  my $STREAM =3D ($exit_code =3D=3D 0 ? *STDOUT : *STDERR);
-  if ($exit_code !=3D 0)
-    {
-      print $STREAM "Try '$ME --help' for more information.\n";
-    }
-  else
-    {
-      print $STREAM <<EOF;
-Usage: $ME --lib-name=3DNAME FILE
-   or: $ME [--help|--version]
-Rewrite a gnulib-tool-generated FILE like lib/gnulib.mk to work with
-automake's subdir-objects.
-
-OPTIONS:
-
-This option must be specified:
-
-   --lib-name=3DNAME    library name, often "lib\$project"
-
-The following are optional:
-
-   --help             display this help and exit
-   --version          output version information and exit
-
-EOF
-    }
-  exit $exit_code;
-}
-
-# contents ($FILE_NAME)
-# ---------------------
-sub contents ($)
-{
-  my ($file) =3D @_;
-  local $/;                     # Turn on slurp-mode.
-  my $f =3D new IO::File "< $file" or die "$file";
-  my $contents =3D $f->getline or die "$file";
-  $f->close;
-  return $contents;
-}
-
-# prefix_word ($WORD)
-# -------------------
-# Do not prefix special words such as variable dereferences.  Also,
-# "Makefile" is really "Makefile", since precisely there is no
-# lib/Makefile.
-sub prefix_word ($)
-{
-  local ($_) =3D @_;
-  $_ =3D $prefix . $_
-    unless /^-/ || m{^\$\(\w+\)} || $_ eq "Makefile" || $_ eq '\\';
-  return $_;
-}
-
-
-# prefix_words ($TEXT)
-# --------------------
-sub prefix_words ($)
-{
-  local ($_) =3D @_;
-  s{(\S+)}{prefix_word($1)}gem;
-  return $_;
-}
-
-
-# prefix_assignment ($LHS-AND-ASSIGN-OP, $RHS)
-# --------------------------------------------
-sub prefix_assignment ($$)
-{
-  my ($lhs_and_assign_op, $rhs) =3D @_;
-  my $res;
-
-  # Some variables are initialized by gnulib.mk, and we don't want
-  # that.  Change '=3D' to '+=3D'.
-  if ($lhs_and_assign_op =3D~ =
/^(SUBDIRS|EXTRA_DIST|BUILT_SOURCES|SUFFIXES|MOSTLYCLEANFILES|CLEANFILES|D=
ISTCLEANFILES|MAINTAINERCLEANFILES|AM_CFLAGS|AM_CPPFLAGS|AM_GNU_GETTEXT) =
=3D/)
-    {
-      $lhs_and_assign_op =3D~ s/=3D/+=3D/;
-    }
-  # We don't want to inherit gnulib's AUTOMAKE_OPTIONS, comment them.
-  elsif ($lhs_and_assign_op =3D~ /^AUTOMAKE_OPTIONS =3D/)
-    {
-      $lhs_and_assign_op =3D~ s/^/# /;
-    }
-  # Don't touch suffixes.
-  elsif ($lhs_and_assign_op =3D~ /^SUFFIXES /)
-    {
-    }
-  # The words are (probably) paths to files in lib/: prefix them.
-  else
-    {
-      $rhs =3D prefix_words($rhs)
-    }
-
-  # Variables which name depend on the location: libbison_a_SOURCES =3D>
-  # lib_libbison_a_SOURCES.
-  $lhs_and_assign_op =3D~ s/($lib_name)/lib_$1/g;
-
-  return $lhs_and_assign_op . $rhs;
-}
-
-# prefix $CONTENTS
-# ----------------
-# $CONTENTS is a Makefile content.  Post-process it so that each =
file-name
-# is prefixed with $prefix (e.g., "lib/").
-#
-# Relies heavily on the regularity of the file generated by =
gnulib-tool.
-sub prefix ($)
-{
-  # Work on $_.
-  local ($_) =3D @_;
-
-  # Prefix all the occurrence of files in rules.  If there is nothing
-  # after in the :, it's probably a phony target, or a suffix rule.
-  # Don't touch it.
-  s{^([-\w+/]+\.[-\w.]+ *: *\S.*)$}
-   {prefix_words($1)}gem;
-
-  # Prefix files in variables.
-  s{^([\w.]+\s*\+?=3D)(.*)$}
-   {prefix_assignment($1, $2)}gem;
-
-  # These three guys escape all the other regular rules.
-  s{(charset\.alias|ref-add\.sed|ref-del\.sed)}{$prefix$1}g;
-  # Unfortunately, as a result we sometimes have lib/lib.
-  s{($prefix){2}}{$1}g;
-
-  # $(srcdir) is actually $(top_srcdir)/lib.
-  s{\$\(srcdir\)}{\$(top_srcdir)/lib}g;
-
-  # Sometimes, t-$@ is used instead of $@-t, which, of course, does
-  # not work when we have a $@ with a directory in it.
-  s{t-\$\@}{\$\@-t}g;
-
-  # Some AC_SUBST patterns remain and would better be Make macros.
-  s{\@(MKDIR_P)\@}{\$($1)}g;
-
-  # Adjust paths in mkdir.
-  s{(\$\(MKDIR_P\))\s*(\w+)}{$1 $prefix$2}g;
-
-  return $_;
-}
-
-# process ($IN)
-# -------------
-sub process ($)
-{
-  my ($file) =3D @_;
-  my ($bak) =3D "$file.bak";
-  rename ($file, $bak) or die;
-  my $contents =3D contents ($bak);
-  $contents =3D prefix ($contents);
-  my $out =3D new IO::File(">$file") or die;
-  print $out $contents;
-}
-
-{
-  GetOptions
-    (
-     'lib-name=3Ds' =3D> \$lib_name,
-     help =3D> sub { usage 0 },
-     version =3D> sub { print "$ME version $VERSION\n"; exit },
-    ) or usage 1;
-
-  my $fail =3D 0;
-  defined $lib_name
-    or (warn "$ME: no library name; use --lib-name=3DNAME\n"), $fail =3D =
1;
-
-  # There must be exactly one argument.
-  @ARGV =3D=3D 0
-    and (warn "$ME: missing FILE argument\n"), $fail =3D 1;
-  1 < @ARGV
-    and (warn "$ME: too many arguments:\n", join ("\n", @ARGV), "\n"),
-      $fail =3D 1;
-  $fail
-    and usage 1;
-
-  my $file =3D $ARGV[0];
-  $prefix =3D (dirname $file) . '/';
-  warn "prefix=3D$prefix\n";
-
-  process $file;
-}
-
-### Setup "GNU" style for perl-mode and cperl-mode.
-## Local Variables:
-## perl-indent-level: 2
-## perl-continued-statement-offset: 2
-## perl-continued-brace-offset: 0
-## perl-brace-offset: 0
-## perl-brace-imaginary-offset: 0
-## perl-label-offset: -2
-## cperl-indent-level: 2
-## cperl-brace-offset: 0
-## cperl-continued-brace-offset: 0
-## cperl-label-offset: -2
-## cperl-extra-newline-before-brace: t
-## cperl-merge-trailing-else: nil
-## cperl-continued-statement-offset: 2
-## eval: (add-hook 'write-file-hooks 'time-stamp)
-## time-stamp-start: "my $VERSION =3D '"
-## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
-## time-stamp-time-zone: "UTC"
-## time-stamp-end: "'; # UTC"
-## End:
diff --git a/m4/.gitignore b/m4/.gitignore
index d317858..3dfdf6a 100644
--- a/m4/.gitignore
+++ b/m4/.gitignore
@@ -183,3 +183,4 @@
 /xstrndup.m4
 /obstack-printf.m4
 /extern-inline.m4
+/non-recursive-gnulib-prefix-hack.m4



From MAILER-DAEMON Mon Oct 01 15:58:14 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TIm85-0005vw-W6
	for mharc-bug-cppi@gnu.org; Mon, 01 Oct 2012 15:58:13 -0400
Received: from eggs.gnu.org ([208.118.235.92]:49076)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1TIm84-0005uO-Ix
	for bug-cppi@gnu.org; Mon, 01 Oct 2012 15:58:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1TIm83-0005kY-Ia
	for bug-cppi@gnu.org; Mon, 01 Oct 2012 15:58:12 -0400
Received: from mx.meyering.net ([88.168.87.75]:60912)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1TIm7x-0005jj-2g; Mon, 01 Oct 2012 15:58:05 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 8A888609E2;
	Mon,  1 Oct 2012 21:58:02 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Akim Demaille <akim.demaille@gmail.com>
In-Reply-To: <CE3E178C-F186-47CC-B3A8-87DA0C5E95FB@gmail.com> (Akim Demaille's
	message of "Mon, 1 Oct 2012 18:23:25 +0200")
References: <87fw6dhprh.fsf@rho.meyering.net>
	<1C15FF5B-912C-4F4C-BA11-9A8F34B8BDB7@gmail.com>
	<CE3E178C-F186-47CC-B3A8-87DA0C5E95FB@gmail.com>
Date: Mon, 01 Oct 2012 21:58:02 +0200
Message-ID: <87391ynewl.fsf@rho.meyering.net>
Lines: 18
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: bug-cppi@gnu.org, Bison Patches <bison-patches@gnu.org>
Subject: Re: [bug-cppi] [PATCH 1/3] build: use new gnulib module:
	non-recursive-gnulib-prefix-hack
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <bug-cppi.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 01 Oct 2012 19:58:13 -0000

Akim Demaille wrote:
> Le 20 sept. 2012 =E0 09:21, Akim Demaille a =E9crit :
>> Le 19 sept. 2012 =E0 19:43, Jim Meyering a =E9crit :
>>> [Cc'ing Akim, in case he wants to do this to bison.  If so,
>>> with three projects using it, I'll move the module to gnulib. ]
>>
>> Yes, I do want that :)
>
> Installed in Bison's master as follows.  Thanks!

 b/bootstrap.conf       |    3
 b/build-aux/.gitignore |    1
 b/configure.ac         |   13 --
 b/m4/.gitignore        |    1
 etc/prefix-gnulib-mk   |  220 --------------------------------------------=
-----
 5 files changed, 4 insertions(+), 234 deletions(-)

Nice!


