Code Monkey home page Code Monkey logo

php-build-scripts_fork's Introduction

Custom PHP build scripts for PocketMine-MP

Build status

Looking for prebuilt binaries? Head over to releases

compile.sh

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.

Additional notes

Mac OSX (native compile)

  • Most dependencies can be installed using Homebrew
  • You will additionally need glibtool (GNU libtool, xcode libtool won't work)
  • You also MUST specify target as mac or mac64 if building for Mac, on Mac.

Android 64-bit (cross-compile)

  • Only aarch64 targets are supported for Android cross-compile.
  • The aarch64-linux-musl toolchain 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)
  • It is strongly recommended that you enable abusive optimizations for Android targets (-f flag) for best performance.
Script flags Description
-d Will compile with debug and the xdebug PHP extension
-f Enabling abusive optimizations...
-g Will compile GD2
-j Set make threads to #
-n Don't remove sources after completing compilation
-s Will compile everything statically
-t Set target
-v Enable Valgrind support in PHP
-x Specifies we are doing cross-compile
-P Compiles extensions for the major PocketMine-MP version specified (default 4, can be 4 or 5)

Example:

Target Arguments
linux64 -t linux64 -j4 -f x86_64
linux64, PM5 -t linux64 -j4 -f x86_64 -P 5
mac64 -t mac64 -j4 -f
android-aarch64 -t android-aarch64 -x -j4 -f

Common pitfalls

  • If used, the -t option (target) MUST be specified BEFORE the -f option (optimizations)
  • 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.

windows-compile-vs.bat

Batch script utilizing Visual Studio on Windows to compile PHP binaries from sources. Ensure you have Visual Studio 2019, git, 7z and wget installed in your PATH.

This script doesn't accept parameters, but the following environment variables are influential:

Variable Description
PHP_DEBUG_BUILD Disables optimisations and builds PHP with detailed debugging information (useful for debugging segfaults)
SOURCES_PATH Where to put the downloaded sources for compilation
VS_EDITION Edition of Visual Studio installed, set to Community by default
PM_VERSION_MAJOR Major version of PocketMine-MP to build extensions for (defaults to 4, can be 4 or 5)

php-build-scripts_fork's People

Contributors

alex2534alex avatar coonce avatar daisukedaisuke avatar danmudd avatar dependabot[bot] avatar dktapps avatar encritary avatar evelire avatar frago9876543210 avatar fuyutsuki avatar humerus avatar intyre avatar kmatuszak avatar legoboy0215 avatar michaelm04 avatar mrtechno avatar msjyoo avatar narapons avatar padreon avatar robske110 avatar shoghicp avatar sof3 avatar tarik02 avatar witalijx avatar xerenahmed avatar zkoz210 avatar

Watchers

 avatar

Forkers

sticknologic

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.