5 [ ! -z ${EXEC_MODE} ] || EXEC_MODE=false
13 echo "warning: fetching online resources may not be reproductible"
14 printf "%s\n" "trying: \"$@\""
17 echo "# Please manually execute from shell:"
29 # WARNING: This helper script is DISCOURAGED to be used
31 # Instead please use the supported build tool "scons"
33 # However in some specific cases it's not possible
34 # so this script is providing a fallback option.
36 # Reminder: it's not safe to access online resources at build time,
37 # so by default the script will tell what to do (like scons),
38 # to enable tasks executions it should be run with EXEC_MODE enabled:
40 # EXEC_MODE=true ./prep.sh
43 # https://wiki.iotivity.org/build
48 which unzip > /dev/null
49 which wget > /dev/null
51 echo "# Checking for tinycbor presence:"
52 tinycbor_url='https://github.com/01org/tinycbor.git'
54 if [ ! -e 'extlibs/tinycbor/tinycbor' ] ; then
55 do_ "git clone --depth 1 -b "${tinycbor_rev}" "$tinycbor_url" extlibs/tinycbor/tinycbor"
58 echo "# Checking for gtest presence:"
59 gtest_url='http://pkgs.fedoraproject.org/repo/pkgs/gtest/gtest-1.7.0.zip/2d6ec8ccdf5c46b05ba54a9fd1d130d7/gtest-1.7.0.zip'
60 gtest_dir="${topdir}/extlibs/gtest/"
61 gtest_archive=$(basename -- "${gtest_url}")
62 gtest_file="${gtest_dir}/gtest-1.7.0/CMakeLists.txt"
63 if [ ! -e "${gtest_file}" ] ; then
64 do_ "cd ${gtest_dir} && wget -nc -O ${gtest_archive} ${gtest_url} && unzip ${gtest_archive}"
68 echo "# Checking for sqlite presence:"
69 sqlite_url='http://www.sqlite.org/2015/sqlite-amalgamation-3081101.zip'
70 sqlite_dir="${topdir}/extlibs/sqlite3"
71 sqlite_file="${sqlite_dir}/sqlite3.c"
72 sqlite_archive=$(basename -- "${sqlite_url}")
73 if [ ! -e 'extlibs/sqlite3/$sqlite_file' ] ; then
74 do_ "cd ${sqlite_dir} && wget -nc $sqlite_url && unzip ${sqlite_archive} && mv */* ."
78 echo "# Checking for mbedtls presence:"
79 mbedtls_url='https://github.com/ARMmbed/mbedtls.git'
80 mbedtls_dir="${topdir}/extlibs/mbedtls/mbedtls"
81 mbedtls_rev="ad249f509fd62a3bbea7ccd1fef605dbd482a7bd" # in "yotta-2.3.2"
82 if [ ! -e "${mbedtls_dir}" ] ; then
83 do_ "git clone ${mbedtls_url} ${mbedtls_dir}"
86 do_ "git reset --hard ${mbedtls_rev}"
87 echo "# Checking for mbedtls patches:"
88 file="${mbedtls_dir}/../ocf.patch"
89 do_ "git apply ${file}" ||: