Bump buildroot to version 2017-02
TG-3 #closed
This commit is contained in:
22
bsp/buildroot/support/misc/Vagrantfile
vendored
22
bsp/buildroot/support/misc/Vagrantfile
vendored
@@ -5,14 +5,14 @@
|
||||
################################################################################
|
||||
|
||||
# Buildroot version to use
|
||||
RELEASE='2016.08'
|
||||
RELEASE='2017.02'
|
||||
|
||||
### Change here for more memory/cores ###
|
||||
VM_MEMORY=2048
|
||||
VM_CORES=1
|
||||
|
||||
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|
|
||||
v.vmx['memsize'] = VM_MEMORY
|
||||
@@ -41,16 +41,20 @@ Vagrant.configure('2') do |config|
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.provision 'shell', inline:
|
||||
"sudo dpkg --add-architecture i386
|
||||
sudo apt-get -q update
|
||||
sudo apt-get -q -y install build-essential libncurses5-dev \
|
||||
git bzr cvs mercurial subversion libc6:i386 unzip
|
||||
sudo apt-get -q -y autoremove
|
||||
sudo apt-get -q -y clean"
|
||||
config.vm.provision 'shell', privileged: true, inline:
|
||||
"sed -i 's|deb http://us.archive.ubuntu.com/ubuntu/|deb mirror://mirrors.ubuntu.com/mirrors.txt|g' /etc/apt/sources.list
|
||||
dpkg --add-architecture i386
|
||||
apt-get -q update
|
||||
apt-get purge -q -y snapd lxcfs lxd ubuntu-core-launcher snap-confine
|
||||
apt-get -q -y install build-essential libncurses5-dev \
|
||||
git bzr cvs mercurial subversion libc6:i386 unzip bc
|
||||
apt-get -q -y autoremove
|
||||
apt-get -q -y clean
|
||||
update-locale LC_ALL=C"
|
||||
|
||||
config.vm.provision 'shell', privileged: false, inline:
|
||||
"echo 'Downloading and extracting buildroot #{RELEASE}'
|
||||
wget -q -c http://buildroot.org/downloads/buildroot-#{RELEASE}.tar.gz
|
||||
tar axf buildroot-#{RELEASE}.tar.gz"
|
||||
|
||||
end
|
||||
|
||||
@@ -13,9 +13,35 @@ string(REPLACE "/usr/share/buildroot" "" RELOCATED_HOST_DIR ${CMAKE_CURRENT_LIST
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_PROCESSOR @@CMAKE_SYSTEM_PROCESSOR@@)
|
||||
|
||||
set(CMAKE_C_FLAGS "@@TARGET_CFLAGS@@ ${CMAKE_C_FLAGS}" CACHE STRING "Buildroot CFLAGS")
|
||||
set(CMAKE_CXX_FLAGS "@@TARGET_CXXFLAGS@@ ${CMAKE_CXX_FLAGS}" CACHE STRING "Buildroot CXXFLAGS")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "@@TARGET_LDFLAGS@@ ${CMAKE_EXE_LINKER_FLAGS}" CACHE STRING "Buildroot LDFLAGS")
|
||||
# Set the {C,CXX}FLAGS appended by CMake depending on the build type
|
||||
# defined by Buildroot. CMake defaults these variables with -g and/or
|
||||
# -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_PROGRAM_PATH "${RELOCATED_HOST_DIR}/usr/bin")
|
||||
@@ -31,6 +57,8 @@ set(ENV{PKG_CONFIG_SYSROOT_DIR} "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
|
||||
set(CMAKE_C_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CC@@")
|
||||
set(CMAKE_CXX_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CXX@@")
|
||||
if(@@TOOLCHAIN_HAS_FORTRAN@@)
|
||||
set(CMAKE_Fortran_FLAGS "@@TARGET_FCFLAGS@@ ${CMAKE_Fortran_FLAGS}" CACHE STRING "Buildroot FCFLAGS")
|
||||
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
bsp/buildroot/support/misc/utils.mk
Normal file
115
bsp/buildroot/support/misc/utils.mk
Normal 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
|
||||
Reference in New Issue
Block a user