env.ini 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ; static-php-cli (spc) env configuration
  3. ;
  4. ; This file is used to set default env vars for static-php-cli build.
  5. ; As dynamic build process, some of these vars can be overwritten by CLI options.
  6. ; And you can also overwrite these vars by setting them in your shell environment.
  7. ;
  8. ; We need to use some pre-defined internal env vars, like `BUILD_ROOT_PATH`, `DOWNLOAD_PATH`, etc.
  9. ; Please note that these vars cannot be defined in this file, they are only be defined before static-php-cli running.
  10. ; Here's a list of these pre-defined internal env vars, these vars are only be defined in the static-php-cli build process if not set in the shell environment:
  11. ;
  12. ; BUILD_ROOT_PATH: the root path of the build process. (default: `$(pwd)/buildroot`)
  13. ; BUILD_INCLUDE_PATH: the path of the include files. (default: `$BUILD_ROOT_PATH/include`)
  14. ; BUILD_LIB_PATH: the path of the lib files. (default: `$BUILD_ROOT_PATH/lib`)
  15. ; BUILD_BIN_PATH: the path of the bin files. (default: `$BUILD_ROOT_PATH/bin`)
  16. ; PKG_ROOT_PATH: the root path of the package files. (default: `$(pwd)/pkgroot`)
  17. ; SOURCE_PATH: the path of the source files. (default: `$(pwd)/source`)
  18. ; DOWNLOAD_PATH: the path of the download files. (default: `$(pwd)/downloads`)
  19. ; CPU_COUNT: the count of the CPU cores. (default: `$(nproc)`)
  20. ; GNU_ARCH: the GNU arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `aarch64`)
  21. ; MAC_ARCH: the MAC arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `arm64`)
  22. ;
  23. ; Here's a list of env vars, these value cannot be changed anywhere:
  24. ;
  25. ; WORKING_DIR: the working directory of the build process. (default: `$(pwd)`)
  26. ; ROOT_DIR: the root directory of static-php-cli. (default: `/path/to/static-php-cli`, when running in phar or micro mode: `phar://path/to/spc.phar`)
  27. ;
  28. ; * These vars are only be defined in Unix (macOS, Linux, FreeBSD)Builder *
  29. ; PATH: static-php-cli will add `$BUILD_BIN_PATH` to PATH.
  30. ; PKG_CONFIG: static-php-cli will set `$BUILD_BIN_PATH/pkg-config` to PKG_CONFIG.
  31. ; PKG_CONFIG_PATH: static-php-cli will set `$BUILD_LIB_PATH/pkgconfig` to PKG_CONFIG_PATH.
  32. ; SPC_PHP_DEFAULT_OPTIMIZE_CFLAGS: the default optimization CFLAGS for compiling php. (if --no-strip option is set: `-g -O0`, else: `-g -Os`)
  33. ;
  34. ; * These vars are only be defined in LinuxBuilder *
  35. ; SPC_LINUX_DEFAULT_CC: the default compiler for linux. (For alpine linux: `gcc`, default: `$GNU_ARCH-linux-musl-gcc`)
  36. ; SPC_LINUX_DEFAULT_CXX: the default c++ compiler for linux. (For alpine linux: `g++`, default: `$GNU_ARCH-linux-musl-g++`)
  37. ; SPC_LINUX_DEFAULT_AR: the default archiver for linux. (For alpine linux: `ar`, default: `$GNU_ARCH-linux-musl-ar`)
  38. ; SPC_PHP_DEFAULT_LD_LIBRARY_PATH_CMD: the default LD_LIBRARY_PATH for php. (linux: `LD_LIBRARY_PATH=/usr/local/musl/$GNU_ARCH-linux-musl/lib`, default: empty)
  39. [global]
  40. ; Build concurrency for make -jN, default is CPU_COUNT, this value are used in every libs.
  41. SPC_CONCURRENCY=${CPU_COUNT}
  42. ; Ignore PHP version check before building some extensions
  43. SPC_SKIP_PHP_VERSION_CHECK="no"
  44. ; Ignore some check item for bin/spc doctor command, comma separated (e.g. SPC_SKIP_DOCTOR_CHECK_ITEMS="if homebrew has installed")
  45. SPC_SKIP_DOCTOR_CHECK_ITEMS=""
  46. [windows]
  47. ; php-sdk-binary-tools path
  48. PHP_SDK_PATH="${WORKING_DIR}\php-sdk-binary-tools"
  49. ; upx executable path
  50. UPX_EXEC="${PKG_ROOT_PATH}\bin\upx.exe"
  51. ; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
  52. SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream,cli_static
  53. [linux]
  54. ; include PATH for musl libc.
  55. SPC_NO_MUSL_PATH=no
  56. ; compiler environments
  57. CC=${SPC_LINUX_DEFAULT_CC}
  58. CXX=${SPC_LINUX_DEFAULT_CXX}
  59. AR=${SPC_LINUX_DEFAULT_AR}
  60. LD=ld.gold
  61. ; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
  62. SPC_DEFAULT_C_FLAGS=
  63. SPC_DEFAULT_CXX_FLAGS=
  64. ; extra libs for building php executable, used in `make` command for building php (this value may changed by extension build process, space separated)
  65. SPC_EXTRA_LIBS=
  66. ; upx executable path
  67. UPX_EXEC=${PKG_ROOT_PATH}/bin/upx
  68. ; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
  69. SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream
  70. ; *** default build command for building php ***
  71. ; buildconf command
  72. SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
  73. ; configure command
  74. SPC_CMD_PREFIX_PHP_CONFIGURE="${SPC_PHP_DEFAULT_LD_LIBRARY_PATH_CMD} ./configure --prefix= --with-valgrind=no --enable-shared=no --enable-static=yes --disable-all --disable-cgi --disable-phpdbg"
  75. ; make command
  76. SPC_CMD_PREFIX_PHP_MAKE="make -j${CPU_COUNT}"
  77. ; *** default build vars for building php ***
  78. ; CFLAGS for configuring php
  79. SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS}"
  80. ; CPPFLAGS for configuring php
  81. SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="-I${BUILD_INCLUDE_PATH}"
  82. ; LDFLAGS for configuring php
  83. SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}"
  84. ; LIBS for configuring php
  85. SPC_CMD_VAR_PHP_CONFIGURE_LIBS="-ldl -lpthread -lm"
  86. ; EXTRA_CFLAGS for `make` php
  87. SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="${SPC_PHP_DEFAULT_OPTIMIZE_CFLAGS} -fno-ident -fPIE"
  88. ; EXTRA_LIBS for `make` php
  89. SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS=""
  90. ; EXTRA_LDFLAGS_PROGRAM for `make` php
  91. SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-all-static"
  92. [macos]
  93. ; compiler environments
  94. CC=clang
  95. CXX=clang++
  96. ; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
  97. SPC_DEFAULT_C_FLAGS="--target=${MAC_ARCH}-apple-darwin"
  98. SPC_DEFAULT_CXX_FLAGS="--target=${MAC_ARCH}-apple-darwin"
  99. ; extra libs for building php executable, used in `make` command for building php (this value may changed by extension build process, space separated)
  100. SPC_EXTRA_LIBS=
  101. ; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
  102. SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream,macos_iconv
  103. ; *** default build command for building php ***
  104. ; buildconf command
  105. SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
  106. ; configure command
  107. SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-shared=no --enable-static=yes --disable-all --disable-cgi --disable-phpdbg"
  108. ; make command
  109. SPC_CMD_PREFIX_PHP_MAKE="make -j${CPU_COUNT}"
  110. ; *** default build vars for building php ***
  111. ; CFLAGS for configuring php
  112. SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -Werror=unknown-warning-option"
  113. ; CPPFLAGS for configuring php
  114. SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="-I${BUILD_INCLUDE_PATH}"
  115. ; LDFLAGS for configuring php
  116. SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}"
  117. ; EXTRA_CFLAGS for `make` php
  118. SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="${SPC_PHP_DEFAULT_OPTIMIZE_CFLAGS}"
  119. ; EXTRA_LIBS for `make` php
  120. SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-lresolv"
  121. [freebsd]
  122. ; compiler environments
  123. CC=clang
  124. CXX=clang++