-
Notifications
You must be signed in to change notification settings - Fork 0
/
carthage.sh
92 lines (78 loc) · 1.97 KB
/
carthage.sh
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env sh
# Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
# SPDX-License-Identifier: ISC
set -xeu
if ! test -f cosmocc.zip
then wget https://cosmo.zip/pub/cosmocc/cosmocc.zip
fi
if ! test -f php-8.3.9.tar.gz
then wget https://www.php.net/distributions/php-8.3.9.tar.gz
fi
if ! test -f ph7.zip
then wget -O ph7.zip https://github.com/alganet/PH7/archive/refs/heads/master.zip
fi
if ! test -d cosmocc
then
mkdir cosmocc
cd cosmocc
unzip ../cosmocc.zip
cd ..
fi
if ! test -d php
then
mkdir php
cd php
tar --extract --strip-components=1 --file ../php-8.3.9.tar.gz
cd ..
fi
if ! test -d ph7
then
mkdir ph7
cd ph7
unzip ../ph7.zip
mv PH7-master/* .
rm -rf PH7-master
cd ..
fi
set -x
mkdir -p target/bin
export PATH="$PWD/cosmocc/bin:$PATH"
export CC="cosmocc -I$PWD/cosmocc/include -L$PWD/cosmocc/lib"
export CXX="cosmoc++ -I$PWD/cosmocc/include -L$PWD/cosmocc/lib"
export PKG_CONFIG="pkg-config --with-path=$PWD/cosmocc/lib/pkgconfig"
export INSTALL="cosmoinstall"
export AR="cosmoar"
if ! test -f target/bin/ph7-2.1.4
then
cd ph7
$CC -o ph7 ph7.c examples/ph7_interp.c -W -Wunused -Wall -I.
$INSTALL -c -m 755 ph7 ../target/bin/ph7-2.1.4
../target/bin/ph7-2.1.4 ../litmus.php
cd ..
fi
if ! test -f target/bin/php-8.3.9
then
cd php
patch -Np0 -i ../patches/php-8.3.9/cosmo-multicast.patch
./buildconf --force
./configure --prefix=$PWD/../target \
--disable-all \
--disable-shared \
--disable-fiber-asm \
--enable-ctype \
--enable-filter \
--enable-fileinfo \
--enable-ftp \
--enable-gmp \
--enable-pcntl \
--enable-posix \
--enable-session \
--enable-sockets \
--enable-tokenizer
make -j $(nproc)
make install-cli install-phpdbg
mv ../target/bin/php ../target/bin/php-8.3.9
mv ../target/bin/phpdbg ../target/bin/phpdbg-8.3.9
../target/bin/php-8.3.9 ../litmus.php
cd ..
fi