docs: fix markdown for COMPILE*md
This commit is contained in:
@@ -2,8 +2,8 @@ This documentation explains how to compile, install & run Unicorn on MacOSX,
|
||||
Linux, *BSD, Solaris, Android & iOS.
|
||||
|
||||
To compile for Microsoft Windows, see [COMPILE-WINDOWS.md](COMPILE-WINDOWS.md)
|
||||
----
|
||||
|
||||
*-*-*-*-*-*
|
||||
|
||||
[0] Dependencies
|
||||
|
||||
@@ -23,46 +23,46 @@ Unicorn requires few dependent packages as follows.
|
||||
|
||||
[1] Tailor Unicorn to your need.
|
||||
|
||||
Out of 6 archtitectures supported by Unicorn (Arm, Arm64, M68K, Mips, Sparc,
|
||||
& X86), if you just need several selected archs, choose which ones you want
|
||||
to compile in by editing "config.mk" before going to next steps.
|
||||
Out of 6 archtitectures supported by Unicorn (Arm, Arm64, M68K, Mips, Sparc,
|
||||
& X86), if you just need several selected archs, choose which ones you want
|
||||
to compile in by editing "config.mk" before going to next steps.
|
||||
|
||||
By default, all 6 architectures are compiled.
|
||||
By default, all 6 architectures are compiled.
|
||||
|
||||
The other way of customize Unicorn without having to edit config.mk is to
|
||||
pass the desired options on the commandline to ./make.sh. Currently,
|
||||
Unicorn supports 4 options, as follows.
|
||||
The other way of customize Unicorn without having to edit config.mk is to
|
||||
pass the desired options on the commandline to ./make.sh. Currently,
|
||||
Unicorn supports 4 options, as follows.
|
||||
|
||||
- UNICORN_ARCHS: specify list of architectures to compiled in.
|
||||
- UNICORN_STATIC: build static library.
|
||||
- UNICORN_SHARED: build dynamic (shared) library.
|
||||
- UNICORN_QEMU_FLAGS: specify extra flags for qemu's configure script
|
||||
|
||||
To avoid editing config.mk for these customization, we can pass their values to
|
||||
make.sh, as follows.
|
||||
To avoid editing config.mk for these customization, we can pass their values to
|
||||
make.sh, as follows.
|
||||
|
||||
$ UNICORN_ARCHS="arm aarch64 x86" ./make.sh
|
||||
|
||||
NOTE: on commandline, put these values in front of ./make.sh, not after it.
|
||||
NOTE: on commandline, put these values in front of ./make.sh, not after it.
|
||||
|
||||
For each option, refer to docs/README for more details.
|
||||
For each option, refer to docs/README for more details.
|
||||
|
||||
|
||||
|
||||
[2] Compile and install from source on *nix
|
||||
|
||||
To build Unicorn on *nix (such as MacOSX, Linux, *BSD, Solaris):
|
||||
To build Unicorn on *nix (such as MacOSX, Linux, *BSD, Solaris):
|
||||
|
||||
- To compile for current platform, run:
|
||||
- To compile for current platform, run:
|
||||
|
||||
$ ./make.sh
|
||||
|
||||
- Unicorn requires Python 2.x to compile. If Python 2.x is not the default
|
||||
- Unicorn requires Python 2.x to compile. If Python 2.x is not the default
|
||||
Python interpreter, ensure that the appropriate option is set:
|
||||
|
||||
$ UNICORN_QEMU_FLAGS="--python=/path/to/python2" ./make.sh
|
||||
|
||||
- To cross-compile Unicorn on 64-bit OS to target 32-bit binary, run:
|
||||
- To cross-compile Unicorn on 64-bit OS to target 32-bit binary, run:
|
||||
|
||||
$ ./make.sh nix32
|
||||
|
||||
@@ -98,50 +98,50 @@ Unicorn requires few dependent packages as follows.
|
||||
|
||||
[3] Cross-compile for iOS from Mac OSX.
|
||||
|
||||
To cross-compile for iOS (iPhone/iPad/iPod), Mac OSX with XCode installed is required.
|
||||
To cross-compile for iOS (iPhone/iPad/iPod), Mac OSX with XCode installed is required.
|
||||
|
||||
- To cross-compile for ArmV7 (iPod 4, iPad 1/2/3, iPhone4, iPhone4S), run:
|
||||
- To cross-compile for ArmV7 (iPod 4, iPad 1/2/3, iPhone4, iPhone4S), run:
|
||||
|
||||
$ ./make.sh ios_armv7
|
||||
|
||||
- To cross-compile for ArmV7s (iPad 4, iPhone 5C, iPad mini), run:
|
||||
- To cross-compile for ArmV7s (iPad 4, iPhone 5C, iPad mini), run:
|
||||
|
||||
$ ./make.sh ios_armv7s
|
||||
|
||||
- To cross-compile for Arm64 (iPhone 5S, iPad mini Retina, iPad Air), run:
|
||||
- To cross-compile for Arm64 (iPhone 5S, iPad mini Retina, iPad Air), run:
|
||||
|
||||
$ ./make.sh ios_arm64
|
||||
|
||||
- To cross-compile for all iDevices (armv7 + armv7s + arm64), run:
|
||||
- To cross-compile for all iDevices (armv7 + armv7s + arm64), run:
|
||||
|
||||
$ ./make.sh ios
|
||||
|
||||
Resulted files libunicorn.dylib, libunicorn.a & tests/test* can then
|
||||
be used on iOS devices.
|
||||
Resulted files libunicorn.dylib, libunicorn.a & tests/test* can then
|
||||
be used on iOS devices.
|
||||
|
||||
|
||||
|
||||
[4] Cross-compile for Android
|
||||
|
||||
To cross-compile for Android (smartphone/tablet), Android NDK is required.
|
||||
NOTE: Only ARM and ARM64 are currently supported.
|
||||
To cross-compile for Android (smartphone/tablet), Android NDK is required.
|
||||
NOTE: Only ARM and ARM64 are currently supported.
|
||||
|
||||
$ NDK=/android/android-ndk-r10e ./make.sh cross-android arm
|
||||
or
|
||||
or
|
||||
$ NDK=/android/android-ndk-r10e ./make.sh cross-android arm64
|
||||
|
||||
Resulted files libunicorn.so, libunicorn.a & tests/test* can then
|
||||
be used on Android devices.
|
||||
Resulted files libunicorn.so, libunicorn.a & tests/test* can then
|
||||
be used on Android devices.
|
||||
|
||||
|
||||
|
||||
[5] By default, "cc" (default C compiler on the system) is used as compiler.
|
||||
|
||||
- To use "clang" compiler instead, run the command below:
|
||||
- To use "clang" compiler instead, run the command below:
|
||||
|
||||
$ ./make.sh clang
|
||||
|
||||
- To use "gcc" compiler instead, run:
|
||||
- To use "gcc" compiler instead, run:
|
||||
|
||||
$ ./make.sh gcc
|
||||
|
||||
@@ -155,15 +155,15 @@ Unicorn requires few dependent packages as follows.
|
||||
|
||||
[7] Language bindings
|
||||
|
||||
Look for the bindings under directory bindings/, and refer to README file
|
||||
of corresponding languages.
|
||||
Look for the bindings under directory bindings/, and refer to README file
|
||||
of corresponding languages.
|
||||
|
||||
|
||||
|
||||
[8] Unit tests
|
||||
|
||||
Automated unit tests use the cmocka unit testing framework (https://cmocka.org/).
|
||||
It can be installed in most Linux distros using the package manager, e.g.
|
||||
`sudo yum install libcmocka libcmocka-devel`, or you can easily build and install it from source.
|
||||
Automated unit tests use the cmocka unit testing framework (https://cmocka.org/).
|
||||
It can be installed in most Linux distros using the package manager, e.g.
|
||||
`sudo yum install libcmocka libcmocka-devel`, or you can easily build and install it from source.
|
||||
|
||||
You can run the tests by running `make test` in the project directory.
|
||||
You can run the tests by running `make test` in the project directory.
|
||||
|
||||
Reference in New Issue
Block a user