Commit Graph

173 Commits

Author SHA1 Message Date
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
Yann E. MORIN"
2ad6d48f78 scripts/functions: recognise Cygwin build hosts 2010-07-18 00:34:38 +02:00
Titus von Boxberg
47af4ebf45 scripts/functions: Use stat correctly on non-GNU (BSD/Darwin) systems.
Call to get the directory mode depending on $CT_SYS_OS

yann.morin.1998@anciens.enib.fr:
CT_SYS_OS has changed on Linuxsystem, it only gets the kernel name "Linux",
and not the system name, 'GNU/'.
2010-05-19 18:22:32 +02:00
Yann E. MORIN"
55ba3f6378 scripts/functions: log the test strings 2010-04-13 22:54:57 +02:00
Yann E. MORIN"
e87fb32624 scripts/functions: compress with gzip level 3, as stated in the documentation
Thanks to Bruno Tarquini <btarquini@gmail.com> for the report.
2010-04-13 21:47:34 +02:00
Yann E. MORIN"
2d54ce4a2c scripts/functions: add a save/restore handler
Saving and restoring the steps requires saving/restoring multiple
directories. Depending on the configuration, some may not exist.

Add a wrapper that checks before creating/extracting the tarballs.
2010-04-13 20:52:38 +02:00
Yann E. MORIN"
09154a7162 scripts/functions: fix CT_Patch again 2010-04-13 20:05:47 +02:00
Yann E. MORIN"
0f52a4c2de scripts/functions: fix CT_Patch 2010-04-13 00:07:00 +02:00
Yann E. MORIN"
bf86627982 scripts/functions: make CT_Patch dumber
It is the responsibility of the caller to split the package name from
its version. It already knows that.
2010-04-11 23:18:10 +02:00
Bart vdr Meulen
d068fcb19c scripts: prevent trailing - in CT_TARGET
Not all target tuples consist of an VENDOR, KERNEL and SYSTEM part, build up the
tuple in such a way to no extra or trailing dashes are added to CT_TARGET

Signed-off-by: Bart vdr Meulen <bartvdrmeulen@gmail.com>
2010-04-09 21:04:27 +02:00
Yann E. MORIN"
58de741ecf complibs: save directory with static complibs for stop/restart 2010-04-11 15:37:53 +02:00
Titus von Boxberg
f65b10457b scripts/functions: fix date munging when ns are not available
On some systems (eg. *BSD and Darwin), date does not support nanoseconds
(%N) precision. Instead of printing '%N' in this case, it just prints 'N'.
Fix the sed expression to handle this case.
2010-02-03 00:24:24 +01:00
Yann E. MORIN"
b44a9d9e34 scripts: Do not create backup files when patching
Some patches may apply with offset and/or fuzz, and would leave .orig files.
2010-01-31 12:07:44 +01:00
Yann E. MORIN"
58a53e7bf6 scripts/functions: add git wrapper
Add a git wrapper to retrieve components from their git tree.
Add a git wrapper to create a working copy (in our tarballs dir).
Recognise git trees when searching for local copies.
2010-01-14 20:54:47 +01:00
Yann E. MORIN"
e3a4063ac6 scripts/functions: change handling of nochdir
- 'nochdir' must be the first option
- have systematic pushd/popd, even if nochdir
2010-01-12 19:24:03 +01:00
Yann E. MORIN"
994427dbbe scripts/functions: do not compute CT_KERNEL_ARCH, it's obsolete
Since we merged the 32/64-bit archs, and we explicitly used
the Linux kernel arch name, we can get rid of CT_KERNEL_ARCH.
2010-01-23 19:02:46 +01:00
Yann E. MORIN"
9bfea69431 scripts/functions: inverse log level ALL and DEBUG 2010-01-16 17:52:44 +01:00
Richard Strand
185ea5a640 scrips/functions: fix downloads using curl
By default curl doesn't folow redirects. This breaks sourceforge downloads.
Add the -L option to curl to fix this.

Curl also downloads the html as a file even when it gets a 404. This breaks
http downloads when using the failback system. Add the -f option to curl to fix
this.

