summaryrefslogtreecommitdiff
path: root/package/pkg-utils.mk
AgeCommit message (Collapse)Author
2017-02-15package: add generic support for lz archivesBaruch Siach
This commit teaches the generic package handling code how to extract .tar.lz archives. When lzip is not installed on the host, host-lzip gets built automatically. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-15package: refactor listing of extractor dependenciesBaruch Siach
Don't special case $(XZCAT) when constructing DL_TOOLS_DEPENDENCIES. The next commit will introduce another extractor that automatically builds when not installed. Introduce EXTRACTOR_DEPENDENCY_PRECHECKED_EXTENSIONS that lists archive extensions for which the extractor is already checked in support/dependencies/check-host-foo.mk. Use this in the newly introduced extractor-dependency to populate DL_TOOLS_DEPENDENCIES. Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> [Thomas: add missing space after "firstword", as noticed by Thomas DS.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-15core/legal-info: don't generate big file with all license textsYann E. MORIN
By aggregating all the license files into a single big text-only file means we have no way to use license files that are binary blobs (e.g. pdf, rtf...). Just do not generate that big file; if the user still wants it, it is very easy to create it afterwards. Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Luca Ceresoli <luca@lucaceresoli.net> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-08-27core: move pkg-utils.mk to support/Yann E. MORIN
pkg-utils.mk contains various definitions that are used in the package infrastructures and packages themselves. However, those definitions can be useful in other parts of Buildroot, and are already used in a few places that are not related to the package infrastructure. Also, $(sep) will be needed early in the Makefile when we eventually support multiple br2-external trees. Since this file only contains definitions, we can include it anytime. So, consider that file to no longer be specific to the package infras: - move it to support and rename it, - move a few similar definitions from the main Makefile to that file. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Peter Korsgaard <jacmet@uclibc.org> Reviewed-by: Romain Naour <romain.naour@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-06-07core/pkg-utils: add macro to escape-and-printfYann E. MORIN
In some cases we need to escape make variables and pass them to printf(1). This is the case in our fs infra, where we want to shoe-horn the commands to generate the filesystems in the fakeroot script, or the devices, permissions and users tables to their respective files. We currently do so by replacing $(sep) with the literal '\n' but that's not enough. This does not protect against strings with an embedded '%' or a backslash. Add a new macro that properly escapes a string and calls printf(1), so that we get the expected output. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-02-21pkg-utils: mask tput failure for non-interactive sessionsJames Knight
When invoking a build from a non-interactive session (for example, a Jenkins build), there is no terminal session to modify. When preparing variables to track the bold and boldoff mode sequences, the `tput` command will always fail as there is no terminal to query. The following change masks the error message when `tput` fails; leaving the TERM_BOLD and TERM_RESET variables empty. Signed-off-by: James Knight <james.d.knight@live.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-06-21pkg-generic: support for lzma archivesPetr Vorel
Signed-off-by: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-04-25pkg-generic: substitute colon and space out of PKG_VERSIONArnout Vandecappelle
Using a colon or a space in a make target doesn't work, so they have to be filtered out of the PKG_VERSION variable just like the / currently already is. This will be needed for date-based CVS versions. Add a helper macro 'sanitize' in pkg-utils.mk to implement this. This also moves the strip to the inner level for the target branch. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Cc: Fabio Porcedda <fabio.porcedda@gmail.com> Cc: Yann E. MORIN <yann.morin.1998@free.fr> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-04-13pkg-utils: update comments after renaming of package infra macrosThomas Petazzoni
The package infrastructure macros have a long time ago been renamed from GENTARGETS, AUTOTARGETS to generic-package and autotools-package. However, one comment in pkg-utils.mk keeps a reference to these *TARGETS macros. This commit updates this comment to match the new name of these macros. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2014-10-16pkg-utils: describe the case conversion macros in more detail.Arnout Vandecappelle
After the refactoring of the case conversion macros in dd5e620ac, the macro became even harder to understand. Improve this explanation a little so future generations can make sense of what we're doing here. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-07.mk files: bulk aligment and whitespace cleanup of assignmentsThomas De Schampheleire
The Buildroot coding style defines one space around make assignments and does not align the assignment symbols. This patch does a bulk fix of offending packages. The package infrastructures (or more in general assignments to calculated variable names, like $(2)_FOO) are not touched. Alignment of line continuation characters (\) is kept as-is. The sed command used to do this replacement is: find * -name "*.mk" | xargs sed -i \ -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*$#\1 \2#' -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\]\+\)$#\1 \2 \3#' -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\ \t]\+\s*\\\)\s*$#\1 \2 \3#' -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\(\s*\\\)#\1 \2\3#' Brief explanation of this command: ^\([A-Z0-9a-z_]\+\) a regular variable at the beginning of the line \([?:+]\?=\) any assignment character =, :=, ?=, += \([^\\]\+\) any string not containing a line continuation \([^\\ \t]\+\s*\\\) string, optional whitespace, followed by a line continuation character \(\s*\\\) optional whitespace, followed by a line continuation character Hence, the first subexpression handles empty assignments, the second handles regular assignments, the third handles regular assignments with line continuation, and the fourth empty assignments with line continuation. This expression was tested on following test text: (initial tab not included) FOO = spaces before FOO = spaces before and after FOO = tab before FOO = tab and spaces before FOO = tab after FOO = tab and spaces after FOO = spaces and tab after FOO = \ FOO = bar \ FOO = bar space \ FOO = \ GENIMAGE_DEPENDENCIES = host-pkgconf libconfuse FOO += spaces before FOO ?= spaces before and after FOO := FOO = FOO = FOO = FOO = $(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C AT91BOOTSTRAP3_DEFCONFIG = \ AXEL_DISABLE_I18N=--i18n=0 After this bulk change, following manual fixups were done: - fix line continuation alignment in cegui06 and spice (the sed expression leaves the number of whitespace between the value and line continuation character intact, but the whitespace before that could have changed, causing misalignment. - qt5base was reverted, as this package uses extensive alignment which actually makes the code more readable. Finally, the end result was manually reviewed. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Cc: Yann E. Morin <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-05check-deprecated-variable: move from pkg-generic.mk to pkg-utils.mkThomas De Schampheleire
Suggested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-09-29pkg-utils: qstrip MESSAGEYann E. MORIN
Currently, the MESSAGE macro double-quotes the message. But a few call sites also double-quote the message, resulting in a borked call to echo, like: $(call MESSAGE,"user text") would expand to: echo "Leading text "user message" trailign text" Just use qstrip on the user message, so we get protected from either a comma in the user text (so make does not interpret it), or a semi-colon (so the shell does not interpret it.) Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Peter Korsgaard <jacmet@uclibc.org> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-07-23legal-info: Add site to legal info manifestClayton Shotwell
I would like to propose adding the site to the legal-info manifest files. This gives a little more information on where the sources came from without adding much overhead. Please note that is is only for packages where the source is not local or set with OVERRIDE_SRCDIR. Signed-off-by: Clayton Shotwell <clayton.shotwell@rockwellcollins.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-15pkg-utils: kconfig helpers: use single iso double quotingThomas De Schampheleire
The echo statements in the kconfig helpers are currently using double quotes. For KCONFIG_SET_OPT this is problematic when the value argument itself contains a double quote (a string value). In this case, the statement echo "$(1)=$(2)" >> $(3) would become: echo "FOO="string value"" >> /some/path/.config resulting in the string FOO=string value in the config file, rather than the properly quoted FOO="string value" The linux package worked around this by escaping the quote characters, but a prettier solution is to use single quoting in the helpers (or alternatively use no quoting at all). A side effect of this change is that a $variable in the key or value would no longer be interpreted by the shell, removing any unexpected behavior. This change is only really necessary for KCONFIG_SET_OPT, but for symmetry reasons the other helpers are updated too. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-15pkg-utils: kconfig helpers: add basic usage documentationThomas De Schampheleire
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-22legal-info: rename legal-warning-pkg-savednothing helperYann E. MORIN
This helper was called when none of the sources or license files were saved. Now we handle license files separately from the sources, this is no longer the case: they are only called when the sources are not saved. Rename the handler and change the warning message accordingly. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Luca Ceresoli <luca@lucaceresoli.net> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Fabio Porcedda <fabio.porcedda@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-01replace references to Busybox with BusyBoxSimon Dawson
The correct capitalised form appears to be "BusyBox" rather than "Busybox"; fix all references to the latter form. (Most such references occur in the manual and in commentary in package makefiles.) Signed-off-by: Simon Dawson <spdawson@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-21infra: pkg-utils.mk replace "echo -e" with printfMaxime Hadjinlian
printf is POSIX-compliant, echo -e is not. Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-04-20pkg-utils: introduce a make-based LOWERCASE functionThomas Petazzoni
Until now, our UPPERCASE function was implemented purely in make for performance reasons, but our LOWERCASE function was implemented by calling "tr", which was reasonable due to the fact that LOWERCASE was rarely used, but future changes might make a more heavy usage of the LOWERCASE macro. We want this LOWERCASE function to turn a "_" into a "-" and not a ".", so we slightly adjust the existing FROM and TO lists to make this possible. This doesn't change the behavior of the UPPERCASE macro because both "-" and "." are converted into "_" by this function. This change takes advantage of suggestions made by Arnout Vandecappelle, who said they further improve the performance of UPPERCASE and LOWERCASE by 30%/40%. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-04Revert "packages infra: add function to get a Kconfig option"Thomas Petazzoni
This reverts commit c28a28eed1943c1efb958448a87a2e8f0baf48d6. The whole host-lzop optional dependency logic cannot work, since the configuration file will only be known after the kernel sources are extracted, if an internal kernel defconfig is used, which is quite common. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-03packages infra: add function to get a Kconfig optionYann E. MORIN
We so far have no mean to get the value from a Kconfig option from the .config file of a package (eg. linux, busybox...). Add a new function that returns the unmangled value of an option. It expect two arguments: - the Kconfig option name (complete, with leading CONFIG if necessary) - the .config file to get it from Note that, if the Kconfig option is a string, the returned value will contain the leading and trailing double-quotes. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Peter Korsgaard <jacmet@uclibc.org> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-02-05infra: remove unused helper function pkgparentdirThomas De Schampheleire
Thanks to the previous patches, no-one is using pkgparentdir anymore, so remove it. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-05infra: remove redundant $(call) on pkgdir, pkgname, pkgparentdirThomas De Schampheleire
When calling make 'functions', the $(call) keyword is only needed if the function takes arguments. For pkgdir, pkgname and pkgparentdir this is not the case, so we can remove the call to make things more readable. Suggested-by: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-17legal info: cleanup utility functionsThomas De Schampheleire
The legal-info utility functions where defined using two ways util-foo = command-foo and define util-bar # parameter description command-bar endef This commit changes these functions to use the second form for clarity and additionally adds parameter descriptions on all functions. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Acked-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-17legal info: split license texts for host and targetThomas De Schampheleire
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Acked-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-17legal info: split manifest for host and targetThomas De Schampheleire
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Acked-by: Luca Ceresoli <luca@lucaceresoli.net> Tested-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-10Generation of locales: made call to tr more robust and added LOWERCASE macroThierry Bultel
When calling 'tr' without quoting braces, bash can make really weird things if there are existing 'single-letter-named' directories eg: thierry@thierry-desktop:~$ echo AAA | tr [A-Z] [a-z] aaa thierry@thierry-desktop:~$ mkdir m thierry@thierry-desktop:~$ echo AAA | tr [A-Z] [a-z] AAA The (quick) analysis is that the callee (tr) argvs then contain 'm' thus the translation does not work Using quotes works around it: thierry@thierry-desktop:~$ echo AAA | tr '[A-Z]' '[a-z]' aaa Signed-off-by: Thierry Bultel <thierry.bultel@wanadoo.fr> Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-09-06infra: introduce suitable-extractor helper functionThomas De Schampheleire
In order to simplify determining the right extractor tool for a given file type, this patch introduces a make function 'suitable-extractor'. Its usage is $(call suitable-extractor,filename), and it returns the path to the suitable extractor. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-06-06Normalize separator size to 80Alexandre Belloni
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-06-05pkg-utils.mk: legal-license-file: handle multiple license files with same namePeter Korsgaard
Some packages (kmod, e2fsprogs, ..) contain multiple (different) license files with the same file name, but in different directories. These are currently all copied to the same filename in output/legal-info/licenses/<pkg>, overwriting everything but the last file. Fix it by recreating the same directory structure under legal-info. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-11-14legal-info: quote csv file contents, so commas can be usedArnout Vandecappelle
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-07-22pkg-utils.mk: fix/clean indentationSamuel Martin
Signed-off-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-17legal-info: infrastructure to collect legally-relevant materialLuca Ceresoli
This allows to automatically collect material that may be needed to comply with the license of packages that Buildroot prepares for the target device. The core of the implementation is made by the following parts: - in package/pkg-utils.mk some helper functions are defined for common actions such as generating a warning, producing info about a package etc; - in package/pkg-gentargets.mk, within the GENTARGETS framework, a new <PKG>-legal-info target produces all the info for a given package; - Makefile implements the top-level targets: - legal-info-prepare creates the output directory and produces legal info about Buildroot itself and the toolchain, which mostly means just warning the user that this is not implemented; - legal-info, the only target that is supposed to be used directly, depends on all of the above and finishes things by producing the README files from the various pieces. Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-06-23pkg-utils.mk: add utility functions find*clauses and notfirstwordThomas De Schampheleire
This patch adds a few utility functions to pkg-utils.mk. Functions finddirclauses and findfileclauses help in building a find command that skips a set of directories and performs operations on a set of files. This pattern can for example be used to keep certain files or directories from being stripped, or to remove certain files from a package installation. The notfirstword function is the inverse of the 'firstword' function in make: it returns all but the first word. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-04-19pkg-*.mk: add some comments, update some existing commentsThomas Petazzoni
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-04-19Split Makefile.package.in in pkg-download.mk, pkg-utils.mk and pkg-gentargets.mkThomas Petazzoni
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>