Commit Graph

208 Commits

Author SHA1 Message Date
Yann E. MORIN"
301cadf45d configure: fix kconfig option names
In the process of converting to autoconf, the kconfig option
were not properly translated.

Fix that.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2012-01-16 23:45:16 +01:00
Yann E. MORIN"
964f379a42 scripts: fix dumping execution backtrace
Dumping the backtrace has been broken since changeset #652e56d6d35a:
    scripts: execute each steps in a subshell

We can spawn sub-sub-shells in some cases.

The way the fault handler works is to dump the backtrace, but to avoid
printing it once for every sub-shell (which could get quite confusing),
it simply exits when it detects that it is being run in a sub-shell,
leaving to the top-level shell the work to dump the backtrace.

Because each step is executed in its own sub-shell, the variable arrays
that contain the step name, the source file and line number, are lost
when exiting the per-step sub-shell.

Hence, the backtrace is currently limited to printing only the top-level
main procedure of the shell.

Fix this thus:
- when dumping the bckatraces for the steps & the functions, remember
  it was dumped, and only dump it if it was not already dumped
- at the top-level shell, print the hints

Also, rename the top-level step label.

Reported-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-12-13 23:32:39 +01:00
Titus von Boxberg
f084787743 scripts/functions: extract: portable call for old and defective tars
Instead of using -J, --lzma, --use-compress-program or the like
use <compressor> -dc <file> | tar -f -

Signed-off-by: Titus von Boxberg <titus@v9g.de>
2011-11-22 10:08:10 +01:00
Yann E. MORIN"
72f1c0b405 scripts/functions: use endian string in tests
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-11-20 21:01:34 +01:00
Yann E. MORIN"
7e07a5043b scripts: use wget, not curl
It seems wget is more popular than curl.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-11-07 21:40:28 +01:00
Yann E. MORIN"
4fc56b1d14 arch: add softfp support
Some architectures support a mixed hard/soft floating point, where
the compiler emits hardware floating point instructions, but passes
the operands in core (aka integer) registers.

For example, ARM supports this mode (to come in the next changeset).

Add support for softfp cross compilers to the GCC and GLIBC
configuration. Needed for Ubuntu and other distros that are softfp.

Signed-off-by: Michael Hope <michael.hope@linaro.org>
[yann.morin.1998@anciens.enib.fr: split the original patch]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-10-19 15:27:32 +13:00
Yann E. MORIN"
67ede2f5d4 scripts: use the hardfloat option to set configure and CFLAGS
When hardfloat is selected, we need to pass that selection down to
./configure and in the CFLAGS.

Signed-off-by: Michael Hope <michael.hope@linaro.org>
[yann.morin.1998@anciens.enib.fr: split the original patch]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-10-19 15:27:32 +13:00
Yann E. MORIN"
28e54116c3 scripts: introduce float type as a string
With the upcoming softfp support, the case..esac test would become
a bit convoluted if it were to test three different booleans.

Introduce a new blind string config option that defaults to the
selected floating point type used.

Signed-off-by: Michael Hope <michael.hope@linaro.org>
[yann.morin.1998@anciens.enib.fr: split the original patch]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-10-19 15:27:32 +13:00
Yann E. MORIN"
0c06bd8cae scripts/functions: Fix CT_ExtractGit function.
Change CT_ExtractGit so that it clones the repository, instead of just
symlinking it.  After cloning, any given ref is checked out, or if no
ref is given, the HEAD of the repository is checked out.

This makes CT_Extract behave similar for git repositories as it does
for tarballs, so that it for example can be used for passing glibc-ports
as a git repository.

