Skip to content

Commit 36fd85e

Browse files
committed
Enforce complete libssh2 1.9 builds
Treat missing agent and session-timeout symbols as configuration errors once the libssh2 1.9 header floor has been accepted. This prevents header and library mismatches from silently producing a reduced SSH2 API.\n\nName the missing library or symbol in each error so failed builds point directly to the mismatched dependency.
1 parent 13825fb commit 36fd85e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

config.m4

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,23 +1067,23 @@ EOF
10671067
PHP_ADD_LIBRARY_WITH_PATH(ssh2, $SSH2_DIR/lib, SWOOLE_SHARED_LIBADD)
10681068
AC_DEFINE(SW_HAVE_SSH2LIB, 1, [Have libssh2])
10691069
],[
1070-
AC_MSG_ERROR([libssh2 version >= 1.9.0 not found])
1070+
AC_MSG_ERROR([libssh2 library not found or too old; version 1.9.0 or newer is required])
10711071
],[
10721072
-L$SSH2_DIR/lib -lm
10731073
])
10741074

10751075
PHP_CHECK_LIBRARY(ssh2, libssh2_agent_init, [
10761076
AC_DEFINE(PHP_SSH2_AGENT_AUTH, 1, [Have libssh2 with ssh-agent support])
10771077
],[
1078-
AC_MSG_WARN([libssh2 <= 1.2.3, ssh-agent subsystem support not enabled])
1078+
AC_MSG_ERROR([libssh2_agent_init not found; ensure the linked libssh2 matches the 1.9.0 or newer headers])
10791079
],[
10801080
-L$SSH2_DIR/lib -lm
10811081
])
10821082

10831083
PHP_CHECK_LIBRARY(ssh2, libssh2_session_set_timeout, [
10841084
AC_DEFINE(PHP_SSH2_SESSION_TIMEOUT, 1, [Have libssh2 with session timeout support])
10851085
],[
1086-
AC_MSG_WARN([libssh2 < 1.2.9, session timeout support not enabled])
1086+
AC_MSG_ERROR([libssh2_session_set_timeout not found; ensure the linked libssh2 matches the 1.9.0 or newer headers])
10871087
],[
10881088
-L$SSH2_DIR/lib -lm
10891089
])

0 commit comments

Comments
 (0)