diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2015-06-14 20:27:02 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-12-23 02:23:01 +0100 |
commit | 67d736925c398deb9df42ffa589a65106f492bde (patch) | |
tree | 9c30588f8a79d24903d5c027d7e4383e033bca95 /CMakeLists.txt | |
parent | ec47e62bfc82144aa0dfb7b5ac0831db7e919b9e (diff) | |
download | tdelibs-67d736925c398deb9df42ffa589a65106f492bde.tar.gz tdelibs-67d736925c398deb9df42ffa589a65106f492bde.zip |
Fix openpty detection with libutil.h
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit e75569be1b7bf138685d0e4941daf111e6f51ba3)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b65206dd4..48d1f9280 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -459,20 +459,16 @@ endif( HAVE_RES_INIT) set( CMAKE_REQUIRED_LIBRARIES util ) 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 - ) + set( USE_OPENPTY_H pty.h ) elseif( HAVE_UTIL_H ) + set( USE_OPENPTY_H util.h ) +elseif( HAVE_LIBUTIL_H ) + set( USE_OPENPTY_H libutil.h ) +endif( ) +if( USE_OPENPTY_H ) check_c_source_runs(" - #include <util.h> - int main(int argc, char* argv) { + #include <${USE_OPENPTY_H}> + int main(int argc, char* argv[]) { int master_fd, slave_fd; int result; result = openpty(&master_fd, &slave_fd, 0, 0, 0); |