From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8849 invoked by alias); 8 Sep 2009 17:57:16 -0000 Received: (qmail 8814 invoked by uid 22791); 8 Sep 2009 17:57:15 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.gmx.net (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Tue, 08 Sep 2009 17:57:06 +0000 Received: (qmail invoked by alias); 08 Sep 2009 17:57:02 -0000 Received: from xdsl-87-79-132-28.netcologne.de (EHLO localhost.localdomain) [87.79.132.28] by mail.gmx.net (mp064) with SMTP; 08 Sep 2009 19:57:02 +0200 Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1Ml4w8-0003T2-Ss; Tue, 08 Sep 2009 19:57:01 +0200 Date: Tue, 08 Sep 2009 17:57:00 -0000 From: Ralf Wildenhues To: binutils@sourceware.org, gdb-patches@sourceware.org Cc: Paolo Bonzini Subject: Re: toplevel configure hits sed program length limit on HP-UX Message-ID: <20090908175659.GB24114@gmx.de> References: <20090831185418.GC31114@gmx.de> <4A9C1F2C.5080005@gnu.org> <20090831195746.GA21485@gmx.de> <4A9C2BC1.6040203@gnu.org> <20090831204138.GD21485@gmx.de> <4A9C412F.3000705@gnu.org> <20090906180059.GA14167@gmx.de> <4AA41B9B.6040304@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AA41B9B.6040304@gnu.org> User-Agent: Mutt/1.5.20 (2009-08-09) X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00235.txt.bz2 Hello binutils, gdb-patches, I've pushed this patch over to src as well, pasted below for convenience * Paolo Bonzini wrote on Sun, Sep 06, 2009 at 10:29:15PM CEST: > On 09/06/2009 08:01 PM, Ralf Wildenhues wrote: > >OK to apply? Tested by ensuring old and new toplevel Makefile are > >identical. > > Ok after the slush finishes. Thanks, done. Cheers, Ralf Fix toplevel config.status for HP-UX sed. ChangeLog: 2009-09-08 Ralf Wildenhues * configure.ac: Do not use $extrasub for replacing @if/@endif parts in Makefile; instead, use additional arguments to AC_CONFIG_COMMANDS to do the replacement manually, with several sed invocations, to avoid HP-UX sed command limits. * configure: Regenerate. diff --git a/configure.ac b/configure.ac index 592a8e3..a85c3bd 100644 --- a/configure.ac +++ b/configure.ac @@ -2410,12 +2410,13 @@ INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g` # configuration, so that the top-level Makefile reconfigures them, # like we used to do when configure itself was recursive. -# Loop over modules. $extrasub must be used with care, limiting as -# much as possible the usage of range addresses. That's because autoconf -# splits the sed script to overcome limits in the number of commands, -# and relying on carefully-timed sed passes may turn out to be very hard -# to maintain later. In this particular case, you just have to be careful -# not to nest @if/@endif pairs, because configure will not warn you at all. +# Loop over modules. We used to use the "$extrasub" feature from Autoconf +# but now we're fixing up the Makefile ourselves with the additional +# commands passed to AC_CONFIG_FILES. Use separate variables +# extrasub-{build,host,target} not because there is any reason to split +# the substitutions up that way, but only to remain below the limit of +# 99 commands in a script, for HP-UX sed. +# Do not nest @if/@endif pairs, because configure will not warn you at all. AC_ARG_ENABLE([bootstrap], [ --enable-bootstrap enable bootstrapping @<:@yes if native build@:>@],, @@ -2502,18 +2503,20 @@ fi AC_MSG_RESULT($BUILD_CONFIG) AC_SUBST(BUILD_CONFIG) +extrasub_build= for module in ${build_configdirs} ; do if test -z "${no_recursion}" \ && test -f ${build_subdir}/${module}/Makefile; then echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure" rm -f ${build_subdir}/${module}/Makefile fi - extrasub="$extrasub + extrasub_build="$extrasub_build /^@if build-$module\$/d /^@endif build-$module\$/d /^@if build-$module-$bootstrap_suffix\$/d /^@endif build-$module-$bootstrap_suffix\$/d" done +extrasub_host= for module in ${configdirs} ; do if test -z "${no_recursion}"; then for file in stage*-${module}/Makefile prev-${module}/Makefile ${module}/Makefile; do @@ -2523,12 +2526,13 @@ for module in ${configdirs} ; do fi done fi - extrasub="$extrasub + extrasub_host="$extrasub_host /^@if $module\$/d /^@endif $module\$/d /^@if $module-$bootstrap_suffix\$/d /^@endif $module-$bootstrap_suffix\$/d" done +extrasub_target= for module in ${target_configdirs} ; do if test -z "${no_recursion}" \ && test -f ${target_subdir}/${module}/Makefile; then @@ -2542,14 +2546,15 @@ for module in ${target_configdirs} ; do *) target_bootstrap_suffix=no-bootstrap ;; esac - extrasub="$extrasub + extrasub_target="$extrasub_target /^@if target-$module\$/d /^@endif target-$module\$/d /^@if target-$module-$target_bootstrap_suffix\$/d /^@endif target-$module-$target_bootstrap_suffix\$/d" done -extrasub="$extrasub +# Do the final fixup along with target modules. +extrasub_target="$extrasub_target /^@if /,/^@endif /d" # Create the serialization dependencies. This uses a temporary file. @@ -3167,4 +3172,12 @@ case "$target" in esac AC_SUBST(compare_exclusions) -AC_OUTPUT(Makefile) +AC_CONFIG_FILES([Makefile], + [sed "$extrasub_build" Makefile | + sed "$extrasub_host" | + sed "$extrasub_target" > mf$$ + mv -f mf$$ Makefile], + [extrasub_build="$extrasub_build" + extrasub_host="$extrasub_host" + extrasub_target="$extrasub_target"]) +AC_OUTPUT