public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* [RFC] Refactor autoconf options and build scripts
@ 2015-09-08 17:32 Bryan Hundven
  2015-09-08 23:42 ` Jasmin J.
  2015-09-12 18:03 ` Thomas Petazzoni
  0 siblings, 2 replies; 26+ messages in thread
From: Bryan Hundven @ 2015-09-08 17:32 UTC (permalink / raw)
  To: crossgcc maillist; +Cc: Yann E. MORIN, Ray Donnelly, Yann Diorcet

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

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2015-09-22 21:18 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-08 17:32 [RFC] Refactor autoconf options and build scripts Bryan Hundven
2015-09-08 23:42 ` Jasmin J.
2015-09-12 18:03 ` Thomas Petazzoni
2015-09-12 21:23   ` Bryan Hundven
2015-09-13 14:13     ` Trevor Woerner
2015-09-13 23:19     ` Jasmin J.
2015-09-13 23:35       ` Jasmin J.
2015-09-14  0:31         ` Jasmin J.
2015-09-15 14:21           ` Jean-Marie Lemetayer
2015-09-15 14:39             ` Trevor Woerner
2015-09-15 15:22               ` Jean-Marie Lemetayer
2015-09-15 18:30                 ` Jasmin J.
2015-09-15 20:38                   ` Jasmin J.
2015-09-15 20:49                   ` Bryan Hundven
2015-09-15 22:46                     ` Jasmin J.
2015-09-15 23:21                       ` Bryan Hundven
2015-09-16 11:17                         ` Jasmin J.
2015-09-16 11:45                         ` Jean-Marie Lemetayer
2015-09-16 11:47                           ` Jean-Marie Lemetayer
2015-09-16 13:20                             ` Jasmin J.
2015-09-16 13:47                               ` Jean-Marie Lemetayer
2015-09-16 14:50                                 ` Jasmin J.
2015-09-21 22:55                                   ` Jasmin J.
2015-09-22  8:17                                     ` Jean-Marie Lemetayer
2015-09-22 21:18                                       ` Bryan Hundven
2015-09-13 22:59   ` Jasmin J.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).