summaryrefslogtreecommitdiff
path: root/scripts/functions
AgeCommit message (Collapse)AuthorFilesLines
2011-04-07functions: pretty print error messagesYann E. MORIN"1-9/+43
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-07functions: fix date calculationsYann E. MORIN"1-1/+1
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-07functions: avoid CR when progress bar is not enabledJavier Viguera1-1/+1
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-06complibs: disable building shared libsYann E. MORIN"1-6/+0
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-03-15scripts: allow logging of commands with variablesYann E. MORIN"1-2/+16
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-19scripts: leave changelog in build dir, copy to install dirYann E. MORIN"1-23/+20
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-03scripts: do not chmod u+w the whole source directoryYann E. MORIN"1-5/+0
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>
2010-12-19buildtools: the buildtools dir is in fact a prefixYann E. MORIN"1-2/+2
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-23buildtools: move to working directoryYann E. MORIN"1-0/+2
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>
2011-01-25scripts: fix double slash in pathsYann E. MORIN"1-0/+18
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>
2010-11-28scripts: recover on partially downloaded filesYann E. MORIN"1-5/+16
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-16scripts: call curl and wget in sequenceYann E. MORIN"1-41/+24
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-16scripts: remove aria2c as downloader, retain only curl and wgetYann E. MORIN"1-16/+1
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2010-10-22scripts: add STATE logging level for state save/restore output.Anthony Foiani1-13/+15
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-22scripts: add "FILE" and "CFG" debug levels.Anthony Foiani1-6/+10
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-03complibs: better deduce whether to backup complibs or notYann E. MORIN"1-6/+2
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-08-26scripts/log: do not interpret log string as printf formatYann E. MORIN"1-1/+1
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2010-08-11scripts: in case of failed download, remove partial filesYann E. MORIN"1-2/+2
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-11scripts: when downloading, use aria2 only when //Yann E. MORIN"1-1/+1
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-07-30Fix CT_SanitizePathJohannes Stezenbach1-7/+5
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-29scripts: remove . from $PATHYann E. MORIN"1-0/+18
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-17scripts/functions: recognise Cygwin build hostsYann E. MORIN"1-1/+1
2010-05-19scripts/functions: Use stat correctly on non-GNU (BSD/Darwin) systems.Titus von Boxberg1-1/+11
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-04-13scripts/functions: log the test stringsYann E. MORIN"1-0/+3
2010-04-13scripts/functions: compress with gzip level 3, as stated in the documentationYann E. MORIN"1-8/+12
Thanks to Bruno Tarquini <btarquini@gmail.com> for the report.
2010-04-13scripts/functions: add a save/restore handlerYann E. MORIN"1-62/+62
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-13scripts/functions: fix CT_Patch againYann E. MORIN"1-4/+6
2010-04-12scripts/functions: fix CT_PatchYann E. MORIN"1-2/+2
2010-04-11scripts/functions: make CT_Patch dumberYann E. MORIN"1-20/+25
It is the responsibility of the caller to split the package name from its version. It already knows that.
2010-04-09scripts: prevent trailing - in CT_TARGETBart vdr Meulen1-4/+4
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-11complibs: save directory with static complibs for stop/restartYann E. MORIN"1-0/+14
2010-02-02scripts/functions: fix date munging when ns are not availableTitus von Boxberg1-1/+1
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-01-31scripts: Do not create backup files when patchingYann E. MORIN"1-1/+1
Some patches may apply with offset and/or fuzz, and would leave .orig files.
2010-01-14scripts/functions: add git wrapperYann E. MORIN"1-6/+88
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-12scripts/functions: change handling of nochdirYann E. MORIN"1-12/+34
- 'nochdir' must be the first option - have systematic pushd/popd, even if nochdir
2010-01-23scripts/functions: do not compute CT_KERNEL_ARCH, it's obsoleteYann E. MORIN"1-3/+0
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-16scripts/functions: inverse log level ALL and DEBUGYann E. MORIN"1-2/+2
2010-01-10scrips/functions: fix downloads using curlRichard Strand1-2/+2
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-09scripts/functions: fix extractionYann E. MORIN"1-7/+7
2010-01-07config: don't force the vendor part in the tupleYann E. MORIN"1-2/+4
Note however that some configurations (eg. arm-elf) will still have the vendor part 'unknown' forced in (by config.sub).
2009-11-30scripts: protect against partially extracted sourceYann E. MORIN"1-0/+11
In case of failure (eg. user hitting Ctrl-C), avoid extracting over partially extracted source. Will help once we have git available.
2009-11-29scripts: handle custom or empty extension when extractingYann E. MORIN"1-8/+10
2009-11-25scripts/functions: do not double check if downloads are allowedYann E. MORIN"1-9/+0
Only call the *_get functions if downloads are allowed, so there is no need to check it again in the retrieval wrappers.
2010-01-03scripts/functions: make aria2 less verbose when downloadingYann E. MORIN"1-2/+2
2010-01-01scripts/functions: fix downloading with aria2Yann E. MORIN"1-1/+1
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-01scripts/functions: fix using Aria2Yann E. MORIN"1-2/+2
Latest aria2 no longer recognise the --retry-wait option.
2009-12-30scripts/functions: add aria2, a powerfull downloaderYann E. MORIN"1-2/+21
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-29scripts/functions: simplify wget vs. curl checkYann E. MORIN"1-5/+7
2009-11-16config/global: enable not using patches at allYann E. MORIN"1-0/+1
It can be needed to build a toolchain with no patch at all.
2009-10-26libc/newlib: allow using CVS snapshotsYann E. MORIN"1-2/+2
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.