All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Coopersmith <alan.coopersmith@oracle.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH libdrm] meson: Fix sys/mkdev.h detection on Solaris
Date: Mon,  9 Sep 2019 16:51:16 -0700	[thread overview]
Message-ID: <20190909235116.19290-1-alan.coopersmith@oracle.com> (raw)

On Solaris, sys/sysmacros.h has long-deprecated copies of major() & minor()
but not makedev().  sys/mkdev.h has all three and is the preferred choice.

So we check for sys/mkdev.h first, as autoconf's AC_HEADER_MAJOR does.

Fixes build failure with error:
../xf86drm.c: In function ‘drmOpenMinor’:
../xf86drm.c:454:30: error: implicit declaration of function ‘makedev’ [-Werror=implicit-function-declaration]
  454 |         return drmOpenDevice(makedev(DRM_MAJOR, minor), minor, type);
      |                              ^~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
---
 meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index bc5cfc58..a3363c32 100644
--- a/meson.build
+++ b/meson.build
@@ -183,10 +183,10 @@ foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h']
   config.set('HAVE_' + header.underscorify().to_upper(),
     cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header)))
 endforeach
-if cc.has_header_symbol('sys/sysmacros.h', 'major')
-  config.set10('MAJOR_IN_SYSMACROS', true)
-elif cc.has_header_symbol('sys/mkdev.h', 'major')
+if cc.has_header_symbol('sys/mkdev.h', 'major')
   config.set10('MAJOR_IN_MKDEV', true)
+elif cc.has_header_symbol('sys/sysmacros.h', 'major')
+  config.set10('MAJOR_IN_SYSMACROS', true)
 endif
 config.set10('HAVE_OPEN_MEMSTREAM', cc.has_function('open_memstream'))
 
-- 
2.15.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2019-09-09 23:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-09 23:51 Alan Coopersmith [this message]
2019-09-10 12:55 ` [PATCH libdrm] meson: Fix sys/mkdev.h detection on Solaris Eric Engestrom
2019-09-13 23:26   ` Alan Coopersmith
2019-09-14 21:35     ` Eric Engestrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190909235116.19290-1-alan.coopersmith@oracle.com \
    --to=alan.coopersmith@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.