From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123261 invoked by alias); 8 Sep 2015 17:32:24 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Received: (qmail 123242 invoked by uid 89); 8 Sep 2015 17:32:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ig0-f169.google.com Received: from mail-ig0-f169.google.com (HELO mail-ig0-f169.google.com) (209.85.213.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 08 Sep 2015 17:32:22 +0000 Received: by igxx6 with SMTP id x6so22040693igx.1 for ; Tue, 08 Sep 2015 10:32:20 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.50.25.195 with SMTP id e3mr26899490igg.0.1441733540367; Tue, 08 Sep 2015 10:32:20 -0700 (PDT) Received: by 10.64.148.161 with HTTP; Tue, 8 Sep 2015 10:32:20 -0700 (PDT) Date: Tue, 08 Sep 2015 17:32:00 -0000 Message-ID: Subject: [RFC] Refactor autoconf options and build scripts From: Bryan Hundven To: crossgcc maillist Cc: "Yann E. MORIN" , Ray Donnelly , Yann Diorcet Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00027.txt.bz2 List, Crosstool-NG has become a very useful and valuable tool for creating custom GCC based toolchains, and over time a lot of new features have been added. The addition of features, and the complexity of options each component can support makes developing new features (multi_cc, multiple different libcs, new targets, new hosts, etc...) very difficult. A large majority of components Crosstool-NG builds utilize the autotools build approach, and have a multitude of different options that may have many external dependencies. These dependencies are difficult at best to track in one build script, let alone across many scripts. My first proposal on re-factoring Crosstool-NG is to move these autoconf arguments (--with-options) to Kconfig options/strings that can be selected or depended on by other components and move them out of the build scripts to additionally simplify the build scripts. For instance: https://github.com/crosstool-ng/crosstool-ng/blob/master/scripts/build/cc/100-gcc.sh#L242 ========================================================== if [ "${CT_CC_CXA_ATEXIT}" = "y" ]; then extra_config+=("--enable-__cxa_atexit") else extra_config+=("--disable-__cxa_atexit") fi ========================================================== Could turn into: ========================================================== if CC_CXA_ATEXIT config CC_CXA_ATEXIT_CONFIG string "--enable-__cxa_atexit" depends on CC_CXA_ATEXIT else # ! CC_CXA_ATEXIT config CC_CXA_ATEXIT_CONFIG string "--disable-__cxa_atexit" depends on !CC_CXA_ATEXIT endif # CC_CXA_ATEXIT ========================================================== Then in the scripts/build/cc/100-gcc.sh, it would only have an override like: ========================================================== CONFIGURE_OPTS += ${CT_CC_CXA_ATEXIT_CONFIG} ========================================================== My second proposal is to refactor the build scripts themselves into a generic build script. Then the current build scripts (i.e.: scripts/build/cc/100-gcc.sh) would override variables and functionality in the generic build script, as needed. The benefits of making the build scripts more generic and moving the configuration options out of the build scripts would allow for Crosstool-NG to become more flexible for future development. Cheers, -Bryan -- For unsubscribe information see http://sourceware.org/lists.html#faq