From b46ebbf56dfe8505eec07033132cdaa2789d7a74 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Tue, 10 May 2016 09:34:05 +0800 Subject: [PATCH] [build] remove hard coded path issue in SConscript --- components/external/cairo/SConscript | 6 ++---- components/external/lzo/SConscript | 5 ++--- components/external/nanopb/SConscript | 5 ++--- components/net/SConscript | 5 +++-- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/components/external/cairo/SConscript b/components/external/cairo/SConscript index f7e0490b58..2e3b5b78cd 100644 --- a/components/external/cairo/SConscript +++ b/components/external/cairo/SConscript @@ -1,11 +1,9 @@ -Import('RTT_ROOT') -Import('rtconfig') - from building import * import os CAIRO_VERSION = '1.10.2' CAIRO_PATH = 'cairo-' + CAIRO_VERSION +cwd = GetCurrentDir() if GetDepend('RT_USING_CAIRO') and not os.path.exists(CAIRO_PATH): print '================ERROR============================' @@ -99,7 +97,7 @@ cairo.c for item in range(len(src)): src[item] = CAIRO_PATH + '/src/' + src[item] -CPPPATH = [RTT_ROOT + '/components/external/cairo/' + CAIRO_PATH + '/src', RTT_ROOT + '/components/external/cairo/'] +CPPPATH = [cwd + '/' + CAIRO_PATH + '/src', cwd] group = DefineGroup('cairo', src, depend = ['RT_USING_CAIRO', 'RT_USING_NEWLIB', 'RTGUI_IMAGE_PNG', 'RT_USING_PTHREADS'], CPPPATH = CPPPATH) Return('group') diff --git a/components/external/lzo/SConscript b/components/external/lzo/SConscript index a90ed2ec97..6b675c98ef 100644 --- a/components/external/lzo/SConscript +++ b/components/external/lzo/SConscript @@ -1,12 +1,11 @@ -Import('RTT_ROOT') -Import('rtconfig') from building import * +cwd = GetCurrentDir() src = Split(''' minilzo.c lzo.c ''') -CPPPATH = [RTT_ROOT + '/components/external/lzo'] +CPPPATH = [cwd] group = DefineGroup('lzo', src, depend = ['RT_USING_LZO'], CPPPATH = CPPPATH) diff --git a/components/external/nanopb/SConscript b/components/external/nanopb/SConscript index 66cf05fb5a..0a4ac0caf5 100644 --- a/components/external/nanopb/SConscript +++ b/components/external/nanopb/SConscript @@ -1,13 +1,12 @@ -Import('RTT_ROOT') -Import('rtconfig') from building import * +cwd = GetCurrentDir() src = Split(''' pb_common.c pb_decode.c pb_encode.c ''') -CPPPATH = [RTT_ROOT + '/components/external/nanopb'] +CPPPATH = [cwd] group = DefineGroup('Nanopb', src, depend = ['RT_USING_NANOPB'], CPPPATH = CPPPATH) diff --git a/components/net/SConscript b/components/net/SConscript index 587018d809..0341cca759 100644 --- a/components/net/SConscript +++ b/components/net/SConscript @@ -4,14 +4,15 @@ Import('RTT_ROOT') from building import * objs = [] -list = os.listdir(os.path.join(RTT_ROOT, 'components', 'net')) +cwd = GetCurrentDir() +list = os.listdir(cwd) # the default version of LWIP is 1.4.1 if not GetDepend('RT_USING_LWIP132') and not GetDepend('RT_USING_LWIP140') and not GetDepend('RT_USING_LWIP_HEAD'): AddDepend('RT_USING_LWIP141') for d in list: - path = os.path.join(RTT_ROOT, 'components', 'net', d) + path = os.path.join(cwd, d) if os.path.isfile(os.path.join(path, 'SConscript')): objs = objs + SConscript(os.path.join(d, 'SConscript'))