summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorFrançois Andriot <francois.andriot@free.fr>2014-10-07 00:35:21 +0200
committerSlávek Banko <slavek.banko@axis.cz>2014-10-07 01:34:09 +0200
commite255a8ca6387cc1f100beffe39f889328e8f2a41 (patch)
tree11cb9e92b6cb545177243d3f1fdf5fd3f2afface /CMakeLists.txt
parent223f0c75788822208fd74259969948658bc26e2c (diff)
downloadtdelibs-e255a8ca6387cc1f100beffe39f889328e8f2a41.tar.gz
tdelibs-e255a8ca6387cc1f100beffe39f889328e8f2a41.zip
Fix openpty detection on openbsd
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt33
1 files changed, 23 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 52ee5c17c..ac8d02304 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -455,16 +455,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( )