3 pushd `dirname $0` > /dev/null
4 export SCRIPTDIR=`pwd -L`
7 export TOPDIR=$(readlink -f "${SCRIPTDIR}/..")
8 if [[ -z "${CHROME_SRC}" ]]; then
9 # If $CHROME_SRC was not set, assume src subfolder in project directory is CHROME_SRC.
10 export CHROME_SRC="${TOPDIR}/src"
18 echo Applying $patchfile in $directory
19 pushd "$directory" > /dev/null
20 patch -p1 $@ < "$patchfile"
24 function getHostOs() {
25 echo $(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')
28 function getHostArch() {
29 echo $(uname -m | sed -e \
30 's/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/')
33 function getPythonVersion() {
34 echo $(python --version 2>&1 | sed -e 's/Python \([0-9]\+\.[0-9]\+\)\.[0-9]\+/\1/')
37 function setIfUndef() {
40 if [ -n "$original" ]; then
48 function hostBuldScriptUsage() {
52 Build non gbs version of chromium-efl
55 -h, --help Show this message
56 --skip-gyp Skip restore_gyp, jhbuild and gyp_chromium steps
57 --ccache configure ccache installed in your system
58 --content-shell Build content_shell application
59 --skip-ninja Skip ninja step
60 --build-ewk-unittests build ewk unittests
61 --debug build debug version of chromium-efl (in $GYP_GENERATOR_OUTPUT/Debug instead of default $GYP_GENERATOR_OUTPUT/Release)
62 -jN set number of jobs, just like with make or ninja
66 $0 --skip-gyp --ccache
72 function parseHostBuildScriptParams() {
77 export BUILD_SUBDIRECTORY=Release
79 if echo "$@" | grep -cq '\(\(\-\-help\)\|\(\-h\)\)'; then
80 hostBuldScriptUsage ${0}
83 if echo "$@" | grep -cq '\-\-skip-gyp'; then
87 if echo "$@" | grep -cq '\-\-skip-ninja'; then
91 if echo "$@" | grep -cq '\-\-content_shell'; then
92 export BUILD_CONTENT_SHELL=1
95 if echo "$@" | grep -cq '\-\-ccache'; then
98 source $TOPDIR/build/ccache_env.sh ${1}
101 if echo "$@" | grep -cq '\-\-build-ewk-unittests'; then
102 export BUILD_EWK_UNITTESTS=1
104 if echo "$@" | grep -cq '\-\-debug'; then
105 export BUILD_SUBDIRECTORY=Debug
107 # Will be empty string if -j not specified or ill-formatted, otherwise -j and the number argument together.
108 # \grep because folks often alias grep but we want the vanilla behavior.
109 export JOBS=$(echo "$@" | \grep -Eo '\-j\s*[1-9]([0-9]*)')
113 function hostGypChromiumEfl() {
114 if [ "$SKIP_GYP" == "0" ]; then
115 ${TOPDIR}/build/gyp_chromiumefl.sh $@
119 function hostNinja() {
120 if [ "$SKIP_NINJA" == "0" ]; then
121 TARGETS="chromium-efl efl_webprocess chromium-ewk efl_webview_app"
122 if [ "$BUILD_EWK_UNITTESTS" == "1" ]; then
123 TARGETS="$TARGETS ewk_unittests"
125 if [ "$BUILD_CONTENT_SHELL" == "1" ]; then
126 TARGETS="$TARGETS content_shell_efl"
128 BUILDDIR=${GYP_GENERATOR_OUTPUT}/${BUILD_SUBDIRECTORY}
129 ninja -C $BUILDDIR ${JOBS} ${TARGETS}
133 function error_report() {
134 echo "Error: File:$1 Line:$2"