?? symbian-armv5.cf
字號(hào):
# Generate .def file for this DLL
defFileName = "%s.def" % project.target_name
self.write_def_file(defFileName)
undefines=self.write_link_script()
# First link pass
#------------------------------------
#--- armlink -- generate .in file ---
#------------------------------------
arg_list = ["-diag_suppress 6331",
"--partial",
"-o %s.in" % baseName,
objects]
cmd = "armlink %s" % (
string.join(arg_list))
cmd_list.append(cmd)
#------------------------------------
#--- armlink -- generate .dll from .def file ---
#------------------------------------
arg_list = ["-absent _E32Dll",
"--path=%s" % project.output_dir,
"--export=%s{000a0000}" % project.target_name,
"--deffile=%s.def" % project.target_name,
"--linkAs=%s{000a0000}[0x101F8571].DLL" % project.target_name,
"--inter"]
cmd = "def2dll.bat %s" % (
string.join(arg_list))
cmd_list.append(cmd)
EpocUrelDir = "%s\EPOC32\Release\ARMV5\UREL" % GetSDKPath('SYMBIANSDK')
EpocLibDir = "%s\EPOC32\Release\ARMV5\LIB" % GetSDKPath('SYMBIANSDK')
EpocLibs = "efsrv.lib EUSER.LIB(VtblExports.o) EDLL.LIB ESTLIB.LIB(VtblExports.o) drtrvct2_1.lib usrt.lib dfpaeabi.lib \"drtaeabi.lib(VtblExports.o)\""
# Second link pass
arg_list = ["-diag_suppress 6331,6239",
"-shl",
"-reloc",
"-split",
"-rw-base 0x400000",
"-noscanlib",
"-entry _E32Dll \"%s\"" % GetSymbianLibPath("EDLL.LIB(UC_DLL_.o)"),
"%s{000a0000}.exp" % baseName,
"-o %s.DLL" % baseName,
"-symbols -list %s\%s.DLL.map" % (EpocUrelDir, project.target_name),
"%s.in" % baseName,
"--userlibpath %s,%s" % (EpocUrelDir, EpocLibDir),
static_libs,
EpocLibs
]
cmd = "armlink %s" % (
string.join(arg_list))
cmd_list.append(cmd)
# Translate DLL for use on the device
arg_list = ["-version 10.0",
"-sid 0x101f8571",
"-nocall",
"-uid1 0x%x" % project.symbianUtil.uid1,
"-uid2 0x%x" % project.symbianUtil.uid2,
"-uid3 0x%x" % project.symbianUtil.uid3,
"-capability ALL-Tcb ",
target_path,
GetSymbianLibPath("%s.dll") % project.target_name]
cmd = "elftran %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)
self.LinkSymbianExe(target_path, cmd_list, objects,
static_libs, 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):
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"
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 arm_interwork",
"--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",
"-e _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 arm_interwork",
"--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",
"-e _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):
def LinkSymbianExe(self, target_path, cmd_list, objects,
static_libs, dynamic_libs):
baseName = re.match("^(.+)\.exe$", target_path).group(1)
EpocUrelDir = "%sEPOC32\Release\ARMV5\UREL" % GetSDKPath('SYMBIANSDK')
EpocLibDir = "%sEPOC32\Release\ARMV5\LIB" % GetSDKPath('SYMBIANSDK')
EpocLibs = "efsrv.lib EUSER.LIB EEXE.LIB ESTLIB.LIB BAFL.LIB drtrvct2_1.lib usrt.lib dfpaeabi.lib \"drtaeabi.lib(VtblExports.o)\""
arg_list = ["-diag_suppress 6331,6239",
"-shl",
"-reloc",
"-split",
"-noscanlib",
"-entry _E32Startup \"%s\"" % GetSymbianLibPath("EEXE.LIB(UC_EXE_.o)"),
"-o %s" % target_path,
"-symbols -list %s\%s.EXE.map" % (EpocUrelDir, project.target_name),
"--userlibpath %s,%s" % (EpocUrelDir, EpocLibDir),
static_libs,
EpocLibs
]
arg_list.append(objects)
cmd = "armlink %s" % (string.join(arg_list))
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\\elftran\" %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 list
platform.link = SymbianARMILinker()
## Output directory setup
if project.BuildOption("debug"):
project.output_dir = "armv5-dbg32"
else:
project.output_dir = "armv5-rel32"
def GetSymbianLibPath(libName):
return os.path.join(GetSDKPath('SYMBIANSDK'),
'EPOC32\Release\ARMV5\UREL',
libName)
def HandleSymbianARMIStuff(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_libraries
AddUmakeCallback(HandleSymbianARMIStuff, None)
platform.build_rules['.s'] = BuildRule('.s', '.obj', asm)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -