-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-alpine
executable file
·71 lines (55 loc) · 2.09 KB
/
build-alpine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
# Copyright (c) 2022, Manticore Software LTD (https://manticoresearch.com)
# This program is free software; you can redistribute it and/or modify
# it under the terms of the The PHP License, version 3.01. You should have
# received a copy of the license along with this program; if you did not,
# you can find it at https://www.php.net/license/3_01.txt
set -xe
. helper.sh
install_deps() {
arch=$(arch)
# Do basic configuration of the system, and install build tools
apk update && \
apk add binutils cmake make libgcc musl-dev gcc g++ perl \
oniguruma-dev linux-headers file && \
ln -s "/usr/bin/${arch}-alpine-linux-musl-gcc-ar" "/usr/bin/${arch}-alpine-linux-musl-ar" && \
ln -s "/usr/bin/${arch}-alpine-linux-musl-gcc-ranlib" "/usr/bin/${arch}-alpine-linux-musl-ranlib" && \
ln -s "/usr/bin/${arch}-alpine-linux-musl-gcc-nm" "/usr/bin/${arch}-alpine-linux-musl-nm" && \
ln -s /usr/bin/strip "/usr/bin/${arch}-alpine-linux-musl-strip" && \
ln -s /usr/bin/objcopy "/usr/bin/${arch}-alpine-linux-musl-objcopy"
export CROSS_COMPILE="/usr/bin/${arch}-alpine-linux-musl-"
apk add curl git autoconf bison re2c pkgconf zlib-dev zstd-dev openssl-libs-static openssl-dev zlib-static zlib-dev
install_curl
install_libzip
install_zlib
install_rdkafka
}
install_dev_deps() {
apk add gmp-dev judy-dev bsd-compat-headers m4
install_libxml2
}
export -f install_deps install_dev_deps
. build-bash-base.sh "$@"
if [ "$BUILD_DEV" -eq 1 ]; then
build_dev_conf
fi
MAKE_LDFLAGS=-ldl
ENABLE_SHARED=no
ENABLE_STATIC=yes
./configure CFLAGS="-O3" --prefix="$BUILD_PREFIX" --disable-all \
--enable-shared=$ENABLE_SHARED --enable-static=$ENABLE_STATIC --with-layout=GNU \
--with-pear=no --disable-cgi --disable-phpdbg \
--with-pcre-jit --enable-zstd --with-libzstd \
--enable-pcntl --enable-posix \
--enable-sockets \
--enable-ds \
--enable-swoole \
--with-rdkafka \
--with-openssl --with-zlib --with-zip \
--enable-filter \
--with-curl \
--enable-mbstring \
"${BUILD_EXTRA[@]}"
fix_static_linking
make LDFLAGS=$MAKE_LDFLAGS -j8
make install-cli