#!/bin/sh

set -f
set -e

[ ! -z ${EXEC_MODE} ] || EXEC_MODE=false

topdir="${PWD}"


main_()
{
    cat<<EOF
#
# WARNING: This helper script is DISCOURAGED to be used
#
#  Instead please use the supported build tool "scons"
#
#  However in some specific cases it's not possible
#  so this script is providing a fallback option.
#
#  Reminder: it's not safe to access online resources at build time,
#  so by default the script will tell what to do (like scons),
#  to enable tasks executions it should be run with EXEC_MODE enabled:
#
#  EXEC_MODE=true ./prep.sh
#
#  More details at:
#  https://wiki.iotivity.org/build
#
EOF

    whereis bash > /dev/null || echo "error: please install: bash"
    whereis git > /dev/null || echo "error: please install: git"
    whereis unzip > /dev/null || echo "error: please install: unzip"
    whereis wget > /dev/null || echo "error: please install: wget"

    find ./extlibs/ -maxdepth 2 -a -iname "prep.sh" | xargs -n1 bash
}


main_

#!/bin/sh

set -f
set -e

[ ! -z ${EXEC_MODE} ] || EXEC_MODE=false

topdir="${PWD}"


main_()
{
    cat<<EOF
#
# WARNING: This helper script is DISCOURAGED to be used
#
#  Instead please use the supported build tool "scons"
#
#  However in some specific cases it's not possible
#  so this script is providing a fallback option.
#
#  Reminder: it's not safe to access online resources at build time,
#  so by default the script will tell what to do (like scons),
#  to enable tasks executions it should be run with EXEC_MODE enabled:
#
#  EXEC_MODE=true ./prep.sh
#
#  More details at:
#  https://wiki.iotivity.org/build
#
EOF

    which bash > /dev/null
    which git > /dev/null
    which unzip > /dev/null
    which wget > /dev/null

    find ./extlibs/ -maxdepth 2 -a -iname "prep.sh" | xargs -n1 bash
}


main_

--- 
+++ 
@@ -30,10 +30,10 @@
 #
 EOF
 
-    which bash > /dev/null
-    which git > /dev/null
-    which unzip > /dev/null
-    which wget > /dev/null
+    whereis bash > /dev/null || echo "error: please install: bash"
+    whereis git > /dev/null || echo "error: please install: git"
+    whereis unzip > /dev/null || echo "error: please install: unzip"
+    whereis wget > /dev/null || echo "error: please install: wget"
 
     find ./extlibs/ -maxdepth 2 -a -iname "prep.sh" | xargs -n1 bash
 }
build: Use whereis instead of which

This was needed for Tizen

Change-Id: I0273e51b9faccbb5ddc86959935654676890e7c6
Signed-off-by: Philippe Coval <ff46fec9739d31cce915aabcc3a7a2c00eee4d6c@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18853
Reviewed-by: Kevin Kane <cd40c34e976f30c9e62efcf24e04c516bc3a3b05@microsoft.com>
Tested-by: jenkins-iotivity <d95b56ce41a2e1ac4cecdd398defd7414407cc08@iotivity.org>
Reviewed-by: Dan Mihai <ba8e1833495515b49ded9e20cae80a8129155aa9@microsoft.com>
Reviewed-by: Dave Thaler <8a98d0850f57b73c42d096f8f8b11e2d5522d554@microsoft.com>
