From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19538 invoked by alias); 12 Dec 2011 00:14:48 -0000 Received: (qmail 19520 invoked by uid 22791); 12 Dec 2011 00:14:44 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Dec 2011 00:14:27 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B29ED2BB211 for ; Sun, 11 Dec 2011 19:14:26 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GLYEYJfrV+Cj for ; Sun, 11 Dec 2011 19:14:26 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 9F40C2BB20D for ; Sun, 11 Dec 2011 19:14:26 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 08862145615; Sun, 11 Dec 2011 16:14:26 -0800 (PST) Date: Mon, 12 Dec 2011 00:25:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFC] a script to update our gnulib import... Message-ID: <20111212001426.GG2748@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="98e8jtXdkpgskNou" Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00338.txt.bz2 --98e8jtXdkpgskNou Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1868 Hello, My ultimate goal is to import gnulib's update-copyright to the list of gnulib modules we import in the GDB sources. This is in preparation for the 2012 Start of Year procedure which is going to come soon... I thought I'd do it in two steps: 1. Refresh our gnulib import to the latest sources; 2. Add/import update-copyright. This way, I know that the patch for the step 1 is a pure refresh. And that the patch for step 2 is a pure import of a new module. But the thing is, the import procedure is not completely obvious to me. I eventually managed to make it work (meaning it built on x86_64-linux) but I'm not sure I didn't break something on another more exotic platform. Also, it's not clear to me which modules we have imported so far. This is why I thought the whole process should be somewhat done by a script which anyone can run to do an update, or to add a new module. Attached is a first attempt at the script. gdb/ChangeLog: * update-gnulib.sh: New script. Still to be done/discussed: (a) Is the list of modules complete? I listed the three that I could figure out. I deleted the whole gnulib/ subdirectory and recreated it using the script and GDB seems to build. Nothing seems to be deleted except some files in gnulib/extra (arg-nonnull.h, c++defs.h, warn-on-use.h). Are we using those? (b) Is the update procedure to regenerate configure, Makefiles et al complete? Right now, after the gnulib-tool is called, we do the following: aclocal -Ignulib/m4 && autoconf && automake Do we need to call autoheader, aclocal without argument, etc? Thoughts? Thanks, -- Joel PS: The suggestion to use gnulib's update-copyright was made because it handles more files than our emacs-based copyright.sh script does. And it will hopefully be much faster as well. --98e8jtXdkpgskNou Content-Type: application/x-sh Content-Disposition: attachment; filename="update-gnulib.sh" Content-Transfer-Encoding: quoted-printable Content-length: 3478 #! /bin/sh=0A= =0A= # Copyright (C) 2011 Free Software Foundation, Inc.=0A= #=0A= # This file is part of GDB.=0A= #=0A= # This program is free software; you can redistribute it and/or modify=0A= # it under the terms of the GNU General Public License as published by=0A= # the Free Software Foundation; either version 3 of the License, or=0A= # (at your option) any later version.=0A= #=0A= # This program is distributed in the hope that it will be useful,=0A= # but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= # GNU General Public License for more details.=0A= #=0A= # You should have received a copy of the GNU General Public License=0A= # along with this program. If not, see .=0A= =0A= # Usage: update-gnulib.sh =0A= # Update our import of gnulib in the GDB source tree.=0A= #=0A= # This script assumes that it is being called from the gdb/ subdirectory,= =0A= # and will verify this before proceeding.=0A= #=0A= # This script will also verify that the correct version of the various=0A= # auto- tools are on the PATH, making sure that the correct versions of=0A= # these tools are being used to re-generate the various scripts and=0A= # Makefiles.=0A= =0A= # The list of gnulib modules we are importing in GDB.=0A= IMPORTED_GNULIB_MODULES=3D"memmem stdint wchar"=0A= =0A= # The expected version number for the various auto tools we will=0A= # use after the import.=0A= AUTOCONF_VERSION=3D"2.64"=0A= AUTOMAKE_VERSION=3D"1.11.1"=0A= ACLOCAL_VERSION=3D"$AUTOMAKE_VERSION"=0A= =0A= if [ $# -ne 1 ]; then=0A= echo "Error: Path to gnulib repository missing. Aborting."=0A= echo "Usage: update-gnulib.sh "=0A= exit 1=0A= fi=0A= GNULIB_PREFIX=3D$1=0A= =0A= # Verify that we are in the gdb/ subdirectory.=0A= if [ ! -f main.c ]; then=0A= echo "Error: This script should be called from the gdb/ subdirectory."= =0A= echo "Aborting."=0A= exit 1=0A= fi=0A= =0A= # Verify that we have the correct version of autoconf.=0A= ver=3D`autoconf --version 2>&1 | head -1 | sed 's/.*) //'`=0A= if [ "$ver" !=3D "$AUTOCONF_VERSION" ]; then=0A= echo "Error: Wrong autoconf version: $ver. Aborting."=0A= exit 1=0A= fi=0A= =0A= # Verify that we have the correct version of automake.=0A= ver=3D`automake --version 2>&1 | head -1 | sed 's/.*) //'`=0A= if [ "$ver" !=3D "$AUTOMAKE_VERSION" ]; then=0A= echo "Error: Wrong automake version: $ver. Aborting."=0A= exit 1=0A= fi=0A= =0A= # Verify that we have the correct version of aclocal.=0A= ver=3D`aclocal --version 2>&1 | head -1 | sed 's/.*) //'`=0A= if [ "$ver" !=3D "$ACLOCAL_VERSION" ]; then=0A= echo "Error: Wrong aclocal version: $ver. Aborting."=0A= exit 1=0A= fi=0A= =0A= # Update our gnulib import.=0A= $GNULIB_PREFIX/gnulib-tool --import --dir=3D. --lib=3Dlibgnu \=0A= --source-base=3Dgnulib --m4-base=3Dgnulib/m4 --doc-base=3Ddoc \=0A= --tests-base=3Dtests --aux-dir=3Dgnulib/extra --no-conditional-dependenci= es \=0A= --no-libtool --macro-prefix=3Dgl --no-vc-files $IMPORTED_GNULIB_MODULES= =0A= if [ $? -ne 0 ]; then=0A= echo "Error: gnulib import failed. Aborting."=0A= exit 1=0A= fi=0A= =0A= # Regenerate all necessary files...=0A= aclocal -Ignulib/m4 &&=0A= autoconf &&=0A= automake=0A= if [ $? -ne 0 ]; then=0A= echo "Error: Failed to regenerate Makefiles and configure scripts."=0A= exit 1=0A= fi=0A= =0A= --98e8jtXdkpgskNou--