3 SCRIPTDIR=$( cd $(dirname $0) ; pwd -P )
4 TOPDIR=$( cd ${SCRIPTDIR}/.. ; pwd -P )
6 source ${SCRIPTDIR}/common.sh
8 host_arch=$(getHostArch)
10 export GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
16 Build desktop version of chromium-efl
19 -h, --help Show this message
20 --skip-gyp Skip restore_gyp, jhbuild and gyp_chromium steps
21 --ccache configure ccache installed in your system
22 --skip-ninja Skip ninja step
23 --build-ewk-unittests build ewk unittests
24 --debug build debug version of chromium-efl (in $GYP_GENERATOR_OUTPUT/Debug instead of default $GYP_GENERATOR_OUTPUT/Release)
25 -jN set number of jobs, just like with make or ninja
29 $0 --skip-gyp --ccache
39 BUILD_SUBDIRECTORY=Release
41 if echo "$@" | grep -cq '\(\(\-\-help\)\|\(\-h\)\)'; then
45 if echo "$@" | grep -cq '\-\-skip-gyp'; then
49 if echo "$@" | grep -cq '\-\-skip-ninja'; then
53 if echo "$@" | grep -cq '\-\-ccache'; then
57 if echo "$@" | grep -cq '\-\-build_ewk_unittests'; then
61 JHBUILD_STAMPFILE="${GYP_GENERATOR_OUTPUT}/Dependencies/Root/jhbuild.stamp"
63 shouldForceJHBuild() {
64 if echo "$@" | grep -cq '\-\-force-jhbuild'; then
68 # Check if anything in jhbuild is more recent than stamp file.
69 for i in $(find "$SCRIPTDIR/jhbuild"); do
70 if [ -f "$i" -a "$JHBUILD_STAMPFILE" -ot "$i" ]; then
78 if [ "$(shouldForceJHBuild $@)" == "1" ]; then
79 rm -f $JHBUILD_STAMPFILE
82 if echo "$@" | grep -cq '\-\-debug'; then
83 BUILD_SUBDIRECTORY=Debug
86 # Will be empty string if -j not specified or ill-formatted, otherwise -j and the number argument together.
87 # \grep because folks often alias grep but we want the vanilla behavior.
88 JOBS=$(echo "$@" | \grep -Eo '\-j\s*[1-9]([0-9]*)')
92 JHBUILD_DEPS="${GYP_GENERATOR_OUTPUT}/Dependencies/Root"
93 if [ "${host_arch}" == "x64" ]; then
95 elif [ "${host_arch}" == "ia32" ]; then
98 export PKG_CONFIG_PATH="${JHBUILD_DEPS}/${_LIBDIR}/pkgconfig"
100 if [ ! -f "$JHBUILD_STAMPFILE" ]; then
101 jhbuild --no-interact -f ${SCRIPTDIR}/jhbuild/jhbuildrc
103 if [ "$?" == "0" ]; then
104 echo "Yay! jhbuild done!" > $JHBUILD_STAMPFILE
108 if [ "$SKIP_GYP" == "0" ]; then
109 ${TOPDIR}/build/gyp_chromiumefl.sh
112 if [ "$SKIP_NINJA" == "0" ]; then
113 if [ "$USE_CCACHE" == "1" ]; then
116 source $TOPDIR/build/ccache_env.sh desktop
119 export LD_LIBRARY_PATH="${JHBUILD_DEPS}/${_LIBDIR}:$LD_LIBRARY_PATH"
120 export PATH="${JHBUILD_DEPS}/bin:$PATH"
122 TARGETS="chromium-efl efl_webprocess chromium-ewk efl_webview_app"
123 if [ "$BUILD_EWK_UNITTESTS" == "1" ]; then
124 TARGETS = "$TARGETS ewk_unittests"
127 ninja -C ${GYP_GENERATOR_OUTPUT}/${BUILD_SUBDIRECTORY} ${JOBS} ${TARGETS}