mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-16 08:42:50 +00:00
fix build fail
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
9817e3e621
commit
0cb2cf6cb4
@ -281,6 +281,7 @@ def generate_ssl_debug_helpers(output_directory, mbedtls_root):
|
|||||||
"""
|
"""
|
||||||
Generate functions of debug helps
|
Generate functions of debug helps
|
||||||
"""
|
"""
|
||||||
|
mbedtls_root = os.path.abspath(mbedtls_root or build_tree.guess_mbedtls_root())
|
||||||
with open(os.path.join(mbedtls_root, 'include/mbedtls/ssl.h')) as f:
|
with open(os.path.join(mbedtls_root, 'include/mbedtls/ssl.h')) as f:
|
||||||
source_code = remove_c_comments(f.read())
|
source_code = remove_c_comments(f.read())
|
||||||
|
|
||||||
@ -319,7 +320,7 @@ def main():
|
|||||||
Command line entry
|
Command line entry
|
||||||
"""
|
"""
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--mbedtls-root', nargs='?', default=build_tree.guess_mbedtls_root(),
|
parser.add_argument('--mbedtls-root', nargs='?', default=None,
|
||||||
help='root directory of mbedtls source code')
|
help='root directory of mbedtls source code')
|
||||||
parser.add_argument('output_directory', nargs='?',
|
parser.add_argument('output_directory', nargs='?',
|
||||||
default='library', help='source/header files location')
|
default='library', help='source/header files location')
|
||||||
|
@ -47,9 +47,10 @@ def guess_mbedtls_root():
|
|||||||
Return the first possible mbedTLS root directory
|
Return the first possible mbedTLS root directory
|
||||||
"""
|
"""
|
||||||
dirs = set({})
|
dirs = set({})
|
||||||
for i in inspect.stack():
|
for frame in inspect.stack():
|
||||||
path = os.path.dirname(i.filename)
|
path = os.path.dirname(frame.filename)
|
||||||
for d in ['.', os.path.pardir, os.path.join(*([os.path.pardir]*2))]:
|
for d in ['.', os.path.pardir] \
|
||||||
|
+ [os.path.join(*([os.path.pardir]*i)) for i in range(2, 10)]:
|
||||||
d = os.path.abspath(os.path.join(path, d))
|
d = os.path.abspath(os.path.join(path, d))
|
||||||
if d in dirs:
|
if d in dirs:
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user