aboutsummaryrefslogtreecommitdiff
path: root/package/pkg-utils.mk
Commit message (Collapse)AuthorAgeFilesLines
* pkg-generic: support for lzma archivesGravatar Petr Vorel2015-06-211-0/+1
| | | | | Signed-off-by: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* pkg-generic: substitute colon and space out of PKG_VERSIONGravatar Arnout Vandecappelle2015-04-251-0/+5
| | | | | | | | | | | | | | | | | 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>
* pkg-utils: update comments after renaming of package infra macrosGravatar Thomas Petazzoni2015-04-131-1/+1
| | | | | | | | | | | 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>
* pkg-utils: describe the case conversion macros in more detail.Gravatar Arnout Vandecappelle2014-10-161-8/+18
| | | | | | | | | | | 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>
* .mk files: bulk aligment and whitespace cleanup of assignmentsGravatar Thomas De Schampheleire2014-10-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* check-deprecated-variable: move from pkg-generic.mk to pkg-utils.mkGravatar Thomas De Schampheleire2014-10-051-0/+9
| | | | | | | 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>
* pkg-utils: qstrip MESSAGEGravatar Yann E. MORIN2014-09-291-1/+1
| | | | | | | | | | | | | | | | | | 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>
* legal-info: Add site to legal info manifestGravatar Clayton Shotwell2014-07-231-2/+2
| | | | | | | | | | | | 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>
* pkg-utils: kconfig helpers: use single iso double quotingGravatar Thomas De Schampheleire2014-07-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* pkg-utils: kconfig helpers: add basic usage documentationGravatar Thomas De Schampheleire2014-07-151-3/+3
| | | | | | | 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>
* legal-info: rename legal-warning-pkg-savednothing helperGravatar Yann E. MORIN2014-06-221-2/+2
| | | | | | | | | | | | | | | | | | 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>
* replace references to Busybox with BusyBoxGravatar Simon Dawson2014-06-011-1/+1
| | | | | | | | | 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>
* infra: pkg-utils.mk replace "echo -e" with printfGravatar Maxime Hadjinlian2014-05-211-2/+2
| | | | | | | | 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>
* pkg-utils: introduce a make-based LOWERCASE functionGravatar Thomas Petazzoni2014-04-201-14/+10
| | | | | | | | | | | | | | | | | | | 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>
* Revert "packages infra: add function to get a Kconfig option"Gravatar Thomas Petazzoni2014-03-041-2/+0
| | | | | | | | | | 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>
* packages infra: add function to get a Kconfig optionGravatar Yann E. MORIN2014-03-031-0/+2
| | | | | | | | | | | | | | | | | | 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>
* infra: remove unused helper function pkgparentdirGravatar Thomas De Schampheleire2014-02-051-4/+1
| | | | | | | | 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>
* infra: remove redundant $(call) on pkgdir, pkgname, pkgparentdirGravatar Thomas De Schampheleire2014-02-051-2/+2
| | | | | | | | | | 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>
* legal info: cleanup utility functionsGravatar Thomas De Schampheleire2013-11-171-6/+19
| | | | | | | | | | | | | | | | 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>
* legal info: split license texts for host and targetGravatar Thomas De Schampheleire2013-11-171-8/+8
| | | | | | 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>
* legal info: split manifest for host and targetGravatar Thomas De Schampheleire2013-11-171-1/+1
| | | | | | | | 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>
* Generation of locales: made call to tr more robust and added LOWERCASE macroGravatar Thierry Bultel2013-11-101-0/+8
| | | | | | | | | | | | | | | | | | | | | | 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>
* infra: introduce suitable-extractor helper functionGravatar Thomas De Schampheleire2013-09-061-0/+2
| | | | | | | | | | 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>
* Normalize separator size to 80Gravatar Alexandre Belloni2013-06-061-2/+2
| | | | | Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* pkg-utils.mk: legal-license-file: handle multiple license files with same nameGravatar Peter Korsgaard2013-06-051-2/+2
| | | | | | | | | | | | 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>
* legal-info: quote csv file contents, so commas can be usedGravatar Arnout Vandecappelle2012-11-141-1/+1
| | | | | Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* pkg-utils.mk: fix/clean indentationGravatar Samuel Martin2012-07-221-24/+16
| | | | | Signed-off-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* legal-info: infrastructure to collect legally-relevant materialGravatar Luca Ceresoli2012-07-171-0/+25
| | | | | | | | | | | | | | | | | | | | | 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>
* pkg-utils.mk: add utility functions find*clauses and notfirstwordGravatar Thomas De Schampheleire2012-06-231-0/+9
| | | | | | | | | | | | | | | | 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>
* pkg-*.mk: add some comments, update some existing commentsGravatar Thomas Petazzoni2012-04-191-0/+13
| | | | | Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* Split Makefile.package.in in pkg-download.mk, pkg-utils.mk and pkg-gentargets.mkGravatar Thomas Petazzoni2012-04-191-0/+72
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>