Skip to content

大佬: 把pkg-config 充分利用起来,因为编译链接时要连接的库特别多 #42

@jingjingxyk

Description

@jingjingxyk

举个例子:libwebp

我为了启用gd库 扩展,编译PHP 是发现待处理的问题越多;需要解决连接 LIBS ,比如: -lwebpdemux -lm -pthread -lwebpdecoder -lwebp -lturbojpeg -lsharpyuv -lz

越来越多的 各种 lib.pc

 ./bin/spc build "bcmath,tokenizer,pdo,ftp,gd" --cc=clang --cxx=clang++  --debug

image

最好在 编译 php 是 导入变量

    PACKAGES="libbrotlicommon libbrotlidec libbrotlienc libzip  libjpeg libturbojpeg freetype2 libpng libpng16 libwebp "
    export  CPPFLAGS="$(pkg-config --cflags-only-I --static $PACKAGES ) "
    export  LDFLAGS=" $(pkg-config --libs-only-L --static $PACKAGES ) "
    export  LIBS=" $(pkg-config --libs-only-l --static $PACKAGES ) -lstdc++"

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedFixed issuekind/dependencyIssues related to dependencies

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions