|
|
|
|
@@ -62,23 +62,26 @@ PHP_SDK_PATH="${WORKING_DIR}\php-sdk-binary-tools"
|
|
|
|
|
UPX_EXEC="${PKG_ROOT_PATH}\bin\upx.exe"
|
|
|
|
|
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
|
|
|
|
SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream,cli_static
|
|
|
|
|
; Windows static linking system libs
|
|
|
|
|
SPC_EXTRA_LIBS=""
|
|
|
|
|
|
|
|
|
|
[linux]
|
|
|
|
|
; Linux can use different build toolchain, but the toolchain can not be changed in this file:
|
|
|
|
|
; - musl (default): used for general linux distros, can build `musl-static` target only.
|
|
|
|
|
; - zig (WIP): used for general linux distros, can build `musl` and `glibc` targets.
|
|
|
|
|
; - musl-native: used for alpine linux, can build `musl-static` and `musl`(WIP) target.
|
|
|
|
|
; - gnu-native (assume): used for general linux distros, can build `glibc` target only and have portability issues.
|
|
|
|
|
; Linux can use different build toolchains.
|
|
|
|
|
; - musl (default, when SPC_LIBC=musl): used for general linux distros, can build `musl` (statically linked) only.
|
|
|
|
|
; - zig (will become default): usable on all Linux distros, can build `-musl`, `arch-linux-musl -dynamic` and `arch-linux-gnu` targets. Can specify version such as `x86_64-linux-gnu.2.17`.
|
|
|
|
|
; - musl-native: used for alpine linux, can build `musl` and `musl -dynamic` target.
|
|
|
|
|
; - gnu-native: used for general linux distros, can build gnu target for the installed glibc version only.
|
|
|
|
|
|
|
|
|
|
; build target:
|
|
|
|
|
; - musl-static (default): pure static linking, using musl-libc, can run on any linux distro.
|
|
|
|
|
; - musl: static linking with dynamic linking to musl-libc, can run on musl-based linux distro.
|
|
|
|
|
; - glibc: static linking with dynamic linking to glibc, can run on glibc-based linux distro.
|
|
|
|
|
|
|
|
|
|
; include PATH for musl libc.
|
|
|
|
|
; LEGACY option to specify the target
|
|
|
|
|
SPC_LIBC=musl
|
|
|
|
|
|
|
|
|
|
; Recommended: specify your target here. Zig toolchain will be used.
|
|
|
|
|
; examples:
|
|
|
|
|
; `native-native-gnu` - links against glibc, current OS version
|
|
|
|
|
; `native-native-gnu.2.17` - links against glibc, version 2.17
|
|
|
|
|
; `native-native` - links against system libc dynamically
|
|
|
|
|
; `native-native-musl` - links against musl libc statically
|
|
|
|
|
; `native-native-musl -dynamic` - links against musl libc dynamically
|
|
|
|
|
; SPC_TARGET=
|
|
|
|
|
|
|
|
|
|
; compiler environments
|
|
|
|
|
CC=${SPC_LINUX_DEFAULT_CC}
|
|
|
|
|
CXX=${SPC_LINUX_DEFAULT_CXX}
|
|
|
|
|
@@ -87,8 +90,7 @@ LD=${SPC_LINUX_DEFAULT_LD}
|
|
|
|
|
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
|
|
|
|
|
SPC_DEFAULT_C_FLAGS="-fPIC -Os"
|
|
|
|
|
SPC_DEFAULT_CXX_FLAGS="-fPIC -Os"
|
|
|
|
|
; extra libs for building php executable, used in `make` command for building php (this value may changed by extension build process, space separated)
|
|
|
|
|
SPC_EXTRA_LIBS=""
|
|
|
|
|
SPC_DEFAULT_LD_FLAGS=""
|
|
|
|
|
; upx executable path
|
|
|
|
|
UPX_EXEC=${PKG_ROOT_PATH}/bin/upx
|
|
|
|
|
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
|
|
|
|
@@ -107,16 +109,10 @@ SPC_CMD_PREFIX_PHP_MAKE="make -j${SPC_CONCURRENCY}"
|
|
|
|
|
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
|
|
|
|
|
; CFLAGS for configuring php
|
|
|
|
|
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -fPIE"
|
|
|
|
|
; CPPFLAGS for configuring php
|
|
|
|
|
SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="-I${BUILD_INCLUDE_PATH}"
|
|
|
|
|
; LDFLAGS for configuring php
|
|
|
|
|
SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}"
|
|
|
|
|
; LIBS for configuring php
|
|
|
|
|
SPC_CMD_VAR_PHP_CONFIGURE_LIBS="-ldl -lpthread -lm"
|
|
|
|
|
; EXTRA_CFLAGS for `make` php
|
|
|
|
|
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="${SPC_DEFAULT_C_FLAGS} -g -fstack-protector-strong -fno-ident -fPIE"
|
|
|
|
|
; EXTRA_LIBS for `make` php
|
|
|
|
|
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm"
|
|
|
|
|
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fno-ident -fPIE ${SPC_DEFAULT_C_FLAGS}"
|
|
|
|
|
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so
|
|
|
|
|
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS=""
|
|
|
|
|
|
|
|
|
|
[macos]
|
|
|
|
|
; build target: macho or macho (possibly we could support macho-universal in the future)
|
|
|
|
|
@@ -128,8 +124,7 @@ CXX=clang++
|
|
|
|
|
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
|
|
|
|
|
SPC_DEFAULT_C_FLAGS="--target=${MAC_ARCH}-apple-darwin -Os"
|
|
|
|
|
SPC_DEFAULT_CXX_FLAGS="--target=${MAC_ARCH}-apple-darwin -Os"
|
|
|
|
|
; extra libs for building php executable, used in `make` command for building php (this value may changed by extension build process, space separated)
|
|
|
|
|
SPC_EXTRA_LIBS=""
|
|
|
|
|
SPC_DEFAULT_LD_FLAGS=""
|
|
|
|
|
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
|
|
|
|
SPC_MICRO_PATCHES=cli_checks,macos_iconv
|
|
|
|
|
|
|
|
|
|
@@ -146,14 +141,8 @@ SPC_CMD_PREFIX_PHP_MAKE="make -j${SPC_CONCURRENCY}"
|
|
|
|
|
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
|
|
|
|
|
; CFLAGS for configuring php
|
|
|
|
|
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -Werror=unknown-warning-option"
|
|
|
|
|
; CPPFLAGS for configuring php
|
|
|
|
|
SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="-I${BUILD_INCLUDE_PATH}"
|
|
|
|
|
; LDFLAGS for configuring php
|
|
|
|
|
SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}"
|
|
|
|
|
; EXTRA_CFLAGS for `make` php
|
|
|
|
|
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="${SPC_DEFAULT_C_FLAGS} -g -fstack-protector-strong -fpic -fpie"
|
|
|
|
|
; EXTRA_LIBS for `make` php
|
|
|
|
|
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-lresolv"
|
|
|
|
|
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie ${SPC_DEFAULT_C_FLAGS}"
|
|
|
|
|
|
|
|
|
|
[freebsd]
|
|
|
|
|
; compiler environments
|
|
|
|
|
|