You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: config/env.ini
+9-10Lines changed: 9 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,11 @@
7
7
;
8
8
; We need to use some pre-defined internal env vars, like `BUILD_ROOT_PATH`, `DOWNLOAD_PATH`, etc.
9
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
10
;
11
+
; Here's a list of env vars, these value cannot be changed anywhere:
12
+
;
13
+
; WORKING_DIR: the working directory of the build process. (default: `$(pwd)`)
14
+
; 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`)
12
15
; BUILD_ROOT_PATH: the root path of the build process. (default: `$(pwd)/buildroot`)
13
16
; BUILD_INCLUDE_PATH: the path of the include files. (default: `$BUILD_ROOT_PATH/include`)
14
17
; BUILD_LIB_PATH: the path of the lib files. (default: `$BUILD_ROOT_PATH/lib`)
@@ -17,21 +20,17 @@
17
20
; SOURCE_PATH: the path of the source files. (default: `$(pwd)/source`)
18
21
; DOWNLOAD_PATH: the path of the download files. (default: `$(pwd)/downloads`)
19
22
; CPU_COUNT: the count of the CPU cores. (default: `$(nproc)`)
23
+
; SPC_ARCH: the arch of the current system, for some libraries needed `--host=XXX` args. (default: `$(uname -m)`, e.g. `x86_64`, `aarch64`, `arm64`)
20
24
; GNU_ARCH: the GNU arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `aarch64`)
21
25
; MAC_ARCH: the MAC arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `arm64`)
22
26
;
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 *
27
+
; * These vars are only be defined in Unix (macOS, Linux, FreeBSD)Builder and cannot be changed anywhere:
29
28
; PATH: static-php-cli will add `$BUILD_BIN_PATH` to PATH.
30
29
; PKG_CONFIG: static-php-cli will set `$BUILD_BIN_PATH/pkg-config` to PKG_CONFIG.
31
30
; PKG_CONFIG_PATH: static-php-cli will set `$BUILD_LIB_PATH/pkgconfig` to PKG_CONFIG_PATH.
32
31
; SPC_PHP_DEFAULT_OPTIMIZE_CFLAGS: the default optimization CFLAGS for compiling php. (if --no-strip option is set: `-g -O0`, else: `-g -Os`)
33
32
;
34
-
; * These vars are only be defined in LinuxBuilder *
33
+
; * These vars are only be defined in LinuxBuilder and cannot be changed anywhere:
35
34
; SPC_LINUX_DEFAULT_CC: the default compiler for linux. (For alpine linux: `gcc`, default: `$GNU_ARCH-linux-musl-gcc`)
36
35
; SPC_LINUX_DEFAULT_CXX: the default c++ compiler for linux. (For alpine linux: `g++`, default: `$GNU_ARCH-linux-musl-g++`)
37
36
; SPC_LINUX_DEFAULT_AR: the default archiver for linux. (For alpine linux: `ar`, default: `$GNU_ARCH-linux-musl-ar`)
@@ -45,7 +44,7 @@ SPC_SKIP_PHP_VERSION_CHECK="no"
45
44
; Ignore some check item for bin/spc doctor command, comma separated (e.g. SPC_SKIP_DOCTOR_CHECK_ITEMS="if homebrew has installed")
46
45
SPC_SKIP_DOCTOR_CHECK_ITEMS=""
47
46
; EXTENSION_DIR where the built php will look for extension when a .ini instructs to load them
48
-
; only useful for builds targeting glibc --libc=glibc
47
+
; only useful for builds targeting not pure-static linking
if (str_ends_with(getenv('CC'), 'linux-musl-gcc') && !file_exists("/usr/local/musl/bin/{$arch}-linux-musl-gcc") && (getenv('SPC_NO_MUSL_PATH') !== 'yes')) {
50
-
thrownewWrongUsageException('musl-cross-make not installed, please install it first. (You can use `doctor` command to install it)');
42
+
if (!file_exists("/usr/local/musl/{$arch}-linux-musl/lib/libc.a")) {
43
+
thrownewWrongUsageException('You are building with musl-libc target in glibc distro, but musl-toolchain is not installed, please install musl-toolchain first. (You can use `doctor` command to install it)');
44
+
}
51
45
}
52
46
53
47
// concurrency
@@ -216,10 +210,8 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
216
210
$this->buildEmbed();
217
211
}
218
212
219
-
if (php_uname('m') === $this->getOption('arch')) {
0 commit comments