Last active
January 25, 2016 19:02
-
-
Save agelastic/bfb3d8c3d00f7a93ea99 to your computer and use it in GitHub Desktop.
quick changes to IDASkins build files to compile a 32-bit OSX plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/build_binary_dist.py b/build_binary_dist.py | |
old mode 100644 | |
new mode 100755 | |
index 77ca6e7..b12c178 | |
--- a/build_binary_dist.py | |
+++ b/build_binary_dist.py | |
@@ -34,11 +34,11 @@ from distutils.spawn import find_executable | |
def get_build_cmd(platform): | |
- return {'unix': 'make', 'win': 'MSBuild'}[platform] | |
+ return {'mac': 'make', 'unix': 'make', 'win': 'MSBuild'}[platform] | |
def get_cmake_gen(platform, cur_target): | |
- if platform == 'unix': | |
+ if platform == 'unix' or platform == 'mac': | |
return 'Unix Makefiles' | |
elif platform == 'win': | |
return 'Visual Studio ' + ('10' if cur_target[0] <= 6 and cur_target[1] <= 8 else '14') | |
@@ -50,7 +50,7 @@ def get_build_solution_arguments(platform): | |
build_bin = get_build_cmd(platform) | |
if platform == 'win': | |
return [build_bin, 'IDASkins.sln', '/p:Configuration=Release'] | |
- elif platform == 'unix': | |
+ elif platform == 'unix' or platform == 'mac': | |
return [build_bin] | |
else: | |
raise Exception('Unknown platform "%s"' % platform) | |
@@ -60,7 +60,7 @@ def get_install_solution_arguments(platform): | |
build_bin = get_build_cmd(platform) | |
if platform == 'win': | |
return [build_bin, 'INSTALL.vcxproj', '/p:Configuration=Release'] | |
- elif platform == 'unix': | |
+ elif platform == 'unix' or platform == 'mac': | |
return [build_bin, 'install', 'VERBOSE=1'] | |
else: | |
raise Exception('Unrecognized platform "%s"' % platform) | |
@@ -76,7 +76,7 @@ if __name__ == '__main__': | |
target_args = parser.add_argument_group('target configuration') | |
target_args.add_argument('--ida-sdks-path', '-i', type=str, required=True, | |
help='Path containing the IDA SDKs for the desired IDA target versions') | |
- target_args.add_argument('--platform', '-p', type=str, choices=['win', 'unix'], | |
+ target_args.add_argument('--platform', '-p', type=str, choices=['win', 'unix', 'mac'], | |
help='Platform to build for (e.g. win, unix)', required=True) | |
target_args.add_argument('--target-version', '-t', action='append', required=True, | |
help='IDA versions to build for (e.g. 6.7). May be passed multiple times.') | |
diff --git a/cmake/IDA.cmake b/cmake/IDA.cmake | |
index 04675ca..597286e 100644 | |
--- a/cmake/IDA.cmake | |
+++ b/cmake/IDA.cmake | |
@@ -61,7 +61,7 @@ file(TO_CMAKE_PATH "${ida_dir_env}" ida_dir) | |
# Compiler specific switches | |
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR | |
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | |
- set(compiler_specific "-m32 -std=c++0x -Werror") | |
+ set(compiler_specific "-m32 -std=c++0x ") | |
set(ida_lib_path_compiler "gcc") | |
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") | |
set(compiler_specific "/WX /wd4996 /MP /D__VC__") | |
@@ -94,6 +94,15 @@ if (WIN32) | |
else() | |
set(plugin_extension ".plw") | |
endif() | |
+elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | |
+ set(os_specific "-D__MAC__ -D_FORTIFY_SOURCE=0") | |
+ set(ida_lib_path_platform "mac") | |
+ | |
+ if (IDA_ARCH_64) | |
+ set(plugin_extension ".pmc64") | |
+ else() | |
+ set(plugin_extension ".pmc") | |
+ endif() | |
elseif (UNIX) | |
set(os_specific "-D__LINUX__") | |
set(ida_lib_path_platform "linux") | |
@@ -103,15 +112,6 @@ elseif (UNIX) | |
else() | |
set(plugin_extension ".plx") | |
endif() | |
-elseif (APPLE) # Untested! | |
- set(os_specific "-D__MAC__ -D_FORTIFY_SOURCE=0") | |
- set(ida_lib_path_platform "mac") | |
- | |
- if (IDA_ARCH_64) | |
- set(plugin_extension ".pmc64") | |
- else() | |
- set(plugin_extension ".pmc") | |
- endif() | |
endif () | |
# IDA target architecture specific | |
@@ -148,7 +148,8 @@ if (WIN32) | |
elseif (UNIX OR APPLE) | |
# We hardwire the path here as the lib lacks the "lib" prefix, making | |
# find_library ignoring it. | |
- list(APPEND IDA_PRO_LIBRARY "${IDA_LIB_DIR}/pro.a") | |
+ list(APPEND ida_libraries "${IDA_LIB_DIR}/pro.a") | |
+ | |
endif () | |
set(ida_libraries ${ida_libraries} CACHE INTERNAL "IDA libraries" FORCE) | |
include_directories("${ida_sdk}/include") | |
@@ -177,7 +178,7 @@ function (add_ida_plugin plugin_name) | |
SUFFIX ${plugin_extension} | |
OUTPUT_NAME ${plugin_name}) | |
- target_link_libraries(${plugin_name} ${ida_libraries}) | |
+ target_link_libraries(${plugin_name} ${ida_libraries} ida) | |
# Define install rule | |
install(TARGETS ${plugin_name} DESTINATION plugins) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment