diff options
author | François Andriot <francois.andriot@free.fr> | 2014-10-07 00:35:21 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-12-23 02:22:53 +0100 |
commit | e9de7e84a390cfde4d8b55449ea537899d637a9c (patch) | |
tree | 18dc9a7ecc00a90db82c4a01842b1694e463531f | |
parent | 4a476fb93718e16effd65d5ba8db8236570edc58 (diff) | |
download | tdelibs-e9de7e84a390cfde4d8b55449ea537899d637a9c.tar.gz tdelibs-e9de7e84a390cfde4d8b55449ea537899d637a9c.zip |
Fix openpty detection on openbsd
(cherry picked from commit e255a8ca6387cc1f100beffe39f889328e8f2a41)
-rw-r--r-- | CMakeLists.txt | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4182ee217..79cc3efe9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -443,16 +443,29 @@ if( HAVE_RES_INIT ) endif( HAVE_RES_INIT) set( CMAKE_REQUIRED_LIBRARIES util ) -check_c_source_runs(" - #include <pty.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 -) +if( HAVE_PTY_H ) + check_c_source_runs(" + #include <pty.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 + ) +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 ) set( LIB_UTIL util ) endif( ) |