Signed-off-by: "Esben Haabendal" <esben.haabendal@prevas.dk>
[yann.morin.1998@anciens.enib.fr: fix incomplete var rename]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-10-07 15:06:44 +02:00
Yann E. MORIN"
77436f025f scripts/functions: only use passive FTP
Virtually all FTP server available on-line support passive FTP.
At least, this is the case for the servers crosstool-NG needs to
connect to.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-09-09 15:48:59 +02:00
Yann E. MORIN"
4b0155c24f scripts/functions: only use one download program
Currently, we use either wget or curl, whichever is installed.
In case both are installed, both are used. This means that it
takes a while trying all extensions.

Remove use of wget, and use only curl.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-09-09 15:34:04 +02:00
Yann E. MORIN"
4c1666134b configure: xz-utils alone can also handle LZMA-compressed tarballs
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-08-26 00:07:51 +02:00
Yann E. MORIN"
04250cc896 configure: check for lzma
Some packages are available as LZMA tarballs. LZMA is a relatively recent
compression algorithm; it's slightly better than bzip2, but offers much
faster decompression. LZMA is now deprecated in favor of XZ, but some
packages switched to LZMA when XZ was not yet available, or still in its
infancy. Latest XZ (which totaly obsoletes LZMA) offers a backward LZMA-
compatible utility, so we can check for 'lzma' nonetheless.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-08-25 18:30:18 +02:00
Yann E. MORIN"
09e5711dcb scripts/functions: add xz support
Add support for the new XZ-compressed tarballs. At least glibc
uses that new format.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-08-14 17:51:38 +02:00
Yann E. MORIN"
3910899c77 scripts/functions: test for decompressors before use
./configure does check for the presence of gz and bzip2, so we can
safely use them in the build scripts.

On the other hand, more recent formats (eg. XZ) are not yet widely
available, and we do not want, and can't, force the user to install
them as a pre-requisite.

So, build up a list of allowed tarball formats based on the available
decompressors. For no, this is a static list, but the upcoming XZ
support will conditionnaly add to this list.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-05-04 00:04:23 +02:00
Yann E. MORIN"
ac058b1042 scripts/functions: commonalise tar options in CT_EXtract
This shortens command lines, so it's good! :-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-08-14 17:28:35 +02:00
Yann E. MORIN"
37db634a00 scripts/functions: remove messages about failed downloads
When downloading via svn/cvs/... an attempt to retrieve from the
mirror is made. If the mirror does not have the required tarball,
an error message is printed. This is misleading, as the download
may later succeed via svn/cvs/...

Remove the messages about failed downloads altogether.

At the same time, use "if ... then ... fi" instead of "... && ..."

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-08-10 23:09:06 +02:00
Yann E. MORIN"
03c3e02fb7 scripts: try the mirror even if downloads are forbidden
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-08-02 23:10:37 +02:00
Yann E. MORIN"
263c92b3eb scripts/functions: use array variables for URLs list
This is needed later, when we'll conditionnally use both the
upstream and the mirror URLs.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-08-03 00:00:44 +02:00
Yann E. MORIN"
bb3519ad37 scripts/functions: always prefer the mirror
Currently, the mirror can be used either:
 - as a fallback in case upstream is unavailable (default behavior)
 - as the preferred source for downloads

But the most common use-case seems to provide a truely-LAN mirror
to speed up downloads in big corpos', and/or provide a 'trusted'
source for the tarballs.

So, make the following changes;
 - if a mirror is specified, always try that before trying upstream

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-08-02 23:11:25 +02:00
Yann E. MORIN"
cba6269810 scripts/functions: cvs retrieval first tries the mirror for tarballs
The cvs download helper looks for the local tarballs dir to see if it
can find a pre-downloaded tarball, and if it does not find it, does
the actual fetch to upstream via cvs.

In the process, it does not even try to get a tarball from the local
mirror, which can be useful if the mirror has been pre-populated
manually (or with a previously downloaded tree).

Fake a tarball get with the standard tarball-download helper, but
without specifying any upstream URL, which makes the helper directly
try the LAN mirror.

