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=-4.1 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,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 ADBA61F461 for ; Sun, 8 Sep 2019 21:06:43 +0000 (UTC) Received: from localhost ([::1]:50592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i74OQ-0003GG-Ry for normalperson@yhbt.net; Sun, 08 Sep 2019 17:06:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43901) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i74OO-0003G8-1v for bug-gnulib@gnu.org; Sun, 08 Sep 2019 17:06:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i74ON-00051S-Ue for bug-gnulib@gnu.org; Sun, 08 Sep 2019 17:06:39 -0400 Received: from pool-98-118-0-140.bstnma.fios.verizon.net ([98.118.0.140]:59876 helo=homebase.home) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1i74ON-00089J-Gc for bug-gnulib@gnu.org; Sun, 08 Sep 2019 17:06:39 -0400 Message-ID: Subject: Why does gnulib use makefile rules rather than configure? From: Paul Smith To: bug-gnulib@gnu.org Date: Sun, 08 Sep 2019 17:06:38 -0400 Organization: GNU's Not UNIX! Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: , Reply-To: psmith@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" I'm looking at allowing GNU make to use more gnulib facilities, but I've run into a serious problem. It seems that a lot of gnulib modules rely on makefile rules added to Makefile.in to construct files, rather than using traditional configure replacement .in file conversions. This is a real issue for me because I've always provided a shell script, build.sh, which can be used to bootstrap an instance of make if the user doesn't already have one. The build.sh script relies on the user first running configure to detect all the normal system-specific behaviors and generate the standard configure output files such as config.h etc., but then instead of running "make" (which they don't have), they run ./build.sh. However, when using gnulib this no longer works because many gnulib modules seem to delegate various configuration operations to the generated makefile, rather than using configure to do it. As a simple example, consider alloca-opt. gnulib provides alloca.in.h then adds a Makefile.am rule to convert it to alloca.h, that uses sed to replace one value: sed -e 's|@''HAVE_ALLOCA_H''@|$(HAVE_ALLOCA_H)|g' The prevalence of this type of behavior in gnulib means that I either have to give up on using gnulib with GNU make, or else give up on providing a bootstrapping script. I don't see why these replacements couldn't instead be done via configure and its built-in replacement facilities. Why can't we add these headers as AC_CONFIG_FILES() and allow them to be generated by the configure script, instead of requiring makefile rules to do it?