Fix openpty detection on openbsd

(cherry picked from commit e255a8ca63)
v3.5.13-sru
François Andriot 10 years ago committed by Slávek Banko
parent 4a476fb937
commit e9de7e84a3

@ -443,16 +443,29 @@ if( HAVE_RES_INIT )
endif( HAVE_RES_INIT) endif( HAVE_RES_INIT)
set( CMAKE_REQUIRED_LIBRARIES util ) set( CMAKE_REQUIRED_LIBRARIES util )
check_c_source_runs(" if( HAVE_PTY_H )
#include <pty.h> check_c_source_runs("
int main(int argc, char* argv) { #include <pty.h>
int master_fd, slave_fd; int main(int argc, char* argv) {
int result; int master_fd, slave_fd;
result = openpty(&master_fd, &slave_fd, 0, 0, 0); int result;
return 0; result = openpty(&master_fd, &slave_fd, 0, 0, 0);
}" return 0;
HAVE_OPENPTY }"
) HAVE_OPENPTY
)
elseif( HAVE_UTIL_H )
check_c_source_runs("
#include <util.h>
int main(int argc, char* argv) {
int master_fd, slave_fd;
int result;
result = openpty(&master_fd, &slave_fd, 0, 0, 0);
return 0;
}"
HAVE_OPENPTY
)
endif( )
if( HAVE_OPENPTY ) if( HAVE_OPENPTY )
set( LIB_UTIL util ) set( LIB_UTIL util )
endif( ) endif( )

Loading…
Cancel
Save