Of course, if no mirror is specified, no URL wil be available, and
the standard cvs retrieval will kick in.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-08-02 18:26:53 +02:00
Yann E. MORIN"
5f79506725 scripts/functions: svn retrieval first tries the mirror for tarballs
The svn download helper looks for the local tarballs dir to see if it
can find a pre-downloaded tarball, and if it does not find it, does
the actual fetch to upstream via svn.

In the process, it does not even try to get a tarball from the local
mirror, which can be useful if the mirror has been pre-populated
manually (or with a previously downloaded tree).

Fake a tarball get with the standard tarball-download helper, but
without specifying any upstream URL, which makes the helper directly
try the LAN mirror.

Of course, if no mirror is specified, no URL wil be available, and
the standard svn retrieval will kick in.

Reported-by: ANDY KENNEDY <ANDY.KENNEDY@adtran.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-08-02 18:28:10 +02:00
Yann E. MORIN"
20b5380556 scripts/functions: if no upstream URL is given, silently ignore that
When retrieving tarballs from upstream, if no URL was given, do not
fail; simmply ignore that fact.

This will be used later when the SVN helper will call the standard
helper to try the LAN mirror before trying svn.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-08-01 18:56:15 +02:00
Benoît THÉBAUDEAU"
6c7f5488ee scripts/functions: force extract folder to archive basename
Some archives like those of the 2011.07 revisions of Linaro GCC contain a folder
name different from the archive basename, which leads to errors afterwards, e.g.
when patching. E.g.:
gcc-linaro-4.5-2011.07.tar.bz2 extracts to gcc-linaro-4.5-2011.07-0/

This patch changes CT_Extract() to force the extraction of all archives to a
folder named like the archive basename. E.g.:
gcc-linaro-4.5-2011.07.tar.bz2 now extracts to gcc-linaro-4.5-2011.07/

Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
2011-07-29 13:04:49 +02:00
Yann E. MORIN"
7f504c6c27 functions: save & restore the static companion libraries install dir
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-02 22:30:55 +02:00
Yann E. MORIN"
3299aa7685 functions: fix downloading files
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-06-02 23:56:13 +02:00
Yann E. MORIN"
3304d5c077 scripts/functions: do not abort on failed svn
In case of eglibc, some add-ons that were previously external are
now internal (bundled with the main sources).

So we do not want to fail if an add-on can't be downloaded; we
want to post-pone the check until we can extract the main archive.

So:
 - try to retrieve the add-on
 - if it fails, print a warning instead of calling CT_Abort
 - return 1

So, components that want to catch the error and want to handle it can,
while components that do not will gracefuly fail thanks to our catching
every errors.

Bonus: it works without changing any existing retrieval procedure! :-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-05-31 00:57:36 +02:00
Yann E. MORIN"
1c3c90d0d4 scripts/functions: do not abort on failed extract
For glibc/eglibc, if the add-on can not be extracted, we want to catch
the error to print a meaningful error message.

So:
 - try to extract the tarball
 - if it fails, print a waring instead of calling CT_Abort
 - return 1

So, components that want to catch the error and want to handle it can,
while components that do not will gracefuly fail thanks to our catching
every errors.

Bonus: it works without changing any existing extract procedure! :-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-05-30 23:24:45 +02:00
Yann E. MORIN"
0c73370023 scripts/functions: do not abort on failed download
In case of glibc/eglibc, some add-ons that were previously external are
now internal (bundled with the main sources).

So we do not want to fail if an add-on tarball can't be downloaded; we
want to post-pone the check until we can extract the main archive.

So:
 - try to download the tarball
 - if it fails, print a warning instead of calling CT_Abort
 - return 1

So, components that want to catch the error and want to handle it can,
while components that do not will gracefuly fail thanks to our catching
every errors.

