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}"
13 if [ -z "$GYP_GENERATOR_FLAGS" ]; then
14 export GYP_GENERATOR_FLAGS="output_dir=${GYP_GENERATOR_OUTPUT}"
19 # __GYP_CHROMIUMEFL_TARGET is defined when we are called from build_desktop.sh.
20 # Otherwise we are called by gbs whch already passes the correct building_for_* flag.
21 if [ "$__GYP_CHROMIUMEFL_TARGET" == "desktop" ]; then
25 while [[ $# > 0 ]]; do
27 -Dbuilding_for_tizen_*=1)
29 target=$(echo $1 | sed -e 's#-Dbuilding_for_tizen_\([a-z]*\)\=1#\1#')
31 -Dchromium_efl_tizen_version=*)
32 tizen_version=$(echo $1 | sed -e 's#-Dchromium_efl_tizen_version\=\([0-9.]*\)#\1#')
34 -Dtizen_emulator_support=1)
35 tizen_emulator_support=1
43 -Dbuilding_crosswalk_bin=*)
44 building_xwalk_for_development=1
50 findElementInArray "$target" "${supported_targets[@]}"
51 if [[ $? == 1 ]]; then
52 echo "Unsupported target: $target"
56 if [ "$__GYP_CHROMIUMEFL_TARGET" == "crosscompile" ]; then
57 buildType=crosscompile
58 EXTRA_GYP_ARGS+=" -Dedje_compiler=${TOPDIR}/out.${host_arch}/Dependencies/Root/bin/edje_cc"
61 ORIGINAL_GYP_DEFINES="$GYP_DEFINES"
62 export GYP_DEFINES=$(echo "$GYP_DEFINES" | sed -e 's/component\s*=\s*shared_library//g')
63 if [ "$ORIGINAL_GYP_DEFINES" != "$GYP_DEFINES" ]; then
64 echo "WARNING: component build is not supported."
65 echo "Removing component=shared_library from GYP_DEFINES."
68 COMMON_GYP_PARAMETERS="
70 -Dproprietary_codecs=1
77 -Dozone_auto_platforms=0
78 -Dozone_platform_wayland=0
87 -Ddisable_fatal_linker_warnings=
91 if [ "$building_xwalk" == "1" ] && [ "$building_xwalk_for_development" != "1" ]; then
92 COMMON_GYP_PARAMETERS+="
93 -Dxwalk_link_against_chromium_ewk=1
98 ADDITIONAL_GYP_PARAMETERS+="-Dbuilding_for_tizen=0
99 -Dbuilding_for_tizen_mobile=0
100 -Dbuilding_for_tizen_tv=0
109 ADDITIONAL_GYP_PARAMETERS+="-Darmv7=1
116 ADDITIONAL_GYP_PARAMETERS+="-Dbuilding_for_tizen=1
118 -Dpython_ver=$(getPythonVersion)
119 -Denable_basic_printing=1
120 -Denable_print_preview=1
122 -Dlinux_use_bundled_gold=0
123 -Dlinux_use_bundled_binutils=0
125 -Dtizen_multimedia_eme_support=0
128 # TODO(youngsoo): Once binutils-gold issue on tizen v3.0 ARM 64bit is fixed,
129 # make the latest tizen version unconditional.
130 if [ "$tizen_version" == "3.0" ] && [ "$host_arch" == "arm" ]; then
131 # [M48_2564] Temporary disabling the flag for switching to new chromium
132 # FIXME: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=15383
133 ADDITIONAL_GYP_PARAMETERS+="-Dlinux_use_gold_flags=0
134 -Dprebuilt_ld_gold_dir=${TOPDIR}/tizen_src/build/prebuild
136 elif [ "$tizen_version" == "2.4" -a "$target" == "tv" ]; then
137 ADDITIONAL_GYP_PARAMETERS+="-Dlinux_use_gold_flags=0
138 -Dprebuilt_ld_gold_dir=${TOPDIR}/tizen_src/build/prebuild/tizen_v2.4_tv
141 ADDITIONAL_GYP_PARAMETERS+="-Dlinux_use_gold_flags=0
142 -Dprebuilt_ld_gold_dir=${TOPDIR}/tizen_src/build/prebuild
146 if [ "$tizen_version" == "3.0" ]; then
147 # [M49_2623] Temporary disabling the flag.
148 # FIXME: http://165.213.149.170/jira/browse/TWF-610
149 ADDITIONAL_GYP_PARAMETERS+="-Dtizen_multimedia_support=0
150 -Dtizen_tbm_support=0
153 ADDITIONAL_GYP_PARAMETERS+="-Dtizen_multimedia_support=0
161 add_wayland_flags() {
162 if [ "$use_wayland" == "1" ]; then
163 ADDITIONAL_GYP_PARAMETERS+="-Duse_wayland=1
167 ADDITIONAL_GYP_PARAMETERS+="-Duse_wayland=0
174 ADDITIONAL_GYP_PARAMETERS+="-Dtarget_arch=$host_arch
175 -Dhost_arch=$host_arch
179 # TODO(b.kelemen): ideally crosscompile should also support system libs.
180 # Unfortunately the gbs root doesn't contain everything chromium needs.
181 SYSTEM_DEPS="-Duse_system_expat=1
182 -Duse_system_libjpeg=0
183 -Duse_system_libpng=1
184 -Duse_system_libusb=1
185 -Duse_system_libxml=1
186 -Duse_system_libxslt=1
190 # [M50_2661] Temporary using the icu of internal chformium instead of system.
191 # The icu of system doesn't support utrie2.h
192 # FIXME: http://suprem.sec.samsung.net/jira/browse/TWF-967
193 SYSTEM_DEPS+="-Duse_system_icu=0
196 if [ "$target" == "mobile" ]; then
197 SYSTEM_DEPS+="-Duse_system_bzip2=1
198 -Duse_system_libexif=1
205 ADDITIONAL_GYP_PARAMETERS+="-Dtarget_arch=arm
206 -Dhost_arch=$host_arch
207 -Dsysroot=$SYSROOTDIR
212 # Compiling yasm with crosscompile + icecc leads to some strange errors (one file is built for target instead of host).
213 # Yasm is an assembler used only by the build (not at runtime) and it is generally available in Linux distros so let's just
214 # use it from the system.
215 ADDITIONAL_GYP_PARAMETERS+="-Duse_system_yasm=1"
218 if [ "$target" == "desktop" ]; then
222 if [ "$target" == "mobile" -o "$target" == "tv" ]; then
223 if [ "$target_arch" == "arm" ]; then
226 if [ "$buildType" == "gbs" ]; then
228 elif [ "$buildType" == "crosscompile" ]; then
232 if [ "$SYSTEM_DEPS" != "" ]; then
233 #replacing original files with correct ones according to $SYSTEM_DEPS
234 $TOPDIR/build/linux/unbundle/replace_gyp_files.py $SYSTEM_DEPS
239 $COMMON_GYP_PARAMETERS
241 $ADDITIONAL_GYP_PARAMETERS
244 printf "GYP_ARGUMENTS:\n"
245 for arg in $_GYP_ARGS; do
246 printf " * ${arg##-D}\n"
249 ${TOPDIR}/tizen_src/build/gyp_chromiumefl \
251 ${TOPDIR}/tizen_src/ewk/chromium-ewk.gyp
255 if [ "$SYSTEM_DEPS" != "" ]; then
256 # Restore gyp files to their original states not to mess up the tree permanently.
257 $TOPDIR/build/linux/unbundle/replace_gyp_files.py --undo $SYSTEM_DEPS