Skip to content

Commit

Permalink
更新构建脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Apr 16, 2022
1 parent 25cc1ac commit 028bf19
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 40 deletions.
92 changes: 56 additions & 36 deletions make.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
SRC=/home/htf/soft/php-8.1.3
SRC=/home/htf/soft/php-8.1.5
ROOT=$(pwd)
export CC=clang
export CXX=clang++
export LD=ld.lld
export PKG_CONFIG_PATH=/usr/curl/lib/pkgconfig:/usr/libwebp/lib/pkgconfig:/usr/freetype/lib/pkgconfig:/usr/libjpeg/lib64/pkgconfig:/usr/libpng/lib/pkgconfig:/usr/giflib/lib/pkgconfig:/usr/gmp/lib/pkgconfig:/usr/imagemagick/lib/pkgconfig:/usr/openssl/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/usr/libyaml/lib/pkgconfig:/usr/curl/lib/pkgconfig:/usr/libwebp/lib/pkgconfig:/usr/freetype/lib/pkgconfig:/usr/libjpeg/lib64/pkgconfig:/usr/libpng/lib/pkgconfig:/usr/giflib/lib/pkgconfig:/usr/gmp/lib/pkgconfig:/usr/imagemagick/lib/pkgconfig:/usr/libxml2/lib/pkgconfig:/usr/openssl/lib/pkgconfig:$PKG_CONFIG_PATH
OPTIONS="--disable-all \
--with-openssl=/usr/openssl --with-openssl-dir=/usr/openssl \
--with-curl=/usr/curl \
--with-curl \
--with-iconv=/usr/libiconv \
--with-bz2 \
--with-bz2=/usr/bzip2 \
--enable-bcmath \
--enable-pcntl \
--enable-filter \
Expand Down Expand Up @@ -406,8 +406,8 @@ make_curl() {
mkdir -p /work/libs/curl && \
tar --strip-components=1 -C /work/libs/curl -xf /work/pool/lib/curl-7.80.0.tar.gz && \
cd curl && \
echo "autoreconf -fi && ./configure --prefix=/usr/curl --enable-static --disable-shared --with-openssl=/usr/openssl"
autoreconf -fi && ./configure --prefix=/usr/curl --enable-static --disable-shared --with-openssl=/usr/openssl && \
echo "autoreconf -fi && ./configure --prefix=/usr/curl --enable-static --disable-shared --with-openssl=/usr/openssl --without-librtmp --without-brotli --without-libidn2 --disable-ldap --disable-rtsp --without-zstd --without-nghttp2 --without-nghttp3"
autoreconf -fi && ./configure --prefix=/usr/curl --enable-static --disable-shared --with-openssl=/usr/openssl --without-librtmp --without-brotli --without-libidn2 --disable-ldap --disable-rtsp --without-zstd --without-nghttp2 --without-nghttp3 && \
make -j 8 && \
make install
cd -
Expand Down Expand Up @@ -499,7 +499,7 @@ config_php() {

make_php() {
make EXTRA_CFLAGS='-fno-ident -Xcompiler -march=nehalem -Xcompiler -mtune=haswell -Os' \
EXTRA_LDFLAGS_PROGRAM='-all-static -fno-ident -L/usr/openssl/lib -L/usr/libiconv/lib -L/usr/imagemagick/lib -L/usr/gmp/lib -L/usr/giflib/lib -L/usr/libpng/lib -L/usr/libjpeg/lib64 -L/usr/freetype/lib -L/usr/libwebp/lib -L/usr/bzip2/lib -L/usr/curl/lib -L/usr/libyaml/lib ' -j 8 && echo ""
EXTRA_LDFLAGS_PROGRAM='-all-static -fno-ident -L/usr/openssl/lib -L/usr/libiconv/lib -L/usr/libxml2/lib -L/usr/imagemagick/lib -L/usr/gmp/lib -L/usr/giflib/lib -L/usr/libpng/lib -L/usr/libjpeg/lib64 -L/usr/freetype/lib -L/usr/libwebp/lib -L/usr/bzip2/lib -L/usr/curl/lib -L/usr/libyaml/lib ' -j 8 && echo ""
}

help() {
Expand Down Expand Up @@ -594,48 +594,69 @@ elif [ "$1" = "clean-library" ] ;then
elif [ "$1" = "diff-configure" ] ;then
meld $SRC/configure.ac ./configure.ac
elif [ "$1" = "pkg-check" ] ;then
echo "openssl"
echo "[openssl]"
pkg-config --libs openssl
echo "libiconv"
echo "==========================================================="
echo "[libiconv]"
pkg-config --libs libiconv
echo "libxml2"
pkg-config --libs libxml2
echo "libxslt"
echo "==========================================================="
echo "[libxml2]"
pkg-config --libs libxml-2.0
echo "==========================================================="
echo "[libxslt]"
pkg-config --libs libxslt
echo "imagemagick"
echo "==========================================================="
echo "[imagemagick]"
pkg-config --libs ImageMagick
echo "gmp"
echo "==========================================================="
echo "[gmp]"
pkg-config --libs gmp
echo "giflib"
echo "==========================================================="
echo "[giflib]"
pkg-config --libs giflib
echo "libpng"
echo "==========================================================="
echo "[libpng]"
pkg-config --libs libpng
echo "libjpeg"
echo "==========================================================="
echo "[libjpeg]"
pkg-config --libs libjpeg
echo "freetype"
pkg-config --libs freetype
echo "libwebp"
echo "==========================================================="
echo "[freetype]"
pkg-config --libs freetype2
echo "==========================================================="
echo "[libwebp]"
pkg-config --libs libwebp
echo "sqlite3"
echo "==========================================================="
echo "[sqlite3]"
pkg-config --libs sqlite3
echo "zlib"
echo "==========================================================="
echo "[zlib]"
pkg-config --libs zlib
echo "bzip2"
echo "==========================================================="
echo "[bzip2]"
pkg-config --libs bzip2
echo "icu"
pkg-config --libs icu
echo "oniguruma"
echo "==========================================================="
echo "[icu]"
pkg-config --libs icu-i18n
echo "==========================================================="
echo "[oniguruma]"
pkg-config --libs oniguruma
echo "zip"
pkg-config --libs zip
echo "cares"
pkg-config --libs cares
echo "curl"
echo "==========================================================="
echo "[zip]"
pkg-config --libs libzip
echo "==========================================================="
echo "[cares]"
pkg-config --libs libcares
echo "==========================================================="
echo "[curl]"
pkg-config --libs libcurl
echo "libsodium"
echo "==========================================================="
echo "[libsodium]"
pkg-config --libs libsodium
echo "libyaml"
pkg-config --libs libyaml
echo "==========================================================="
echo "[libyaml]"
pkg-config --libs yaml-0.1
echo "==========================================================="
elif [ "$1" = "sync" ] ;then
echo "sync"
# ZendVM
Expand Down Expand Up @@ -690,8 +711,7 @@ elif [ "$1" = "sync" ] ;then
cp -r $SRC/ext/zip/ ./ext
cp -r $SRC/ext/zlib/ ./ext
# main
cp -r $SRC/main ./main
cp -r sapi/cli sapi/cli
cp -r $SRC/main ./
cp -r ./TSRM/TSRM.h main/TSRM.h
exit 0
else
Expand Down
4 changes: 2 additions & 2 deletions prepare.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}

$p = new Preprocessor(__DIR__);
$p->setPhpSrcDir('/home/htf/soft/php-8.1.3');
$p->setPhpSrcDir('/home/htf/soft/php-8.1.5');
$p->setDockerVersion('1.1');
$p->setSwooleDir('/home/htf/workspace/swoole');

Expand Down Expand Up @@ -449,4 +449,4 @@ function install_curl(Preprocessor $p)
$p->gen();
$p->info();

$endCallback($p);
$endCallback($p);
7 changes: 7 additions & 0 deletions sapi/Preprocessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,20 @@ class Library extends Project
public string $makeOptions = '';
public string $pkgConfig = '';
public string $pkgName = '';
public string $prefix = '/usr/local';

function withUrl(string $url): static
{
$this->url = $url;
return $this;
}

function withPrefix(string $prefix): static
{
$this->prefix = $prefix;
return $this;
}

function withFile(string $file): static
{
$this->file = $file;
Expand Down
3 changes: 1 addition & 2 deletions sapi/make.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@
cp -r $SRC/ext/zip/ ./ext
cp -r $SRC/ext/zlib/ ./ext
# main
cp -r $SRC/main ./main
cp -r sapi/cli sapi/cli
cp -r $SRC/main ./
cp -r ./TSRM/TSRM.h main/TSRM.h
exit 0
else
Expand Down

0 comments on commit 028bf19

Please sign in to comment.