1010
1111arch=" $( uname -m) "
1212os=" $( uname -s | tr ' [:upper:]' ' [:lower:]' ) "
13+ # FIXME: re-enable PHP errors when SPC will be compatible with PHP 8.4
14+ spcCommand=" php -ddisplay_errors=Off ./bin/spc"
1315md5binary=" md5sum"
1416if [ " ${os} " = " darwin" ]; then
1517 os=" mac"
@@ -114,10 +116,10 @@ else
114116 extraOpts=" ${extraOpts} --no-strip"
115117 fi
116118
117- ./bin/spc doctor --auto-fix
118- ./bin/spc download --with-php=" ${PHP_VERSION} " --for-extensions=" ${PHP_EXTENSIONS} " --for-libs=" ${PHP_EXTENSION_LIBS} " --ignore-cache-sources=php-src --prefer-pre-built
119+ ${spcCommand} doctor --auto-fix
120+ ${spcCommand} download --with-php=" ${PHP_VERSION} " --for-extensions=" ${PHP_EXTENSIONS} " --for-libs=" ${PHP_EXTENSION_LIBS} " --ignore-cache-sources=php-src --prefer-pre-built
119121 # shellcheck disable=SC2086
120- ./bin/spc build --debug --enable-zts --build-embed ${extraOpts} " ${PHP_EXTENSIONS} " --with-libs=" ${PHP_EXTENSION_LIBS} "
122+ ${spcCommand} build --debug --enable-zts --build-embed ${extraOpts} " ${PHP_EXTENSIONS} " --with-libs=" ${PHP_EXTENSION_LIBS} "
121123fi
122124
123125curlGitHubHeaders=(--header " X-GitHub-Api-Version: 2022-11-28" )
@@ -144,7 +146,7 @@ cp -R include/wtr/watcher-c.h ../../buildroot/include/wtr/watcher-c.h
144146cd ../../
145147
146148# See https://github.com/docker-library/php/blob/master/8.3/alpine3.20/zts/Dockerfile#L53-L55
147- CGO_CFLAGS=" -DFRANKENPHP_VERSION=${FRANKENPHP_VERSION} -I${PWD} /buildroot/include/ $( ./buildroot/bin/php -config --includes | sed s#-I/ # -I "${PWD}"/buildroot/#g )"
149+ CGO_CFLAGS=" -DFRANKENPHP_VERSION=${FRANKENPHP_VERSION} -I${PWD} /buildroot/include/ $( ${spcCommand} spc -config " ${PHP_EXTENSIONS} " --with-libs= " ${PHP_EXTENSION_LIBS} " --includes ) "
148150if [ -n " ${DEBUG_SYMBOLS} " ]; then
149151 CGO_CFLAGS=" -g ${CGO_CFLAGS} "
150152else
@@ -159,7 +161,7 @@ elif [ "${os}" = "linux" ] && [ -z "${DEBUG_SYMBOLS}" ]; then
159161 CGO_LDFLAGS=" -Wl,-O1 -pie"
160162fi
161163
162- CGO_LDFLAGS=" ${CGO_LDFLAGS} ${PWD} /buildroot/lib/libbrotlicommon.a ${PWD} /buildroot/lib/libbrotlienc.a ${PWD} /buildroot/lib/libbrotlidec.a ${PWD} /buildroot/lib/libwatcher-c.a $( ./buildroot/bin/php -config --ldflags || true ) $( ./buildroot/bin/php-config --libs | sed -e ' s/-lgcc_s//g ' || true ) "
164+ CGO_LDFLAGS=" ${CGO_LDFLAGS} ${PWD} /buildroot/lib/libbrotlicommon.a ${PWD} /buildroot/lib/libbrotlienc.a ${PWD} /buildroot/lib/libbrotlidec.a ${PWD} /buildroot/lib/libwatcher-c.a $( ${spcCommand} spc -config " ${PHP_EXTENSIONS} " --with- libs= " ${PHP_EXTENSION_LIBS} " --libs ) "
163165if [ " ${os} " = " linux" ]; then
164166 if echo " ${PHP_EXTENSIONS} " | grep -qE " \b(intl|imagick|grpc|v8js|protobuf|mongodb|tbb)\b" ; then
165167 CGO_LDFLAGS=" ${CGO_LDFLAGS} -lstdc++"
0 commit comments