mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-28 03:54:18 +01:00
build.py: slightly modified the build.py script so that it can be imported and used from other build scripts
This commit is contained in:
parent
99c60a82de
commit
3862f05f3f
20
build.py
20
build.py
@ -352,8 +352,7 @@ def build_plugin(platform, idasdkdir, plugin_name, ea64):
|
|||||||
extra_link_parameters)
|
extra_link_parameters)
|
||||||
assert res == 0, "Failed to link the plugin binary"
|
assert res == 0, "Failed to link the plugin binary"
|
||||||
|
|
||||||
|
def detect_platform(ea64):
|
||||||
def build_binary_package(ea64, nukeold):
|
|
||||||
# Detect the platform
|
# Detect the platform
|
||||||
system = platform.system()
|
system = platform.system()
|
||||||
|
|
||||||
@ -362,14 +361,21 @@ def build_binary_package(ea64, nukeold):
|
|||||||
platform_string = "win32"
|
platform_string = "win32"
|
||||||
plugin_name = ea64 and "python.p64" or "python.plw"
|
plugin_name = ea64 and "python.p64" or "python.plw"
|
||||||
|
|
||||||
if system == "Linux":
|
elif system == "Linux":
|
||||||
platform_string = "linux"
|
platform_string = "linux"
|
||||||
plugin_name = ea64 and "python.plx64" or "python.plx"
|
plugin_name = ea64 and "python.plx64" or "python.plx"
|
||||||
|
|
||||||
if system == "Darwin":
|
elif system == "Darwin":
|
||||||
platform_string = "macosx"
|
platform_string = "macosx"
|
||||||
plugin_name = ea64 and "python.pmc64" or "python.pmc"
|
plugin_name = ea64 and "python.pmc64" or "python.pmc"
|
||||||
|
else:
|
||||||
|
print "Unknown platform!"
|
||||||
|
sys.exit(-1)
|
||||||
|
|
||||||
|
return (system, platform_string, plugin_name)
|
||||||
|
|
||||||
|
def build_binary_package(ea64, nukeold):
|
||||||
|
system, platform_string, plugin_name = detect_platform(ea64)
|
||||||
BINDISTDIR = "idapython-%d.%d.%d_ida%d.%d_py%d.%d_%s" % (VERSION_MAJOR,
|
BINDISTDIR = "idapython-%d.%d.%d_ida%d.%d_py%d.%d_%s" % (VERSION_MAJOR,
|
||||||
VERSION_MINOR,
|
VERSION_MINOR,
|
||||||
VERSION_PATCH,
|
VERSION_PATCH,
|
||||||
@ -401,11 +407,13 @@ def build_source_package():
|
|||||||
srcmanifest.extend([(x, "python") for x in "python/init.py", "python/idc.py", "python/idautils.py"])
|
srcmanifest.extend([(x, "python") for x in "python/init.py", "python/idc.py", "python/idautils.py"])
|
||||||
build_distribution(srcmanifest, SRCDISTDIR, ea64=False, nukeold=True)
|
build_distribution(srcmanifest, SRCDISTDIR, ea64=False, nukeold=True)
|
||||||
|
|
||||||
|
def main():
|
||||||
if __name__ == "__main__":
|
|
||||||
# Do 64-bit build?
|
# Do 64-bit build?
|
||||||
ea64 = '--ea64' in sys.argv
|
ea64 = '--ea64' in sys.argv
|
||||||
build_binary_package(ea64=False, nukeold=True)
|
build_binary_package(ea64=False, nukeold=True)
|
||||||
if ea64:
|
if ea64:
|
||||||
build_binary_package(ea64=True, nukeold=False)
|
build_binary_package(ea64=True, nukeold=False)
|
||||||
build_source_package()
|
build_source_package()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
Loading…
Reference in New Issue
Block a user