3 source $(dirname $0)/common.sh
4 trap 'error_report $0 $LINENO' ERR SIGINT SIGTERM SIGQUIT
5 host_arch=$(getHostArch)
7 if [ -z "$GYP_GENERATOR_OUTPUT" ]; then
8 GYP_GENERATOR_OUTPUT=${TOPDIR}/"out.${host_arch}"
13 # __GYP_CHROMIUMEFL_TARGET is defined when we are called from build_desktop.sh.
14 # Otherwise we are called by gbs whch already passes the correct building_for_* flag.
15 if [ "$__GYP_CHROMIUMEFL_TARGET" == "desktop" ]; then
17 elif echo "$@" | grep -cq '\-\Dbuilding_for_tizen_mobile=1'; then
20 elif echo "$@" | grep -cq '\-\Dbuilding_for_tizen_tv=1'; then
25 if [ "$__GYP_CHROMIUMEFL_TARGET" == "crosscompile" ]; then
26 buildType=crosscompile
27 EXTRA_GYP_ARGS+=" -Dedje_compiler=${TOPDIR}/out.${host_arch}/Dependencies/Root/bin/edje_cc"
28 if [ "$target" == "mobile" ]; then
29 EXTRA_GYP_ARGS+=" -Dcustom_libc_dir=/opt/usr/eglibc-2.18/lib"
33 ORIGINAL_GYP_DEFINES="$GYP_DEFINES"
34 export GYP_DEFINES=$(echo "$GYP_DEFINES" | sed -e 's/component\s*=\s*shared_library//g')
35 if [ "$ORIGINAL_GYP_DEFINES" != "$GYP_DEFINES" ]; then
36 echo "WARNING: component build is not supported."
37 echo "Removing component=shared_library from GYP_DEFINES."
40 COMMON_GYP_PARAMETERS="
42 -Dproprietary_codecs=1
43 -Dtizen_multimedia_support=1
49 if [[ $BUILD_CONTENT_SHELL == 1 ]]; then
50 COMMON_GYP_PARAMETERS+="-Dchromium_efl_library_type=static_library"
54 ADDITIONAL_GYP_PARAMETERS+="-Dbuilding_for_tizen=0
56 -Dmake_clang_dir=${CLANG_DIR}
61 ADDITIONAL_GYP_PARAMETERS+="-Darmv7=1
68 ADDITIONAL_GYP_PARAMETERS+="-Dbuilding_for_tizen=1
70 -Dpython_ver=$(getPythonVersion)
71 -Denable_basic_printing=1
72 -Denable_print_preview=1
77 -Dlinux_use_bundled_gold=0
78 -Dlinux_use_bundled_binutils=0
79 -Dprebuilt_ld_gold_dir=${TOPDIR}/build/prebuild
84 ADDITIONAL_GYP_PARAMETERS+="-Dtarget_arch=$host_arch
85 -Dhost_arch=$host_arch
89 # TODO(b.kelemen): ideally crosscompile should also support system libs.
90 # Unfortunately the gbs root doesn't contain everything chromium needs.
91 SYSTEM_DEPS="-Duse_system_expat=1
94 -Duse_system_libjpeg=0
98 -Duse_system_libxslt=1
99 -Duse_system_minizip=1
103 if [ "$target" == "mobile" ]; then
104 SYSTEM_DEPS+="-Duse_system_bzip2=1
105 -Duse_system_libexif=1
112 ADDITIONAL_GYP_PARAMETERS+="-Dtarget_arch=arm
113 -Dhost_arch=$host_arch
114 -Dsysroot=$SYSROOTDIR
119 # Compiling yasm with crosscompile + icecc leads to some strange errors (one file is built for target instead of host).
120 # Yasm is an assembler used only by the build (not at runtime) and it is generally available in Linux distros so let's just
121 # use it from the system.
122 ADDITIONAL_GYP_PARAMETERS+="-Duse_system_yasm=1"
125 if [ "$target" == "desktop" ]; then
129 if [ "$target" == "mobile" -o "$target" == "tv" ]; then
130 if [ "$target_arch" == "arm" ]; then
133 if [ "$buildType" == "gbs" ]; then
135 elif [ "$buildType" == "crosscompile" ]; then
139 if [ "$SYSTEM_DEPS" != "" ]; then
140 #replacing original files with correct ones according to $SYSTEM_DEPS
141 $TOPDIR/src/build/linux/unbundle/replace_gyp_files.py $SYSTEM_DEPS
146 ${TOPDIR}/build/gyp_chromiumefl \
147 $COMMON_GYP_PARAMETERS \
149 $ADDITIONAL_GYP_PARAMETERS \
151 ${TOPDIR}/ewk/chromium-ewk.gyp
155 if [ "$SYSTEM_DEPS" != "" ]; then
156 # Restore gyp files to their original states not to mess up the tree permanently.
157 $TOPDIR/src/build/linux/unbundle/replace_gyp_files.py --undo $SYSTEM_DEPS