2007-08-22 05:47:22 -06:00
|
|
|
ifndef MAKE
|
2014-07-25 10:38:37 -06:00
|
|
|
MAKE := make
|
2007-01-30 10:33:53 -07:00
|
|
|
endif
|
2007-07-17 06:09:07 -06:00
|
|
|
ifndef HOSTMAKE
|
2014-07-25 10:38:37 -06:00
|
|
|
HOSTMAKE = $(MAKE)
|
2007-07-17 06:09:07 -06:00
|
|
|
endif
|
2014-07-25 10:38:37 -06:00
|
|
|
HOSTMAKE := $(shell which $(HOSTMAKE) || type -p $(HOSTMAKE) || echo make)
|
2007-07-17 06:09:07 -06:00
|
|
|
|
2015-04-07 18:53:36 -06:00
|
|
|
# If BR2_JLEVEL is 0, scale the maximum concurrency with the number of
|
package-infra: limit the number of // jobs
The current code spawns as many jobs as up to twice the number of CPUs.
On small-class machines like laptops, with a limitted amount of memory,
but still a few CPUs (real or hyperthreads), the HDD becomes a bottleneck,
and it becomes almost impossible to do anythiong else while there is a
build in progress.
Limit the number of jobs to the number of CPUs plus one.
Even on fast machines with fast HDDs, this settings keeps the machine
fully busy (for those packages that can build in parallel, of course).
For example, building qemu or the linux kernel kept my hyperthreaded
hexa Core i7 with 18GiB of RAM, busy at 99% (I never ever managed to
get 100% even with more jobs, not even 200); while on my hyperthreaded
dual Core i5 with only 4GiB and a slow HDD, I still topped at 100% CPU,
while still able to do some work involving the HDD.
If the number of processors is not available, assume one.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Nathan Lynch <ntl@pobox.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-05-09 21:56:01 -06:00
|
|
|
# CPUs. An additional job is used in order to keep processors busy
|
2012-06-16 03:37:17 -06:00
|
|
|
# while waiting on I/O.
|
package-infra: limit the number of // jobs
The current code spawns as many jobs as up to twice the number of CPUs.
On small-class machines like laptops, with a limitted amount of memory,
but still a few CPUs (real or hyperthreads), the HDD becomes a bottleneck,
and it becomes almost impossible to do anythiong else while there is a
build in progress.
Limit the number of jobs to the number of CPUs plus one.
Even on fast machines with fast HDDs, this settings keeps the machine
fully busy (for those packages that can build in parallel, of course).
For example, building qemu or the linux kernel kept my hyperthreaded
hexa Core i7 with 18GiB of RAM, busy at 99% (I never ever managed to
get 100% even with more jobs, not even 200); while on my hyperthreaded
dual Core i5 with only 4GiB and a slow HDD, I still topped at 100% CPU,
while still able to do some work involving the HDD.
If the number of processors is not available, assume one.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Nathan Lynch <ntl@pobox.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-05-09 21:56:01 -06:00
|
|
|
# If the number of processors is not available, assume one.
|
2012-06-16 03:37:17 -06:00
|
|
|
ifeq ($(BR2_JLEVEL),0)
|
2014-07-25 10:38:37 -06:00
|
|
|
PARALLEL_JOBS := $(shell echo \
|
package-infra: limit the number of // jobs
The current code spawns as many jobs as up to twice the number of CPUs.
On small-class machines like laptops, with a limitted amount of memory,
but still a few CPUs (real or hyperthreads), the HDD becomes a bottleneck,
and it becomes almost impossible to do anythiong else while there is a
build in progress.
Limit the number of jobs to the number of CPUs plus one.
Even on fast machines with fast HDDs, this settings keeps the machine
fully busy (for those packages that can build in parallel, of course).
For example, building qemu or the linux kernel kept my hyperthreaded
hexa Core i7 with 18GiB of RAM, busy at 99% (I never ever managed to
get 100% even with more jobs, not even 200); while on my hyperthreaded
dual Core i5 with only 4GiB and a slow HDD, I still topped at 100% CPU,
while still able to do some work involving the HDD.
If the number of processors is not available, assume one.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Nathan Lynch <ntl@pobox.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-05-09 21:56:01 -06:00
|
|
|
$$((1 + `getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1`)))
|
2012-06-16 03:37:17 -06:00
|
|
|
else
|
2014-07-25 10:38:37 -06:00
|
|
|
PARALLEL_JOBS := $(BR2_JLEVEL)
|
2012-06-16 03:37:17 -06:00
|
|
|
endif
|
2012-06-11 10:09:37 -06:00
|
|
|
|
2014-07-25 10:38:37 -06:00
|
|
|
MAKE1 := $(HOSTMAKE) -j1
|
2015-07-01 02:10:46 -06:00
|
|
|
override MAKE = $(HOSTMAKE) \
|
|
|
|
$(if $(findstring j,$(filter-out --%,$(MAKEFLAGS))),,-j$(PARALLEL_JOBS))
|
2008-07-01 07:30:26 -06:00
|
|
|
|
2014-04-01 00:25:47 -06:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
|
|
|
|
TARGET_VENDOR = $(call qstrip,$(BR2_TOOLCHAIN_BUILDROOT_VENDOR))
|
|
|
|
else
|
|
|
|
TARGET_VENDOR = buildroot
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Sanity checks
|
|
|
|
ifeq ($(TARGET_VENDOR),)
|
|
|
|
$(error BR2_TOOLCHAIN_BUILDROOT_VENDOR is not allowed to be empty)
|
|
|
|
endif
|
|
|
|
ifeq ($(TARGET_VENDOR),unknown)
|
|
|
|
$(error BR2_TOOLCHAIN_BUILDROOT_VENDOR cannot be 'unknown'. \
|
2014-10-25 12:29:31 -06:00
|
|
|
It might be confused with the native toolchain)
|
2014-04-01 00:25:47 -06:00
|
|
|
endif
|
|
|
|
|
2012-06-07 19:52:16 -06:00
|
|
|
# Compute GNU_TARGET_NAME
|
2014-07-25 10:38:37 -06:00
|
|
|
GNU_TARGET_NAME = $(ARCH)-$(TARGET_VENDOR)-$(TARGET_OS)-$(LIBC)$(ABI)
|
2013-07-20 06:52:14 -06:00
|
|
|
|
2013-09-23 03:16:50 -06:00
|
|
|
# FLAT binary format needs uclinux
|
|
|
|
ifeq ($(BR2_BINFMT_FLAT),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
TARGET_OS = uclinux
|
2013-07-20 06:52:14 -06:00
|
|
|
else
|
2014-07-25 10:38:37 -06:00
|
|
|
TARGET_OS = linux
|
2013-07-20 06:52:14 -06:00
|
|
|
endif
|
2010-12-28 12:10:27 -07:00
|
|
|
|
2013-06-30 13:29:09 -06:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
LIBC = uclibc
|
2014-05-05 15:17:06 -06:00
|
|
|
else ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
LIBC = musl
|
2010-12-28 12:10:27 -07:00
|
|
|
else
|
2014-07-25 10:38:37 -06:00
|
|
|
LIBC = gnu
|
2010-12-28 12:10:27 -07:00
|
|
|
endif
|
|
|
|
|
|
|
|
# The ABI suffix is a bit special on ARM, as it needs to be
|
2013-07-13 16:27:31 -06:00
|
|
|
# -uclibcgnueabi for uClibc EABI, and -gnueabi for glibc EABI.
|
|
|
|
# This means that the LIBC and ABI aren't strictly orthogonal,
|
|
|
|
# which explains why we need the test on LIBC below.
|
|
|
|
ifeq ($(BR2_arm)$(BR2_armeb),y)
|
2010-12-28 12:10:27 -07:00
|
|
|
ifeq ($(LIBC),uclibc)
|
2014-07-25 10:38:37 -06:00
|
|
|
ABI = gnueabi
|
2010-12-28 12:10:27 -07:00
|
|
|
else
|
2014-07-25 10:38:37 -06:00
|
|
|
ABI = eabi
|
2010-12-28 12:10:27 -07:00
|
|
|
endif
|
2013-08-23 12:40:16 -06:00
|
|
|
|
|
|
|
ifeq ($(BR2_ARM_EABIHF),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
ABI := $(ABI)hf
|
arch: improve ARM floating point support and add support for EABIhf
This commit introduces the support for the EABIhf ABI, next to the
existing support we have for EABI and OABI (even though OABI support
is deprecated). EABIhf allows to improve performance of floating point
workload by using floating point registers to transfer floating point
arguments when calling functions, instead of using integer registers
to do, as is done in the 'softfp' floating point model of EABI.
In addition to this, this commit introduces a list of options for the
floating point support:
* Software floating point
* VFP
* VFPv3
* VFPv3-D16
* VFPv4
* VFPv4-D16
and it introduces some logic to make sure the options are only visible
when it makes sense, depending on the ARM core being selected. This is
however made complicated by the fact that certain VFP capabilities are
mandatory on some cores, but optional on some other cores. The kconfig
logic tries to achieve the following goals:
* Hide options that are definitely not possible.
* Use safe default values (i.e for Cortex-A5 and A7, the presence of
the VFPv4 unit is optional, so we default on software floating
point on these cores)..
* Show the available possibilities, even if some of them are not
necessarily working on a particular core (again, for the Cortex-A5
and A7 cores, there is no way of knowing whether the particular
variant used by the user has VFPv4 or not, so we select software
floating point by default, but still show VFP/VFPv3/VFPv4 options).
It is worth noting that this commit doesn't add support for all
possible -mfpu= values on ARM. We haven't added support for fpa, fpe2,
fpe3, maverick (those four are only used on very old ARM cores), for
vfpv3-fp16, vfpv3-d16-fp16, vfpv3xd, vfpv3xd-fp16, neon-fp16,
vfpv4-sp-d16. They can be added quite easily if needed thanks to the
new organization of the Config.in options.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-07-16 02:03:14 -06:00
|
|
|
endif
|
2010-12-28 12:10:27 -07:00
|
|
|
endif
|
|
|
|
|
2012-01-05 12:31:43 -07:00
|
|
|
# For FSL PowerPC there's SPE
|
|
|
|
ifeq ($(BR2_powerpc_SPE),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
ABI = spe
|
2012-01-05 12:31:43 -07:00
|
|
|
# MPC8540s are e500v1 with single precision FP
|
|
|
|
ifeq ($(BR2_powerpc_8540),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
TARGET_ABI += -mabi=spe -mfloat-gprs=single -Wa,-me500
|
2012-01-05 12:31:43 -07:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_powerpc_8548),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
TARGET_ABI += -mabi=spe -mfloat-gprs=double -Wa,-me500x2
|
2012-01-05 12:31:43 -07:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_powerpc_e500mc),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
TARGET_ABI += -mabi=spe -mfloat-gprs=double -Wa,-me500mc
|
2012-01-05 12:31:43 -07:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2012-12-05 12:36:36 -07:00
|
|
|
# Use longcalls option for Xtensa globally.
|
|
|
|
# The 'longcalls' option allows calls across a greater range of addresses,
|
|
|
|
# and is required for some packages. While this option can degrade both
|
|
|
|
# code size and performance, the linker can usually optimize away the
|
|
|
|
# overhead when a call ends up within a certain range.
|
2014-03-30 11:57:46 -06:00
|
|
|
#
|
2015-08-12 16:20:02 -06:00
|
|
|
# Use auto-litpools for Xtensa globally.
|
2014-03-30 11:57:46 -06:00
|
|
|
# Collecting literals into separate section can be advantageous if that
|
|
|
|
# section is placed into DTCM at link time. This is applicable for code
|
|
|
|
# running on bare metal, but makes no sense under linux, where userspace
|
|
|
|
# is isolated from the physical memory details. OTOH placing literals into
|
|
|
|
# separate section breaks build of huge source files, because l32r
|
|
|
|
# instruction can only access literals in 256 KBytes range.
|
|
|
|
#
|
2012-12-05 12:36:36 -07:00
|
|
|
ifeq ($(BR2_xtensa),y)
|
2015-08-12 16:20:02 -06:00
|
|
|
TARGET_ABI += -mlongcalls -mauto-litpools
|
2012-12-05 12:36:36 -07:00
|
|
|
endif
|
|
|
|
|
2014-07-31 07:24:42 -06:00
|
|
|
ifeq ($(BR2_arc)$(BR2_ARC_ATOMIC_EXT),yy)
|
|
|
|
TARGET_ABI += -matomic
|
|
|
|
endif
|
|
|
|
|
2012-07-14 19:12:05 -06:00
|
|
|
STAGING_SUBDIR = usr/$(GNU_TARGET_NAME)/sysroot
|
|
|
|
STAGING_DIR = $(HOST_DIR)/$(STAGING_SUBDIR)
|
2010-12-28 12:10:27 -07:00
|
|
|
|
2008-03-12 07:07:10 -06:00
|
|
|
ifeq ($(BR2_OPTIMIZE_0),y)
|
2015-10-14 16:19:10 -06:00
|
|
|
TARGET_OPTIMIZATION = -O0
|
2008-03-12 07:07:10 -06:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_OPTIMIZE_1),y)
|
2015-10-14 16:19:10 -06:00
|
|
|
TARGET_OPTIMIZATION = -O1
|
2008-03-12 07:07:10 -06:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_OPTIMIZE_2),y)
|
2015-10-14 16:19:10 -06:00
|
|
|
TARGET_OPTIMIZATION = -O2
|
2008-03-12 07:07:10 -06:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_OPTIMIZE_3),y)
|
2015-10-14 16:19:10 -06:00
|
|
|
TARGET_OPTIMIZATION = -O3
|
2008-03-12 07:07:10 -06:00
|
|
|
endif
|
2016-05-18 15:17:55 -06:00
|
|
|
ifeq ($(BR2_OPTIMIZE_G),y)
|
|
|
|
TARGET_OPTIMIZATION = -Og
|
|
|
|
endif
|
2008-03-12 07:07:10 -06:00
|
|
|
ifeq ($(BR2_OPTIMIZE_S),y)
|
2015-10-14 16:19:10 -06:00
|
|
|
TARGET_OPTIMIZATION = -Os
|
2008-03-12 07:07:10 -06:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_DEBUG_1),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
TARGET_DEBUGGING = -g1
|
2008-03-12 07:07:10 -06:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_DEBUG_2),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
TARGET_DEBUGGING = -g2
|
2008-03-12 07:07:10 -06:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_DEBUG_3),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
TARGET_DEBUGGING = -g3
|
2008-03-12 07:07:10 -06:00
|
|
|
endif
|
|
|
|
|
2012-07-25 11:40:46 -06:00
|
|
|
TARGET_CPPFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
|
|
|
TARGET_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING)
|
2012-10-11 01:01:10 -06:00
|
|
|
TARGET_CXXFLAGS = $(TARGET_CFLAGS)
|
2016-07-01 10:29:08 -06:00
|
|
|
TARGET_FCFLAGS = $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING)
|
2012-10-11 01:01:10 -06:00
|
|
|
TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))
|
2007-06-20 05:26:36 -06:00
|
|
|
|
2013-05-02 18:39:38 -06:00
|
|
|
ifeq ($(BR2_BINFMT_FLAT),y)
|
2013-09-11 06:53:44 -06:00
|
|
|
TARGET_CFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\
|
|
|
|
-Wl$(comma)-elf2flt)
|
|
|
|
TARGET_CXXFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\
|
|
|
|
-Wl$(comma)-elf2flt)
|
2016-07-01 10:29:08 -06:00
|
|
|
TARGET_FCFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\
|
|
|
|
-Wl$(comma)-elf2flt)
|
package/Makefile.in: adjust LDFLAGS for elf2flt
So far, our LDFLAGS for the BR2_BINFMT_FLAT case were only used on
Blackfin. However, passing -elf2flt in LDFLAGS is wrong. Indeed,
LDFLAGS are not linker flags, but flags passed to the compiler when
linking.
If you pass -elf2flt to the compiler when linking, it is understood as
"-e lf2flt", i.e "the entry point is named lf2flt", which isn't
exactly the intention. We in fact need to pass -Wl,-elf2flt in LDFLAGS
as well, so that the compiler passes -elf2flt down to the linker.
For some reason, this option does not cause an issue with the Blackfin
toolchain, but it does with either a Buildroot toolchain for Cortex-M
or an OSELAS toolchain for Cortex-M. We have verified that passing
-Wl,-elf2flt continues to work with the Blackfin toolchain.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-03-31 13:00:11 -06:00
|
|
|
TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt)
|
2013-05-02 18:39:38 -06:00
|
|
|
endif
|
|
|
|
|
2013-05-03 04:39:37 -06:00
|
|
|
ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
|
|
|
|
TARGET_LDFLAGS += -mid-shared-library -mshared-library-id=0
|
|
|
|
TARGET_CFLAGS += -mid-shared-library -mshared-library-id=0
|
2016-07-01 10:29:08 -06:00
|
|
|
TARGET_FCFLAGS += -mid-shared-library -mshared-library-id=0
|
2013-05-03 04:39:37 -06:00
|
|
|
TARGET_CXXFLAGS += -mid-shared-library -mshared-library-id=0
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_BINFMT_FLAT_SEP_DATA),y)
|
|
|
|
TARGET_LDFLAGS += -msep-data
|
|
|
|
TARGET_CFLAGS += -msep-data
|
2016-07-01 10:29:08 -06:00
|
|
|
TARGET_FCFLAGS += -msep-data
|
2013-05-03 04:39:37 -06:00
|
|
|
TARGET_CXXFLAGS += -msep-data
|
|
|
|
endif
|
|
|
|
|
2015-12-27 04:07:31 -07:00
|
|
|
ifeq ($(BR2_SSP_REGULAR),y)
|
|
|
|
TARGET_CFLAGS += -fstack-protector
|
|
|
|
TARGET_CXXFLAGS += -fstack-protector
|
2016-07-01 10:29:08 -06:00
|
|
|
TARGET_FCFLAGS += -fstack-protector
|
2015-12-27 04:07:31 -07:00
|
|
|
else ifeq ($(BR2_SSP_STRONG),y)
|
|
|
|
TARGET_CFLAGS += -fstack-protector-strong
|
|
|
|
TARGET_CXXFLAGS += -fstack-protector-strong
|
2016-07-01 10:29:08 -06:00
|
|
|
TARGET_FCFLAGS += -fstack-protector-strong
|
2015-12-27 04:07:31 -07:00
|
|
|
else ifeq ($(BR2_SSP_ALL),y)
|
2013-07-04 12:30:26 -06:00
|
|
|
TARGET_CFLAGS += -fstack-protector-all
|
|
|
|
TARGET_CXXFLAGS += -fstack-protector-all
|
2016-07-01 10:29:08 -06:00
|
|
|
TARGET_FCFLAGS += -fstack-protector-all
|
2013-07-04 12:30:26 -06:00
|
|
|
endif
|
|
|
|
|
2013-10-06 08:19:11 -06:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
TARGET_CROSS = $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-
|
2010-10-15 15:01:08 -06:00
|
|
|
else
|
2016-11-06 18:19:56 -07:00
|
|
|
TARGET_CROSS = $(HOST_DIR)/usr/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-
|
2007-02-06 11:19:38 -07:00
|
|
|
endif
|
2010-06-25 07:04:08 -06:00
|
|
|
|
2013-09-02 10:06:27 -06:00
|
|
|
# Define TARGET_xx variables for all common binutils/gcc
|
2010-06-25 07:04:08 -06:00
|
|
|
TARGET_AR = $(TARGET_CROSS)ar
|
|
|
|
TARGET_AS = $(TARGET_CROSS)as
|
2011-05-02 15:58:20 -06:00
|
|
|
TARGET_CC = $(TARGET_CROSS)gcc
|
|
|
|
TARGET_CPP = $(TARGET_CROSS)cpp
|
|
|
|
TARGET_CXX = $(TARGET_CROSS)g++
|
|
|
|
TARGET_FC = $(TARGET_CROSS)gfortran
|
|
|
|
TARGET_LD = $(TARGET_CROSS)ld
|
2010-06-25 07:04:08 -06:00
|
|
|
TARGET_NM = $(TARGET_CROSS)nm
|
|
|
|
TARGET_RANLIB = $(TARGET_CROSS)ranlib
|
2012-11-06 22:01:20 -07:00
|
|
|
TARGET_READELF = $(TARGET_CROSS)readelf
|
2010-06-25 07:04:08 -06:00
|
|
|
TARGET_OBJCOPY = $(TARGET_CROSS)objcopy
|
|
|
|
TARGET_OBJDUMP = $(TARGET_CROSS)objdump
|
|
|
|
|
2007-07-31 12:06:50 -06:00
|
|
|
ifeq ($(BR2_STRIP_strip),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
STRIP_STRIP_DEBUG := --strip-debug
|
|
|
|
TARGET_STRIP = $(TARGET_CROSS)strip
|
|
|
|
STRIPCMD = $(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note
|
2017-07-01 06:51:20 -06:00
|
|
|
else
|
2017-07-01 01:42:05 -06:00
|
|
|
TARGET_STRIP = /bin/true
|
2014-07-25 10:38:37 -06:00
|
|
|
STRIPCMD = $(TARGET_STRIP)
|
2007-07-31 12:06:50 -06:00
|
|
|
endif
|
2014-07-25 10:38:37 -06:00
|
|
|
INSTALL := $(shell which install || type -p install)
|
|
|
|
FLEX := $(shell which flex || type -p flex)
|
|
|
|
BISON := $(shell which bison || type -p bison)
|
2014-10-29 03:18:41 -06:00
|
|
|
UNZIP := $(shell which unzip || type -p unzip) -q
|
2004-10-08 19:06:03 -06:00
|
|
|
|
core infra: make sure apply-patches is called with correct tar
Buildroot has a mechanism to detect a too-old or missing tar program on the
host machine, and builds a custom host-tar if needed. An example situation
is a RHEL5 host machine, where tar is knowingly too old.
The apply-patches script also employs tar, in case the patches come as an
archive. However, tar is called as 'tar' without any absolute path, and the
environment does not point in any way to the possibly custom tar. As a
result, the too-old-tar is called. A particular problem is the flag '-a'
which is missing on e.g. RHEL5.
Previously, this problem went unnoticed: tar would fail, but apply-patches
did not notice it, and the overall return code of the script was 'success'.
However, commit d5ae67b4 added 'set -e' to the script, causing any error to
halt execution of the script with an error.
Fix the problem by adding the Buildroot-built host tools to the PATH when
calling apply-patches.
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-01 04:27:08 -07:00
|
|
|
APPLY_PATCHES = PATH=$(HOST_DIR)/usr/bin:$$PATH support/scripts/apply-patches.sh $(if $(QUIET),-s)
|
2014-10-22 10:20:10 -06:00
|
|
|
|
2016-07-30 10:10:18 -06:00
|
|
|
HOST_CPPFLAGS = -I$(HOST_DIR)/usr/include
|
2010-10-29 13:00:26 -06:00
|
|
|
HOST_CFLAGS ?= -O2
|
2012-07-25 11:40:46 -06:00
|
|
|
HOST_CFLAGS += $(HOST_CPPFLAGS)
|
|
|
|
HOST_CXXFLAGS += $(HOST_CFLAGS)
|
Solve the host tools relying on host libraries problem
We build host tools installed in $(HOST_DIR)/usr/bin, and some of them
rely on host libraries in $(HOST_DIR)/usr/lib. So when these host
tools are executed, they need to find the host libraries, which are
not installed in a default location.
In c1b6242fdcf2cff7ebf09fec4cc1be58963e8427 we tried to use
LD_LIBRARY_PATH when building target packages to solve this
problem. Unfortunately, LD_LIBRARY_PATH is not only used to find
libraries at run-time, but also at compile time. So it leads the build
of some packages, such as icu, to fail.
Therefore, in 0d1830b07db4ebfd14e77a258de6fb391e57e960, we reverted
the LD_LIBRARY_PATH idea.
The other option to solve this problem was to hardcode a RPATH value
in the host binaries that would reference the location of host
libraries. We added this -Wl,-rpath option to HOST_CFLAGS in
6b939d40f6a29a43277566adc9d4312d49cb3abf. Unfortunately, this caused
problems when building binutils, as reported in bug 1789 so this
change was reverted in e1a7d916e9eeaa215551740de40c055130d6c073.
Then, we tried to use -Wl,-rpath in HOST_LDFLAGS, but it was causing
problems with fakeroot not recognizing 'ld' as the GNU linker, since
the -Wl,-rpath cannot be understood by 'ld' directly, only by 'gcc'.
This commit is a new attempt at using HOST_LDFLAGS, but in this case
we modified the definition of HOST_LD to *not* contain
HOST_LDFLAGS. LDFLAGS are being set separatly. It solved the fakeroot
issue and was tested against nearly 300 packages of Buildroot.
For more details on this story, see
http://lists.busybox.net/pipermail/buildroot/2010-June/035580.html
http://lists.busybox.net/pipermail/buildroot/2010-June/035581.html
http://lists.busybox.net/pipermail/buildroot/2010-June/035586.html
http://lists.busybox.net/pipermail/buildroot/2010-June/035609.html
https://bugs.busybox.net/show_bug.cgi?id=1789
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-06-25 06:15:20 -06:00
|
|
|
HOST_LDFLAGS += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/usr/lib
|
2009-03-16 14:58:08 -06:00
|
|
|
|
2014-10-17 12:48:01 -06:00
|
|
|
# host-intltool should be executed with the system perl, so we save
|
|
|
|
# the path to the system perl, before a host-perl built by Buildroot
|
|
|
|
# might get installed into $(HOST_DIR)/usr/bin and therefore appears
|
|
|
|
# in our PATH. This system perl will be used as INTLTOOL_PERL.
|
|
|
|
export PERL=$(shell which perl)
|
|
|
|
|
|
|
|
# host-intltool needs libxml-parser-perl, which Buildroot installs in
|
|
|
|
# $(HOST_DIR)/usr/lib/perl, so we must make sure that the system perl
|
|
|
|
# finds this perl module by exporting the proper value for PERL5LIB.
|
|
|
|
export PERL5LIB=$(HOST_DIR)/usr/lib/perl
|
|
|
|
|
2016-10-14 08:09:44 -06:00
|
|
|
TARGET_MAKE_ENV = PATH=$(BR_PATH)
|
|
|
|
|
2014-12-30 00:36:23 -07:00
|
|
|
TARGET_CONFIGURE_OPTS = \
|
2016-10-14 08:09:44 -06:00
|
|
|
$(TARGET_MAKE_ENV) \
|
2014-12-30 00:36:23 -07:00
|
|
|
AR="$(TARGET_AR)" \
|
|
|
|
AS="$(TARGET_AS)" \
|
|
|
|
LD="$(TARGET_LD)" \
|
|
|
|
NM="$(TARGET_NM)" \
|
|
|
|
CC="$(TARGET_CC)" \
|
|
|
|
GCC="$(TARGET_CC)" \
|
|
|
|
CPP="$(TARGET_CPP)" \
|
|
|
|
CXX="$(TARGET_CXX)" \
|
|
|
|
FC="$(TARGET_FC)" \
|
2016-07-01 10:29:09 -06:00
|
|
|
F77="$(TARGET_FC)" \
|
2014-12-30 00:36:23 -07:00
|
|
|
RANLIB="$(TARGET_RANLIB)" \
|
|
|
|
READELF="$(TARGET_READELF)" \
|
|
|
|
STRIP="$(TARGET_STRIP)" \
|
|
|
|
OBJCOPY="$(TARGET_OBJCOPY)" \
|
|
|
|
OBJDUMP="$(TARGET_OBJDUMP)" \
|
|
|
|
AR_FOR_BUILD="$(HOSTAR)" \
|
|
|
|
AS_FOR_BUILD="$(HOSTAS)" \
|
|
|
|
CC_FOR_BUILD="$(HOSTCC)" \
|
|
|
|
GCC_FOR_BUILD="$(HOSTCC)" \
|
|
|
|
CXX_FOR_BUILD="$(HOSTCXX)" \
|
|
|
|
LD_FOR_BUILD="$(HOSTLD)" \
|
|
|
|
CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \
|
|
|
|
CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
|
|
|
|
CXXFLAGS_FOR_BUILD="$(HOST_CXXFLAGS)" \
|
|
|
|
LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
|
|
|
|
FCFLAGS_FOR_BUILD="$(HOST_FCFLAGS)" \
|
|
|
|
DEFAULT_ASSEMBLER="$(TARGET_AS)" \
|
|
|
|
DEFAULT_LINKER="$(TARGET_LD)" \
|
|
|
|
CPPFLAGS="$(TARGET_CPPFLAGS)" \
|
|
|
|
CFLAGS="$(TARGET_CFLAGS)" \
|
|
|
|
CXXFLAGS="$(TARGET_CXXFLAGS)" \
|
|
|
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
|
|
|
FCFLAGS="$(TARGET_FCFLAGS)" \
|
2016-07-01 10:29:09 -06:00
|
|
|
FFLAGS="$(TARGET_FCFLAGS)" \
|
2014-12-30 00:36:23 -07:00
|
|
|
PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
|
|
|
|
STAGING_DIR="$(STAGING_DIR)" \
|
|
|
|
INTLTOOL_PERL=$(PERL)
|
2007-06-20 05:26:36 -06:00
|
|
|
|
2014-02-10 05:23:08 -07:00
|
|
|
|
2016-10-14 08:09:44 -06:00
|
|
|
HOST_MAKE_ENV = \
|
|
|
|
PATH=$(BR_PATH) \
|
|
|
|
PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
|
|
|
|
PKG_CONFIG_SYSROOT_DIR="/" \
|
|
|
|
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \
|
|
|
|
PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
|
|
|
|
PKG_CONFIG_LIBDIR="$(HOST_DIR)/usr/lib/pkgconfig:$(HOST_DIR)/usr/share/pkgconfig"
|
2009-12-15 05:39:40 -07:00
|
|
|
|
2014-12-30 00:36:23 -07:00
|
|
|
HOST_CONFIGURE_OPTS = \
|
2016-10-14 08:09:44 -06:00
|
|
|
$(HOST_MAKE_ENV) \
|
2014-12-30 00:36:23 -07:00
|
|
|
AR="$(HOSTAR)" \
|
|
|
|
AS="$(HOSTAS)" \
|
|
|
|
LD="$(HOSTLD)" \
|
|
|
|
NM="$(HOSTNM)" \
|
|
|
|
CC="$(HOSTCC)" \
|
|
|
|
GCC="$(HOSTCC)" \
|
|
|
|
CXX="$(HOSTCXX)" \
|
|
|
|
CPP="$(HOSTCPP)" \
|
|
|
|
OBJCOPY="$(HOSTOBJCOPY)" \
|
|
|
|
RANLIB="$(HOSTRANLIB)" \
|
|
|
|
CPPFLAGS="$(HOST_CPPFLAGS)" \
|
|
|
|
CFLAGS="$(HOST_CFLAGS)" \
|
|
|
|
CXXFLAGS="$(HOST_CXXFLAGS)" \
|
|
|
|
LDFLAGS="$(HOST_LDFLAGS)" \
|
|
|
|
INTLTOOL_PERL=$(PERL)
|
|
|
|
|
2014-03-10 14:51:33 -06:00
|
|
|
# This is extra environment we can not export ourselves (eg. because some
|
2013-11-11 08:03:26 -07:00
|
|
|
# packages use that variable internally, eg. uboot), so we have to
|
|
|
|
# explicitly pass it to user-supplied external hooks (eg. post-build,
|
|
|
|
# post-images)
|
2014-07-25 10:38:37 -06:00
|
|
|
EXTRA_ENV = \
|
2014-04-14 16:31:09 -06:00
|
|
|
PATH=$(BR_PATH) \
|
2014-06-30 16:26:19 -06:00
|
|
|
BR2_DL_DIR=$(BR2_DL_DIR) \
|
core: introduce per br2-external NAME
This unique NAME is used to construct a per br2-external tree variable,
BR2_EXTERNAL_$(NAME)_PATH, which contains the path to the br2-external
tree.
This variable is available both from Kconfig (set in the Kconfig
snippet) and from the .mk files.
Also, display the NAME and its path as a comment in the menuconfig.
This will ultimately allow us to support multiple br2-external trees at
once, with that NAME (and thus BR2_EXTERNAL_$(NAME)) uniquely defining
which br2-external tree is being used.
The obvious outcome is that BR2_EXTERNAL should now no longer be used to
refer to the files in the br2-external tree; that location is now known
from the BR2_EXTERNAL_$(NAME)_PATH variable instead. This means we no
longer need to expose, and must stop from from exposing BR2_EXTERNAL as
a Kconfig variable.
Finally, this also fixes a latent bug in the pkg-generic infra, where we
would so far always refer to BR2_EXTERNAL (even if not set) to filter
the names of packages (to decide whether they are a bootloader, a
toolchain or a simple package).
Note: since the variables in the Makefile and in Kconfig are named the
same, the one we computed early on in the Makefile will be overridden by
the one in .config when we have it. Thus, even though they are set to
the same raw value, the one from .config is quoted and, being included
later in the Makefile, will take precedence, so we just re-include the
generated Makefile fragment a third time before includeing the
br2-external's Makefiles. That's unfortunate, but there is no easy way
around that as we do want the two variables to be named the same in
Makefile and Kconfig (and we can't ask the user to un-quote that variable
himself either), hence this little dirty triple-inclusion trick.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-10-14 08:39:17 -06:00
|
|
|
BUILD_DIR=$(BUILD_DIR)
|
2009-03-17 07:48:15 -06:00
|
|
|
|
2013-06-07 04:13:46 -06:00
|
|
|
################################################################################
|
2007-06-27 03:48:23 -06:00
|
|
|
# settings we need to pass to configure
|
|
|
|
|
|
|
|
# does unaligned access trap?
|
2014-07-25 10:38:37 -06:00
|
|
|
BR2_AC_CV_TRAP_CHECK = ac_cv_lbl_unaligned_fail=yes
|
2007-06-27 03:48:23 -06:00
|
|
|
ifeq ($(BR2_i386),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
BR2_AC_CV_TRAP_CHECK = ac_cv_lbl_unaligned_fail=no
|
2007-06-27 03:48:23 -06:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_x86_64),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
BR2_AC_CV_TRAP_CHECK = ac_cv_lbl_unaligned_fail=no
|
2007-06-27 03:48:23 -06:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_m68k),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
BR2_AC_CV_TRAP_CHECK = ac_cv_lbl_unaligned_fail=no
|
2007-06-27 03:48:23 -06:00
|
|
|
endif
|
2014-05-12 23:28:21 -06:00
|
|
|
ifeq ($(BR2_powerpc)$(BR2_powerpc64)$(BR2_powerpc64le),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
BR2_AC_CV_TRAP_CHECK = ac_cv_lbl_unaligned_fail=no
|
2007-06-27 03:48:23 -06:00
|
|
|
endif
|
|
|
|
|
2007-06-27 06:01:27 -06:00
|
|
|
ifeq ($(BR2_ENDIAN),"BIG")
|
2014-07-25 10:38:37 -06:00
|
|
|
BR2_AC_CV_C_BIGENDIAN = ac_cv_c_bigendian=yes
|
2007-06-27 06:01:27 -06:00
|
|
|
else
|
2014-07-25 10:38:37 -06:00
|
|
|
BR2_AC_CV_C_BIGENDIAN = ac_cv_c_bigendian=no
|
2007-06-27 06:01:27 -06:00
|
|
|
endif
|
|
|
|
|
2016-02-01 09:02:06 -07:00
|
|
|
# AM_GNU_GETTEXT misdetects musl gettext support.
|
|
|
|
# musl currently implements api level 1 and 2 (basic + ngettext)
|
|
|
|
# http://www.openwall.com/lists/musl/2015/04/16/3
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
|
|
|
|
BR2_GT_CV_FUNC_GNUGETTEXT_LIBC = \
|
2016-02-01 09:19:36 -07:00
|
|
|
gt_cv_func_gnugettext1_libc=yes \
|
2016-02-01 09:02:06 -07:00
|
|
|
gt_cv_func_gnugettext2_libc=yes
|
|
|
|
endif
|
|
|
|
|
2014-07-25 10:38:37 -06:00
|
|
|
TARGET_CONFIGURE_ARGS = \
|
2007-06-27 03:48:23 -06:00
|
|
|
$(BR2_AC_CV_TRAP_CHECK) \
|
2007-06-27 06:01:27 -06:00
|
|
|
ac_cv_func_mmap_fixed_mapped=yes \
|
|
|
|
ac_cv_func_memcmp_working=yes \
|
2008-11-28 07:20:47 -07:00
|
|
|
ac_cv_have_decl_malloc=yes \
|
|
|
|
gl_cv_func_malloc_0_nonnull=yes \
|
|
|
|
ac_cv_func_malloc_0_nonnull=yes \
|
|
|
|
ac_cv_func_calloc_0_nonnull=yes \
|
|
|
|
ac_cv_func_realloc_0_nonnull=yes \
|
2011-05-03 07:23:40 -06:00
|
|
|
lt_cv_sys_lib_search_path_spec="" \
|
2016-02-01 09:02:06 -07:00
|
|
|
$(BR2_AC_CV_C_BIGENDIAN) \
|
|
|
|
$(BR2_GT_CV_FUNC_GNUGETTEXT_LIBC)
|
2004-10-08 19:06:03 -06:00
|
|
|
|
2013-06-07 04:13:46 -06:00
|
|
|
################################################################################
|
2007-06-27 03:48:23 -06:00
|
|
|
|
2006-10-17 10:57:02 -06:00
|
|
|
ifeq ($(BR2_ENABLE_LOCALE),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
DISABLE_NLS :=
|
2004-10-08 19:06:03 -06:00
|
|
|
else
|
2014-07-25 10:38:37 -06:00
|
|
|
DISABLE_NLS :=--disable-nls
|
2004-10-08 19:06:03 -06:00
|
|
|
endif
|
|
|
|
|
2010-12-13 09:27:41 -07:00
|
|
|
ifneq ($(BR2_INSTALL_LIBSTDCPP),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
TARGET_CONFIGURE_OPTS += CXX=false
|
2006-12-21 06:51:53 -07:00
|
|
|
endif
|
2004-10-08 19:06:03 -06:00
|
|
|
|
2014-12-03 14:41:29 -07:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
SHARED_STATIC_LIBS_OPTS = --enable-static --disable-shared
|
2014-05-25 16:13:00 -06:00
|
|
|
TARGET_CFLAGS += -static
|
|
|
|
TARGET_CXXFLAGS += -static
|
2016-07-01 10:29:08 -06:00
|
|
|
TARGET_FCFLAGS += -static
|
2014-05-25 16:12:59 -06:00
|
|
|
TARGET_LDFLAGS += -static
|
Turn the static lib option into a choice with more options
This commit turns the single static option into a choice, which offers
various possibilities:
1. Build and use static libraries only;
2. Build both shared and static libraries, but use shared libraries;
3. Build and use shared libraries only.
On most platforms, (2) is currently the default, and kept as the
default in this commit. Of course, on certain platforms (Blackfin,
m68k), only option (1) will be available.
In addition to the introduction of the Config.in options, this commit
also:
* Removes the 'select BR2_STATIC_LIBS' from 'BR2_BINFMT_FLAT', since
with the use of a choice, we are guaranteed that BR2_STATIC_LIBS
will be selected when the binary format is BR2_BINFMT_FLAT, since
BR2_STATIC_LIBS will be the only possible solution in the choice.
* Changes package/Makefile.in to use the proper
--{enable,disable}-{shared,static} options for autotools packages.
[Thomas: remove useless empty newline right after 'choice'. Noticed by
Yann E. Morin.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2014-12-11 15:50:09 -07:00
|
|
|
else ifeq ($(BR2_SHARED_LIBS),y)
|
|
|
|
SHARED_STATIC_LIBS_OPTS = --disable-static --enable-shared
|
|
|
|
else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
|
2014-07-25 10:38:37 -06:00
|
|
|
SHARED_STATIC_LIBS_OPTS = --enable-static --enable-shared
|
package/autotools: add --{enable,disable}-{shared,static} automatically
For target packages, depending on BR2_PREFER_STATIC_LIB, add the
correct combination of --{enable,disable}-{shared,static} flags to
./configure calls.
* When BR2_PREFER_STATIC_LIB is enabled, we pass --enable-static
--disable-shared.
* When BR2_PREFER_STATIC_LIB is disabled, we pass --enable-static
--enable-shared. We enable static libraries since they can still be
useful to statically link applications against some libraries
(sometimes it is useful for size reasons). Static libraries are
anyway only installed in the STAGING_DIR, so it doesn't increase in
any way the size of the TARGET_DIR.
For host packages, always pass --enable-shared and --disable-static.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-05-30 15:57:02 -06:00
|
|
|
endif
|
|
|
|
|
2014-12-10 15:53:57 -07:00
|
|
|
ifeq ($(BR2_COMPILER_PARANOID_UNSAFE_PATH),y)
|
|
|
|
export BR_COMPILER_PARANOID_UNSAFE_PATH=enabled
|
|
|
|
endif
|
|
|
|
|
2012-04-17 08:45:19 -06:00
|
|
|
include package/pkg-download.mk
|
2012-07-05 16:06:46 -06:00
|
|
|
include package/pkg-autotools.mk
|
|
|
|
include package/pkg-cmake.mk
|
2014-01-11 08:42:07 -07:00
|
|
|
include package/pkg-luarocks.mk
|
2014-02-23 07:17:16 -07:00
|
|
|
include package/pkg-perl.mk
|
2013-12-11 13:26:36 -07:00
|
|
|
include package/pkg-python.mk
|
2014-04-05 09:21:45 -06:00
|
|
|
include package/pkg-virtual.mk
|
2012-07-05 16:06:46 -06:00
|
|
|
include package/pkg-generic.mk
|
infra: introduce a kconfig-package infrastructure
There are several packages that have a configuration file managed by
kconfig: uclibc, busybox, linux and barebox. All these packages need some
make targets to handle the kconfig specificities: creating a configuration
(menuconfig, ...) and saving it back (update-config, ...)
These targets should be the same for each of these packages, but
unfortunately they are not. Especially with respect to saving back the
configuration to the original config file, there are many differences.
A previous set of patches fixed these targets for the uclibc package.
This patch extracts these targets into a common kconfig-package
infrastructure, with the goals of:
- aligning the behavior of all kconfig-based packages
- removing code duplication
In order to use this infrastructure, a package should at a minimum specify
FOO_KCONFIG_FILE and eval the kconfig-package macro. The supported
configuration editors can be set with FOO_KCONFIG_EDITORS and defaults to
menuconfig only.
Additionally, a package can specify FOO_KCONFIG_OPT for extra options to
pass to the invocation of the kconfig editors, and FOO_KCONFIG_FIXUP_CMDS
for a list of shell commands used to fixup the .config file after a
configuration has been created/edited.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
[yann.morin.1998@free.fr: add missing 4th argument when calling to
inner-kconfig-package (namely, 'target']
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-03 09:32:40 -06:00
|
|
|
include package/pkg-kconfig.mk
|
2015-01-12 02:32:06 -07:00
|
|
|
include package/pkg-rebar.mk
|
package-infra: add helper to build kernel modules
The Linux kernel offers a nice and easy-to-use infra to build
out-of-tree kernel modules.
Currently, we have quite a few packages that build kernel modules, and
most duplicate (or rewrite) the same code over-and-over again.
Introduce a new infrastructure that provides helpers to build kernel
modules, so packages do not have to duplicate/rewrite that.
The infrastructure, unlike any other package infra, is not standalone.
It needs another package infra to be used. This is so that packages that
provide both userland and kernel modules can be built easily. So, this
infra only defines post-build and post-install hooks, that will build
the kernel modules after the rest of the package.
We need to override PWD, because some packages will use it to find their
own includes (and other helper files). PWD is inherited from the
environment, so it gets whatever value it had when make was launched,
which happens to be Buildroot's own top source tree. So, we just force
PWD to the proper value, rather than cd-ing first.
Also, no host version is provided, since it does not make sense to build
kernel modules for the host.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-11 18:21:31 -06:00
|
|
|
include package/pkg-kernel-module.mk
|
2016-10-30 10:02:13 -06:00
|
|
|
include package/pkg-waf.mk
|