# ext/snmp building shared

- Thread: https://externals.io/message/5336
- Original archive: https://news-web.php.net/php.internals/5336
- Started by Brian J. France on 2003-11-11T04:19:36+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #5336 — Brian J. France — 2003-11-11T04:19:36+00:00

URL: https://externals.io/message/5336#5336

I am having a problem building snmp as a shared extension since the move to 
PHP_SETUP_OPENSSL.

The big problem is libssl.so on FreeBSD doesn't have a dependence on 
libcrypt.so, but I don't think I can get fixed anytime soon.

When running ./configure for the shared extension it fails for the test of 
SSL_CTX_set_ssl_version because of undefined symbols.  This is because it is 
only linking with -lssl and not -lssl -lcrypto.

Short of hacking the generated configure script and adding:

   LIBS="$LIBS -lcrypt";

right before the SSL_CTX_set_ssl_version, I don't know how to fix it.

Any ideas?

Thanks,

Brian

acinclude.m4:

1660     PHP_CHECK_LIBRARY(crypto, CRYPTO_free, [
1661       PHP_ADD_LIBRARY(crypto,,$1)
1662     ],[
1663       AC_MSG_ERROR([libcrypto not found!])
1664     ],[
1665       -L$OPENSSL_LIBDIR
1666     ])
1667   
1668     PHP_CHECK_LIBRARY(ssl, SSL_CTX_set_ssl_version, [
1669       PHP_ADD_LIBRARY(ssl,,$1)
1670       found_openssl=yes
1671     ],[
1672       AC_MSG_ERROR([libssl not found!])
1673     ],[
1674       -L$OPENSSL_LIBDIR
1675     ])
1676   fi
