Skip to content

Commit

Permalink
debian 环境下 屏蔽pgsql 构建动态库
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Jul 27, 2023
1 parent b9253c6 commit 795887b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sapi/src/builder/library/pgsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
return function (Preprocessor $p) {
$pgsql_prefix = PGSQL_PREFIX;
$option = '';
$ldflags = $p->getOsType() == 'macos' ? '' : ' -static ';
if ($p->getOsType() == 'macos') {
$option = '--disable-thread-safety';
}
Expand All @@ -31,14 +32,16 @@
# 121行 替换内容
sed -i.backup "s/invokes exit\'; exit 1;/invokes exit\';/" ../src/interfaces/libpq/Makefile
sed -i.backup "293 s/^/#$/" ../src/Makefile.shlib
sed -i.backup "441 s/^/#$/" ../src/Makefile.shlib
# 静态链接方法二:
# 102行,整行替换
# sed -i.backup "102c all: all-lib" ../src/interfaces/libpq/Makefile
PACKAGES="openssl zlib icu-uc icu-io icu-i18n readline libxml-2.0 libxslt libzstd liblz4"
CPPFLAGS="$(pkg-config --cflags-only-I --static \$PACKAGES )" \
LDFLAGS="$(pkg-config --libs-only-L --static \$PACKAGES )" \
LDFLAGS="$(pkg-config --libs-only-L --static \$PACKAGES ) {$ldflags} " \
LIBS="$(pkg-config --libs-only-l --static \$PACKAGES )" \
../configure \
--prefix={$pgsql_prefix} \
Expand Down

0 comments on commit 795887b

Please sign in to comment.