Bonus: it works without changing any existing retrieval procedure! :-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-05-30 23:24:11 +02:00
Yann E. MORIN"
81862cd306 functions: pretty print error messages
Reformat the error messages:
 - strip ${CT_LIB_DIR} from scripts path names
 - strip ${CT_TOP_DIR} from build.log path and docs path
 - overall shorter lines
 - point to the known-issues file

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-04-08 00:08:57 +02:00
Yann E. MORIN"
bdf0b26e19 functions: fix date calculations
In case date(1) does not support nanosecond resolution, it does
not interpret '%N', and leave it as-is. So we have to remove it.

Note that some versions replaces '%N' with 'N', so we have to
take this into account as well.

Reported-by: Kyle Grieb <grieb.kyle@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-04-08 00:02:44 +02:00
Javier Viguera
98ceb8faf3 functions: avoid CR when progress bar is not enabled
Using CT-NG with progress bar disabled, still prints CR ('\r') characters
on the output. When you capture the output to a file as part of an
automated build, it shows extra empty lines.

For example:

------------------------------------------------------------
[INFO ]  Performing some trivial sanity checks

[INFO ]  Build started 20110404.113619

[INFO ]  Building environment variables

[EXTRA]  Preparing working directories

[EXTRA]  Installing user-supplied crosstool-NG configuration
------------------------------------------------------------

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2011-04-07 11:52:23 +02:00
Yann E. MORIN"
5e27ad1e5a complibs: disable building shared libs
Managing the shared version of the companion libraries
has become cumbersome.

Also, it will one day be possible to use the companion
libraries from the host distribution, and then we will
be able to easily use either shared or static libs.

As a side note, while working on the canadian-rework
series, it has become quite more complex to properly
handle shared companion libraries, as they need to be
built both for the build and gost systems. That's not
easy to handle. At all.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-04-06 22:30:57 +02:00
Yann E. MORIN"
807daf12d0 scripts: allow logging of commands with variables
In a lot of places, we need to call some commands with specific
variable settings, a-la:
  var1=val1 var2=val2 /foo/bar/buz opt1 opt2

Unfortunately, we currently can not log the variable settings.

Enhance CT_DoExecLog with a crude heuristic that works pretty well
and that can also log setting variables.

Reported-by: ANDY KENNEDY <ANDY.KENNEDY@adtran.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-03-15 23:18:37 +01:00
Yann E. MORIN"
7bfa4139ad scripts: leave changelog in build dir, copy to install dir
Users tend to look for the build log in the current working directory,
rather than in the toolchain's installation dir. While bundling the build
log in the toolchain installation dir is nice for distribution and review,
it can be easier to have the build log readily available in the working
directory, as it is quicker to get to it.

So, the build log stays in the working directory until the toolchain is
completely and successfully built, and then a (compressed) copy is made.

Reported-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-03-20 00:02:21 +01:00
Yann E. MORIN"
32fd4c0963 scripts: do not chmod u+w the whole source directory
Doing a chmod on the whole source dir after every packages
are extracted can take a hell of a lot of time.

The offending packages are far from legion, and they now
have their own chmod u+w to cleanup their own mess...

Reported-by: ANDY KENNEDY <ANDY.KENNEDY@adtran.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-03-03 23:46:03 +01:00
Yann E. MORIN"
742a6f6508 buildtools: the buildtools dir is in fact a prefix
Consider the buildtools install directory as a prefix directory,
that is, install buildtools in prefix/bin/, not in prefix/.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2010-12-20 00:07:29 +01:00
Yann E. MORIN"
5d175195f6 buildtools: move to working directory
There is absolutely *no* reason for the buildtools (wrappers to gcc, g++,
as, ld... for the local machine) to be in the toolchain directory. Moreover,
they are removed after the build completes.

Move them out of the toolchain directory, and into the build directory (but
yet the part specific to the current toolchain). This means we no longer
need to explicitly remove them either, BTW, but we need to save/restore them
for the restart feature.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2010-12-23 20:43:32 +01:00
Yann E. MORIN"
8efc6dae8a scripts: fix double slash in paths
Computed paths may contain double slashes.
This is not an issue but it is just ugly to look at.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-01-25 21:59:03 +01:00
Yann E. MORIN"
28c5ee8baf scripts: recover on partially downloaded files
Download to an intermediate temp file, and rename it to its final
name only of download succeeds.

