configure.ac: use AC_HEADER_MAJOR to detect major()/minor()

This change slightly updates c4d7f66c12
which added <sys/sysmacros.h> 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 <slyfox@gentoo.org>
Reviewed-by: Daniel Stone <daniels@collabora.com>
dev
Sergei Trofimovich 8 years ago committed by Daniel Stone
parent 0c30fa5503
commit 43c5a65b03
  1. 1
      configure.ac
  2. 9
      libweston/launcher-direct.c
  3. 9
      libweston/launcher-logind.c
  4. 8
      libweston/launcher-weston-launch.c
  5. 9
      libweston/weston-launch.c

@ -34,6 +34,7 @@ AC_CONFIG_MACRO_DIR([m4])
AC_USE_SYSTEM_EXTENSIONS AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE AC_SYS_LARGEFILE
AC_HEADER_MAJOR
AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests subdir-objects]) AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests subdir-objects])

@ -33,7 +33,6 @@
#include <unistd.h> #include <unistd.h>
#include <signal.h> #include <signal.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/sysmacros.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <linux/vt.h> #include <linux/vt.h>
#include <linux/kd.h> #include <linux/kd.h>
@ -47,6 +46,14 @@
#define KDSKBMUTE 0x4B51 #define KDSKBMUTE 0x4B51
#endif #endif
/* major()/minor() */
#ifdef MAJOR_IN_MKDEV
#include <sys/mkdev.h>
#endif
#ifdef MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h>
#endif
#ifdef BUILD_DRM_COMPOSITOR #ifdef BUILD_DRM_COMPOSITOR
#include <xf86drm.h> #include <xf86drm.h>

@ -35,7 +35,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/sysmacros.h>
#include <systemd/sd-login.h> #include <systemd/sd-login.h>
#include <unistd.h> #include <unistd.h>
@ -45,6 +44,14 @@
#define DRM_MAJOR 226 #define DRM_MAJOR 226
/* major()/minor() */
#ifdef MAJOR_IN_MKDEV
#include <sys/mkdev.h>
#endif
#ifdef MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h>
#endif
struct launcher_logind { struct launcher_logind {
struct weston_launcher base; struct weston_launcher base;
struct weston_compositor *compositor; struct weston_compositor *compositor;

@ -34,7 +34,6 @@
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/sysmacros.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/uio.h> #include <sys/uio.h>
@ -75,6 +74,13 @@ drmSetMaster(int drm_fd)
#endif #endif
/* major()/minor() */
#ifdef MAJOR_IN_MKDEV
#include <sys/mkdev.h>
#endif
#ifdef MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h>
#endif
union cmsg_data { unsigned char b[4]; int fd; }; union cmsg_data { unsigned char b[4]; int fd; };

@ -42,7 +42,6 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/signalfd.h> #include <sys/signalfd.h>
#include <sys/sysmacros.h>
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
@ -93,6 +92,14 @@ drmSetMaster(int drm_fd)
#endif #endif
/* major()/minor() */
#ifdef MAJOR_IN_MKDEV
# include <sys/mkdev.h>
#endif
#ifdef MAJOR_IN_SYSMACROS
# include <sys/sysmacros.h>
#endif
struct weston_launch { struct weston_launch {
struct pam_conv pc; struct pam_conv pc;
pam_handle_t *ph; pam_handle_t *ph;

Loading…
Cancel
Save