summaryrefslogtreecommitdiff
path: root/scripts/functions
AgeCommit message (Collapse)AuthorFilesLines
2017-02-05Use 'make olddefconfig' in uClibc/uClibc-ng configurationAlexey Neyman1-8/+0
instead of 'make oldconfig' and responding 'y'. This avoids 'Broken pipe' errors in the log, as well as selects default setting for all options not explicitly set. This requires a small fix in the old uClibc. Won't have to maintain that fix for long though :) Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-30Allow for per-tool templates when creating overridesAlexey Neyman1-1/+1
... will be used to implement a smarter install wrapper. While there, correct the spelling of "OVERIDE". Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-25Fix log saving/restoringAlexey Neyman1-17/+19
after the CT_Log{Enable,Disable} changes. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-20Get rid of .config.2.Alexey Neyman1-9/+15
Now handled by CT_LoadConfig. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-20Install canadian crosses into a separate subdir.Alexey Neyman1-15/+75
Makes them sorted out by host, and removes the need for similar hack in samples.mk. Change how canadian crosses are named: using `=' character resulted in Glibc build failure. Move loading config into a common function, CT_LoadConfig. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-14Use ${CT_CC} instead of gcc ...Alexey Neyman1-6/+6
... when refering to target's compiler. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-13Unify fetching Linaro components.Alexey Neyman1-0/+34
Add CT_GetLinaro, use it from gcc/binutils/gdb/glibc/newlib. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-18Catch more make errors.Alexey Neyman1-1/+1
Some errors from make(1) do not include a file reference in brackets. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-17Pass original multi_os_dir to iterator.Alexey Neyman1-8/+13
This is needed for callbacks that use that directory to look inside GCC internal directories, e.g. moving the libraries. This broke when I made libexpat for target honor ${CT_SHARED_LIBS}. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-06Work around Cygwin idiosyncrasy.Alexey Neyman1-1/+7
Cygwin doesn't like directory names ending with a dot, e.g. "multilib_." Signed-off-by: Alexey Neyman <stilor@att.net>
2016-11-21Partially revert 6f8e89cb5ca061e899bf3feaaf3fecf30d366c3e.Alexey Neyman1-25/+25
The referenced commit replaced 'make' with '${make}' everywhere. This is wrong for at least the utilities that we may build as companion tools (make, libtool): this will always invoke the version detected by configure by supplying the absolute path. In other words, the wrappers in .build/tools/bin are not fallbacks - they are either temporary (in case a respective companion tool is built) or permanent redirectors. This is the reason why the PATH= has .build/*/buildtools/bin at higher precedence than .build/tools/bin; the latter has the versions detected by configure and the former has the versions built as companion tools. Revert the rest of the gang (grep/sed/...) for consistency. After all, we may decide to supply some of them as well (awk, for instance). Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23Merge pull request #422 from datacom-teracom/masterBryan Hundven1-1/+1
scripts/functions: fix log level in call to CT_DoLog
2016-08-23Support multilib in sh/uClibc.Alexey Neyman1-28/+123
Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23Change multilib functions to set the variable.Alexey Neyman1-3/+3
Rather than echo-ing the new value, set the value into the variable with the name passed as an argument (similar to CT_SanitizeVarDir). This allows to use CT_DoLog in these functions. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23libc/*.sh: Deprecate libc_check_config step.Alexey Neyman1-2/+0
This step was only used in uClibc. However, with upcoming multilib, the config management will have to be done for each variant differently, anyway. uClibc was the only user of libc_check_config step, as well as CT_CONFIG_DIR directory. Retire these. Two other clean-ups in uClibc.sh: - KERNEL_HEADERS check seems to be bogus, this config option is not present even in 0.9.30 - which is not supported already. - SHARED_LIB_LOADER_PREFIX was renamed to MULTILIB_DIR in 0.9.31, according to ChangeLog - and MULTILIB_DIR is passed from command line instead. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23libc/*.sh: handle combinations of multilib root/dir.Alexey Neyman1-9/+45
Install startfiles for libc variants into the most specific combination (suffixed sysroot, if applicable + suffixed multi-os dir, if applicable). Install headers once in every suffixed sysroot (although it seems that GCC picks up headers from top-level sysroot, GCC manual claims that sysroot suffix affects headers search path). In uClibc, this requires a better sanitization of the directory: it creates symlinks from {sysroot}/usr/lib/{multi_os_dir} to {sysroot}/lib/{multi_os_dir} and to do so, it counts the number of path components in the libdir. This breaks if one of such components is `..' - symlinks contain an extra `../..' then. Since such sanitization had to be implemented anyway, use it in other places to print more sensible directory names. Also, fix the description of configure --host/--target per musl's configure help message (and its actual code). Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23multilib: Determine which options may pass through.Alexey Neyman1-0/+25
On some arches (e.g. MIPS) the options like -mabi do not work if specified more than once (see the comment in 100-gcc.sh). Therefore, we need to determine which of the options produced by <arch>.sh can be passed to multilib builds and which must be removed (i.e., which options vary among the multilibs). This presents a chicken-and-egg problem. GCC developers, in their infinite wisdom, do not allow arbitrary multilib specification to be supplied to GCC's configure. Instead, the target (and sometimes some extra options) determine the set of multilibs - which may include different CPUs, different ABIs, different endianness, different FPUs, different floating-point ABIs, ... That is, we don't know which parts vary until we build GCC and ask it. So, the solution implemented here is: - For multilib builds, start with empty CT_ARCH_TARGET_CFLAGS/LDFLAGS. - For multilib builds, require core pass 1. Pass 1 does not build any target binaries, so at that point, our target options have not been used yet. - Provide an API to modify the environment variables for the steps that follow the current one. - As a part of multilib-related housekeeping, determine the variable part of multilibs and filter out these options; pass the rest into CT_TARGET_CFLAGS/LDFLAGS. This still does not handle extra dependencies between GCC options (like -ma implying -mcpu=X -mtune=Y, etc.) but I feel that would complicate matters too much. Let's leave this until there's a compelling case for it. Also, query GCC's sysroot suffix for targets that use it (SuperH, for example) - the default multilib may not work if the command line specifies the default option explicitly (%sysroot_suffix_spec is not aware of multilib defaults). Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-17scripts/functions: fix log level in call to CT_DoLogCarlos Santos1-1/+1
It must be "DEBUG", not "Debug" Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
2016-06-10glibc: Use common arch call to get multilib targetsRay Donnelly1-0/+19
The previous patch added the function 'CT_DoMultilibTarget()' to scripts/build/arch/*.sh. This patch calls the common function to (currently) get just the target tuple for the current multilib target. This patch was originally by: Cody P Schafer Changed by Alexey Neyman: first, try `gcc -print-multiarch`. If it is supported, use whatever it reports. Otherwise, fall back to our guesswork. Move "i486" quirk into glibc.sh, as it is specific to glibc (e.g. uclibc will need i386, which is what GCC reports). Signed-off-by: Bryan Hundven <bryanhundven@gmail.com> Signed-off-by: Ray Donnelly <mingw.android@gmail.com> Signed-off-by: Alexey Neyman <stilor@att.net>
2016-02-19functions: use 'ln -sf' for softlinksBryan Hundven1-1/+1
I should have just used ln -sf when I rewrote the custom locations change. BSD based systems don't have 'cp -s', so switch to using 'ln -sf'. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2016-02-09functions: Softlink custom directoryBryan Hundven1-1/+1
Hardlinking the custom source directory does not work across separate mount points. Chnage this to a softlink instead. This closes #336 Reported-by: Jasmin Jessich <jasmin@anw.at> Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-12-08CT_GetCustom: Rewrite function to meet expectationsBryan Hundven1-26/+47
The previous version of CT_GetCustom was a bit... funky. It didn't handle custom versions to location very well. This new version is exactly as it appears: CT_GetCustom <name> <version> <location> The name is the beginning of the archive (file or directory). The version is the second half of the archive. The location is where it can be found. This should be made an absolute path, but this version is expecting the path in kconfig to be absolute. A file should extract to a directory: <name>-<version> A directory will be copied to: <name>-<version> This keeps our expectations of what we should get. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-12-08CT_Extract: Move check extracted upBryan Hundven1-6/+6
If we are using a custom location, and that custom location is a directory that does not have an associated tarball, then we shouldn't warn about not finding a tarball in CT_TARBALLS_DIR if CT_SRC_DIR/.<basename>.extracted is found. If the extracted file is not found, then we can warn that the tarball was not found then error out that the tarball is missing. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-11-17consistency: Use exported variables of required toolsBryan Hundven1-3/+3
We check for apps: * make * sed * grep * awk * libtool/libtoolize * install * patch * and more ...during configure. Our scripts should be consistent about using the variables that define where the found tool was found. Of course, we do hard-link these tools in buildtools, but that should be a backup for the components we are building. Our scripts should always use the tools we find. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2015-11-14Do not log state saving/restoring as ERROR.Alexey Neyman1-4/+2
These are not errors. Signed-off-by: Alexey Neyman <stilor@att.net>
2015-11-13functions: Add global functions for manipulating kconfig optionsBryan Hundven1-1/+49
This commit adds 4 new functions to aid in the process of managing a kconfig .config file: * CT_KconfigSetOption <option> <value> <file> * CT_KconfigEnableOption <option> <file> * CT_KconfigDisableOption <option> <file> * CT_KconfigDeleteOption <option> <file> (akin to how buildroot manages the uClibc.config) These functions are global so that we can manage any component that also uses kconfig, or to be able to use it internally on Crosstool-NG's kconfig files. Last but not least, be consistent and update sed to be ${sed}! Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
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