I was building out the ssh2 extension (0.10) under OpenBSD 3.9 on sparc64 and I got this error when running configure:
checking for libssh2_banner_set in -lssh2... no
configure: error: libssh2 version >= 0.4 not found
I did some poking around in the configure file and traced the problem down. The reason for the failure is that configure is trying to compile a test program with -ldl. libdl is not installed on OpenBSD 3.9. The OpenBSD folks purged libdl years ago and I could not find a package that contains it.
(The error message above is misleading because the problem is not with libssh2.)
I looked at the ssh2 extension code and could not see a reason for using libdl, so I removed the -ldl from the config.m4 file. Re-ran phpize and configure. No errors. Did make and installed ssh2.so. Works fine.