Switch to the branch dev/m38_2125
[platform/framework/web/chromium-efl.git] / tizen_src / build / gyp_chromiumefl.sh
1 #!/bin/bash
2
3 SCRIPTDIR=$( cd $(dirname $0) ; pwd -P )
4 TOPDIR=$( cd ${SCRIPTDIR}/.. ; pwd -P )
5
6 source ${SCRIPTDIR}/common.sh
7
8 host_arch=$(getHostArch)
9 target=desktop
10
11 #need to be exported because it is used by jhbuild
12 export GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
13
14 if echo "$@" | grep -cq '\-\Dbuilding_for_tizen_mobile=1'; then
15   GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.mobile.${host_arch}"
16   target=mobile
17 fi
18 if echo "$@" | grep -cq '\-\Dbuilding_for_tizen_tv=1'; then
19   GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.tv.${host_arch}"
20   target=tv
21 fi
22
23 if [ "$target" == "desktop" ]; then
24   JHBUILD_DEPS="${GYP_GENERATOR_OUTPUT}/Dependencies/Root"
25
26   if [ "${host_arch}" == "x64" ]; then
27     _LIBDIR=lib64
28   elif [ "${host_arch}" == "ia32" ]; then
29     _LIBDIR=lib
30   fi
31
32   export PKG_CONFIG_PATH="${JHBUILD_DEPS}/${_LIBDIR}/pkgconfig"
33 fi
34
35 set -e
36
37 if [ ! -e ${TOPDIR}/src/build/util/LASTCHANGE.blink ]; then
38   ${TOPDIR}/src/build/util/lastchange.py -s ${TOPDIR}/src/third_party/WebKit -o ${TOPDIR}/src/build/util/LASTCHANGE.blink
39 fi
40
41 COMMON_GYP_PARAMETERS="--depth=${TOPDIR}/src
42                       -I${TOPDIR}/impl/chromium-efl.gypi
43                       --generator-output ${GYP_GENERATOR_OUTPUT}
44                       --format=ninja
45                       --check
46                       -Goutput_dir=${GYP_GENERATOR_OUTPUT}
47                       -Dchrome_src_dir=${TOPDIR}/src
48                       -Defl_impl_dir=${TOPDIR}/impl
49                       -Duse_libjpeg_turbo=0
50                       -Dproprietary_codecs=1
51                       -Dclang=0
52                       -Duse_aura=1
53                       "
54
55 #reverting back origin files
56 ${SCRIPTDIR}/restore_gyp.sh
57
58 if [ "$target" == "desktop" ]; then
59   ADDITIONAL_GYP_PARAMETERS+="-Dbuilding_for_tizen=0
60                              "
61 else
62   ADDITIONAL_GYP_PARAMETERS+="-Dbuilding_for_tizen=1
63                               -Duse_gstreamer=1
64                               -Dwerror=
65                               -Dsysroot=
66                               --no-parallel
67                               -Dpython_ver=$(getPythonVersion)
68                               -Dtarget_arch=$host_arch
69                               -Dhost_arch=$host_arch
70                               -Denable_printing=0
71                               -Duse_kerberos=0
72                              "
73
74   if [ "${GBS_ARCH}" == "arm" ]; then
75     ADDITIONAL_GYP_PARAMETERS+="-Darmv7=1
76                                 -Darm_thumb=1
77                                 -Darm_neon=1
78                                "
79   fi
80
81   SYSTEM_DEPS="-Duse_alsa=0
82                -Duse_system_expat=1
83                -Duse_system_flac=1
84                -Duse_system_icu=1
85                -Duse_system_libjpeg=1
86                -Duse_system_libpng=1
87                -Duse_system_libusb=1
88                -Duse_system_libxml=1
89                -Duse_system_libxslt=1
90                -Duse_system_minizip=1
91                -Duse_system_speex=1
92                -Duse_system_zlib=1
93               "
94   if [ "$target" == "mobile" ]; then
95       SYSTEM_DEPS+=" -Duse_system_bzip2=1
96                      -Duse_system_libexif=1
97                      -Duse_system_nspr=1
98                      -Duse_system_vpx=1"
99   fi
100
101   #and replacing original files with correct ones according to $SYSTEM_DEPS
102   $TOPDIR/src/build/linux/unbundle/replace_gyp_files.py $SYSTEM_DEPS
103
104 fi
105
106
107 if [ "$target" == "desktop" ]; then
108   jhbuild --no-interact -f ${SCRIPTDIR}/jhbuild/jhbuildrc
109 fi
110
111 set -x
112 ${TOPDIR}/build/gyp_chromiumefl \
113                                  $COMMON_GYP_PARAMETERS \
114                                  $SYSTEM_DEPS \
115                                  $ADDITIONAL_GYP_PARAMETERS \
116                                  $@ \
117                                  ${TOPDIR}/impl/chromium-efl.gyp