summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
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>2015-12-23 02:22:52 +0100
commit72532b66026c4ca95fa06906021c0bb95b31b525 (patch)
treeb1bdf9c8ace7a6d114dce372db9b13626d692df5 /CMakeLists.txt
parent0c90f47458279156d84f4548d4508ef45d6ea289 (diff)
downloadtdelibs-72532b66026c4ca95fa06906021c0bb95b31b525.tar.gz
tdelibs-72532b66026c4ca95fa06906021c0bb95b31b525.zip
Fix detection of some headers on openbsd
Many headers requires additional include stdlib.h (cherry picked from commit 3f5a4b419f7907ba61c6f63458e0413cccb74760)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 22 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ea892a911..4182ee217 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -169,6 +169,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 )
@@ -185,6 +191,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 )
@@ -194,6 +206,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 )
@@ -251,7 +269,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 )
@@ -293,6 +311,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 )