Refactoring of build scripts
authorTomasz Olszak <t.olszak@samsung.com>
Fri, 25 Jul 2014 10:32:57 +0000 (12:32 +0200)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
Use gyp_chromium instead of gyp_chromiumefl

Change-Id: Ib5380ce042c46f7079ba1c2731f725805e17eb87

tizen_src/build/ccache_env.sh [new file with mode: 0644]
tizen_src/build/common.sh
tizen_src/build/prebuild_desktop.sh
tizen_src/build/restore_gyp.sh

diff --git a/tizen_src/build/ccache_env.sh b/tizen_src/build/ccache_env.sh
new file mode 100644 (file)
index 0000000..13e4b43
--- /dev/null
@@ -0,0 +1,31 @@
+
+SCRIPTDIR=$(cd $(dirname ${BASH_SOURCE[0]}); pwd -P)
+TOPDIR=$(cd ${SCRIPTDIR}/.. ; pwd -P)
+source ${SCRIPTDIR}/common.sh
+
+function usage() {
+ echo "Usage:"
+ echo "source build/ccache_env.sh desktop|mobile|tv"
+}
+
+
+if [ "$1" == "desktop" -o  "$1" == "mobile" -o "$1" == "tv" ]; then
+  OUTPUT_BASE_FOLDER=out.${1}.$(getHostArch)
+  export CCACHE_CPP2=yes
+  export CCACHE_SLOPPINESS=time_macros
+  export CCACHE_BASEDIR=${TOPDIR}/src
+  export CCACHE_DIR=${TOPDIR}/${OUTPUT_BASE_FOLDER}.ccache
+  export CCACHE_COMPILERCHECK=content
+  CCACHESIZE=$(ccache -s | grep max | grep -oE "[0-9]+" | head -1)
+  if [ $CCACHESIZE == "1" ]; then
+     ccache -M 10
+  fi
+  ccacheInPath=$(echo $PATH | grep -c /usr/lib/ccache)
+  if [ "$ccacheInPath" == "0" -a "$1" == "desktop" ]; then
+    export PATH=/usr/lib/ccache:$PATH
+  fi
+else
+  echo "Warning! You need to pick correct profile when you include ccache_env.sh"
+  echo "ccache will not be configured"
+  usage
+fi
index ce1a347..cd221be 100644 (file)
@@ -21,3 +21,15 @@ function applyPatch {
   popd > /dev/null
 }
 
+function getHostOs() {
+  echo $(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')
+}
+
+function getHostArch() {
+  echo $(uname -m | sed -e \
+        's/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/')
+}
+
+function getPythonVersion() {
+  echo $(python --version  2>&1 | sed -e 's/Python \([0-9]\+\.[0-9]\+\)\.[0-9]\+/\1/')
+}
index 12f4393..9e0e7e0 100755 (executable)
@@ -1,10 +1,53 @@
 #!/bin/bash
 
-# excute environment setup
-. `dirname ${BASH_SOURCE[0]}`/envsetup.sh
+SCRIPTDIR=$( cd $(dirname ${BASH_SOURCE[0]}) ; pwd -P )
+TOPDIR=$( cd ${SCRIPTDIR}/.. ; pwd -P )
 
-# excute efl_jhbuild
-efl_jhbuild
+source ${SCRIPTDIR}/common.sh
 
-# excute efl_gyp
-gyp_chromiumefl
+host_arch=$(getHostArch)
+
+export GYP_GENERATOR_OUTPUT="out.${host_arch}"
+
+jhbuild --no-interact -f ${SCRIPTDIR}/jhbuild/jhbuildrc
+
+export JHBUILD_DEPS="${TOPDIR}/${GYP_GENERATOR_OUTPUT}/Dependencies/Root"
+
+if [ "${host_arch}" == "x64" ]; then
+  _LIBDIR=lib64
+elif [ "${host_arch}" == "ia32" ]; then
+  _LIBDIR=lib
+fi
+
+export PKG_CONFIG_PATH="${JHBUILD_DEPS}/${_LIBDIR}/pkgconfig"
+export LD_LIBRARY_PATH="${JHBUILD_DEPS}/${_LIBDIR}"
+export PATH="$PATH:${JHBUILD_DEPS}/bin"
+
+
+
+if [ ! -e ${TOPDIR}/src/build/util/LASTCHANGE.blink ]; then
+  ${TOPDIR}/src/build/util/lastchange.py -s ${TOPDIR}/src/third_party/WebKit -o ${TOPDIR}/src/build/util/LASTCHANGE.blink
+fi
+
+${TOPDIR}/src/build/gyp_chromium --depth=${TOPDIR}/src -I${TOPDIR}/impl/chromium-efl.gypi \
+                                 --generator-output ${TOPDIR}/${GYP_GENERATOR_OUTPUT} \
+                                 --format=ninja \
+                                 --check \
+                                 -Goutput_dir=${TOPDIR}/${GYP_GENERATOR_OUTPUT} \
+                                 -Dchrome_src_dir=${TOPDIR}/src \
+                                 -Defl_impl_dir=${TOPDIR}/impl \
+                                 -DOS=linux \
+                                 -Duse_libjpeg_turbo=0 \
+                                 -Duse_kerberos=0 \
+                                 -Denable_automation=0 \
+                                 -Dremoting=0 \
+                                 -Denable_google_now=0 \
+                                 -Denable_language_detection=0 \
+                                 -Dproprietary_codecs=1 \
+                                 -Duse_cups=0 \
+                                 -Duse_xi2_mt=2 \
+                                 -Dtoolkit_uses_gtk=0 \
+                                 -Duse_aura=1 \
+                                 -Dlinux_use_bundled_binutils=0 \
+                                 -Dclang=0 \
+                                 ${TOPDIR}/impl/chromium-efl.gyp
index bd1a20f..21d9aa6 100755 (executable)
 #   'use_system_zlib': 'third_party/zlib/zlib.gyp',
 # }
 
+SCRIPTDIR=$( cd $(dirname ${BASH_SOURCE[0]}) ; pwd -P )
+
 # get changed gyp files, above data
 CHANGE_GYP_PATH="third_party/expat/expat.gyp third_party/ffmpeg/ffmpeg.gyp third_party/flac/flac.gyp third_party/harfbuzz-ng/harfbuzz.gyp third_party/icu/icu.gyp third_party/jsoncpp/jsoncpp.gyp third_party/libevent/libevent.gyp third_party/libjpeg/libjpeg.gyp third_party/libpng/libpng.gyp third_party/libusb/libusb.gyp third_party/libvpx/libvpx.gyp third_party/libwebp/libwebp.gyp third_party/libxml/libxml.gyp third_party/libxslt/libxslt.gyp third_party/openssl/openssl.gyp third_party/opus/opus.gyp third_party/re2/re2.gyp third_party/snappy/snappy.gyp third_party/speex/speex.gyp third_party/sqlite/sqlite.gyp v8/tools/gyp/v8.gyp third_party/zlib/zlib.gyp"
 
 # move chromium root directory
-pushd ${CHROME_SRC} > /dev/null
+pushd ${SCRIPTDIR}/../src > /dev/null
 
 # git checkout each gyp files
 git checkout -- ${CHANGE_GYP_PATH}