more work on merging with buildroot201702

This commit is contained in:
Calin Crisan 2017-02-18 23:10:42 +02:00
parent c8ed482c5a
commit 1d71845cc8
130 changed files with 5509 additions and 7080 deletions

401
Config.in
View File

@ -14,18 +14,23 @@ config BR2_HOSTARCH
string string
option env="HOSTARCH" option env="HOSTARCH"
config BR2_EXTERNAL config BR2_BUILD_DIR
string string
option env="BR2_EXTERNAL" option env="BUILD_DIR"
# Hidden config symbols for packages to check system gcc version # Hidden config symbols for packages to check system gcc version
config BR2_HOST_GCC_VERSION config BR2_HOST_GCC_VERSION
string string
option env="HOST_GCC_VERSION" option env="HOST_GCC_VERSION"
config BR2_HOST_GCC_AT_LEAST_4_5
bool
default y if BR2_HOST_GCC_VERSION = "4 5"
config BR2_HOST_GCC_AT_LEAST_4_6 config BR2_HOST_GCC_AT_LEAST_4_6
bool bool
default y if BR2_HOST_GCC_VERSION = "4 6" default y if BR2_HOST_GCC_VERSION = "4 6"
select BR2_HOST_GCC_AT_LEAST_4_5
config BR2_HOST_GCC_AT_LEAST_4_7 config BR2_HOST_GCC_AT_LEAST_4_7
bool bool
@ -47,6 +52,11 @@ config BR2_HOST_GCC_AT_LEAST_5
default y if BR2_HOST_GCC_VERSION = "5" default y if BR2_HOST_GCC_VERSION = "5"
select BR2_HOST_GCC_AT_LEAST_4_9 select BR2_HOST_GCC_AT_LEAST_4_9
config BR2_HOST_GCC_AT_LEAST_6
bool
default y if BR2_HOST_GCC_VERSION = "6"
select BR2_HOST_GCC_AT_LEAST_5
# Hidden boolean selected by packages in need of Java in order to build # Hidden boolean selected by packages in need of Java in order to build
# (example: xbmc) # (example: xbmc)
config BR2_NEEDS_HOST_JAVA config BR2_NEEDS_HOST_JAVA
@ -74,6 +84,11 @@ config BR2_HOSTARCH_NEEDS_IA32_LIBS
config BR2_HOSTARCH_NEEDS_IA32_COMPILER config BR2_HOSTARCH_NEEDS_IA32_COMPILER
bool bool
# Hidden boolean selected by packages that need the host to have an
# UTF8 locale.
config BR2_NEEDS_HOST_UTF8_LOCALE
bool
source "arch/Config.in" source "arch/Config.in"
menu "Build options" menu "Build options"
@ -120,9 +135,9 @@ config BR2_ZCAT
string "zcat command" string "zcat command"
default "gzip -d -c" default "gzip -d -c"
help help
Command to be used to extract a gzip'ed file to stdout. Command to be used to extract a gzip'ed file to stdout. zcat
zcat is identical to gunzip -c except that the former may is identical to gunzip -c except that the former may not be
not be available on your system. available on your system.
Default is "gzip -d -c" Default is "gzip -d -c"
Other possible values include "gunzip -c" or "zcat". Other possible values include "gunzip -c" or "zcat".
@ -162,8 +177,8 @@ config BR2_DEFCONFIG
default BR2_DEFCONFIG_FROM_ENV if BR2_DEFCONFIG_FROM_ENV != "" default BR2_DEFCONFIG_FROM_ENV if BR2_DEFCONFIG_FROM_ENV != ""
default "$(CONFIG_DIR)/defconfig" default "$(CONFIG_DIR)/defconfig"
help help
When running 'make savedefconfig', the defconfig file will be saved When running 'make savedefconfig', the defconfig file will be
in this location. saved in this location.
config BR2_DL_DIR config BR2_DL_DIR
string "Download dir" string "Download dir"
@ -171,7 +186,8 @@ config BR2_DL_DIR
help help
Directory to store all the source files that we need to fetch. Directory to store all the source files that we need to fetch.
If the Linux shell environment has defined the BR2_DL_DIR If the Linux shell environment has defined the BR2_DL_DIR
environment variable, then this overrides this configuration item. environment variable, then this overrides this configuration
item.
The default is $(TOPDIR)/dl The default is $(TOPDIR)/dl
@ -179,9 +195,9 @@ config BR2_HOST_DIR
string "Host dir" string "Host dir"
default "$(BASE_DIR)/host" default "$(BASE_DIR)/host"
help help
Directory to store all the binary files that are built for the host. Directory to store all the binary files that are built for the
This includes the cross compilation toolchain when building the host. This includes the cross compilation toolchain when
internal buildroot toolchain. building the internal buildroot toolchain.
The default is $(BASE_DIR)/host The default is $(BASE_DIR)/host
@ -191,9 +207,9 @@ config BR2_PRIMARY_SITE
string "Primary download site" string "Primary download site"
default "" default ""
help help
Primary site to download from. If this option is set then buildroot Primary site to download from. If this option is set then
will try to download package source first from this site and try the buildroot will try to download package source first from this
default if the file is not found. site and try the default if the file is not found.
Valid URIs are: Valid URIs are:
- URIs recognized by $(WGET) - URIs recognized by $(WGET)
- local URIs of the form file://absolutepath - local URIs of the form file://absolutepath
@ -206,11 +222,11 @@ config BR2_PRIMARY_SITE_ONLY
If this option is enabled, downloads will only be attempted If this option is enabled, downloads will only be attempted
from the primary download site. Other locations, like the from the primary download site. Other locations, like the
package's official download location or the backup download package's official download location or the backup download
site, will not be considered. Therefore, if the package is site, will not be considered. Therefore, if the package is not
not present on the primary site, the download fails. present on the primary site, the download fails.
This is useful for project developers who want to ensure This is useful for project developers who want to ensure that
that the project can be built even if the upstream tarball the project can be built even if the upstream tarball
locations disappear. locations disappear.
if !BR2_PRIMARY_SITE_ONLY if !BR2_PRIMARY_SITE_ONLY
@ -219,32 +235,36 @@ config BR2_BACKUP_SITE
string "Backup download site" string "Backup download site"
default "http://sources.buildroot.net" default "http://sources.buildroot.net"
help help
Backup site to download from. If this option is set then buildroot Backup site to download from. If this option is set then
will fall back to download package sources from here if the buildroot will fall back to download package sources from here
normal location fails. if the normal location fails.
config BR2_KERNEL_MIRROR config BR2_KERNEL_MIRROR
string "Kernel.org mirror" string "Kernel.org mirror"
default "https://www.kernel.org/pub" default "https://cdn.kernel.org/pub"
help help
kernel.org is mirrored on a number of servers around the world. kernel.org is mirrored on a number of servers around the
The following allows you to select your preferred mirror. world. The following allows you to select your preferred
mirror. By default, a CDN is used, which automatically
redirects to a mirror geographically close to you.
Have a look on the kernel.org site for a list of mirrors, then enter Have a look on the kernel.org site for a list of mirrors, then
the URL to the base directory. Examples: enter the URL to the base directory. Examples:
http://www.XX.kernel.org/pub (XX = country code) http://www.XX.kernel.org/pub (XX = country code)
http://mirror.aarnet.edu.au/pub/ftp.kernel.org http://mirror.aarnet.edu.au/pub/ftp.kernel.org
config BR2_GNU_MIRROR config BR2_GNU_MIRROR
string "GNU Software mirror" string "GNU Software mirror"
default "http://ftp.gnu.org/pub/gnu" default "http://ftpmirror.gnu.org"
help help
GNU has multiple software mirrors scattered around the world. GNU has multiple software mirrors scattered around the
The following allows you to select your preferred mirror. world. The following allows you to select your preferred
mirror. By default, a generic address is used, which
automatically selects an up-to-date and local mirror.
Have a look on the gnu.org site for a list of mirrors, then enter Have a look on the gnu.org site for a list of mirrors, then
the URL to the base directory. Examples: enter the URL to the base directory. Examples:
http://ftp.gnu.org/pub/gnu http://ftp.gnu.org/pub/gnu
http://mirror.aarnet.edu.au/pub/gnu http://mirror.aarnet.edu.au/pub/gnu
@ -261,8 +281,8 @@ config BR2_CPAN_MIRROR
string "CPAN mirror (Perl packages)" string "CPAN mirror (Perl packages)"
default "http://cpan.metacpan.org" default "http://cpan.metacpan.org"
help help
CPAN (Comprehensive Perl Archive Network) is a repository CPAN (Comprehensive Perl Archive Network) is a repository of
of Perl packages. It has multiple software mirrors scattered Perl packages. It has multiple software mirrors scattered
around the world. This option allows you to select a mirror. around the world. This option allows you to select a mirror.
The list of mirrors is available at: The list of mirrors is available at:
@ -276,24 +296,22 @@ config BR2_JLEVEL
int "Number of jobs to run simultaneously (0 for auto)" int "Number of jobs to run simultaneously (0 for auto)"
default "0" default "0"
help help
Number of jobs to run simultaneously. If 0, determine Number of jobs to run simultaneously. If 0, determine
automatically according to number of CPUs on the host automatically according to number of CPUs on the host system.
system.
config BR2_CCACHE config BR2_CCACHE
bool "Enable compiler cache" bool "Enable compiler cache"
help help
This option will enable the use of ccache, a compiler This option will enable the use of ccache, a compiler cache.
cache. It will cache the result of previous builds to speed It will cache the result of previous builds to speed up future
up future builds. By default, the cache is stored in builds. By default, the cache is stored in
$HOME/.buildroot-ccache. $HOME/.buildroot-ccache.
Note that Buildroot does not try to invalidate the cache Note that Buildroot does not try to invalidate the cache
contents when the compiler changes in an incompatible contents when the compiler changes in an incompatible way.
way. Therefore, if you make a change to the compiler version Therefore, if you make a change to the compiler version and/or
and/or configuration, you are responsible for purging the configuration, you are responsible for purging the ccache
ccache cache by removing the $HOME/.buildroot-ccache cache by removing the $HOME/.buildroot-ccache directory.
directory.
if BR2_CCACHE if BR2_CCACHE
@ -306,16 +324,19 @@ config BR2_CCACHE_DIR
config BR2_CCACHE_INITIAL_SETUP config BR2_CCACHE_INITIAL_SETUP
string "Compiler cache initial setup" string "Compiler cache initial setup"
help help
Initial ccache settings to apply, such as --max-files or --max-size. Initial ccache settings to apply, such as --max-files or
--max-size.
For example, if your project is known to require more space than the For example, if your project is known to require more space
default max cache size, then you might want to increase the cache size than the default max cache size, then you might want to
to a suitable amount using the -M (--max-size) option. increase the cache size to a suitable amount using the -M
(--max-size) option.
The string you specify here is passed verbatim to ccache. Refer to The string you specify here is passed verbatim to ccache.
ccache documentation for more details. Refer to ccache documentation for more details.
These initial settings are applied after ccache has been compiled. These initial settings are applied after ccache has been
compiled.
config BR2_CCACHE_USE_BASEDIR config BR2_CCACHE_USE_BASEDIR
bool "Use relative paths" bool "Use relative paths"
@ -324,55 +345,25 @@ config BR2_CCACHE_USE_BASEDIR
Allow ccache to convert absolute paths within the output Allow ccache to convert absolute paths within the output
directory into relative paths. directory into relative paths.
During the build, many -I include directives are given with During the build, many -I include directives are given with an
an absolute path. These absolute paths end up in the hashes absolute path. These absolute paths end up in the hashes that
that are computed by ccache. Therefore, when you build from a are computed by ccache. Therefore, when you build from a
different directory, the hash will be different and the different directory, the hash will be different and the cached
cached object will not be used. object will not be used.
To improve cache performance, set this option to y. This To improve cache performance, set this option to y. This
allows ccache to rewrite absolute paths within the output allows ccache to rewrite absolute paths within the output
directory into relative paths. Note that only paths within directory into relative paths. Note that only paths within the
the output directory will be rewritten; therefore, if you output directory will be rewritten; therefore, if you change
change BR2_HOST_DIR to point outside the output directory and BR2_HOST_DIR to point outside the output directory and
subsequently move it to a different location, this will lead subsequently move it to a different location, this will lead
to cache misses. to cache misses.
This option has as a result that the debug information in the This option has as a result that the debug information in the
object files also has only relative paths. Therefore, make object files also has only relative paths. Therefore, make
sure you cd to the build directory before starting gdb. See sure you cd to the build directory before starting gdb. See
the section "COMPILING IN DIFFERENT DIRECTORIES" in the the section "COMPILING IN DIFFERENT DIRECTORIES" in the ccache
ccache manual for more information. manual for more information.
endif
config BR2_DEPRECATED
bool "Show options and packages that are deprecated or obsolete"
help
This option shows outdated/obsolete versions of packages and
options that are otherwise hidden.
if BR2_DEPRECATED
config BR2_DEPRECATED_SINCE_2015_05
bool
default y
config BR2_DEPRECATED_SINCE_2015_08
bool
default y
config BR2_DEPRECATED_SINCE_2015_11
bool
default y
config BR2_DEPRECATED_SINCE_2016_02
bool
default y
config BR2_DEPRECATED_SINCE_2016_05
bool
default y
endif endif
@ -396,11 +387,11 @@ choice
config BR2_DEBUG_1 config BR2_DEBUG_1
bool "debug level 1" bool "debug level 1"
help help
Debug level 1 produces minimal information, enough Debug level 1 produces minimal information, enough for making
for making backtraces in parts of the program that backtraces in parts of the program that you don't plan to
you don't plan to debug. This includes descriptions debug. This includes descriptions of functions and external
of functions and external variables, but no information variables, but no information about local variables and no
about local variables and no line numbers. line numbers.
config BR2_DEBUG_2 config BR2_DEBUG_2
bool "debug level 2" bool "debug level 2"
@ -410,9 +401,9 @@ config BR2_DEBUG_2
config BR2_DEBUG_3 config BR2_DEBUG_3
bool "debug level 3" bool "debug level 3"
help help
Level 3 includes extra information, such as all the Level 3 includes extra information, such as all the macro
macro definitions present in the program. Some debuggers definitions present in the program. Some debuggers support
support macro expansion when you use -g3. macro expansion when you use -g3.
endchoice endchoice
endif endif
@ -425,16 +416,15 @@ config BR2_STRIP_strip
depends on !BR2_PACKAGE_HOST_ELF2FLT depends on !BR2_PACKAGE_HOST_ELF2FLT
help help
Binaries and libraries in the target filesystem will be Binaries and libraries in the target filesystem will be
stripped using the normal 'strip' command. This allows to stripped using the normal 'strip' command. This allows to save
save space, mainly by removing debugging symbols. Debugging space, mainly by removing debugging symbols. Debugging symbols
symbols on the target are needed for native debugging, but on the target are needed for native debugging, but not when
not when remote debugging is used. remote debugging is used.
config BR2_STRIP_none config BR2_STRIP_none
bool "none" bool "none"
help help
Do not strip binaries and libraries in the target Do not strip binaries and libraries in the target filesystem.
filesystem.
endchoice endchoice
config BR2_STRIP_EXCLUDE_FILES config BR2_STRIP_EXCLUDE_FILES
@ -442,19 +432,19 @@ config BR2_STRIP_EXCLUDE_FILES
depends on !BR2_STRIP_none depends on !BR2_STRIP_none
default "" default ""
help help
You may specify a space-separated list of binaries and libraries You may specify a space-separated list of binaries and
here that should not be stripped on the target. libraries here that should not be stripped on the target.
config BR2_STRIP_EXCLUDE_DIRS config BR2_STRIP_EXCLUDE_DIRS
string "directories that should be skipped when stripping" string "directories that should be skipped when stripping"
depends on !BR2_STRIP_none depends on !BR2_STRIP_none
default "" default ""
help help
You may specify a space-separated list of directories that should You may specify a space-separated list of directories that
be skipped when stripping. Binaries and libraries in these should be skipped when stripping. Binaries and libraries in
directories will not be touched. these directories will not be touched. The directories should
The directories should be specified relative to the target directory, be specified relative to the target directory, without leading
without leading slash. slash.
choice choice
prompt "gcc optimization level" prompt "gcc optimization level"
@ -470,54 +460,67 @@ config BR2_OPTIMIZE_0
config BR2_OPTIMIZE_1 config BR2_OPTIMIZE_1
bool "optimization level 1" bool "optimization level 1"
help help
Optimize. Optimizing compilation takes somewhat more time, Optimize. Optimizing compilation takes somewhat more time, and
and a lot more memory for a large function. With -O, the a lot more memory for a large function. With -O, the compiler
compiler tries to reduce code size and execution time, tries to reduce code size and execution time, without
without performing any optimizations that take a great deal performing any optimizations that take a great deal of
of compilation time. -O turns on the following optimization compilation time. -O turns on the following optimization
flags: -fdefer-pop -fdelayed-branch -fguess-branch-probability flags: -fdefer-pop -fdelayed-branch -fguess-branch-probability
-fcprop-registers -floop-optimize -fif-conversion -fcprop-registers -floop-optimize -fif-conversion
-fif-conversion2 -ftree-ccp -ftree-dce -ftree-dominator-opts -fif-conversion2 -ftree-ccp -ftree-dce -ftree-dominator-opts
-ftree-dse -ftree-ter -ftree-lrs -ftree-sra -ftree-copyrename -ftree-dse -ftree-ter -ftree-lrs -ftree-sra -ftree-copyrename
-ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants. -O
-O also turns on -fomit-frame-pointer on machines where doing also turns on -fomit-frame-pointer on machines where doing so
so does not interfere with debugging. does not interfere with debugging.
config BR2_OPTIMIZE_2 config BR2_OPTIMIZE_2
bool "optimization level 2" bool "optimization level 2"
help help
Optimize even more. GCC performs nearly all supported optimizations Optimize even more. GCC performs nearly all supported
that do not involve a space-speed tradeoff. The compiler does not optimizations that do not involve a space-speed tradeoff. The
perform loop unrolling or function inlining when you specify -O2. compiler does not perform loop unrolling or function inlining
As compared to -O, this option increases both compilation time and when you specify -O2. As compared to -O, this option increases
the performance of the generated code. -O2 turns on all optimization both compilation time and the performance of the generated
flags specified by -O. It also turns on the following optimization code. -O2 turns on all optimization flags specified by -O. It
flags: -fthread-jumps -fcrossjumping -foptimize-sibling-calls also turns on the following optimization flags:
-fthread-jumps -fcrossjumping -foptimize-sibling-calls
-fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm
-fexpensive-optimizations -fstrength-reduce -frerun-cse-after-loop -fexpensive-optimizations -fstrength-reduce
-frerun-loop-opt -fcaller-saves -fpeephole2 -fschedule-insns -frerun-cse-after-loop -frerun-loop-opt -fcaller-saves
-fschedule-insns2 -fsched-interblock -fsched-spec -fregmove -fpeephole2 -fschedule-insns -fschedule-insns2
-fstrict-aliasing -fdelete-null-pointer-checks -freorder-blocks -fsched-interblock -fsched-spec -fregmove -fstrict-aliasing
-freorder-functions -falign-functions -falign-jumps -falign-loops -fdelete-null-pointer-checks -freorder-blocks
-falign-labels -ftree-vrp -ftree-pre -freorder-functions -falign-functions -falign-jumps
Please note the warning under -fgcse about invoking -O2 on programs -falign-loops -falign-labels -ftree-vrp -ftree-pre. Please
note the warning under -fgcse about invoking -O2 on programs
that use computed gotos. that use computed gotos.
config BR2_OPTIMIZE_3 config BR2_OPTIMIZE_3
bool "optimization level 3" bool "optimization level 3"
help help
Optimize yet more. -O3 turns on all optimizations specified by -O2 Optimize yet more. -O3 turns on all optimizations specified by
and also turns on the -finline-functions, -funswitch-loops and -O2 and also turns on the -finline-functions, -funswitch-loops
-fgcse-after-reload options. and -fgcse-after-reload options.
config BR2_OPTIMIZE_G
bool "optimize for debugging"
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
help
Optimize for debugging. This enables optimizations that do not
interfere with debugging. It should be the optimization level
of choice for the standard edit-compile-debug cycle, offering
a reasonable level of optimization while maintaining fast
compilation and a good debugging experience.
config BR2_OPTIMIZE_S config BR2_OPTIMIZE_S
bool "optimize for size" bool "optimize for size"
help help
Optimize for size. -Os enables all -O2 optimizations that do not Optimize for size. -Os enables all -O2 optimizations that do
typically increase code size. It also performs further optimizations not typically increase code size. It also performs further
designed to reduce code size. -Os disables the following optimization optimizations designed to reduce code size. -Os disables the
flags: -falign-functions -falign-jumps -falign-loops -falign-labels following optimization flags: -falign-functions -falign-jumps
-freorder-blocks -freorder-blocks-and-partition -fprefetch-loop-arrays -falign-loops -falign-labels -freorder-blocks
-freorder-blocks-and-partition -fprefetch-loop-arrays
-ftree-vect-loop-version -ftree-vect-loop-version
endchoice endchoice
@ -526,16 +529,20 @@ config BR2_GOOGLE_BREAKPAD_ENABLE
bool "Enable google-breakpad support" bool "Enable google-breakpad support"
select BR2_PACKAGE_GOOGLE_BREAKPAD select BR2_PACKAGE_GOOGLE_BREAKPAD
depends on BR2_INSTALL_LIBSTDCPP depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_TOOLCHAIN_USES_GLIBC depends on BR2_HOST_GCC_AT_LEAST_4_8 # C++11
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
depends on BR2_USE_WCHAR
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on (BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_UCLIBC)
depends on BR2_PACKAGE_GOOGLE_BREAKPAD_ARCH_SUPPORTS depends on BR2_PACKAGE_GOOGLE_BREAKPAD_ARCH_SUPPORTS
help help
This option will enable the use of google breakpad, a This option will enable the use of google breakpad, a library
library and tool suite that allows you to distribute an and tool suite that allows you to distribute an application to
application to users with compiler-provided debugging users with compiler-provided debugging information removed,
information removed, record crashes in compact "minidump" record crashes in compact "minidump" files, send them back to
files, send them back to your server and produce C and C++ your server and produce C and C++ stack traces from these
stack traces from these minidumps. Breakpad can also write minidumps. Breakpad can also write minidumps on request for
minidumps on request for programs that have not crashed. programs that have not crashed.
if BR2_GOOGLE_BREAKPAD_ENABLE if BR2_GOOGLE_BREAKPAD_ENABLE
@ -563,12 +570,13 @@ choice
Enable stack smashing protection support using GCC's Enable stack smashing protection support using GCC's
-fstack-protector option family. -fstack-protector option family.
See http://www.linuxfromscratch.org/hints/downloads/files/ssp.txt See
http://www.linuxfromscratch.org/hints/downloads/files/ssp.txt
for details. for details.
Note that this requires the toolchain to have SSP Note that this requires the toolchain to have SSP support.
support. This is always the case for glibc and eglibc This is always the case for glibc and eglibc toolchain, but is
toolchain, but is optional in uClibc toolchains. optional in uClibc toolchains.
config BR2_SSP_NONE config BR2_SSP_NONE
bool "None" bool "None"
@ -616,20 +624,19 @@ choice
help help
Select the type of libraries you want to use on the target. Select the type of libraries you want to use on the target.
The default is to build dynamic libraries and use those on The default is to build dynamic libraries and use those on the
the target filesystem, except when the architecture and/or target filesystem, except when the architecture and/or the
the selected binary format does not support shared selected binary format does not support shared libraries.
libraries.
config BR2_STATIC_LIBS config BR2_STATIC_LIBS
bool "static only" bool "static only"
help help
Build and use only static libraries. No shared libraries Build and use only static libraries. No shared libraries will
will be instaled on the target. This potentially increases be installed on the target. This potentially increases your
your code size and should only be used if you know what you code size and should only be used if you know what you are
are doing. Note that some packages may not be available when doing. Note that some packages may not be available when this
this option is enabled, due to their need for dynamic option is enabled, due to their need for dynamic library
library support. support.
config BR2_SHARED_LIBS config BR2_SHARED_LIBS
bool "shared only" bool "shared only"
@ -655,48 +662,67 @@ config BR2_PACKAGE_OVERRIDE_FILE
default "$(CONFIG_DIR)/local.mk" default "$(CONFIG_DIR)/local.mk"
help help
A package override file is a short makefile that contains A package override file is a short makefile that contains
variable definitions of the form <pkg>_OVERRIDE_SRCDIR, variable definitions of the form <pkg>_OVERRIDE_SRCDIR, which
which allows to tell Buildroot to use an existing directory allows to tell Buildroot to use an existing directory as the
as the source directory for a particular package. See the source directory for a particular package. See the Buildroot
Buildroot documentation for more details on this feature. documentation for more details on this feature.
config BR2_GLOBAL_PATCH_DIR config BR2_GLOBAL_PATCH_DIR
string "global patch directories" string "global patch directories"
help help
You may specify a space separated list of one or more directories You may specify a space separated list of one or more
containing global package patches. For a specific version directories containing global package patches. For a specific
<packageversion> of a specific package <packagename>, patches are version <packageversion> of a specific package <packagename>,
applied as follows: patches are applied as follows:
First, the default Buildroot patch set for the package is applied First, the default Buildroot patch set for the package is
from the package's directory in Buildroot. applied from the package's directory in Buildroot.
Then for every directory - <global-patch-dir> - that exists in Then for every directory - <global-patch-dir> - that exists in
BR2_GLOBAL_PATCH_DIR, if the directory BR2_GLOBAL_PATCH_DIR, if the directory
<global-patch-dir>/<packagename>/<packageversion>/ exists, then all <global-patch-dir>/<packagename>/<packageversion>/ exists,
*.patch files in this directory will be applied. then all *.patch files in this directory will be applied.
Otherwise, if the directory <global-patch-dir>/<packagename> exists, Otherwise, if the directory <global-patch-dir>/<packagename>
then all *.patch files in the directory will be applied. exists, then all *.patch files in the directory will be
applied.
menu "Advanced" menu "Advanced"
config BR2_COMPILER_PARANOID_UNSAFE_PATH config BR2_COMPILER_PARANOID_UNSAFE_PATH
bool "paranoid check of library/header paths" bool "paranoid check of library/header paths"
default y
help help
By default, when this option is disabled, when the Buildroot By default, when this option is disabled, when the Buildroot
cross-compiler will encounter an unsafe library or header cross-compiler will encounter an unsafe library or header path
path (such as /usr/include, or /usr/lib), the compiler will (such as /usr/include, or /usr/lib), the compiler will display
display a warning. a warning.
By enabling this option, this warning is turned into an By enabling this option, this warning is turned into an error,
error, which will completely abort the build when such which will completely abort the build when such unsafe paths
unsafe paths are encountered. are encountered.
Note that this mechanism is available for both the internal Note that this mechanism is available for both the internal
toolchain (through the toolchain wrapper and binutils patches) toolchain (through the toolchain wrapper and binutils patches)
and external toolchain backends (through the toolchain wrapper). and external toolchain backends (through the toolchain wrapper).
config BR2_REPRODUCIBLE
bool "Make the build reproducible (experimental)"
help
This option will remove all sources of non-reproducibility
from the build process. For a given Buildroot configuration,
this allows to generate exactly identical binaries from one
build to the other, including on different machines.
The current implementation is restricted to builds with the
same output directory. Many (absolute) paths are recorded in
intermediary files, and it is very likely that some of these
paths leak into the target rootfs. If you build with the
same O=... path, however, the result is identical.
This is labeled as an experimental feature, as not all
packages behave properly to ensure reproducibility.
endmenu endmenu
endmenu endmenu
@ -717,9 +743,4 @@ source "package/Config.in.host"
source "Config.in.legacy" source "Config.in.legacy"
menu "User-provided options" source "$BR2_BUILD_DIR/.br2-external.in"
depends on BR2_EXTERNAL != "support/dummy-external"
source "$BR2_EXTERNAL/Config.in"
endmenu

View File

@ -142,6 +142,402 @@ comment "build, or run, in unpredictable ways. "
comment "----------------------------------------------------" comment "----------------------------------------------------"
endif endif
###############################################################################
comment "Legacy options removed in 2017.02"
config BR2_PACKAGE_PERL_DB_FILE
bool "perl-db-file removed"
select BR2_LEGACY
select BR2_PACKAGE_BERKELEYDB
select BR2_PACKAGE_PERL
help
DB_File can be built as a core Perl module, so the separate
perl-db-file package has been removed.
config BR2_KERNEL_HEADERS_4_7
bool "kernel headers version 4.7.x are no longer supported"
select BR2_KERNEL_HEADERS_4_4
select BR2_LEGACY
help
Version 4.7.x of the Linux kernel headers are no longer
maintained upstream and are now removed. As an alternative,
version 4.4.x of the headers have been automatically
selected in your configuration.
config BR2_KERNEL_HEADERS_4_6
bool "kernel headers version 4.6.x are no longer supported"
select BR2_KERNEL_HEADERS_4_4
select BR2_LEGACY
help
Version 4.6.x of the Linux kernel headers are no longer
maintained upstream and are now removed. As an alternative,
version 4.4.x of the headers have been automatically
selected in your configuration.
config BR2_KERNEL_HEADERS_4_5
bool "kernel headers version 4.5.x are no longer supported"
select BR2_KERNEL_HEADERS_4_4
select BR2_LEGACY
help
Version 4.5.x of the Linux kernel headers are no longer
maintained upstream and are now removed. As an alternative,
version 4.4.x of the headers have been automatically
selected in your configuration.
config BR2_KERNEL_HEADERS_3_14
bool "kernel headers version 3.14.x are no longer supported"
select BR2_KERNEL_HEADERS_3_12
select BR2_LEGACY
help
Version 3.14.x of the Linux kernel headers are no longer
maintained upstream and are now removed. As an alternative,
version 3.12.x of the headers have been automatically
selected in your configuration.
config BR2_TOOLCHAIN_EXTERNAL_MUSL_CROSS
bool "musl-cross 1.1.12 toolchain removed"
select BR2_LEGACY
help
The support for the prebuilt toolchain based on the Musl C
library provided by the musl-cross project has been removed.
Upstream doesn't provide any prebuilt toolchain anymore, use the
Buildroot toolchain instead.
config BR2_UCLIBC_INSTALL_TEST_SUITE
bool "uClibc tests now in uclibc-ng-test"
select BR2_LEGACY
select BR2_PACKAGE_UCLIBC_NG_TEST
help
The test suite of the uClibc C library has been moved into a
separate package, uclibc-ng-test.
config BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX
bool "Blackfin.uclinux.org 2014R1 toolchain removed"
select BR2_LEGACY
help
The ADI Blackfin toolchain has many bugs which are fixed in
more recent gcc and uClibc-ng releases. Use the Buildroot
toolchain instead.
config BR2_PACKAGE_MAKEDEVS
bool "makedevs removed"
select BR2_LEGACY
help
The makedevs tool is part of busybox. The Buildroot fork
should not be used outside of the Buildroot infrastructure.
config BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV7A
bool "Arago ARMv7 2011.09 removed"
select BR2_LEGACY
help
The Arago toolchains are every old and not updated anymore.
config BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV5TE
bool "Arago ARMv5 2011.09 removed"
select BR2_LEGACY
help
The Arago toolchains are every old and not updated anymore.
config BR2_PACKAGE_SNOWBALL_HDMISERVICE
bool "snowball-hdmiservice removed"
select BR2_LEGACY
help
We no longer have support for the Snowball platform in
Buildroot, so this package was no longer useful.
config BR2_PACKAGE_SNOWBALL_INIT
bool "snowball-init removed"
select BR2_LEGACY
help
We no longer have support for the Snowball platform in
Buildroot, so this package was no longer useful.
config BR2_GDB_VERSION_7_9
bool "gdb 7.9 has been removed"
select BR2_LEGACY
help
The 7.9 version of gdb has been removed. Use a newer version
instead.
###############################################################################
comment "Legacy options removed in 2016.11"
config BR2_PACKAGE_PHP_SAPI_CLI_CGI
bool "PHP CGI and CLI options are now seperate"
select BR2_PACKAGE_PHP_SAPI_CLI
select BR2_PACKAGE_PHP_SAPI_CGI
select BR2_LEGACY
help
The PHP Interface options have been split up into a
separate option for each interface.
config BR2_PACKAGE_PHP_SAPI_CLI_FPM
bool "PHP CLI and FPM options are now separate"
select BR2_PACKAGE_PHP_SAPI_CLI
select BR2_PACKAGE_PHP_SAPI_FPM
select BR2_LEGACY
help
The PHP Interface options have been split up into a
separate option for each interface.
config BR2_PACKAGE_WVSTREAMS
bool "wvstreams removed"
select BR2_LEGACY
help
wvstreams is not maintained anymore since about 2009. It also
doesn't build anymore with recent compilers (GCC 5+).
config BR2_PACKAGE_WVDIAL
bool "wvdial removed"
select BR2_LEGACY
help
wvdial is not maintained anymore since about 2009. It also
doesn't build anymore with recent compilers (GCC 5+).
config BR2_PACKAGE_WEBKITGTK24
bool "webkitgtk 2.4.x removed"
select BR2_LEGACY
help
This legacy package only existed because some other packages
depended on that specific version of webkitgtk. However, the
other packages have been fixed. webkitgtk 2.4 is full of
security issues so it needs to be removed.
config BR2_PACKAGE_TORSMO
bool "torsmo removed"
select BR2_LEGACY
help
torsmo has been unmaintained for a long time, and nobody
seems to be interested in it.
config BR2_PACKAGE_SSTRIP
bool "sstrip removed"
select BR2_LEGACY
help
sstrip is unmaintained and potentially harmful. It doesn't
save so much compared to normal binutils strip, and there is
a big risk of binaries that don't work. Use normal strip
instead.
config BR2_KERNEL_HEADERS_4_3
bool "kernel headers version 4.3.x are no longer supported"
select BR2_KERNEL_HEADERS_4_1
select BR2_LEGACY
help
Version 4.3.x of the Linux kernel headers are no longer
maintained upstream and are now removed. As an alternative,
version 4.1.x of the headers have been automatically
selected in your configuration.
config BR2_KERNEL_HEADERS_4_2
bool "kernel headers version 4.2.x are no longer supported"
select BR2_KERNEL_HEADERS_4_1
select BR2_LEGACY
help
Version 4.2.x of the Linux kernel headers are no longer
maintained upstream and are now removed. As an alternative,
version 4.1.x of the headers have been automatically
selected in your configuration.
config BR2_PACKAGE_KODI_ADDON_XVDR
bool "kodi-addon-xvdr removed"
select BR2_LEGACY
help
According to the github project page:
https://github.com/pipelka/xbmc-addon-xvdr
this package is discontinued.
config BR2_PACKAGE_IPKG
bool "ipkg removed"
select BR2_LEGACY
help
ipkg dates back to the early 2000s when Compaq started the
handhelds.org project and it hasn't seen development since 2006.
Use opkg as a replacement.
config BR2_GCC_VERSION_4_7_X
bool "gcc 4.7.x support removed"
select BR2_LEGACY
help
Support for gcc version 4.7.x has been removed. The current
default version (4.9.x or later) has been selected instead.
config BR2_BINUTILS_VERSION_2_24_X
bool "binutils version 2.24 support removed"
select BR2_LEGACY
help
Support for binutils version 2.24 has been removed. The
current default version (2.26 or later) has been selected
instead.
config BR2_PACKAGE_WESTON_RPI
bool "Weston propietary RPI support is gone"
select BR2_LEGACY
help
Upstream decided the propietary (rpi-userland) weston composer
support wasn't worth the effort so it was removed. Switch to
the open VC4 support.
config BR2_LINUX_KERNEL_TOOL_CPUPOWER
bool "linux-tool cpupower"
depends on BR2_LINUX_KERNEL
select BR2_LEGACY
select BR2_PACKAGE_LINUX_TOOLS_CPUPOWER
help
Linux tool cpupower option was renamed.
config BR2_LINUX_KERNEL_TOOL_PERF
bool "linux-tool perf"
depends on BR2_LINUX_KERNEL
select BR2_LEGACY
select BR2_PACKAGE_LINUX_TOOLS_PERF
help
Linux tool perf option was renamed.
config BR2_LINUX_KERNEL_TOOL_SELFTESTS
bool "linux-tool selftests"
depends on BR2_LINUX_KERNEL
select BR2_LEGACY
select BR2_PACKAGE_LINUX_TOOLS_SELFTESTS
help
Linux tool selftests option was renamed.
config BR2_GCC_VERSION_4_8_ARC
bool "gcc arc option renamed"
select BR2_LEGACY
select BR2_GCC_VERSION_ARC
help
The option that selects the gcc version for the ARC
architecture has been renamed to BR2_GCC_VERSION_ARC.
config BR2_KERNEL_HEADERS_4_0
bool "kernel headers version 4.0.x are no longer supported"
select BR2_KERNEL_HEADERS_3_18
select BR2_LEGACY
help
Version 4.0.x of the Linux kernel headers have been deprecated
for more than four buildroot releases and are now removed.
As an alternative, version 3.18.x of the headers have been
automatically selected in your configuration.
config BR2_KERNEL_HEADERS_3_19
bool "kernel headers version 3.19.x are no longer supported"
select BR2_KERNEL_HEADERS_3_18
select BR2_LEGACY
help
Version 3.19.x of the Linux kernel headers have been deprecated
for more than four buildroot releases and are now removed.
As an alternative, version 3.18.x of the headers have been
automatically selected in your configuration.
config BR2_PACKAGE_LIBEVAS_GENERIC_LOADERS
bool "libevas-generic-loaders package removed"
select BR2_LEGACY
select BR2_PACKAGE_EFL
help
With EFL 1.18, libevas-generic-loaders is now provided by the efl
package.
config BR2_PACKAGE_ELEMENTARY
bool "elementary package removed"
select BR2_LEGACY
select BR2_PACKAGE_EFL
help
With EFL 1.18, elementary is now provided by the efl package.
config BR2_LINUX_KERNEL_CUSTOM_LOCAL
bool "Linux kernel local directory option removed"
help
The option to select a local directory as the source of the Linux
kernel has been removed. It hurts reproducibility of builds.
In case you were using this option during development of your
Linux kernel, use the override mechanism instead.
###############################################################################
comment "Legacy options removed in 2016.08"
config BR2_PACKAGE_SYSTEMD_COMPAT
bool "systemd compatibility libraries have been removed"
select BR2_LEGACY
help
The systemd option to enable the compatibility libraries has
been removed. Theses libraries have been useless since a few
version, and have been fully dropped from the source since
v230.
config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_LIVEADDER
bool "gst1-plugins-bad liveadder plugin removed"
select BR2_LEGACY
select BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_AUDIOMIXER
help
The functionality of the liveadder plugin of the
gst1-plugins-bad package has been merged into audiomixer.
config BR2_PACKAGE_LIBFSLVPUWRAP
bool "libfslvpuwrap has been renamed to imx-vpuwrap"
select BR2_LEGACY
select BR2_PACKAGE_IMX_VPUWRAP
help
The libfslvpuwrap has been renamed to match the renamed package.
config BR2_PACKAGE_LIBFSLPARSER
bool "libfslparser has been renamed to imx-parser"
select BR2_LEGACY
select BR2_PACKAGE_IMX_PARSER
help
The libfslparser has been renamed to match the renamed package.
config BR2_PACKAGE_LIBFSLCODEC
bool "libfslcodec has been renamed to imx-codec"
select BR2_LEGACY
select BR2_PACKAGE_IMX_CODEC
help
The libfslcodec has been renamed to match the renamed package.
config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
bool "FIT support in uboot-tools has been refactored"
select BR2_LEGACY
select BR2_PACKAGE_DTC
select BR2_PACKAGE_DTC_PROGRAMS
select BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
select BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
select BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
help
This option has been removed in favor of a more fine-grained
configuration, which is recommended. Selecting this option
enables FIT and FIT signature support for the target packages.
It will also select the dtc and openssl packages.
config BR2_PTHREADS_OLD
bool "linuxthreads (stable/old)"
select BR2_LEGACY
help
Linuxthreads have been reworked, BR2_PTHREADS_OLD is now
BR2_PTHREADS and the old BR2_PTHREADS - LT.new got removed.
config BR2_BINUTILS_VERSION_2_23_X
bool "binutils 2.23 removed"
select BR2_LEGACY
help
Binutils 2.23 has been removed, using a newer version is
recommended.
config BR2_TOOLCHAIN_BUILDROOT_EGLIBC
bool "eglibc support has been removed"
select BR2_LEGACY
help
The eglibc project no longer exists, as it has been merged
back into the glibc project. Therefore, support for eglibc
has been removed, and glibc should be used instead.
config BR2_GDB_VERSION_7_8
bool "gdb 7.8 has been removed"
select BR2_LEGACY
help
The 7.8 version of gdb has been removed. Use a newer version
instead.
############################################################################### ###############################################################################
comment "Legacy options removed in 2016.05" comment "Legacy options removed in 2016.05"
@ -220,12 +616,19 @@ config BR2_PACKAGE_QT5QUICK1
from upstream starting from Qt 5.6. from upstream starting from Qt 5.6.
config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR
bool "uboot custom patch dir removed" string "uboot custom patch dir has been removed"
select BR2_LEGACY
help help
The uboot custom patch directory option has been removed. Use The uboot custom patch directory option has been removed. Use
the improved BR2_TARGET_UBOOT_PATCH option instead. the improved BR2_TARGET_UBOOT_PATCH option instead.
config BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR_WRAP
bool
default y if BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR != ""
select BR2_LEGACY
# Note: BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR is still referenced from
# boot/uboot/Config.in
config BR2_PACKAGE_XDRIVER_XF86_INPUT_VOID config BR2_PACKAGE_XDRIVER_XF86_INPUT_VOID
bool "xf86-input-void removed" bool "xf86-input-void removed"
select BR2_LEGACY select BR2_LEGACY
@ -235,12 +638,12 @@ config BR2_PACKAGE_XDRIVER_XF86_INPUT_VOID
config BR2_KERNEL_HEADERS_3_17 config BR2_KERNEL_HEADERS_3_17
bool "kernel headers version 3.17.x are no longer supported" bool "kernel headers version 3.17.x are no longer supported"
select BR2_KERNEL_HEADERS_3_18 select BR2_KERNEL_HEADERS_3_12
select BR2_LEGACY select BR2_LEGACY
help help
Version 3.17.x of the Linux kernel headers have been deprecated Version 3.17.x of the Linux kernel headers have been deprecated
for more than four buildroot releases and are now removed. for more than four buildroot releases and are now removed.
As an alternative, version 3.18.x of the headers have been As an alternative, version 3.12.x of the headers have been
automatically selected in your configuration. automatically selected in your configuration.
config BR2_GDB_VERSION_7_7 config BR2_GDB_VERSION_7_7
@ -302,7 +705,7 @@ config BR2_GCC_VERSION_4_5_X
version instead. version instead.
config BR2_PACKAGE_SQLITE_READLINE config BR2_PACKAGE_SQLITE_READLINE
bool "command-line editing support was updated" bool "sqlite command-line editing support was updated"
select BR2_PACKAGE_NCURSES select BR2_PACKAGE_NCURSES
select BR2_PACKAGE_READLINE select BR2_PACKAGE_READLINE
select BR2_LEGACY select BR2_LEGACY
@ -336,7 +739,7 @@ config BR2_PACKAGE_E2FSPROGS_FINDFS
This option attempted to enable findfs capabilities from This option attempted to enable findfs capabilities from
e2fsprogs but has not worked since July 2015 (due to e2fsprogs but has not worked since July 2015 (due to
packaging changes). One can use BusyBox's findfs support or packaging changes). One can use BusyBox's findfs support or
enable the BR2_PACKAGE_UTIL_LINUX_FINDFS option. enable the BR2_PACKAGE_UTIL_LINUX_BINARIES option.
config BR2_PACKAGE_OPENPOWERLINK_DEBUG_LEVEL config BR2_PACKAGE_OPENPOWERLINK_DEBUG_LEVEL
bool "openpowerlink debug option has been removed" bool "openpowerlink debug option has been removed"
@ -381,12 +784,12 @@ config BR2_PACKAGE_CUPS_PDFTOPS
config BR2_KERNEL_HEADERS_3_16 config BR2_KERNEL_HEADERS_3_16
bool "kernel headers version 3.16.x are no longer supported" bool "kernel headers version 3.16.x are no longer supported"
select BR2_KERNEL_HEADERS_3_18 select BR2_KERNEL_HEADERS_3_12
select BR2_LEGACY select BR2_LEGACY
help help
Version 3.16.x of the Linux kernel headers have been deprecated Version 3.16.x of the Linux kernel headers have been deprecated
for more than four buildroot releases and are now removed. for more than four buildroot releases and are now removed.
As an alternative, version 3.18.x of the headers have been As an alternative, version 3.12.x of the headers have been
automatically selected in your configuration. automatically selected in your configuration.
config BR2_PACKAGE_PYTHON_PYXML config BR2_PACKAGE_PYTHON_PYXML
@ -597,32 +1000,32 @@ config BR2_KERNEL_HEADERS_3_0
config BR2_KERNEL_HEADERS_3_11 config BR2_KERNEL_HEADERS_3_11
bool "kernel headers version 3.11.x are no longer supported" bool "kernel headers version 3.11.x are no longer supported"
select BR2_KERNEL_HEADERS_3_12 select BR2_KERNEL_HEADERS_3_10
select BR2_LEGACY select BR2_LEGACY
help help
Version 3.11.x of the Linux kernel headers have been deprecated Version 3.11.x of the Linux kernel headers have been deprecated
for more than four buildroot releases and are now removed. for more than four buildroot releases and are now removed.
As an alternative, version 3.12.x of the headers have been As an alternative, version 3.10.x of the headers have been
automatically selected in your configuration. automatically selected in your configuration.
config BR2_KERNEL_HEADERS_3_13 config BR2_KERNEL_HEADERS_3_13
bool "kernel headers version 3.13.x are no longer supported" bool "kernel headers version 3.13.x are no longer supported"
select BR2_KERNEL_HEADERS_3_14 select BR2_KERNEL_HEADERS_3_12
select BR2_LEGACY select BR2_LEGACY
help help
Version 3.13.x of the Linux kernel headers have been deprecated Version 3.13.x of the Linux kernel headers have been deprecated
for more than four buildroot releases and are now removed. for more than four buildroot releases and are now removed.
As an alternative, version 3.14.x of the headers have been As an alternative, version 3.12.x of the headers have been
automatically selected in your configuration. automatically selected in your configuration.
config BR2_KERNEL_HEADERS_3_15 config BR2_KERNEL_HEADERS_3_15
bool "kernel headers version 3.15.x are no longer supported" bool "kernel headers version 3.15.x are no longer supported"
select BR2_KERNEL_HEADERS_3_18 select BR2_KERNEL_HEADERS_3_12
select BR2_LEGACY select BR2_LEGACY
help help
Version 3.15.x of the Linux kernel headers have been deprecated Version 3.15.x of the Linux kernel headers have been deprecated
for more than four buildroot releases and are now removed. for more than four buildroot releases and are now removed.
As an alternative, version 3.18.x of the headers have been As an alternative, version 3.12.x of the headers have been
automatically selected in your configuration. automatically selected in your configuration.
config BR2_PACKAGE_DIRECTFB_EXAMPLES_ANDI config BR2_PACKAGE_DIRECTFB_EXAMPLES_ANDI
@ -913,11 +1316,9 @@ config BR2_PACKAGE_KODI_PVR_ADDONS
config BR2_BINUTILS_VERSION_2_23_2 config BR2_BINUTILS_VERSION_2_23_2
bool "binutils 2.23 option renamed" bool "binutils 2.23 option renamed"
select BR2_LEGACY select BR2_LEGACY
select BR2_BINUTILS_VERSION_2_23_X
help help
The binutils version option has been renamed to match the Binutils 2.23.2 has been removed, using a newer version is
same patchlevel logic used by gcc. The new option is now recommended.
BR2_BINUTILS_VERSION_2_23_X.
config BR2_BINUTILS_VERSION_2_24 config BR2_BINUTILS_VERSION_2_24
bool "binutils 2.24 option renamed" bool "binutils 2.24 option renamed"
@ -1174,11 +1575,12 @@ config BR2_PACKAGE_STRONGSWAN_TOOLS
deprecated. deprecated.
config BR2_PACKAGE_XBMC_ADDON_XVDR config BR2_PACKAGE_XBMC_ADDON_XVDR
bool "xbmc options have been renamed" bool "xbmc-addon-xvdr removed"
select BR2_LEGACY select BR2_LEGACY
select BR2_PACKAGE_KODI_ADDON_XVDR
help help
The XBMC media center project was renamed to Kodi entertainment center According to the github project page:
https://github.com/pipelka/xbmc-addon-xvdr
this package is discontinued.
config BR2_PACKAGE_XBMC_PVR_ADDONS config BR2_PACKAGE_XBMC_PVR_ADDONS
bool "xbmc options have been renamed" bool "xbmc options have been renamed"
@ -1430,12 +1832,12 @@ config BR2_PACKAGE_LIBELF
config BR2_KERNEL_HEADERS_3_8 config BR2_KERNEL_HEADERS_3_8
bool "kernel headers version 3.8.x are no longer supported" bool "kernel headers version 3.8.x are no longer supported"
select BR2_KERNEL_HEADERS_3_10 select BR2_KERNEL_HEADERS_3_4
select BR2_LEGACY select BR2_LEGACY
help help
Version 3.8.x of the Linux kernel headers have been deprecated Version 3.8.x of the Linux kernel headers have been deprecated
for more than four buildroot releases and are now removed. for more than four buildroot releases and are now removed.
As an alternative, version 3.10.x of the headers have been As an alternative, version 3.4.x of the headers have been
automatically selected in your configuration. automatically selected in your configuration.
config BR2_PACKAGE_GETTEXT_TOOLS config BR2_PACKAGE_GETTEXT_TOOLS
@ -1588,22 +1990,22 @@ config BR2_PACKAGE_EVTEST_CAPTURE
config BR2_KERNEL_HEADERS_3_6 config BR2_KERNEL_HEADERS_3_6
bool "kernel headers version 3.6.x are no longer supported" bool "kernel headers version 3.6.x are no longer supported"
select BR2_KERNEL_HEADERS_3_10 select BR2_KERNEL_HEADERS_3_4
select BR2_LEGACY select BR2_LEGACY
help help
Version 3.6.x of the Linux kernel headers have been deprecated Version 3.6.x of the Linux kernel headers have been deprecated
for more than four buildroot releases and are now removed. for more than four buildroot releases and are now removed.
As an alternative, version 3.10.x of the headers have been As an alternative, version 3.4.x of the headers have been
automatically selected in your configuration. automatically selected in your configuration.
config BR2_KERNEL_HEADERS_3_7 config BR2_KERNEL_HEADERS_3_7
bool "kernel headers version 3.7.x are no longer supported" bool "kernel headers version 3.7.x are no longer supported"
select BR2_KERNEL_HEADERS_3_10 select BR2_KERNEL_HEADERS_3_4
select BR2_LEGACY select BR2_LEGACY
help help
Version 3.7.x of the Linux kernel headers have been deprecated Version 3.7.x of the Linux kernel headers have been deprecated
for more than four buildroot releases and are now removed. for more than four buildroot releases and are now removed.
As an alternative, version 3.10.x of the headers have been As an alternative, version 3.4.x of the headers have been
automatically selected in your configuration. automatically selected in your configuration.
config BR2_PACKAGE_VALA config BR2_PACKAGE_VALA
@ -1776,22 +2178,22 @@ config BR2_KERNEL_HEADERS_3_1
config BR2_KERNEL_HEADERS_3_3 config BR2_KERNEL_HEADERS_3_3
bool "kernel headers version 3.3.x are no longer supported" bool "kernel headers version 3.3.x are no longer supported"
select BR2_KERNEL_HEADERS_3_4 select BR2_KERNEL_HEADERS_3_2
select BR2_LEGACY select BR2_LEGACY
help help
Version 3.3.x of the Linux kernel headers have been deprecated Version 3.3.x of the Linux kernel headers have been deprecated
for more than four buildroot releases and are now removed. for more than four buildroot releases and are now removed.
As an alternative, version 3.4.x of the headers have been As an alternative, version 3.2.x of the headers have been
automatically selected in your configuration. automatically selected in your configuration.
config BR2_KERNEL_HEADERS_3_5 config BR2_KERNEL_HEADERS_3_5
bool "kernel headers version 3.5.x are no longer supported" bool "kernel headers version 3.5.x are no longer supported"
select BR2_KERNEL_HEADERS_3_10 select BR2_KERNEL_HEADERS_3_4
select BR2_LEGACY select BR2_LEGACY
help help
Version 3.5.x of the Linux kernel headers have been deprecated Version 3.5.x of the Linux kernel headers have been deprecated
for more than four buildroot releases and are now removed. for more than four buildroot releases and are now removed.
As an alternative, version 3.10.x of the headers have been As an alternative, version 3.4.x of the headers have been
automatically selected in your configuration. automatically selected in your configuration.
config BR2_GDB_VERSION_7_2 config BR2_GDB_VERSION_7_2

343
Makefile
View File

@ -2,7 +2,7 @@
# #
# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org> # Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
# Copyright (C) 2006-2014 by the Buildroot developers <buildroot@uclibc.org> # Copyright (C) 2006-2014 by the Buildroot developers <buildroot@uclibc.org>
# Copyright (C) 2014-2016 by the Buildroot developers <buildroot@buildroot.org> # Copyright (C) 2014-2017 by the Buildroot developers <buildroot@buildroot.org>
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -24,24 +24,71 @@
# You shouldn't need to mess with anything beyond this point... # You shouldn't need to mess with anything beyond this point...
#-------------------------------------------------------------- #--------------------------------------------------------------
# Trick for always running with a fixed umask # Delete default rules. We don't use them. This saves a bit of time.
UMASK = 0022 .SUFFIXES:
ifneq ($(shell umask),$(UMASK))
# we want bash as shell
SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi; fi)
# Set O variable if not already done on the command line;
# or avoid confusing packages that can use the O=<dir> syntax for out-of-tree
# build by preventing it from being forwarded to sub-make calls.
ifneq ("$(origin O)", "command line")
O := $(CURDIR)/output
endif
# Check if the current Buildroot execution meets all the pre-requisites.
# If they are not met, Buildroot will actually do its job in a sub-make meeting
# its pre-requisites, which are:
# 1- Permissive enough umask:
# Wrong or too restrictive umask will prevent Buildroot and packages from
# creating files and directories.
# 2- Absolute canonical CWD (i.e. $(CURDIR)):
# Otherwise, some packages will use CWD as-is, others will compute its
# absolute canonical path. This makes harder tracking and fixing host
# machine path leaks.
# 3- Absolute canonical output location (i.e. $(O)):
# For the same reason as the one for CWD.
# Remove the trailing '/.' from $(O) as it can be added by the makefile wrapper
# installed in the $(O) directory.
# Also remove the trailing '/' the user can set when on the command line.
override O := $(patsubst %/,%,$(patsubst %.,%,$(O)))
# Make sure $(O) actually exists before calling realpath on it; this is to
# avoid empty CANONICAL_O in case on non-existing entry.
CANONICAL_O := $(shell mkdir -p $(O) >/dev/null 2>&1)$(realpath $(O))
CANONICAL_CURDIR = $(realpath $(CURDIR))
REQ_UMASK = 0022
# Make sure O= is passed (with its absolute canonical path) everywhere the
# toplevel makefile is called back.
EXTRAMAKEARGS := O=$(CANONICAL_O)
# Check Buildroot execution pre-requisites here.
ifneq ($(shell umask):$(CURDIR):$(O),$(REQ_UMASK):$(CANONICAL_CURDIR):$(CANONICAL_O))
.PHONY: _all $(MAKECMDGOALS) .PHONY: _all $(MAKECMDGOALS)
$(MAKECMDGOALS): _all $(MAKECMDGOALS): _all
@: @:
_all: _all:
@umask $(UMASK) && $(MAKE) --no-print-directory $(MAKECMDGOALS) @umask $(REQ_UMASK) && \
$(MAKE) -C $(CANONICAL_CURDIR) --no-print-directory \
$(MAKECMDGOALS) $(EXTRAMAKEARGS)
else # umask else # umask / $(CURDIR) / $(O)
# This is our default rule, so must come first # This is our default rule, so must come first
all: all:
# Set and export the version string # Set and export the version string
export BR2_VERSION := 2016.05 export BR2_VERSION := 2017.02-rc1
# Actual time the release is cut (for reproducible builds)
BR2_VERSION_EPOCH = 1486825200
# Save running make version since it's clobbered by the make package # Save running make version since it's clobbered by the make package
RUNNING_MAKE_VERSION := $(MAKE_VERSION) RUNNING_MAKE_VERSION := $(MAKE_VERSION)
@ -81,7 +128,8 @@ export BR2_VERSION_FULL := $(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlo
noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconfig \ noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconfig \
defconfig %_defconfig allyesconfig allnoconfig silentoldconfig release \ defconfig %_defconfig allyesconfig allnoconfig silentoldconfig release \
randpackageconfig allyespackageconfig allnopackageconfig \ randpackageconfig allyespackageconfig allnopackageconfig \
print-version olddefconfig print-version olddefconfig distclean manual manual-html manual-split-html \
manual-pdf manual-text manual-epub
# Some global targets do not trigger a build, but are used to collect # Some global targets do not trigger a build, but are used to collect
# metadata, or do various checks. When such targets are triggered, # metadata, or do various checks. When such targets are triggered,
@ -92,80 +140,63 @@ noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconf
# We're building in two situations: when MAKECMDGOALS is empty # We're building in two situations: when MAKECMDGOALS is empty
# (default target is to build), or when MAKECMDGOALS contains # (default target is to build), or when MAKECMDGOALS contains
# something else than one of the nobuild_targets. # something else than one of the nobuild_targets.
nobuild_targets := source source-check \ nobuild_targets := source %-source source-check \
legal-info external-deps _external-deps \ legal-info %-legal-info external-deps _external-deps \
clean distclean help clean distclean help show-targets graph-depends \
%-graph-depends %-show-depends %-show-version \
graph-build graph-size list-defconfigs \
savedefconfig printvars
ifeq ($(MAKECMDGOALS),) ifeq ($(MAKECMDGOALS),)
BR_BUILDING = y BR_BUILDING = y
else ifneq ($(filter-out $(nobuild_targets),$(MAKECMDGOALS)),) else ifneq ($(filter-out $(nobuild_targets),$(MAKECMDGOALS)),)
BR_BUILDING = y BR_BUILDING = y
endif endif
# Strip quotes and then whitespaces # We call make recursively to build packages. The command-line overrides that
qstrip = $(strip $(subst ",,$(1))) # are passed to Buildroot don't apply to those package build systems. In
#")) # particular, we don't want to pass down the O=<dir> option for out-of-tree
# builds, because the value specified on the command line will not be correct
# for packages.
MAKEOVERRIDES :=
# Variables for use in Make constructs # Include some helper macros and variables
comma := , include support/misc/utils.mk
empty :=
space := $(empty) $(empty)
ifneq ("$(origin O)", "command line") # Set variables related to in-tree or out-of-tree build.
O := output # Here, both $(O) and $(CURDIR) are absolute canonical paths.
CONFIG_DIR := $(TOPDIR) ifeq ($(O),$(CURDIR)/output)
CONFIG_DIR := $(CURDIR)
NEED_WRAPPER = NEED_WRAPPER =
else else
# other packages might also support Linux-style out of tree builds
# with the O=<dir> syntax (E.G. BusyBox does). As make automatically
# forwards command line variable definitions those packages get very
# confused. Fix this by telling make to not do so
MAKEOVERRIDES =
# strangely enough O is still passed to submakes with MAKEOVERRIDES
# (with make 3.81 atleast), the only thing that changes is the output
# of the origin function (command line -> environment).
# Unfortunately some packages don't look at origin (E.G. uClibc 0.9.31+)
# To really make O go away, we have to override it.
override O := $(O)
CONFIG_DIR := $(O) CONFIG_DIR := $(O)
# we need to pass O= everywhere we call back into the toplevel makefile
EXTRAMAKEARGS = O=$(O)
NEED_WRAPPER = y NEED_WRAPPER = y
endif endif
# bash prints the name of the directory on 'cd <dir>' if CDPATH is # bash prints the name of the directory on 'cd <dir>' if CDPATH is
# set, so unset it here to not cause problems. Notice that the export # set, so unset it here to not cause problems. Notice that the export
# line doesn't affect the environment of $(shell ..) calls, so # line doesn't affect the environment of $(shell ..) calls.
# explictly throw away any output from 'cd' here.
export CDPATH := export CDPATH :=
BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd)
BASE_DIR := $(CANONICAL_O)
$(if $(BASE_DIR),, $(error output directory "$(O)" does not exist)) $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
# Handling of BR2_EXTERNAL. # Handling of BR2_EXTERNAL.
# #
# The value of BR2_EXTERNAL is stored in .br-external in the output directory. # The value of BR2_EXTERNAL is stored in .br-external in the output directory.
# On subsequent invocations of make, it is read in. It can still be overridden # The location of the external.mk makefile fragments is computed in that file.
# on the command line, therefore the file is re-created every time make is run. # On subsequent invocations of make, this file is read in. BR2_EXTERNAL can
# # still be overridden on the command line, therefore the file is re-created
# When BR2_EXTERNAL is set to an empty value (e.g. explicitly in command # every time make is run.
# line), the .br-external file is removed and we point to
# support/dummy-external. This makes sure we can unconditionally include the
# Config.in and external.mk from the BR2_EXTERNAL directory. In this case,
# override is necessary so the user can clear BR2_EXTERNAL from the command
# line, but the dummy path is still used internally.
BR2_EXTERNAL_FILE = $(BASE_DIR)/.br-external BR2_EXTERNAL_FILE = $(BASE_DIR)/.br-external.mk
-include $(BR2_EXTERNAL_FILE) -include $(BR2_EXTERNAL_FILE)
ifeq ($(BR2_EXTERNAL),) $(shell support/scripts/br2-external \
override BR2_EXTERNAL = support/dummy-external -m -o '$(BR2_EXTERNAL_FILE)' $(BR2_EXTERNAL))
$(shell rm -f $(BR2_EXTERNAL_FILE)) BR2_EXTERNAL_ERROR =
else include $(BR2_EXTERNAL_FILE)
_BR2_EXTERNAL = $(shell cd $(BR2_EXTERNAL) >/dev/null 2>&1 && pwd) ifneq ($(BR2_EXTERNAL_ERROR),)
ifeq ($(_BR2_EXTERNAL),) $(error $(BR2_EXTERNAL_ERROR))
$(error BR2_EXTERNAL='$(BR2_EXTERNAL)' does not exist, relative to $(TOPDIR))
endif
override BR2_EXTERNAL := $(_BR2_EXTERNAL)
$(shell echo BR2_EXTERNAL ?= $(BR2_EXTERNAL) > $(BR2_EXTERNAL_FILE))
endif endif
# To make sure that the environment variable overrides the .config option, # To make sure that the environment variable overrides the .config option,
@ -196,11 +227,18 @@ LICENSE_FILES_DIR_TARGET = $(LEGAL_INFO_DIR)/licenses
LICENSE_FILES_DIR_HOST = $(LEGAL_INFO_DIR)/host-licenses LICENSE_FILES_DIR_HOST = $(LEGAL_INFO_DIR)/host-licenses
LEGAL_MANIFEST_CSV_TARGET = $(LEGAL_INFO_DIR)/manifest.csv LEGAL_MANIFEST_CSV_TARGET = $(LEGAL_INFO_DIR)/manifest.csv
LEGAL_MANIFEST_CSV_HOST = $(LEGAL_INFO_DIR)/host-manifest.csv LEGAL_MANIFEST_CSV_HOST = $(LEGAL_INFO_DIR)/host-manifest.csv
LEGAL_LICENSES_TXT_TARGET = $(LEGAL_INFO_DIR)/licenses.txt
LEGAL_LICENSES_TXT_HOST = $(LEGAL_INFO_DIR)/host-licenses.txt
LEGAL_WARNINGS = $(LEGAL_INFO_DIR)/.warnings LEGAL_WARNINGS = $(LEGAL_INFO_DIR)/.warnings
LEGAL_REPORT = $(LEGAL_INFO_DIR)/README LEGAL_REPORT = $(LEGAL_INFO_DIR)/README
################################################################################
#
# staging and target directories do NOT list these as
# dependencies anywhere else
#
################################################################################
$(BUILD_DIR) $(TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
@mkdir -p $@
BR2_CONFIG = $(CONFIG_DIR)/.config BR2_CONFIG = $(CONFIG_DIR)/.config
# Pull in the user's configuration file # Pull in the user's configuration file
@ -208,6 +246,17 @@ ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
-include $(BR2_CONFIG) -include $(BR2_CONFIG)
endif endif
# timezone and locale may affect build output
ifeq ($(BR2_REPRODUCIBLE),y)
export TZ = UTC
export LANG = C
export LC_ALL = C
export GZIP = -n
BR2_VERSION_GIT_EPOCH = $(shell GIT_DIR=$(TOPDIR)/.git $(GIT) log -1 --format=%at)
export SOURCE_DATE_EPOCH = $(if $(wildcard $(TOPDIR)/.git),$(BR2_VERSION_GIT_EPOCH),$(BR2_VERSION_EPOCH))
DEPENDENCIES_HOST_PREREQ += host-fakedate
endif
# To put more focus on warnings, be less verbose as default # To put more focus on warnings, be less verbose as default
# Use 'make V=1' to see the full commands # Use 'make V=1' to see the full commands
ifeq ("$(origin V)", "command line") ifeq ("$(origin V)", "command line")
@ -227,11 +276,6 @@ else
Q = @ Q = @
endif endif
# we want bash as shell
SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi; fi)
# kconfig uses CONFIG_SHELL # kconfig uses CONFIG_SHELL
CONFIG_SHELL := $(SHELL) CONFIG_SHELL := $(SHELL)
@ -279,6 +323,7 @@ HOSTLN := $(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
HOSTNM := $(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm) HOSTNM := $(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
HOSTOBJCOPY := $(shell which $(HOSTOBJCOPY) || type -p $(HOSTOBJCOPY) || echo objcopy) HOSTOBJCOPY := $(shell which $(HOSTOBJCOPY) || type -p $(HOSTOBJCOPY) || echo objcopy)
HOSTRANLIB := $(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) || echo ranlib) HOSTRANLIB := $(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) || echo ranlib)
SED := $(shell which sed || type -p sed) -i -e
export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
@ -376,6 +421,7 @@ KERNEL_ARCH := $(shell echo "$(ARCH)" | sed -e "s/-.*//" \
-e s/arm.*/arm/ -e s/sa110/arm/ \ -e s/arm.*/arm/ -e s/sa110/arm/ \
-e s/aarch64.*/arm64/ \ -e s/aarch64.*/arm64/ \
-e s/bfin/blackfin/ \ -e s/bfin/blackfin/ \
-e s/or1k/openrisc/ \
-e s/parisc64/parisc/ \ -e s/parisc64/parisc/ \
-e s/powerpc64.*/powerpc/ \ -e s/powerpc64.*/powerpc/ \
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
@ -410,6 +456,7 @@ endif
# Scripts in support/ or post-build scripts may need to reference # Scripts in support/ or post-build scripts may need to reference
# these locations, so export them so it is easier to use # these locations, so export them so it is easier to use
export BR2_CONFIG export BR2_CONFIG
export BR2_REPRODUCIBLE
export TARGET_DIR export TARGET_DIR
export STAGING_DIR export STAGING_DIR
export HOST_DIR export HOST_DIR
@ -427,9 +474,7 @@ all: world
# Include legacy before the other things, because package .mk files # Include legacy before the other things, because package .mk files
# may rely on it. # may rely on it.
ifneq ($(BR2_DEPRECATED),y)
include Makefile.legacy include Makefile.legacy
endif
include package/Makefile.in include package/Makefile.in
include support/dependencies/dependencies.mk include support/dependencies/dependencies.mk
@ -450,7 +495,15 @@ include boot/common.mk
include linux/linux.mk include linux/linux.mk
include fs/common.mk include fs/common.mk
include $(BR2_EXTERNAL)/external.mk # If using a br2-external tree, the BR2_EXTERNAL_$(NAME)_PATH variables
# are also present in the .config file. Since .config is included after
# we defined them in the Makefile, the values for those variables are
# quoted. We just include the generated Makefile fragment .br2-external.mk
# a third time, which will set those variables to the un-quoted values.
include $(BR2_EXTERNAL_FILE)
# Nothing to include if no BR2_EXTERNAL tree in use
include $(BR2_EXTERNAL_MKS)
# Now we are sure we have all the packages scanned and defined. We now # Now we are sure we have all the packages scanned and defined. We now
# check for each package in the list of enabled packages, that all its # check for each package in the list of enabled packages, that all its
@ -494,15 +547,6 @@ world: target-post-image
legal-info legal-info-prepare legal-info-clean printvars help \ legal-info legal-info-prepare legal-info-clean printvars help \
list-defconfigs target-finalize target-post-image source-check list-defconfigs target-finalize target-post-image source-check
################################################################################
#
# staging and target directories do NOT list these as
# dependencies anywhere else
#
################################################################################
$(BUILD_DIR) $(TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
@mkdir -p $@
# Populating the staging with the base directories is handled by the skeleton package # Populating the staging with the base directories is handled by the skeleton package
$(STAGING_DIR): $(STAGING_DIR):
@mkdir -p $(STAGING_DIR) @mkdir -p $(STAGING_DIR)
@ -612,7 +656,7 @@ target-finalize: $(PACKAGES)
$(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \ $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \
$(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake $(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake
find $(TARGET_DIR)/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f find $(TARGET_DIR)/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f
find $(TARGET_DIR)/lib $(TARGET_DIR)/usr/lib $(TARGET_DIR)/usr/libexec \ find $(TARGET_DIR)/lib/ $(TARGET_DIR)/usr/lib/ $(TARGET_DIR)/usr/libexec/ \
\( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
ifneq ($(BR2_PACKAGE_GDB),y) ifneq ($(BR2_PACKAGE_GDB),y)
rm -rf $(TARGET_DIR)/usr/share/gdb rm -rf $(TARGET_DIR)/usr/share/gdb
@ -627,23 +671,20 @@ endif
rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
rm -rf $(TARGET_DIR)/usr/doc $(TARGET_DIR)/usr/share/doc rm -rf $(TARGET_DIR)/usr/doc $(TARGET_DIR)/usr/share/doc
rm -rf $(TARGET_DIR)/usr/share/gtk-doc rm -rf $(TARGET_DIR)/usr/share/gtk-doc
-rmdir $(TARGET_DIR)/usr/share 2>/dev/null rmdir $(TARGET_DIR)/usr/share 2>/dev/null || true
$(STRIP_FIND_CMD) | xargs -0 $(STRIPCMD) 2>/dev/null || true $(STRIP_FIND_CMD) | xargs -0 $(STRIPCMD) 2>/dev/null || true
if test -d $(TARGET_DIR)/lib/modules; then \
find $(TARGET_DIR)/lib/modules -type f -name '*.ko' -print0 | \
xargs -0 -r $(KSTRIPCMD); fi
# See http://sourceware.org/gdb/wiki/FAQ, "GDB does not see any threads # See http://sourceware.org/gdb/wiki/FAQ, "GDB does not see any threads
# besides the one in which crash occurred; or SIGTRAP kills my program when # besides the one in which crash occurred; or SIGTRAP kills my program when
# I set a breakpoint" # I set a breakpoint"
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
find $(TARGET_DIR)/lib -type f -name 'libpthread*.so*' | \ find $(TARGET_DIR)/lib/ -type f -name 'libpthread*.so*' | \
xargs -r $(STRIPCMD) $(STRIP_STRIP_DEBUG) xargs -r $(STRIPCMD) $(STRIP_STRIP_DEBUG)
endif endif
# Valgrind needs ld.so with enough information, so only strip # Valgrind needs ld.so with enough information, so only strip
# debugging symbols. # debugging symbols.
find $(TARGET_DIR)/lib -type f -name 'ld-*.so*' | \ find $(TARGET_DIR)/lib/ -type f -name 'ld-*.so*' | \
xargs -r $(STRIPCMD) $(STRIP_STRIP_DEBUG) xargs -r $(STRIPCMD) $(STRIP_STRIP_DEBUG)
test -f $(TARGET_DIR)/etc/ld.so.conf && \ test -f $(TARGET_DIR)/etc/ld.so.conf && \
{ echo "ERROR: we shouldn't have a /etc/ld.so.conf file"; exit 1; } || true { echo "ERROR: we shouldn't have a /etc/ld.so.conf file"; exit 1; } || true
@ -701,8 +742,12 @@ legal-info: dirs legal-info-clean legal-info-prepare $(foreach p,$(PACKAGES),$(p
cat support/legal-info/README.warnings-header \ cat support/legal-info/README.warnings-header \
$(LEGAL_WARNINGS) >>$(LEGAL_REPORT); \ $(LEGAL_WARNINGS) >>$(LEGAL_REPORT); \
cat $(LEGAL_WARNINGS); fi cat $(LEGAL_WARNINGS); fi
@echo "Legal info produced in $(LEGAL_INFO_DIR)"
@rm -f $(LEGAL_WARNINGS) @rm -f $(LEGAL_WARNINGS)
@(cd $(LEGAL_INFO_DIR); \
find * -type f -exec sha256sum {} + | LC_ALL=C sort -k2 \
>.legal-info.sha256; \
mv .legal-info.sha256 legal-info.sha256)
@echo "Legal info produced in $(LEGAL_INFO_DIR)"
show-targets: show-targets:
@echo $(PACKAGES) $(TARGETS_ROOTFS) @echo $(PACKAGES) $(TARGETS_ROOTFS)
@ -726,7 +771,7 @@ graph-depends: graph-depends-requirements
@$(INSTALL) -d $(GRAPHS_DIR) @$(INSTALL) -d $(GRAPHS_DIR)
@cd "$(CONFIG_DIR)"; \ @cd "$(CONFIG_DIR)"; \
$(TOPDIR)/support/scripts/graph-depends $(BR2_GRAPH_DEPS_OPTS) \ $(TOPDIR)/support/scripts/graph-depends $(BR2_GRAPH_DEPS_OPTS) \
-o $(GRAPHS_DIR)/$(@).dot --direct -o $(GRAPHS_DIR)/$(@).dot
dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) \ dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) \
-o $(GRAPHS_DIR)/$(@).$(BR_GRAPH_OUT) \ -o $(GRAPHS_DIR)/$(@).$(BR_GRAPH_OUT) \
$(GRAPHS_DIR)/$(@).dot $(GRAPHS_DIR)/$(@).dot
@ -754,6 +799,9 @@ endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
HOSTCFLAGS = $(CFLAGS_FOR_BUILD) HOSTCFLAGS = $(CFLAGS_FOR_BUILD)
export HOSTCFLAGS export HOSTCFLAGS
.PHONY: prepare-kconfig
prepare-kconfig: outputmakefile $(BUILD_DIR)/.br2-external.in
$(BUILD_DIR)/buildroot-config/%onf: $(BUILD_DIR)/buildroot-config/%onf:
mkdir -p $(@D)/lxdialog mkdir -p $(@D)/lxdialog
PKG_CONFIG_PATH="$(HOST_PKG_CONFIG_PATH)" $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" \ PKG_CONFIG_PATH="$(HOST_PKG_CONFIG_PATH)" $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" \
@ -769,23 +817,23 @@ COMMON_CONFIG_ENV = \
KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \ KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \ KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
BR2_CONFIG=$(BR2_CONFIG) \ BR2_CONFIG=$(BR2_CONFIG) \
BR2_EXTERNAL=$(BR2_EXTERNAL) \
HOST_GCC_VERSION="$(HOSTCC_VERSION)" \ HOST_GCC_VERSION="$(HOSTCC_VERSION)" \
BUILD_DIR=$(BUILD_DIR) \
SKIP_LEGACY= SKIP_LEGACY=
xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile xconfig: $(BUILD_DIR)/buildroot-config/qconf prepare-kconfig
@$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
gconfig: $(BUILD_DIR)/buildroot-config/gconf outputmakefile gconfig: $(BUILD_DIR)/buildroot-config/gconf prepare-kconfig
@$(COMMON_CONFIG_ENV) srctree=$(TOPDIR) $< $(CONFIG_CONFIG_IN) @$(COMMON_CONFIG_ENV) srctree=$(TOPDIR) $< $(CONFIG_CONFIG_IN)
menuconfig: $(BUILD_DIR)/buildroot-config/mconf outputmakefile menuconfig: $(BUILD_DIR)/buildroot-config/mconf prepare-kconfig
@$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
nconfig: $(BUILD_DIR)/buildroot-config/nconf outputmakefile nconfig: $(BUILD_DIR)/buildroot-config/nconf prepare-kconfig
@$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
config: $(BUILD_DIR)/buildroot-config/conf outputmakefile config: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
# For the config targets that automatically select options, we pass # For the config targets that automatically select options, we pass
@ -793,22 +841,22 @@ config: $(BUILD_DIR)/buildroot-config/conf outputmakefile
# no values are set for the legacy options so a subsequent oldconfig # no values are set for the legacy options so a subsequent oldconfig
# will query them. Therefore, run an additional olddefconfig. # will query them. Therefore, run an additional olddefconfig.
oldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile oldconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@$(COMMON_CONFIG_ENV) $< --oldconfig $(CONFIG_CONFIG_IN) @$(COMMON_CONFIG_ENV) $< --oldconfig $(CONFIG_CONFIG_IN)
randconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile randconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --randconfig $(CONFIG_CONFIG_IN) @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --randconfig $(CONFIG_CONFIG_IN)
@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
allyesconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile allyesconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allyesconfig $(CONFIG_CONFIG_IN) @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allyesconfig $(CONFIG_CONFIG_IN)
@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
allnoconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile allnoconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allnoconfig $(CONFIG_CONFIG_IN) @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allnoconfig $(CONFIG_CONFIG_IN)
@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile randpackageconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg @grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \ @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \ KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
@ -816,7 +864,7 @@ randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
@rm -f $(CONFIG_DIR)/.config.nopkg @rm -f $(CONFIG_DIR)/.config.nopkg
@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg @grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \ @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \ KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
@ -824,7 +872,7 @@ allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
@rm -f $(CONFIG_DIR)/.config.nopkg @rm -f $(CONFIG_DIR)/.config.nopkg
@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg @grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \ @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \ KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
@ -832,25 +880,24 @@ allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
@rm -f $(CONFIG_DIR)/.config.nopkg @rm -f $(CONFIG_DIR)/.config.nopkg
@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile silentoldconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
$(COMMON_CONFIG_ENV) $< --silentoldconfig $(CONFIG_CONFIG_IN) $(COMMON_CONFIG_ENV) $< --silentoldconfig $(CONFIG_CONFIG_IN)
olddefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile olddefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) $(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN)
defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile defconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN) @$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN)
define percent_defconfig
# Override the BR2_DEFCONFIG from COMMON_CONFIG_ENV with the new defconfig # Override the BR2_DEFCONFIG from COMMON_CONFIG_ENV with the new defconfig
%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(1)/configs/%_defconfig prepare-kconfig
@$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(TOPDIR)/configs/$@ \ @$$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(1)/configs/$$@ \
$< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN) $$< --defconfig=$(1)/configs/$$@ $$(CONFIG_CONFIG_IN)
endef
$(eval $(foreach d,$(call reverse,$(TOPDIR) $(BR2_EXTERNAL_DIRS)),$(call percent_defconfig,$(d))$(sep)))
%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(BR2_EXTERNAL)/configs/%_defconfig outputmakefile savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(BR2_EXTERNAL)/configs/$@ \
$< --defconfig=$(BR2_EXTERNAL)/configs/$@ $(CONFIG_CONFIG_IN)
savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
@$(COMMON_CONFIG_ENV) $< \ @$(COMMON_CONFIG_ENV) $< \
--savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \ --savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
$(CONFIG_CONFIG_IN) $(CONFIG_CONFIG_IN)
@ -872,6 +919,13 @@ ifeq ($(NEED_WRAPPER),y)
$(Q)$(TOPDIR)/support/scripts/mkmakefile $(TOPDIR) $(O) $(Q)$(TOPDIR)/support/scripts/mkmakefile $(TOPDIR) $(O)
endif endif
# Even though the target is a real file, we mark it as PHONY as we
# want it to be re-generated each time make is invoked, in case the
# value of BR2_EXTERNAL is changed.
.PHONY: $(BUILD_DIR)/.br2-external.in
$(BUILD_DIR)/.br2-external.in: $(BUILD_DIR)
$(Q)support/scripts/br2-external -k -o "$(@)" $(BR2_EXTERNAL)
# printvars prints all the variables currently defined in our # printvars prints all the variables currently defined in our
# Makefiles. Alternatively, if a non-empty VARS variable is passed, # Makefiles. Alternatively, if a non-empty VARS variable is passed,
# only the variables matching the make pattern passed in VARS are # only the variables matching the make pattern passed in VARS are
@ -889,13 +943,10 @@ clean:
$(LEGAL_INFO_DIR) $(GRAPHS_DIR) $(LEGAL_INFO_DIR) $(GRAPHS_DIR)
distclean: clean distclean: clean
ifeq ($(DL_DIR),$(TOPDIR)/dl) ifeq ($(O),$(CURDIR)/output)
rm -rf $(DL_DIR)
endif
ifeq ($(O),output)
rm -rf $(O) rm -rf $(O)
endif endif
rm -rf $(BR2_CONFIG) $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/..config.tmp \ rm -rf $(TOPDIR)/dl $(BR2_CONFIG) $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/..config.tmp \
$(CONFIG_DIR)/.auto.deps $(BR2_EXTERNAL_FILE) $(CONFIG_DIR)/.auto.deps $(BR2_EXTERNAL_FILE)
help: help:
@ -933,26 +984,17 @@ help:
@echo ' <pkg>-depends - Build <pkg>'\''s dependencies' @echo ' <pkg>-depends - Build <pkg>'\''s dependencies'
@echo ' <pkg>-configure - Build <pkg> up to the configure step' @echo ' <pkg>-configure - Build <pkg> up to the configure step'
@echo ' <pkg>-build - Build <pkg> up to the build step' @echo ' <pkg>-build - Build <pkg> up to the build step'
@echo ' <pkg>-show-depends - List packages on which <pkg> depends'
@echo ' <pkg>-show-rdepends - List packages which have <pkg> as a dependency'
@echo ' <pkg>-graph-depends - Generate a graph of <pkg>'\''s dependencies' @echo ' <pkg>-graph-depends - Generate a graph of <pkg>'\''s dependencies'
@echo ' <pkg>-graph-rdepends - Generate a graph of <pkg>'\''s reverse dependencies'
@echo ' <pkg>-dirclean - Remove <pkg> build directory' @echo ' <pkg>-dirclean - Remove <pkg> build directory'
@echo ' <pkg>-reconfigure - Restart the build from the configure step' @echo ' <pkg>-reconfigure - Restart the build from the configure step'
@echo ' <pkg>-rebuild - Restart the build from the build step' @echo ' <pkg>-rebuild - Restart the build from the build step'
ifeq ($(BR2_PACKAGE_BUSYBOX),y) $(foreach p,$(HELP_PACKAGES), \
@echo ' busybox-menuconfig - Run BusyBox menuconfig' @echo $(sep) \
endif @echo '$($(p)_NAME):' $(sep) \
ifeq ($(BR2_LINUX_KERNEL),y) $($(p)_HELP_CMDS)$(sep))
@echo ' linux-menuconfig - Run Linux kernel menuconfig'
@echo ' linux-savedefconfig - Run Linux kernel savedefconfig'
@echo ' linux-update-defconfig - Save the Linux configuration to the path specified'
@echo ' by BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE'
endif
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
@echo ' uclibc-menuconfig - Run uClibc menuconfig'
endif
ifeq ($(BR2_TARGET_BAREBOX),y)
@echo ' barebox-menuconfig - Run barebox menuconfig'
@echo ' barebox-savedefconfig - Run barebox savedefconfig'
endif
@echo @echo
@echo 'Documentation:' @echo 'Documentation:'
@echo ' manual - build manual in all formats' @echo ' manual - build manual in all formats'
@ -979,17 +1021,34 @@ endif
@echo 'it on-line at http://buildroot.org/docs.html' @echo 'it on-line at http://buildroot.org/docs.html'
@echo @echo
# List the defconfig files
# $(1): base directory
# $(2): br2-external name, empty for bundled
define list-defconfigs
@first=true; \
for defconfig in $(1)/configs/*_defconfig; do \
[ -f "$${defconfig}" ] || continue; \
if $${first}; then \
if [ "$(2)" ]; then \
printf 'External configs in "$(call qstrip,$(2))":\n'; \
else \
printf "Built-in configs:\n"; \
fi; \
first=false; \
fi; \
defconfig="$${defconfig##*/}"; \
printf " %-35s - Build for %s\n" "$${defconfig}" "$${defconfig%_defconfig}"; \
done; \
$${first} || printf "\n"
endef
# We iterate over BR2_EXTERNAL_NAMES rather than BR2_EXTERNAL_DIRS,
# because we want to display the name of the br2-external tree.
list-defconfigs: list-defconfigs:
@echo 'Built-in configs:' $(call list-defconfigs,$(TOPDIR))
@$(foreach b, $(sort $(notdir $(wildcard $(TOPDIR)/configs/*_defconfig))), \ $(foreach name,$(BR2_EXTERNAL_NAMES),\
printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);) $(call list-defconfigs,$(BR2_EXTERNAL_$(name)_PATH),\
ifneq ($(wildcard $(BR2_EXTERNAL)/configs/*_defconfig),) $(BR2_EXTERNAL_$(name)_DESC))$(sep))
@echo
@echo 'User-provided configs:'
@$(foreach b, $(sort $(notdir $(wildcard $(BR2_EXTERNAL)/configs/*_defconfig))), \
printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
endif
@echo
release: OUT = buildroot-$(BR2_VERSION) release: OUT = buildroot-$(BR2_VERSION)
@ -1008,8 +1067,8 @@ print-version:
@echo $(BR2_VERSION_FULL) @echo $(BR2_VERSION_FULL)
#include docs/manual/manual.mk #include docs/manual/manual.mk
#-include $(BR2_EXTERNAL)/docs/*/*.mk #-include $(foreach dir,$(BR2_EXTERNAL_DIRS),$(dir)/docs/*/*.mk)
.PHONY: $(noconfig_targets) .PHONY: $(noconfig_targets)
endif #umask endif #umask / $(CURDIR) / $(O)

View File

@ -4,9 +4,6 @@
# This file contains placeholders to detect backward-compatibility problems. # This file contains placeholders to detect backward-compatibility problems.
# When a buildroot "API" feature is being deprecated, a rule should be added # When a buildroot "API" feature is being deprecated, a rule should be added
# here that issues an error when the old feature is used. # here that issues an error when the old feature is used.
#
# This file is not included if BR2_DEPRECATED is selected, so it is possible
# to bypass the errors (although that's usually a bad idea).
ifeq ($(BR2_LEGACY),y) ifeq ($(BR2_LEGACY),y)
$(error "You have legacy configuration in your .config! Please check your configuration.") $(error "You have legacy configuration in your .config! Please check your configuration.")

View File

@ -1,11 +1,12 @@
menu "Linux Kernel Extensions" menu "Linux Kernel Extensions"
#-------------------------------------------------------------------------------
# Xenomai # Xenomai
config BR2_LINUX_KERNEL_EXT_XENOMAI config BR2_LINUX_KERNEL_EXT_XENOMAI
bool "Adeos/Xenomai Real-time patch" bool "Adeos/Xenomai Real-time patch"
depends on BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS
depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_i386 || BR2_x86_64 || BR2_arm || \ depends on !BR2_TOOLCHAIN_USES_MUSL
BR2_bfin || BR2_powerpc || BR2_sh4
select BR2_PACKAGE_XENOMAI select BR2_PACKAGE_XENOMAI
help help
Xenomai is split in two parts: a kernel part and a userspace Xenomai is split in two parts: a kernel part and a userspace
@ -24,19 +25,19 @@ config BR2_LINUX_KERNEL_EXT_XENOMAI
Xenomai is know to support Blackfin, SH4, x86, ARM, NIOS2 Xenomai is know to support Blackfin, SH4, x86, ARM, NIOS2
and PowerPC architectures. and PowerPC architectures.
comment "xenomai needs a toolchain w/ threads"
depends on BR2_i386 || BR2_x86_64 || BR2_arm || \
BR2_bfin || BR2_powerpc || BR2_sh4
depends on !BR2_TOOLCHAIN_HAS_THREADS
config BR2_LINUX_KERNEL_EXT_XENOMAI_ADEOS_PATCH config BR2_LINUX_KERNEL_EXT_XENOMAI_ADEOS_PATCH
depends on BR2_LINUX_KERNEL_EXT_XENOMAI
string "Path for Adeos patch file" string "Path for Adeos patch file"
depends on BR2_LINUX_KERNEL_EXT_XENOMAI
help help
Optionally, explicitly specify the Adeos patch to use. Optionally, explicitly specify the Adeos patch to use.
Download it at http://download.gna.org/adeos/patches Download it at http://download.gna.org/adeos/patches
and verify that your kernel version in buildroot matches. and verify that your kernel version in buildroot matches.
comment "xenomai needs a uClibc or glibc toolchain w/ threads"
depends on BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS
depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_TOOLCHAIN_USES_MUSL
#-------------------------------------------------------------------------------
# RTAI # RTAI
config BR2_LINUX_KERNEL_EXT_RTAI config BR2_LINUX_KERNEL_EXT_RTAI
bool "RTAI Real-time patch" bool "RTAI Real-time patch"
@ -44,6 +45,17 @@ config BR2_LINUX_KERNEL_EXT_RTAI
help help
RTAI Kernel part. RTAI Kernel part.
#-------------------------------------------------------------------------------
# ev3dev Linux drivers
config BR2_LINUX_KERNEL_EXT_EV3DEV_LINUX_DRIVERS
bool "ev3dev Linux drivers"
select BR2_PACKAGE_EV3DEV_LINUX_DRIVERS
help
Linux drivers for LEGO MINDSTORMS EV3 from the ev3dev project.
https://github.com/ev3dev/lego-linux-drivers
#-------------------------------------------------------------------------------
# fbtft # fbtft
config BR2_LINUX_KERNEL_EXT_FBTFT config BR2_LINUX_KERNEL_EXT_FBTFT
bool "FB TFT drivers" bool "FB TFT drivers"
@ -64,4 +76,56 @@ config BR2_LINUX_KERNEL_EXT_FBTFT
https://github.com/notro/fbtft https://github.com/notro/fbtft
# aufs-standalone
config BR2_LINUX_KERNEL_EXT_AUFS
bool "Aufs Filesystem Module patch"
select BR2_PACKAGE_AUFS
help
Aufs is split in two parts: a kernel part and a userspace
part. Enabling this option automatically selects the aufs
standalone (module) package and patches the Linux kernel
built by Buildroot with the aufs kernel part (ie fs/aufs).
It is important to use the correct branch of aufs-standalone.
if BR2_LINUX_KERNEL_EXT_AUFS
choice
bool "aufs-standalone series"
help
Select the major series of this version. This must match the
major version of your kernel (e.g. for kernels 3.x, select
aufs3.x; for kernels 4.x, select aufs4.x).
Note: neither aufs1.x nor aufs2.x (both for kernels older than
3.x) are supported.
config BR2_LINUX_KERNEL_EXT_AUFS_SERIES_3
bool "aufs3.x"
config BR2_LINUX_KERNEL_EXT_AUFS_SERIES_4
bool "aufs4.x"
endchoice
config BR2_LINUX_KERNEL_EXT_AUFS_SERIES
int
default 3 if BR2_LINUX_KERNEL_EXT_AUFS_SERIES_3
default 4 if BR2_LINUX_KERNEL_EXT_AUFS_SERIES_4
config BR2_LINUX_KERNEL_EXT_AUFS_VERSION
string "aufs-standalone version"
default ""
help
The version you choose must match that of your kernel. Usually,
the sha1 of the cset you want to use; avoid using a branch name
as this yields non-reproducible builds.
See the following resources to see what versions are available:
For aufs3.x: https://sourceforge.net/p/aufs/aufs3-standalone/ref/master/branches/
For aufs4.x: https://github.com/sfjro/aufs4-standalone/branches/all
endif # aufs
endmenu endmenu

View File

@ -18,16 +18,15 @@ config BR2_LINUX_NEEDS_MODULES
# Version selection. We provide the choice between: # Version selection. We provide the choice between:
# #
# 1. A single fairly recent stable kernel version # 1. A single fairly recent stable kernel version
# 2. In case an internal toolchain has been built, the same kernel # 2. A custom stable version
# version as the kernel headers # 3. A custom tarball
# 3. A custom stable version # 4. A set of custom repository locations
# 4. A custom tarball
# #
choice choice
prompt "Kernel version" prompt "Kernel version"
config BR2_LINUX_KERNEL_LATEST_VERSION config BR2_LINUX_KERNEL_LATEST_VERSION
bool "4.4.3" bool "Latest version (4.9.9)"
config BR2_LINUX_KERNEL_CUSTOM_VERSION config BR2_LINUX_KERNEL_CUSTOM_VERSION
bool "Custom version" bool "Custom version"
@ -63,11 +62,11 @@ config BR2_LINUX_KERNEL_CUSTOM_HG
This option allows Buildroot to get the Linux kernel source This option allows Buildroot to get the Linux kernel source
code from a Mercurial repository. code from a Mercurial repository.
config BR2_LINUX_KERNEL_CUSTOM_LOCAL config BR2_LINUX_KERNEL_CUSTOM_SVN
bool "Local directory" bool "Custom Subversion repository"
help help
This option allows Buildroot to get the Linux kernel source This option allows Buildroot to get the Linux kernel source
code from a local directory. code from a Subversion repository.
endchoice endchoice
@ -79,7 +78,7 @@ config BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION
string "URL of custom kernel tarball" string "URL of custom kernel tarball"
depends on BR2_LINUX_KERNEL_CUSTOM_TARBALL depends on BR2_LINUX_KERNEL_CUSTOM_TARBALL
if BR2_LINUX_KERNEL_CUSTOM_GIT || BR2_LINUX_KERNEL_CUSTOM_HG if BR2_LINUX_KERNEL_CUSTOM_GIT || BR2_LINUX_KERNEL_CUSTOM_HG || BR2_LINUX_KERNEL_CUSTOM_SVN
config BR2_LINUX_KERNEL_CUSTOM_REPO_URL config BR2_LINUX_KERNEL_CUSTOM_REPO_URL
string "URL of custom repository" string "URL of custom repository"
@ -91,26 +90,19 @@ config BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION
default BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION \ default BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION \
if BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION != "" # legacy if BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION != "" # legacy
help help
Revision to use in the typical format used by Git/Mercurial Revision to use in the typical format used by Git/Mercurial/Subversion
E.G. a sha id, a tag, branch, .. E.G. a sha id, a tag, branch, ..
endif endif
config BR2_LINUX_KERNEL_CUSTOM_LOCAL_PATH
string "Path to the local directory"
depends on BR2_LINUX_KERNEL_CUSTOM_LOCAL
help
Path to the local directory with the Linux kernel source code.
config BR2_LINUX_KERNEL_VERSION config BR2_LINUX_KERNEL_VERSION
string string
default "4.4.3" if BR2_LINUX_KERNEL_LATEST_VERSION default "4.9.9" if BR2_LINUX_KERNEL_LATEST_VERSION
default BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE \ default BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE \
if BR2_LINUX_KERNEL_CUSTOM_VERSION if BR2_LINUX_KERNEL_CUSTOM_VERSION
default "custom" if BR2_LINUX_KERNEL_CUSTOM_TARBALL default "custom" if BR2_LINUX_KERNEL_CUSTOM_TARBALL
default BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION \ default BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION \
if BR2_LINUX_KERNEL_CUSTOM_GIT || BR2_LINUX_KERNEL_CUSTOM_HG if BR2_LINUX_KERNEL_CUSTOM_GIT || BR2_LINUX_KERNEL_CUSTOM_HG || BR2_LINUX_KERNEL_CUSTOM_SVN
default "custom" if BR2_LINUX_KERNEL_CUSTOM_LOCAL
# #
# Patch selection # Patch selection
@ -118,7 +110,6 @@ config BR2_LINUX_KERNEL_VERSION
config BR2_LINUX_KERNEL_PATCH config BR2_LINUX_KERNEL_PATCH
string "Custom kernel patches" string "Custom kernel patches"
depends on !BR2_LINUX_KERNEL_CUSTOM_LOCAL
help help
A space-separated list of patches to apply to the A space-separated list of patches to apply to the
kernel. Each patch can be described as an URL, a local file kernel. Each patch can be described as an URL, a local file
@ -136,6 +127,14 @@ choice
config BR2_LINUX_KERNEL_USE_DEFCONFIG config BR2_LINUX_KERNEL_USE_DEFCONFIG
bool "Using an in-tree defconfig file" bool "Using an in-tree defconfig file"
config BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG
bool "Use the architecture default configuration"
help
This option will use the default configuration for the
selected architecture. I.e, it is equivalent to running
"make ARCH=<foo> defconfig". This is useful on architectures
that have a single defconfig file, such as ARM64.
config BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG config BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG
bool "Using a custom (def)config file" bool "Using a custom (def)config file"
@ -173,12 +172,13 @@ config BR2_LINUX_KERNEL_UBOOT_IMAGE
choice choice
prompt "Kernel binary format" prompt "Kernel binary format"
default BR2_LINUX_KERNEL_ZIMAGE if BR2_arm || BR2_armeb
config BR2_LINUX_KERNEL_UIMAGE config BR2_LINUX_KERNEL_UIMAGE
bool "uImage" bool "uImage"
depends on BR2_arc || BR2_arm || BR2_armeb || BR2_bfin || \ depends on BR2_arc || BR2_arm || BR2_armeb || BR2_bfin || \
BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || \ BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || \
BR2_sh || BR2_sh64 || BR2_mips || BR2_mipsel || \ BR2_sh || BR2_mips || BR2_mipsel || \
BR2_mips64 || BR2_mips64el BR2_mips64 || BR2_mips64el
select BR2_LINUX_KERNEL_UBOOT_IMAGE select BR2_LINUX_KERNEL_UBOOT_IMAGE
@ -197,7 +197,7 @@ config BR2_LINUX_KERNEL_ZIMAGE
bool "zImage" bool "zImage"
depends on BR2_arm || BR2_armeb || BR2_powerpc || \ depends on BR2_arm || BR2_armeb || BR2_powerpc || \
BR2_powerpc64 || BR2_powerpc64le || BR2_sparc || \ BR2_powerpc64 || BR2_powerpc64le || BR2_sparc || \
BR2_sh || BR2_sh64 || BR2_xtensa BR2_sh || BR2_xtensa
config BR2_LINUX_KERNEL_ZIMAGE_EPAPR config BR2_LINUX_KERNEL_ZIMAGE_EPAPR
bool "zImage.epapr" bool "zImage.epapr"
@ -234,7 +234,7 @@ config BR2_LINUX_KERNEL_LINUX_BIN
config BR2_LINUX_KERNEL_VMLINUX_BIN config BR2_LINUX_KERNEL_VMLINUX_BIN
bool "vmlinux.bin" bool "vmlinux.bin"
depends on BR2_mips || BR2_mipsel || BR2_sh || BR2_sh64 depends on BR2_mips || BR2_mipsel || BR2_sh
config BR2_LINUX_KERNEL_VMLINUX config BR2_LINUX_KERNEL_VMLINUX
bool "vmlinux" bool "vmlinux"
@ -399,7 +399,7 @@ config BR2_LINUX_KERNEL_INSTALL_TARGET
source "linux/Config.ext.in" source "linux/Config.ext.in"
# Linux tools # Linux tools
source "linux/Config.tools.in" source "package/linux-tools/Config.in"
endif # BR2_LINUX_KERNEL endif # BR2_LINUX_KERNEL

View File

@ -1,29 +0,0 @@
menu "Linux Kernel Tools"
config BR2_LINUX_KERNEL_TOOL_CPUPOWER
bool "cpupower"
depends on !BR2_bfin # pciutils
select BR2_PACKAGE_PCIUTILS
help
cpupower is a collection of tools to examine and tune power
saving related features of your processor.
config BR2_LINUX_KERNEL_TOOL_PERF
bool "perf"
help
perf (sometimes "Perf Events" or perf tools, originally
"Performance Counters for Linux") - is a performance
analyzing tool in Linux, available from kernel version
2.6.31. User-space controlling utility, called 'perf' has
git-like interface with subcommands. It is capable of
statistical profiling of entire system (both kernel and user
code), single CPU or severals threads.
This will build and install the userspace 'perf'
command. It is up to the user to ensure that the kernel
configuration has all the suitable options enabled to allow a
proper operation of 'perf'.
https://perf.wiki.kernel.org/
endmenu

21
linux/linux-ext-aufs.mk Normal file
View File

@ -0,0 +1,21 @@
################################################################################
# Linux Aufs extensions
#
# Patch the linux kernel with aufs extension
################################################################################
LINUX_EXTENSIONS += aufs
define AUFS_PREPARE_KERNEL
if test -d $(@D)/fs/aufs/; then \
echo "Your kernel already supports AUFS."; \
exit 1; \
fi
$(APPLY_PATCHES) $(@D) $(AUFS_DIR) \
aufs$(BR2_PACKAGE_AUFS_SERIES)-kbuild.patch \
aufs$(BR2_PACKAGE_AUFS_SERIES)-base.patch \
aufs$(BR2_PACKAGE_AUFS_SERIES)-mmap.patch \
aufs$(BR2_PACKAGE_AUFS_SERIES)-standalone.patch
cp -r $(AUFS_DIR)/fs/aufs/ $(@D)/fs/
cp $(AUFS_DIR)/include/uapi/linux/aufs_type.h $(@D)/include/uapi/linux/
endef

View File

@ -0,0 +1,12 @@
################################################################################
# Linux ev3dev extensions
#
# Patch the linux kernel with ev3dev extension
################################################################################
LINUX_EXTENSIONS += ev3dev-linux-drivers
define EV3DEV_LINUX_DRIVERS_PREPARE_KERNEL
mkdir -p $(LINUX_DIR)/drivers/lego
cp -dpfr $(EV3DEV_LINUX_DRIVERS_DIR)/* $(LINUX_DIR)/drivers/lego/
endef

View File

@ -1,39 +0,0 @@
################################################################################
#
# cpupower
#
################################################################################
LINUX_TOOLS += cpupower
CPUPOWER_DEPENDENCIES = pciutils
CPUPOWER_MAKE_OPTS = CROSS=$(TARGET_CROSS) \
CPUFREQ_BENCH=false \
DEBUG=false
define CPUPOWER_BUILD_CMDS
$(Q)if test ! -f $(@D)/tools/power/cpupower/Makefile ; then \
echo "Your kernel version is too old and does not have the cpupower tool." ; \
echo "At least kernel 3.4 must be used." ; \
exit 1 ; \
fi
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/tools \
$(CPUPOWER_MAKE_OPTS) \
cpupower
endef
define CPUPOWER_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/tools \
$(CPUPOWER_MAKE_OPTS) \
DESTDIR=$(STAGING_DIR) \
cpupower_install
endef
define CPUPOWER_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/tools \
$(CPUPOWER_MAKE_OPTS) \
DESTDIR=$(TARGET_DIR) \
cpupower_install
endef

View File

@ -1,101 +0,0 @@
################################################################################
#
# perf
#
################################################################################
LINUX_TOOLS += perf
PERF_DEPENDENCIES = host-flex host-bison
ifeq ($(KERNEL_ARCH),x86_64)
PERF_ARCH=x86
else
PERF_ARCH=$(KERNEL_ARCH)
endif
PERF_MAKE_FLAGS = \
$(LINUX_MAKE_FLAGS) \
ARCH=$(PERF_ARCH) \
NO_LIBAUDIT=1 \
NO_NEWT=1 \
NO_GTK2=1 \
NO_LIBPERL=1 \
NO_LIBPYTHON=1 \
DESTDIR=$(TARGET_DIR) \
prefix=/usr \
WERROR=0 \
ASCIIDOC=
# We need to pass an argument to ld for setting the endianness when
# building it for MIPS architecture, otherwise the default one will
# always be used (which is big endian) and the compilation for little
# endian will always fail showing an error like this one:
# LD foo.o
# mips-linux-gnu-ld: foo.o: compiled for a little endian system and
# target is big endian
ifeq ($(BR2_mips)$(BR2_mips64),y)
PERF_MAKE_FLAGS += LD="$(TARGET_LD) -EB"
else ifeq ($(BR2_mipsel)$(BR2_mips64el),y)
PERF_MAKE_FLAGS += LD="$(TARGET_LD) -EL"
endif
# The call to backtrace() function fails for ARC, because for some
# reason the unwinder from libgcc returns early. Thus the usage of
# backtrace() should be disabled in perf explicitly: at build time
# backtrace() appears to be available, but it fails at runtime: the
# backtrace will contain only several functions from the top of stack,
# instead of the complete backtrace.
ifeq ($(BR2_arc),y)
PERF_MAKE_FLAGS += NO_BACKTRACE=1
endif
ifeq ($(BR2_PACKAGE_SLANG),y)
PERF_DEPENDENCIES += slang
endif
ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
PERF_DEPENDENCIES += libunwind
endif
ifeq ($(BR2_PACKAGE_NUMACTL),y)
PERF_DEPENDENCIES += numactl
endif
ifeq ($(BR2_PACKAGE_ELFUTILS),y)
PERF_DEPENDENCIES += elfutils
else
PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
endif
# O must be redefined here to overwrite the one used by Buildroot for
# out of tree build. We build perf in $(@D)/tools/perf/ and not just
# $(@D) so that it isn't built in the root directory of the kernel
# sources.
define PERF_BUILD_CMDS
$(Q)if test ! -f $(@D)/tools/perf/Makefile ; then \
echo "Your kernel version is too old and does not have the perf tool." ; \
echo "At least kernel 2.6.31 must be used." ; \
exit 1 ; \
fi
$(Q)if test "$(BR2_PACKAGE_ELFUTILS)" = "" ; then \
if ! grep -q NO_LIBELF $(@D)/tools/perf/Makefile* ; then \
if ! test -r $(@D)/tools/perf/config/Makefile ; then \
echo "The perf tool in your kernel cannot be built without libelf." ; \
echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
exit 1 ; \
fi \
fi \
fi
$(TARGET_MAKE_ENV) $(MAKE1) $(PERF_MAKE_FLAGS) \
-C $(@D)/tools/perf O=$(@D)/tools/perf/
endef
# After installation, we remove the Perl and Python scripts from the
# target.
define PERF_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE1) $(PERF_MAKE_FLAGS) \
-C $(@D)/tools/perf O=$(@D)/tools/perf/ install
$(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/scripts/
$(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/tests/
endef

View File

@ -8,21 +8,28 @@ LINUX_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
LINUX_LICENSE = GPLv2 LINUX_LICENSE = GPLv2
LINUX_LICENSE_FILES = COPYING LINUX_LICENSE_FILES = COPYING
define LINUX_HELP_CMDS
@echo ' linux-menuconfig - Run Linux kernel menuconfig'
@echo ' linux-savedefconfig - Run Linux kernel savedefconfig'
@echo ' linux-update-defconfig - Save the Linux configuration to the path specified'
@echo ' by BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE'
endef
# Compute LINUX_SOURCE and LINUX_SITE from the configuration # Compute LINUX_SOURCE and LINUX_SITE from the configuration
ifeq ($(BR2_LINUX_KERNEL_CUSTOM_TARBALL),y) ifeq ($(BR2_LINUX_KERNEL_CUSTOM_TARBALL),y)
LINUX_TARBALL = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION)) LINUX_TARBALL = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION))
LINUX_SITE = $(patsubst %/,%,$(dir $(LINUX_TARBALL))) LINUX_SITE = $(patsubst %/,%,$(dir $(LINUX_TARBALL)))
LINUX_SOURCE = $(notdir $(LINUX_TARBALL)) LINUX_SOURCE = $(notdir $(LINUX_TARBALL))
BR_NO_CHECK_HASH_FOR += $(LINUX_SOURCE) BR_NO_CHECK_HASH_FOR += $(LINUX_SOURCE)
else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_LOCAL),y)
LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_LOCAL_PATH))
LINUX_SITE_METHOD = local
else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_GIT),y) else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_GIT),y)
LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL)) LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
LINUX_SITE_METHOD = git LINUX_SITE_METHOD = git
else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_HG),y) else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_HG),y)
LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL)) LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
LINUX_SITE_METHOD = hg LINUX_SITE_METHOD = hg
else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_SVN),y)
LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
LINUX_SITE_METHOD = svn
else else
LINUX_SOURCE = linux-$(LINUX_VERSION).tar.xz LINUX_SOURCE = linux-$(LINUX_VERSION).tar.xz
ifeq ($(BR2_LINUX_KERNEL_CUSTOM_VERSION),y) ifeq ($(BR2_LINUX_KERNEL_CUSTOM_VERSION),y)
@ -87,6 +94,14 @@ LINUX_MAKE_ENV = \
$(TARGET_MAKE_ENV) \ $(TARGET_MAKE_ENV) \
BR_BINARIES_DIR=$(BINARIES_DIR) BR_BINARIES_DIR=$(BINARIES_DIR)
ifeq ($(BR2_REPRODUCIBLE),y)
LINUX_MAKE_ENV += \
KBUILD_BUILD_VERSION=1 \
KBUILD_BUILD_USER=buildroot \
KBUILD_BUILD_HOST=buildroot \
KBUILD_BUILD_TIMESTAMP="$(shell LC_ALL=C date -d @$(SOURCE_DATE_EPOCH))"
endif
# Get the real Linux version, which tells us where kernel modules are # Get the real Linux version, which tells us where kernel modules are
# going to be installed in the target filesystem. # going to be installed in the target filesystem.
LINUX_VERSION_PROBED = `$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) --no-print-directory -s kernelrelease 2>/dev/null` LINUX_VERSION_PROBED = `$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) --no-print-directory -s kernelrelease 2>/dev/null`
@ -196,6 +211,8 @@ LINUX_POST_PATCH_HOOKS += LINUX_TRY_PATCH_TIMECONST
ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y) ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
LINUX_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig LINUX_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig
else ifeq ($(BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG),y)
LINUX_KCONFIG_DEFCONFIG = defconfig
else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y) else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
LINUX_KCONFIG_FILE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE)) LINUX_KCONFIG_FILE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE))
endif endif
@ -206,6 +223,20 @@ LINUX_KCONFIG_OPTS = $(LINUX_MAKE_FLAGS)
# If no package has yet set it, set it from the Kconfig option # If no package has yet set it, set it from the Kconfig option
LINUX_NEEDS_MODULES ?= $(BR2_LINUX_NEEDS_MODULES) LINUX_NEEDS_MODULES ?= $(BR2_LINUX_NEEDS_MODULES)
# Make sure the Linux kernel is built with the right endianness. Not
# all architectures support
# CONFIG_CPU_BIG_ENDIAN/CONFIG_CPU_LITTLE_ENDIAN in Linux, but the
# option will be thrown away and ignored if it doesn't exist.
ifeq ($(BR2_ENDIAN),"BIG")
define LINUX_FIXUP_CONFIG_ENDIANNESS
$(call KCONFIG_ENABLE_OPT,CONFIG_CPU_BIG_ENDIAN,$(@D)/.config)
endef
else
define LINUX_FIXUP_CONFIG_ENDIANNESS
$(call KCONFIG_ENABLE_OPT,CONFIG_CPU_LITTLE_ENDIAN,$(@D)/.config)
endef
endif
define LINUX_KCONFIG_FIXUP_CMDS define LINUX_KCONFIG_FIXUP_CMDS
$(if $(LINUX_NEEDS_MODULES), $(if $(LINUX_NEEDS_MODULES),
$(call KCONFIG_ENABLE_OPT,CONFIG_MODULES,$(@D)/.config)) $(call KCONFIG_ENABLE_OPT,CONFIG_MODULES,$(@D)/.config))
@ -213,6 +244,7 @@ define LINUX_KCONFIG_FIXUP_CMDS
$(foreach opt, $(LINUX_COMPRESSION_OPT_), $(foreach opt, $(LINUX_COMPRESSION_OPT_),
$(call KCONFIG_DISABLE_OPT,$(opt),$(@D)/.config) $(call KCONFIG_DISABLE_OPT,$(opt),$(@D)/.config)
) )
$(LINUX_FIXUP_CONFIG_ENDIANNESS)
$(if $(BR2_arm)$(BR2_armeb), $(if $(BR2_arm)$(BR2_armeb),
$(call KCONFIG_ENABLE_OPT,CONFIG_AEABI,$(@D)/.config)) $(call KCONFIG_ENABLE_OPT,CONFIG_AEABI,$(@D)/.config))
$(if $(BR2_TARGET_ROOTFS_CPIO), $(if $(BR2_TARGET_ROOTFS_CPIO),
@ -348,6 +380,9 @@ define LINUX_INSTALL_HOST_TOOLS
# Installing dtc (device tree compiler) as host tool, if selected # Installing dtc (device tree compiler) as host tool, if selected
if grep -q "CONFIG_DTC=y" $(@D)/.config; then \ if grep -q "CONFIG_DTC=y" $(@D)/.config; then \
$(INSTALL) -D -m 0755 $(@D)/scripts/dtc/dtc $(HOST_DIR)/usr/bin/linux-dtc ; \ $(INSTALL) -D -m 0755 $(@D)/scripts/dtc/dtc $(HOST_DIR)/usr/bin/linux-dtc ; \
if [ ! -e $(HOST_DIR)/usr/bin/dtc ]; then \
ln -sf linux-dtc $(HOST_DIR)/usr/bin/dtc ; \
fi \
fi fi
endef endef
@ -357,6 +392,10 @@ define LINUX_INSTALL_IMAGES_CMDS
$(call LINUX_INSTALL_DTB,$(BINARIES_DIR)) $(call LINUX_INSTALL_DTB,$(BINARIES_DIR))
endef endef
ifeq ($(BR2_STRIP_strip),y)
LINUX_MAKE_FLAGS += INSTALL_MOD_STRIP=1
endif
define LINUX_INSTALL_TARGET_CMDS define LINUX_INSTALL_TARGET_CMDS
$(LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET) $(LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET)
# Install modules and remove symbolic links pointing to build # Install modules and remove symbolic links pointing to build
@ -369,7 +408,7 @@ define LINUX_INSTALL_TARGET_CMDS
$(LINUX_INSTALL_HOST_TOOLS) $(LINUX_INSTALL_HOST_TOOLS)
endef endef
# Include all our extensions and tools definitions. # Include all our extensions.
# #
# Note: our package infrastructure uses the full-path of the last-scanned # Note: our package infrastructure uses the full-path of the last-scanned
# Makefile to determine what package we're currently defining, using the # Makefile to determine what package we're currently defining, using the
@ -380,7 +419,6 @@ endef
# the current Makefile, we are OK. But this is a hard requirement: files # the current Makefile, we are OK. But this is a hard requirement: files
# included here *must* be in the same directory! # included here *must* be in the same directory!
include $(sort $(wildcard linux/linux-ext-*.mk)) include $(sort $(wildcard linux/linux-ext-*.mk))
include $(sort $(wildcard linux/linux-tool-*.mk))
LINUX_PATCH_DEPENDENCIES += $(foreach ext,$(LINUX_EXTENSIONS),\ LINUX_PATCH_DEPENDENCIES += $(foreach ext,$(LINUX_EXTENSIONS),\
$(if $(BR2_LINUX_KERNEL_EXT_$(call UPPERCASE,$(ext))),$(ext))) $(if $(BR2_LINUX_KERNEL_EXT_$(call UPPERCASE,$(ext))),$(ext)))
@ -389,28 +427,18 @@ LINUX_PRE_PATCH_HOOKS += $(foreach ext,$(LINUX_EXTENSIONS),\
$(if $(BR2_LINUX_KERNEL_EXT_$(call UPPERCASE,$(ext))),\ $(if $(BR2_LINUX_KERNEL_EXT_$(call UPPERCASE,$(ext))),\
$(call UPPERCASE,$(ext))_PREPARE_KERNEL)) $(call UPPERCASE,$(ext))_PREPARE_KERNEL))
# Install Linux kernel tools in the staging directory since some tools
# may install shared libraries and headers (e.g. cpupower). The kernel
# image is NOT installed in the staging directory.
LINUX_INSTALL_STAGING = YES
LINUX_DEPENDENCIES += $(foreach tool,$(LINUX_TOOLS),\
$(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
$($(call UPPERCASE,$(tool))_DEPENDENCIES)))
LINUX_POST_BUILD_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
$(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
$(call UPPERCASE,$(tool))_BUILD_CMDS))
LINUX_POST_INSTALL_STAGING_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
$(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
$(call UPPERCASE,$(tool))_INSTALL_STAGING_CMDS))
LINUX_POST_INSTALL_TARGET_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
$(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
$(call UPPERCASE,$(tool))_INSTALL_TARGET_CMDS))
# Checks to give errors that the user can understand # Checks to give errors that the user can understand
# When a custom repository has been set, check for the repository version
ifeq ($(BR2_LINUX_KERNEL_CUSTOM_SVN)$(BR2_LINUX_KERNEL_CUSTOM_GIT)$(BR2_LINUX_KERNEL_CUSTOM_HG),y)
ifeq ($(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION)),)
$(error No custom repository version set. Check your BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION setting)
endif
ifeq ($(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL)),)
$(error No custom repo URL set. Check your BR2_LINUX_KERNEL_CUSTOM_REPO_URL setting)
endif
endif
ifeq ($(BR_BUILDING),y) ifeq ($(BR_BUILDING),y)
ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y) ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
@ -444,8 +472,8 @@ $(LINUX_DIR)/.stamp_initramfs_rebuilt: $(LINUX_DIR)/.stamp_target_installed $(LI
# Build the kernel. # Build the kernel.
$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME) $(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
$(LINUX_APPEND_DTB) $(LINUX_APPEND_DTB)
# Copy the kernel image to its final destination # Copy the kernel image(s) to its(their) final destination
cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR) $(call LINUX_INSTALL_IMAGE,$(BINARIES_DIR))
# If there is a .ub file copy it to the final destination # If there is a .ub file copy it to the final destination
test ! -f $(LINUX_IMAGE_PATH).ub || cp $(LINUX_IMAGE_PATH).ub $(BINARIES_DIR) test ! -f $(LINUX_IMAGE_PATH).ub || cp $(LINUX_IMAGE_PATH).ub $(BINARIES_DIR)
$(Q)touch $@ $(Q)touch $@

View File

@ -0,0 +1,18 @@
# Versions before 3.0 are affected by the bug described in
# https://git.busybox.net/buildroot/commit/?id=ef2c1970e4bff3be3992014070392b0e6bc28bd2
# and fixed in upstream CMake in version 3.0:
# https://cmake.org/gitweb?p=cmake.git;h=e8b8b37ef6fef094940d3384df5a1d421b9fa568
#
# Set this to either 3.0 or higher, depending on the highest minimum
# version required by any of the packages bundled in Buildroot. If a
# package is bumped or a new one added, and it requires a higher
# version, our cmake infra will catch it and whine.
#
BR2_CMAKE_VERSION_MIN = 3.1
BR2_CMAKE ?= cmake
ifeq ($(call suitable-host-package,cmake,\
$(BR2_CMAKE) $(BR2_CMAKE_VERSION_MIN)),)
BR2_CMAKE = $(HOST_DIR)/usr/bin/cmake
BR2_CMAKE_HOST_DEPENDENCY = host-cmake
endif

View File

@ -0,0 +1,39 @@
#!/bin/sh
candidate="${1}"
version_min="${2}"
major_min="${version_min%.*}"
minor_min="${version_min#*.}"
cmake=`which ${candidate}`
if [ ! -x "${cmake}" ]; then
# echo nothing: no suitable cmake found
exit 1
fi
# Extract version X.Y from versions in the form X.Y or X.Y.Z
# with X, Y and Z numbers with one or more digits each, e.g.
# 3.2 -> 3.2
# 3.2.3 -> 3.2
# 3.2.42 -> 3.2
# 3.10 -> 3.10
# 3.10.4 -> 3.10
# 3.10.42 -> 3.10
version="$(${cmake} --version \
|sed -r -e '/.* ([[:digit:]]+\.[[:digit:]]+).*$/!d;' \
-e 's//\1/'
)"
major="${version%.*}"
minor="${version#*.}"
if [ ${major} -gt ${major_min} ]; then
echo "${cmake}"
else
if [ ${major} -eq ${major_min} -a ${minor} -ge ${minor_min} ]; then
echo "${cmake}"
else
# echo nothing: no suitable cmake found
exit 1
fi
fi

View File

@ -5,8 +5,6 @@
# #
################################################################################ ################################################################################
DEPENDENCIES_HOST_PREREQ :=
# suitable-host-pkg: calls check-host-$(1).sh shell script. Parameter (2) # suitable-host-pkg: calls check-host-$(1).sh shell script. Parameter (2)
# can be the candidate to be checked. If not present, the check-host-$(1).sh # can be the candidate to be checked. If not present, the check-host-$(1).sh
# script should use 'which' to find a candidate. The script should return # script should use 'which' to find a candidate. The script should return
@ -16,10 +14,6 @@ $(shell support/dependencies/check-host-$(1).sh $(2))
endef endef
-include $(sort $(wildcard support/dependencies/check-host-*.mk)) -include $(sort $(wildcard support/dependencies/check-host-*.mk))
ifeq ($(BR2_STRIP_sstrip),y)
DEPENDENCIES_HOST_PREREQ += host-sstrip
endif
ifeq ($(BR2_CCACHE),y) ifeq ($(BR2_CCACHE),y)
DEPENDENCIES_HOST_PREREQ += host-ccache DEPENDENCIES_HOST_PREREQ += host-ccache
endif endif

View File

@ -69,6 +69,10 @@ check_prog_host "which"
# Verify that sed is installed # Verify that sed is installed
check_prog_host "sed" check_prog_host "sed"
# 'file' must be present and must be exactly /usr/bin/file,
# otherwise libtool fails in incomprehensible ways.
check_prog_host "/usr/bin/file"
# Check make # Check make
MAKE=$(which make 2> /dev/null) MAKE=$(which make 2> /dev/null)
if [ -z "$MAKE" ] ; then if [ -z "$MAKE" ] ; then
@ -178,8 +182,7 @@ if test "${missing_progs}" = "yes" ; then
exit 1 exit 1
fi fi
if grep ^BR2_TOOLCHAIN_BUILDROOT=y $BR2_CONFIG > /dev/null && \ if grep ^BR2_NEEDS_HOST_UTF8_LOCALE=y $BR2_CONFIG > /dev/null; then
grep ^BR2_ENABLE_LOCALE=y $BR2_CONFIG > /dev/null ; then
if ! which locale > /dev/null ; then if ! which locale > /dev/null ; then
echo echo
echo "You need locale support on your build machine to build a toolchain supporting locales" echo "You need locale support on your build machine to build a toolchain supporting locales"
@ -238,8 +241,14 @@ fi
# Check that the Perl installation is complete enough for Buildroot. # Check that the Perl installation is complete enough for Buildroot.
required_perl_modules="Data::Dumper" # Needed to build host-autoconf required_perl_modules="Data::Dumper" # Needed to build host-autoconf
required_perl_modules="$required_perl_modules ExtUtils::MakeMaker" # Used by host-libxml-parser-perl
required_perl_modules="$required_perl_modules Thread::Queue" # Used by host-automake required_perl_modules="$required_perl_modules Thread::Queue" # Used by host-automake
if grep -q ^BR2_PACKAGE_MPV=y $BR2_CONFIG ; then
required_perl_modules="$required_perl_modules Math::BigInt"
required_perl_modules="$required_perl_modules Math::BigRat"
fi
# This variable will keep the modules that are missing in your system. # This variable will keep the modules that are missing in your system.
missing_perl_modules="" missing_perl_modules=""

View File

@ -26,6 +26,8 @@ repo="${2}"
rev="${3}" rev="${3}"
basename="${4}" basename="${4}"
shift 4 # Get rid of our options
# Caller needs to single-quote its arguments to prevent them from # Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them) # being expanded a second time (in case there are spaces in them)
_bzr() { _bzr() {
@ -49,5 +51,5 @@ if [ ${bzr_version} -ge ${bzr_min_version} ]; then
fi fi
_bzr export ${verbose} --root="'${basename}/'" --format=tgz \ _bzr export ${verbose} --root="'${basename}/'" --format=tgz \
${timestamp_opt} - "'${repo}'" -r "'${rev}'" \ ${timestamp_opt} - "${@}" "'${repo}'" -r "'${rev}'" \
>"${output}" >"${output}"

View File

@ -28,10 +28,12 @@ shift $((OPTIND-1))
output="${1}" output="${1}"
source="${2}" source="${2}"
shift 2 # Get rid of our options
# Caller needs to single-quote its arguments to prevent them from # Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them) # being expanded a second time (in case there are spaces in them)
_localfiles() { _localfiles() {
eval ${LOCALFILES} "${@}" eval ${LOCALFILES} "${@}"
} }
_localfiles ${verbose} "'${source}'" "'${output}'" _localfiles ${verbose} "${@}""'${source}'" "'${output}'"

View File

@ -26,6 +26,8 @@ rev="${3}"
rawname="${4}" rawname="${4}"
basename="${5}" basename="${5}"
shift 5 # Get rid of our options
# Caller needs to single-quote its arguments to prevent them from # Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them) # being expanded a second time (in case there are spaces in them)
_cvs() { _cvs() {
@ -48,6 +50,6 @@ fi
export TZ=UTC export TZ=UTC
_cvs ${verbose} -z3 -d"'${repo}'" \ _cvs ${verbose} -z3 -d"'${repo}'" \
co -d "'${basename}'" ${select} "'${rev}'" -P "'${rawname}'" co "${@}" -d "'${basename}'" ${select} "'${rev}'" -P "'${rawname}'"
tar czf "${output}" "${basename}" tar czf "${output}" "${basename}"

View File

@ -21,15 +21,16 @@ set -e
main() { main() {
local OPT OPTARG local OPT OPTARG
local backend output hfile quiet local backend output hfile recurse quiet
# Parse our options; anything after '--' is for the backend # Parse our options; anything after '--' is for the backend
while getopts :hb:o:H:q OPT; do while getopts :hb:o:H:rq OPT; do
case "${OPT}" in case "${OPT}" in
h) help; exit 0;; h) help; exit 0;;
b) backend="${OPTARG}";; b) backend="${OPTARG}";;
o) output="${OPTARG}";; o) output="${OPTARG}";;
H) hfile="${OPTARG}";; H) hfile="${OPTARG}";;
r) recurse="-r";;
q) quiet="-q";; q) quiet="-q";;
:) error "option '%s' expects a mandatory argument\n" "${OPTARG}";; :) error "option '%s' expects a mandatory argument\n" "${OPTARG}";;
\?) error "unknown option '%s'\n" "${OPTARG}";; \?) error "unknown option '%s'\n" "${OPTARG}";;
@ -82,7 +83,7 @@ main() {
# If the backend fails, we can just remove the temporary directory to # If the backend fails, we can just remove the temporary directory to
# remove all the cruft it may have left behind. Then we just exit in # remove all the cruft it may have left behind. Then we just exit in
# error too. # error too.
if ! "${OLDPWD}/support/download/${backend}" ${quiet} "${tmpf}" "${@}"; then if ! "${OLDPWD}/support/download/${backend}" ${quiet} ${recurse} "${tmpf}" "${@}"; then
rm -rf "${tmpd}" rm -rf "${tmpd}"
exit 1 exit 1
fi fi

View File

@ -6,15 +6,20 @@ set -e
# Download helper for git, to be called from the download wrapper script # Download helper for git, to be called from the download wrapper script
# #
# Call it as: # Call it as:
# .../git [-q] OUT_FILE REPO_URL CSET BASENAME # .../git [-q] [-r] OUT_FILE REPO_URL CSET BASENAME
#
# -q Be quiet.
# -r Clone and archive sub-modules.
# #
# Environment: # Environment:
# GIT : the git command to call # GIT : the git command to call
verbose= verbose=
while getopts :q OPT; do recurse=0
while getopts :qr OPT; do
case "${OPT}" in case "${OPT}" in
q) verbose=-q; exec >/dev/null;; q) verbose=-q; exec >/dev/null;;
r) recurse=1;;
\?) printf "unknown option '%s'\n" "${OPTARG}" >&2; exit 1;; \?) printf "unknown option '%s'\n" "${OPTARG}" >&2; exit 1;;
esac esac
done done
@ -25,6 +30,8 @@ repo="${2}"
cset="${3}" cset="${3}"
basename="${4}" basename="${4}"
shift 4 # Get rid of our options
# Caller needs to single-quote its arguments to prevent them from # Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them) # being expanded a second time (in case there are spaces in them)
_git() { _git() {
@ -41,7 +48,7 @@ _git() {
git_done=0 git_done=0
if [ -n "$(_git ls-remote "'${repo}'" "'${cset}'" 2>&1)" ]; then if [ -n "$(_git ls-remote "'${repo}'" "'${cset}'" 2>&1)" ]; then
printf "Doing shallow clone\n" printf "Doing shallow clone\n"
if _git clone ${verbose} --depth 1 -b "'${cset}'" --bare "'${repo}'" "'${basename}'"; then if _git clone ${verbose} "${@}" --depth 1 -b "'${cset}'" "'${repo}'" "'${basename}'"; then
git_done=1 git_done=1
else else
printf "Shallow clone failed, falling back to doing a full clone\n" printf "Shallow clone failed, falling back to doing a full clone\n"
@ -49,10 +56,44 @@ if [ -n "$(_git ls-remote "'${repo}'" "'${cset}'" 2>&1)" ]; then
fi fi
if [ ${git_done} -eq 0 ]; then if [ ${git_done} -eq 0 ]; then
printf "Doing full clone\n" printf "Doing full clone\n"
_git clone ${verbose} --mirror "'${repo}'" "'${basename}'" _git clone ${verbose} "${@}" "'${repo}'" "'${basename}'"
fi fi
GIT_DIR="${basename}" \ pushd "${basename}" >/dev/null
_git archive --prefix="'${basename}/'" -o "'${output}.tmp'" --format=tar "'${cset}'"
gzip -n <"${output}.tmp" >"${output}" # Try to get the special refs exposed by some forges (pull-requests for
# github, changes for gerrit...). There is no easy way to know whether
# the cset the user passed us is such a special ref or a tag or a sha1
# or whatever else. We'll eventually fail at checking out that cset,
# below, if there is an issue anyway. Since most of the cset we're gonna
# have to clone are not such special refs, consign the output to oblivion
# so as not to alarm unsuspecting users, but still trace it as a warning.
if ! _git fetch origin "'${cset}:${cset}'" >/dev/null 2>&1; then
printf "Could not fetch special ref '%s'; assuming it is not special.\n" "${cset}"
fi
# Checkout the required changeset, so that we can update the required
# submodules.
_git checkout -q "'${cset}'"
# Get date of commit to generate a reproducible archive.
# %cD is RFC2822, so it's fully qualified, with TZ and all.
date="$( _git log -1 --pretty=format:%cD )"
# There might be submodules, so fetch them.
if [ ${recurse} -eq 1 ]; then
_git submodule update --init --recursive
fi
# We do not need the .git dir; we keep other .git files, in case they
# are the only files in their directory.
rm -rf .git
popd >/dev/null
# Generate the archive, sort with the C locale so that it is reproducible
find "${basename}" -not -type d >"${basename}.list"
LC_ALL=C sort <"${basename}.list" >"${basename}.list.sorted"
tar cf - --numeric-owner --owner=0 --group=0 --mtime="${date}" \
-T "${basename}.list.sorted" >"${output}.tar"
gzip -n <"${output}.tar" >"${output}"

View File

@ -25,13 +25,15 @@ repo="${2}"
cset="${3}" cset="${3}"
basename="${4}" basename="${4}"
shift 4 # Get rid of our options
# Caller needs to single-quote its arguments to prevent them from # Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them) # being expanded a second time (in case there are spaces in them)
_hg() { _hg() {
eval ${HG} "${@}" eval ${HG} "${@}"
} }
_hg clone ${verbose} --noupdate "'${repo}'" "'${basename}'" _hg clone ${verbose} "${@}" --noupdate "'${repo}'" "'${basename}'"
_hg archive ${verbose} --repository "'${basename}'" --type tgz \ _hg archive ${verbose} --repository "'${basename}'" --type tgz \
--prefix "'${basename}'" --rev "'${cset}'" \ --prefix "'${basename}'" --rev "'${cset}'" \

View File

@ -23,10 +23,12 @@ shift $((OPTIND-1))
output="${1}" output="${1}"
url="${2}" url="${2}"
shift 2 # Get rid of our options
# Caller needs to single-quote its arguments to prevent them from # Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them) # being expanded a second time (in case there are spaces in them)
_scp() { _scp() {
eval ${SCP} "${@}" eval ${SCP} "${@}"
} }
_scp ${verbose} "'${url}'" "'${output}'" _scp ${verbose} "${@}" "'${url}'" "'${output}'"

View File

@ -25,12 +25,14 @@ repo="${2}"
rev="${3}" rev="${3}"
basename="${4}" basename="${4}"
shift 4 # Get rid of our options
# Caller needs to single-quote its arguments to prevent them from # Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them) # being expanded a second time (in case there are spaces in them)
_svn() { _svn() {
eval ${SVN} "${@}" eval ${SVN} "${@}"
} }
_svn export ${verbose} "'${repo}@${rev}'" "'${basename}'" _svn export ${verbose} "${@}" "'${repo}@${rev}'" "'${basename}'"
tar czf "${output}" "${basename}" tar czf "${output}" "${basename}"

View File

@ -23,10 +23,12 @@ shift $((OPTIND-1))
output="${1}" output="${1}"
url="${2}" url="${2}"
shift 2 # Get rid of our options
# Caller needs to single-quote its arguments to prevent them from # Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them) # being expanded a second time (in case there are spaces in them)
_wget() { _wget() {
eval ${WGET} "${@}" eval ${WGET} "${@}"
} }
_wget ${verbose} -O "'${output}'" "'${url}'" _wget ${verbose} "${@}" -O "'${output}'" "'${url}'"

View File

@ -24,4 +24,4 @@ Currently no patches are needed, but they may be needed again in the
future. future.
The current Buildroot version is based on the Git commit The current Buildroot version is based on the Git commit
5e4de70bb0064d974a848fbe3a445d5dafaf7b48 of the config.git repository. dafd8e767ec87b90aac62f0fcedd11944c84b50a of the config.git repository.

View File

@ -1,8 +1,8 @@
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright 1992-2013 Free Software Foundation, Inc. # Copyright 1992-2016 Free Software Foundation, Inc.
timestamp='2013-06-10' timestamp='2016-05-15'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@ -24,12 +24,12 @@ timestamp='2013-06-10'
# program. This Exception is an additional permission under section 7 # program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3"). # of the GNU General Public License, version 3 ("GPLv3").
# #
# Originally written by Per Bothner. # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
# #
# You can get the latest version of this script from: # You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
# #
# Please send patches with a ChangeLog entry to config-patches@gnu.org. # Please send patches to <config-patches@gnu.org>.
me=`echo "$0" | sed -e 's,.*/,,'` me=`echo "$0" | sed -e 's,.*/,,'`
@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp) GNU config.guess ($timestamp)
Originally written by Per Bothner. Originally written by Per Bothner.
Copyright 1992-2013 Free Software Foundation, Inc. Copyright 1992-2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -149,7 +149,7 @@ Linux|GNU|GNU/*)
LIBC=gnu LIBC=gnu
#endif #endif
EOF EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
;; ;;
esac esac
@ -168,19 +168,29 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# Note: NetBSD doesn't particularly care about the vendor # Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown". # portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch" sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)` /sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || \
echo unknown)`
case "${UNAME_MACHINE_ARCH}" in case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;; armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;; arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;; sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;; sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;; sh5el) machine=sh5le-unknown ;;
earmv*)
arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
machine=${arch}${endian}-unknown
;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac esac
# The Operating System including object format, if it has switched # The Operating System including object format, if it has switched
# to ELF recently, or will in the future. # to ELF recently (or will in the future) and ABI.
case "${UNAME_MACHINE_ARCH}" in case "${UNAME_MACHINE_ARCH}" in
earm*)
os=netbsdelf
;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax) arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
@ -197,6 +207,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
os=netbsd os=netbsd
;; ;;
esac esac
# Determine ABI tags.
case "${UNAME_MACHINE_ARCH}" in
earm*)
expr='s/^earmv[0-9]/-eabi/;s/eb$//'
abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
;;
esac
# The OS release # The OS release
# Debian GNU/NetBSD machines have a different userland, and # Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need # thus, need a distinct triplet. However, they do not need
@ -207,13 +224,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
release='-gnu' release='-gnu'
;; ;;
*) *)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
;; ;;
esac esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form: # contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}" echo "${machine}-${os}${release}${abi}"
exit ;; exit ;;
*:Bitrig:*:*) *:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
@ -223,6 +240,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;; exit ;;
*:LibertyBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*) *:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;; exit ;;
@ -235,6 +256,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:MirBSD:*:*) *:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;; exit ;;
*:Sortix:*:*)
echo ${UNAME_MACHINE}-unknown-sortix
exit ;;
alpha:OSF1:*:*) alpha:OSF1:*:*)
case $UNAME_RELEASE in case $UNAME_RELEASE in
*4.0) *4.0)
@ -251,42 +275,42 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in case "$ALPHA_CPU_TYPE" in
"EV4 (21064)") "EV4 (21064)")
UNAME_MACHINE="alpha" ;; UNAME_MACHINE=alpha ;;
"EV4.5 (21064)") "EV4.5 (21064)")
UNAME_MACHINE="alpha" ;; UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)") "LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;; UNAME_MACHINE=alpha ;;
"EV5 (21164)") "EV5 (21164)")
UNAME_MACHINE="alphaev5" ;; UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)") "EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;; UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)") "EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;; UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)") "EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;; UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)") "EV6 (21264)")
UNAME_MACHINE="alphaev6" ;; UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)") "EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;; UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)") "EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;; UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)") "EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;; UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)") "EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;; UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)") "EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;; UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)") "EV7 (21364)")
UNAME_MACHINE="alphaev7" ;; UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)") "EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;; UNAME_MACHINE=alphaev79 ;;
esac esac
# A Pn.n version is a patched version. # A Pn.n version is a patched version.
# A Vn.n version is a released version. # A Vn.n version is a released version.
# A Tn.n version is a released field test version. # A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel. # A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r. # 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
# Reset EXIT trap before exiting to avoid spurious non-zero exit code. # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$? exitcode=$?
trap '' 0 trap '' 0
@ -359,16 +383,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit ;; exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build eval $set_cc_for_build
SUN_ARCH="i386" SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects. # If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers. # This test works for both compilers.
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null grep IS_64BIT_ARCH >/dev/null
then then
SUN_ARCH="x86_64" SUN_ARCH=x86_64
fi fi
fi fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@ -393,7 +417,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit ;; exit ;;
sun*:*:4.2BSD:*) sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
case "`/bin/arch`" in case "`/bin/arch`" in
sun3) sun3)
echo m68k-sun-sunos${UNAME_RELEASE} echo m68k-sun-sunos${UNAME_RELEASE}
@ -579,8 +603,9 @@ EOF
else else
IBM_ARCH=powerpc IBM_ARCH=powerpc
fi fi
if [ -x /usr/bin/oslevel ] ; then if [ -x /usr/bin/lslpp ] ; then
IBM_REV=`/usr/bin/oslevel` IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi fi
@ -617,13 +642,13 @@ EOF
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0 532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;; 32) HP_ARCH=hppa2.0n ;;
64) HP_ARCH="hppa2.0w" ;; 64) HP_ARCH=hppa2.0w ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;; esac ;;
esac esac
fi fi
@ -662,11 +687,11 @@ EOF
exit (0); exit (0);
} }
EOF EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;; fi ;;
esac esac
if [ ${HP_ARCH} = "hppa2.0w" ] if [ ${HP_ARCH} = hppa2.0w ]
then then
eval $set_cc_for_build eval $set_cc_for_build
@ -679,12 +704,12 @@ EOF
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23 # => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__ grep -q __LP64__
then then
HP_ARCH="hppa2.0w" HP_ARCH=hppa2.0w
else else
HP_ARCH="hppa64" HP_ARCH=hppa64
fi fi
fi fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV} echo ${HP_ARCH}-hp-hpux${HPUX_REV}
@ -789,14 +814,14 @@ EOF
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;; exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;; exit ;;
5000:UNIX_System_V:4.*:*) 5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;; exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
@ -826,7 +851,7 @@ EOF
*:MINGW*:*) *:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32 echo ${UNAME_MACHINE}-pc-mingw32
exit ;; exit ;;
i*:MSYS*:*) *:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys echo ${UNAME_MACHINE}-pc-msys
exit ;; exit ;;
i*:windows32*:*) i*:windows32*:*)
@ -878,7 +903,7 @@ EOF
exit ;; exit ;;
*:GNU/*:*:*) *:GNU/*:*:*)
# other systems with GNU libc and userland # other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;; exit ;;
i*86:Minix:*:*) i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix echo ${UNAME_MACHINE}-pc-minix
@ -901,7 +926,7 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;; EV68*) UNAME_MACHINE=alphaev68 ;;
esac esac
objdump --private-headers /bin/sh | grep -q ld.so.1 objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
arc:Linux:*:* | arceb:Linux:*:*) arc:Linux:*:* | arceb:Linux:*:*)
@ -932,6 +957,9 @@ EOF
crisv32:Linux:*:*) crisv32:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC} echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;; exit ;;
e2k:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
frv:Linux:*:*) frv:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
@ -944,6 +972,9 @@ EOF
ia64:Linux:*:*) ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
k1om:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*) m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
@ -969,10 +1000,10 @@ EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;; ;;
or1k:Linux:*:*) openrisc*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} echo or1k-unknown-linux-${LIBC}
exit ;; exit ;;
or32:Linux:*:*) or32:Linux:*:* | or1k*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
padre:Linux:*:*) padre:Linux:*:*)
@ -1020,7 +1051,7 @@ EOF
echo ${UNAME_MACHINE}-dec-linux-${LIBC} echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;; exit ;;
x86_64:Linux:*:*) x86_64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;; exit ;;
xtensa*:Linux:*:*) xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
@ -1099,7 +1130,7 @@ EOF
# uname -m prints for DJGPP always 'pc', but it prints nothing about # uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586. # the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub # Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that # prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build. # this is a cross-build.
echo i586-pc-msdosdjgpp echo i586-pc-msdosdjgpp
exit ;; exit ;;
@ -1248,6 +1279,9 @@ EOF
SX-8R:SUPER-UX:*:*) SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE} echo sx8r-nec-superux${UNAME_RELEASE}
exit ;; exit ;;
SX-ACE:SUPER-UX:*:*)
echo sxace-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*) Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE} echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;; exit ;;
@ -1260,22 +1294,32 @@ EOF
if test "$UNAME_PROCESSOR" = unknown ; then if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc UNAME_PROCESSOR=powerpc
fi fi
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
grep IS_64BIT_ARCH >/dev/null (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
then grep IS_64BIT_ARCH >/dev/null
case $UNAME_PROCESSOR in then
i386) UNAME_PROCESSOR=x86_64 ;; case $UNAME_PROCESSOR in
powerpc) UNAME_PROCESSOR=powerpc64 ;; i386) UNAME_PROCESSOR=x86_64 ;;
esac powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
fi fi
elif test "$UNAME_PROCESSOR" = i386 ; then
# Avoid executing cc on OS X 10.9, as it ships with a stub
# that puts up a graphical alert prompting to install
# developer tools. Any system running Mac OS X 10.7 or
# later (Darwin 11 and later) is required to have a 64-bit
# processor. This is not true of the ARM version of Darwin
# that Apple uses in portable devices.
UNAME_PROCESSOR=x86_64
fi fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;; exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*) *:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p` UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386 UNAME_PROCESSOR=i386
UNAME_MACHINE=pc UNAME_MACHINE=pc
fi fi
@ -1306,7 +1350,7 @@ EOF
# "uname -m" is not consistent, so use $cputype instead. 386 # "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86 # is converted to i386 for consistency with other x86
# operating systems. # operating systems.
if test "$cputype" = "386"; then if test "$cputype" = 386; then
UNAME_MACHINE=i386 UNAME_MACHINE=i386
else else
UNAME_MACHINE="$cputype" UNAME_MACHINE="$cputype"
@ -1348,7 +1392,7 @@ EOF
echo i386-pc-xenix echo i386-pc-xenix
exit ;; exit ;;
i*86:skyos:*:*) i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
exit ;; exit ;;
i*86:rdos:*:*) i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos echo ${UNAME_MACHINE}-pc-rdos
@ -1359,171 +1403,25 @@ EOF
x86_64:VMkernel:*:*) x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx echo ${UNAME_MACHINE}-unknown-esx
exit ;; exit ;;
amd64:Isilon\ OneFS:*:*)
echo x86_64-unknown-onefs
exit ;;
esac esac
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
# if !defined (ultrix)
# include <sys/param.h>
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
c34*)
echo c34-convex-bsd
exit ;;
c38*)
echo c38-convex-bsd
exit ;;
c4*)
echo c4-convex-bsd
exit ;;
esac
fi
cat >&2 <<EOF cat >&2 <<EOF
$0: unable to guess system type $0: unable to guess system type
This script, last modified $timestamp, has failed to recognize This script (version $timestamp), has failed to recognize the
the operating system you are using. It is advised that you operating system you are using. If your script is old, overwrite
download the most up to date version of the config scripts from config.guess and config.sub with the latest versions from:
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and and
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
If the version you run ($0) is already up to date, please If $0 has already been updated, send the following data and any
send the following data and any information you think might be information you think might be pertinent to config-patches@gnu.org to
pertinent to <config-patches@gnu.org> in order to provide the needed provide the necessary information to handle your system.
information to handle your system.
config.guess timestamp = $timestamp config.guess timestamp = $timestamp

View File

@ -1,8 +1,8 @@
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright 1992-2013 Free Software Foundation, Inc. # Copyright 1992-2016 Free Software Foundation, Inc.
timestamp='2013-10-01' timestamp='2016-05-10'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@ -25,7 +25,7 @@ timestamp='2013-10-01'
# of the GNU General Public License, version 3 ("GPLv3"). # of the GNU General Public License, version 3 ("GPLv3").
# Please send patches with a ChangeLog entry to config-patches@gnu.org. # Please send patches to <config-patches@gnu.org>.
# #
# Configuration subroutine to validate and canonicalize a configuration type. # Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument. # Supply the specified configuration type as an argument.
@ -33,7 +33,7 @@ timestamp='2013-10-01'
# Otherwise, we print the canonical config type on stdout and succeed. # Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from: # You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
# This file is supposed to be the same for all GNU packages # This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases # and recognize all the CPU types, system types and aliases
@ -53,8 +53,7 @@ timestamp='2013-10-01'
me=`echo "$0" | sed -e 's,.*/,,'` me=`echo "$0" | sed -e 's,.*/,,'`
usage="\ usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
$0 [OPTION] ALIAS
Canonicalize a configuration name. Canonicalize a configuration name.
@ -68,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\ version="\
GNU config.sub ($timestamp) GNU config.sub ($timestamp)
Copyright 1992-2013 Free Software Foundation, Inc. Copyright 1992-2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -117,7 +116,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
kopensolaris*-gnu* | \ kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*) storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os os=-$maybe_os
@ -255,12 +254,13 @@ case $basic_machine in
| arc | arceb \ | arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \ | avr | avr32 \
| ba \
| be32 | be64 \ | be32 | be64 \
| bfin \ | bfin \
| c4x | c8051 | clipper \ | c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \ | d10v | d30v | dlx | dsp16xx \
| epiphany \ | e2k | epiphany \
| fido | fr30 | frv \ | fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \ | hexagon \
| i370 | i860 | i960 | ia64 \ | i370 | i860 | i960 | ia64 \
@ -283,8 +283,10 @@ case $basic_machine in
| mips64vr5900 | mips64vr5900el \ | mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \ | mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \ | mipsisa32r2 | mipsisa32r2el \
| mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \ | mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \ | mipsisa64r2 | mipsisa64r2el \
| mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \ | mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \ | mipsr5900 | mipsr5900el \
@ -296,14 +298,14 @@ case $basic_machine in
| nds32 | nds32le | nds32be \ | nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \ | nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \ | ns16k | ns32k \
| open8 \ | open8 | or1k | or1knd | or32 \
| or1k | or32 \
| pdp10 | pdp11 | pj | pjl \ | pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \ | pyramid \
| riscv32 | riscv64 \
| rl78 | rx \ | rl78 | rx \
| score \ | score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \ | sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@ -311,6 +313,7 @@ case $basic_machine in
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \ | ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| visium \
| we32k \ | we32k \
| x86 | xc16x | xstormy16 | xtensa \ | x86 | xc16x | xstormy16 | xtensa \
| z8k | z80) | z8k | z80)
@ -325,6 +328,9 @@ case $basic_machine in
c6x) c6x)
basic_machine=tic6x-unknown basic_machine=tic6x-unknown
;; ;;
leon|leon[3-9])
basic_machine=sparc-$basic_machine
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
os=-none os=-none
@ -370,12 +376,13 @@ case $basic_machine in
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \ | avr-* | avr32-* \
| ba-* \
| be32-* | be64-* \ | be32-* | be64-* \
| bfin-* | bs2000-* \ | bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \
| c8051-* | clipper-* | craynv-* | cydra-* \ | c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \ | d10v-* | d30v-* | dlx-* \
| elxsi-* \ | e2k-* | elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \ | h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
@ -402,8 +409,10 @@ case $basic_machine in
| mips64vr5900-* | mips64vr5900el-* \ | mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \ | mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \ | mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \ | mipsr5900-* | mipsr5900el-* \
@ -415,16 +424,18 @@ case $basic_machine in
| nios-* | nios2-* | nios2eb-* | nios2el-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \ | none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \ | open8-* \
| or1k*-* \
| orion-* \ | orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \ | pyramid-* \
| riscv32-* | riscv64-* \
| rl78-* | romp-* | rs6000-* | rx-* \ | rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \ | sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
| tahoe-* \ | tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \ | tile*-* \
@ -432,6 +443,7 @@ case $basic_machine in
| ubicom32-* \ | ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \ | vax-* \
| visium-* \
| we32k-* \ | we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \ | xstormy16-* | xtensa*-* \
@ -508,6 +520,9 @@ case $basic_machine in
basic_machine=i386-pc basic_machine=i386-pc
os=-aros os=-aros
;; ;;
asmjs)
basic_machine=asmjs-unknown
;;
aux) aux)
basic_machine=m68k-apple basic_machine=m68k-apple
os=-aux os=-aux
@ -769,6 +784,9 @@ case $basic_machine in
basic_machine=m68k-isi basic_machine=m68k-isi
os=-sysv os=-sysv
;; ;;
leon-*|leon[3-9]-*)
basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
;;
m68knommu) m68knommu)
basic_machine=m68k-unknown basic_machine=m68k-unknown
os=-linux os=-linux
@ -824,6 +842,10 @@ case $basic_machine in
basic_machine=powerpc-unknown basic_machine=powerpc-unknown
os=-morphos os=-morphos
;; ;;
moxiebox)
basic_machine=moxie-unknown
os=-moxiebox
;;
msdos) msdos)
basic_machine=i386-pc basic_machine=i386-pc
os=-msdos os=-msdos
@ -1356,11 +1378,11 @@ case $os in
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \ | -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \ | -aos* | -aros* | -cloudabi* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
@ -1369,14 +1391,15 @@ case $os in
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
| -onefs* | -tirtos* | -phoenix*)
# Remember, each alternative MUST END IN *, to match a version number. # Remember, each alternative MUST END IN *, to match a version number.
;; ;;
-qnx*) -qnx*)
@ -1508,6 +1531,8 @@ case $os in
;; ;;
-nacl*) -nacl*)
;; ;;
-ios)
;;
-none) -none)
;; ;;
*) *)
@ -1594,9 +1619,6 @@ case $basic_machine in
mips*-*) mips*-*)
os=-elf os=-elf
;; ;;
or1k-*)
os=-elf
;;
or32-*) or32-*)
os=-coff os=-coff
;; ;;

View File

@ -14,10 +14,17 @@ This material is composed of the following items.
compiled programs. compiled programs.
Note: this may have not been saved due to technical limitations, you may Note: this may have not been saved due to technical limitations, you may
need to collect it manually. need to collect it manually.
* The source code for all packages; this has been saved in the sources/ * The original source code for all packages; this has been saved in the
subdirectory (except for the non-redistributable packages, which have not sources/ subdirectory (except for the non-redistributable packages, which
been saved); patches applied to some packages by Buildroot are included in have not been saved). Patches that were applied are also saved, along
the Buildroot sources and were not duplicated in the sources/ subdirectory. with a file named 'series' that lists the patches in the order they were
applied. Patches are under the same license as the files that they modify
in the original package.
Note: Buildroot applies additional patches to Libtool scripts of
autotools-based packages. These patches can be found under
support/libtool in the Buildroot source and, due to technical
limitations, are not saved with the package sources. You may need
to collect them manually.
* A manifest file listing the configured packages and related information. * A manifest file listing the configured packages and related information.
* The license text of the packages; they have been saved in the licenses/ * The license text of the packages; they have been saved in the licenses/
subdirectory. subdirectory.

View File

@ -5,14 +5,14 @@
################################################################################ ################################################################################
# Buildroot version to use # Buildroot version to use
RELEASE='2016.02' RELEASE='2016.11.2'
### Change here for more memory/cores ### ### Change here for more memory/cores ###
VM_MEMORY=2048 VM_MEMORY=2048
VM_CORES=1 VM_CORES=1
Vagrant.configure('2') do |config| Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu/trusty64' config.vm.box = 'bento/ubuntu-16.04'
config.vm.provider :vmware_fusion do |v, override| config.vm.provider :vmware_fusion do |v, override|
v.vmx['memsize'] = VM_MEMORY v.vmx['memsize'] = VM_MEMORY
@ -44,10 +44,13 @@ Vagrant.configure('2') do |config|
config.vm.provision 'shell', inline: config.vm.provision 'shell', inline:
"sudo dpkg --add-architecture i386 "sudo dpkg --add-architecture i386
sudo apt-get -q update sudo apt-get -q update
sudo apt-get purge -q -y snapd lxcfs lxd ubuntu-core-launcher snap-confine
sudo apt-get -q -y upgrade
sudo apt-get -q -y install build-essential libncurses5-dev \ sudo apt-get -q -y install build-essential libncurses5-dev \
git bzr cvs mercurial subversion libc6:i386 unzip git bzr cvs mercurial subversion libc6:i386 unzip bc
sudo apt-get -q -y autoremove sudo apt-get -q -y autoremove
sudo apt-get -q -y clean" sudo apt-get -q -y clean
sudo update-locale LC_ALL=C"
config.vm.provision 'shell', privileged: false, inline: config.vm.provision 'shell', privileged: false, inline:
"echo 'Downloading and extracting buildroot #{RELEASE}' "echo 'Downloading and extracting buildroot #{RELEASE}'

View File

@ -13,12 +13,39 @@ string(REPLACE "/usr/share/buildroot" "" RELOCATED_HOST_DIR ${CMAKE_CURRENT_LIST
set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR @@CMAKE_SYSTEM_PROCESSOR@@) set(CMAKE_SYSTEM_PROCESSOR @@CMAKE_SYSTEM_PROCESSOR@@)
set(CMAKE_C_FLAGS "@@TARGET_CFLAGS@@ ${CMAKE_C_FLAGS}" CACHE STRING "Buildroot CFLAGS") # Set the {C,CXX}FLAGS appended by CMake depending on the build type
set(CMAKE_CXX_FLAGS "@@TARGET_CXXFLAGS@@ ${CMAKE_CXX_FLAGS}" CACHE STRING "Buildroot CXXFLAGS") # defined by Buildroot. CMake defaults these variables with -g and/or
set(CMAKE_EXE_LINKER_FLAGS "@@TARGET_LDFLAGS@@ ${CMAKE_EXE_LINKER_FLAGS}" CACHE STRING "Buildroot LDFLAGS") # -O options, and they are appended at the end of the argument list,
# so the Buildroot options are overridden. Therefore these variables
# have to be cleared, so that the options passed in CMAKE_C_FLAGS do
# apply.
#
# Note:
# if the project forces some of these flag variables, Buildroot is
# screwed up and there is nothing Buildroot can do about that :(
set(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "Debug CFLAGS")
set(CMAKE_CXX_FLAGS_DEBUG "" CACHE STRING "Debug CXXFLAGS")
set(CMAKE_C_FLAGS_RELEASE " -DNDEBUG" CACHE STRING "Release CFLAGS")
set(CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG" CACHE STRING "Release CXXFLAGS")
# Build type from the Buildroot configuration
set(CMAKE_BUILD_TYPE @@CMAKE_BUILD_TYPE@@ CACHE STRING "Buildroot build configuration")
# Buildroot defaults flags.
# If you are using this toolchainfile.cmake file outside of Buildroot and
# want to customize the compiler/linker flags, then:
# * set them all on the cmake command line, e.g.:
# cmake -DCMAKE_C_FLAGS="@@TARGET_CFLAGS@@ -Dsome_custom_flag" ...
# * and make sure the project's CMake code extends them like this if needed:
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Dsome_definitions")
set(CMAKE_C_FLAGS "@@TARGET_CFLAGS@@" CACHE STRING "Buildroot CFLAGS")
set(CMAKE_CXX_FLAGS "@@TARGET_CXXFLAGS@@" CACHE STRING "Buildroot CXXFLAGS")
set(CMAKE_EXE_LINKER_FLAGS "@@TARGET_LDFLAGS@@" CACHE STRING "Buildroot LDFLAGS for executables")
set(CMAKE_INSTALL_SO_NO_EXE 0) set(CMAKE_INSTALL_SO_NO_EXE 0)
set(CMAKE_PROGRAM_PATH "${RELOCATED_HOST_DIR}/usr/bin") set(CMAKE_PROGRAM_PATH "${RELOCATED_HOST_DIR}/usr/bin")
set(CMAKE_SYSROOT "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
set(CMAKE_FIND_ROOT_PATH "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@") set(CMAKE_FIND_ROOT_PATH "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
@ -29,3 +56,9 @@ set(ENV{PKG_CONFIG_SYSROOT_DIR} "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
# This toolchain file can be used both inside and outside Buildroot. # This toolchain file can be used both inside and outside Buildroot.
set(CMAKE_C_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CC@@") set(CMAKE_C_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CC@@")
set(CMAKE_CXX_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CXX@@") set(CMAKE_CXX_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CXX@@")
if(@@TOOLCHAIN_HAS_FORTRAN@@)
set(CMAKE_Fortran_FLAGS_DEBUG "" CACHE STRING "Debug Fortran FLAGS")
set(CMAKE_Fortran_FLAGS_RELEASE " -DNDEBUG" CACHE STRING "Release Fortran FLAGS")
set(CMAKE_Fortran_FLAGS "@@TARGET_FCFLAGS@@" CACHE STRING "Buildroot FCFLAGS")
set(CMAKE_Fortran_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_FC@@")
endif()

115
support/misc/utils.mk Normal file
View File

@ -0,0 +1,115 @@
################################################################################
#
# This file contains various utility macros and variables used about
# everywhere in make constructs.
#
################################################################################
# Strip quotes and then whitespaces
qstrip = $(strip $(subst ",,$(1)))
#"))
# Variables for use in Make constructs
comma := ,
empty :=
space := $(empty) $(empty)
# Case conversion macros. This is inspired by the 'up' macro from gmsl
# (http://gmsl.sf.net). It is optimised very heavily because these macros
# are used a lot. It is about 5 times faster than forking a shell and tr.
#
# The caseconvert-helper creates a definition of the case conversion macro.
# After expansion by the outer $(eval ), the UPPERCASE macro is defined as:
# $(strip $(eval __tmp := $(1)) $(eval __tmp := $(subst a,A,$(__tmp))) ... )
# In other words, every letter is substituted one by one.
#
# The caseconvert-helper allows us to create this definition out of the
# [FROM] and [TO] lists, so we don't need to write down every substition
# manually. The uses of $ and $$ quoting are chosen in order to do as
# much expansion as possible up-front.
#
# Note that it would be possible to conceive a slightly more optimal
# implementation that avoids the use of __tmp, but that would be even
# more unreadable and is not worth the effort.
[FROM] := a b c d e f g h i j k l m n o p q r s t u v w x y z - .
[TO] := A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _ _
define caseconvert-helper
$(1) = $$(strip \
$$(eval __tmp := $$(1))\
$(foreach c, $(2),\
$$(eval __tmp := $$(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)),$$(__tmp))))\
$$(__tmp))
endef
$(eval $(call caseconvert-helper,UPPERCASE,$(join $(addsuffix :,$([FROM])),$([TO]))))
$(eval $(call caseconvert-helper,LOWERCASE,$(join $(addsuffix :,$([TO])),$([FROM]))))
# Reverse the orders of words in a list. Again, inspired by the gmsl
# 'reverse' macro.
reverse = $(if $(1),$(call reverse,$(wordlist 2,$(words $(1)),$(1))) $(firstword $(1)))
# Sanitize macro cleans up generic strings so it can be used as a filename
# and in rules. Particularly useful for VCS version strings, that can contain
# slashes, colons (OK in filenames but not in rules), and spaces.
sanitize = $(subst $(space),_,$(subst :,_,$(subst /,_,$(strip $(1)))))
# MESSAGE Macro -- display a message in bold type
MESSAGE = echo "$(TERM_BOLD)>>> $($(PKG)_NAME) $($(PKG)_VERSION) $(call qstrip,$(1))$(TERM_RESET)"
TERM_BOLD := $(shell tput smso 2>/dev/null)
TERM_RESET := $(shell tput rmso 2>/dev/null)
# Utility functions for 'find'
# findfileclauses(filelist) => -name 'X' -o -name 'Y'
findfileclauses = $(call notfirstword,$(patsubst %,-o -name '%',$(1)))
# finddirclauses(base, dirlist) => -path 'base/dirX' -o -path 'base/dirY'
finddirclauses = $(call notfirstword,$(patsubst %,-o -path '$(1)/%',$(2)))
# Miscellaneous utility functions
# notfirstword(wordlist): returns all but the first word in wordlist
notfirstword = $(wordlist 2,$(words $(1)),$(1))
# Needed for the foreach loops to loop over the list of hooks, so that
# each hook call is properly separated by a newline.
define sep
endef
PERCENT = %
QUOTE = '
# ' # Meh... syntax-highlighting
# This macro properly escapes a command string, then prints it with printf:
#
# - first, backslash '\' are self-escaped, so that they do not escape
# the following char and so that printf properly outputs a backslash;
#
# - next, single quotes are escaped by closing an existing one, adding
# an escaped one, and re-openning a new one (see below for the reason);
#
# - then '%' signs are self-escaped so that the printf does not interpret
# them as a format specifier, in case the variable contains an actual
# printf with a format;
#
# - finally, $(sep) is replaced with the literal '\n' so that make does
# not break on the so-expanded variable, but so that the printf does
# correctly output an LF.
#
# Note: this must be escaped in this order to avoid over-escaping the
# previously escaped elements.
#
# Once everything has been escaped, it is passed between single quotes
# (that's why the single-quotes are escaped they way they are, above,
# and why the dollar sign is not escaped) to printf(1). A trailing
# newline is apended, too.
#
# Note: leading or trailing spaces are *not* stripped.
#
define PRINTF
printf '$(subst $(sep),\n,\
$(subst $(PERCENT),$(PERCENT)$(PERCENT),\
$(subst $(QUOTE),$(QUOTE)\$(QUOTE)$(QUOTE),\
$(subst \,\\,$(1)))))\n'
endef

View File

@ -31,6 +31,8 @@
# applied. The list of the patches applied is stored in '.applied_patches_list' # applied. The list of the patches applied is stored in '.applied_patches_list'
# file in the build directory. # file in the build directory.
set -e
silent= silent=
if [ "$1" = "-s" ] ; then if [ "$1" = "-s" ] ; then
# add option to be used by the patch tool # add option to be used by the patch tool
@ -63,8 +65,12 @@ find ${builddir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print0 | \
xargs -0 -r rm -f xargs -0 -r rm -f
function apply_patch { function apply_patch {
path=$1 path="${1%%/}"
patch=$2 patch="${2}"
case "${path}" in
/*) ;;
*) path="$PWD/${path}";;
esac
if [ "$3" ]; then if [ "$3" ]; then
type="series"; uncomp="cat" type="series"; uncomp="cat"
else else
@ -99,7 +105,15 @@ function apply_patch {
echo "Error: missing patch file ${path}/$patch" echo "Error: missing patch file ${path}/$patch"
exit 1 exit 1
fi fi
echo $patch >> ${builddir}/.applied_patches_list existing="$(grep -E "/${patch}\$" ${builddir}/.applied_patches_list || true)"
if [ -n "${existing}" ]; then
echo "Error: duplicate filename '${patch}'"
echo "Conflicting files are:"
echo " already applied: ${existing}"
echo " to be applied : ${path}/${patch}"
exit 1
fi
echo "${path}/${patch}" >> ${builddir}/.applied_patches_list
${uncomp} "${path}/$patch" | patch -g0 -p1 -E -d "${builddir}" -t -N $silent ${uncomp} "${path}/$patch" | patch -g0 -p1 -E -d "${builddir}" -t -N $silent
if [ $? != 0 ] ; then if [ $? != 0 ] ; then
echo "Patch failed! Please fix ${patch}!" echo "Patch failed! Please fix ${patch}!"
@ -141,6 +155,7 @@ function scan_patchdir {
fi fi
} }
touch ${builddir}/.applied_patches_list
scan_patchdir "$patchdir" "$patchpattern" scan_patchdir "$patchdir" "$patchpattern"
# Check for rejects... # Check for rejects...

221
support/scripts/br2-external Executable file
View File

@ -0,0 +1,221 @@
#!/bin/bash
set -e
# This script must be able to run with bash-3.1, so it can't use
# associative arrays. Instead, it emulates them using 'eval'. It
# can however use indexed arrays, supported since at least bash-3.0.
# The names of the br2-external trees, once validated.
declare -a BR2_EXT_NAMES
# URL to manual for help in converting old br2-external trees.
# Escape '#' so that make does not consider it a comment.
MANUAL_URL='https://buildroot.org/manual.html\#br2-external-converting'
main() {
local OPT OPTARG
local br2_ext ofile ofmt
while getopts :hkmo: OPT; do
case "${OPT}" in
h) help; exit 0;;
o) ofile="${OPTARG}";;
k) ofmt="kconfig";;
m) ofmt="mk";;
:) error "option '%s' expects a mandatory argument\n" "${OPTARG}";;
\?) error "unknown option '%s'\n" "${OPTARG}";;
esac
done
# Forget options; keep only positional args
shift $((OPTIND-1))
case "${ofmt}" in
mk|kconfig)
;;
*) error "no output format specified (-m/-k)\n";;
esac
if [ -z "${ofile}" ]; then
error "no output file specified (-o)\n"
fi
exec >"${ofile}"
do_validate ${@//:/ }
do_${ofmt}
}
# Validates the br2-external trees passed as arguments. Makes each of
# them canonical and store them in the global arrays BR2_EXT_NAMES
# and BR2_EXT_PATHS.
#
# Note: since this script is always first called from Makefile context
# to generate the Makefile fragment before it is called to generate the
# Kconfig snippet, we're sure that any error in do_validate will be
# interpreted in Makefile context. Going up to generating the Kconfig
# snippet means that there were no error.
#
do_validate() {
local br2_ext
if [ ${#} -eq 0 ]; then
# No br2-external tree is valid
return
fi
for br2_ext in "${@}"; do
do_validate_one "${br2_ext}"
done
}
do_validate_one() {
local br2_ext="${1}"
local br2_name br2_desc n d
if [ ! -d "${br2_ext}" ]; then
error "'%s': no such file or directory\n" "${br2_ext}"
fi
if [ ! -r "${br2_ext}" -o ! -x "${br2_ext}" ]; then
error "'%s': permission denied\n" "${br2_ext}"
fi
if [ ! -f "${br2_ext}/external.desc" ]; then
error "'%s': does not have a name (in 'external.desc'). See %s\n" \
"${br2_ext}" "${MANUAL_URL}"
fi
br2_name="$(sed -r -e '/^name: +(.*)$/!d; s//\1/' "${br2_ext}/external.desc")"
if [ -z "${br2_name}" ]; then
error "'%s/external.desc': does not define the name\n" "${br2_ext}"
fi
# Only ASCII chars in [A-Za-z0-9_] are permitted
n="$(sed -r -e 's/[A-Za-z0-9_]//g' <<<"${br2_name}" )"
if [ -n "${n}" ]; then
# Escape '$' so that it gets printed
error "'%s': name '%s' contains invalid chars: '%s'\n" \
"${br2_ext}" "${br2_name//\$/\$\$}" "${n//\$/\$\$}"
fi
eval d="\"\${BR2_EXT_PATHS_${br2_name}}\""
if [ -n "${d}" ]; then
error "'%s': name '%s' is already used in '%s'\n" \
"${br2_ext}" "${br2_name}" "${d}"
fi
br2_desc="$(sed -r -e '/^desc: +(.*)$/!d; s//\1/' "${br2_ext}/external.desc")"
if [ ! -f "${br2_ext}/external.mk" ]; then
error "'%s/external.mk': no such file or directory\n" "${br2_ext}"
fi
if [ ! -f "${br2_ext}/Config.in" ]; then
error "'%s/Config.in': no such file or directory\n" "${br2_ext}"
fi
# Register this br2-external tree, use an absolute canonical path
br2_ext="$( cd "${br2_ext}"; pwd )"
BR2_EXT_NAMES+=( "${br2_name}" )
eval BR2_EXT_PATHS_${br2_name}="\"\${br2_ext}\""
eval BR2_EXT_DESCS_${br2_name}="\"\${br2_desc:-\${br2_name}}\""
}
# Generate the .mk snippet that defines makefile variables
# for the br2-external tree
do_mk() {
local br2_name br2_ext
printf '#\n# Automatically generated file; DO NOT EDIT.\n#\n'
printf '\n'
printf 'BR2_EXTERNAL ?='
for br2_name in "${BR2_EXT_NAMES[@]}"; do
eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\""
printf ' %s' "${br2_ext}"
done
printf '\n'
printf 'BR2_EXTERNAL_NAMES = \n'
printf 'BR2_EXTERNAL_DIRS = \n'
printf 'BR2_EXTERNAL_MKS = \n'
if [ ${#BR2_EXT_NAMES[@]} -eq 0 ]; then
printf '\n'
printf '# No br2-external tree defined.\n'
return
fi
for br2_name in "${BR2_EXT_NAMES[@]}"; do
eval br2_desc="\"\${BR2_EXT_DESCS_${br2_name}}\""
eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\""
printf '\n'
printf 'BR2_EXTERNAL_NAMES += %s\n' "${br2_name}"
printf 'BR2_EXTERNAL_DIRS += %s\n' "${br2_ext}"
printf 'BR2_EXTERNAL_MKS += %s/external.mk\n' "${br2_ext}"
printf 'export BR2_EXTERNAL_%s_PATH = %s\n' "${br2_name}" "${br2_ext}"
printf 'export BR2_EXTERNAL_%s_DESC = %s\n' "${br2_name}" "${br2_desc}"
done
}
# Generate the kconfig snippet for the br2-external tree.
do_kconfig() {
local br2_name br2_ext
printf '#\n# Automatically generated file; DO NOT EDIT.\n#\n'
printf '\n'
if [ ${#BR2_EXT_NAMES[@]} -eq 0 ]; then
printf '# No br2-external tree defined.\n'
return
fi
printf 'menu "External options"\n'
printf '\n'
for br2_name in "${BR2_EXT_NAMES[@]}"; do
eval br2_desc="\"\${BR2_EXT_DESCS_${br2_name}}\""
eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\""
if [ ${#BR2_EXT_NAMES[@]} -gt 1 ]; then
printf 'menu "%s"\n' "${br2_desc}"
fi
printf 'comment "%s (in %s)"\n' "${br2_desc}" "${br2_ext}"
printf 'config BR2_EXTERNAL_%s_PATH\n' "${br2_name}"
printf '\tstring\n'
printf '\tdefault "%s"\n' "${br2_ext}"
printf 'source "%s/Config.in"\n' "${br2_ext}"
if [ ${#BR2_EXT_NAMES[@]} -gt 1 ]; then
printf 'endmenu # %s\n' "${br2_name}"
fi
printf '\n'
done
printf "endmenu # User-provided options\n"
}
help() {
cat <<-_EOF_
Usage:
${my_name} <-m|-k> -o FILE PATH
With -m, ${my_name} generates the makefile fragment that defines
variables related to the br2-external trees passed as positional
arguments.
With -k, ${my_name} generates the kconfig snippet to include the
configuration options specified in the br2-external trees passed
as positional arguments.
Using -k and -m together is not possible. The last one wins.
Options:
-m Generate the makefile fragment.
-k Generate the kconfig snippet.
-o FILE
FILE in which to generate the kconfig snippet or makefile
fragment.
Returns:
0 If no error
!0 If any error
_EOF_
}
error() { local fmt="${1}"; shift; printf "BR2_EXTERNAL_ERROR = ${fmt}" "${@}"; exit 1; }
my_name="${0##*/}"
main "${@}"

View File

@ -26,7 +26,7 @@ main() {
printf "*** ERROR: package %s installs executables without proper RPATH:\n" "${pkg}" printf "*** ERROR: package %s installs executables without proper RPATH:\n" "${pkg}"
fi fi
printf "*** %s\n" "${file}" printf "*** %s\n" "${file}"
done < <( find "${hostdir}"/usr/{bin,sbin} -type f -exec file {} + 2>/dev/null \ done < <( find "${hostdir}"/{,usr/}{bin,sbin} -type f -exec file {} + 2>/dev/null \
|sed -r -e '/^([^:]+):.*\<ELF\>.*\<executable\>.*/!d' \ |sed -r -e '/^([^:]+):.*\<ELF\>.*\<executable\>.*/!d' \
-e 's//\1/' \ -e 's//\1/' \
) )

View File

@ -0,0 +1,47 @@
#!/bin/bash
# This is a script to find, and correct, a problem with old versions of
# configure that affect powerpc64 and powerpc64le.
# The issue causes configure to incorrectly determine that shared library
# support is not present in the linker. This causes the package to build a
# static library rather than a dynamic one and although the build will succeed,
# it may cause packages that link with the static library it to fail due to
# undefined symbols.
# This script searches for files named 'configure' that appear to have this
# issue (by searching for a known bad pattern) and patching them.
set -e
if [ $# -ne 1 ]; then
echo "Usage: $0 <package build directory>"
exit 2
fi
srcdir="$1"
files=$(cd "$srcdir" && find . -name configure \
-exec grep -qF 'Generated by GNU Autoconf' {} \; \
-exec grep -qF 'ppc*-*linux*|powerpc*-*linux*)' {} \; -print)
# --ignore-whitespace is needed because some packages have included
# copies of configure scripts where tabs have been replaced with spaces.
for c in $files; do
patch --ignore-whitespace "$srcdir"/"$c" <<'EOF'
--- a/configure 2016-11-16 15:31:46.097447271 +1100
+++ b/configure 2008-07-21 12:17:23.000000000 +1000
@@ -4433,7 +4433,10 @@
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
- ppc*-*linux*|powerpc*-*linux*)
+ powerpcle-*linux*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*linux*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*)
EOF
done

View File

@ -1,513 +0,0 @@
## gen-manual-lists.py
##
## This script generates the following Buildroot manual appendices:
## - the package tables (one for the target, the other for host tools);
## - the deprecated items.
##
## Author(s):
## - Samuel Martin <s.martin49@gmail.com>
##
## Copyright (C) 2013 Samuel Martin
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##
from __future__ import print_function
from __future__ import unicode_literals
import os
import re
import sys
import datetime
from argparse import ArgumentParser
try:
import kconfiglib
except ImportError:
message = """
Could not find the module 'kconfiglib' in the PYTHONPATH:
"""
message += "\n".join([" {0}".format(path) for path in sys.path])
message += """
Make sure the Kconfiglib directory is in the PYTHONPATH, then relaunch the
script.
You can get kconfiglib from:
https://github.com/ulfalizer/Kconfiglib
"""
sys.stderr.write(message)
raise
def get_symbol_subset(root, filter_func):
""" Return a generator of kconfig items.
:param root_item: Root item of the generated subset of items
:param filter_func: Filter function
"""
if hasattr(root, "get_items"):
get_items = root.get_items
elif hasattr(root, "get_top_level_items"):
get_items = root.get_top_level_items
else:
message = "The symbol does not contain any subset of symbols"
raise Exception(message)
for item in get_items():
if item.is_symbol():
if not filter_func(item):
continue
yield item
elif item.is_menu() or item.is_choice():
for i in get_symbol_subset(item, filter_func):
yield i
def get_symbol_parents(item, root=None, enable_choice=False):
""" Return the list of the item's parents. The last item of the list is
the closest parent, the first the furthest.
:param item: Item from which the parent list is generated
:param root: Root item stopping the search (not included in the
parent list)
:param enable_choice: Flag enabling choices to appear in the parent list
"""
parent = item.get_parent()
parents = []
while parent and parent != root:
if parent.is_menu():
parents.append(parent.get_title())
elif enable_choice and parent.is_choice():
parents.append(parent.get_prompts()[0])
parent = parent.get_parent()
if isinstance(root, kconfiglib.Menu) or \
(enable_choice and isinstance(root, kconfiglib.Choice)):
parents.append("") # Dummy empty parent to get a leading arrow ->
parents.reverse()
return parents
def format_asciidoc_table(root, get_label_func, filter_func=lambda x: True,
format_func=lambda x: x,
enable_choice=False, sorted=True,
item_label=None):
""" Return the asciidoc formatted table of the items and their location.
:param root: Root item of the item subset
:param get_label_func: Item's label getter function
:param filter_func: Filter function to apply on the item subset
:param format_func: Function to format a symbol and the table header
:param enable_choice: Enable choices to appear as part of the item's
location
:param sorted: Flag to alphabetically sort the table
"""
lines = []
for item in get_symbol_subset(root, filter_func):
lines.append(format_func(what="symbol", symbol=item, root=root,
get_label_func=get_label_func,
enable_choice=enable_choice))
if sorted:
lines.sort(key=lambda x: x.lower())
table = ":halign: center\n\n"
width, columns = format_func(what="layout")
table = "[width=\"{0}\",cols=\"{1}\",options=\"header\"]\n".format(width, columns)
table += "|===================================================\n"
table += format_func(what="header", header=item_label, root=root)
table += "\n" + "".join(lines) + "\n"
table += "|===================================================\n"
return table
class Buildroot:
""" Buildroot configuration object.
"""
root_config = "Config.in"
package_dirname = "package"
package_prefixes = ["BR2_PACKAGE_", "BR2_PACKAGE_HOST_"]
re_pkg_prefix = re.compile(r"^(" + "|".join(package_prefixes) + ").*")
deprecated_symbol = "BR2_DEPRECATED"
list_in = """\
//
// Automatically generated list for Buildroot manual.
//
{table}
"""
list_info = {
'target-packages': {
'filename': "package-list",
'root_menu': "Target packages",
'filter': "_is_real_package",
'format': "_format_symbol_prompt_location",
'sorted': True,
},
'host-packages': {
'filename': "host-package-list",
'root_menu': "Host utilities",
'filter': "_is_real_package",
'format': "_format_symbol_prompt",
'sorted': True,
},
'virtual-packages': {
'filename': "virtual-package-list",
'root_menu': "Target packages",
'filter': "_is_virtual_package",
'format': "_format_symbol_virtual",
'sorted': True,
},
'deprecated': {
'filename': "deprecated-list",
'root_menu': None,
'filter': "_is_deprecated_feature",
'format': "_format_symbol_prompt_location",
'sorted': False,
},
}
def __init__(self):
self.base_dir = os.environ.get("TOPDIR")
self.output_dir = os.environ.get("O")
self.package_dir = os.path.join(self.base_dir, self.package_dirname)
self.config = kconfiglib.Config(os.path.join(self.base_dir,
self.root_config),
self.base_dir)
self._deprecated = self.config.get_symbol(self.deprecated_symbol)
self.gen_date = datetime.datetime.utcnow()
self.br_version_full = os.environ.get("BR2_VERSION_FULL")
if self.br_version_full and self.br_version_full.endswith("-git"):
self.br_version_full = self.br_version_full[:-4]
if not self.br_version_full:
self.br_version_full = "undefined"
def _get_package_symbols(self, package_name):
""" Return a tuple containing the target and host package symbol.
"""
symbols = re.sub("[-+.]", "_", package_name)
symbols = symbols.upper()
symbols = tuple([prefix + symbols for prefix in self.package_prefixes])
return symbols
def _is_deprecated(self, symbol):
""" Return True if the symbol is marked as deprecated, otherwise False.
"""
# This also catches BR2_DEPRECATED_SINCE_xxxx_xx
return bool([ symbol for x in symbol.get_referenced_symbols()
if x.get_name().startswith(self._deprecated.get_name()) ])
def _is_package(self, symbol, type='real'):
""" Return True if the symbol is a package or a host package, otherwise
False.
:param symbol: The symbol to check
:param type: Limit to 'real' or 'virtual' types of packages,
with 'real' being the default.
Note: only 'real' is (implictly) handled for now
"""
if not symbol.is_symbol():
return False
if type == 'real' and not symbol.get_prompts():
return False
if type == 'virtual' and symbol.get_prompts():
return False
if not self.re_pkg_prefix.match(symbol.get_name()):
return False
pkg_name = self._get_pkg_name(symbol)
pattern = "^(HOST_)?" + pkg_name + "$"
pattern = re.sub("_", ".", pattern)
pattern = re.compile(pattern, re.IGNORECASE)
# Here, we cannot just check for the location of the Config.in because
# of the "virtual" package.
#
# So, to check that a symbol is a package (not a package option or
# anything else), we check for the existence of the package *.mk file.
#
# By the way, to actually check for a package, we should grep all *.mk
# files for the following regex:
# "\$\(eval \$\((host-)?(generic|autotools|cmake)-package\)\)"
#
# Implementation details:
#
# * The package list is generated from the *.mk file existence, the
# first time this function is called. Despite the memory consumption,
# this list is stored because the execution time of this script is
# noticeably shorter than rescanning the package sub-tree for each
# symbol.
if not hasattr(self, "_package_list"):
pkg_list = []
for _, _, files in os.walk(self.package_dir):
for file_ in (f for f in files if f.endswith(".mk")):
pkg_list.append(re.sub(r"(.*?)\.mk", r"\1", file_))
setattr(self, "_package_list", pkg_list)
for pkg in getattr(self, "_package_list"):
if type == 'real':
if pattern.match(pkg) and not self._exists_virt_symbol(pkg):
return True
if type == 'virtual':
if pattern.match('has_' + pkg):
return True
return False
def _is_real_package(self, symbol):
return self._is_package(symbol, 'real')
def _is_virtual_package(self, symbol):
return self._is_package(symbol, 'virtual')
def _is_deprecated_feature(self, symbol):
return symbol.get_prompts() and self._is_deprecated(symbol)
def _exists_virt_symbol(self, pkg_name):
""" Return True if a symbol exists that defines the package as
a virtual package, False otherwise
:param pkg_name: The name of the package, for which to check if
a symbol exists defining it as a virtual package
"""
virt_pattern = "BR2_PACKAGE_HAS_" + pkg_name + "$"
virt_pattern = re.sub("_", ".", virt_pattern)
virt_pattern = re.compile(virt_pattern, re.IGNORECASE)
for sym in self.config:
if virt_pattern.match(sym.get_name()):
return True
return False
def _get_pkg_name(self, symbol):
""" Return the package name of the specified symbol.
:param symbol: The symbol to get the package name of
"""
return re.sub("BR2_PACKAGE_(HOST_)?(.*)", r"\2", symbol.get_name())
def _get_symbol_label(self, symbol, mark_deprecated=True):
""" Return the label (a.k.a. prompt text) of the symbol.
:param symbol: The symbol
:param mark_deprecated: Append a 'deprecated' to the label
"""
label = symbol.get_prompts()[0]
if self._is_deprecated(symbol) and mark_deprecated:
label += " *(deprecated)*"
return label
def _format_symbol_prompt(self, what=None, symbol=None, root=None,
enable_choice=False, header=None,
get_label_func=lambda x: x):
if what == "layout":
return ( "30%", "^1" )
if what == "header":
return "| {0:<40}\n".format(header)
if what == "symbol":
return "| {0:<40}\n".format(get_label_func(symbol))
message = "Invalid argument 'what': '%s'\n" % str(what)
message += "Allowed values are: 'layout', 'header' and 'symbol'"
raise Exception(message)
def _format_symbol_prompt_location(self, what=None, symbol=None, root=None,
enable_choice=False, header=None,
get_label_func=lambda x: x):
if what == "layout":
return ( "100%", "^1,4" )
if what == "header":
if hasattr(root, "get_title"):
loc_label = get_symbol_parents(root, None, enable_choice=enable_choice)
loc_label += [root.get_title(), "..."]
else:
loc_label = ["Location"]
return "| {0:<40} <| {1}\n".format(header, " -> ".join(loc_label))
if what == "symbol":
parents = get_symbol_parents(symbol, root, enable_choice)
return "| {0:<40} <| {1}\n".format(get_label_func(symbol),
" -> ".join(parents))
message = "Invalid argument 'what': '%s'\n" % str(what)
message += "Allowed values are: 'layout', 'header' and 'symbol'"
raise Exception(message)
def _format_symbol_virtual(self, what=None, symbol=None, root=None,
enable_choice=False, header=None,
get_label_func=lambda x: "?"):
def _symbol_is_legacy(symbol):
selects = [ s.get_name() for s in symbol.get_selected_symbols() ]
return ("BR2_LEGACY" in selects)
def _get_parent_package(sym):
if self._is_real_package(sym):
return None
# Trim the symbol name from its last component (separated with
# underscores), until we either find a symbol which is a real
# package, or until we have no component (i.e. just 'BR2')
name = sym.get_name()
while name != "BR2":
name = name.rsplit("_", 1)[0]
s = self.config.get_symbol(name)
if s is None:
continue
if self._is_real_package(s):
return s
return None
def _get_providers(symbol):
providers = list()
for sym in self.config:
if not sym.is_symbol():
continue
if _symbol_is_legacy(sym):
continue
selects = sym.get_selected_symbols()
if not selects:
continue
for s in selects:
if s == symbol:
if sym.get_prompts():
l = self._get_symbol_label(sym,False)
parent_pkg = _get_parent_package(sym)
if parent_pkg is not None:
l = self._get_symbol_label(parent_pkg, False) \
+ " (w/ " + l + ")"
providers.append(l)
else:
providers.extend(_get_providers(sym))
return providers
if what == "layout":
return ( "100%", "^1,4,4" )
if what == "header":
return "| {0:<20} <| {1:<32} <| Providers\n".format("Virtual packages", "Symbols")
if what == "symbol":
pkg = re.sub(r"^BR2_PACKAGE_HAS_(.+)$", r"\1", symbol.get_name())
providers = _get_providers(symbol)
return "| {0:<20} <| {1:<32} <| {2}\n".format(pkg.lower(),
'+' + symbol.get_name() + '+',
", ".join(providers))
message = "Invalid argument 'what': '%s'\n" % str(what)
message += "Allowed values are: 'layout', 'header' and 'symbol'"
raise Exception(message)
def print_list(self, list_type, enable_choice=True, enable_deprecated=True,
dry_run=False, output=None):
""" Print the requested list. If not dry run, then the list is
automatically written in its own file.
:param list_type: The list type to be generated
:param enable_choice: Flag enabling choices to appear in the list
:param enable_deprecated: Flag enabling deprecated items to appear in
the package lists
:param dry_run: Dry run (print the list in stdout instead of
writing the list file
"""
def _get_menu(title):
""" Return the first symbol menu matching the given title.
"""
menus = self.config.get_menus()
menu = [m for m in menus if m.get_title().lower() == title.lower()]
if not menu:
message = "No such menu: '{0}'".format(title)
raise Exception(message)
return menu[0]
list_config = self.list_info[list_type]
root_title = list_config.get('root_menu')
if root_title:
root_item = _get_menu(root_title)
else:
root_item = self.config
filter_ = getattr(self, list_config.get('filter'))
filter_func = lambda x: filter_(x)
format_func = getattr(self, list_config.get('format'))
if not enable_deprecated and list_type != "deprecated":
filter_func = lambda x: filter_(x) and not self._is_deprecated(x)
mark_depr = list_type != "deprecated"
get_label = lambda x: self._get_symbol_label(x, mark_depr)
item_label = "Features" if list_type == "deprecated" else "Packages"
table = format_asciidoc_table(root_item, get_label,
filter_func=filter_func,
format_func=format_func,
enable_choice=enable_choice,
sorted=list_config.get('sorted'),
item_label=item_label)
content = self.list_in.format(table=table)
if dry_run:
print(content)
return
if not output:
output_dir = self.output_dir
if not output_dir:
print("Warning: Undefined output directory.")
print("\tUse source directory as output location.")
output_dir = self.base_dir
output = os.path.join(output_dir,
list_config.get('filename') + ".txt")
if not os.path.exists(os.path.dirname(output)):
os.makedirs(os.path.dirname(output))
print("Writing the {0} list in:\n\t{1}".format(list_type, output))
with open(output, 'w') as fout:
fout.write(content)
if __name__ == '__main__':
list_types = ['target-packages', 'host-packages', 'virtual-packages', 'deprecated']
parser = ArgumentParser()
parser.add_argument("list_type", nargs="?", choices=list_types,
help="""\
Generate the given list (generate all lists if unspecified)""")
parser.add_argument("-n", "--dry-run", dest="dry_run", action='store_true',
help="Output the generated list to stdout")
parser.add_argument("--output-target", dest="output_target",
help="Output target package file")
parser.add_argument("--output-host", dest="output_host",
help="Output host package file")
parser.add_argument("--output-virtual", dest="output_virtual",
help="Output virtual package file")
parser.add_argument("--output-deprecated", dest="output_deprecated",
help="Output deprecated file")
args = parser.parse_args()
lists = [args.list_type] if args.list_type else list_types
buildroot = Buildroot()
for list_name in lists:
output = getattr(args, "output_" + list_name.split("-", 1)[0])
buildroot.print_list(list_name, dry_run=args.dry_run, output=output)

83
support/scripts/get-developers Executable file
View File

@ -0,0 +1,83 @@
#!/usr/bin/env python
import argparse
import getdeveloperlib
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('patches', metavar='P', type=argparse.FileType('r'), nargs='*',
help='list of patches (use - to read patches from stdin)')
parser.add_argument('-a', dest='architecture', action='store',
help='find developers in charge of this architecture')
parser.add_argument('-p', dest='package', action='store',
help='find developers in charge of this package')
parser.add_argument('-c', dest='check', action='store_const',
const=True, help='list files not handled by any developer')
return parser.parse_args()
def __main__():
devs = getdeveloperlib.parse_developers()
if devs is None:
sys.exit(1)
args = parse_args()
# Check that only one action is given
action = 0
if args.architecture is not None:
action += 1
if args.package is not None:
action += 1
if args.check:
action += 1
if len(args.patches) != 0:
action += 1
if action > 1:
print("Cannot do more than one action")
return
if action == 0:
print("No action specified")
return
# Handle the check action
if args.check:
files = getdeveloperlib.check_developers(devs)
for f in files:
print(f)
# Handle the architecture action
if args.architecture is not None:
for dev in devs:
if args.architecture in dev.architectures:
print(dev.name)
return
# Handle the package action
if args.package is not None:
for dev in devs:
if args.package in dev.packages:
print(dev.name)
return
# Handle the patches action
if len(args.patches) != 0:
(files, infras) = getdeveloperlib.analyze_patches(args.patches)
matching_devs = set()
for dev in devs:
# See if we have developers matching by package name
for f in files:
if dev.hasfile(f):
matching_devs.add(dev.name)
# See if we have developers matching by package infra
for i in infras:
if i in dev.infras:
matching_devs.add(dev.name)
result = "--to buildroot@buildroot.org"
for dev in matching_devs:
result += " --cc \"%s\"" % dev
if result != "":
print("git send-email %s" % result)
__main__()

View File

@ -0,0 +1,200 @@
import sys
import os
import re
import argparse
import glob
import subprocess
#
# Patch parsing functions
#
FIND_INFRA_IN_PATCH = re.compile("^\+\$\(eval \$\((host-)?([^-]*)-package\)\)$")
def analyze_patch(patch):
"""Parse one patch and return the list of files modified, added or
removed by the patch."""
files = set()
infras = set()
for line in patch:
# If the patch is adding a package, find which infra it is
m = FIND_INFRA_IN_PATCH.match(line)
if m:
infras.add(m.group(2))
if not line.startswith("+++ "):
continue
line.strip()
fname = line[line.find("/") + 1 : ].strip()
if fname == "dev/null":
continue
files.add(fname)
return (files, infras)
FIND_INFRA_IN_MK = re.compile("^\$\(eval \$\((host-)?([^-]*)-package\)\)$")
def fname_get_package_infra(fname):
"""Checks whether the file name passed as argument is a Buildroot .mk
file describing a package, and find the infrastructure it's using."""
if not fname.endswith(".mk"):
return None
if not os.path.exists(fname):
return None
with open(fname, "r") as f:
for l in f:
l = l.strip()
m = FIND_INFRA_IN_MK.match(l)
if m:
return m.group(2)
return None
def get_infras(files):
"""Search in the list of files for .mk files, and collect the package
infrastructures used by those .mk files."""
infras = set()
for fname in files:
infra = fname_get_package_infra(fname)
if infra:
infras.add(infra)
return infras
def analyze_patches(patches):
"""Parse a list of patches and returns the list of files modified,
added or removed by the patches, as well as the list of package
infrastructures used by those patches (if any)"""
allfiles = set()
allinfras = set()
for patch in patches:
(files, infras) = analyze_patch(patch)
allfiles = allfiles | files
allinfras = allinfras | infras
allinfras = allinfras | get_infras(allfiles)
return (allfiles, allinfras)
#
# DEVELOPERS file parsing functions
#
class Developer:
def __init__(self, name, files):
self.name = name
self.files = files
self.packages = parse_developer_packages(files)
self.architectures = parse_developer_architectures(files)
self.infras = parse_developer_infras(files)
def hasfile(self, f):
f = os.path.abspath(f)
for fs in self.files:
if f.startswith(fs):
return True
return False
def parse_developer_packages(fnames):
"""Given a list of file patterns, travel through the Buildroot source
tree to find which packages are implemented by those file
patterns, and return a list of those packages."""
packages = set()
for fname in fnames:
for root, dirs, files in os.walk(fname):
for f in files:
path = os.path.join(root, f)
if fname_get_package_infra(path):
pkg = os.path.splitext(f)[0]
packages.add(pkg)
return packages
def parse_arches_from_config_in(fname):
"""Given a path to an arch/Config.in.* file, parse it to get the list
of BR2_ARCH values for this architecture."""
arches = set()
with open(fname, "r") as f:
parsing_arches = False
for l in f:
l = l.strip()
if l == "config BR2_ARCH":
parsing_arches = True
continue
if parsing_arches:
m = re.match("^\s*default \"([^\"]*)\".*", l)
if m:
arches.add(m.group(1))
else:
parsing_arches = False
return arches
def parse_developer_architectures(fnames):
"""Given a list of file names, find the ones starting by
'arch/Config.in.', and use that to determine the architecture a
developer is working on."""
arches = set()
for fname in fnames:
if not re.match("^.*/arch/Config\.in\..*$", fname):
continue
arches = arches | parse_arches_from_config_in(fname)
return arches
def parse_developer_infras(fnames):
infras = set()
for fname in fnames:
m = re.match("^package/pkg-([^.]*).mk$", fname)
if m:
infras.add(m.group(1))
return infras
def parse_developers(basepath=None):
"""Parse the DEVELOPERS file and return a list of Developer objects."""
developers = []
linen = 0
if basepath == None:
basepath = os.getcwd()
with open(os.path.join(basepath, "DEVELOPERS"), "r") as f:
files = []
name = None
for l in f:
l = l.strip()
if l.startswith("#"):
continue
elif l.startswith("N:"):
if name is not None or len(files) != 0:
print("Syntax error in DEVELOPERS file, line %d" % linen)
name = l[2:].strip()
elif l.startswith("F:"):
fname = l[2:].strip()
dev_files = glob.glob(os.path.join(basepath, fname))
if len(dev_files) == 0:
print("WARNING: '%s' doesn't match any file" % fname)
files += dev_files
elif l == "":
if not name:
continue
developers.append(Developer(name, files))
files = []
name = None
else:
print("Syntax error in DEVELOPERS file, line %d: '%s'" % (linen, l))
return None
linen += 1
# handle last developer
if name is not None:
developers.append(Developer(name, files))
return developers
def check_developers(developers, basepath=None):
"""Look at the list of files versioned in Buildroot, and returns the
list of files that are not handled by any developer"""
if basepath == None:
basepath = os.getcwd()
cmd = ["git", "--git-dir", os.path.join(basepath, ".git"), "ls-files"]
files = subprocess.check_output(cmd).strip().split("\n")
unhandled_files = []
for f in files:
handled = False
for d in developers:
if d.hasfile(os.path.join(basepath, f)):
handled = True
break
if not handled:
unhandled_files.append(f)
return unhandled_files

View File

@ -276,7 +276,7 @@ parser.add_argument("--order", '-O', metavar="GRAPH_ORDER",
help="Ordering of packages: build or duration (for histogram only)") help="Ordering of packages: build or duration (for histogram only)")
parser.add_argument("--alternate-colors", '-c', action="store_true", parser.add_argument("--alternate-colors", '-c', action="store_true",
help="Use alternate colour-scheme") help="Use alternate colour-scheme")
parser.add_argument("--input", '-i', metavar="OUTPUT", parser.add_argument("--input", '-i', metavar="INPUT",
help="Input file (usually $(O)/build/build-time.log)") help="Input file (usually $(O)/build/build-time.log)")
parser.add_argument("--output", '-o', metavar="OUTPUT", required=True, parser.add_argument("--output", '-o', metavar="OUTPUT", required=True,
help="Output file (.pdf or .png extension)") help="Output file (.pdf or .png extension)")

View File

@ -26,6 +26,8 @@ import subprocess
import argparse import argparse
from fnmatch import fnmatch from fnmatch import fnmatch
import pkgutil
# Modes of operation: # Modes of operation:
MODE_FULL = 1 # draw full dependency graph for all selected packages MODE_FULL = 1 # draw full dependency graph for all selected packages
MODE_PKG = 2 # draw dependency graph for a given package MODE_PKG = 2 # draw dependency graph for a given package
@ -63,6 +65,10 @@ parser.add_argument("--transitive", dest="transitive", action='store_true',
default=False) default=False)
parser.add_argument("--no-transitive", dest="transitive", action='store_false', parser.add_argument("--no-transitive", dest="transitive", action='store_false',
help="Draw (do not draw) transitive dependencies") help="Draw (do not draw) transitive dependencies")
parser.add_argument("--direct", dest="direct", action='store_true', default=True,
help="Draw direct dependencies (the default)")
parser.add_argument("--reverse", dest="direct", action='store_false',
help="Draw reverse dependencies")
args = parser.parse_args() args = parser.parse_args()
check_only = args.check_only check_only = args.check_only
@ -73,7 +79,7 @@ else:
if check_only: if check_only:
sys.stderr.write("don't specify outfile and check-only at the same time\n") sys.stderr.write("don't specify outfile and check-only at the same time\n")
sys.exit(1) sys.exit(1)
outfile = open(args.outfile, "wb") outfile = open(args.outfile, "w")
if args.package is None: if args.package is None:
mode = MODE_FULL mode = MODE_FULL
@ -95,6 +101,16 @@ else:
transitive = args.transitive transitive = args.transitive
if args.direct:
get_depends_func = pkgutil.get_depends
arrow_dir = "forward"
else:
if mode == MODE_FULL:
sys.stderr.write("--reverse needs a package\n")
sys.exit(1)
get_depends_func = pkgutil.get_rdepends
arrow_dir = "back"
# Get the colours: we need exactly three colours, # Get the colours: we need exactly three colours,
# so no need not split more than 4 # so no need not split more than 4
# We'll let 'dot' validate the colours... # We'll let 'dot' validate the colours...
@ -108,28 +124,6 @@ host_colour = colours[2]
allpkgs = [] allpkgs = []
# Execute the "make <pkg>-show-version" command to get the version of a given
# list of packages, and return the version formatted as a Python dictionary.
def get_version(pkgs):
sys.stderr.write("Getting version for %s\n" % pkgs)
cmd = ["make", "-s", "--no-print-directory" ]
for pkg in pkgs:
cmd.append("%s-show-version" % pkg)
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True)
output = p.communicate()[0]
if p.returncode != 0:
sys.stderr.write("Error getting version %s\n" % pkgs)
sys.exit(1)
output = output.split("\n")
if len(output) != len(pkgs) + 1:
sys.stderr.write("Error getting version\n")
sys.exit(1)
version = {}
for i in range(0, len(pkgs)):
pkg = pkgs[i]
version[pkg] = output[i]
return version
# Execute the "make show-targets" command to get the list of the main # Execute the "make show-targets" command to get the list of the main
# Buildroot PACKAGES and return it formatted as a Python list. This # Buildroot PACKAGES and return it formatted as a Python list. This
# list is used as the starting point for full dependency graphs # list is used as the starting point for full dependency graphs
@ -144,33 +138,6 @@ def get_targets():
return [] return []
return output.split(' ') return output.split(' ')
# Execute the "make <pkg>-show-depends" command to get the list of
# dependencies of a given list of packages, and return the list of
# dependencies formatted as a Python dictionary.
def get_depends(pkgs):
sys.stderr.write("Getting dependencies for %s\n" % pkgs)
cmd = ["make", "-s", "--no-print-directory" ]
for pkg in pkgs:
cmd.append("%s-show-depends" % pkg)
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True)
output = p.communicate()[0]
if p.returncode != 0:
sys.stderr.write("Error getting dependencies %s\n" % pkgs)
sys.exit(1)
output = output.split("\n")
if len(output) != len(pkgs) + 1:
sys.stderr.write("Error getting dependencies\n")
sys.exit(1)
deps = {}
for i in range(0, len(pkgs)):
pkg = pkgs[i]
pkg_deps = output[i].split(" ")
if pkg_deps == ['']:
deps[pkg] = []
else:
deps[pkg] = pkg_deps
return deps
# Recursive function that builds the tree of dependencies for a given # Recursive function that builds the tree of dependencies for a given
# list of packages. The dependencies are built in a list called # list of packages. The dependencies are built in a list called
# 'dependencies', which contains tuples of the form (pkg1 -> # 'dependencies', which contains tuples of the form (pkg1 ->
@ -190,7 +157,7 @@ def get_all_depends(pkgs):
if len(filtered_pkgs) == 0: if len(filtered_pkgs) == 0:
return [] return []
depends = get_depends(filtered_pkgs) depends = get_depends_func(filtered_pkgs)
deps = set() deps = set()
for pkg in filtered_pkgs: for pkg in filtered_pkgs:
@ -363,7 +330,7 @@ if check_only:
sys.exit(0) sys.exit(0)
dict_deps = remove_extra_deps(dict_deps) dict_deps = remove_extra_deps(dict_deps)
dict_version = get_version([pkg for pkg in allpkgs dict_version = pkgutil.get_version([pkg for pkg in allpkgs
if pkg != "all" and not pkg.startswith("root")]) if pkg != "all" and not pkg.startswith("root")])
# Print the attributes of a node: label and fill-color # Print the attributes of a node: label and fill-color
@ -418,7 +385,7 @@ def print_pkg_deps(depth, pkg):
add = False add = False
break break
if add: if add:
outfile.write("%s -> %s\n" % (pkg_node_name(pkg), pkg_node_name(d))) outfile.write("%s -> %s [dir=%s]\n" % (pkg_node_name(pkg), pkg_node_name(d), arrow_dir))
print_pkg_deps(depth+1, d) print_pkg_deps(depth+1, d)
# Start printing the graph data # Start printing the graph data

View File

@ -0,0 +1,35 @@
#!/bin/bash
# Try to hardlink a file into a directory, fallback to copy on failure.
#
# Hardlink-or-copy the source file in the first argument into the
# destination directory in the second argument, using the basename in
# the third argument as basename for the destination file. If the third
# argument is missing, use the basename of the source file as basename
# for the destination file.
#
# In either case, remove the destination prior to doing the
# hardlink-or-copy.
#
# Note that this is NOT an atomic operation.
set -e
main() {
local src_file="${1}"
local dst_dir="${2}"
local dst_file="${3}"
if [ -n "${dst_file}" ]; then
dst_file="${dst_dir}/${dst_file}"
else
dst_file="${dst_dir}/${src_file##*/}"
fi
mkdir -p "${dst_dir}"
rm -f "${dst_file}"
ln -f "${src_file}" "${dst_file}" 2>/dev/null \
|| cp -f "${src_file}" "${dst_file}"
}
main "${@}"

File diff suppressed because it is too large Load Diff

View File

@ -35,7 +35,7 @@ PASSWD="${TARGET_DIR}/etc/passwd"
SHADOW="${TARGET_DIR}/etc/shadow" SHADOW="${TARGET_DIR}/etc/shadow"
GROUP="${TARGET_DIR}/etc/group" GROUP="${TARGET_DIR}/etc/group"
# /etc/gshadow is not part of the standard skeleton, so not everybody # /etc/gshadow is not part of the standard skeleton, so not everybody
# will have it, but some may hav it, and its content must be in sync # will have it, but some may have it, and its content must be in sync
# with /etc/group, so any use of gshadow must be conditional. # with /etc/group, so any use of gshadow must be conditional.
GSHADOW="${TARGET_DIR}/etc/gshadow" GSHADOW="${TARGET_DIR}/etc/gshadow"
@ -43,7 +43,7 @@ GSHADOW="${TARGET_DIR}/etc/gshadow"
# such as: # such as:
# BR2_DEFCONFIG="$(CONFIG_DIR)/defconfig" # BR2_DEFCONFIG="$(CONFIG_DIR)/defconfig"
# which when sourced from a shell script will eventually try to execute # which when sourced from a shell script will eventually try to execute
# a command name 'CONFIG_DIR', which is plain wrong for virtually every # a command named 'CONFIG_DIR', which is plain wrong for virtually every
# systems out there. # systems out there.
# So, we have to scan that file instead. Sigh... :-( # So, we have to scan that file instead. Sigh... :-(
PASSWD_METHOD="$( sed -r -e '/^BR2_TARGET_GENERIC_PASSWD_METHOD="(.*)"$/!d;' \ PASSWD_METHOD="$( sed -r -e '/^BR2_TARGET_GENERIC_PASSWD_METHOD="(.*)"$/!d;' \

View File

@ -94,10 +94,10 @@ for i in $(find boot/ linux/ package/ -name '*.mk' | sort) ; do
if test \ if test \
$i = "boot/common.mk" -o \ $i = "boot/common.mk" -o \
$i = "linux/linux-ext-ev3dev-linux-drivers.mk" -o \
$i = "linux/linux-ext-fbtft.mk" -o \ $i = "linux/linux-ext-fbtft.mk" -o \
$i = "linux/linux-ext-xenomai.mk" -o \ $i = "linux/linux-ext-xenomai.mk" -o \
$i = "linux/linux-ext-rtai.mk" -o \ $i = "linux/linux-ext-rtai.mk" -o \
$i = "package/efl/efl.mk" -o \
$i = "package/freescale-imx/freescale-imx.mk" -o \ $i = "package/freescale-imx/freescale-imx.mk" -o \
$i = "package/gcc/gcc.mk" -o \ $i = "package/gcc/gcc.mk" -o \
$i = "package/gstreamer/gstreamer.mk" -o \ $i = "package/gstreamer/gstreamer.mk" -o \

View File

@ -0,0 +1,62 @@
# Copyright (C) 2010-2013 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
import sys
import subprocess
# Execute the "make <pkg>-show-version" command to get the version of a given
# list of packages, and return the version formatted as a Python dictionary.
def get_version(pkgs):
sys.stderr.write("Getting version for %s\n" % pkgs)
cmd = ["make", "-s", "--no-print-directory" ]
for pkg in pkgs:
cmd.append("%s-show-version" % pkg)
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True)
output = p.communicate()[0]
if p.returncode != 0:
sys.stderr.write("Error getting version %s\n" % pkgs)
sys.exit(1)
output = output.split("\n")
if len(output) != len(pkgs) + 1:
sys.stderr.write("Error getting version\n")
sys.exit(1)
version = {}
for i in range(0, len(pkgs)):
pkg = pkgs[i]
version[pkg] = output[i]
return version
def _get_depends(pkgs, rule):
sys.stderr.write("Getting dependencies for %s\n" % pkgs)
cmd = ["make", "-s", "--no-print-directory" ]
for pkg in pkgs:
cmd.append("%s-%s" % (pkg, rule))
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True)
output = p.communicate()[0]
if p.returncode != 0:
sys.stderr.write("Error getting dependencies %s\n" % pkgs)
sys.exit(1)
output = output.split("\n")
if len(output) != len(pkgs) + 1:
sys.stderr.write("Error getting dependencies\n")
sys.exit(1)
deps = {}
for i in range(0, len(pkgs)):
pkg = pkgs[i]
pkg_deps = output[i].split(" ")
if pkg_deps == ['']:
deps[pkg] = []
else:
deps[pkg] = pkg_deps
return deps
# Execute the "make <pkg>-show-depends" command to get the list of
# dependencies of a given list of packages, and return the list of
# dependencies formatted as a Python dictionary.
def get_depends(pkgs):
return _get_depends(pkgs, 'show-depends')
# Execute the "make <pkg>-show-rdepends" command to get the list of
# reverse dependencies of a given list of packages, and return the
# list of dependencies formatted as a Python dictionary.
def get_rdepends(pkgs):
return _get_depends(pkgs, 'show-rdepends')

View File

@ -0,0 +1,24 @@
#!/usr/bin/env python
# Wrapper for python2 and python3 around compileall to raise exception
# when a python byte code generation failed.
#
# Inspired from:
# http://stackoverflow.com/questions/615632/how-to-detect-errors-from-compileall-compile-dir
from __future__ import print_function
import sys
import py_compile
import compileall
class ReportProblem:
def __nonzero__(self):
type, value, traceback = sys.exc_info()
if type is not None and issubclass(type, py_compile.PyCompileError):
print("Cannot compile %s" %value.file)
raise value
return 1
report_problem = ReportProblem()
compileall.compile_dir(sys.argv[1], quiet=report_problem)

View File

@ -1,30 +0,0 @@
Readme
======
Kconfiglib
----------
This python module, developped by Ulf Magnusson and released under the ISC
license, is fetched from:
https://github.com/ulfalizer/Kconfiglib
commit: a95f477eafc0b6708c3ce671fce7302ecec4f789
Kconfiglib license
~~~~~~~~~~~~~~~~~~
License (ISC)
Copyright (c) 2011-2013, Ulf Magnusson <ulfalizer@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

View File

@ -471,7 +471,7 @@ unshift @INC, sub {
} # END OF FATPACK CODE } # END OF FATPACK CODE
use 5.022; # same major version as target perl use 5.010;
use strict; use strict;
use warnings; use warnings;
use Fatal qw(open close); use Fatal qw(open close);
@ -484,6 +484,19 @@ use HTTP::Tiny;
use Safe; use Safe;
use MetaCPAN::API::Tiny; use MetaCPAN::API::Tiny;
# Below, 5.024 should be aligned with the version of perl actually
# bundled in Buildroot:
die <<"MSG" if $] < 5.024;
This script needs a host perl with the same major version as Buildroot target perl.
Your current host perl is:
$^X
version $]
You may install a local one by running:
perlbrew install perl-5.24.0
MSG
my ($help, $man, $quiet, $force, $recommend, $test, $host); my ($help, $man, $quiet, $force, $recommend, $test, $host);
my $target = 1; my $target = 1;
GetOptions( 'help|?' => \$help, GetOptions( 'help|?' => \$help,
@ -505,6 +518,7 @@ my %need_host; # name -> 1 if host package is needed
my %need_dlopen; # name -> 1 if requires dynamic library my %need_dlopen; # name -> 1 if requires dynamic library
my %deps_build; # name -> list of host dependencies my %deps_build; # name -> list of host dependencies
my %deps_runtime; # name -> list of target dependencies my %deps_runtime; # name -> list of target dependencies
my %deps_optional; # name -> list of optional target dependencies
my %license_files; # name -> list of license files my %license_files; # name -> list of license files
my %checksum; # author -> list of checksum my %checksum; # author -> list of checksum
my $mcpan = MetaCPAN::API::Tiny->new(); my $mcpan = MetaCPAN::API::Tiny->new();
@ -551,10 +565,10 @@ sub find_license_files {
} }
sub fetch { sub fetch {
my ($name, $need_target, $need_host) = @_; my ($name, $need_target, $need_host, $top) = @_;
$need_target{$name} = $need_target if $need_target; $need_target{$name} = $need_target if $need_target;
$need_host{$name} = $need_host if $need_host; $need_host{$name} = $need_host if $need_host;
unless ($dist{$name}) { unless ($dist{$name} && !$top) {
say qq{fetch ${name}} unless $quiet; say qq{fetch ${name}} unless $quiet;
my $result = $mcpan->release( distribution => $name ); my $result = $mcpan->release( distribution => $name );
$dist{$name} = $result; $dist{$name} = $result;
@ -563,21 +577,26 @@ sub fetch {
$license_files{$name} = find_license_files( $manifest ); $license_files{$name} = find_license_files( $manifest );
my %build = (); my %build = ();
my %runtime = (); my %runtime = ();
my %optional = ();
foreach my $dep (@{$result->{dependency}}) { foreach my $dep (@{$result->{dependency}}) {
my $modname = ${$dep}{module}; my $modname = ${$dep}{module};
next if $modname eq q{perl}; next if $modname eq q{perl};
next if $modname =~ m|^Alien|; next if $modname =~ m|^Alien|;
next if $modname =~ m|^Win32|; next if $modname =~ m|^Win32|;
next if !$test && $modname =~ m|^Test|; next if !($test && $top) && $modname =~ m|^Test|;
next if Module::CoreList::is_core( $modname, undef, $] ); next if Module::CoreList::is_core( $modname, undef, $] );
# we could use the host Module::CoreList data, because host perl and # we could use the host Module::CoreList data, because host perl and
# target perl have the same major version # target perl have the same major version
next if ${$dep}{phase} eq q{develop}; next if ${$dep}{phase} eq q{develop};
next if !$test && ${$dep}{phase} eq q{test}; next if !($test && $top) && ${$dep}{phase} eq q{test};
next if !$recommend && ${$dep}{relationship} ne q{requires};
my $distname = $mcpan->module( $modname )->{distribution}; my $distname = $mcpan->module( $modname )->{distribution};
if (${$dep}{phase} eq q{runtime}) { if (${$dep}{phase} eq q{runtime}) {
$runtime{$distname} = 1; if (${$dep}{relationship} eq q{requires}) {
$runtime{$distname} = 1;
}
else {
$optional{$distname} = 1 if $recommend && $top;
}
} }
else { # configure, build else { # configure, build
$build{$distname} = 1; $build{$distname} = 1;
@ -585,6 +604,7 @@ sub fetch {
} }
$deps_build{$name} = [keys %build]; $deps_build{$name} = [keys %build];
$deps_runtime{$name} = [keys %runtime]; $deps_runtime{$name} = [keys %runtime];
$deps_optional{$name} = [keys %optional];
foreach my $distname (@{$deps_build{$name}}) { foreach my $distname (@{$deps_build{$name}}) {
fetch( $distname, 0, 1 ); fetch( $distname, 0, 1 );
} }
@ -592,13 +612,16 @@ sub fetch {
fetch( $distname, $need_target, $need_host ); fetch( $distname, $need_target, $need_host );
$need_dlopen{$name} ||= $need_dlopen{$distname}; $need_dlopen{$name} ||= $need_dlopen{$distname};
} }
foreach my $distname (@{$deps_optional{$name}}) {
fetch( $distname, $need_target, $need_host );
}
} }
return; return;
} }
foreach my $distname (@ARGV) { foreach my $distname (@ARGV) {
# Command-line's distributions # Command-line's distributions
fetch( $distname, !!$target, !!$host ); fetch( $distname, !!$target, !!$host, 1 );
} }
say scalar keys %dist, q{ packages fetched.} unless $quiet; say scalar keys %dist, q{ packages fetched.} unless $quiet;
@ -683,6 +706,15 @@ while (my ($distname, $dist) = each %dist) {
say {$fh} qq{${brname}_LICENSE = ${license}} if $license && $license ne q{unknown}; say {$fh} qq{${brname}_LICENSE = ${license}} if $license && $license ne q{unknown};
say {$fh} qq{${brname}_LICENSE_FILES = ${license_files}} if $license_files; say {$fh} qq{${brname}_LICENSE_FILES = ${license_files}} if $license_files;
say {$fh} qq{}; say {$fh} qq{};
foreach (sort @{$deps_optional{$distname}}) {
next if grep { $_ eq $distname; } @{$deps_runtime{$_}}; # avoid cyclic dependencies
my $opt_brname = brname( $_ );
my $opt_fsname = fsname( $_ );
say {$fh} qq{ifeq (\$(BR2_PACKAGE_PERL_${opt_brname}),y)};
say {$fh} qq{${brname}_DEPENDENCIES += ${opt_fsname}};
say {$fh} qq{endif};
say {$fh} qq{};
}
say {$fh} qq{\$(eval \$(perl-package))} if $need_target{$distname}; say {$fh} qq{\$(eval \$(perl-package))} if $need_target{$distname};
say {$fh} qq{\$(eval \$(host-perl-package))} if $need_host{$distname}; say {$fh} qq{\$(eval \$(host-perl-package))} if $need_host{$distname};
close $fh; close $fh;
@ -727,10 +759,6 @@ support/scripts/scancpan Try-Tiny Moo
=head1 SYNOPSIS =head1 SYNOPSIS
curl -kL http://install.perlbrew.pl | bash
perlbrew install perl-5.18.2
supports/scripts/scancpan [options] [distname ...] supports/scripts/scancpan [options] [distname ...]
Options: Options:
@ -800,7 +828,7 @@ in order to work with the right CoreList data.
=head1 LICENSE =head1 LICENSE
Copyright (C) 2013-2014 by Francois Perrad <francois.perrad@gadz.org> Copyright (C) 2013-2016 by Francois Perrad <francois.perrad@gadz.org>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

653
support/scripts/scanpypi Executable file
View File

@ -0,0 +1,653 @@
#!/usr/bin/python2
"""
Utility for building Buildroot packages for existing PyPI packages
Any package built by scanpypi should be manually checked for
errors.
"""
from __future__ import print_function
import argparse
import json
import urllib2
import sys
import os
import shutil
import StringIO
import tarfile
import zipfile
import errno
import hashlib
import re
import textwrap
import tempfile
import imp
from functools import wraps
def setup_decorator(func, method):
"""
Decorator for distutils.core.setup and setuptools.setup.
Puts the arguments with which setup is called as a dict
Add key 'method' which should be either 'setuptools' or 'distutils'.
Keyword arguments:
func -- either setuptools.setup or distutils.core.setup
method -- either 'setuptools' or 'distutils'
"""
@wraps(func)
def closure(*args, **kwargs):
# Any python packages calls its setup function to be installed.
# Argument 'name' of this setup function is the package's name
BuildrootPackage.setup_args[kwargs['name']] = kwargs
BuildrootPackage.setup_args[kwargs['name']]['method'] = method
return closure
# monkey patch
import setuptools
setuptools.setup = setup_decorator(setuptools.setup, 'setuptools')
import distutils
distutils.core.setup = setup_decorator(setuptools.setup, 'distutils')
def find_file_upper_case(filenames, path='./'):
"""
List generator:
Recursively find files that matches one of the specified filenames.
Returns a relative path starting with path argument.
Keyword arguments:
filenames -- List of filenames to be found
path -- Path to the directory to search
"""
for root, dirs, files in os.walk(path):
for file in files:
if file.upper() in filenames:
yield (os.path.join(root, file))
def pkg_buildroot_name(pkg_name):
"""
Returns the Buildroot package name for the PyPI package pkg_name.
Remove all non alphanumeric characters except -
Also lowers the name and adds 'python-' suffix
Keyword arguments:
pkg_name -- String to rename
"""
name = re.sub('[^\w-]', '', pkg_name.lower())
prefix = 'python-'
pattern = re.compile('^(?!' + prefix + ')(.+?)$')
name = pattern.sub(r'python-\1', name)
return name
class DownloadFailed(Exception):
pass
class BuildrootPackage():
"""This class's methods are not meant to be used individually please
use them in the correct order:
__init__
download_package
extract_package
load_module
get_requirements
create_package_mk
create_hash_file
create_config_in
"""
setup_args = {}
def __init__(self, real_name, pkg_folder):
self.real_name = real_name
self.buildroot_name = pkg_buildroot_name(self.real_name)
self.pkg_dir = os.path.join(pkg_folder, self.buildroot_name)
self.mk_name = self.buildroot_name.upper().replace('-', '_')
self.as_string = None
self.md5_sum = None
self.metadata = None
self.metadata_name = None
self.metadata_url = None
self.pkg_req = None
self.setup_metadata = None
self.tmp_extract = None
self.used_url = None
self.filename = None
self.url = None
self.version = None
def fetch_package_info(self):
"""
Fetch a package's metadata from the python package index
"""
self.metadata_url = 'https://pypi.python.org/pypi/{pkg}/json'.format(
pkg=self.real_name)
try:
pkg_json = urllib2.urlopen(self.metadata_url).read().decode()
except urllib2.HTTPError as error:
print('ERROR:', error.getcode(), error.msg, file=sys.stderr)
print('ERROR: Could not find package {pkg}.\n'
'Check syntax inside the python package index:\n'
'https://pypi.python.org/pypi/ '
.format(pkg=self.real_name))
raise
except urllib2.URLError:
print('ERROR: Could not find package {pkg}.\n'
'Check syntax inside the python package index:\n'
'https://pypi.python.org/pypi/ '
.format(pkg=self.real_name))
raise
self.metadata = json.loads(pkg_json)
self.version = self.metadata['info']['version']
self.metadata_name = self.metadata['info']['name']
def download_package(self):
"""
Download a package using metadata from pypi
"""
try:
self.metadata['urls'][0]['filename']
except IndexError:
print(
'Non-conventional package, ',
'please check carefully after creation')
self.metadata['urls'] = [{
'packagetype': 'sdist',
'url': self.metadata['info']['download_url'],
'md5_digest': None}]
# In this case, we can't get the name of the downloaded file
# from the pypi api, so we need to find it, this should work
urlpath = urllib2.urlparse.urlparse(
self.metadata['info']['download_url']).path
# urlparse().path give something like
# /path/to/file-version.tar.gz
# We use basename to remove /path/to
self.metadata['urls'][0]['filename'] = os.path.basename(urlpath)
for download_url in self.metadata['urls']:
if 'bdist' in download_url['packagetype']:
continue
try:
print('Downloading package {pkg} from {url}...'.format(
pkg=self.real_name, url=download_url['url']))
download = urllib2.urlopen(download_url['url'])
except urllib2.HTTPError as http_error:
download = http_error
else:
self.used_url = download_url
self.as_string = download.read()
if not download_url['md5_digest']:
break
self.md5_sum = hashlib.md5(self.as_string).hexdigest()
if self.md5_sum == download_url['md5_digest']:
break
else:
if download.__class__ == urllib2.HTTPError:
raise download
raise DownloadFailed('Failed to downloas package {pkg}'
.format(pkg=self.real_name))
self.filename = self.used_url['filename']
self.url = self.used_url['url']
def extract_package(self, tmp_path):
"""
Extract the package contents into a directrory
Keyword arguments:
tmp_path -- directory where you want the package to be extracted
"""
as_file = StringIO.StringIO(self.as_string)
if self.filename[-3:] == 'zip':
with zipfile.ZipFile(as_file) as as_zipfile:
tmp_pkg = os.path.join(tmp_path, self.buildroot_name)
try:
os.makedirs(tmp_pkg)
except OSError as exception:
if exception.errno != errno.EEXIST:
print("ERROR: ", exception.message, file=sys.stderr)
return None, None
print('WARNING:', exception.message, file=sys.stderr)
print('Removing {pkg}...'.format(pkg=tmp_pkg))
shutil.rmtree(tmp_pkg)
os.makedirs(tmp_pkg)
as_zipfile.extractall(tmp_pkg)
else:
with tarfile.open(fileobj=as_file) as as_tarfile:
tmp_pkg = os.path.join(tmp_path, self.buildroot_name)
try:
os.makedirs(tmp_pkg)
except OSError as exception:
if exception.errno != errno.EEXIST:
print("ERROR: ", exception.message, file=sys.stderr)
return None, None
print('WARNING:', exception.message, file=sys.stderr)
print('Removing {pkg}...'.format(pkg=tmp_pkg))
shutil.rmtree(tmp_pkg)
os.makedirs(tmp_pkg)
as_tarfile.extractall(tmp_pkg)
tmp_extract = '{folder}/{name}-{version}'
self.tmp_extract = tmp_extract.format(
folder=tmp_pkg,
name=self.metadata_name,
version=self.version)
def load_setup(self):
"""
Loads the corresponding setup and store its metadata
"""
current_dir = os.getcwd()
os.chdir(self.tmp_extract)
sys.path.append(self.tmp_extract)
s_file, s_path, s_desc = imp.find_module('setup', [self.tmp_extract])
setup = imp.load_module('setup', s_file, s_path, s_desc)
try:
self.setup_metadata = self.setup_args[self.metadata_name]
except KeyError:
# This means setup was not called which most likely mean that it is
# called through the if __name__ == '__main__' directive.
# In this case, we can only pray that it is called through a
# function called main() in setup.py.
setup.main([]) # Will raise AttributeError if not found
self.setup_metadata = self.setup_args[self.metadata_name]
# Here we must remove the module the hard way.
# We must do this because of a very sepcific case: if a package calls
# setup from the __main__ but does not come with a 'main()' function,
# for some reason setup.main([]) will successfully call the main
# function of a previous package...
sys.modules.pop('setup',None)
del setup
os.chdir(current_dir)
sys.path.remove(self.tmp_extract)
def get_requirements(self, pkg_folder):
"""
Retrieve dependencies from the metadata found in the setup.py script of
a pypi package.
Keyword Arguments:
pkg_folder -- location of the already created packages
"""
if 'install_requires' not in self.setup_metadata:
self.pkg_req = None
return set()
self.pkg_req = self.setup_metadata['install_requires']
self.pkg_req = [re.sub('([-.\w]+).*', r'\1', req)
for req in self.pkg_req]
req_not_found = self.pkg_req
self.pkg_req = map(pkg_buildroot_name, self.pkg_req)
pkg_tuples = zip(req_not_found, self.pkg_req)
# pkg_tuples is a list of tuples that looks like
# ('werkzeug','python-werkzeug') because I need both when checking if
# dependencies already exist or are already in the download list
req_not_found = set(
pkg[0] for pkg in pkg_tuples
if not os.path.isdir(pkg[1])
)
return req_not_found
def __create_mk_header(self):
"""
Create the header of the <package_name>.mk file
"""
header = ['#' * 80 + '\n']
header.append('#\n')
header.append('# {name}\n'.format(name=self.buildroot_name))
header.append('#\n')
header.append('#' * 80 + '\n')
header.append('\n')
return header
def __create_mk_download_info(self):
"""
Create the lines refering to the download information of the
<package_name>.mk file
"""
lines = []
version_line = '{name}_VERSION = {version}\n'.format(
name=self.mk_name,
version=self.version)
lines.append(version_line)
targz = self.filename.replace(
self.version,
'$({name}_VERSION)'.format(name=self.mk_name))
targz_line = '{name}_SOURCE = {filename}\n'.format(
name=self.mk_name,
filename=targz)
lines.append(targz_line)
if self.filename not in self.url:
# Sometimes the filename is in the url, sometimes it's not
site_url = self.url
else:
site_url = self.url[:self.url.find(self.filename)]
site_line = '{name}_SITE = {url}'.format(name=self.mk_name,
url=site_url)
site_line = site_line.rstrip('/') + '\n'
lines.append(site_line)
return lines
def __create_mk_setup(self):
"""
Create the line refering to the setup method of the package of the
<package_name>.mk file
There are two things you can use to make an installer
for a python package: distutils or setuptools
distutils comes with python but does not support dependencies.
distutils is mostly still there for backward support.
setuptools is what smart people use,
but it is not shipped with python :(
"""
lines = []
setup_type_line = '{name}_SETUP_TYPE = {method}\n'.format(
name=self.mk_name,
method=self.setup_metadata['method'])
lines.append(setup_type_line)
return lines
def __create_mk_license(self):
"""
Create the lines referring to the package's license informations of the
<package_name>.mk file
The license is found using the metadata from pypi.
In the metadata, the license can be found either with standard names in
the classifiers part or with naming from the packager in the "License"
part.
From the classifiers, the license is "translated" according to
buildroot standards if need be (i.e. from Apache Software License to
Apache-2.0).
From the License part, we cannot guess what formatting the packager
used. Hence, it is likely to be incorrect. (i.e. Apache License 2.0
instead of Apache-2.0).
The license's files are found by searching the package for files named
license or license.txt (case insensitive).
If more than one license file is found, the user is asked to select
which ones he wants to use.
"""
license_dict = {
'Apache Software License': 'Apache-2.0',
'BSD License': 'BSD',
'European Union Public Licence 1.0': 'EUPLv1.0',
'European Union Public Licence 1.1': 'EUPLv1.1',
"GNU General Public License": "GPL",
"GNU General Public License v2": "GPLv2",
"GNU General Public License v2 or later": "GPLv2+",
"GNU General Public License v3": "GPLv3",
"GNU General Public License v3 or later": "GPLv3+",
"GNU Lesser General Public License v2": "LGPLv2.1",
"GNU Lesser General Public License v2 or later": "LGPLv2.1+",
"GNU Lesser General Public License v3": "LGPLv3",
"GNU Lesser General Public License v3 or later": "LGPLv3+",
"GNU Library or Lesser General Public License": "LGPLv2",
"ISC License": "ISC",
"MIT License": "MIT",
"Mozilla Public License 1.0": "MPL-1.0",
"Mozilla Public License 1.1": "MPL-1.1",
"Mozilla Public License 2.0": "MPL-2.0",
"Zope Public License": "ZPL"
}
regexp = re.compile('^License :* *.* *:+ (.*)( \(.*\))?$')
classifiers_licenses = [regexp.sub(r"\1", lic)
for lic in self.metadata['info']['classifiers']
if regexp.match(lic)]
licenses = map(lambda x: license_dict[x] if x in license_dict else x,
classifiers_licenses)
lines = []
if not len(licenses):
print('WARNING: License has been set to "{license}". It is most'
' likely wrong, please change it if need be'.format(
license=', '.join(licenses)))
licenses = [self.metadata['info']['license']]
license_line = '{name}_LICENSE = {license}\n'.format(
name=self.mk_name,
license=', '.join(licenses))
lines.append(license_line)
filenames = ['LICENCE', 'LICENSE', 'LICENSE.TXT', 'COPYING',
'COPYING.TXT']
license_files = list(find_file_upper_case(filenames, self.tmp_extract))
license_files = [license.replace(self.tmp_extract, '')[1:]
for license in license_files]
if len(license_files) > 0:
if len(license_files) > 1:
print('More than one file found for license:',
', '.join(license_files))
license_files = [filename
for index, filename in enumerate(license_files)]
license_file_line = ('{name}_LICENSE_FILES ='
' {files}\n'.format(
name=self.mk_name,
files=' '.join(license_files)))
lines.append(license_file_line)
else:
print('WARNING: No license file found,'
' please specify it manually afterwards')
license_file_line = '# No license file found\n'
return lines
def __create_mk_requirements(self):
"""
Create the lines referring to the dependencies of the of the
<package_name>.mk file
Keyword Arguments:
pkg_name -- name of the package
pkg_req -- dependencies of the package
"""
lines = []
dependencies_line = ('{name}_DEPENDENCIES ='
' {reqs}\n'.format(
name=self.mk_name,
reqs=' '.join(self.pkg_req)))
lines.append(dependencies_line)
return lines
def create_package_mk(self):
"""
Create the lines corresponding to the <package_name>.mk file
"""
pkg_mk = '{name}.mk'.format(name=self.buildroot_name)
path_to_mk = os.path.join(self.pkg_dir, pkg_mk)
print('Creating {file}...'.format(file=path_to_mk))
lines = self.__create_mk_header()
lines += self.__create_mk_download_info()
lines += self.__create_mk_setup()
lines += self.__create_mk_license()
lines.append('\n')
lines.append('$(eval $(python-package))')
lines.append('\n')
with open(path_to_mk, 'w') as mk_file:
mk_file.writelines(lines)
def create_hash_file(self):
"""
Create the lines corresponding to the <package_name>.hash files
"""
pkg_hash = '{name}.hash'.format(name=self.buildroot_name)
path_to_hash = os.path.join(self.pkg_dir, pkg_hash)
print('Creating {filename}...'.format(filename=path_to_hash))
lines = []
if self.used_url['md5_digest']:
md5_comment = '# md5 from {url}, sha256 locally computed\n'.format(
url=self.metadata_url)
lines.append(md5_comment)
hash_line = '{method}\t{digest} {filename}\n'.format(
method='md5',
digest=self.used_url['md5_digest'],
filename=self.filename)
lines.append(hash_line)
digest = hashlib.sha256(self.as_string).hexdigest()
hash_line = '{method}\t{digest} {filename}\n'.format(
method='sha256',
digest=digest,
filename=self.filename)
lines.append(hash_line)
with open(path_to_hash, 'w') as hash_file:
hash_file.writelines(lines)
def create_config_in(self):
"""
Creates the Config.in file of a package
"""
path_to_config = os.path.join(self.pkg_dir, 'Config.in')
print('Creating {file}...'.format(file=path_to_config))
lines = []
config_line = 'config BR2_PACKAGE_{name}\n'.format(
name=self.mk_name)
lines.append(config_line)
bool_line = '\tbool "{name}"\n'.format(name=self.buildroot_name)
lines.append(bool_line)
if self.pkg_req:
for dep in self.pkg_req:
dep_line = '\tselect BR2_PACKAGE_{req} # runtime\n'.format(
req=dep.upper().replace('-', '_'))
lines.append(dep_line)
lines.append('\thelp\n')
help_lines = textwrap.wrap(self.metadata['info']['summary'],
initial_indent='\t ',
subsequent_indent='\t ')
# make sure a help text is terminated with a full stop
if help_lines[-1][-1] != '.':
help_lines[-1] += '.'
# \t + two spaces is 3 char long
help_lines.append('')
help_lines.append('\t ' + self.metadata['info']['home_page'])
help_lines = map(lambda x: x + '\n', help_lines)
lines += help_lines
with open(path_to_config, 'w') as config_file:
config_file.writelines(lines)
def main():
# Building the parser
parser = argparse.ArgumentParser(
description="Creates buildroot packages from the metadata of "
"an existing PyPI packages and include it "
"in menuconfig")
parser.add_argument("packages",
help="list of packages to be created",
nargs='+')
parser.add_argument("-o", "--output",
help="""
Output directory for packages.
Default is ./package
""",
default='./package')
args = parser.parse_args()
packages = list(set(args.packages))
# tmp_path is where we'll extract the files later
tmp_prefix = 'scanpypi-'
pkg_folder = args.output
tmp_path = tempfile.mkdtemp(prefix=tmp_prefix)
try:
for real_pkg_name in packages:
package = BuildrootPackage(real_pkg_name, pkg_folder)
print('buildroot package name for {}:'.format(package.real_name),
package.buildroot_name)
# First we download the package
# Most of the info we need can only be found inside the package
print('Package:', package.buildroot_name)
print('Fetching package', package.real_name)
try:
package.fetch_package_info()
except (urllib2.URLError, urllib2.HTTPError):
continue
if package.metadata_name.lower() == 'setuptools':
# setuptools imports itself, that does not work very well
# with the monkey path at the begining
print('Error: setuptools cannot be built using scanPyPI')
continue
try:
package.download_package()
except urllib2.HTTPError as error:
print('Error: {code} {reason}'.format(code=error.code,
reason=error.reason))
print('Error downloading package :', package.buildroot_name)
print()
continue
# extract the tarball
try:
package.extract_package(tmp_path)
except (tarfile.ReadError, zipfile.BadZipfile):
print('Error extracting package {}'.format(package.real_name))
print()
continue
# Loading the package install info from the package
try:
package.load_setup()
except ImportError as err:
if 'buildutils' in err.message:
print('This package needs buildutils')
else:
raise
continue
except AttributeError:
print('Error: Could not install package {pkg}'.format(
pkg=package.real_name))
continue
# Package requirement are an argument of the setup function
req_not_found = package.get_requirements(pkg_folder)
req_not_found = req_not_found.difference(packages)
packages += req_not_found
if req_not_found:
print('Added packages \'{pkgs}\' as dependencies of {pkg}'
.format(pkgs=", ".join(req_not_found),
pkg=package.buildroot_name))
print('Checking if package {name} already exists...'.format(
name=package.pkg_dir))
try:
os.makedirs(package.pkg_dir)
except OSError as exception:
if exception.errno != errno.EEXIST:
print("ERROR: ", exception.message, file=sys.stderr)
continue
print('Error: Package {name} already exists'
.format(name=package.pkg_dir))
del_pkg = raw_input(
'Do you want to delete existing package ? [y/N]')
if del_pkg.lower() == 'y':
shutil.rmtree(package.pkg_dir)
os.makedirs(package.pkg_dir)
else:
continue
package.create_package_mk()
package.create_hash_file()
package.create_config_in()
print()
# printing an empty line for visual confort
finally:
shutil.rmtree(tmp_path)
if __name__ == "__main__":
main()

View File

@ -66,7 +66,7 @@ def build_package_dict(builddir):
filesdict = {} filesdict = {}
with open(os.path.join(builddir, "build", "packages-file-list.txt")) as filelistf: with open(os.path.join(builddir, "build", "packages-file-list.txt")) as filelistf:
for l in filelistf.readlines(): for l in filelistf.readlines():
pkg, fpath = l.split(",") pkg, fpath = l.split(",", 1)
# remove the initial './' in each file path # remove the initial './' in each file path
fpath = fpath.strip()[2:] fpath = fpath.strip()[2:]
fullpath = os.path.join(builddir, "target", fpath) fullpath = os.path.join(builddir, "target", fpath)
@ -88,11 +88,20 @@ def build_package_dict(builddir):
def build_package_size(filesdict, builddir): def build_package_size(filesdict, builddir):
pkgsize = collections.defaultdict(int) pkgsize = collections.defaultdict(int)
seeninodes = set()
for root, _, files in os.walk(os.path.join(builddir, "target")): for root, _, files in os.walk(os.path.join(builddir, "target")):
for f in files: for f in files:
fpath = os.path.join(root, f) fpath = os.path.join(root, f)
if os.path.islink(fpath): if os.path.islink(fpath):
continue continue
st = os.stat(fpath)
if st.st_ino in seeninodes:
# hard link
continue
else:
seeninodes.add(st.st_ino)
frelpath = os.path.relpath(fpath, os.path.join(builddir, "target")) frelpath = os.path.relpath(fpath, os.path.join(builddir, "target"))
if not frelpath in filesdict: if not frelpath in filesdict:
print("WARNING: %s is not part of any package" % frelpath) print("WARNING: %s is not part of any package" % frelpath)
@ -100,7 +109,7 @@ def build_package_size(filesdict, builddir):
else: else:
pkg = filesdict[frelpath][0] pkg = filesdict[frelpath][0]
pkgsize[pkg] += os.path.getsize(fpath) pkgsize[pkg] += st.st_size
return pkgsize return pkgsize

188
support/scripts/test-pkg Executable file
View File

@ -0,0 +1,188 @@
#!/bin/bash
set -e
TOOLCHAINS_URL='http://autobuild.buildroot.org/toolchains/configs/toolchain-configs.csv'
main() {
local o O opts
local cfg dir pkg random toolchain
local -a toolchains
o='hc:d:p:r:'
O='help,config-snippet:build-dir:package:,random:'
opts="$( getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}" )"
eval set -- "${opts}"
random=0
while [ ${#} -gt 0 ]; do
case "${1}" in
(-h|--help)
help; exit 0
;;
(-c|--config-snippet)
cfg="${2}"; shift 2
;;
(-d|--build-dir)
dir="${2}"; shift 2
;;
(-p|--package)
pkg="${2}"; shift 2
;;
(-r|--random)
random="${2}"; shift 2
;;
(--)
shift; break
;;
esac
done
if [ -z "${cfg}" ]; then
printf "error: no config snippet specified\n" >&2; exit 1
fi
if [ -z "${dir}" ]; then
dir="${HOME}/br-test-pkg"
fi
# Extract the URLs of the toolchains; drop internal toolchains
# E.g.: http://server/path/to/name.config,arch,libc
# --> http://server/path/to/name.config
toolchains=( $( curl -s "${TOOLCHAINS_URL}" \
|sed -r -e 's/,.*//; /internal/d;' \
|if [ ${random} -gt 0 ]; then \
sort -R |head -n ${random}
else
cat
fi |sort
)
)
if [ ${#toolchains[@]} -eq 0 ]; then
printf "error: no toolchain found (networking issue?)\n" >&2; exit 1
fi
for toolchain in "${toolchains[@]}"; do
build_one "${dir}" "${toolchain}" "${cfg}" "${pkg}"
done
}
build_one() {
local dir="${1}"
local url="${2}"
local cfg="${3}"
local pkg="${4}"
local toolchain line skip
# Using basename(1) on a URL works nicely
toolchain="$( basename "${url}" .config )"
printf "%40s: " "${toolchain}"
dir="${dir}/${toolchain}"
mkdir -p "${dir}"
printf "download config"
if ! curl -s "${url}" >"${dir}/.config"; then
printf ": FAILED\n"
return
fi
cat >>"${dir}/.config" <<-_EOF_
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
# BR2_TARGET_ROOTFS_TAR is not set
_EOF_
cat "${cfg}" >>"${dir}/.config"
printf ", olddefconfig"
if ! make O="${dir}" olddefconfig >/dev/null 2>&1; then
printf ": FAILED\n"
return
fi
# We want all the options from the snippet to be present as-is (set
# or not set) in the actual .config; if one of them is not, it means
# some dependency from the toolchain or arch is not available, in
# which case this config is untestable and we skip it.
skip=false
while read line; do
if ! grep "^${line}\$" "${dir}/.config" >/dev/null 2>&1; then
printf "%s\n" "${line}"
skip=true
fi
done <"${cfg}" >"${dir}/missing.config"
if ${skip}; then
printf ", SKIPPED\n"
return
fi
# Remove file, it's empty anyway.
rm -f "${dir}/missing.config"
if [ -n "${pkg}" ]; then
printf ", dirclean"
if ! make O="${dir}" "${pkg}-dirclean" >> "${dir}/logfile" 2>&1; then
printf ": FAILED\n"
return
fi
fi
printf ", build"
# shellcheck disable=SC2086
if ! make O="${dir}" ${pkg} >> "${dir}/logfile" 2>&1; then
printf ": FAILED\n"
return
fi
printf ": OK\n"
}
help() {
cat <<_EOF_
test-pkg: test-build a package against various toolchains and architectures
The supplied config snippet is appended to each toolchain config, the
resulting configuration is checked to ensure it still contains all options
specified in the snippet; if any is missing, the build is skipped, on the
assumption that the package under test requires a toolchain or architecture
feature that is missing.
In case failures are noticed, you can fix the package and just re-run the
same command again; it will re-run the test where it failed. If you did
specify a package (with -p), the package build dir will be removed first.
The list of toolchains is retrieved from the Buildroot autobuilders, available
at ${TOOLCHAINS_URL}.
Options:
-h, --help
Print this help.
-c CFG, --config-snippet CFG
Use the CFG file as the source for the config snippet. This file
should contain all the config options required to build a package.
-d DIR, --build-dir DIR
Do the builds in directory DIR, one sub-dir per toolchain.
-p PKG, --package PKG
Test-build the package PKG, by running 'make PKG'; if not specified,
just runs 'make'.
-r N, --random N
Limit the tests to the N randomly selected toolchains, instead of
building with all toolchains.
Example:
Testing libcec would require a config snippet that contains:
BR2_PACKAGE_LIBCEC=y
Testing libcurl with openSSL support would require a snippet such as:
BR2_PACKAGE_OPENSSL=y
BR2_PACKAGE_LIBCURL=y
_EOF_
}
my_name="${0##*/}"
main "${@}"

View File

@ -1,5 +1,35 @@
menu "System configuration" menu "System configuration"
choice
prompt "Root FS skeleton"
config BR2_ROOTFS_SKELETON_DEFAULT
bool "default target skeleton"
help
Use default target skeleton
config BR2_ROOTFS_SKELETON_CUSTOM
bool "custom target skeleton"
help
Use custom target skeleton.
endchoice
if BR2_ROOTFS_SKELETON_CUSTOM
config BR2_ROOTFS_SKELETON_CUSTOM_PATH
string "custom target skeleton path"
help
Path to custom target skeleton.
# dummy config so merged /usr workarounds can also be activated for
# custom rootfs skeleton
config BR2_ROOTFS_MERGED_USR
endif
if BR2_ROOTFS_SKELETON_DEFAULT
config BR2_TARGET_GENERIC_HOSTNAME config BR2_TARGET_GENERIC_HOSTNAME
string "System hostname" string "System hostname"
default "buildroot" default "buildroot"
@ -18,6 +48,8 @@ config BR2_TARGET_GENERIC_ISSUE
Leave empty to not create /etc/issue, or to keep the Leave empty to not create /etc/issue, or to keep the
one from a custom skeleton. one from a custom skeleton.
endif
choice choice
bool "Passwords encoding" bool "Passwords encoding"
default BR2_TARGET_GENERIC_PASSWD_MD5 default BR2_TARGET_GENERIC_PASSWD_MD5
@ -74,6 +106,7 @@ config BR2_INIT_BUSYBOX
config BR2_INIT_SYSV config BR2_INIT_SYSV
bool "systemV" bool "systemV"
depends on BR2_USE_MMU # sysvinit
select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # sysvinit select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # sysvinit
select BR2_PACKAGE_INITSCRIPTS select BR2_PACKAGE_INITSCRIPTS
select BR2_PACKAGE_SYSVINIT select BR2_PACKAGE_SYSVINIT
@ -94,8 +127,9 @@ config BR2_INIT_SYSTEMD
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10 depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
select BR2_ROOTFS_MERGED_USR select BR2_ROOTFS_MERGED_USR
select BR2_PACKAGE_SYSTEMD select BR2_PACKAGE_SYSTEMD
select BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW if BR2_ROOTFS_SKELETON_DEFAULT
comment "systemd needs (e)glibc toolchain, headers >= 3.10" comment "systemd needs a glibc toolchain, headers >= 3.10"
depends on !(BR2_TOOLCHAIN_USES_GLIBC \ depends on !(BR2_TOOLCHAIN_USES_GLIBC \
&& BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10) && BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10)
@ -124,7 +158,7 @@ config BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV
config BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV config BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV
bool "Dynamic using devtmpfs + eudev" bool "Dynamic using devtmpfs + eudev"
depends on BR2_USE_WCHAR depends on BR2_USE_WCHAR # eudev
depends on !BR2_STATIC_LIBS depends on !BR2_STATIC_LIBS
depends on BR2_USE_MMU # eudev depends on BR2_USE_MMU # eudev
select BR2_PACKAGE_EUDEV select BR2_PACKAGE_EUDEV
@ -162,33 +196,10 @@ config BR2_ROOTFS_STATIC_DEVICE_TABLE
See package/makedevs/README for details on the usage and See package/makedevs/README for details on the usage and
syntax of these files. syntax of these files.
choice config BR2_ROOTFS_DEVICE_TABLE_SUPPORTS_EXTENDED_ATTRIBUTES
prompt "Root FS skeleton" bool "support extended attributes in device tables"
config BR2_ROOTFS_SKELETON_DEFAULT
bool "default target skeleton"
help help
Use default target skeleton Support extended attributes handling in device tables
config BR2_ROOTFS_SKELETON_CUSTOM
bool "custom target skeleton"
help
Use custom target skeleton.
endchoice
if BR2_ROOTFS_SKELETON_CUSTOM
config BR2_ROOTFS_SKELETON_CUSTOM_PATH
string "custom target skeleton path"
default "system/skeleton"
help
Path to custom target skeleton.
# dummy config so merged /usr workarounds can also be activated for
# custom rootfs skeleton
config BR2_ROOTFS_MERGED_USR
endif
if BR2_ROOTFS_SKELETON_DEFAULT if BR2_ROOTFS_SKELETON_DEFAULT
@ -265,13 +276,19 @@ config BR2_SYSTEM_BIN_SH_DASH
depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
select BR2_PACKAGE_DASH select BR2_PACKAGE_DASH
config BR2_SYSTEM_BIN_SH_MKSH
bool "mksh"
depends on BR2_USE_MMU # mksh
depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
select BR2_PACKAGE_MKSH
config BR2_SYSTEM_BIN_SH_ZSH config BR2_SYSTEM_BIN_SH_ZSH
bool "zsh" bool "zsh"
depends on BR2_USE_MMU # zsh depends on BR2_USE_MMU # zsh
depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
select BR2_PACKAGE_ZSH select BR2_PACKAGE_ZSH
comment "bash, dash, zsh need BR2_PACKAGE_BUSYBOX_SHOW_OTHERS" comment "bash, dash, mksh, zsh need BR2_PACKAGE_BUSYBOX_SHOW_OTHERS"
depends on !BR2_PACKAGE_BUSYBOX_SHOW_OTHERS && BR2_PACKAGE_BUSYBOX depends on !BR2_PACKAGE_BUSYBOX_SHOW_OTHERS && BR2_PACKAGE_BUSYBOX
config BR2_SYSTEM_BIN_SH_NONE config BR2_SYSTEM_BIN_SH_NONE
@ -284,6 +301,7 @@ config BR2_SYSTEM_BIN_SH
default "busybox" if BR2_SYSTEM_BIN_SH_BUSYBOX default "busybox" if BR2_SYSTEM_BIN_SH_BUSYBOX
default "bash" if BR2_SYSTEM_BIN_SH_BASH default "bash" if BR2_SYSTEM_BIN_SH_BASH
default "dash" if BR2_SYSTEM_BIN_SH_DASH default "dash" if BR2_SYSTEM_BIN_SH_DASH
default "mksh" if BR2_SYSTEM_BIN_SH_MKSH
default "zsh" if BR2_SYSTEM_BIN_SH_ZSH default "zsh" if BR2_SYSTEM_BIN_SH_ZSH
menuconfig BR2_TARGET_GENERIC_GETTY menuconfig BR2_TARGET_GENERIC_GETTY
@ -351,13 +369,10 @@ config BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
read-only. read-only.
If unsure, say Y. If unsure, say Y.
endif # BR2_ROOTFS_SKELETON_DEFAULT
config BR2_SYSTEM_DHCP config BR2_SYSTEM_DHCP
string "Network interface to configure through DHCP" string "Network interface to configure through DHCP"
default "" default ""
depends on !BR2_PACKAGE_SYSTEMD_NETWORKD && (BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN) depends on BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN || BR2_PACKAGE_SYSTEMD_NETWORKD
help help
Enter here the name of the network interface (E.G. eth0) to Enter here the name of the network interface (E.G. eth0) to
automatically configure through DHCP at bootup. automatically configure through DHCP at bootup.
@ -367,17 +382,49 @@ config BR2_SYSTEM_DHCP
For more complicated network setups use an overlay to overwrite For more complicated network setups use an overlay to overwrite
/etc/network/interfaces or add a networkd configuration file. /etc/network/interfaces or add a networkd configuration file.
comment "automatic network configuration via DHCP is not compatible with networkd" comment "automatic network configuration via DHCP needs ifupdown or busybox or networkd"
depends on BR2_PACKAGE_SYSTEMD_NETWORKD depends on !(BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN || BR2_PACKAGE_SYSTEMD_NETWORKD)
comment "automatic network configuration via DHCP needs ifupdown or busybox" endif # BR2_ROOTFS_SKELETON_DEFAULT
depends on !(BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN)
config BR2_ENABLE_LOCALE_PURGE
bool "Purge unwanted locales"
default y
help
Explicitly specify what locales to install on target. If N
then all locales supported by packages are installed.
config BR2_ENABLE_LOCALE_WHITELIST
string "Locales to keep"
default "C en_US"
depends on BR2_ENABLE_LOCALE_PURGE
help
Whitespace seperated list of locales to allow on target.
Locales not listed here will be removed from the target.
See 'locale -a' on your host for a list of locales available
on your build host, or have a look in /usr/share/locale in
the target file system for available locales.
Notice that listing a locale here doesn't guarantee that it
will be available on the target - That purely depends on the
support for that locale in the selected packages.
config BR2_GENERATE_LOCALE
string "Generate locale data"
default ""
depends on \
(BR2_TOOLCHAIN_BUILDROOT_UCLIBC && BR2_ENABLE_LOCALE) || \
BR2_TOOLCHAIN_USES_GLIBC
help
Generate support for a list of locales. Locales can be
specified with or without encoding, when no encoding is
specified, UTF-8 is assumed. Examples of locales: en_US,
fr_FR.UTF-8.
config BR2_TARGET_TZ_INFO config BR2_TARGET_TZ_INFO
bool "Install timezone info" bool "Install timezone info"
# No timezone for musl; only for uClibc or (e)glibc.
depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_UCLIBC
select BR2_PACKAGE_TZDATA if BR2_TOOLCHAIN_USES_GLIBC select BR2_PACKAGE_TZDATA if BR2_TOOLCHAIN_USES_GLIBC
select BR2_PACKAGE_TZDATA if BR2_TOOLCHAIN_USES_MUSL
select BR2_PACKAGE_TZ if BR2_TOOLCHAIN_USES_UCLIBC select BR2_PACKAGE_TZ if BR2_TOOLCHAIN_USES_UCLIBC
help help
Say 'y' here to install timezone info. Say 'y' here to install timezone info.
@ -391,7 +438,7 @@ config BR2_TARGET_TZ_ZONELIST
Space-separated list of time zones to compile. Space-separated list of time zones to compile.
The value "default" includes all commonly used time zones. Note The value "default" includes all commonly used time zones. Note
that this set consumes around 5.5M for (e)glibc and 2.1M for uClibc. that this set consumes around 5.5M for glibc and 2.1M for uClibc.
The full list is the list of files in the time zone database source, The full list is the list of files in the time zone database source,
not including the build and .tab files. not including the build and .tab files.
@ -449,6 +496,38 @@ config BR2_ROOTFS_POST_BUILD_SCRIPT
argument. Make sure the exit code of those scripts are 0, otherwise argument. Make sure the exit code of those scripts are 0, otherwise
make will stop after calling them. make will stop after calling them.
config BR2_ROOTFS_POST_FAKEROOT_SCRIPT
string "Custom scripts to run inside the fakeroot environment"
default ""
help
Specify a space-separated list of scripts to be run at the end
of the fakeroot script right before the image(s) are actually
generated.
This gives users the opportunity to do customisations of the
content of the rootfs, which would otherwise require root
rights.
These scripts are called with the target directory name as
first argument. The build will fail on the first scripts that
exits with a non-zero exit code.
Note that Buildroot already provides mechanisms to customise
the content of the rootfs:
- BR2_ROOTFS_STATIC_DEVICE_TABLE
to create arbitrary entries statically in /dev
- BR2_ROOTFS_DEVICE_TABLE
to set arbitrary permissions as well as extended attributes
(such as capabilities) on files and directories,
- BR2_ROOTFS_USERS_TABLES:
to create arbitrary users and their home directories
It is highly recommended to use those mechanisms if possible,
rather than using custom fakeroot scripts.
config BR2_ROOTFS_POST_IMAGE_SCRIPT config BR2_ROOTFS_POST_IMAGE_SCRIPT
string "Custom scripts to run after creating filesystem images" string "Custom scripts to run after creating filesystem images"
default "" default ""
@ -468,8 +547,10 @@ config BR2_ROOTFS_POST_IMAGE_SCRIPT
source directory as the current directory. source directory as the current directory.
config BR2_ROOTFS_POST_SCRIPT_ARGS config BR2_ROOTFS_POST_SCRIPT_ARGS
string "Extra post-{build,image} arguments" string "Extra arguments passed to custom scripts"
depends on BR2_ROOTFS_POST_BUILD_SCRIPT != "" || BR2_ROOTFS_POST_IMAGE_SCRIPT != "" depends on BR2_ROOTFS_POST_BUILD_SCRIPT != "" \
|| BR2_ROOTFS_POST_FAKEROOT_SCRIPT != "" \
|| BR2_ROOTFS_POST_IMAGE_SCRIPT != ""
help help
Pass these additional arguments to each post-build or post-image Pass these additional arguments to each post-build or post-image
scripts. scripts.

View File

@ -31,6 +31,7 @@
/dev/ttyAM c 666 0 0 204 16 0 1 3 /dev/ttyAM c 666 0 0 204 16 0 1 3
/dev/ttyCPM c 666 0 0 204 46 0 1 4 /dev/ttyCPM c 666 0 0 204 46 0 1 4
/dev/ttyAMA c 666 0 0 204 64 0 1 4 /dev/ttyAMA c 666 0 0 204 64 0 1 4
/dev/ttyBF c 666 0 0 204 64 0 1 2
/dev/ttySAC c 666 0 0 204 64 0 1 4 /dev/ttySAC c 666 0 0 204 64 0 1 4
/dev/ttySC c 666 0 0 204 8 0 1 8 /dev/ttySC c 666 0 0 204 8 0 1 8
/dev/ttyPSC c 666 0 0 204 148 0 1 4 /dev/ttyPSC c 666 0 0 204 148 0 1 4

View File

@ -22,5 +22,5 @@ plugdev:x:46:
staff:x:50: staff:x:50:
lock:x:54: lock:x:54:
netdev:x:82: netdev:x:82:
nogroup:x:99:
users:x:100: users:x:100:
nogroup:x:65534:

View File

@ -1 +1 @@
/proc/mounts ../proc/self/mounts

View File

@ -6,4 +6,4 @@ sync:x:4:100:sync:/bin:/bin/sync
mail:x:8:8:mail:/var/spool/mail:/bin/false mail:x:8:8:mail:/var/spool/mail:/bin/false
www-data:x:33:33:www-data:/var/www:/bin/false www-data:x:33:33:www-data:/var/www:/bin/false
operator:x:37:37:Operator:/var:/bin/false operator:x:37:37:Operator:/var:/bin/false
nobody:x:99:99:nobody:/home:/bin/false nobody:x:65534:65534:nobody:/home:/bin/false

View File

@ -1 +0,0 @@
../../tmp

View File

@ -1 +0,0 @@
../tmp

View File

@ -1 +1 @@
../tmp ../run

View File

@ -15,9 +15,11 @@ config BR2_TOOLCHAIN_USES_GLIBC
select BR2_TOOLCHAIN_HAS_THREADS_DEBUG select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
select BR2_TOOLCHAIN_HAS_THREADS_NPTL select BR2_TOOLCHAIN_HAS_THREADS_NPTL
select BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS select BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS
select BR2_TOOLCHAIN_SUPPORTS_PIE
config BR2_TOOLCHAIN_USES_UCLIBC config BR2_TOOLCHAIN_USES_UCLIBC
bool bool
select BR2_TOOLCHAIN_SUPPORTS_PIE if !BR2_m68k && !BR2_microblaze && !BR2_STATIC_LIBS
config BR2_TOOLCHAIN_USES_MUSL config BR2_TOOLCHAIN_USES_MUSL
bool bool
@ -26,6 +28,7 @@ config BR2_TOOLCHAIN_USES_MUSL
select BR2_TOOLCHAIN_HAS_THREADS select BR2_TOOLCHAIN_HAS_THREADS
select BR2_TOOLCHAIN_HAS_THREADS_DEBUG select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
select BR2_TOOLCHAIN_HAS_THREADS_NPTL select BR2_TOOLCHAIN_HAS_THREADS_NPTL
select BR2_TOOLCHAIN_SUPPORTS_PIE
choice choice
prompt "Toolchain type" prompt "Toolchain type"
@ -38,8 +41,11 @@ choice
config BR2_TOOLCHAIN_BUILDROOT config BR2_TOOLCHAIN_BUILDROOT
bool "Buildroot toolchain" bool "Buildroot toolchain"
depends on !BR2_bfin
select BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS select BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS
depends on !BR2_bf606
depends on !BR2_bf607
depends on !BR2_bf608
depends on !BR2_bf609
config BR2_TOOLCHAIN_EXTERNAL config BR2_TOOLCHAIN_EXTERNAL
bool "External toolchain" bool "External toolchain"

View File

@ -50,22 +50,10 @@ copy_toolchain_lib_root = \
# corresponding architecture variants), and we don't want to import # corresponding architecture variants), and we don't want to import
# them. # them.
# #
# Then, we need to support two types of multilib toolchains: # Then, if the selected architecture variant is not the default one
# (i.e, if SYSROOT_DIR != ARCH_SYSROOT_DIR), then we :
# #
# - The toolchains that have nested sysroots: a main sysroot, and # * Import the header files from the default architecture
# then additional sysroots available as subdirectories of the main
# one. This is for example used by Sourcery CodeBench toolchains.
#
# - The toolchains that have side-by-side sysroots. Each sysroot is a
# complete one, they simply leave one next to each other. This is
# for example used by MIPS Codescape toolchains.
#
# So, we first detect if the selected architecture variant is not the
# default one (i.e, if SYSROOT_DIR != ARCH_SYSROOT_DIR).
#
# If we are in the situation of a nested sysroot, we:
#
# * If needed, import the header files from the default architecture
# variant. Header files are typically shared between the sysroots # variant. Header files are typically shared between the sysroots
# for the different architecture variants. If we use the # for the different architecture variants. If we use the
# non-default one, header files were not copied by the previous # non-default one, header files were not copied by the previous
@ -79,14 +67,10 @@ copy_toolchain_lib_root = \
# non-default architecture variant is used. Without this, the # non-default architecture variant is used. Without this, the
# compiler fails to find libraries and headers. # compiler fails to find libraries and headers.
# #
# If we are in the situation of a side-by-side sysroot, we: # Some toolchains (i.e Linaro binary toolchains) store support
# # libraries (libstdc++, libgcc_s) outside of the sysroot, so we simply
# * Create a symbolic link # copy all the libraries from the "support lib directory" into our
# # sysroot.
# Finally, some toolchains (i.e Linaro binary toolchains) store
# support libraries (libstdc++, libgcc_s) outside of the sysroot, so
# we simply copy all the libraries from the "support lib directory"
# into our sysroot.
# #
# Note that the 'locale' directories are not copied. They are huge # Note that the 'locale' directories are not copied. They are huge
# (400+MB) in CodeSourcery toolchains, and they are not really useful. # (400+MB) in CodeSourcery toolchains, and they are not really useful.
@ -111,25 +95,18 @@ copy_toolchain_sysroot = \
$${ARCH_SYSROOT_DIR}/$$i/ $(STAGING_DIR)/$$i/ ; \ $${ARCH_SYSROOT_DIR}/$$i/ $(STAGING_DIR)/$$i/ ; \
fi ; \ fi ; \
done ; \ done ; \
SYSROOT_DIR_CANON=`readlink -f $${SYSROOT_DIR}` ; \ if [ `readlink -f $${SYSROOT_DIR}` != `readlink -f $${ARCH_SYSROOT_DIR}` ] ; then \
ARCH_SYSROOT_DIR_CANON=`readlink -f $${ARCH_SYSROOT_DIR}` ; \ if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \
if [ $${SYSROOT_DIR_CANON} != $${ARCH_SYSROOT_DIR_CANON} ] ; then \ cp -a $${SYSROOT_DIR}/usr/include $(STAGING_DIR)/usr ; \
relpath="./" ; \
if [ $${ARCH_SYSROOT_DIR_CANON:0:$${\#SYSROOT_DIR_CANON}} == $${SYSROOT_DIR_CANON} ] ; then \
if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \
cp -a $${SYSROOT_DIR}/usr/include $(STAGING_DIR)/usr ; \
fi ; \
mkdir -p `dirname $(STAGING_DIR)/$${ARCH_SUBDIR}` ; \
nbslashs=`printf $${ARCH_SUBDIR} | sed 's%[^/]%%g' | wc -c` ; \
for slash in `seq 1 $${nbslashs}` ; do \
relpath=$${relpath}"../" ; \
done ; \
ln -s $${relpath} $(STAGING_DIR)/$${ARCH_SUBDIR} ; \
echo "Symlinking $(STAGING_DIR)/$${ARCH_SUBDIR} -> $${relpath}" ; \
elif [ `dirname $${ARCH_SYSROOT_DIR_CANON}` == `dirname $${SYSROOT_DIR_CANON}` ] ; then \
ln -snf $${relpath} $(STAGING_DIR)/`basename $${ARCH_SYSROOT_DIR_CANON}` ; \
echo "Symlinking $(STAGING_DIR)/`basename $${ARCH_SYSROOT_DIR_CANON}` -> $${relpath}" ; \
fi ; \ fi ; \
mkdir -p `dirname $(STAGING_DIR)/$${ARCH_SUBDIR}` ; \
relpath="./" ; \
nbslashs=`printf $${ARCH_SUBDIR} | sed 's%[^/]%%g' | wc -c` ; \
for slash in `seq 1 $${nbslashs}` ; do \
relpath=$${relpath}"../" ; \
done ; \
ln -s $${relpath} $(STAGING_DIR)/$${ARCH_SUBDIR} ; \
echo "Symlinking $(STAGING_DIR)/$${ARCH_SUBDIR} -> $${relpath}" ; \
fi ; \ fi ; \
if test -n "$${SUPPORT_LIB_DIR}" ; then \ if test -n "$${SUPPORT_LIB_DIR}" ; then \
cp -a $${SUPPORT_LIB_DIR}/* $(STAGING_DIR)/lib/ ; \ cp -a $${SUPPORT_LIB_DIR}/* $(STAGING_DIR)/lib/ ; \
@ -168,8 +145,7 @@ check_kernel_headers_version = \
check_gcc_version = \ check_gcc_version = \
expected_version="$(strip $2)" ; \ expected_version="$(strip $2)" ; \
if [ -z "$${expected_version}" ]; then \ if [ -z "$${expected_version}" ]; then \
printf "Internal error, gcc version unknown (no GCC_AT_LEAST_X_Y selected)\n"; \ exit 0 ; \
exit 1 ; \
fi; \ fi; \
real_version=`$(1) --version | sed -r -e '1!d; s/^[^)]+\) ([^[:space:]]+).*/\1/;'` ; \ real_version=`$(1) --version | sed -r -e '1!d; s/^[^)]+\) ([^[:space:]]+).*/\1/;'` ; \
if [[ ! "$${real_version}" =~ ^$${expected_version}\. ]] ; then \ if [[ ! "$${real_version}" =~ ^$${expected_version}\. ]] ; then \
@ -333,6 +309,24 @@ check_cplusplus = \
exit 1 ; \ exit 1 ; \
fi fi
#
#
# Check that the external toolchain supports Fortran
#
# $1: cross-gfortran path
#
check_fortran = \
__CROSS_FC=$(strip $1) ; \
__o=$(BUILD_DIR)/.br-toolchain-test-fortran.tmp ; \
printf 'program hello\n\tprint *, "Hello Fortran!\\n"\nend program hello\n' | \
$${__CROSS_FC} -x f95 -o $${__o} - ; \
if test $$? -ne 0 ; then \
rm -f $${__o}* ; \
echo "Fortran support is selected but is not available in external toolchain" ; \
exit 1 ; \
fi ; \
rm -f $${__o}* \
# #
# Check that the cross-compiler given in the configuration exists # Check that the cross-compiler given in the configuration exists
# #

View File

@ -2,6 +2,8 @@
if BR2_TOOLCHAIN_BUILDROOT if BR2_TOOLCHAIN_BUILDROOT
comment "Toolchain Buildroot Options"
config BR2_TOOLCHAIN_BUILDROOT_VENDOR config BR2_TOOLCHAIN_BUILDROOT_VENDOR
string "custom toolchain vendor name" string "custom toolchain vendor name"
default "buildroot" default "buildroot"
@ -18,49 +20,25 @@ config BR2_TOOLCHAIN_BUILDROOT_VENDOR
If you're not sure, just leave the default "buildroot" value. If you're not sure, just leave the default "buildroot" value.
source "package/linux-headers/Config.in.host"
choice choice
prompt "C library" prompt "C library"
default BR2_TOOLCHAIN_UCLIBC default BR2_TOOLCHAIN_UCLIBC
default BR2_TOOLCHAIN_BUILDROOT_GLIBC if BR2_aarch64 || BR2_aarch64_be \ default BR2_TOOLCHAIN_BUILDROOT_GLIBC if BR2_powerpc64
|| BR2_microblaze || BR2_powerpc64
config BR2_TOOLCHAIN_BUILDROOT_UCLIBC config BR2_TOOLCHAIN_BUILDROOT_UCLIBC
bool "uClibc" bool "uClibc-ng"
select BR2_TOOLCHAIN_USES_UCLIBC select BR2_TOOLCHAIN_USES_UCLIBC
depends on BR2_arcle || BR2_arceb || BR2_arm || BR2_armeb || \ depends on BR2_aarch64 || BR2_aarch64_be || BR2_arcle || BR2_arceb || \
BR2_bfin || BR2_i386 || BR2_m68k || \ BR2_arm || BR2_armeb || \
BR2_bfin || BR2_i386 || BR2_m68k || BR2_microblaze || \
BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el || \ BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el || \
BR2_powerpc || BR2_sh2a || BR2_sh4 || BR2_sh4eb || \ BR2_or1k || BR2_powerpc || BR2_sh2a || BR2_sh4 || \
BR2_sparc || BR2_xtensa || BR2_x86_64 BR2_sh4eb || BR2_sparc || BR2_xtensa || BR2_x86_64
# Unsupported for MIPS R6
depends on !BR2_mips_32r6 && !BR2_mips_64r6
help help
This option selects uClibc as the C library for the This option selects uClibc-ng as the C library for the
cross-compilation toolchain. cross-compilation toolchain.
http://uclibc.org http://uclibc-ng.org
config BR2_TOOLCHAIN_BUILDROOT_EGLIBC
bool "eglibc"
depends on BR2_arm || BR2_armeb || BR2_aarch64 || \
BR2_aarch64_be || BR2_i386 || BR2_mips || \
BR2_mipsel || BR2_mips64 || BR2_mips64el || \
BR2_powerpc || BR2_sh || BR2_sh64 || \
BR2_sparc || BR2_x86_64 || BR2_microblaze || \
BR2_powerpc64
depends on BR2_USE_MMU
depends on !BR2_STATIC_LIBS
depends on BR2_DEPRECATED_SINCE_2015_08
select BR2_TOOLCHAIN_USES_GLIBC
# our eglibc.mk enables RPC support
select BR2_TOOLCHAIN_HAS_NATIVE_RPC
help
This option selects eglibc as the C library for the
cross-compilation toolchain.
http://eglibc.org
config BR2_TOOLCHAIN_BUILDROOT_GLIBC config BR2_TOOLCHAIN_BUILDROOT_GLIBC
bool "glibc" bool "glibc"
@ -68,8 +46,8 @@ config BR2_TOOLCHAIN_BUILDROOT_GLIBC
BR2_aarch64_be || BR2_i386 || BR2_mips || \ BR2_aarch64_be || BR2_i386 || BR2_mips || \
BR2_mipsel || BR2_mips64 || BR2_mips64el|| \ BR2_mipsel || BR2_mips64 || BR2_mips64el|| \
BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || \ BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || \
BR2_sh || BR2_sh64 || BR2_sparc64 || \ BR2_sh || BR2_sparc64 || BR2_x86_64 || \
BR2_x86_64 || BR2_microblaze || BR2_nios2 BR2_microblaze || BR2_nios2
depends on BR2_USE_MMU depends on BR2_USE_MMU
depends on !BR2_STATIC_LIBS depends on !BR2_STATIC_LIBS
depends on !BR2_powerpc_SPE depends on !BR2_powerpc_SPE
@ -82,18 +60,17 @@ config BR2_TOOLCHAIN_BUILDROOT_GLIBC
http://www.gnu.org/software/libc/ http://www.gnu.org/software/libc/
comment "(e)glibc only available with shared lib support" comment "glibc only available with shared lib support"
depends on BR2_USE_MMU depends on BR2_USE_MMU
depends on BR2_STATIC_LIBS depends on BR2_STATIC_LIBS
config BR2_TOOLCHAIN_BUILDROOT_MUSL config BR2_TOOLCHAIN_BUILDROOT_MUSL
bool "musl (experimental)" bool "musl"
depends on BR2_aarch64 || BR2_arm || BR2_armeb || BR2_i386 || \ depends on BR2_aarch64 || BR2_arm || BR2_armeb || BR2_i386 || \
BR2_microblaze || BR2_mips || BR2_mipsel || BR2_powerpc || \ BR2_microblaze || BR2_mips || BR2_mipsel || BR2_mips64 || \
BR2_sh || BR2_x86_64 BR2_mips64el || BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || \
BR2_sh || BR2_x86_64
depends on !BR2_powerpc_SPE # not supported, build breaks depends on !BR2_powerpc_SPE # not supported, build breaks
# Unsupported for MIPS R6
depends on !BR2_mips_32r6 && !BR2_mips_64r6
# sh2 nommu is supported by musl, but we don't have support # sh2 nommu is supported by musl, but we don't have support
# for it in Buildroot. # for it in Buildroot.
depends on BR2_USE_MMU depends on BR2_USE_MMU
@ -107,12 +84,10 @@ endchoice
config BR2_TOOLCHAIN_BUILDROOT_LIBC config BR2_TOOLCHAIN_BUILDROOT_LIBC
string string
default "uclibc" if BR2_TOOLCHAIN_BUILDROOT_UCLIBC default "uclibc" if BR2_TOOLCHAIN_BUILDROOT_UCLIBC
# Both glibc and eglibc are handled by the package called
# 'glibc'
default "glibc" if BR2_TOOLCHAIN_BUILDROOT_EGLIBC
default "glibc" if BR2_TOOLCHAIN_BUILDROOT_GLIBC default "glibc" if BR2_TOOLCHAIN_BUILDROOT_GLIBC
default "musl" if BR2_TOOLCHAIN_BUILDROOT_MUSL default "musl" if BR2_TOOLCHAIN_BUILDROOT_MUSL
source "package/linux-headers/Config.in.host"
source "package/linux-headers/Config.in" source "package/linux-headers/Config.in"
source "package/musl/Config.in" source "package/musl/Config.in"
source "package/uclibc/Config.in" source "package/uclibc/Config.in"

View File

@ -5,6 +5,19 @@
# so put it here instead # so put it here instead
source "package/gdb/Config.in.host" source "package/gdb/Config.in.host"
comment "Toolchain Generic Options"
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735
# exception_ptr, nested_exception, and future from libstdc++ are not
# available for architectures not supporting always lock-free atomic
# ints before GCC 7
config BR2_TOOLCHAIN_HAS_GCC_BUG_64735
bool
default y if BR2_nios2
default y if BR2_ARM_CPU_ARMV4
default y if BR2_ARM_CPU_ARMV5
default y if BR2_sparc_v8
# https://sourceware.org/bugzilla/show_bug.cgi?id=19405 # https://sourceware.org/bugzilla/show_bug.cgi?id=19405
config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405 config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405
bool bool
@ -21,6 +34,9 @@ config BR2_ENABLE_LOCALE
config BR2_INSTALL_LIBSTDCPP config BR2_INSTALL_LIBSTDCPP
bool bool
config BR2_TOOLCHAIN_HAS_FORTRAN
bool
config BR2_TOOLCHAIN_HAS_THREADS config BR2_TOOLCHAIN_HAS_THREADS
bool bool
@ -36,38 +52,8 @@ config BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS
config BR2_TOOLCHAIN_HAS_SSP config BR2_TOOLCHAIN_HAS_SSP
bool bool
config BR2_ENABLE_LOCALE_PURGE config BR2_TOOLCHAIN_SUPPORTS_PIE
bool "Purge unwanted locales" bool
help
Explicitly specify what locales to install on target. If N
then all locales supported by packages are installed.
config BR2_ENABLE_LOCALE_WHITELIST
string "Locales to keep"
default "C en_US de fr"
depends on BR2_ENABLE_LOCALE_PURGE
help
Whitespace seperated list of locales to allow on target.
Locales not listed here will be removed from the target.
See 'locale -a' on your host for a list of locales available
on your build host, or have a look in /usr/share/locale in
the target file system for available locales.
Notice that listing a locale here doesn't guarantee that it
will be available on the target - That purely depends on the
support for that locale in the selected packages.
config BR2_GENERATE_LOCALE
string "Generate locale data"
default ""
depends on \
(BR2_TOOLCHAIN_BUILDROOT_UCLIBC && BR2_ENABLE_LOCALE) || \
BR2_TOOLCHAIN_USES_GLIBC
help
Generate support for a list of locales. Locales can be
specified with or without encoding, when no encoding is
specified, UTF-8 is assumed. Examples of locales: en_US,
fr_FR.UTF-8.
config BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY config BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY
bool "Copy gconv libraries" bool "Copy gconv libraries"
@ -241,10 +227,30 @@ config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5
bool bool
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4 select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4
config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_6
bool
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5
config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
bool
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_6
config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8
bool
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_9
bool
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8
# This order guarantees that the highest version is set, as kconfig # This order guarantees that the highest version is set, as kconfig
# stops affecting a value on the first matching default. # stops affecting a value on the first matching default.
config BR2_TOOLCHAIN_HEADERS_AT_LEAST config BR2_TOOLCHAIN_HEADERS_AT_LEAST
string string
default "4.9" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_9
default "4.8" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8
default "4.7" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
default "4.6" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_6
default "4.5" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5 default "4.5" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5
default "4.4" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4 default "4.4" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4
default "4.3" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3 default "4.3" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3
@ -326,6 +332,7 @@ config BR2_TOOLCHAIN_HAS_SYNC_1
bool bool
default y default y
depends on !BR2_bfin depends on !BR2_bfin
depends on !BR2_m68k_cf
depends on !BR2_microblaze depends on !BR2_microblaze
depends on !BR2_sparc depends on !BR2_sparc
depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT) depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT)
@ -337,6 +344,7 @@ config BR2_TOOLCHAIN_HAS_SYNC_2
config BR2_TOOLCHAIN_HAS_SYNC_4 config BR2_TOOLCHAIN_HAS_SYNC_4
bool bool
default y default y
depends on !BR2_m68k_cf
depends on !BR2_sparc depends on !BR2_sparc
depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT) depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT)
@ -385,11 +393,14 @@ config BR2_TOOLCHAIN_HAS_SYNC_8
default y if BR2_TOOLCHAIN_X86_HAS_SYNC_8 default y if BR2_TOOLCHAIN_X86_HAS_SYNC_8
# libatomic is available since gcc 4.8, when thread support is # libatomic is available since gcc 4.8, when thread support is
# enabled. # enabled. Also, libatomic doesn't recognize "uclinux" as a valid OS
# part of the tuple, and is therefore not build on uclinux targets,
# which is why BR2_BINFMT_FLAT configurations are excluded.
config BR2_TOOLCHAIN_HAS_LIBATOMIC config BR2_TOOLCHAIN_HAS_LIBATOMIC
bool bool
default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 && \ default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 && \
BR2_TOOLCHAIN_HAS_THREADS BR2_TOOLCHAIN_HAS_THREADS && \
!BR2_BINFMT_FLAT
# __atomic intrinsics are available: # __atomic intrinsics are available:
# - with gcc 4.8, either through built-ins or libatomic, on all # - with gcc 4.8, either through built-ins or libatomic, on all
@ -412,3 +423,13 @@ config BR2_TOOLCHAIN_HAS_ATOMIC
default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_armeb default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_armeb
default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_xtensa default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_xtensa
default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_ARCH_IS_64 default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_ARCH_IS_64
# - libquadmath is not needed/available on all architectures (but gcc
# correctly handles this already).
# - At least, libquadmath is available on:
# - i*86
# - x86_64
# - When available, libquadmath requires wchar support.
config BR2_TOOLCHAIN_HAS_LIBQUADMATH
bool
default y if BR2_i386 || BR2_x86_64

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,607 @@
################################################################################
# External toolchain package infrastructure
#
# This package infrastructure implements the support for external
# toolchains, i.e toolchains that are available pre-built, ready to
# use. Such toolchain may either be readily available on the Web
# (Linaro, Sourcery CodeBench, from processor vendors) or may be built
# with tools like Crosstool-NG or Buildroot itself. So far, we have
# tested this with:
#
# * Toolchains generated by Crosstool-NG
# * Toolchains generated by Buildroot
# * Toolchains provided by Linaro for the ARM and AArch64
# architectures
# * Sourcery CodeBench toolchains (from Mentor Graphics) for the ARM,
# MIPS, PowerPC, x86, x86_64 and NIOS 2 architectures. For the MIPS
# toolchain, the -muclibc variant isn't supported yet, only the
# default glibc-based variant is.
# * Xilinx toolchains for the Microblaze architecture
# * Synopsys DesignWare toolchains for ARC cores
#
# The basic principle is the following
#
# 1. If the toolchain is not pre-installed, download and extract it
# in $(TOOLCHAIN_EXTERNAL_INSTALL_DIR). Otherwise,
# $(TOOLCHAIN_EXTERNAL_INSTALL_DIR) points to were the toolchain has
# already been installed by the user.
#
# 2. For all external toolchains, perform some checks on the
# conformity between the toolchain configuration described in the
# Buildroot menuconfig system, and the real configuration of the
# external toolchain. This is for example important to make sure that
# the Buildroot configuration system knows whether the toolchain
# supports RPC, IPv6, locales, large files, etc. Unfortunately, these
# things cannot be detected automatically, since the value of these
# options (such as BR2_TOOLCHAIN_HAS_NATIVE_RPC) are needed at
# configuration time because these options are used as dependencies
# for other options. And at configuration time, we are not able to
# retrieve the external toolchain configuration.
#
# 3. Copy the libraries needed at runtime to the target directory,
# $(TARGET_DIR). Obviously, things such as the C library, the dynamic
# loader and a few other utility libraries are needed if dynamic
# applications are to be executed on the target system.
#
# 4. Copy the libraries and headers to the staging directory. This
# will allow all further calls to gcc to be made using --sysroot
# $(STAGING_DIR), which greatly simplifies the compilation of the
# packages when using external toolchains. So in the end, only the
# cross-compiler binaries remains external, all libraries and headers
# are imported into the Buildroot tree.
#
# 5. Build a toolchain wrapper which executes the external toolchain
# with a number of arguments (sysroot/march/mtune/..) hardcoded,
# so we're sure the correct configuration is always used and the
# toolchain behaves similar to an internal toolchain.
# This toolchain wrapper and symlinks are installed into
# $(HOST_DIR)/usr/bin like for the internal toolchains, and the rest
# of Buildroot is handled identical for the 2 toolchain types.
################################################################################
#
# Definitions of where the toolchain can be found
#
TOOLCHAIN_EXTERNAL_PREFIX = $(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))
TOOLCHAIN_EXTERNAL_DOWNLOAD_INSTALL_DIR = $(HOST_DIR)/opt/ext-toolchain
ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y)
TOOLCHAIN_EXTERNAL_INSTALL_DIR = $(TOOLCHAIN_EXTERNAL_DOWNLOAD_INSTALL_DIR)
else
TOOLCHAIN_EXTERNAL_INSTALL_DIR = $(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))
endif
ifeq ($(TOOLCHAIN_EXTERNAL_INSTALL_DIR),)
ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),)
# if no path set, figure it out from path
TOOLCHAIN_EXTERNAL_BIN := $(shell dirname $(shell which $(TOOLCHAIN_EXTERNAL_PREFIX)-gcc))
endif
else
TOOLCHAIN_EXTERNAL_BIN := $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/bin
endif
# If this is a buildroot toolchain, it already has a wrapper which we want to
# bypass. Since this is only evaluated after it has been extracted, we can use
# $(wildcard ...) here.
TOOLCHAIN_EXTERNAL_SUFFIX = \
$(if $(wildcard $(TOOLCHAIN_EXTERNAL_BIN)/*.br_real),.br_real)
TOOLCHAIN_EXTERNAL_CROSS = $(TOOLCHAIN_EXTERNAL_BIN)/$(TOOLCHAIN_EXTERNAL_PREFIX)-
TOOLCHAIN_EXTERNAL_CC = $(TOOLCHAIN_EXTERNAL_CROSS)gcc$(TOOLCHAIN_EXTERNAL_SUFFIX)
TOOLCHAIN_EXTERNAL_CXX = $(TOOLCHAIN_EXTERNAL_CROSS)g++$(TOOLCHAIN_EXTERNAL_SUFFIX)
TOOLCHAIN_EXTERNAL_FC = $(TOOLCHAIN_EXTERNAL_CROSS)gfortran$(TOOLCHAIN_EXTERNAL_SUFFIX)
TOOLCHAIN_EXTERNAL_READELF = $(TOOLCHAIN_EXTERNAL_CROSS)readelf$(TOOLCHAIN_EXTERNAL_SUFFIX)
# Normal handling of downloaded toolchain tarball extraction.
ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y)
# As a regular package, the toolchain gets extracted in $(@D), but
# since it's actually a fairly special package, we need it to be moved
# into TOOLCHAIN_EXTERNAL_DOWNLOAD_INSTALL_DIR.
define TOOLCHAIN_EXTERNAL_MOVE
rm -rf $(TOOLCHAIN_EXTERNAL_DOWNLOAD_INSTALL_DIR)
mkdir -p $(TOOLCHAIN_EXTERNAL_DOWNLOAD_INSTALL_DIR)
mv $(@D)/* $(TOOLCHAIN_EXTERNAL_DOWNLOAD_INSTALL_DIR)/
endef
endif
#
# Definitions of the list of libraries that should be copied to the target.
#
ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
TOOLCHAIN_EXTERNAL_LIBS += libatomic.so.* libc.so.* libcrypt.so.* libdl.so.* libgcc_s.so.* libm.so.* libnsl.so.* libresolv.so.* librt.so.* libutil.so.*
ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC)$(BR2_ARM_EABIHF),yy)
TOOLCHAIN_EXTERNAL_LIBS += ld-linux-armhf.so.*
else
TOOLCHAIN_EXTERNAL_LIBS += ld*.so.*
endif
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
TOOLCHAIN_EXTERNAL_LIBS += libpthread.so.*
ifneq ($(BR2_PACKAGE_GDB)$(BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY),)
TOOLCHAIN_EXTERNAL_LIBS += libthread_db.so.*
endif # gdbserver
endif # ! no threads
endif
ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GLIBC),y)
TOOLCHAIN_EXTERNAL_LIBS += libnss_files.so.* libnss_dns.so.* libmvec.so.*
endif
ifeq ($(BR2_TOOLCHAIN_EXTERNAL_MUSL),y)
TOOLCHAIN_EXTERNAL_LIBS += libc.so libgcc_s.so.*
endif
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
TOOLCHAIN_EXTERNAL_LIBS += libstdc++.so.*
endif
ifeq ($(BR2_TOOLCHAIN_HAS_FORTRAN),y)
TOOLCHAIN_EXTERNAL_LIBS += libgfortran.so.*
# fortran needs quadmath on x86 and x86_64
ifeq ($(BR2_TOOLCHAIN_HAS_LIBQUADMATH),y)
TOOLCHAIN_EXTERNAL_LIBS += libquadmath.so*
endif
endif
TOOLCHAIN_EXTERNAL_LIBS += $(call qstrip,$(BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS))
#
# Definition of the CFLAGS to use with the external toolchain, as well as the
# common toolchain wrapper build arguments
#
ifeq ($(call qstrip,$(BR2_GCC_TARGET_CPU_REVISION)),)
CC_TARGET_CPU_ := $(call qstrip,$(BR2_GCC_TARGET_CPU))
else
CC_TARGET_CPU_ := $(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISION))
endif
CC_TARGET_ARCH_ := $(call qstrip,$(BR2_GCC_TARGET_ARCH))
CC_TARGET_ABI_ := $(call qstrip,$(BR2_GCC_TARGET_ABI))
CC_TARGET_FPU_ := $(call qstrip,$(BR2_GCC_TARGET_FPU))
CC_TARGET_FLOAT_ABI_ := $(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
CC_TARGET_MODE_ := $(call qstrip,$(BR2_GCC_TARGET_MODE))
# march/mtune/floating point mode needs to be passed to the external toolchain
# to select the right multilib variant
ifeq ($(BR2_x86_64),y)
TOOLCHAIN_EXTERNAL_CFLAGS += -m64
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_64
endif
ifneq ($(CC_TARGET_ARCH_),)
TOOLCHAIN_EXTERNAL_CFLAGS += -march=$(CC_TARGET_ARCH_)
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_ARCH='"$(CC_TARGET_ARCH_)"'
endif
ifneq ($(CC_TARGET_CPU_),)
TOOLCHAIN_EXTERNAL_CFLAGS += -mcpu=$(CC_TARGET_CPU_)
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_CPU='"$(CC_TARGET_CPU_)"'
endif
ifneq ($(CC_TARGET_ABI_),)
TOOLCHAIN_EXTERNAL_CFLAGS += -mabi=$(CC_TARGET_ABI_)
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_ABI='"$(CC_TARGET_ABI_)"'
endif
ifneq ($(CC_TARGET_FPU_),)
TOOLCHAIN_EXTERNAL_CFLAGS += -mfpu=$(CC_TARGET_FPU_)
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_FPU='"$(CC_TARGET_FPU_)"'
endif
ifneq ($(CC_TARGET_FLOAT_ABI_),)
TOOLCHAIN_EXTERNAL_CFLAGS += -mfloat-abi=$(CC_TARGET_FLOAT_ABI_)
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_FLOAT_ABI='"$(CC_TARGET_FLOAT_ABI_)"'
endif
ifneq ($(CC_TARGET_MODE_),)
TOOLCHAIN_EXTERNAL_CFLAGS += -m$(CC_TARGET_MODE_)
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_MODE='"$(CC_TARGET_MODE_)"'
endif
ifeq ($(BR2_BINFMT_FLAT),y)
TOOLCHAIN_EXTERNAL_CFLAGS += -Wl,-elf2flt
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_BINFMT_FLAT
endif
ifeq ($(BR2_mipsel)$(BR2_mips64el),y)
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_MIPS_TARGET_LITTLE_ENDIAN
TOOLCHAIN_EXTERNAL_CFLAGS += -EL
endif
ifeq ($(BR2_mips)$(BR2_mips64),y)
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_MIPS_TARGET_BIG_ENDIAN
TOOLCHAIN_EXTERNAL_CFLAGS += -EB
endif
ifeq ($(BR2_arceb),y)
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_ARC_TARGET_BIG_ENDIAN
TOOLCHAIN_EXTERNAL_CFLAGS += -EB
endif
TOOLCHAIN_EXTERNAL_CFLAGS += $(call qstrip,$(BR2_TARGET_OPTIMIZATION))
ifeq ($(BR2_SOFT_FLOAT),y)
TOOLCHAIN_EXTERNAL_CFLAGS += -msoft-float
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_SOFTFLOAT=1
endif
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += \
-DBR_CROSS_PATH_SUFFIX='"$(TOOLCHAIN_EXTERNAL_SUFFIX)"'
ifeq ($(filter $(HOST_DIR)/%,$(TOOLCHAIN_EXTERNAL_BIN)),)
# TOOLCHAIN_EXTERNAL_BIN points outside HOST_DIR => absolute path
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += \
-DBR_CROSS_PATH_ABS='"$(TOOLCHAIN_EXTERNAL_BIN)"'
else
# TOOLCHAIN_EXTERNAL_BIN points inside HOST_DIR => relative path
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += \
-DBR_CROSS_PATH_REL='"$(TOOLCHAIN_EXTERNAL_BIN:$(HOST_DIR)/%=%)"'
endif
#
# The following functions creates the symbolic links needed to get the
# cross-compilation tools visible in $(HOST_DIR)/usr/bin. Some of
# links are done directly to the corresponding tool in the external
# toolchain installation directory, while some other links are done to
# the toolchain wrapper (preprocessor, C, C++ and Fortran compiler)
#
# We skip gdb symlink when we are building our own gdb to prevent two
# gdb's in $(HOST_DIR)/usr/bin.
#
# The LTO support in gcc creates wrappers for ar, ranlib and nm which load
# the lto plugin. These wrappers are called *-gcc-ar, *-gcc-ranlib, and
# *-gcc-nm and should be used instead of the real programs when -flto is
# used. However, we should not add the toolchain wrapper for them, and they
# match the *cc-* pattern. Therefore, an additional case is added for *-ar,
# *-ranlib and *-nm.
define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER
$(Q)cd $(HOST_DIR)/usr/bin; \
for i in $(TOOLCHAIN_EXTERNAL_CROSS)*; do \
base=$${i##*/}; \
case "$$base" in \
*-ar|*-ranlib|*-nm) \
ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
;; \
*cc|*cc-*|*++|*++-*|*cpp|*-gfortran) \
ln -sf toolchain-wrapper $$base; \
;; \
*gdb|*gdbtui) \
if test "$(BR2_PACKAGE_HOST_GDB)" != "y"; then \
ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
fi \
;; \
*) \
ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
;; \
esac; \
done
endef
# Various utility functions used by the external toolchain package
# infrastructure. Those functions are mainly responsible for:
#
# - installation the toolchain libraries to $(TARGET_DIR)
# - copying the toolchain sysroot to $(STAGING_DIR)
# - installing a gdbinit file
#
# Details about sysroot directory selection.
#
# To find the sysroot directory, we use the trick of looking for the
# 'libc.a' file with the -print-file-name gcc option, and then
# mangling the path to find the base directory of the sysroot.
#
# Note that we do not use the -print-sysroot option, because it is
# only available since gcc 4.4.x, and we only recently dropped support
# for 4.2.x and 4.3.x.
#
# When doing this, we don't pass any option to gcc that could select a
# multilib variant (such as -march) as we want the "main" sysroot,
# which contains all variants of the C library in the case of multilib
# toolchains. We use the TARGET_CC_NO_SYSROOT variable, which is the
# path of the cross-compiler, without the --sysroot=$(STAGING_DIR),
# since what we want to find is the location of the original toolchain
# sysroot. This "main" sysroot directory is stored in SYSROOT_DIR.
#
# Then, multilib toolchains are a little bit more complicated, since
# they in fact have multiple sysroots, one for each variant supported
# by the toolchain. So we need to find the particular sysroot we're
# interested in.
#
# To do so, we ask the compiler where its sysroot is by passing all
# flags (including -march and al.), except the --sysroot flag since we
# want to the compiler to tell us where its original sysroot
# is. ARCH_SUBDIR will contain the subdirectory, in the main
# SYSROOT_DIR, that corresponds to the selected architecture
# variant. ARCH_SYSROOT_DIR will contain the full path to this
# location.
#
# One might wonder why we don't just bother with ARCH_SYSROOT_DIR. The
# fact is that in multilib toolchains, the header files are often only
# present in the main sysroot, and only the libraries are available in
# each variant-specific sysroot directory.
# toolchain_find_sysroot returns the sysroot location for the given
# compiler + flags. We need to handle cases where libc.a is in:
#
# - lib/
# - usr/lib/
# - lib32/
# - lib64/
# - lib32-fp/ (Cavium toolchain)
# - lib64-fp/ (Cavium toolchain)
# - usr/lib/<tuple>/ (Linaro toolchain)
#
# And variations on these.
define toolchain_find_sysroot
$$(printf $(call toolchain_find_libc_a,$(1)) | sed -r -e 's:(usr/)?lib(32|64)?([^/]*)?/([^/]*/)?libc\.a::')
endef
# Returns the lib subdirectory for the given compiler + flags (i.e
# typically lib32 or lib64 for some toolchains)
define toolchain_find_libdir
$$(printf $(call toolchain_find_libc_a,$(1)) | sed -r -e 's:.*/(usr/)?(lib(32|64)?([^/]*)?)/([^/]*/)?libc.a:\2:')
endef
# Returns the location of the libc.a file for the given compiler + flags
define toolchain_find_libc_a
$$(readlink -f $$(LANG=C $(1) -print-file-name=libc.a))
endef
# Integration of the toolchain into Buildroot: find the main sysroot
# and the variant-specific sysroot, then copy the needed libraries to
# the $(TARGET_DIR) and copy the whole sysroot (libraries and headers)
# to $(STAGING_DIR).
#
# Variables are defined as follows:
#
# SYSROOT_DIR: the main sysroot directory, deduced from the location of
# the libc.a file in the default multilib variant, by
# removing the usr/lib[32|64]/libc.a part of the path.
# Ex: /x-tools/mips-2011.03/mips-linux-gnu/libc/
#
# ARCH_SYSROOT_DIR: the sysroot of the selected multilib variant,
# deduced from the location of the libc.a file in the
# selected multilib variant (taking into account the
# CFLAGS), by removing usr/lib[32|64]/libc.a at the end
# of the path.
# Ex: /x-tools/mips-2011.03/mips-linux-gnu/libc/mips16/soft-float/el/
#
# ARCH_LIB_DIR: 'lib', 'lib32' or 'lib64' depending on where libraries
# are stored. Deduced from the location of the libc.a file
# in the selected multilib variant, by looking at
# usr/lib??/libc.a.
# Ex: lib
#
# ARCH_SUBDIR: the relative location of the sysroot of the selected
# multilib variant compared to the main sysroot.
# Ex: mips16/soft-float/el
#
# SUPPORT_LIB_DIR: some toolchains, such as recent Linaro toolchains,
# store GCC support libraries (libstdc++,
# libgcc_s, etc.) outside of the sysroot. In
# this case, SUPPORT_LIB_DIR is set to a
# non-empty value, and points to the directory
# where these support libraries are
# available. Those libraries will be copied to
# our sysroot, and the directory will also be
# considered when searching libraries for copy
# to the target filesystem.
#
# Please be very careful to check the major toolchain sources:
# Buildroot, Crosstool-NG, CodeSourcery and Linaro
# before doing any modification on the below logic.
ifeq ($(BR2_STATIC_LIBS),)
define TOOLCHAIN_EXTERNAL_INSTALL_TARGET_LIBS
$(Q)$(call MESSAGE,"Copying external toolchain libraries to target...")
$(Q)for libs in $(TOOLCHAIN_EXTERNAL_LIBS); do \
$(call copy_toolchain_lib_root,$$libs); \
done
endef
endif
ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY),y)
define TOOLCHAIN_EXTERNAL_INSTALL_TARGET_GDBSERVER
$(Q)$(call MESSAGE,"Copying gdbserver")
$(Q)ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
gdbserver_found=0 ; \
for d in $${ARCH_SYSROOT_DIR}/usr \
$${ARCH_SYSROOT_DIR}/../debug-root/usr \
$${ARCH_SYSROOT_DIR}/usr/$${ARCH_LIB_DIR} \
$(TOOLCHAIN_EXTERNAL_INSTALL_DIR); do \
if test -f $${d}/bin/gdbserver ; then \
install -m 0755 -D $${d}/bin/gdbserver $(TARGET_DIR)/usr/bin/gdbserver ; \
gdbserver_found=1 ; \
break ; \
fi ; \
done ; \
if [ $${gdbserver_found} -eq 0 ] ; then \
echo "Could not find gdbserver in external toolchain" ; \
exit 1 ; \
fi
endef
endif
define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS
$(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \
ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
SUPPORT_LIB_DIR="" ; \
if test `find $${ARCH_SYSROOT_DIR} -name 'libstdc++.a' | wc -l` -eq 0 ; then \
LIBSTDCPP_A_LOCATION=$$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libstdc++.a) ; \
if [ -e "$${LIBSTDCPP_A_LOCATION}" ]; then \
SUPPORT_LIB_DIR=`readlink -f $${LIBSTDCPP_A_LOCATION} | sed -r -e 's:libstdc\+\+\.a::'` ; \
fi ; \
fi ; \
if [ "$${SYSROOT_DIR}" == "$${ARCH_SYSROOT_DIR}" ] ; then \
ARCH_SUBDIR="" ; \
elif [ "`dirname $${ARCH_SYSROOT_DIR}`" = "`dirname $${SYSROOT_DIR}`" ] ; then \
SYSROOT_DIR_DIRNAME=`dirname $${SYSROOT_DIR}`/ ; \
ARCH_SUBDIR=`echo $${ARCH_SYSROOT_DIR} | sed -r -e "s:^$${SYSROOT_DIR_DIRNAME}(.*)/$$:\1:"` ; \
else \
ARCH_SUBDIR=`echo $${ARCH_SYSROOT_DIR} | sed -r -e "s:^$${SYSROOT_DIR}(.*)/$$:\1:"` ; \
fi ; \
$(call MESSAGE,"Copying external toolchain sysroot to staging...") ; \
$(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR},$${ARCH_LIB_DIR},$${SUPPORT_LIB_DIR})
endef
# Create a symlink from (usr/)$(ARCH_LIB_DIR) to lib.
# Note: the skeleton package additionally creates lib32->lib or lib64->lib
# (as appropriate)
#
# $1: destination directory (TARGET_DIR / STAGING_DIR)
create_lib_symlinks = \
$(Q)DESTDIR="$(strip $1)" ; \
ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
if [ ! -e "$${DESTDIR}/$${ARCH_LIB_DIR}" -a ! -e "$${DESTDIR}/usr/$${ARCH_LIB_DIR}" ]; then \
ln -snf lib "$${DESTDIR}/$${ARCH_LIB_DIR}" ; \
ln -snf lib "$${DESTDIR}/usr/$${ARCH_LIB_DIR}" ; \
fi
define TOOLCHAIN_EXTERNAL_CREATE_STAGING_LIB_SYMLINK
$(call create_lib_symlinks,$(STAGING_DIR))
endef
define TOOLCHAIN_EXTERNAL_CREATE_TARGET_LIB_SYMLINK
$(call create_lib_symlinks,$(TARGET_DIR))
endef
#
# Generate gdbinit file for use with Buildroot
#
define TOOLCHAIN_EXTERNAL_INSTALL_GDBINIT
$(Q)if test -f $(TARGET_CROSS)gdb ; then \
$(call MESSAGE,"Installing gdbinit"); \
$(gen_gdbinit_file); \
fi
endef
# Various utility functions used by the external toolchain based on musl.
# With the musl C library, the libc.so library directly plays the role
# of the dynamic library loader. We just need to create a symbolic
# link to libc.so with the appropriate name.
ifeq ($(BR2_TOOLCHAIN_EXTERNAL_MUSL),y)
ifeq ($(BR2_i386),y)
MUSL_ARCH = i386
else ifeq ($(BR2_ARM_EABIHF),y)
MUSL_ARCH = armhf
else ifeq ($(BR2_mipsel):$(BR2_SOFT_FLOAT),y:y)
MUSL_ARCH = mipsel-sf
else ifeq ($(BR2_sh),y)
MUSL_ARCH = sh
else
MUSL_ARCH = $(ARCH)
endif
define TOOLCHAIN_EXTERNAL_MUSL_LD_LINK
ln -sf libc.so $(TARGET_DIR)/lib/ld-musl-$(MUSL_ARCH).so.1
endef
endif
# uClibc-ng dynamic loader is called ld-uClibc.so.1, but gcc is not
# patched specifically for uClibc-ng, so it continues to generate
# binaries that expect the dynamic loader to be named ld-uClibc.so.0,
# like with the original uClibc. Therefore, we create an additional
# symbolic link to make uClibc-ng systems work properly.
define TOOLCHAIN_EXTERNAL_FIXUP_UCLIBCNG_LDSO
$(Q)if test -e $(TARGET_DIR)/lib/ld-uClibc.so.1; then \
ln -sf ld-uClibc.so.1 $(TARGET_DIR)/lib/ld-uClibc.so.0 ; \
fi
$(Q)if test -e $(TARGET_DIR)/lib/ld64-uClibc.so.1; then \
ln -sf ld64-uClibc.so.1 $(TARGET_DIR)/lib/ld64-uClibc.so.0 ; \
fi
endef
################################################################################
# inner-toolchain-external-package -- defines the generic installation rules
# for external toolchain packages
#
# argument 1 is the lowercase package name
# argument 2 is the uppercase package name, including a HOST_ prefix
# for host packages
# argument 3 is the uppercase package name, without the HOST_ prefix
# for host packages
# argument 4 is the type (target or host)
################################################################################
define inner-toolchain-external-package
$(2)_INSTALL_STAGING = YES
$(2)_ADD_TOOLCHAIN_DEPENDENCY = NO
# In fact, we don't need to download the toolchain, since it is already
# available on the system, so force the site and source to be empty so
# that nothing will be downloaded/extracted.
ifeq ($$(BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED),y)
$(2)_SITE =
$(2)_SOURCE =
endif
ifeq ($$(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y)
$(2)_EXCLUDES = usr/lib/locale/*
$(2)_POST_EXTRACT_HOOKS += \
TOOLCHAIN_EXTERNAL_MOVE
endif
# Checks for an already installed toolchain: check the toolchain
# location, check that it is usable, and then verify that it
# matches the configuration provided in Buildroot: ABI, C++ support,
# kernel headers version, type of C library and all C library features.
define $(2)_CONFIGURE_CMDS
$$(Q)$$(call check_cross_compiler_exists,$$(TOOLCHAIN_EXTERNAL_CC))
$$(Q)$$(call check_unusable_toolchain,$$(TOOLCHAIN_EXTERNAL_CC))
$$(Q)SYSROOT_DIR="$$(call toolchain_find_sysroot,$$(TOOLCHAIN_EXTERNAL_CC))" ; \
$$(call check_kernel_headers_version,\
$$(call toolchain_find_sysroot,$$(TOOLCHAIN_EXTERNAL_CC)),\
$$(call qstrip,$$(BR2_TOOLCHAIN_HEADERS_AT_LEAST))); \
$$(call check_gcc_version,$$(TOOLCHAIN_EXTERNAL_CC),\
$$(call qstrip,$$(BR2_TOOLCHAIN_GCC_AT_LEAST))); \
if test "$$(BR2_arm)" = "y" ; then \
$$(call check_arm_abi,\
"$$(TOOLCHAIN_EXTERNAL_CC) $$(TOOLCHAIN_EXTERNAL_CFLAGS)",\
$$(TOOLCHAIN_EXTERNAL_READELF)) ; \
fi ; \
if test "$$(BR2_INSTALL_LIBSTDCPP)" = "y" ; then \
$$(call check_cplusplus,$$(TOOLCHAIN_EXTERNAL_CXX)) ; \
fi ; \
if test "$$(BR2_TOOLCHAIN_HAS_FORTRAN)" = "y" ; then \
$$(call check_fortran,$$(TOOLCHAIN_EXTERNAL_FC)) ; \
fi ; \
if test "$$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC)" = "y" ; then \
$$(call check_uclibc,$$$${SYSROOT_DIR}) ; \
elif test "$$(BR2_TOOLCHAIN_EXTERNAL_MUSL)" = "y" ; then \
$$(call check_musl,$$$${SYSROOT_DIR}) ; \
else \
$$(call check_glibc,$$$${SYSROOT_DIR}) ; \
fi
$$(Q)$$(call check_toolchain_ssp,$$(TOOLCHAIN_EXTERNAL_CC))
endef
$(2)_TOOLCHAIN_WRAPPER_ARGS += $$(TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS)
$(2)_BUILD_CMDS = $$(TOOLCHAIN_WRAPPER_BUILD)
define $(2)_INSTALL_STAGING_CMDS
$$(TOOLCHAIN_WRAPPER_INSTALL)
$$(TOOLCHAIN_EXTERNAL_CREATE_STAGING_LIB_SYMLINK)
$$(TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS)
$$(TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER)
$$(TOOLCHAIN_EXTERNAL_INSTALL_GDBINIT)
endef
ifeq ($$(BR2_TOOLCHAIN_EXTERNAL_MUSL),y)
$(2)_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_MUSL_LD_LINK
endif
# Even though we're installing things in both the staging, the host
# and the target directory, we do everything within the
# install-staging step, arbitrarily.
define $(2)_INSTALL_TARGET_CMDS
$$(TOOLCHAIN_EXTERNAL_CREATE_TARGET_LIB_SYMLINK)
$$(TOOLCHAIN_EXTERNAL_INSTALL_TARGET_LIBS)
$$(TOOLCHAIN_EXTERNAL_INSTALL_TARGET_GDBSERVER)
$$(TOOLCHAIN_EXTERNAL_FIXUP_UCLIBCNG_LDSO)
endef
# Call the generic package infrastructure to generate the necessary
# make targets
$(call inner-generic-package,$(1),$(2),$(3),$(4))
endef
toolchain-external-package = $(call inner-toolchain-external-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)

View File

@ -0,0 +1,61 @@
config BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS
bool "Codescape IMG GNU Linux Toolchain 2016.05"
depends on BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
depends on BR2_MIPS_CPU_MIPS32R6 || (BR2_MIPS_CPU_MIPS64R6 && !BR2_MIPS_SOFT_FLOAT)
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
select BR2_INSTALL_LIBSTDCPP
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
select BR2_TOOLCHAIN_HAS_FORTRAN
help
Codescape IMG GNU Linux Toolchain 2016.05 for the MIPS
architecture, from Imagination Technologies. It uses gcc
4.9.2, binutils 2.24.90, glibc 2.20, gdb 7.9.1 and kernel
headers 4.7. It has support for the following variants:
- MIPS32r6 - Big-Endian, Hard-Float, 2008 NaN, o32 ABI
Select 'MIPS (big endian)' Target Architecture
Select 'mips 32r6' Target Architecture Variant
Disable 'Use soft-float'
- MIPS32r6 - Big-Endian, Soft-Float, 2008 NaN, o32 ABI
Select 'MIPS (big endian)' Target Architecture
Select 'mips 32r6' Target Architecture Variant
Enable 'Use soft-float'
- MIPS32r6 - Little-Endian, Hard-Float, 2008 NaN, o32 ABI
Select 'MIPS (little endian)' Target Architecture
Select 'mips 32r6' Target Architecture Variant
Disable 'Use soft-float'
- MIPS32r6 - Little-Endian, Soft-Float, 2008 NaN, o32 ABI
Select 'MIPS (little endian)' Target Architecture
Select 'mips 32r6' Target Architecture Variant
Enable 'Use soft-float'
- MIPS32r6 - Little-Endian, Hard-Float, 2008 NaN, o32 ABI, microMIPS
Select 'MIPS (little endian)' Target Architecture
Select 'mips 32r6' Target Architecture Variant
Disable 'Use soft-float'
Set BR2_TARGET_OPTIMIZATION to '-mmicromips'
- MIPS32r6 - Little-Endian, Soft-Float, 2008 NaN, o32 ABI, microMIPS
Select 'MIPS (little endian)' Target Architecture
Select 'mips 32r6' Target Architecture Variant
Enable 'Use soft-float'
Set BR2_TARGET_OPTIMIZATION to '-mmicromips'
- MIPS64r6 - Big-Endian, Hard-Float, 2008 NaN, n32 ABI
Select 'MIPS64 (big endian)' Target Architecture
Select 'mips 64r6' Target Architecture Variant
Select 'n32' Target ABI
Disable 'Use soft-float'
- MIPS64r6 - Little-Endian, Hard-Float, 2008 NaN, n32 ABI
Select 'MIPS64 (little endian)' Target Architecture
Select 'mips 64r6' Target Architecture Variant
Select 'n32' Target ABI
Disable 'Use soft-float'
- MIPS64r6 - Big-Endian, Hard-Float, 2008 NaN, n64 ABI
Select 'MIPS64 (big endian)' Target Architecture
Select 'mips 64r6' Target Architecture Variant
Select 'n64' Target ABI
Disable 'Use soft-float'
- MIPS64r6 - Little-Endian, Hard-Float, 2008 NaN, n64 ABI
Select 'MIPS64 (little endian)' Target Architecture
Select 'mips 64r6' Target Architecture Variant
Select 'n64' Target ABI
Disable 'Use soft-float'

View File

@ -0,0 +1,9 @@
if BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS
config BR2_TOOLCHAIN_EXTERNAL_PREFIX
default "mips-img-linux-gnu"
config BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL
default "toolchain-external-codescape-img-mips"
endif

View File

@ -0,0 +1,4 @@
# Codescape toolchains from Imagination Technologies
# From: http://codescape-mips-sdk.imgtec.com/components/toolchain/2016.05-06/downloads.html
sha256 8d9cdf711dd402d7bf82883d425c221038fe8ce9d0c91a3f6b30939d9d55476c Codescape.GNU.Tools.Package.2016.05-06.for.MIPS.IMG.Linux.CentOS-5.x86.tar.gz
sha256 6e2784d6df962fe4db7510c8a62ce3947b73f54207b10e18b52da59d1bc487bd Codescape.GNU.Tools.Package.2016.05-06.for.MIPS.IMG.Linux.CentOS-5.x86_64.tar.gz

View File

@ -0,0 +1,51 @@
################################################################################
#
# toolchain-external-codescape-img-mips
#
################################################################################
TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_VERSION = 2016.05-06
TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_SITE = http://codescape-mips-sdk.imgtec.com/components/toolchain/$(TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_VERSION)
TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_STRIP_COMPONENTS = 2
ifeq ($(HOSTARCH),x86)
TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_SOURCE = Codescape.GNU.Tools.Package.$(TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_VERSION).for.MIPS.IMG.Linux.CentOS-5.x86.tar.gz
else
TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_SOURCE = Codescape.GNU.Tools.Package.$(TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_VERSION).for.MIPS.IMG.Linux.CentOS-5.x86_64.tar.gz
endif
# Special fixup for Codescape MIPS toolchains, that have bin-<abi> and
# sbin-<abi> directories. We create symlinks bin -> bin-<abi> and sbin
# -> sbin-<abi> so that the rest of Buildroot can find the toolchain
# tools in the appropriate location.
ifeq ($(BR2_MIPS_OABI32),y)
TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_BIN_DIR_SUFFIX = o32
else ifeq ($(BR2_MIPS_NABI32),y)
TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_BIN_DIR_SUFFIX = n32
else ifeq ($(BR2_MIPS_NABI64),y)
TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_BIN_DIR_SUFFIX = n64
endif
define TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_STAGING_FIXUPS
rmdir $(STAGING_DIR)/usr/bin $(STAGING_DIR)/usr/sbin
ln -sf bin-$(TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_BIN_DIR_SUFFIX) $(STAGING_DIR)/usr/bin
ln -sf sbin-$(TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_BIN_DIR_SUFFIX) $(STAGING_DIR)/usr/sbin
endef
# The Codescape toolchain uses a sysroot layout that places them
# side-by-side instead of nested like multilibs. A symlink is needed
# much like for the nested sysroots which are handled in
# copy_toolchain_sysroot but there is not enough information in there
# to determine whether the sysroot layout was nested or side-by-side.
# Add the symlink here for now.
define TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_SYMLINK
$(Q)ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))"; \
ARCH_SUBDIR=`basename $${ARCH_SYSROOT_DIR}`; \
ln -snf . $(STAGING_DIR)/$${ARCH_SUBDIR}
endef
TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_POST_INSTALL_STAGING_HOOKS += \
TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_STAGING_FIXUPS \
TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS_SYMLINK
$(eval $(toolchain-external-package))

View File

@ -0,0 +1,72 @@
config BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS
bool "Codescape MTI GNU Linux Toolchain 2016.05"
depends on BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
depends on BR2_MIPS_CPU_MIPS32R2 || (BR2_MIPS_CPU_MIPS64R2 && !BR2_MIPS_SOFT_FLOAT) || \
BR2_MIPS_CPU_MIPS32R5 || (BR2_MIPS_CPU_MIPS64R5 && !BR2_MIPS_SOFT_FLOAT)
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
select BR2_INSTALL_LIBSTDCPP
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
select BR2_TOOLCHAIN_HAS_FORTRAN
help
Codescape MTI GNU Linux Toolchain 2016.05 for the MIPS
architecture, from Imagination Technologies. It uses gcc
4.9.2, binutils 2.24.90, glibc 2.20, gdb 7.9.1 and kernel
headers 4.7. It has support for the following variants:
- MIPS32r2 - Big-Endian, Hard-Float, Legacy NaN, o32 ABI
Select 'MIPS (big endian)' Target Architecture
Select 'mips 32r2' Target Architecture Variant
Disable 'Use soft-float'
- MIPS32r2 - Big-Endian, Hard-Float, 2008 NaN, o32 ABI
Select 'MIPS (big endian)' Target Architecture
Select 'mips 32r2' Target Architecture Variant
Disable 'Use soft-float'
Set BR2_TARGET_OPTIMIZATION to '-mnan=2008'
- MIPS32r2 - Big-Endian, Soft-Float, Legacy NaN, o32 ABI
Select 'MIPS (big endian)' Target Architecture
Select 'mips 32r2' Target Architecture Variant
Enable 'Use soft-float'
- MIPS32r2 - Little-Endian, Hard-Float, Legacy NaN, o32 ABI
Select 'MIPS (little endian)' Target Architecture
Select 'mips 32r2' Target Architecture Variant
Disable 'Use soft-float'
- MIPS32r2 - Little-Endian, Hard-Float, 2008 NaN, o32 ABI
Select 'MIPS (little endian)' Target Architecture
Select 'mips 32r2' Target Architecture Variant
Disable 'Use soft-float'
Set BR2_TARGET_OPTIMIZATION to '-mnan=2008'
- MIPS32r2 - Little-Endian, Soft-Float, Legacy NaN, o32 ABI
Select 'MIPS (little endian)' Target Architecture
Select 'mips 32r2' Target Architecture Variant
Enable 'Use soft-float'
- MIPS32r2 - Little-Endian, Hard-Float, 2008 NaN, o32 ABI, microMIPS
Select 'MIPS (little endian)' Target Architecture
Select 'mips 32r2' Target Architecture Variant
Enable 'Use soft-float'
Set BR2_TARGET_OPTIMIZATION to '-mmicromips'
- MIPS32r2 - Little-Endian, Soft-Float, Legacy NaN, o32 ABI, microMIPS
Select 'MIPS (little endian)' Target Architecture
Select 'mips 32r2' Target Architecture Variant
Disable 'Use soft-float'
Set BR2_TARGET_OPTIMIZATION to '-mmicromips'
- MIPS64r2 - Big-Endian, Hard-Float, Legacy NaN, n32 ABI
Select 'MIPS64 (big endian)' Target Architecture
Select 'mips 64r2' Target Architecture Variant
Select 'n32' Target ABI
Disable 'Use soft-float'
- MIPS64r2 - Little-Endian, Hard-Float, Legacy NaN, n32 ABI
Select 'MIPS64 (little endian)' Target Architecture
Select 'mips 64r2' Target Architecture Variant
Select 'n32' Target ABI
Disable 'Use soft-float'
- MIPS64r2 - Big-Endian, Hard-Float, Legacy NaN, n64 ABI
Select 'MIPS64 (big endian)' Target Architecture
Select 'mips 64r2' Target Architecture Variant
Select 'n64' Target ABI
Disable 'Use soft-float'
- MIPS64r2 - Little-Endian, Hard-Float, Legacy NaN, n64 ABI
Select 'MIPS64 (little endian)' Target Architecture
Select 'mips 64r2' Target Architecture Variant
Select 'n64' Target ABI
Disable 'Use soft-float'

View File

@ -0,0 +1,9 @@
if BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS
config BR2_TOOLCHAIN_EXTERNAL_PREFIX
default "mips-mti-linux-gnu"
config BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL
default "toolchain-external-codescape-mti-mips"
endif

View File

@ -0,0 +1,4 @@
# Codescape toolchains from Imagination Technologies
# From: http://codescape-mips-sdk.imgtec.com/components/toolchain/2016.05-06/downloads.html
sha256 3a7aba259beb05f0e3054b5a61a368a5085447f47361949a938ac9cc7de4227b Codescape.GNU.Tools.Package.2016.05-06.for.MIPS.MTI.Linux.CentOS-5.x86.tar.gz
sha256 a676a8b3647c8c651fb8935a75db8f00b79d36ec55676f7c05bac12b550788f7 Codescape.GNU.Tools.Package.2016.05-06.for.MIPS.MTI.Linux.CentOS-5.x86_64.tar.gz

View File

@ -0,0 +1,51 @@
################################################################################
#
# toolchain-external-codescape-mti-mips
#
################################################################################
TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_VERSION = 2016.05-06
TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_SITE = http://codescape-mips-sdk.imgtec.com/components/toolchain/$(TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_VERSION)
TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_STRIP_COMPONENTS = 2
ifeq ($(HOSTARCH),x86)
TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_SOURCE = Codescape.GNU.Tools.Package.$(TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_VERSION).for.MIPS.MTI.Linux.CentOS-5.x86.tar.gz
else
TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_SOURCE = Codescape.GNU.Tools.Package.$(TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_VERSION).for.MIPS.MTI.Linux.CentOS-5.x86_64.tar.gz
endif
# Special fixup for Codescape MIPS toolchains, that have bin-<abi> and
# sbin-<abi> directories. We create symlinks bin -> bin-<abi> and sbin
# -> sbin-<abi> so that the rest of Buildroot can find the toolchain
# tools in the appropriate location.
ifeq ($(BR2_MIPS_OABI32),y)
TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_BIN_DIR_SUFFIX = o32
else ifeq ($(BR2_MIPS_NABI32),y)
TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_BIN_DIR_SUFFIX = n32
else ifeq ($(BR2_MIPS_NABI64),y)
TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_BIN_DIR_SUFFIX = n64
endif
define TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_STAGING_FIXUPS
rmdir $(STAGING_DIR)/usr/bin $(STAGING_DIR)/usr/sbin
ln -sf bin-$(TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_BIN_DIR_SUFFIX) $(STAGING_DIR)/usr/bin
ln -sf sbin-$(TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_BIN_DIR_SUFFIX) $(STAGING_DIR)/usr/sbin
endef
# The Codescape toolchain uses a sysroot layout that places them
# side-by-side instead of nested like multilibs. A symlink is needed
# much like for the nested sysroots which are handled in
# copy_toolchain_sysroot but there is not enough information in there
# to determine whether the sysroot layout was nested or side-by-side.
# Add the symlink here for now.
define TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_SYMLINK
$(Q)ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))"; \
ARCH_SUBDIR=`basename $${ARCH_SYSROOT_DIR}`; \
ln -snf . $(STAGING_DIR)/$${ARCH_SUBDIR}
endef
TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_POST_INSTALL_STAGING_HOOKS += \
TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_STAGING_FIXUPS \
TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS_SYMLINK
$(eval $(toolchain-external-package))

View File

@ -0,0 +1,17 @@
config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64
bool "CodeSourcery AArch64 2014.11"
depends on BR2_aarch64
depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
depends on !BR2_STATIC_LIBS
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
select BR2_TOOLCHAIN_HAS_SSP
select BR2_INSTALL_LIBSTDCPP
select BR2_HOSTARCH_NEEDS_IA32_LIBS
select BR2_TOOLCHAIN_HAS_NATIVE_RPC
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16
select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
help
Sourcery CodeBench toolchain for the AArch64 architecture,
from Mentor Graphics. It uses gcc 4.9.1, binutils
2.24.51.20140217, glibc 2.20, gdb 7.7.50 and kernel headers
3.16.2.

View File

@ -0,0 +1,9 @@
if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64
config BR2_TOOLCHAIN_EXTERNAL_PREFIX
default "aarch64-amd-linux-gnu"
config BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL
default "toolchain-external-codesourcery-aarch64"
endif

View File

@ -0,0 +1,3 @@
# Locally calculated
sha256 405aada821146755c5f2df566375c2a682456d6b8451ee47b88cf1a52b093676 aarch64-amd-2014.11-95-aarch64-amd-linux-gnu-i686-pc-linux-gnu.tar.bz2
sha256 3f50dd6ee433eb5b6992a1071b988e50379a738f54f58722bc60081613764716 aarch64-amd-2014.11-95-aarch64-amd-linux-gnu.src.tar.bz2

View File

@ -0,0 +1,22 @@
################################################################################
#
# toolchain-external-codesourcery-aarch64
#
################################################################################
TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_SITE = http://sourcery.mentor.com/public/gnu_toolchain/$(TOOLCHAIN_EXTERNAL_PREFIX)
TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_VERSION = 2014.11-95
TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_SOURCE = aarch64-amd-$(TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_VERSION)-$(TOOLCHAIN_EXTERNAL_PREFIX)-i686-pc-linux-gnu.tar.bz2
TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_ACTUAL_SOURCE_TARBALL = aarch64-amd-$(TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_VERSION)-$(TOOLCHAIN_EXTERNAL_PREFIX).src.tar.bz2
define TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_STAGING_FIXUP
ln -sf ld-2.20.so $(STAGING_DIR)/lib/ld-linux-aarch64.so.1
endef
TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_STAGING_FIXUP
define TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_TARGET_FIXUP
ln -sf ld-2.20.so $(TARGET_DIR)/lib/ld-linux-aarch64.so.1
endef
TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_POST_INSTALL_TARGET_HOOKS += TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_TARGET_FIXUP
$(eval $(toolchain-external-package))

View File

@ -0,0 +1,24 @@
config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AMD64
bool "Sourcery CodeBench AMD64 2016.11"
depends on BR2_x86_64
depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
depends on !BR2_STATIC_LIBS
depends on BR2_x86_jaguar || BR2_x86_steamroller
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
select BR2_TOOLCHAIN_HAS_SSP
select BR2_TOOLCHAIN_HAS_NATIVE_RPC
select BR2_INSTALL_LIBSTDCPP
select BR2_HOSTARCH_NEEDS_IA32_LIBS
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
select BR2_TOOLCHAIN_GCC_AT_LEAST_6
help
Sourcery CodeBench toolchain for the amd64 (x86_64)
architectures, from Mentor Graphics. It uses gcc 6.2,
binutils 2.26, glibc 2.24, gdb 7.11 and kernel headers
4.7. It has support for the following variants:
- AMD Puma/Jaguar (family 16h), glibc
Default for x86_64, nothing special to do.
- AMD Steamroller (family 15h), glibc
Select a steamroller core.
No other architecture variants are supported since glibc
is optimized for one of these two baselines.

View File

@ -0,0 +1,9 @@
if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AMD64
config BR2_TOOLCHAIN_EXTERNAL_PREFIX
default "x86_64-amd-linux-gnu"
config BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL
default "toolchain-external-codesourcery-amd64"
endif

View File

@ -0,0 +1,3 @@
# Locally calculated
sha256 a6c23837dd45a33866c60a2fd8d7af40520cd84ff1059abda797952d7ee0fafd amd-2016.11-19-x86_64-amd-linux-gnu-i686-pc-linux-gnu.tar.bz2
sha256 d61ce0b5648ad63cca16fe233c82e7eaa6a3212a549d69a527e7a2d5350f7b4a amd-2016.11-19-x86_64-amd-linux-gnu.src.tar.bz2

View File

@ -0,0 +1,12 @@
################################################################################
#
# toolchain-external-codesourcery-amd64
#
################################################################################
TOOLCHAIN_EXTERNAL_CODESOURCERY_AMD64_SITE = https://sourcery.mentor.com/public/gnu_toolchain/$(TOOLCHAIN_EXTERNAL_PREFIX)
TOOLCHAIN_EXTERNAL_CODESOURCERY_AMD64_VERSION = 2016.11-19
TOOLCHAIN_EXTERNAL_CODESOURCERY_AMD64_SOURCE = amd-$(TOOLCHAIN_EXTERNAL_CODESOURCERY_AMD64_VERSION)-$(TOOLCHAIN_EXTERNAL_PREFIX)-i686-pc-linux-gnu.tar.bz2
TOOLCHAIN_EXTERNAL_CODESOURCERY_AMD64_ACTUAL_SOURCE_TARBALL = amd-$(TOOLCHAIN_EXTERNAL_CODESOURCERY_AMD64_VERSION)-$(TOOLCHAIN_EXTERNAL_PREFIX).src.tar.bz2
$(eval $(toolchain-external-package))

View File

@ -0,0 +1,35 @@
config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM
bool "Sourcery CodeBench ARM 2014.05"
depends on BR2_arm
depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
depends on BR2_ARM_EABI
# Unsupported ARM cores
depends on !BR2_cortex_a12 && !BR2_cortex_a17 && !BR2_ARM_CPU_ARMV8
depends on !BR2_STATIC_LIBS
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
select BR2_TOOLCHAIN_HAS_SSP
select BR2_TOOLCHAIN_HAS_NATIVE_RPC
select BR2_INSTALL_LIBSTDCPP
select BR2_HOSTARCH_NEEDS_IA32_LIBS
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
select BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
help
Sourcery CodeBench toolchain for the ARM architecture, from
Mentor Graphics. It uses gcc 4.8.3, binutils 2.24.51, glibc
2.18 and gdb 7.7.50, kernel headers 3.13. It has support
for the following variants:
- ARMv5TE, little endian, soft-float, glibc
Select ARM926T, ARM10T, XScale or another ARMv5 core
Select BR2_SOFT_FLOAT
- ARMv4T, little endian, soft-float, glibc
Select ARM720T, ARM920T, ARM922T or another ARMv4 core
Select BR2_SOFT_FLOAT
- ARMv7-A, Thumb 2, little endian, soft-float, glibc
Select Cortex-A8, Cortex-A9 or another ARMv7-A core
Select BR2_SOFT_FLOAT
Set BR2_TARGET_OPTIMIZATION to -mthumb
comment "Sourcery CodeBench toolchains available for the EABI ABI"
depends on BR2_arm
depends on !BR2_ARM_EABI
depends on !BR2_STATIC_LIBS

View File

@ -0,0 +1,9 @@
if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM
config BR2_TOOLCHAIN_EXTERNAL_PREFIX
default "arm-none-linux-gnueabi"
config BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL
default "toolchain-external-codesourcery-arm"
endif

View File

@ -0,0 +1,3 @@
# Locally calculated
sha256 39ee0e789034334ecc89af94e838e3a4815400ac5ff980f808f466b04778532e arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
sha256 e16a5b1e41d7ff1e74161f9405182001bc8d1360d89564e73911032e6966cc0d arm-2014.05-29-arm-none-linux-gnueabi.src.tar.bz2

View File

@ -0,0 +1,13 @@
################################################################################
#
# toolchain-external-codesourcery-arm
#
################################################################################
TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM_VERSION = 2014.05-29
TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM_SITE = http://sourcery.mentor.com/public/gnu_toolchain/$(TOOLCHAIN_EXTERNAL_PREFIX)
TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM_SOURCE = arm-$(TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM_VERSION)-$(TOOLCHAIN_EXTERNAL_PREFIX)-i686-pc-linux-gnu.tar.bz2
TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM_ACTUAL_SOURCE_TARBALL = arm-$(TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM_VERSION)-$(TOOLCHAIN_EXTERNAL_PREFIX).src.tar.bz2
$(eval $(toolchain-external-package))

View File

@ -0,0 +1,93 @@
config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS
bool "Sourcery CodeBench MIPS 2016.05"
depends on BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
depends on BR2_MIPS_CPU_MIPS32R2 || BR2_MIPS_CPU_MIPS64R2
# Unsupported MIPS cores
depends on !BR2_mips_interaptiv
depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
depends on !BR2_MIPS_NABI32
depends on !BR2_STATIC_LIBS
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
select BR2_TOOLCHAIN_HAS_SSP
select BR2_TOOLCHAIN_HAS_NATIVE_RPC
select BR2_INSTALL_LIBSTDCPP
select BR2_HOSTARCH_NEEDS_IA32_LIBS
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4
select BR2_TOOLCHAIN_GCC_AT_LEAST_5
help
Sourcery CodeBench toolchain for the MIPS architecture, from
Mentor Graphics. It uses gcc 5.3, binutils 2.25.51, glibc
2.23, uClibc 0.9.30 and gdb 7.10.50, kernel headers 4.4.1. It
has support for the following variants:
- MIPS32r2 - Big-Endian, 2008 NaN, O32
Select MIPS (big endian) core
Disable BR2_SOFT_FLOAT
Set BR2_TARGET_OPTIMIZATION to -mnan=2008
- MIPS32r2 - Big-Endian, O32
Select MIPS (big endian) core
Disable BR2_SOFT_FLOAT
- MIPS32r2 - Big-Endian, O32, MIPS16
Select MIPS (big endian) core
Disable BR2_SOFT_FLOAT
Set BR2_TARGET_OPTIMIZATION to -mips16
- MIPS32r2 - Big-Endian, Soft-Float, O32
Select MIPS (big endian) core
Select BR2_SOFT_FLOAT
- MIPS32r2 - Big-Endian, Soft-Float, O32, MIPS16
Select MIPS (big endian) core
Select BR2_SOFT_FLOAT
Set BR2_TARGET_OPTIMIZATION to -mips16
- MIPS32r2 - Little-Endian, 2008 NaN, O32
Select MIPS (little endian) core
Disable BR2_SOFT_FLOAT
Set BR2_TARGET_OPTIMIZATION to -mnan=2008
- MIPS32r2 - Little-Endian, O32
Select MIPS (little endian) core
Disable BR2_SOFT_FLOAT
- MIPS32r2 - Little-Endian, O32, MIPS16
Select MIPS (little endian) core
Disable BR2_SOFT_FLOAT
Set BR2_TARGET_OPTIMIZATION to -mips16
- MIPS32r2 - Little-Endian, Soft-Float, O32
Select MIPS (little endian) core
Select BR2_SOFT_FLOAT
- MIPS32r2 - Little-Endian, Soft-Float, O32, MIPS16
Select MIPS (little endian) core
Select BR2_SOFT_FLOAT
Set BR2_TARGET_OPTIMIZATION to -mips16
- MIPS32r2 - Little-Endian, Soft-Float, O32, microMIPS
Select MIPS (little endian) core
Select BR2_SOFT_FLOAT
Set BR2_TARGET_OPTIMIZATION to -mmicromips
- MIPS32r2 - uClibc, Big-Endian, 2008 NaN, O32
Not usable in Buildroot yet.
- MIPS32r2 - uClibc, Big-Endian, O32
Not usable in Buildroot yet.
- MIPS32r2 - uClibc, Big-Endian, Soft-Float, O32
Not usable in Buildroot yet.
- MIPS32r2 - uClibc, Little-Endian, 2008 NaN, O32
Not usable in Buildroot yet.
- MIPS32r2 - uClibc, Little-Endian, O32
Not usable in Buildroot yet.
- MIPS32r2 - uClibc, Little-Endian, Soft-Float, O32
Not usable in Buildroot yet.
- MIPS64r2 - Big-Endian, N64
Select MIPS64 (big endian) core
Select the n64 ABI
Disable BR2_SOFT_FLOAT
- MIPS64r2 - Big-Endian, Soft-Float, N64
Select MIPS64 (big endian) core
Select the n64 ABI
Select BR2_SOFT_FLOAT
- MIPS64r2 - Little-Endian, N64
Select MIPS64 (little endian) core
Select the n64 ABI
Disable BR2_SOFT_FLOAT
- MIPS64r2 - Little-Endian, Soft-Float, N64
Select MIPS64 (little endian) core
Select the n64 ABI
Select BR2_SOFT_FLOAT
comment "Sourcery CodeBench toolchains are only available for MIPS/MIPS64 o32 and n64"
depends on BR2_MIPS_NABI32
depends on !BR2_STATIC_LIBS

View File

@ -0,0 +1,9 @@
if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS
config BR2_TOOLCHAIN_EXTERNAL_PREFIX
default "mips-linux-gnu"
config BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL
default "toolchain-external-codesourcery-mips"
endif

View File

@ -0,0 +1,3 @@
# Locally computed
sha256 d354447c4c5160439dafd5464fa3a0266dd41e79f973477238e4f0215a6b5397 mips-2016.05-8-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2
sha256 2658e55d5b71bba25d6f77e868e18b200ea5f75c8add7ed3a9266e716d9adfff mips-2016.05-8-mips-linux-gnu.src.tar.bz2

View File

@ -0,0 +1,13 @@
################################################################################
#
# toolchain-external-codesourcery-mips
#
################################################################################
TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS_VERSION = 2016.05-8
TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS_SITE = http://sourcery.mentor.com/public/gnu_toolchain/$(TOOLCHAIN_EXTERNAL_PREFIX)
TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS_SOURCE = mips-$(TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS_VERSION)-$(TOOLCHAIN_EXTERNAL_PREFIX)-i686-pc-linux-gnu.tar.bz2
TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS_ACTUAL_SOURCE_TARBALL = mips-$(TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS_VERSION)-$(TOOLCHAIN_EXTERNAL_PREFIX).src.tar.bz2
$(eval $(toolchain-external-package))

View File

@ -0,0 +1,17 @@
config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII
bool "Sourcery CodeBench Nios-II 2016.11"
depends on BR2_nios2
depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
depends on !BR2_STATIC_LIBS
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
select BR2_TOOLCHAIN_HAS_SSP
select BR2_TOOLCHAIN_HAS_NATIVE_RPC
select BR2_INSTALL_LIBSTDCPP
select BR2_HOSTARCH_NEEDS_IA32_LIBS
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
select BR2_TOOLCHAIN_GCC_AT_LEAST_6
select BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405 # based-on binutils-2.26
help
Sourcery CodeBench toolchain for the Nios-II architecture,
from Mentor Graphics. It uses gcc 6.2, binutils 2.26,
glibc 2.24, gdb 7.11 and kernel headers 4.7.

View File

@ -0,0 +1,9 @@
if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII
config BR2_TOOLCHAIN_EXTERNAL_PREFIX
default "nios2-linux-gnu"
config BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL
default "toolchain-external-codesourcery-niosII"
endif

View File

@ -0,0 +1,3 @@
# Locally calculated
sha256 97e3b878c67e46430f2b9a42b11bc95b1ef9fef263e6b5ee9103d1239c9e847d sourceryg++-2016.11-32-nios2-linux-gnu-i686-pc-linux-gnu.tar.bz2
sha256 ee2c4391137be8fee987411301bbf9f0e4a823400e37c9f8c1cae9900485cbca sourceryg++-2016.11-32-nios2-linux-gnu.src.tar.bz2

View File

@ -0,0 +1,13 @@
################################################################################
#
# toolchain-external-codesourcery-niosII
#
################################################################################
TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII_VERSION = 2016.11-32
TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII_SITE = http://sourcery.mentor.com/public/gnu_toolchain/$(TOOLCHAIN_EXTERNAL_PREFIX)
TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII_SOURCE = sourceryg++-$(TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII_VERSION)-$(TOOLCHAIN_EXTERNAL_PREFIX)-i686-pc-linux-gnu.tar.bz2
TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII_ACTUAL_SOURCE_TARBALL = sourceryg++-$(TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII_VERSION)-$(TOOLCHAIN_EXTERNAL_PREFIX).src.tar.bz2
$(eval $(toolchain-external-package))

View File

@ -0,0 +1,25 @@
config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH
bool "Sourcery CodeBench SH 2012.09"
depends on BR2_sh4a || BR2_sh4aeb
depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
depends on !BR2_STATIC_LIBS
select BR2_TOOLCHAIN_EXTERNAL_GLIBC
select BR2_TOOLCHAIN_HAS_SSP
select BR2_TOOLCHAIN_HAS_NATIVE_RPC
select BR2_INSTALL_LIBSTDCPP
select BR2_HOSTARCH_NEEDS_IA32_LIBS
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
select BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
help
Sourcery CodeBench toolchain for the SuperH architecture,
from Mentor Graphics. It uses gcc 4.7.2, binutils 2.23.51,
glibc 2.16, uClibc 0.9.30, gdb 7.4.50 and kernel headers
3.5.4. It has support for the following variants:
- SH4A, glibc, little endian
Default.
- SH4A, glibc, big endian
Add -mb to BR2_TARGET_OPTIMIZATION
- SH4A, uClibc, little endian
Not usable in Buildroot yet.
- SH4A, uClibc, big endian
Not usable in Buildroot yet.

View File

@ -0,0 +1,9 @@
if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH
config BR2_TOOLCHAIN_EXTERNAL_PREFIX
default "sh-linux-gnu"
config BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL
default "toolchain-external-codesourcery-sh"
endif

View File

@ -0,0 +1,3 @@
# Locally calculated
sha256 59d6766fde244931aa52db01433d5acd051998762a931121c5fc109536a1a802 renesas-2012.09-61-sh-linux-gnu-i686-pc-linux-gnu.tar.bz2
sha256 e2e58c10e52395d5d35157e35f85233f713c6f9223a652dfc56194cfd2eed004 renesas-2012.09-61-sh-linux-gnu.src.tar.bz2

Some files were not shown because too many files have changed in this diff Show More