From bc003c022846b7bdcb8df29097801fd9f5b914e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 30 Jul 2017 21:30:33 +0200 Subject: [PATCH] Add cmake check whether sys/sysmacros.h exists Unfortunately 9ada8baca65da11a355970d02df8511f1b649d5a failed to compile on FreeBSD due to the header not existing. So we need to check the existance and properly guard with ifdef. --- CMakeLists.txt | 1 + config-kwin.h.cmake | 1 + logind.cpp | 3 +++ 3 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d2944805e..21afd66ad8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -337,6 +337,7 @@ check_include_file("linux/fb.h" HAVE_LINUX_FB_H) add_feature_info("linux/fb.h" HAVE_LINUX_FB_H "Required for the fbdev backend") +check_include_file("sys/sysmacros.h" HAVE_SYS_SYSMACROS_H) ########### global ############### set(kwin_effects_dbus_xml ${CMAKE_CURRENT_SOURCE_DIR}/org.kde.kwin.Effects.xml) diff --git a/config-kwin.h.cmake b/config-kwin.h.cmake index dcdf80c833..7b04cb79b9 100644 --- a/config-kwin.h.cmake +++ b/config-kwin.h.cmake @@ -21,6 +21,7 @@ #cmakedefine01 HAVE_PR_SET_PDEATHSIG #cmakedefine01 HAVE_SYS_PROCCTL_H #cmakedefine01 HAVE_PROC_TRACE_CTL +#cmakedefine01 HAVE_SYS_SYSMACROS_H #cmakedefine01 HAVE_BREEZE_DECO #cmakedefine01 HAVE_UDEV #if HAVE_BREEZE_DECO diff --git a/logind.cpp b/logind.cpp index 8a92ae02d1..4a86d77e03 100644 --- a/logind.cpp +++ b/logind.cpp @@ -29,7 +29,10 @@ along with this program. If not, see . #include #include +#include +#if HAVE_SYS_SYSMACROS_H #include +#endif #ifndef major #include #endif