target_os = env.get('TARGET_OS')
root_dir = env.get('SRC_DIR')
mbedtls_dir = os.path.join(root_dir, 'extlibs','mbedtls','mbedtls/')
-mbedtls_revision = 'ad249f509fd62a3bbea7ccd1fef605dbd482a7bd'
+# Right now this script assumes the revision is a tag, and not a branch or an arbitrary
+# commit. If this changes, update the check below, or else the script will always conclude
+# the repo is not up to date because a tag with that name doesn't exist.
+mbedtls_revision = 'mbedtls-2.4.0'
if not os.path.exists(mbedtls_dir):
print '''
***********************************************************************************
'''
Exit(1)
+
+# Tizen uses its own process to prepare the mbedTLS repo in gbsbuild.sh. Make sure
+# the mbedtls_revision tag selected is the same as in extlibs/mbedtls/prep.sh.
+# This code also assumes mbedtls_revision is a tag; if it changes to
+# a branch or an arbitrary commit, disable this check below.
+if target_os != 'tizen':
+ if not os.path.exists(os.path.join(mbedtls_dir, '.git', 'refs', 'tags', mbedtls_revision)):
+ print '''
+*********************************** Error: ****************************************
+* Your mbedTLS repo is not up to date with the latest version we require. Please *
+* update with the following commands: *
+* $ cd extlibs/mbedtls/mbedtls *
+* $ git fetch *
+***********************************************************************************
+ '''
+ Exit(1)
+
start_dir = os.getcwd()
os.chdir(mbedtls_dir)
# Apply ocf patch on git revision
######################################################################
mbedtls_src = [
'mbedtls/library/debug.c',
- 'mbedtls/library/net.c',
+ 'mbedtls/library/net_sockets.c',
'mbedtls/library/ssl_cache.c',
'mbedtls/library/ssl_ciphersuites.c',
'mbedtls/library/ssl_cli.c',