-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild-linux
More file actions
executable file
·76 lines (60 loc) · 2.75 KB
/
build-linux
File metadata and controls
executable file
·76 lines (60 loc) · 2.75 KB
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
72
73
74
75
#!/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
# We use this script exclusively to build dev version, because static linking is hard
# For static linking we keep using the alpine docker image and buildx
# To make it work on fresh ubuntu jammy, run the following command:
# apt-get install -y libxml2 libcurl4 libonig5 libzip4
set -xe
. helper.sh
install_deps() {
sudo apt-get update -y
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update -y
sudo apt-get install -y php8.4 php8.4-dev php8.4-cli build-essential clang libclang-dev pkg-config curl autoconf automake bison re2c libzstd-dev git libssl-dev zlib1g-dev libzip-dev libonig-dev cmake libcurl4-openssl-dev librdkafka-dev libiconv-hook-dev wget
# Install LLVM 17 directly from apt.llvm.org
wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" | sudo tee /etc/apt/sources.list.d/llvm.list > /dev/null
sudo apt-get update -y
sudo apt-get install -y clang-17 lldb-17 lld-17 clangd-17 clang-tidy-17 clang-format-17 clang-tools-17 llvm-17-dev libomp-17-dev libc++-17-dev libc++abi-17-dev libclang-common-17-dev libclang-17-dev libclang-cpp17-dev || echo "LLVM 17 packages not all available, continuing..."
install_rust
}
install_dev_deps() {
sudo apt-get install -y libonig-dev libgmp-dev libxml2-dev
}
export -f install_deps install_dev_deps install_rust
. build-bash-base.sh "$@"
if [ "$BUILD_DEV" -eq 1 ]; then
build_dev_conf
fi
ENABLE_SHARED=yes
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 \
--enable-jchash \
--enable-simdjson \
--enable-llm \
--with-openssl --with-zlib --with-zip --with-iconv \
--enable-filter \
--with-curl \
--enable-mbstring \
--enable-shmop \
--enable-sysvsem \
--with-mysqli \
--enable-mysqlnd \
"${BUILD_EXTRA[@]}"
make -j8
make install-cli
# Remove php84 that was used for building before installing php
sudo apt-get remove -y php8.4-dev php8.4-cli php8.4