From 4f79cf391e902de140dba3ea70cd98869f9cf8d4 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Fri, 9 Jan 2015 18:09:52 -0600 Subject: [PATCH 01/20] First attempt at ARM cross compile targeting Raspberry Pi --- .travis.yml | 7 ++++--- osx/ArmLinux.sh | 14 ++++++++++++++ osx/ArmLinux_setup.sh | 12 ++++++++++++ osx/ArmLinux_setup_stage2.sh | 16 ++++++++++++++++ 4 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 osx/ArmLinux.sh create mode 100644 osx/ArmLinux_setup.sh create mode 100755 osx/ArmLinux_setup_stage2.sh diff --git a/.travis.yml b/.travis.yml index beefb791..85268248 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,8 @@ install: before_script: - if test "${COMMIT_MESSAGE#*'[publish]'}" != "$COMMIT_MESSAGE"; then echo "publishing" && export PUBLISH=true; else echo "not publishing"; fi; - + - if test "${MASON_PLATFORM}" == "ArmLinux"; then source osx/ArmLinux_setup.sh; fi; + script: - - source ./build.sh - - ${TARGET} + - $COMPILE_ENV source ./build.sh + - $COMPILE_ENV ${TARGET} diff --git a/osx/ArmLinux.sh b/osx/ArmLinux.sh new file mode 100644 index 00000000..0d5666ca --- /dev/null +++ b/osx/ArmLinux.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -u + +export MASON_PLATFORM="ArmLinux" +export HOST_PLATFORM="Linux" +export BOOST_ARCH="arm" +export ARCH_NAME="armv7" +source $(dirname "$BASH_SOURCE")/settings.sh +export MAKE="make" +# default to C++11 for this platform +if [[ "${CXX11:-false}" == false ]]; then + export CXX11=true +fi diff --git a/osx/ArmLinux_setup.sh b/osx/ArmLinux_setup.sh new file mode 100644 index 00000000..c9ef3929 --- /dev/null +++ b/osx/ArmLinux_setup.sh @@ -0,0 +1,12 @@ +CHROOT_BASE=. # This makes Travis CI environment easier + +export COMPILE_ENV="sudo chroot $CHROOT_BASE" + +# setup chroot/qemu +sudo apt-get install debootstrap qemu-user-static +sudo debootstrap --foreign --variant=minbase --arch armhf --include=locales testing `pwd`/$CHROOT_BASE http://mirrordirector.raspbian.org/raspbian +sudo cp /usr/bin/qemu-arm-static $CHROOT_BASE/usr/bin/ +sudo cp ../osx/ArmLinux_setup_stage2.sh $CHROOT_BASE/tmp/setup.sh # FIXME: '../' + +# enter chroot/qemu +$COMPILE_ENV /tmp/setup.sh diff --git a/osx/ArmLinux_setup_stage2.sh b/osx/ArmLinux_setup_stage2.sh new file mode 100755 index 00000000..ee2354e5 --- /dev/null +++ b/osx/ArmLinux_setup_stage2.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# finish debootstrap process +./debootstrap/debootstrap --second-stage +export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true +cat <<'EOF' > /tmp/preseed.txt +locales locales/locales_to_be_generated multiselect "en_US.UTF-8 UTF-8" +locales locales/default_environment_locale select en_US.UTF-8 +tzdata tzdata/Areas select US +tzdata tzdata/Zones/US select Central +EOF +debconf-set-selections /tmp/preseed.txt +dpkg-reconfigure tzdata locales + +# set up apt-get +echo "deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi" > /etc/apt/sources.list From c7b3275edafed61aca7e5fac6116140f51cfe8cc Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Fri, 9 Jan 2015 18:15:10 -0600 Subject: [PATCH 02/20] Correct path to stage2 setup script --- osx/ArmLinux_setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osx/ArmLinux_setup.sh b/osx/ArmLinux_setup.sh index c9ef3929..3ed084aa 100644 --- a/osx/ArmLinux_setup.sh +++ b/osx/ArmLinux_setup.sh @@ -6,7 +6,7 @@ export COMPILE_ENV="sudo chroot $CHROOT_BASE" sudo apt-get install debootstrap qemu-user-static sudo debootstrap --foreign --variant=minbase --arch armhf --include=locales testing `pwd`/$CHROOT_BASE http://mirrordirector.raspbian.org/raspbian sudo cp /usr/bin/qemu-arm-static $CHROOT_BASE/usr/bin/ -sudo cp ../osx/ArmLinux_setup_stage2.sh $CHROOT_BASE/tmp/setup.sh # FIXME: '../' +sudo cp osx/ArmLinux_setup_stage2.sh $CHROOT_BASE/tmp/setup.sh # enter chroot/qemu $COMPILE_ENV /tmp/setup.sh From ae6169903aaf93f385c18ca07845ebee9058edd9 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Fri, 9 Jan 2015 18:47:37 -0600 Subject: [PATCH 03/20] use wrapper script from .travis.yml --- .travis.yml | 3 +-- wrapper.sh | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100755 wrapper.sh diff --git a/.travis.yml b/.travis.yml index 85268248..2406e4b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,5 +22,4 @@ before_script: - if test "${MASON_PLATFORM}" == "ArmLinux"; then source osx/ArmLinux_setup.sh; fi; script: - - $COMPILE_ENV source ./build.sh - - $COMPILE_ENV ${TARGET} + - $COMPILE_ENV ./wrapper.sh diff --git a/wrapper.sh b/wrapper.sh new file mode 100755 index 00000000..35fe9e5d --- /dev/null +++ b/wrapper.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +source ./build.sh +${TARGET} From 7884efe0750bad9cca1bf37c53c6d84e30b26ab5 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Fri, 9 Jan 2015 19:18:38 -0600 Subject: [PATCH 04/20] Fake sudo since chroot environment doesn't use/need it, however, scripts call it for other build environments --- osx/ArmLinux_fake_sudo.sh | 3 +++ osx/ArmLinux_setup.sh | 1 + 2 files changed, 4 insertions(+) create mode 100755 osx/ArmLinux_fake_sudo.sh diff --git a/osx/ArmLinux_fake_sudo.sh b/osx/ArmLinux_fake_sudo.sh new file mode 100755 index 00000000..d1a04c67 --- /dev/null +++ b/osx/ArmLinux_fake_sudo.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +$@ diff --git a/osx/ArmLinux_setup.sh b/osx/ArmLinux_setup.sh index 3ed084aa..15a8aead 100644 --- a/osx/ArmLinux_setup.sh +++ b/osx/ArmLinux_setup.sh @@ -7,6 +7,7 @@ sudo apt-get install debootstrap qemu-user-static sudo debootstrap --foreign --variant=minbase --arch armhf --include=locales testing `pwd`/$CHROOT_BASE http://mirrordirector.raspbian.org/raspbian sudo cp /usr/bin/qemu-arm-static $CHROOT_BASE/usr/bin/ sudo cp osx/ArmLinux_setup_stage2.sh $CHROOT_BASE/tmp/setup.sh +sudo cp osx/ArmLinux_fake_sudo.sh $CHROOT_BASE/usr/bin/sudo # enter chroot/qemu $COMPILE_ENV /tmp/setup.sh From 258c95707a17d2f64f20a405dc9576d02d89a812 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Fri, 9 Jan 2015 19:19:43 -0600 Subject: [PATCH 05/20] Debug statements in wrapper.sh --- wrapper.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wrapper.sh b/wrapper.sh index 35fe9e5d..cb0e4f0a 100755 --- a/wrapper.sh +++ b/wrapper.sh @@ -1,4 +1,7 @@ #!/bin/bash +echo "Sourcing build.sh for build functions ..." source ./build.sh + +echo "Running '${TARGET}' as build target ..." ${TARGET} From a3e0c2ec928bd03e5e02b0d4313dd0e923f171c0 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Fri, 9 Jan 2015 21:48:29 -0600 Subject: [PATCH 06/20] Redefine important variables for chroot environment --- osx/ArmLinux_setup_stage2.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osx/ArmLinux_setup_stage2.sh b/osx/ArmLinux_setup_stage2.sh index ee2354e5..b755dca2 100755 --- a/osx/ArmLinux_setup_stage2.sh +++ b/osx/ArmLinux_setup_stage2.sh @@ -14,3 +14,10 @@ dpkg-reconfigure tzdata locales # set up apt-get echo "deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi" > /etc/apt/sources.list + +# redefine these for the chroot environment +export MASON_PLATFORM=ArmLinux +export CXX11=true +export TARGET=build_mapnik +export QUIET=true +export MAPNIK_BRANCH=master From 5a93d3298b807c545ab5bd96475e060fbb370500 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Sat, 10 Jan 2015 01:46:44 -0600 Subject: [PATCH 07/20] Move variable redefinition to where it actually has effect. --- osx/ArmLinux_setup.sh | 8 +++++++- osx/ArmLinux_setup_stage2.sh | 7 ------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/osx/ArmLinux_setup.sh b/osx/ArmLinux_setup.sh index 15a8aead..2a283c09 100644 --- a/osx/ArmLinux_setup.sh +++ b/osx/ArmLinux_setup.sh @@ -1,6 +1,12 @@ CHROOT_BASE=. # This makes Travis CI environment easier -export COMPILE_ENV="sudo chroot $CHROOT_BASE" +MASON_PLATFORM=${MASON_PLATFORM-ArmLinux} +CXX11=${CXX11-true} +TARGET=${TARGET-build_mapnik} +QUIET=${QUIET-true} +MAPNIK_BRANCH=${MAPNIK_BRANCH-master} + +export COMPILE_ENV="sudo chroot $CHROOT_BASE /usr/bin/env MASON_PLATFORM=${MASON_PLATFORM} CXX11=${CXX11} TARGET=${TARGET} QUIET=${QUIET} MAPNIK_BRANCH=${MAPNIK_BRANCH}" # setup chroot/qemu sudo apt-get install debootstrap qemu-user-static diff --git a/osx/ArmLinux_setup_stage2.sh b/osx/ArmLinux_setup_stage2.sh index b755dca2..ee2354e5 100755 --- a/osx/ArmLinux_setup_stage2.sh +++ b/osx/ArmLinux_setup_stage2.sh @@ -14,10 +14,3 @@ dpkg-reconfigure tzdata locales # set up apt-get echo "deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi" > /etc/apt/sources.list - -# redefine these for the chroot environment -export MASON_PLATFORM=ArmLinux -export CXX11=true -export TARGET=build_mapnik -export QUIET=true -export MAPNIK_BRANCH=master From f7ba560d1082414771a9dc6cff5a770fe33dc96c Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Sat, 10 Jan 2015 02:37:27 -0600 Subject: [PATCH 08/20] Add lsb-release and related hooks. First guess at settings.sh section for Raspbian --- build.sh | 4 +++- osx/ArmLinux_setup.sh | 4 +++- osx/ArmLinux_setup_stage2.sh | 3 +++ osx/settings.sh | 24 ++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 29850181..acd33d38 100755 --- a/build.sh +++ b/build.sh @@ -58,7 +58,7 @@ function upgrade_gcc { fi echo "updating apt" sudo apt-get update -y - if [[ $(lsb_release --id) =~ "Ubuntu" ]]; then + if [[ $(lsb_release --id) =~ "Ubuntu" -o $(lsb_release --id) =~ "Raspbian"]]; then echo "installing C++11 compiler" sudo apt-get install -qq -y gcc-4.8 g++-4.8 export CC="gcc-4.8" @@ -91,6 +91,8 @@ function upgrade_clang { sudo apt-get install -y software-properties-common sudo add-apt-repository "deb http://llvm.org/apt/unstable/ llvm-toolchain-${CLANG_VERSION} main" fi + fi + if [[ $(lsb_release --id) =~ "Debian" -o $(lsb_release --id) =~ "Raspbian" ]]; then echo "updating apt" sudo apt-get update -y echo 'upgrading libstdc++' diff --git a/osx/ArmLinux_setup.sh b/osx/ArmLinux_setup.sh index 2a283c09..29fafc5f 100644 --- a/osx/ArmLinux_setup.sh +++ b/osx/ArmLinux_setup.sh @@ -5,8 +5,10 @@ CXX11=${CXX11-true} TARGET=${TARGET-build_mapnik} QUIET=${QUIET-true} MAPNIK_BRANCH=${MAPNIK_BRANCH-master} +CXX=${CXX-g++} +CC=${CC-gcc} -export COMPILE_ENV="sudo chroot $CHROOT_BASE /usr/bin/env MASON_PLATFORM=${MASON_PLATFORM} CXX11=${CXX11} TARGET=${TARGET} QUIET=${QUIET} MAPNIK_BRANCH=${MAPNIK_BRANCH}" +export COMPILE_ENV="sudo chroot $CHROOT_BASE /usr/bin/env MASON_PLATFORM=${MASON_PLATFORM} CXX11=${CXX11} TARGET=${TARGET} QUIET=${QUIET} MAPNIK_BRANCH=${MAPNIK_BRANCH} CXX=${CXX} CC=${CC}" # setup chroot/qemu sudo apt-get install debootstrap qemu-user-static diff --git a/osx/ArmLinux_setup_stage2.sh b/osx/ArmLinux_setup_stage2.sh index ee2354e5..a252b160 100755 --- a/osx/ArmLinux_setup_stage2.sh +++ b/osx/ArmLinux_setup_stage2.sh @@ -14,3 +14,6 @@ dpkg-reconfigure tzdata locales # set up apt-get echo "deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi" > /etc/apt/sources.list + +apt-get update +apt-get install -q -y lsb-release diff --git a/osx/settings.sh b/osx/settings.sh index 69f5140c..c6deffbd 100644 --- a/osx/settings.sh +++ b/osx/settings.sh @@ -209,6 +209,30 @@ elif [[ ${MASON_PLATFORM} == 'Linaro-softfp' ]]; then fi export ZLIB_PATH="${SYSROOT}/usr" +elif [[ ${MASON_PLATFORM} == 'ArmLinux' ]]; then + #NOTE: This section was originally based on Linaro-softfp version + + export ICU_EXTRA_CPP_FLAGS="${ICU_EXTRA_CPP_FLAGS} -DU_HAVE_NL_LANGINFO_CODESET=0" + cd ${ROOTDIR} + # NOTE --sysroot used here instead of -isysroot because I assume the former works better on linux + export EXTRA_CFLAGS="-fPIC --sysroot ${SYSROOT}" + export EXTRA_LDFLAGS="-Wl,-search_paths_first" + export EXTRA_CXXFLAGS="${EXTRA_CFLAGS}" + export EXTRA_CPPFLAGS="--sysroot ${SYSROOT}" + export PATH="${SDK_PATH}/bin":${PATH} + export CORE_CXX="g++" + export CORE_CC="gcc" + export ARCH_FLAGS= + export STDLIB="libstdcpp" + export STDLIB_CXXFLAGS="" + export STDLIB_LDFLAGS="" + export CXX_VISIBILITY_FLAGS="" + if [[ "${CXX11}" == true ]]; then + export STDLIB="libstdcpp" + export STDLIB_CXXFLAGS="-std=c++11 -DBOOST_SPIRIT_USE_PHOENIX_V3=1" + export STDLIB_LDFLAGS="" + fi + export ZLIB_PATH="${SYSROOT}/usr" elif [[ ${MASON_PLATFORM} == 'Android' ]]; then export CXX_VISIBILITY_FLAGS="" export alias ldconfig=true From 3357fb126dcf076a2771a3789b15c84a196950a0 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Sat, 10 Jan 2015 10:46:01 -0600 Subject: [PATCH 09/20] Fix or operator --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index acd33d38..8b2df2db 100755 --- a/build.sh +++ b/build.sh @@ -58,7 +58,7 @@ function upgrade_gcc { fi echo "updating apt" sudo apt-get update -y - if [[ $(lsb_release --id) =~ "Ubuntu" -o $(lsb_release --id) =~ "Raspbian"]]; then + if [[ $(lsb_release --id) =~ "Ubuntu" ]] || [[ $(lsb_release --id) =~ "Raspbian"]]; then echo "installing C++11 compiler" sudo apt-get install -qq -y gcc-4.8 g++-4.8 export CC="gcc-4.8" @@ -92,7 +92,7 @@ function upgrade_clang { sudo add-apt-repository "deb http://llvm.org/apt/unstable/ llvm-toolchain-${CLANG_VERSION} main" fi fi - if [[ $(lsb_release --id) =~ "Debian" -o $(lsb_release --id) =~ "Raspbian" ]]; then + if [[ $(lsb_release --id) =~ "Debian" ]] || [[ $(lsb_release --id) =~ "Raspbian" ]]; then echo "updating apt" sudo apt-get update -y echo 'upgrading libstdc++' From da796a73fe0407f91e62acd08fac81984c77f060 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Sun, 11 Jan 2015 21:02:24 -0600 Subject: [PATCH 10/20] Add space in if statement --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 8b2df2db..1587f5c8 100755 --- a/build.sh +++ b/build.sh @@ -58,7 +58,7 @@ function upgrade_gcc { fi echo "updating apt" sudo apt-get update -y - if [[ $(lsb_release --id) =~ "Ubuntu" ]] || [[ $(lsb_release --id) =~ "Raspbian"]]; then + if [[ $(lsb_release --id) =~ "Ubuntu" ]] || [[ $(lsb_release --id) =~ "Raspbian" ]]; then echo "installing C++11 compiler" sudo apt-get install -qq -y gcc-4.8 g++-4.8 export CC="gcc-4.8" From 2a502156e719c4f18cab75dfd6dc5eaecc3f1f89 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Sun, 11 Jan 2015 22:30:16 -0600 Subject: [PATCH 11/20] Add wget dependency --- osx/ArmLinux_setup_stage2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osx/ArmLinux_setup_stage2.sh b/osx/ArmLinux_setup_stage2.sh index a252b160..e7a462af 100755 --- a/osx/ArmLinux_setup_stage2.sh +++ b/osx/ArmLinux_setup_stage2.sh @@ -16,4 +16,4 @@ dpkg-reconfigure tzdata locales echo "deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi" > /etc/apt/sources.list apt-get update -apt-get install -q -y lsb-release +apt-get install -q -y lsb-release wget From 8ada57dd31d9e7877f2d75bbfd5a897b578adc3e Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Mon, 12 Jan 2015 21:14:42 -0600 Subject: [PATCH 12/20] Try with fewer exports in platform-specific settings.sh section --- osx/settings.sh | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/osx/settings.sh b/osx/settings.sh index c6deffbd..6dd28b20 100644 --- a/osx/settings.sh +++ b/osx/settings.sh @@ -210,19 +210,8 @@ elif [[ ${MASON_PLATFORM} == 'Linaro-softfp' ]]; then export ZLIB_PATH="${SYSROOT}/usr" elif [[ ${MASON_PLATFORM} == 'ArmLinux' ]]; then - #NOTE: This section was originally based on Linaro-softfp version - - export ICU_EXTRA_CPP_FLAGS="${ICU_EXTRA_CPP_FLAGS} -DU_HAVE_NL_LANGINFO_CODESET=0" - cd ${ROOTDIR} - # NOTE --sysroot used here instead of -isysroot because I assume the former works better on linux - export EXTRA_CFLAGS="-fPIC --sysroot ${SYSROOT}" - export EXTRA_LDFLAGS="-Wl,-search_paths_first" - export EXTRA_CXXFLAGS="${EXTRA_CFLAGS}" - export EXTRA_CPPFLAGS="--sysroot ${SYSROOT}" - export PATH="${SDK_PATH}/bin":${PATH} export CORE_CXX="g++" export CORE_CC="gcc" - export ARCH_FLAGS= export STDLIB="libstdcpp" export STDLIB_CXXFLAGS="" export STDLIB_LDFLAGS="" @@ -232,7 +221,6 @@ elif [[ ${MASON_PLATFORM} == 'ArmLinux' ]]; then export STDLIB_CXXFLAGS="-std=c++11 -DBOOST_SPIRIT_USE_PHOENIX_V3=1" export STDLIB_LDFLAGS="" fi - export ZLIB_PATH="${SYSROOT}/usr" elif [[ ${MASON_PLATFORM} == 'Android' ]]; then export CXX_VISIBILITY_FLAGS="" export alias ldconfig=true From 1b65f3ae63ec5b5ecddfbb5495e6b9479dad9c58 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Mon, 12 Jan 2015 21:36:56 -0600 Subject: [PATCH 13/20] Define SDK_PATH as empty string --- osx/settings.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/osx/settings.sh b/osx/settings.sh index 6dd28b20..939b2f5d 100644 --- a/osx/settings.sh +++ b/osx/settings.sh @@ -221,6 +221,7 @@ elif [[ ${MASON_PLATFORM} == 'ArmLinux' ]]; then export STDLIB_CXXFLAGS="-std=c++11 -DBOOST_SPIRIT_USE_PHOENIX_V3=1" export STDLIB_LDFLAGS="" fi + export SDK_PATH="" elif [[ ${MASON_PLATFORM} == 'Android' ]]; then export CXX_VISIBILITY_FLAGS="" export alias ldconfig=true From 2bb5cd6a57b8ea00121a49239b42ebb9006d8a37 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Mon, 12 Jan 2015 22:27:36 -0600 Subject: [PATCH 14/20] Add empty flags exports to settings.sh --- osx/settings.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osx/settings.sh b/osx/settings.sh index 939b2f5d..4102d243 100644 --- a/osx/settings.sh +++ b/osx/settings.sh @@ -210,8 +210,13 @@ elif [[ ${MASON_PLATFORM} == 'Linaro-softfp' ]]; then export ZLIB_PATH="${SYSROOT}/usr" elif [[ ${MASON_PLATFORM} == 'ArmLinux' ]]; then + export EXTRA_CFLAGS="" + export EXTRA_LDFLAGS="" + export EXTRA_CXXFLAGS="" + export EXTRA_CPPFLAGS="" export CORE_CXX="g++" export CORE_CC="gcc" + export ARCH_FLAGS="" export STDLIB="libstdcpp" export STDLIB_CXXFLAGS="" export STDLIB_LDFLAGS="" From 237824e9d1ccde9b8f69a378a28a80761f6fe972 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Mon, 12 Jan 2015 22:53:01 -0600 Subject: [PATCH 15/20] Mount /proc in chroot so 'free' works --- osx/ArmLinux_setup_stage2.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osx/ArmLinux_setup_stage2.sh b/osx/ArmLinux_setup_stage2.sh index e7a462af..180bb8c8 100755 --- a/osx/ArmLinux_setup_stage2.sh +++ b/osx/ArmLinux_setup_stage2.sh @@ -17,3 +17,6 @@ echo "deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-f apt-get update apt-get install -q -y lsb-release wget + +# mount proc for 'free' +mount proc /proc -t proc From 8a39ec9cf6e295871f165b7e13401566d822a975 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Tue, 13 Jan 2015 12:09:41 -0600 Subject: [PATCH 16/20] Force arm build to use g++, since upgrade_clang forces libstdc++ upgrade which ends with g++-4.9 instead of g++4.8 --- osx/ArmLinux.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osx/ArmLinux.sh b/osx/ArmLinux.sh index 0d5666ca..412ad49f 100644 --- a/osx/ArmLinux.sh +++ b/osx/ArmLinux.sh @@ -6,9 +6,11 @@ export MASON_PLATFORM="ArmLinux" export HOST_PLATFORM="Linux" export BOOST_ARCH="arm" export ARCH_NAME="armv7" -source $(dirname "$BASH_SOURCE")/settings.sh +export CXX="g++" +export CC="gcc" export MAKE="make" # default to C++11 for this platform if [[ "${CXX11:-false}" == false ]]; then export CXX11=true fi +source $(dirname "$BASH_SOURCE")/settings.sh From dd2dfbe7d88e862ef1746202665d7756c3a2d411 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Tue, 13 Jan 2015 15:49:10 -0600 Subject: [PATCH 17/20] Debug environment --- wrapper.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wrapper.sh b/wrapper.sh index cb0e4f0a..5e31a2a2 100755 --- a/wrapper.sh +++ b/wrapper.sh @@ -1,7 +1,13 @@ #!/bin/bash +echo "Initial environment:" +env + echo "Sourcing build.sh for build functions ..." source ./build.sh +echo "Post-build.sh environment:" +env + echo "Running '${TARGET}' as build target ..." ${TARGET} From 7fa5dbe523e1fb2f1307fd41fcad02715cf1ddd6 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Tue, 13 Jan 2015 15:49:51 -0600 Subject: [PATCH 18/20] Add empty HOST_ARG to prevent failure during build_freetype.sh --- osx/ArmLinux.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/osx/ArmLinux.sh b/osx/ArmLinux.sh index 412ad49f..48a6c99c 100644 --- a/osx/ArmLinux.sh +++ b/osx/ArmLinux.sh @@ -6,6 +6,7 @@ export MASON_PLATFORM="ArmLinux" export HOST_PLATFORM="Linux" export BOOST_ARCH="arm" export ARCH_NAME="armv7" +export HOST_ARG="" export CXX="g++" export CC="gcc" export MAKE="make" From dee6252266341a84f48a4cb96ab0d6ccff66d7f5 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Tue, 13 Jan 2015 16:24:19 -0600 Subject: [PATCH 19/20] Force g++/gcc during chrot setup --- osx/ArmLinux_setup.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osx/ArmLinux_setup.sh b/osx/ArmLinux_setup.sh index 29fafc5f..3d6719c0 100644 --- a/osx/ArmLinux_setup.sh +++ b/osx/ArmLinux_setup.sh @@ -5,8 +5,10 @@ CXX11=${CXX11-true} TARGET=${TARGET-build_mapnik} QUIET=${QUIET-true} MAPNIK_BRANCH=${MAPNIK_BRANCH-master} -CXX=${CXX-g++} -CC=${CC-gcc} + +# select g++/gcc here because upgrade_(compiler) is called before platorm script +CXX=g++ +CC=gcc export COMPILE_ENV="sudo chroot $CHROOT_BASE /usr/bin/env MASON_PLATFORM=${MASON_PLATFORM} CXX11=${CXX11} TARGET=${TARGET} QUIET=${QUIET} MAPNIK_BRANCH=${MAPNIK_BRANCH} CXX=${CXX} CC=${CC}" From eb316ff686ca684a26130dbe26406318bf9f99f1 Mon Sep 17 00:00:00 2001 From: Brandon Anderson Date: Tue, 13 Jan 2015 17:29:51 -0600 Subject: [PATCH 20/20] Attempt to get rid of locale warnings. --- osx/ArmLinux_setup_stage2.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osx/ArmLinux_setup_stage2.sh b/osx/ArmLinux_setup_stage2.sh index 180bb8c8..2e8f690c 100755 --- a/osx/ArmLinux_setup_stage2.sh +++ b/osx/ArmLinux_setup_stage2.sh @@ -1,15 +1,21 @@ #!/bin/bash +LANG=${LANG-'en_US.UTF-8'} + # finish debootstrap process ./debootstrap/debootstrap --second-stage export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true cat <<'EOF' > /tmp/preseed.txt -locales locales/locales_to_be_generated multiselect "en_US.UTF-8 UTF-8" +locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8 locales locales/default_environment_locale select en_US.UTF-8 tzdata tzdata/Areas select US tzdata tzdata/Zones/US select Central EOF debconf-set-selections /tmp/preseed.txt +export LANGUAGE=$LANG +export LANG=$LANG +export LC_ALL=$LANG +locale-gen $LANG dpkg-reconfigure tzdata locales # set up apt-get