Signed-off-by: Richard Strand <richard.strand@icomera.com>
2010-01-10 15:19:25 +00:00
Yann E. MORIN"
28d1a52859 scripts/functions: fix extraction 2010-01-09 17:31:25 +01:00
Yann E. MORIN"
a272b32bba config: don't force the vendor part in the tuple
Note however that some configurations (eg. arm-elf) will still
have the vendor part 'unknown' forced in (by config.sub).
2010-01-07 23:05:30 +01:00
Yann E. MORIN"
009eb2a247 scripts: protect against partially extracted source
In case of failure (eg. user hitting Ctrl-C), avoid extracting over
partially extracted source. Will help once we have git available.
2009-11-30 21:34:50 +01:00
Yann E. MORIN"
01a58679df scripts: handle custom or empty extension when extracting 2009-11-30 00:05:45 +01:00
Yann E. MORIN"
135ea6486f scripts/functions: do not double check if downloads are allowed
Only call the *_get functions if downloads are allowed, so there
is no need to check it again in the retrieval wrappers.
2009-11-25 20:36:04 +01:00
Yann E. MORIN"
9b5d316acc scripts/functions: make aria2 less verbose when downloading 2010-01-03 16:30:35 +01:00
Yann E. MORIN"
c20e01d094 scripts/functions: fix downloading with aria2
In case the remote file does not exist (and probably for some
other reasons as well), aria2 nonetheless creates an empty file
(or not empty for some other reasons).

The solution is to delete the file whenever aria2 fails.
2010-01-01 17:09:52 +01:00
Yann E. MORIN"
b9eba0996a scripts/functions: fix using Aria2
Latest aria2 no longer recognise the --retry-wait option.
2010-01-01 12:27:06 +01:00
Yann E. MORIN"
04c68600ea scripts/functions: add aria2, a powerfull downloader
aria2 is a powerfull downloader that is capable of chunking and
parallel retrieval.

Due to li;itations in crosstool-NG retrieval facilities, it's not possible
to take fully advantage of aria2. It might happen that, in the future,
those limitations get lifted away, so we can take use features such as
parallel downloading from more than one server at the same time. For now,
it should still speed up downloads thanks to parallel downloading of chunks.
2009-12-30 15:36:22 +01:00
Yann E. MORIN"
2c077d6fac scripts/functions: simplify wget vs. curl check 2009-12-29 22:11:09 +01:00
Yann E. MORIN"
2b212bccad config/global: enable not using patches at all
It can be needed to build a toolchain with no patch at all.
2009-11-16 20:15:45 +01:00
Yann E. MORIN"
49e5b08739 libc/newlib: allow using CVS snapshots
The newlib "team" rolls new releases about once a year (december).
This is quite a long time between releases, in case code was fixed.
So, allow user to use a CVS snapshot to benefit early from fixes
and enhancements to newlib.
2009-10-26 22:00:30 +01:00
Yann E. MORIN"
e73418236d functions: allow using sub-dir of a module
Some projects' module (eg. newlib) are checked-out into a sudirectory
rather than into their own directory. Handle this case in the CT_GetCVS
function.
2009-10-26 19:49:50 +01:00
Yann E. MORIN"
68b9b30f6b libc/newlib: allow using newlib with archs other than avr32 2009-10-21 22:51:39 +02:00
Frederic Roussel
1215142d57 scripts/functions: Fix a variable name.
Signed-off-by: Frederic Roussel <fr.frasc@gmail.com>
2009-10-23 09:48:22 -07:00
Yann E. MORIN"
9ce2053352 log functions: fix CT_DoLog and CT_DoExecLog
$@ and $* are different when in double quotes; use $* to print the message.
2009-09-06 16:49:20 +02:00
Yann E. MORIN"
2efc2b2319 config: add fallback to patch order
Add the possibility to fallback to either bundled or local patches
if local or bundled are missing.
2009-08-31 12:47:58 +02:00
Yann E. MORIN"
b09e70bda5 config: add the local,bundled patch order
This ordering first applies the local patches, then the bundeld ones.
2009-08-31 12:51:53 +02:00