This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

crosstool cleaning up


Hello!

I have been needing to build new uClibc-based toolchains recently, but was
stuck with the /very/ old implementation I posted last year. This did not
support latest GCCs (4.0+).

So I decided I was to use the latest crosstool package, and apply my diff to
the somewhat up-to-date crosstool scripts.

Alas, I made such changes that it was not possible.

So here am I, with the suggestion to clean up crosstool:
  - apply a consistent naming scheme
     -> make it easy to understand every variable's puprpose, what/who sets
        them, their scope, etc... while still being easy to follow and not
        too cumbersome;
  - move files around
     -> have a cleaner and leaner repository;
  - reorder things
     -> have cleanly separate build steps, make it easy to change the C
        library (or other component :-] ) to use;
  - re-layout the patch directory
     -> allows to have different set of patches for the different tool combos
        used (eg.: uClibc applies different patches to gcc than glibc does).
  - add suport for uClibc-based toolchains;
  - add a nifty menuconfig-like interface! ;-)

I have written a small naming scheme that you'll find below. Note: I have not
thought of a naming scheme for the scripts yet.

I already have started shuffling the files around, and have moved all the
demo-*.sh, *.dat and *.config files to a sub-directory. Although not really
clean yet, the root of crosstool is much, much easier to look at.

Then I'll continue till I'm done.

That will take some time. On the other side, I'm not in such a hurry, my old
toolchains can still be built.

Anyway, you'll find all my work on my private repository:
  http://ymorin.is-a-geek.org/svn/crosstool/
NOTE: it is not meant as a replacement for the repository Ian has put up
earlier. Ian's repository is still the reference and official repository!
I do not have the bandwidth for that, the machine hosting the thing is
slow-as-snail, and uptime is not guaranteed.

Use 'svn log' to see what each branch is. One interesting branch now is
branches/cleanup :-] You'll be able to find old bit of my work on ct-0.38
in the attic branch.

Comments are most welcome! :-)

Thanks for your attention!

Regards,
Yann E. MORIN.

===============================================================================
Suggested naming scheme for crosstool

The naming scheme must make clear what variables are used by crosstool, the
way they are used, and what/who sets them. It must be so that it avoids name
clashing with any other user's variables (PREFIX could well be used by other
program!).

On the other hand, it must not be to hard on the crosstool developper, it must
be easy to remember and apply, and must not be cumbersome.

Here  are the six rules to apply when programming crosstool:

 1) Variables set outside of crosstool, but not specific to crosstool, are
    not concerned by this naming scheme. Eg.: LC_*.

 2) Variables specific to crosstool shall begin with CT_. Thus TARGET would
    become CT_TARGET.

 3) Variables set outside of crosstool, but specific to crosstool shall
    be all uppercase. Eg.: PREFIX would become CT_PREFIX.

 4) Variables that are set internally by crosstool and have a /strong/ [*]
    meaning shall be all uppercase, and have an underscore in-between two
    words. Eg.: TOP_DIR would become CT_TOP_DIR.

 5) Variables that are set internally by crosstool and have a /weak/ [*]
    meaning may begin with CT_, shall be all lowercase, and may not have an
    underscore nor a dash in-between two words. Eg.: ARCHIVENAME could
    become CT_archivename, while i would most probably be left as is. :-)

 6) Functions shall begin with CT_, shall have an uppercase for the first
    letter of each words, be all lowercase for the rest of the words, and may
    not have a dash in-between two words. Eg.: downloadFile would become
    CT_DownloadFile.

[*] - Variables with /strong/ meaning are variables used through-out crosstool
      with their content seldom changing.
    - Variables with /weak/ meaning are variables used locally (Eg.: the loop
      index, a temporary variable...).
    Of course, strongness and weakness of some variables may be discussed. :-)

End of suggested naming scheme for crosstool
===============================================================================

YEM.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< °_° >==-- °------------.-------:  X  AGAINST      |  /e\  There is no  |
| http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL    |  """  conspiracy.  |
°------------------------------°-------°------------------°--------------------°

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]