How to tell Autoconf “require symbol A or B” from LIB?

后端 未结 2 794
礼貌的吻别
礼貌的吻别 2021-01-26 02:15

I\'m trying to configure Postgres 9.5.4 for OpenSSL 1.1.0. Configure is dying because it can\'t find SSL_library_init in OpenSSL 1.1.0. OpenSSL 1.1.0 provides

2条回答
  •  感情败类
    2021-01-26 02:30

    Something like this should work out for you:

    ACCEPT_SSL_LIB="no"
    AC_CHECK_LIB(ssl, OPENSSL_init_ssl, [ACCEPT_SSL_LIB="yes"])
    AC_CHECK_LIB(ssl, SSL_library_init, [ACCEPT_SSL_LIB="yes"])
    AS_IF([test "x$ACCEPT_SSL_LIB" = xno], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
    

    You may need another variable to tell you what init function to call, to set up SSL, unless there's some macro magic in a header file that will actually fix it up to the right value.

提交回复
热议问题