3 source $(dirname $0)/common.sh
4 trap 'error_report $0 $LINENO' ERR SIGINT SIGTERM SIGQUIT
5 host_arch=$(getHostArch)
7 supported_targets=("mobile" "tv" "desktop")
9 if [ -z "$GYP_GENERATOR_OUTPUT" ]; then
10 GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
15 # __GYP_CHROMIUMEFL_TARGET is defined when we are called from build_desktop.sh.
16 # Otherwise we are called by gbs whch already passes the correct building_for_* flag.
17 if [ "$__GYP_CHROMIUMEFL_TARGET" == "desktop" ]; then
21 while [[ $# > 0 ]]; do
23 -Dbuilding_for_tizen_*=1)
25 target=$(echo $1 | sed -e 's#-Dbuilding_for_tizen_\([a-z]*\)\=1#\1#')
27 -Dchromium_efl_tizen_version=*)
28 tizen_version=$(echo $1 | sed -e 's#-Dchromium_efl_tizen_version\=\([0-9.]*\)#\1#')
34 findElementInArray "$target" "${supported_targets[@]}"
35 if [[ $? == 1 ]]; then
36 echo "Unsupported target: $target"
40 if [ "$__GYP_CHROMIUMEFL_TARGET" == "crosscompile" ]; then
41 buildType=crosscompile
42 EXTRA_GYP_ARGS+=" -Dedje_compiler=${TOPDIR}/out.${host_arch}/Dependencies/Root/bin/edje_cc"
43 if [ "$target" == "mobile" ]; then
44 EXTRA_GYP_ARGS+=" -Dcustom_libc_dir=/opt/usr/eglibc-2.18/lib"
48 ORIGINAL_GYP_DEFINES="$GYP_DEFINES"
49 export GYP_DEFINES=$(echo "$GYP_DEFINES" | sed -e 's/component\s*=\s*shared_library//g')
50 if [ "$ORIGINAL_GYP_DEFINES" != "$GYP_DEFINES" ]; then
51 echo "WARNING: component build is not supported."
52 echo "Removing component=shared_library from GYP_DEFINES."
55 COMMON_GYP_PARAMETERS="
57 -Dproprietary_codecs=1
63 -Dtizen_multimedia_support=1
68 -Ddisable_fatal_linker_warnings=
72 ADDITIONAL_GYP_PARAMETERS+="-Dbuilding_for_tizen=0
73 -Dbuilding_for_tizen_mobile=0
74 -Dbuilding_for_tizen_tv=0
76 -Dtizen_multimedia_use_capi_for_me=0
82 ADDITIONAL_GYP_PARAMETERS+="-Darmv7=1
89 ADDITIONAL_GYP_PARAMETERS+="-Dbuilding_for_tizen=1
92 -Dpython_ver=$(getPythonVersion)
93 -Denable_basic_printing=1
94 -Denable_print_preview=1
99 -Dlinux_use_bundled_gold=0
100 -Dlinux_use_gold_flags=0
101 -Dlinux_use_bundled_binutils=0
103 -Dprebuilt_ld_gold_dir=${TOPDIR}/tizen_src/build/prebuild
105 if [ "$target" == "mobile" ]; then
106 ADDITIONAL_GYP_PARAMETERS+="-Dtizen_multimedia_use_capi_for_me=0
108 elif [ "$target" == "tv" ] && [ "$tizen_version" != "3.0" ]; then
109 ADDITIONAL_GYP_PARAMETERS+="-Dtizen_multimedia_use_capi_for_me=1
112 ADDITIONAL_GYP_PARAMETERS+="-Dtizen_multimedia_use_capi_for_me=0
118 ADDITIONAL_GYP_PARAMETERS+="-Dtarget_arch=$host_arch
119 -Dhost_arch=$host_arch
123 # TODO(b.kelemen): ideally crosscompile should also support system libs.
124 # Unfortunately the gbs root doesn't contain everything chromium needs.
125 SYSTEM_DEPS="-Duse_system_expat=1
128 -Duse_system_libjpeg=0
129 -Duse_system_libpng=1
130 -Duse_system_libusb=1
131 -Duse_system_libxml=1
132 -Duse_system_libxslt=1
133 -Duse_system_minizip=1
137 if [ "$target" == "mobile" ]; then
138 SYSTEM_DEPS+="-Duse_system_bzip2=1
139 -Duse_system_libexif=1
146 ADDITIONAL_GYP_PARAMETERS+="-Dtarget_arch=arm
147 -Dhost_arch=$host_arch
148 -Dsysroot=$SYSROOTDIR
153 # Compiling yasm with crosscompile + icecc leads to some strange errors (one file is built for target instead of host).
154 # Yasm is an assembler used only by the build (not at runtime) and it is generally available in Linux distros so let's just
155 # use it from the system.
156 ADDITIONAL_GYP_PARAMETERS+="-Duse_system_yasm=1"
159 if [ "$target" == "desktop" ]; then
163 if [ "$target" == "mobile" -o "$target" == "tv" ]; then
164 if [ "$target_arch" == "arm" ]; then
167 if [ "$buildType" == "gbs" ]; then
169 elif [ "$buildType" == "crosscompile" ]; then
173 if [ "$SYSTEM_DEPS" != "" ]; then
174 #replacing original files with correct ones according to $SYSTEM_DEPS
175 $TOPDIR/build/linux/unbundle/replace_gyp_files.py $SYSTEM_DEPS
180 $COMMON_GYP_PARAMETERS
182 $ADDITIONAL_GYP_PARAMETERS
185 printf "GYP_ARGUMENTS:\n"
186 for arg in $_GYP_ARGS; do
187 printf " * ${arg##-D}\n"
190 ${TOPDIR}/tizen_src/build/gyp_chromiumefl \
192 ${TOPDIR}/tizen_src/ewk/chromium-ewk.gyp \
193 ${TOPDIR}/xwalk/xwalk.gyp
197 if [ "$SYSTEM_DEPS" != "" ]; then
198 # Restore gyp files to their original states not to mess up the tree permanently.
199 $TOPDIR/build/linux/unbundle/replace_gyp_files.py --undo $SYSTEM_DEPS