diff --git a/docs/changes.md b/docs/changes.md index 0df075338..a960b59bc 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -1,4 +1,7 @@ # 最新动态 +2023/09/26 + * 修复对旧linux-fb的debug模式为true的问题(感谢智明提供补丁) + 2023/09/25 * 按标准c库修正iswspace 函数定义(感谢陈谭提供补丁) * 增加函数csv\_file\_object\_load/csv\_file\_object\_load\_from\_buff diff --git a/scripts/app_helper_base.py b/scripts/app_helper_base.py index 515c2ea08..abe83ab19 100644 --- a/scripts/app_helper_base.py +++ b/scripts/app_helper_base.py @@ -19,7 +19,7 @@ COMPILE_CONFIG = { 'LINUX_FB' : { 'value' : False, 'desc' : ['use linux\'s building'], 'help_info' : 'use linux\'s compile tools prefix building, value is true or false'}, 'MVVM_ROOT' : { 'value' : '', 'desc' : ['awtk\'s mvvm root'], 'help_info' : 'set link awtk\'s mvvm root, MVVM_ROOT=XXXXX'}, 'WITH_MVVM' : { 'value' : False, 'desc' : ['use mvvm'], 'help_info' : 'use mvvm\'s lib, value is true or false'}, - 'WITH_JERRYSCRIPT' : { 'value' : False, 'desc' : ['use mvvm\'s js'], 'help_info' : 'use mvvm js\'s lib, value is true or false'}, + 'WITH_JERRYSCRIPT' : { 'value' : True, 'desc' : ['use mvvm\'s js'], 'help_info' : 'use mvvm js\'s lib, value is true or false'}, 'WITH_IOTJS' : { 'value' : False, 'desc' : ['use mvvm\'s iotjs'], 'help_info' : 'use mvvm iotjs\'s lib, value is true or false'}, 'AWFLOW_ROOT' : { 'value' : '', 'desc' : ['awtk\'s awflow root'], 'help_info' : 'set link awtk\'s awflow root, AWFLOW_ROOT=XXXXX'}, 'WITH_AWFLOW' : { 'value' : False, 'desc' : ['use awflow'], 'help_info' : 'use awflow\'s lib, value is true or false'}, @@ -28,7 +28,7 @@ COMPILE_CONFIG = { 'BUILD_DIR' : { 'value' : None, 'desc' : ['build dir, compile temp file dir'], 'help_info' : 'set build dir, save compile temp file dir or *.obj/.*o dir, BUILD_DIR=XXXXX'}, # 'APP_BIN_DIR' : { 'value' : None, 'desc' : ['build bin dir'], 'help_info' : 'set build bin dir, APP_BIN_DIR=XXXXX'}, # 'APP_LIB_DIR' : { 'value' : None, 'desc' : ['build lib dir'], 'help_info' : 'set build lib dir, APP_LIB_DIR=XXXXX'}, - 'DEBUG' : { 'value' : True, 'desc' : ['awtk\'s compile is debug'], 'help_info' : 'awtk\'s compile is debug, value is true or false' }, + 'DEBUG' : { 'value' : None, 'desc' : ['awtk\'s compile is debug'], 'help_info' : 'awtk\'s compile is debug, value is true or false' }, 'PDB' : { 'value' : True, 'desc' : ['export pdb file'], 'help_info' : 'export pdb file, value is true or false' }, 'FLAGS' : { 'value' : '', 'desc' : ['compile flags'], 'help_info' : 'set compile\'s flags, so care of system and compile tools'}, 'LIBS' : { 'value' : [], 'desc' : ['compile libs'], 'help_info' : 'set compile\'s libs, so care of system and compile tools, use \',\' split muliple libraries '}, @@ -266,21 +266,21 @@ class AppHelperBase: self.DEPENDS_LIBS = [] self.GEN_IDL_DEF = True self.BUILD_SHARED = True - self.LINUX_FB = self.complie_helper.get_value('LINUX_FB', False) + self.LINUX_FB = self.complie_helper.get_value('LINUX_FB') self.AWTK_ROOT = self.getAwtkRoot() self.awtk = self.getAwtkConfig() self.AWTK_LIBS = self.awtk.LIBS self.AWTK_CFLAGS = self.awtk.CFLAGS self.AWTK_CCFLAGS = self.awtk.CCFLAGS self.APP_ROOT = APP_ROOT - self.BUILD_DIR = self.complie_helper.get_value('BUILD_DIR', '') + self.BUILD_DIR = self.complie_helper.get_value('BUILD_DIR') self.BIN_DIR = os.path.join(self.BUILD_DIR, 'bin') self.LIB_DIR = os.path.join(self.BUILD_DIR, 'lib') self.APP_BIN_DIR = os.path.join(APP_ROOT, self.BIN_DIR) self.APP_LIB_DIR = os.path.join(APP_ROOT, self.LIB_DIR) self.APP_SRC = os.path.join(APP_ROOT, 'src') self.APP_RES = os.path.join(APP_ROOT, 'res') - self.APP_LIBS = self.complie_helper.get_value('LIBS', []) + self.APP_LIBS = self.complie_helper.get_value('LIBS') self.APP_LINKFLAGS = '' self.PLATFORM_LIBS = [] self.APP_TOOLS = None @@ -288,11 +288,14 @@ class AppHelperBase: self.WITH_IOTJS = False self.MVVM_ROOT = None self.AWFLOW_ROOT = None - self.DEBUG = self.complie_helper.get_value('DEBUG', False) + if self.LINUX_FB and 'DEBUG' not in ARGUMENTS : + self.DEBUG = False + else : + self.DEBUG = self.complie_helper.get_value('DEBUG') self.parseArgs(self.awtk, ARGUMENTS) - self.APP_CPPPATH = [self.APP_SRC, self.APP_RES] + self.complie_helper.get_value('CPPPATH', []) - self.APP_LIBPATH = [self.APP_LIB_DIR, self.APP_BIN_DIR] + self.complie_helper.get_value('LIBPATH', []) + self.APP_CPPPATH = [self.APP_SRC, self.APP_RES] + self.complie_helper.get_value('CPPPATH') + self.APP_LIBPATH = [self.APP_LIB_DIR, self.APP_BIN_DIR] + self.complie_helper.get_value('LIBPATH') mkdir_if_not_exist(self.APP_BIN_DIR) mkdir_if_not_exist(self.APP_LIB_DIR) @@ -306,11 +309,11 @@ class AppHelperBase: if self.LINUX_FB: os.environ['LINUX_FB'] = 'true' - self.WITH_JERRYSCRIPT = self.complie_helper.get_value('WITH_JERRYSCRIPT', True) - self.WITH_IOTJS = self.complie_helper.get_value('WITH_IOTJS', False) + self.WITH_JERRYSCRIPT = self.complie_helper.get_value('WITH_JERRYSCRIPT') + self.WITH_IOTJS = self.complie_helper.get_value('WITH_IOTJS') - WITH_MVVM = self.complie_helper.get_value('WITH_MVVM', False) - MVVM_ROOT = self.complie_helper.get_value('MVVM_ROOT', '') + WITH_MVVM = self.complie_helper.get_value('WITH_MVVM') + MVVM_ROOT = self.complie_helper.get_value('MVVM_ROOT') if WITH_MVVM or os.path.exists(MVVM_ROOT): os.environ['WITH_MVVM'] = 'true' if not os.path.exists(MVVM_ROOT): @@ -318,8 +321,8 @@ class AppHelperBase: self.MVVM_ROOT = MVVM_ROOT print("MVVM_ROOT: " + self.MVVM_ROOT) - WITH_AWFLOW = self.complie_helper.get_value('WITH_AWFLOW', False) - AWFLOW_ROOT = self.complie_helper.get_value('AWFLOW_ROOT', '') + WITH_AWFLOW = self.complie_helper.get_value('WITH_AWFLOW') + AWFLOW_ROOT = self.complie_helper.get_value('AWFLOW_ROOT') print(WITH_AWFLOW) if WITH_AWFLOW or os.path.exists(AWFLOW_ROOT): os.environ['WITH_AWFLOW'] = 'true' @@ -459,7 +462,7 @@ class AppHelperBase: APP_RES_ROOT = config.get_res_res_root() LCD_ORIENTATION = config.get_res_lcd_orientation(APP_THEME) - LCD = self.complie_helper.get_value('LCD', '') + LCD = self.complie_helper.get_value('LCD') if len(LCD) > 0: wh = LCD.split('_') if len(wh) >= 1: @@ -467,13 +470,13 @@ class AppHelperBase: if len(wh) >= 2: LCD_HEIGHT = wh[1] - FONT = self.complie_helper.get_value('FONT', '') + FONT = self.complie_helper.get_value('FONT') if len(FONT) > 0: APP_DEFAULT_FONT = FONT APP_THEME = self.complie_helper.get_value('THEME', APP_THEME) - LANGUAGE = self.complie_helper.get_value('LANGUAGE', '') + LANGUAGE = self.complie_helper.get_value('LANGUAGE') if len(LANGUAGE) > 0: lan = LANGUAGE.split('_') if len(lan) >= 1: @@ -484,8 +487,8 @@ class AppHelperBase: APP_RES_ROOT = self.complie_helper.get_value('RES_ROOT', APP_RES_ROOT) self.APP_RES = os.path.abspath(os.path.join(self.APP_BIN_DIR, APP_RES_ROOT)) - self.BUILD_SHARED = self.complie_helper.get_value('SHARED', False) - self.GEN_IDL_DEF = self.complie_helper.get_value('IDL_DEF', True) + self.BUILD_SHARED = self.complie_helper.get_value('SHARED') + self.GEN_IDL_DEF = self.complie_helper.get_value('IDL_DEF') if LCD_ORIENTATION == '90' or LCD_ORIENTATION == '270' : tmp = LCD_WIDTH; @@ -503,9 +506,9 @@ class AppHelperBase: APP_CCFLAGS = APP_CCFLAGS + ' -DAPP_ROOT=\"\\\"' + \ self.APP_ROOT + '\\\"\" ' - self.APP_CFLAGS = self.complie_helper.get_value('FLAGS', '') - self.APP_CCFLAGS = APP_CCFLAGS + self.complie_helper.get_value('FLAGS', '') - self.APP_CXXFLAGS = self.APP_CCFLAGS + self.complie_helper.get_value('FLAGS', '') + self.APP_CFLAGS = self.complie_helper.get_value('FLAGS') + self.APP_CCFLAGS = APP_CCFLAGS + self.complie_helper.get_value('FLAGS') + self.APP_CXXFLAGS = self.APP_CCFLAGS + self.complie_helper.get_value('FLAGS') if PLATFORM == 'Linux': self.APP_LINKFLAGS += ' -Wl,-rpath=' + self.APP_BIN_DIR + ' ' @@ -569,12 +572,12 @@ class AppHelperBase: if hasattr(awtk, 'OS_DEBUG') : OS_DEBUG = awtk.OS_DEBUG else : - OS_DEBUG = True + OS_DEBUG = self.DEBUG if hasattr(awtk, 'BUILD_DEBUG_FLAG') : BUILD_DEBUG_FLAG = awtk.BUILD_DEBUG_FLAG else : if hasattr(awtk, 'CC') : - BUILD_DEBUG_FLAG = ' -g -O0 ' + BUILD_DEBUG_FLAG = ' ' else : BUILD_DEBUG_FLAG = ' /MDd -D_DEBUG -DDEBUG /DEBUG /Od ' DEBUG = self.complie_helper.get_value('DEBUG', OS_DEBUG) @@ -686,7 +689,7 @@ class AppHelperBase: else : CCFLAGS += BUILD_DEBUG_FLAG CFLAGS += BUILD_DEBUG_FLAG - + env = DefaultEnvironment( ENV = os.environ, CC=awtk.CC,