📄 symbian-thumb.cf
字号:
# Generate second .exp file arg_list = ["-m thumb", "--def %s" % defFileName, "--dllname %s" % target_path, "--base-file %s.bas" % baseName, "--output-exp %s.exp" % baseName] cmd = '"%s/EPOC32/gcc/bin/dlltool" %s' % (platform.tool_root, string.join(arg_list)) cmd_list.append(cmd) # Second link pass arg_list = ["-s", "--thumb-entry _E32Dll", "-u _E32Dll", undefines, "%s.exp" % baseName, "--dll", "-Map %s.map" % target_path, "-o %s" % target_path, GetSymbianLibPath("edll.lib"), objects, mergedLibPath, dynamic_libs, GetSymbianLibPath("egcc.lib"), GetSymbianLibPath("euser.lib")] cmd = "python %s ld %s" % ( os.path.join(BUILD_ROOT,"bin","rlink.py"), string.join(arg_list)) cmd_list.append(cmd) # Translate DLL for use on the device arg_list = ["-nocall", "-uid1 0x%x" % project.symbianUtil.uid1, "-uid2 0x%x" % project.symbianUtil.uid2, "-uid3 0x%x" % project.symbianUtil.uid3, target_path, target_path] cmd = "\"%s/epoc32/tools/petran\" %s" % (platform.tool_root, string.join(arg_list)) cmd_list.append(cmd) arg_list = ["%s.exp" % baseName, "%s.bas" % baseName] cmd = "rm %s" % (string.join(arg_list)) cmd_list.append(cmd) cmd = "rm %s" % (mergedLibPath) cmd_list.append(cmd) return cmd_list def CleanDLL(self, target_path): list = [] list.append(target_path) return list def LinkEXE(self, target_path, objects, static_libs, dynamic_libs): cmd_list = [] mergedLibPath = self.AddARMerge( cmd_list, static_libs) if (project.BuildOption('make-app')): self.LinkSymbianPolyDll(target_path, "app", cmd_list, objects, mergedLibPath, dynamic_libs) elif (project.BuildOption('make-mdl')): self.LinkSymbianPolyDll(target_path, "mdl", cmd_list, objects, mergedLibPath, dynamic_libs) elif (project.BuildOption('make-mmf')): self.LinkSymbianPolyDll(target_path, "dll", cmd_list, objects, mergedLibPath, dynamic_libs) else: self.LinkSymbianExe(target_path, cmd_list, objects, mergedLibPath, dynamic_libs) cmd = "rm %s" % (mergedLibPath) cmd_list.append(cmd) return cmd_list def LinkSymbianPolyDll(self, target_path, dllExt, cmd_list, objects, mergedLibPath, dynamic_libs): print "target_path %s" % target_path baseName = re.match("^(.+)\.%s$" % dllExt, target_path).group(1) # Create .def file if( dllExt == "app"): exportLine = "NewApplication__Fv @ 1 NONAME R3UNUSED ; NewApplication(void)\n" elif( dllExt == "mdl"): exportLine = "CreateRecognizer__Fv @ 1 NONAME R3UNUSED ; CreateRecognizer(void)\n" elif( dllExt == "dll" ): exportLine = "ImplementationGroupProxy__FRi @ 1 NONAME R3UNUSED ; ImplementationGroupProxy(int &)\n" else: raise "don't know what to export for dll type '%s'" % outExt defFileName = "%s.def" % project.target_name defFile = open(defFileName, "w") defFile.write("EXPORTS\n") defFile.write(exportLine) defFile.close() arg_list = ["-m thumb", "--def %s" % defFileName, "--output-exp %s.exp" % baseName, "--dllname %s" % target_path] cmd = '"%s/EPOC32/gcc/bin/dlltool" %s' % (platform.tool_root, string.join(arg_list)) cmd_list.append(cmd) arg_list = ["-s", "--thumb-entry _E32Dll", "-u _E32Dll", "%s.exp" % baseName, "--dll", "--base-file %s.bas" % baseName, "-o %s" % target_path, GetSymbianLibPath("edll.lib"), objects, mergedLibPath, dynamic_libs, GetSymbianLibPath("edllstub.lib"), GetSymbianLibPath("egcc.lib"), GetSymbianLibPath("euser.lib")] cmd = "ld %s" % (string.join(arg_list)) cmd_list.append(cmd) arg_list = ["-m thumb", "--def %s" % defFileName, "--dllname %s" % target_path, "--base-file %s.bas" % baseName, "--output-exp %s.exp" % baseName] cmd = '"%s/EPOC32/gcc/bin/dlltool" %s' % (platform.tool_root, string.join(arg_list)) cmd_list.append(cmd) arg_list = ["-s", "--thumb-entry _E32Dll", "-u _E32Dll", "--dll", "%s.exp" % baseName, "-Map %s.map" % target_path, "-o %s" % target_path, GetSymbianLibPath("edll.lib"), objects, mergedLibPath, dynamic_libs, GetSymbianLibPath("edllstub.lib"), GetSymbianLibPath("egcc.lib"), GetSymbianLibPath("euser.lib")] cmd = "ld %s" % (string.join(arg_list)) cmd_list.append(cmd) # Translate .APP for use on the device arg_list = ["-nocall", "-uid1 0x%x" % project.symbianUtil.uid1, "-uid2 0x%x" % project.symbianUtil.uid2, "-uid3 0x%x" % project.symbianUtil.uid3, target_path, target_path] cmd = "\"%s/epoc32/tools/petran\" %s" % (platform.tool_root, string.join(arg_list)) cmd_list.append(cmd) arg_list = ["%s.exp" % baseName, "%s.bas" % baseName] cmd = "rm %s" % (string.join(arg_list)) cmd_list.append(cmd) return cmd_list def LinkSymbianExe(self, target_path, cmd_list, objects, mergedLibPath, dynamic_libs): baseName = re.match("^(.+)\.exe$", target_path).group(1) arg_list = ["-s", "--thumb-entry _E32Startup", "-u _E32Startup", "--base-file %s.bas" % baseName, "-o %s" % target_path] arg_list.append(objects) arg_list.append(GetSymbianLibPath("eexe.lib")) arg_list.append(mergedLibPath) arg_list.append(dynamic_libs) arg_list.append(GetSymbianLibPath("egcc.lib")) arg_list.append(GetSymbianLibPath("euser.lib")) cmd = "ld %s" % (string.join(arg_list)) cmd_list.append(cmd) cmd = "rm %s" % target_path cmd_list.append(cmd) arg_list = ["-m thumb", "--base-file %s.bas" % baseName, "--output-exp %s.exp" % baseName] cmd = '"%s/EPOC32/gcc/bin/dlltool" %s' % (platform.tool_root, string.join(arg_list)) cmd_list.append(cmd) cmd = "rm %s.bas" % baseName cmd_list.append(cmd) arg_list = ["-s", "--thumb-entry _E32Startup", "-u _E32Startup", "%s.exp" % baseName, "-Map %s.map" % target_path, "-o %s" % target_path] arg_list.append(objects) arg_list.append(GetSymbianLibPath("eexe.lib")) arg_list.append(mergedLibPath) arg_list.append(dynamic_libs) arg_list.append(GetSymbianLibPath("egcc.lib")) arg_list.append(GetSymbianLibPath("euser.lib")) cmd = "ld %s" % (string.join(arg_list)) cmd_list.append(cmd) cmd = "rm %s.exp" % baseName cmd_list.append(cmd) arg_list = ["-nocall ", "-uid1 0x%x" % project.symbianUtil.uid1, "-uid2 0x%x" % project.symbianUtil.uid2, "-uid3 0x%x" % project.symbianUtil.uid3, target_path, target_path] cmd = "\"%s/epoc32/tools/petran\" %s" % (platform.tool_root, string.join(arg_list)) cmd_list.append(cmd) return cmd_list def CleanEXE(self, target_path): list = [] list.append(target_path) return listplatform.link = SymbianTHUMBLinker()## Output directory setupif project.BuildOption("debug"): project.output_dir = "thumb-dbg32"else: project.output_dir = "thumb-rel32"def GetSymbianLibPath(libName): return os.path.join(GetSDKPath('SYMBIANSDK'), 'EPOC32\Release\THUMB\UREL', libName)def HandleSymbianTHUMBStuff(args): new_sys_libraries = [] for x in project.sys_libraries: new_path = GetSymbianLibPath(x) if (os.path.isfile(new_path)): new_sys_libraries.append("\"%s\"" % new_path) else: new_sys_libraries.append(x) project.sys_libraries = new_sys_librariesAddUmakeCallback(HandleSymbianTHUMBStuff, None)platform.build_rules['.s'] = BuildRule('.s', '.obj', cxx)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -