@@ -25,7 +25,7 @@ os="$(uname -s | tr '[:upper:]' '[:lower:]')"
2525# - SPC_REL_TYPE: Release type to download (accept "source" and "binary", default: "source")
2626# - SPC_OPT_BUILD_ARGS: Additional arguments to pass to spc build
2727# - SPC_OPT_DOWNLOAD_ARGS: Additional arguments to pass to spc download
28- # - SPC_BUILD_GNU : Set to 1 to build with GNU toolchain (default: musl toolchain )
28+ # - SPC_LIBC : Set to glibc to build with GNU toolchain (default: musl)
2929
3030# init spc command, if we use spc binary, just use it instead of fetching source
3131if [ -z " ${SPC_REL_TYPE} " ]; then
3939if [ -z " ${SPC_OPT_DOWNLOAD_ARGS} " ]; then
4040 SPC_OPT_DOWNLOAD_ARGS=" --prefer-pre-built --debug --ignore-cache-sources=php-src"
4141fi
42- # linux build need to disable opcache jit
43- if [ " ${os} " = " linux" ]; then
44- SPC_OPT_BUILD_ARGS=" ${SPC_OPT_BUILD_ARGS} --disable-opcache-jit"
45- fi
4642# if we need debug symbols, disable strip
4743if [ -n " ${DEBUG_SYMBOLS} " ]; then
4844 SPC_OPT_BUILD_ARGS=" ${SPC_OPT_BUILD_ARGS} --no-strip"
344340
345341go env
346342cd caddy/
347- if [ -z " ${SPC_BUILD_GNU} " ]; then
343+ if [ -z " ${SPC_LIBC} " ] || [ " ${SPC_LIBC} " = " musl " ]; then
348344 xcaddyGoBuildFlags=" -buildmode=pie -tags cgo,netgo,osusergo,static_build,nobadger,nomysql,nopgx -ldflags \" -linkmode=external -extldflags '-static-pie ${extraExtldflags} ' ${extraLdflags} -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP ${FRANKENPHP_VERSION} PHP ${LIBPHP_VERSION} Caddy'\" "
349- else
345+ elif [ " ${SPC_LIBC} " = " glibc " ] ; then
350346 xcaddyGoBuildFlags=" -buildmode=pie -tags cgo,netgo,osusergo,nobadger,nomysql,nopgx -ldflags \" -linkmode=external -extldflags '-pie ${extraExtldflags} ' ${extraLdflags} -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP ${FRANKENPHP_VERSION} PHP ${LIBPHP_VERSION} Caddy'\" "
351347fi
352348
0 commit comments