--debug Run tests on debug build of chromium
--nocheck-sys-deps Do not check if necessary dependencies have been installed on target system. Useful when not using supported ubuntu version
--help Display full list of supported command line options
+
+### Crosscompile mobile build
+This is a build mode only for development purposes. It doesn't produce an installable
+rpm package. It might break any time. I warned you! The advantage is that everything
+is built directly on the host and the overhead of gbs is eliminated. Ergo it is fast.
+
+The setup is a bit involved. Let's see. Note that it is quite likely that it will not
+work out-of-box and you have to tailor it to your system.
+
+First you need to have your gbs root directory set up which effectively means you
+should do a gbs mobile build.
+
+Now you need to have corresponding cross compiler. We have sources of cross compiler
+used in gbs so why don't use it? Let's clone tizenbuildtools repo first:
+
+ git clone -b master http://gitorious.org/tizenbuildtools/tizenbuildtools.git
+ cd tizenbuildtools/tools
+
+Now build binutils and cross compiler.
+ ./create_cross_compiler_from_gbs_sysroot \
+ -p ~/toolchains/gcc-4.8-mobile/ \
+ -s ~/GBS-ROOT-2.3-DEV/local/BUILD-ROOTS/scratch.armv7l.0 \
+ -r http://10.251.52.177/tizenrepo/tv_repo/tizen-2.2.1-vd-4.8_20140822.1/repos/base/source
+First parameter (-p) is toolchain prefix. There will land binutils and gcc. Second one is gbs sysroot
+needed to cross compilation. It needs to be prepared (gbs build performed). Third parameter is source
+rpm repository corresponding to binary repository used by gbs(almost always this repository is
+ancestor of repository used by gbs and placed in gbs.conf)
+
+It's recommended to use gold linker. Replace the ld binary in the compiler with gold.
+
+ cd ~/toolchains/gcc-4.8-mobile/bin
+ cp armv7l-tizen-linux-gnueabi-ld armv7l-tizen-linux-gnueabi-ld.normal
+ ln -sf armv7l-tizen-linux-gnueabi-ld.gold armv7l-tizen-linux-gnueabi-ld
+
+Build
+ export GBS_ROOT_PATH=~/GBS-ROOT-2.3-DEV
+ export PATH=~/toolchains/gcc-4.8-mobile/bin:$PATH
+ export CROSS_COMPILE=armv7l-tizen-linux-gnueabi-
+ ./build/cross_build_mobile.sh
+
+Before first deployment of cross compiled binaries ensure that you installed rpm on device.
+Rpm will create necessary, initial configuration e.g. smack permissions.
+
+Deploy:
+ scripts/deploy2device.sh release -o /home/tolszak/workspace/CT/chromium-efl/out.cross.arm
+
+[Optional] Icecc
+You can use ccache and/or icecc by setting up the cc variables and symlinks appropriately.
+This is more or less what I have done before running build_dekstop.sh to set up both:
+
+ cd ~/bin
+ TARBALL=$(/usr/lib/icecc/icecc-create-env --gcc /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-linux-gnueabi-g++-4.6 | tail -n 1)
+ mv $TARBALL arm-linux-gnueabi-gcc-4.6.3.tar.gz
+ export ICECC_VERSION="$HOME/bin/arm-linux-gnueabi-gcc-4.6.3.tar.gz=arm-linux-gnueabi,$ICECC_VERSION"
+ ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 arm-linux-gnueabi-gcc
+ ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 arm-linux-gnueabi-g++
+ export PATH=~/bin:$PATH
+
+ cd /usr/lib/ccache
+ ln -s ../../bin/ccache arm-linux-gnueabi-gcc
+ ln -s ../../bin/ccache arm-linux-gnueabi-g++
+ cd /usr/lib/icecc/bin
+ ln -s ../../bin/icecc arm-linux-gnueabi-gcc
+ ln -s ../../bin/icecc arm-linux-gnueabi-g++
+ cd ~/bin
+
+ export CC_target=arm-linux-gnueabi-gcc
+ export CXX_target=arm-linux-gnueabi-g++
+ export CC_host=gcc
+ export CXX_host=g++
+[Optional] ccache
+ # make symbolic links to your cross compiler
+ ln -s ~/toolchains/gcc-4.8-mobile/bin/armv7l-tizen-linux-gnueabi-gcc armv7l-tizen-linux-gnueabi-gcc
+ ln -s ~/toolchains/gcc-4.8-mobile/bin/armv7l-tizen-linux-gnueabi-g++ armv7l-tizen-linux-gnueabi-g++
+ # add invoke build script with with --ccache parameter
+ cd chromium-efl
+ ./build/cross_build_mobile.sh --ccache
+
+Now let's set up the phone to be able to run it. We need the nss libraries from
+chromium-ewk/thirdparty to be on the phone under /lib. This might not be very safe
+(break other apps) so be sure you make a backup.
+gconf-2 has to be installed as well. Download the rpm from the tizen repositories
+(that gbs is using also) and install.
+
+It is recommended to use scripts/deploy2device.sh to install binaries on device.
TOPDIR=$( cd ${SCRIPTDIR}/.. ; pwd -P )
source ${SCRIPTDIR}/common.sh
+trap 'error_report $0 $LINENO' ERR SIGINT SIGTERM SIGQUIT
host_arch=$(getHostArch)
-export GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
-
-usage() {
-cat << EOF
-usage: $0 [OPTIONS]
-
-Build desktop version of chromium-efl
-
-OPTIONS:
- -h, --help Show this message
- --skip-gyp Skip restore_gyp, jhbuild and gyp_chromium steps
- --ccache configure ccache installed in your system
- --skip-ninja Skip ninja step
- --build-ewk-unittests build ewk unittests
- --debug build debug version of chromium-efl (in $GYP_GENERATOR_OUTPUT/Debug instead of default $GYP_GENERATOR_OUTPUT/Release)
- -jN set number of jobs, just like with make or ninja
-
-examples:
-$0 --skip-gyp
-$0 --skip-gyp --ccache
-$0 --skip-ninja
-EOF
- exit
-}
-
-SKIP_GYP=0
-USE_CCACHE=0
-SKIP_NINJA=0
-
-BUILD_SUBDIRECTORY=Release
-
-if echo "$@" | grep -cq '\(\(\-\-help\)\|\(\-h\)\)'; then
- usage
-fi
-
-if echo "$@" | grep -cq '\-\-skip-gyp'; then
- SKIP_GYP=1
+if [ -z "$GYP_GENERATOR_OUTPUT" ]; then
+ export GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
fi
-if echo "$@" | grep -cq '\-\-skip-ninja'; then
- SKIP_NINJA=1
-fi
-
-if echo "$@" | grep -cq '\-\-ccache'; then
- USE_CCACHE=1
-fi
-
-if echo "$@" | grep -cq '\-\-build-ewk-unittests'; then
- BUILD_EWK_UNITTESTS=1
-fi
-
-if echo "$@" | grep -cq '\-\-content_shell'; then
- BUILD_CONTENT_SHELL=1
-fi
+parseHostBuildScriptParams desktop $@
JHBUILD_STAMPFILE="${GYP_GENERATOR_OUTPUT}/Dependencies/Root/jhbuild.stamp"
rm -f $JHBUILD_STAMPFILE
fi
-if echo "$@" | grep -cq '\-\-debug'; then
- BUILD_SUBDIRECTORY=Debug
-fi
-
-# Will be empty string if -j not specified or ill-formatted, otherwise -j and the number argument together.
-# \grep because folks often alias grep but we want the vanilla behavior.
-JOBS=$(echo "$@" | \grep -Eo '\-j\s*[1-9]([0-9]*)')
-
-set -e
-
JHBUILD_DEPS="${GYP_GENERATOR_OUTPUT}/Dependencies/Root"
if [ "${host_arch}" == "x64" ]; then
_LIBDIR=lib64
fi
fi
-if [ "$SKIP_GYP" == "0" ]; then
- ${TOPDIR}/build/gyp_chromiumefl.sh
-fi
+export __GYP_CHROMIUMEFL_TARGET=desktop
-if [ "$SKIP_NINJA" == "0" ]; then
- if [ "$USE_CCACHE" == "1" ]; then
- echo using ccache
- set +e
- source $TOPDIR/build/ccache_env.sh desktop
- set -e
- fi
- export LD_LIBRARY_PATH="${JHBUILD_DEPS}/${_LIBDIR}:$LD_LIBRARY_PATH"
- export PATH="${JHBUILD_DEPS}/bin:$PATH"
+hostGypChromiumEfl
- TARGETS="chromium-efl efl_webprocess chromium-ewk efl_webview_app"
- if [ "$BUILD_EWK_UNITTESTS" == "1" ]; then
- TARGETS="$TARGETS ewk_unittests"
- fi
+export LD_LIBRARY_PATH="${JHBUILD_DEPS}/${_LIBDIR}:$LD_LIBRARY_PATH"
+export PATH="${JHBUILD_DEPS}/bin:$PATH"
- if [ "$BUILD_CONTENT_SHELL" == "1" ]; then
- TARGETS="$TARGETS content_shell_efl"
- fi
-
- ninja -C ${GYP_GENERATOR_OUTPUT}/${BUILD_SUBDIRECTORY} ${JOBS} ${TARGETS}
-fi
+hostNinja desktop
#!/bin/bash
-export ICECC=no
-SCRIPTDIR=$(cd $(dirname $0); pwd -P)
-
# source common functions and vars
-. `dirname ${BASH_SOURCE[0]}`/common.sh
+. `dirname $0`/common.sh
+trap '${SCRIPTDIR}/apply_patches.sh -r ${SCRIPTDIR}/patches;\
+ error_report $0 $LINENO' ERR SIGINT SIGTERM SIGQUIT
-${SCRIPTDIR}/apply_patches.sh
+${SCRIPTDIR}/apply_patches.sh ${SCRIPTDIR}/patches
# "|| :" means "or always succeeding built-in command"
PROFILE_NAME=$(echo "$@" | grep -Po "(?<=\-P\s)[^\s]*" || :)
gbs $CONF_FLAG build $PROFILE_FLAG -A armv7l --incremental \
--define "${CUSTOM_LIBC_DIR}" \
--define "${TIZEN_VERSION}" "$@"
-GBS_RET=$?
-${SCRIPTDIR}/apply_patches.sh -r
-APPLY_PATCHES_RET=$?
+${SCRIPTDIR}/apply_patches.sh -r ${SCRIPTDIR}/patches
-[ "$GBS_RET" != "0" ] && exit $GBS_RET
-[ "$APPLY_PATCHES_RET" != "0" ] && exit $APPLY_PATCHES_RET
-exit 0
#!/bin/bash
-SCRIPTDIR=$(cd $(dirname $0); pwd -P)
-
# source common functions and vars
-. `dirname ${BASH_SOURCE[0]}`/common.sh
+. `dirname $0`/common.sh
+trap '${SCRIPTDIR}/apply_patches.sh -r ${SCRIPTDIR}/patches;\
+ error_report $0 $LINENO' ERR SIGINT SIGTERM SIGQUIT
-${SCRIPTDIR}/apply_patches.sh
+${SCRIPTDIR}/apply_patches.sh ${SCRIPTDIR}/patches
# "|| :" means "or always succeeding built-in command"
PROFILE_NAME=$(echo "$@" | grep -Po "(?<=\-P\s)[^\s]*" || :)
gbs $CONF_FLAG build $PROFILE_FLAG -A armv7l --incremental \
--extra-packs python-base-x86-arm,python-x86-arm,python-xml-x86-arm \
--define "${TIZEN_VERSION}" "$@"
-GBS_RET=$?
-${SCRIPTDIR}/apply_patches.sh -r
-APPLY_PATCHES_RET=$?
+${SCRIPTDIR}/apply_patches.sh -r ${SCRIPTDIR}/patches
-[ "$GBS_RET" != "0" ] && exit $GBS_RET
-[ "$APPLY_PATCHES_RET" != "0" ] && exit $APPLY_PATCHES_RET
-exit 0
return 0
fi
-if [ "$1" == "desktop" -o "$1" == "mobile" -o "$1" == "tv" ]; then
+if [ "$1" == "desktop" -o "$1" == "mobile" -o "$1" == "tv" -o "$1" == "crosscompile" ]; then
OUTPUT_BASE_FOLDER=out.${1}.$(getHostArch)
export CCACHE_CPP2=yes
export CCACHE_SLOPPINESS=time_macros
ccache -M 10
fi
- if [ "$1" == "desktop" ]; then
+ if [ "$1" == "desktop" -o "$1" == "crosscompile" ]; then
ccacheInPath=$(echo $PATH | grep -c /usr/lib/ccache)
if [ "$ccacheInPath" == "0" ]; then
export PATH=/usr/lib/ccache:$PATH
#!/bin/bash
-pushd `dirname ${BASH_SOURCE[0]}` > /dev/null
-SCRIPTDIR=`pwd -L`
+pushd `dirname $0` > /dev/null
+export SCRIPTDIR=`pwd -L`
popd > /dev/null
-export TOPDIR="${SCRIPTDIR}/.."
+export TOPDIR=$(readlink -f "${SCRIPTDIR}/..")
if [[ -z "${CHROME_SRC}" ]]; then
# If $CHROME_SRC was not set, assume src subfolder in project directory is CHROME_SRC.
export CHROME_SRC="${TOPDIR}/src"
function getPythonVersion() {
echo $(python --version 2>&1 | sed -e 's/Python \([0-9]\+\.[0-9]\+\)\.[0-9]\+/\1/')
}
+
+function setIfUndef() {
+ eval original=\$$1
+ new=$2
+ if [ -n "$original" ]; then
+ echo $original
+ else
+ echo $new
+ fi
+}
+
+
+function hostBuldScriptUsage() {
+cat << EOF
+usage: $1 [OPTIONS]
+
+Build non gbs version of chromium-efl
+
+OPTIONS:
+ -h, --help Show this message
+ --skip-gyp Skip restore_gyp, jhbuild and gyp_chromium steps
+ --ccache configure ccache installed in your system
+ --content-shell Build content_shell application
+ --skip-ninja Skip ninja step
+ --build-ewk-unittests build ewk unittests
+ --debug build debug version of chromium-efl (in $GYP_GENERATOR_OUTPUT/Debug instead of default $GYP_GENERATOR_OUTPUT/Release)
+ -jN set number of jobs, just like with make or ninja
+
+examples:
+$0 --skip-gyp
+$0 --skip-gyp --ccache
+$0 --skip-ninja
+EOF
+ exit
+}
+
+function parseHostBuildScriptParams() {
+
+ export SKIP_GYP=0
+ export USE_CCACHE=0
+ export SKIP_NINJA=0
+ export BUILD_SUBDIRECTORY=Release
+
+ if echo "$@" | grep -cq '\(\(\-\-help\)\|\(\-h\)\)'; then
+ hostBuldScriptUsage ${0}
+ fi
+
+ if echo "$@" | grep -cq '\-\-skip-gyp'; then
+ export SKIP_GYP=1
+ fi
+
+ if echo "$@" | grep -cq '\-\-skip-ninja'; then
+ export SKIP_NINJA=1
+ fi
+
+ if echo "$@" | grep -cq '\-\-content_shell'; then
+ export BUILD_CONTENT_SHELL=1
+ fi
+
+ if echo "$@" | grep -cq '\-\-ccache'; then
+ export USE_CCACHE=1
+ echo using ccache
+ source $TOPDIR/build/ccache_env.sh ${1}
+ fi
+
+ if echo "$@" | grep -cq '\-\-build-ewk-unittests'; then
+ export BUILD_EWK_UNITTESTS=1
+ fi
+ if echo "$@" | grep -cq '\-\-debug'; then
+ export BUILD_SUBDIRECTORY=Debug
+ fi
+ # Will be empty string if -j not specified or ill-formatted, otherwise -j and the number argument together.
+ # \grep because folks often alias grep but we want the vanilla behavior.
+ export JOBS=$(echo "$@" | \grep -Eo '\-j\s*[1-9]([0-9]*)')
+
+}
+
+function hostGypChromiumEfl() {
+ if [ "$SKIP_GYP" == "0" ]; then
+ ${TOPDIR}/build/gyp_chromiumefl.sh $@
+ fi
+}
+
+function hostNinja() {
+ if [ "$SKIP_NINJA" == "0" ]; then
+ TARGETS="chromium-efl efl_webprocess chromium-ewk efl_webview_app"
+ if [ "$BUILD_EWK_UNITTESTS" == "1" ]; then
+ TARGETS="$TARGETS ewk_unittests"
+ fi
+ if [ "$BUILD_CONTENT_SHELL" == "1" ]; then
+ TARGETS="$TARGETS content_shell_efl"
+ fi
+ BUILDDIR=${GYP_GENERATOR_OUTPUT}/${BUILD_SUBDIRECTORY}
+ ninja -C $BUILDDIR ${JOBS} ${TARGETS}
+ fi
+}
+
+function error_report() {
+ echo "Error: File:$1 Line:$2"
+ exit 1
+}
--- /dev/null
+#! /bin/bash
+
+# common.gypi wants arm-linux-gnueabihf-gcc to set default settings.
+# Tizen doesn't support hard floating point so we redirect it.
+${CROSS_COMPILE}g++ $@
--- /dev/null
+#! /bin/bash
+
+# common.gypi wants arm-linux-gnueabihf-gcc to set default settings.
+# Tizen doesn't support hard floating point so we redirect it.
+${CROSS_COMPILE}gcc $@
--- /dev/null
+#!/bin/bash
+
+SCRIPTDIR=$( cd $(dirname $0) ; pwd -P )
+TOPDIR=$( cd ${SCRIPTDIR}/.. ; pwd -P )
+
+source ${SCRIPTDIR}/common.sh
+trap 'postBuild ${SYSROOTDIR};\
+ error_report $0 $LINENO' ERR SIGINT SIGTERM SIGQUIT
+
+host_arch=$(getHostArch)
+
+
+__SUFFIX=crosscompile.orig
+
+function adaptGbsSysrootToCrossCompilation() {
+ echo "cd /etc/; [ -e ld.so.conf.d ] && mv ld.so.conf.d ld.so.conf.d.$__SUFFIX;" | gbs chroot --root ${1}
+}
+function rollbackGbsSysrootChanges() {
+ echo "cd /etc/; [ -e ld.so.conf.d.$__SUFFIX ] && mv ld.so.conf.d.$__SUFFIX ld.so.conf.d;" | gbs chroot --root ${1}
+}
+
+function preBuild() {
+ adaptGbsSysrootToCrossCompilation $1
+ ${SCRIPTDIR}/apply_patches.sh ${SCRIPTDIR}/patches
+}
+
+function postBuild() {
+ rollbackGbsSysrootChanges $1
+ ${SCRIPTDIR}/apply_patches.sh -r ${SCRIPTDIR}/patches
+}
+
+if [ -z "$GYP_GENERATOR_OUTPUT" ]; then
+ export GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.cross.arm"
+fi
+
+parseHostBuildScriptParams crosscompile $@
+
+if [ -z "$GBS_ROOT_PATH" ]; then
+ echo "Set GBS_ROOT_PATH for cross compilation"
+ exit 1
+fi
+
+if [ -z "$CROSS_COMPILE" ]; then
+ echo "Set CROSS_COMPILE for cross compilation like: /home/user/toolchains/bin/armv7l-tizen-linux-gnueabi-"
+ exit 1
+fi
+
+# Only override if not set to enable customization for distributed compiling.
+export CC_target=$(setIfUndef CC_target ${CROSS_COMPILE}gcc)
+export CXX_target=$(setIfUndef CXX_target ${CROSS_COMPILE}g++)
+export AR_target=${CROSS_COMPILE}ar
+export AS_target=${CROSS_COMPILE}as
+export RANLIB_target=${CROSS_COMPILE}ranlib
+
+export SYSROOTDIR="${GBS_ROOT_PATH}"/local/BUILD-ROOTS/scratch.armv7l.0
+export PKG_CONFIG_SYSROOT_DIR="${SYSROOTDIR}"
+export PKG_CONFIG_PATH="${SYSROOTDIR}/usr/lib/pkgconfig:${SYSROOTDIR}/usr/share/pkgconfig"
+export GYP_CROSSCOMPILE=1
+
+export PATH="${TOPDIR}/build/cross-shim:$PATH"
+
+preBuild ${SYSROOTDIR}
+
+export __GYP_CHROMIUMEFL_TARGET=crosscompile
+hostGypChromiumEfl -Dbuilding_for_tizen_mobile=1
+
+hostNinja crosscompile
+RET=$?
+
+postBuild ${SYSROOTDIR}
+
+exit $RET
--- /dev/null
+#!/bin/bash
+
+SCRIPTDIR=$( cd $(dirname $0) ; pwd -P )
+TOPDIR=$( cd ${SCRIPTDIR}/.. ; pwd -P )
+
+source ${SCRIPTDIR}/common.sh
+trap 'postBuild ${SYSROOTDIR};\
+ error_report $0 $LINENO' ERR SIGINT SIGTERM SIGQUIT
+
+host_arch=$(getHostArch)
+
+
+__SUFFIX=crosscompile.orig
+
+function adaptGbsSysrootToCrossCompilation() {
+ echo "cd /etc/; [ -e ld.so.conf.d ] && mv ld.so.conf.d ld.so.conf.d.$__SUFFIX;" | gbs chroot --root ${1}
+}
+function rollbackGbsSysrootChanges() {
+ echo "cd /etc/; [ -e ld.so.conf.d.$__SUFFIX ] && mv ld.so.conf.d.$__SUFFIX ld.so.conf.d;" | gbs chroot --root ${1}
+}
+
+function preBuild() {
+ adaptGbsSysrootToCrossCompilation $1
+ ${SCRIPTDIR}/apply_patches.sh ${SCRIPTDIR}/patches
+}
+
+function postBuild() {
+ rollbackGbsSysrootChanges $1
+ ${SCRIPTDIR}/apply_patches.sh -r ${SCRIPTDIR}/patches
+}
+
+if [ -z "$GYP_GENERATOR_OUTPUT" ]; then
+ export GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.cross.tv.arm"
+fi
+
+parseHostBuildScriptParams crosscompile $@
+
+if [ -z "$GBS_ROOT_PATH" ]; then
+ echo "Set GBS_ROOT_PATH for cross compilation"
+ exit 1
+fi
+
+if [ -z "$CROSS_COMPILE" ]; then
+ echo "Set CROSS_COMPILE for cross compilation like: /home/user/toolchains/bin/armv7l-tizen-linux-gnueabi-"
+ exit 1
+fi
+
+# Only override if not set to enable customization for distributed compiling.
+export CC_target=$(setIfUndef CC_target ${CROSS_COMPILE}gcc)
+export CXX_target=$(setIfUndef CXX_target ${CROSS_COMPILE}g++)
+export AR_target=${CROSS_COMPILE}ar
+export AS_target=${CROSS_COMPILE}as
+export RANLIB_target=${CROSS_COMPILE}ranlib
+
+export SYSROOTDIR="${GBS_ROOT_PATH}"/local/BUILD-ROOTS/scratch.armv7l.0
+export PKG_CONFIG_SYSROOT_DIR="${SYSROOTDIR}"
+export PKG_CONFIG_PATH="${SYSROOTDIR}/usr/lib/pkgconfig:${SYSROOTDIR}/usr/share/pkgconfig"
+export GYP_CROSSCOMPILE=1
+
+export PATH="${TOPDIR}/build/cross-shim:$PATH"
+
+preBuild ${SYSROOTDIR}
+
+export __GYP_CHROMIUMEFL_TARGET=crosscompile
+hostGypChromiumEfl -Dbuilding_for_tizen_tv=1 -Dchromium_efl_tizen_version="2.2.1"
+
+hostNinja crosscompile
+RET=$?
+
+postBuild ${SYSROOTDIR}
+
+exit $RET
#!/bin/bash
-SCRIPTDIR=$( cd $(dirname $0) ; pwd -P )
-TOPDIR=$( cd ${SCRIPTDIR}/.. ; pwd -P )
-
-source ${SCRIPTDIR}/common.sh
-
+source $(dirname $0)/common.sh
+trap 'error_report $0 $LINENO' ERR SIGINT SIGTERM SIGQUIT
host_arch=$(getHostArch)
-target=desktop
-export GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
+if [ -z "$GYP_GENERATOR_OUTPUT" ]; then
+ GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
+fi
+
+EXTRA_GYP_ARGS="$@"
-if echo "$@" | grep -cq '\-\Dbuilding_for_tizen_mobile=1'; then
- GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.mobile.${host_arch}"
+# __GYP_CHROMIUMEFL_TARGET is defined when we are called from build_desktop.sh.
+# Otherwise we are called by gbs whch already passes the correct building_for_* flag.
+if [ "$__GYP_CHROMIUMEFL_TARGET" == "desktop" ]; then
+ target=desktop
+elif echo "$@" | grep -cq '\-\Dbuilding_for_tizen_mobile=1'; then
target=mobile
-fi
-if echo "$@" | grep -cq '\-\Dbuilding_for_tizen_tv=1'; then
- GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.tv.${host_arch}"
+ buildType=gbs
+elif echo "$@" | grep -cq '\-\Dbuilding_for_tizen_tv=1'; then
target=tv
+ buildType=gbs
fi
-set -e
+if [ "$__GYP_CHROMIUMEFL_TARGET" == "crosscompile" ]; then
+ buildType=crosscompile
+ EXTRA_GYP_ARGS+=" -Dedje_compiler=${TOPDIR}/out.${host_arch}/Dependencies/Root/bin/edje_cc"
+ if [ "$target" == "mobile" ]; then
+ EXTRA_GYP_ARGS+=" -Dcustom_libc_dir=/opt/usr/eglibc-2.18/lib"
+ fi
+fi
ORIGINAL_GYP_DEFINES="$GYP_DEFINES"
export GYP_DEFINES=$(echo "$GYP_DEFINES" | sed -e 's/component\s*=\s*shared_library//g')
-Dtoolkit_uses_gtk=0
"
-if [ "$target" == "desktop" ]; then
- ADDITIONAL_GYP_PARAMETERS+="-Dbuilding_for_tizen=0
+add_desktop_flags() {
+ ADDITIONAL_GYP_PARAMETERS+="-Dbuilding_for_tizen=0"
+}
+
+add_arm_flags() {
+ ADDITIONAL_GYP_PARAMETERS+="-Darmv7=1
+ -Darm_thumb=1
+ -Darm_neon=1
"
-else
+}
+
+add_tizen_flags() {
ADDITIONAL_GYP_PARAMETERS+="-Dbuilding_for_tizen=1
-Dwerror=
- -Dsysroot=
- --no-parallel
-Dpython_ver=$(getPythonVersion)
- -Dtarget_arch=$host_arch
- -Dhost_arch=$host_arch
-Denable_basic_printing=1
-Denable_print_preview=1
-Duse_kerberos=0
-Duse_gconf=0
+ -Duse_alsa=0
-Dlinux_use_bundled_gold=0
-Dlinux_use_bundled_binutils=0
-Dprebuilt_ld_gold_dir=${TOPDIR}/build/prebuild
"
+}
- if [ "${GBS_ARCH}" == "arm" ]; then
- ADDITIONAL_GYP_PARAMETERS+="-Darmv7=1
- -Darm_thumb=1
- -Darm_neon=1
- "
- fi
-
- SYSTEM_DEPS="-Duse_alsa=0
- -Duse_system_expat=1
+add_gbs_flags() {
+ ADDITIONAL_GYP_PARAMETERS+="-Dtarget_arch=$host_arch
+ -Dhost_arch=$host_arch
+ -Dsysroot=
+ --no-parallel
+ "
+ # TODO(b.kelemen): ideally crosscompile should also support system libs.
+ # Unfortunately the gbs root doesn't contain everything chromium needs.
+ SYSTEM_DEPS="-Duse_system_expat=1
-Duse_system_flac=1
-Duse_system_icu=1
-Duse_system_libjpeg=0
-Duse_system_zlib=1
"
if [ "$target" == "mobile" ]; then
- SYSTEM_DEPS+=" -Duse_system_bzip2=1
- -Duse_system_libexif=1
- -Duse_system_nspr=1
- -Duse_system_vpx=1"
+ SYSTEM_DEPS+="-Duse_system_bzip2=1
+ -Duse_system_libexif=1
+ -Duse_system_nspr=1
+ -Duse_system_vpx=1"
fi
+}
- #and replacing original files with correct ones according to $SYSTEM_DEPS
- $TOPDIR/src/build/linux/unbundle/replace_gyp_files.py $SYSTEM_DEPS
+add_cross_flags() {
+ ADDITIONAL_GYP_PARAMETERS+="-Dtarget_arch=arm
+ -Dhost_arch=$host_arch
+ -Dsysroot=$SYSROOTDIR
+ -Darm_tune=arm7
+ -Dhost_clang=0
+ "
+ # Compiling yasm with crosscompile + icecc leads to some strange errors (one file is built for target instead of host).
+ # Yasm is an assembler used only by the build (not at runtime) and it is generally available in Linux distros so let's just
+ # use it from the system.
+ ADDITIONAL_GYP_PARAMETERS+="-Duse_system_yasm=1"
+}
+
+if [ "$target" == "desktop" ]; then
+ add_desktop_flags
+else
+ add_tizen_flags
+ if [ "$target" == "mobile" -o "$target" == "tv" ]; then
+ if [ "$target_arch" == "arm" ]; then
+ add_arm_flags
+ fi
+ if [ "$buildType" == "gbs" ]; then
+ add_gbs_flags
+ elif [ "$buildType" == "crosscompile" ]; then
+ add_cross_flags
+ fi
+ fi
+ if [ "$SYSTEM_DEPS" != "" ]; then
+ #replacing original files with correct ones according to $SYSTEM_DEPS
+ $TOPDIR/src/build/linux/unbundle/replace_gyp_files.py $SYSTEM_DEPS
+ fi
fi
-set +e
set -x
${TOPDIR}/build/gyp_chromiumefl \
$COMMON_GYP_PARAMETERS \
$SYSTEM_DEPS \
$ADDITIONAL_GYP_PARAMETERS \
- $@ \
+ $EXTRA_GYP_ARGS \
${TOPDIR}/ewk/chromium-ewk.gyp
ret=$?
-if [ "$target" != "desktop" ]; then
+if [ "$SYSTEM_DEPS" != "" ]; then
# Restore gyp files to their original states not to mess up the tree permanently.
$TOPDIR/src/build/linux/unbundle/replace_gyp_files.py --undo $SYSTEM_DEPS
fi
['chromium_efl_tizen_version=="2.2.1"', {
'direct_dependent_settings': {
'include_dirs': [
- '/usr/include/sensor',
+ '<(sysroot)/usr/include/sensor',
]
}
}],
%endif
%define OUTPUT_BASE_FOLDER out.%{OUTPUT_BUILD_PROFILE_TARGET}.%{EFL_TARGET}
+export GYP_GENERATOR_OUTPUT=$PWD/%{OUTPUT_BASE_FOLDER}
#set build mode
%if 0%{?_debug_mode}
}
get_arm_strip() {
- if [ -n "$CROSS_COMPILE" -a -x "${CROSS_COMPILE}strip" ]; then
+ if [ -n "$CROSS_COMPILE" ] && type "${CROSS_COMPILE}strip" &> /dev/null; then
echo "${CROSS_COMPILE}strip"
return 0
fi