Bug 89763 - xf86-video-intel-2.99.917 should check for <sys/mkdev.h> being needed on SunOS for backlight.c
Summary: xf86-video-intel-2.99.917 should check for <sys/mkdev.h> being needed on SunO...
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: 7.7 (2012.06)
Hardware: Other Solaris
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-25 13:16 UTC by Richard PALO
Modified: 2015-03-25 14:23 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Richard PALO 2015-03-25 13:16:14 UTC
From the Solaris man page MAKEDEV(3C)
>NAME
>     makedev, major, minor - manage a device number
>
>SYNOPSIS
>     #include <sys/types.h>
>     #include <sys/mkdev.h>
>
>     dev_t makedev(major_t maj, minor_t min);
>
>     major_t major(dev_t device);
>
>     minor_t minor(dev_t device);

Needed the following quick and dirty patch:
>--- backlight.c.orig    2014-11-18 21:50:39.000000000 +0000
>+++ backlight.c
>@@ -49,6 +49,9 @@
> 
> #include "backlight.h"
> #include "fd.h"
>+#ifdef __sun
>+#include <sys/mkdev.h>
>+#endif
> 
> #define BACKLIGHT_CLASS "/sys/class/backlight"
 
perhaps a configure time check should be made...
Comment 1 Richard PALO 2015-03-25 14:04:46 UTC
From http://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/Particular-Headers.html

— Macro: AC_HEADER_MAJOR

    If sys/types.h does not define major, minor, and makedev, but sys/mkdev.h does, define MAJOR_IN_MKDEV; otherwise, if sys/sysmacros.h does, define MAJOR_IN_SYSMACROS.
Comment 2 Chris Wilson 2015-03-25 14:23:13 UTC
commit aa40f990142eb165ee7f60f08e9616bc5bebdebe
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Mar 25 13:16:56 2015 +0000

    Use AC_HEADER_MAJOR to find how to include major()
    
    We need to include <sys/mkdev.h> on Solaris.
    
    Reported-by: Richard Palo <richard@netbsd.org>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89763
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.