This catches both a failed download, and also the case where the user
interrupts the download. Thus, the a partial download gets discarded,
and we no longer try to extract a partial tarball, which we would
previously have done.

Suggested by Thomas PETAZZONI.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2010-11-29 00:26:39 +01:00
Yann E. MORIN"
af6dd3f3f0 scripts: call curl and wget in sequence
It can happen, in some circumpstances, than one can succeed where
the other would fail. Those cases involves convoluted enterprise
networks with proxies playing tricks.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2010-11-16 17:49:15 +01:00
Yann E. MORIN"
9dbbc8e5f6 scripts: remove aria2c as downloader, retain only curl and wget
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2010-11-16 10:00:27 +01:00
Anthony Foiani
90918d1095 scripts: add STATE logging level for state save/restore output.
The save/restore state output is voluminous; using this flag allows us
to quickly see or ignore when something is just being saved.

[Yann E. MORIN: this is a blind log level, and is used only to search
 in the build-log afterward.]

Signed-off-by: Anthony Foiani <anthony.foiani@gmail.com>
2010-10-22 22:02:49 +02:00
Anthony Foiani
92898249bd scripts: add "FILE" and "CFG" debug levels.
I ran into some minor difficulties looking through the build log for a
particular file: I wasn't interested in seeing it unpacked, but only
when it is built or installed.  Adding these two levels allows me to
differentiate between those cases.

[Yann E. MORIN: Those are blind log levels, and are used only to search
 in the build-log afterward.]

Signed-off-by: Anthony Foiani <anthony.foiani@gmail.com>
2010-10-22 22:02:57 +02:00
Yann E. MORIN"
cb1a6420e9 complibs: better deduce whether to backup complibs or not
To decide whether we need to backup the companion libraries,
do not rely on the !shared case. In the future other cases
may require not to save the companion libraries (eg. if using
the ones provided by the host distro).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2010-10-03 23:10:46 +02:00
Yann E. MORIN"
ae715a0a3c scripts/log: do not interpret log string as printf format
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2010-08-26 23:36:54 +02:00
Yann E. MORIN"
e8f9aeade3 scripts: in case of failed download, remove partial files
It happens from time to time that the server mis-behaves, and breaks the
connection right in the middle of nowhere, for no good reason, leaving us
with a partial file, on which the extract pass would choke.

Remove partial downloads, to fail early.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2010-08-11 20:07:18 +02:00
Yann E. MORIN"
63235bd89c scripts: when downloading, use aria2 only when //
Even when // downloads are not enabled, aria2 can
fail on some servers (eg. uclibc.org).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2010-08-11 19:13:10 +02:00
Johannes Stezenbach
6d084fb565 Fix CT_SanitizePath
Replace the over-engineered and buggy test in CT_SanitizePath
with a straight forward string pattern match, and also
handle empty PATH elements which are qeuivalent to ".".

Thanks-To: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Johannes Stezenbach <js@sig21.net>
2010-07-30 17:50:34 +02:00
Yann E. MORIN"
8bd0034057 scripts: remove . from $PATH
Add CT_SanitizePath function which removes entries referring to ., /tmp
and non-existing directories from $PATH, and call it early in the
build script.

If . is in PATH, gcc-4.4.4 build breaks:

[ALL  ]    checking what assembler to use...
/tmp/build/targets/arm-unknown-linux-uclibcgnueabi/build/gcc-core-static/arm-unknown-linux-uclibcgnueabi/bin/as
...
[ALL  ]    config.status: creating as

i.e. "as" is supposed to be the arm-unknown-linux-uclibcgnueabi cross assembler,
but config.status creates a local "as" script which is calling the
host assembler.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
[Yann E. MORIN: style fixes + explanations]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2010-07-29 19:30:37 +02:00