summaryrefslogtreecommitdiff
path: root/scripts/functions
AgeCommit message (Collapse)AuthorFilesLines
2015-10-30Interpret escape sequences in CT_DoLog.Alexey Neyman1-1/+1
Otherwise, CT_Abort messages with \n are not displayed properly. Signed-off-by: Alexey Neyman <stilor@att.net>
2015-10-30Only create backtrace stamp if dir exists.Alexey Neyman1-1/+1
If the build is aborted before the working directory is created, there's also an induced error message about inability to create a 'backtrace' file. But in that case, there is no subshells executing yet. Signed-off-by: Alexey Neyman <stilor@att.net>
2015-06-21functions: write permission in config.{guess,sub}Erico Nunes1-1/+3
avr-libc doesn't have write permissions in these by default in the 1.8.1 tar release, this caused an error during build with CT_OVERIDE_CONFIG_GUESS_SUB enabled. chmod u+w them before overriding to avoid an this error. Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2015-06-21functions: add support for arch-specific patchErico Nunes1-3/+4
Add support for applying arch-specific patches found in "patches/${pkgname}/${version}/${CT_ARCH}". This is needed for applying a popular binutils patch specific for the AVR architecture but which isn't isolated for AVR in binutils' code. In this case, applying it for every architecture would end up bloating binutils' "size" options with AVR specifics. This feels like a bit of a hack but it is easy enough to support with current crosstool-ng infrastructure, seems like worth it for this case. Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2015-06-21avr-libc: add support for avr-libc C libraryErico Nunes1-1/+9
This commit adds support for the avr-libc C library. According to the project page at http://www.nongnu.org/avr-libc , the avr-libc package provides a subset of the standard C library for Atmel AVR 8-bit RISC microcontrollers. In addition, the library provides the basic startup code needed by most applications. Support for this library in crosstool-ng is only enabled for the AVR 8-bit target. The avr-libc manual and most distributions build the AVR 8-bit gcc toolchain with the "avr" (non-canonical) target. Some experimentation also led to the conclusion that other (canonical) targets are not very well supported, so we force the "avr" target for crosstool-ng as well. The manual also recommends building avr-libc after the final gcc build. To accomplish this with crosstool-ng, a new do_libc_post_cc step is added, in which currently only avr-libc performs its build, and is a no-op for the other libc options. Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2015-06-02Merge pull request #107 from bhundven/remove_experimental_musl_patchesBryan Hundven1-10/+4
Remove support for experimental patches and musl patches
2015-06-02Merge pull request #58 from dirkhusemann/masterBryan Hundven1-1/+1
Update functions to grok symlinks
2015-06-02Remove support for experimental patches and musl patchesBryan Hundven1-10/+4
This functionality was provided so that crosstool-ng could have a further set of patches considered experimental and unsupported. Now that musl-libc support is making it's way upstream in gcc, I'm removing this support and the experimental musl patches. In later commits, backports from gcc upstream will be added to the supported patch sets to support musl-libc. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-06-02Update functions to grok symlinksDirk Husemann1-1/+1
when specifying a custom kernel provided as a tar ball, the tar ball gets symlinked. the -e test will fail. Signed-off-by: Dirk Husemann <dirk@d2h.net>
2015-05-12CT_GetGit: Allow cset to be a ref (branch or tag)Ray Donnelly1-4/+31
Pass cset as ref=somename to use this feature. CT_GetGit echos the cset sha1 on exit since the caller will need to know that information as it forms part of the downloaded tarball name. Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
2015-01-28eglibc: Remove eglibc supportBryan Hundven1-1/+1
As posted on http://www.eglibc.org/ ==================== EGLIBC is no longer developed and such goals are now being addressed directly in GLIBC. ==================== I'm not interested in maintaining build support for unsupported software. Older branches of crosstool-ng continue to have eglibc support. If you find issues with older branches, I'm always open to pull requests. Removing eglibc also frees up glibc cleanup and build optimization. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2014-08-28scripts/crosstool-NG: use ${grep} instead of 'grep'Fabian Freyer1-2/+2
Helps building on BSD-like systems. Reported-by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de> Signed-off-by: "Fabian Freyer" <fabian.freyer@physik.tu-berlin.de> [yann.morin.1998@free.fr: split the original patch] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
2014-08-28scripts/functions: use ${sed} instead of 'sed'Fabian Freyer1-7/+9
Helps build on BSD-like systems. Reported-by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de> Signed-off-by: "Fabian Freyer" <fabian.freyer@physik.tu-berlin.de> [yann.morin.1998@free.fr: split the original patch] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
2014-08-08libc/musl: add musl-libc supportBryan Hundven1-0/+1
This patch adds initial support for musl-libc. Musl-libc versions currently supported: * 1.0.3 (Stable) * 1.1.3 (Previous Mainline) * 1.1.4 (Mainline) Futher improvements are needed. * gcc-4.9.x has issues (Might be fixed in musl-1.1.4). * Multilib support is needed. * Checks to make sure paths are correct. * Move to 2-step gcc build. 3-step build is not necessary. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com> [yann.morin.1998@free.fr: removed the gcc musl patch, to be added later; removed dead code do_get_arch()] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2014-07-27Add main EXPERIMENTAL_PATCHES settingBryan Hundven1-4/+12
This change adds support for experimental patches to be introduced to crosstool-ng. The patches enabled by this option are to be located here: patches/experimental/<package>/<version>/XXXX-NAME.patch Where, XXXX is the patch number to be applied in order, like: 0001-some_patch_one.patch 0002-some_patch_two.patch 9999-some_patch_to_be_applied_last.patch In the first patch series, all patches in the EXPERIMENTAL_PATCHES option will be applied all at once, or none at all. In a later [RFC] patch, I plan on adding finer tuned patch enable/disable options based on the name of the patch and where it is located in the patches/experimental sub-tree. So the name of the patch should use underscores between words in the patch name. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com> [yann.morin.1998@free.fr: slightly reword prompt] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2014-05-11scripts/functions: introduce target_bits_32 and target_bits_64 variablesYann E. MORIN"1-0/+12
These variables behave the same for bitness as their counterparts do for endianness: they are defined to the appropriate bitness. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Cody P Schafer <dev@codyps.com>
2014-05-11scripts/functions: add target_endian_le and target_endian_beYann E. MORIN"1-0/+4
We currently define target_endian_el and target_endian_eb to be the tuple extension depending on endianness, defined to be respectively 'el' or 'eb' according to the endianness. Some architecture do not use 'el' or 'eb', but use 'le' or 'be'. Provide that as well, as two new variables: target_endian_le and target_endian_be. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Cody P Schafer <dev@codyps.com>
2014-05-11functions: finally fix the git helperYann E. MORIN"1-19/+41
It's gonna soon be used by elf2flt, so we better get it working. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2014-05-10scripts: remove references to curlYann E. MORIN"1-1/+0
It's been a while we're not using curl anymore. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2014-05-10scripts: add possibility to not override default connection timeoutCody Schafer1-1/+6
Allow '-1' to be specified as CONNECTION_TIMEOUT to disable the use of the connection timeout for wget. Signed-off-by: Cody P Schafer <dev@codyps.com> Message-Id: <cb33f8c2cbaf802d4f04.1399687632@localhost> Patchwork-Id: 347582
2013-11-15scripts/functions: use portable 'gzip -dc'Yann E. MORIN"1-1/+1
'zcat' on MacOS-X is broken (it is not gzip's zcat, but compres' zcat). Use 'gzip -dc' for portability, as suggested by Anthony. Reported-by: Fernando Ortiz <fortiz2k@gmail.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Anthony Foiani <anthony.foiani@gmail.com>
2013-05-05scripts: help debugging missing directoriesYann E. MORIN"1-0/+1
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-03-21scripts/functions: add xz-ed linux tarballsJerzy Grzegorek"1-0/+1
Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net> Message-Id: <d0ec17a687dc80754e0f.1363860872@NX5000> Patchwork-Id: 229619
2013-03-31arch/avr32: Fix download of header filesMartin Guy1-1/+3
This patch fixes the download of the avr32 headers in crosstool-ng by fetching them directly from Atmel's web site instead of the now-broken URL given by the original author of the avr32-header-fetching modification, who fetched them from a copy on his own, now-defunct server. It also adds the necessary logic to extract from a zip file, as that is how the headers are packaged. To configure it for avr32 after launching ct-ng menuconfig in an empty directory: Paths and misc options -> Shell to use as CONFIG_SHELL = sh Target options -> Target Architecture = avr32 Toolchain options -> Tuple's alias = avr32 Binary utilities -> binutils version = 2.18a C compiler gcc version = 4.2.2 C-library newlib version = 1.17.0 Enable IOs on long long = yes Enable IOs on floats and doubles = yes Disable the syscalls supplied with newlib = yes CONFIG_SHELL is necessary to get round the "fragment: command not found" bug when binutils-2.18 is configured using bash. Prepared against crosstool-ng mercurial trunk on 31 March 2012. Signed-off-by: Martin Guy <martinwguy@gmail.com> [yann.morin.1998@free.fr: update bundles sample accordingly] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Message-Id: <CAL4-wQrg_NQ7jm-NCADqeyQr9twyhtx42OUGNThP6gWeqZc=kw@mail.gmail.com> Patchwork-Id: 232612
2013-01-20arch: allow adding a suffix to the arch-part of a tupleYann E. MORIN"1-1/+1
For some architectures, it is legit to have an alternate value in the 'architecture' part of the tuple. For example: armv5te-* armv7a8-* Besides, some packages expect the tuple to reflect the arch variant (eg. openMPI) to detect the variant's capabilities (eg. atomic primitives). This patch adds an option for the user to specify a suffix to be added to the arch-part of the tuple. Signed-off-by: Willy Tarreau <w@1wt.eu> Message-ID: <20130120225822.GS6838@1wt.eu> Patch-Id: 213994 [yann.morin.1998@free.fr: make it a suffix, not an override] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-11-22scripts/functions: fix debug-shellYann E. MORIN"1-9/+13
Properly catch resuming the build when continuing past the failed command. The 'case ;;&' construct is a bash4ism. Get rid of it. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-10-30scripts/functions: fix endless loop in debug-shell with IO redirectionJohannes Stezenbach1-2/+3
CT_DEBUG_INTERACTIVE is disabled when stdin, stdout or stderr are redirected, but the check is only done at the start of the build and doesn't catch when individual build commands use redirection. When stdin is redirected it will cause the debug shell to exit immediately, causing and endless loop. Thus, save the stdin/our/err file handles and restore them before invoking the debug shell. Signed-off-by: Johannes Stezenbach <js@sig21.net> Message-Id: <20121030102225.GA8303@sig21.net> Patchwork-Id: 195409
2012-10-30scripts/functions: use patch -i instead of IO redirectionJohannes Stezenbach1-2/+1
This makes the patch name show up on the command line logged by CT_DoExecLog so it's easier to see what is going on. The -i for patch is specified by Posix and supported by GNU patch and busybox patch. Signed-off-by: Johannes Stezenbach <js@sig21.net> [yann.morin.1998@free.fr: remove now-useless debug message] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Message-Id: <20121030103620.GB8303@sig21.net> Patchwork-Id: 195418
2012-10-21scripts/functions: return a proper error code in CT_DoExecLogYann E. MORIN"1-0/+5
Since we added the debug-shell feature, CT_DoExecLog no longer returns the error code of the command, but always return 0. This breaks the download mechanism, which relies on CT_DoExecLog to fail _on_purpose_ to detect that the ressource was not found at the specified URL. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-10-17scripts/functions: properly catch failure in CT_Test* helpersYann E. MORIN"1-1/+1
So we get caught by the trap-handler and have a chance to run the debug-shell. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Johannes Stezenbach <js@sig21.net>
2012-10-06scripts: add option to start an interactive debug shellYann E. MORIN"1-3/+93
Add an option that, when a command fails: - starts an interactive shell with the failed command's environment - attempts re-execution of the failed command, continues, or aborts at user's whim. Before starting the debug-shell, the backtrace is printed. When exiting for an abort, the standard error message is printed. Based on an idea and a patch from: Johannes Stezenbach <js@sig21.net> http://sourceware.org/ml/crossgcc/2012-09/msg00144.html Signed-off-by: Johannes Stezenbach <js@sig21.net> [yann.morin.1998@free.fr: integrate in the fault handler] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Acked-by: Johannes Stezenbach <js@sig21.net> Patchwork-Id: 191571 Patchwork-Id: 191668
2012-10-14scripts: move backtrace marker to CT_WORK_DIRJohannes Stezenbach1-3/+3
Avoid error when commands in scripts/crosstool-NG.sh fail before CT_BUILD_DIR is set. So we need to remove the backtrace marker of a potential previous build. Previously, it was implicitly removed because we did remove the directory it was in, which is no longer the case. Signed-off-by: Johannes Stezenbach <js@sig21.net> [yann.morin.1998@free.fr: remove backtrace marker on start of build] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Message-Id: <20121015094615.GA18673@sig21.net> Patchwork-Id: 191498
2012-10-04scripts/functions: add a generic custom location infrastructureDavid Holsgrove1-0/+35
Add a generic custom location infrastructure (inspired by the one in kernel/linux) to allow the user to use custom tarballs or directories for any component. Signed-off-by: "David Holsgrove" <david.holsgrove@xilinx.com> [yann.morin.1998@free.fr: move config option, improve help text, fix API doc] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Message-Id: <131c163c69f9cc81d2be.1349931191@localhost.localdomain> PatchWork-Id: 190784 Message-Id: <0bbaba9190a76ba97f72.1349931192@localhost.localdomain> PatchWork-Id: 190785
2012-08-12scripts: add option to only use the mirrorYann E. MORIN"1-1/+7
Currently, if downloads are forbidden, the mirror is still tried for. Change this way: - if downlaods forbidden, do not try neither upstream locations nor mirror - add option to only use the mirror, and avoid upstream locations Signed-off-by: Austin Morton <austinpmorton@gmail.com> [yann.morin.1998@free.fr: broaden the if USE_MIRRORto enclode mirror location] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-08-22scripts/functions: remove rude wordingsYann E. MORIN"1-3/+2
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-05-06scripts/functions: tweak the endianness LDFLAGSYann E. MORIN"1-2/+2
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2011-07-25complibs: fixup the host complibs install dirYann E. MORIN"1-2/+0
It's easier to have as much as possible stuff in the same place to ease backup/restore, and make things easier to follow. Move the host companion libraries install dir as a sub-dir of the build-tools install dir (but not directly in it, it would break for canadian or cross-native). Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2012-01-01cc/gcc: install the core compilers in the build-tools dirYann E. MORIN"1-4/+0
There really is no good reason to install the core compilers in their own places, one for each pass. We can install them with the other build tools. Also, this implies that: - there are fewer directories to save/restore - there are fewer symlinks to create for binutils - the PATH is shorter Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-07-24functions: add new helpers that create a dir and cd/pushd into itYann E. MORIN"1-0/+16
A lot of places are currently doing: mkdir -p foo/bar cd foo/bar Or even: mkdir -p foo/bar pushd foo/bar [...] popd Provide both wrapper to ease doing this. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2012-01-16configure: fix kconfig option namesYann E. MORIN"1-2/+2
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>
2011-12-13scripts: fix dumping execution backtraceYann E. MORIN"1-43/+43
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-11-22scripts/functions: extract: portable call for old and defective tarsTitus von Boxberg1-6/+6
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-20scripts/functions: use endian string in testsYann E. MORIN"1-3/+5
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-11-07scripts: use wget, not curlYann E. MORIN"1-5/+4
It seems wget is more popular than curl. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-10-19arch: add softfp supportYann E. MORIN"1-0/+4
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-19scripts: use the hardfloat option to set configure and CFLAGSYann E. MORIN"1-0/+4
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-19scripts: introduce float type as a stringYann E. MORIN"1-1/+7
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-07scripts/functions: Fix CT_ExtractGit function.Yann E. MORIN"1-12/+15
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-09-09scripts/functions: only use passive FTPYann E. MORIN"1-6/+8
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-09scripts/functions: only use one download programYann E. MORIN"1-12/+4
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>