Custom PHP build scripts for PocketMine-MP
Bash script used to compile PHP on MacOS and Linux platforms. Make sure you have
make autoconf automake libtool m4 wget getconf gzip bzip2 bison g++ git cmake pkg-config re2c ca-certificates.
- If you're going to use the compiled binary only on the machine you're build it on, remove the
-toption for best performance - this will allow the script to optimize for the current machine rather than a generic one.
ext-gd2is NOT included unless the
-gflag is provided, as PocketMine-MP doesn't need it. However, if your plugins need it, don't forget to enable it using
-loptions can be used to specify cache folders to speed up recompiling if you're recompiling many times (e.g. to improve the script).
- Avoid using the script in directory trees containing spaces. Some libraries don't like trying to be built in directory trees containing spaces, e.g.
/home/user/my folder/pocketmine-mp/might experience problems.
Mac OSX (native compile)
- Most dependencies can be installed using Homebrew
- You will additionally need
glibtool(GNU libtool, xcode libtool won't work)
Android 64-bit (cross-compile)
- Only aarch64 targets are supported for Android cross-compile.
aarch64-linux-musltoolchain is required. You can compile and install it using https://github.com/pmmp/musl-cross-make (PMMP fork includes musl-libc patches for DNS resolver config path and increasing stack size limit for LevelDB)
|-c||Uses the folder specified for caching downloaded tarballs, zipballs etc.|
|-d||Compiles with debugging symbols and disables optimizations (slow, but useful for debugging segfaults)|
|-D||Compiles with separated debugging symbols, but leaves optimizations enabled (used for distributed binaries)|
|-g||Will compile GD2|
|-j||Set make threads to #|
|-l||Uses the folder specified for caching compilation artifacts (useful for rapid rebuild and testing)|
|-n||Don't remove sources after completing compilation|
|-s||Will compile everything statically|
|-v||Enable Valgrind support in PHP|
|-x||Specifies we are doing cross-compile|
|-P||Compiles extensions for the major PocketMine-MP version specified (can be
Batch script utilizing Visual Studio on Windows to compile PHP binaries from sources.
Ensure you have Visual Studio 2019,
wget installed in your PATH.
This script doesn't accept parameters, but the following environment variables are influential:
||Disables optimisations and builds PHP with detailed debugging information (useful for debugging segfaults)|
||Where to put the downloaded sources for compilation|
||Edition of Visual Studio installed, set to
||Major version of PocketMine-MP to build extensions for (defaults to 4, can be