From 9ac46ec5ed6ba67a8c684069f8255384f6acd18b Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 1 May 2017 15:50:19 +1200 Subject: [PATCH] Got it to build --- CMake/FindSystemd.cmake | 40 ++++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 1 + backend/CMakeLists.txt | 6 ++++++ backend/drm/drm.c | 6 +++--- backend/drm/event.c | 8 ++++---- backend/drm/otd.c | 10 +++++----- backend/drm/session.c | 6 ++++-- backend/drm/udev.c | 10 ++++++---- 8 files changed, 69 insertions(+), 18 deletions(-) create mode 100644 CMake/FindSystemd.cmake diff --git a/CMake/FindSystemd.cmake b/CMake/FindSystemd.cmake new file mode 100644 index 00000000..09d60115 --- /dev/null +++ b/CMake/FindSystemd.cmake @@ -0,0 +1,40 @@ +#.rst: +# FindSystemd +# ------- +# +# Find Systemd library +# +# Try to find Systemd library on UNIX systems. The following values are defined +# +# :: +# +# SYSTEMD_FOUND - True if Systemd is available +# SYSTEMD_INCLUDE_DIRS - Include directories for Systemd +# SYSTEMD_LIBRARIES - List of libraries for Systemd +# SYSTEMD_DEFINITIONS - List of definitions for Systemd +# +#============================================================================= +# Copyright (c) 2015 Jari Vetoniemi +# +# Distributed under the OSI-approved BSD License (the "License"); +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= + +include(FeatureSummary) +set_package_properties(Systemd PROPERTIES + URL "http://freedesktop.org/wiki/Software/systemd/" + DESCRIPTION "System and Service Manager") + +find_package(PkgConfig) +pkg_check_modules(PC_SYSTEMD QUIET libsystemd) +find_library(SYSTEMD_LIBRARIES NAMES systemd ${PC_SYSTEMD_LIBRARY_DIRS}) +find_path(SYSTEMD_INCLUDE_DIRS systemd/sd-login.h HINTS ${PC_SYSTEMD_INCLUDE_DIRS}) + +set(SYSTEMD_DEFINITIONS ${PC_SYSTEMD_CFLAGS_OTHER}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SYSTEMD DEFAULT_MSG SYSTEMD_INCLUDE_DIRS SYSTEMD_LIBRARIES) +mark_as_advanced(SYSTEMD_INCLUDE_DIRS SYSTEMD_LIBRARIES SYSTEMD_DEFINITIONS) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd4d9969..30a2c37d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,7 @@ find_package(DRM REQUIRED) find_package(LibInput REQUIRED) find_package(Udev) find_package(Dbus) +find_package(Systemd) include(Wayland) include(Manpage) diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt index 830a2158..c962b8ed 100644 --- a/backend/CMakeLists.txt +++ b/backend/CMakeLists.txt @@ -1,6 +1,7 @@ include_directories( ${PROTOCOLS_INCLUDE_DIRS} ${WAYLAND_INCLUDE_DIR} + ${DRM_INCLUDE_DIRS} ) add_library(wlr-backend @@ -8,6 +9,11 @@ add_library(wlr-backend wayland/registry.c wayland/wl_seat.c wayland/wl_output.c + drm/drm.c + drm/event.c + drm/otd.c + drm/session.c + drm/udev.c ) target_link_libraries(wlr-backend diff --git a/backend/drm/drm.c b/backend/drm/drm.c index bb6359c5..894d8513 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -1,6 +1,6 @@ -#include "otd.h" -#include "drm.h" -#include "event.h" +#include "backend/drm/otd.h" +#include "backend/drm/drm.h" +#include "backend/drm/event.h" #include #include diff --git a/backend/drm/event.c b/backend/drm/event.c index f20cb282..34679514 100644 --- a/backend/drm/event.c +++ b/backend/drm/event.c @@ -1,7 +1,7 @@ -#include "otd.h" -#include "event.h" -#include "drm.h" -#include "udev.h" +#include "backend/drm/otd.h" +#include "backend/drm/event.h" +#include "backend/drm/drm.h" +#include "backend/drm/udev.h" #include #include diff --git a/backend/drm/otd.c b/backend/drm/otd.c index 3d5345c7..f5960793 100644 --- a/backend/drm/otd.c +++ b/backend/drm/otd.c @@ -2,11 +2,11 @@ #include #include -#include "otd.h" -#include "drm.h" -#include "event.h" -#include "session.h" -#include "udev.h" +#include "backend/drm/otd.h" +#include "backend/drm/drm.h" +#include "backend/drm/event.h" +#include "backend/drm/session.h" +#include "backend/drm/udev.h" struct otd *otd_start(void) { diff --git a/backend/drm/session.c b/backend/drm/session.c index c845fb27..261c5ac6 100644 --- a/backend/drm/session.c +++ b/backend/drm/session.c @@ -1,3 +1,5 @@ +#define _POSIX_C_SOURCE 200809L + #include #include #include @@ -9,8 +11,8 @@ #include #include -#include "session.h" -#include "otd.h" +#include "backend/drm/session.h" +#include "backend/drm/otd.h" int take_device(struct otd *restrict otd, const char *restrict path, diff --git a/backend/drm/udev.c b/backend/drm/udev.c index 1efa26c2..5f20a1be 100644 --- a/backend/drm/udev.c +++ b/backend/drm/udev.c @@ -1,3 +1,5 @@ +#define _POSIX_C_SOURCE 200809L + #include #include #include @@ -6,10 +8,10 @@ #include #include -#include "otd.h" -#include "udev.h" -#include "session.h" -#include "drm.h" +#include "backend/drm/otd.h" +#include "backend/drm/udev.h" +#include "backend/drm/session.h" +#include "backend/drm/drm.h" static bool device_is_kms(struct otd *otd, struct udev_device *dev) {