From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 025BB1F8C6 for ; Tue, 22 Jun 2021 16:33:42 +0000 (UTC) Received: from localhost ([::1]:49700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvjLI-0001uU-Pg for normalperson@yhbt.net; Tue, 22 Jun 2021 12:33:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvjLG-0001td-02 for bug-gnulib@gnu.org; Tue, 22 Jun 2021 12:33:38 -0400 Received: from mout01.posteo.de ([185.67.36.65]:56599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvjLE-0000jU-0f for bug-gnulib@gnu.org; Tue, 22 Jun 2021 12:33:37 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id A99EC240027 for ; Tue, 22 Jun 2021 18:33:33 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4G8X5S3sr0z6tmB for ; Tue, 22 Jun 2021 18:33:32 +0200 (CEST) Date: Tue, 22 Jun 2021 16:33:26 +0000 (UTC) Message-Id: <20210622.183326.255236285487180571.wl@gnu.org> To: bug-gnulib@gnu.org Subject: inflexible non-recursive support From: Werner LEMBERG Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=185.67.36.65; envelope-from=werner.lemberg@posteo.de; helo=mout01.posteo.de X-Spam_score_int: -38 X-Spam_score: -3.9 X-Spam_bar: --- X-Spam_report: (-3.9 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" [c7b1e060d17023065c776757da406d728310cc38] Dear gnulib maintainers, Currently, the script `prefix-gnulib-mk` replaces variables like `libbison_a_SOURCES` with `lib_libbison_a_SOURCES`. However, this works only if the directory is indeed `lib/', which is not the general case. For example, in my project I would like to call the script as prefix-gnulib-mk --lib-name=libgnu gnulib/src/$gnulib_mk I suggest a patch as below (which needs further polishing to properly canonicalize the directory path, I guess). A similar problem exists with `modules/non-recursive-gnulib-prefix-hack`, which has the directory name `lib` hard-coded. Isn't it possible to modify `gnulib-tool` so that it patches `non-resursive-gnulib-prefix-hack.m4` based on the value of option `--source-base`? Right now I have to manually patch `gnulib-comp.m4` (using function `bootstrap_post_import_hook`) for changing `lib` to `gnulib/src`... Werner ====================================================================== diff --git a/build-aux/prefix-gnulib-mk b/build-aux/prefix-gnulib-mk index 347ddcd64..4eea8b738 100755 --- a/build-aux/prefix-gnulib-mk +++ b/build-aux/prefix-gnulib-mk @@ -40,6 +40,7 @@ use File::Basename; # for dirname (my $ME = $0) =~ s|.*/||; my $prefix; +my $varprefix; my $lib_name; sub usage ($) @@ -162,7 +163,7 @@ sub prefix_assignment ($$) # Variables whose name depend on the location: libbison_a_SOURCES => # lib_libbison_a_SOURCES. - $lhs_and_assign_op =~ s/($lib_name)/lib_$1/g; + $lhs_and_assign_op =~ s/($lib_name)/${varprefix}$1/g; $lhs_and_assign_op . $rhs; } @@ -243,6 +244,8 @@ sub process ($) my $file = $ARGV[0]; $prefix = (dirname $file) . '/'; + $varprefix = $prefix; + $varprefix =~ s{/}{_}g; warn "prefix=$prefix\n"; process $file;