Haivision / srt

Secure, Reliable, Transport
https://www.srtalliance.org
Mozilla Public License 2.0
3.05k stars 839 forks source link

[BUG] Compile args OPENSSL_INCLUDE_DIR be ignored by pkg-config when openssl-dev installed #2690

Closed Philogag closed 1 year ago

Philogag commented 1 year ago

Describe the bug When I trying to cross-compile srt with my prebuilt openssl-3.0, I provide those args to srt configration:

But it find the openssl-1.1.1 install in system by pkg-config, and told me those three args has been ignored. And then at further compile, it failed at

haicrypt/cryspr-openssl.h:23:10: fatal error: openssl/evp.h: No such file or directory

To Reproduce

./configure \
        --disable-apps \
        --disable-static \
        --prefix=/home/yuhr/iwork/workspace/sigmastar/src/PanGu2022/opensource/srt/__install \
        --openssl-crypto-library=${CROSS_COMPILE_OPENSSL_INSTALL}/lib/libcrypto.so \
        --openssl-ssl-library=${CROSS_COMPILE_OPENSSL_INSTALL}/lib/libssl.so \
        --openssl-include-dir=${CROSS_COMPILE_OPENSSL_INSTALL}/include \
        --with-compiler-prefix=arm-linux-gnueabihf-sigmastar-9.1.0- \
        --with-target-path=/opt/sigmastar/gcc-sigmastar-9.1.0-2020.07-x86_64_arm-linux-gnueabihf

Expected behavior Skip search for openssl by pkg-config and use the profide args.

Screenshots here is some logs of configradion

...
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
...
-- Checking for module 'openssl libcrypto'
--   Found openssl libcrypto, version 1.1.1h;1.1.1h
-- SSL via pkg-config: -L /usr/local/lib -I /usr/local/include -l;ssl;crypto
-- ENCRYPTION: ENABLED, using: openssl libcrypto
-- SSL libraries: ssl;crypto
...
CMake Warning:
  Manually-specified variables were not used by the project:

    OPENSSL_CRYPTO_LIBRARY
    OPENSSL_INCLUDE_DIR
    OPENSSL_SSL_LIBRARY
...

I don't have premission to remove or upgrade the system installed openssl-dev in out compile server.

Philogag commented 1 year ago

Sorry to bother you. I found the --use-openssl-pc=false from CmakeLists.txt can solve this problem