From 43c5a65b034a243700cf9c5bfbe6bcefb15f1161 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Wed, 31 May 2017 22:17:50 +0100 Subject: [PATCH] configure.ac: use AC_HEADER_MAJOR to detect major()/minor() This change slightly updates c4d7f66c12853b9575366dd9f4a7960ec5694934 which added inclusion. Autoconf has AC_HEADER_MAJOR to find out which header defines reqiured macros: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Particular-Headers.html This change should increase portability across other libcs. Bug: https://bugs.gentoo.org/610652 Signed-off-by: Sergei Trofimovich Reviewed-by: Daniel Stone --- configure.ac | 1 + libweston/launcher-direct.c | 9 ++++++++- libweston/launcher-logind.c | 9 ++++++++- libweston/launcher-weston-launch.c | 8 +++++++- libweston/weston-launch.c | 9 ++++++++- 5 files changed, 32 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index d6a9cbd2..5c08b271 100644 --- a/configure.ac +++ b/configure.ac @@ -34,6 +34,7 @@ AC_CONFIG_MACRO_DIR([m4]) AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE +AC_HEADER_MAJOR AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests subdir-objects]) diff --git a/libweston/launcher-direct.c b/libweston/launcher-direct.c index a5d3ee53..b4ca609a 100644 --- a/libweston/launcher-direct.c +++ b/libweston/launcher-direct.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -47,6 +46,14 @@ #define KDSKBMUTE 0x4B51 #endif +/* major()/minor() */ +#ifdef MAJOR_IN_MKDEV +#include +#endif +#ifdef MAJOR_IN_SYSMACROS +#include +#endif + #ifdef BUILD_DRM_COMPOSITOR #include diff --git a/libweston/launcher-logind.c b/libweston/launcher-logind.c index a069bd4f..21d8c37b 100644 --- a/libweston/launcher-logind.c +++ b/libweston/launcher-logind.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -45,6 +44,14 @@ #define DRM_MAJOR 226 +/* major()/minor() */ +#ifdef MAJOR_IN_MKDEV +#include +#endif +#ifdef MAJOR_IN_SYSMACROS +#include +#endif + struct launcher_logind { struct weston_launcher base; struct weston_compositor *compositor; diff --git a/libweston/launcher-weston-launch.c b/libweston/launcher-weston-launch.c index 97da18c5..3d3b4d2f 100644 --- a/libweston/launcher-weston-launch.c +++ b/libweston/launcher-weston-launch.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -75,6 +74,13 @@ drmSetMaster(int drm_fd) #endif +/* major()/minor() */ +#ifdef MAJOR_IN_MKDEV +#include +#endif +#ifdef MAJOR_IN_SYSMACROS +#include +#endif union cmsg_data { unsigned char b[4]; int fd; }; diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c index c8e1513d..1adcf21a 100644 --- a/libweston/weston-launch.c +++ b/libweston/weston-launch.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include @@ -93,6 +92,14 @@ drmSetMaster(int drm_fd) #endif +/* major()/minor() */ +#ifdef MAJOR_IN_MKDEV +# include +#endif +#ifdef MAJOR_IN_SYSMACROS +# include +#endif + struct weston_launch { struct pam_conv pc; pam_handle_t *ph; -- 2.34.1