summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrançois Andriot <francois.andriot@free.fr>2014-10-05 17:05:09 +0200
committerSlávek Banko <slavek.banko@axis.cz>2014-10-05 17:05:47 +0200
commit3f5a4b419f7907ba61c6f63458e0413cccb74760 (patch)
tree8d71a56496fa008c413bba78248a8b504e6347a5
parent8e7888b85708c6e5d7a3b404c40a1bcf9c807bd0 (diff)
downloadtdelibs-3f5a4b419f7907ba61c6f63458e0413cccb74760.tar.gz
tdelibs-3f5a4b419f7907ba61c6f63458e0413cccb74760.zip
Fix detection of some headers on openbsd
Many headers requires additional include stdlib.h
-rw-r--r--CMakeLists.txt23
1 files changed, 22 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5433fe121..52ee5c17c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -181,6 +181,12 @@ check_include_file( "mntent.h" HAVE_MNTENT_H )
check_include_file( "ndir.h" HAVE_NDIR_H )
check_include_file( "netinet/in.h" HAVE_NETINET_IN_H )
check_include_file( "net/if.h" HAVE_NET_IF_H )
+if( NOT HAVE_NET_IF_H )
+ find_path( NET_IF_PATH "net/if.h" )
+ if( NET_IF_PATH )
+ set( HAVE_NET_IF_H "1" )
+ endif( )
+endif( )
check_include_file( "paths.h" HAVE_PATHS_H )
check_include_file( "pty.h" HAVE_PTY_H )
check_include_file( "stdint.h" HAVE_STDINT_H )
@@ -197,6 +203,12 @@ check_include_file( "sys/mman.h" HAVE_SYS_MMAN_H )
check_include_file( "sys/mntent.h" HAVE_SYS_MNTENT_H )
check_include_file( "sys/mnttab.h" HAVE_SYS_MNTTAB_H )
check_include_file( "sys/mount.h" HAVE_SYS_MOUNT_H )
+if( NOT HAVE_SYS_MOUNT_H )
+ find_path( SYS_MOUNT_PATH "sys/mount.h" )
+ if( SYS_MOUNT_PATH )
+ set( HAVE_SYS_MOUNT_H "1" )
+ endif( )
+endif( )
check_include_file( "sys/ndir.h" HAVE_SYS_NDIR_H )
check_include_file( "sys/param.h" HAVE_SYS_PARAM_H )
check_include_file( "sys/prctl.h" HAVE_SYS_PRCTL_H )
@@ -206,6 +218,12 @@ check_include_file( "sys/stat.h" HAVE_SYS_STAT_H )
check_include_file( "sys/stropts.h" HAVE_SYS_STROPTS_H )
check_include_file( "sys/types.h" HAVE_SYS_TYPES_H )
check_include_file( "sys/ucred.h" HAVE_SYS_UCRED_H )
+if( NOT HAVE_SYS_UCRED_H )
+ find_path( SYS_UCRED_PATH "sys/ucred.h" )
+ if( SYS_UCRED_PATH )
+ set( HAVE_SYS_UCRED_H "1" )
+ endif( )
+endif( )
check_include_file( "sys/xattr.h" HAVE_SYS_XATTR_H )
check_include_file( "termios.h" HAVE_TERMIOS_H )
check_include_file( "termio.h" HAVE_TERMIO_H )
@@ -263,7 +281,7 @@ check_function_exists( mkstemps HAVE_MKSTEMPS )
check_symbol_exists( mkstemps "stdlib.h" HAVE_MKSTEMPS_PROTO )
check_function_exists( initgroups HAVE_INITGROUPS )
-check_symbol_exists( initgroups "grp.h" HAVE_INITGROUPS_PROTO )
+check_symbol_exists( initgroups "grp.h;unistd.h" HAVE_INITGROUPS_PROTO )
check_function_exists( strlcat HAVE_STRLCAT )
check_symbol_exists( strlcat "string.h" HAVE_STRLCAT_PROTO )
@@ -305,6 +323,9 @@ if (HAVE_ALLOCA_H )
else (HAVE_ALLOCA_H )
check_symbol_exists( alloca "stdlib.h" HAVE_ALLOCA )
endif (HAVE_ALLOCA_H )
+if( ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" )
+ set( HAVE_ALLOCA 1 )
+endif( )
check_function_exists( getmntinfo HAVE_GETMNTINFO )
check_function_exists( getnameinfo HAVE_GETNAMEINFO )