Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提示: 构建依赖库解决依赖的3种办法 #95

Open
jingjingxyk opened this issue Mar 27, 2023 · 0 comments
Open

提示: 构建依赖库解决依赖的3种办法 #95

jingjingxyk opened this issue Mar 27, 2023 · 0 comments

Comments

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Mar 27, 2023

办法一: 直接指定依赖库所在目录 。例如(--with-openssl=/usr/openssl)

办法二: 使用 pkg-config

办法三: 上述两种办法混用,大部分情况是(办法一)比(办法二)优先级高

为啥会混用,因为一部分库未提供 pkg-config 配置。 比如bzip2 ,iconv ,libgif

例子:构建 curl

            package_name='zlib openssl libcares libbrotlicommon libbrotlidec libbrotlienc libzstd libnghttp2 libidn2'
            CPPFLAGS="$(pkg-config  --cflags-only-I  --static $package_name)" \
            LDFLAGS="$(pkg-config   --libs-only-L    --static $package_name)" \
            LIBS="$(pkg-config      --libs-only-l    --static $package_name)" \
            ./configure --prefix=/usr/curl  \
            --enable-static \
            --disable-shared \
            --without-librtmp \
            --disable-ldap \
            --disable-rtsp \
            --enable-http \
            --enable-alt-svc \
            --enable-hsts \
            --enable-http-auth \
            --enable-mime \
            --enable-cookies \
            --enable-doh \
            --enable-threaded-resolver \
            --enable-ipv6 \
            --enable-proxy  \
            --enable-websockets \
            --enable-get-easy-options \
            --enable-file \
            --enable-mqtt \
            --enable-unix-sockets  \
            --enable-progress-meter \
            --enable-optimize \
            --with-zlib=/usr/zlib \
            --with-openssl=/usr/openssl \
            --enable-ares=/usr/cares \
            --with-default-ssl-backend=openssl \
            --with-libidn2 \
            --with-nghttp2 \
            --without-ngtcp2 \
            --without-nghttp3 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant