Subject: drm.h; OpenChrome driver and NetBSD/amd64 3.0 - help fixing build
To: None <,>
From: Jan Danielsson <>
List: netbsd-users
Date: 09/27/2006 21:19:33
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello all,

   I've managed to get the OpenChrome driver working with xorg 6.9 on
NetBSD/amd64 3.0, but it involved some ugly hardcoded paths.

This is how I did it:

1) Get xorg-server files (required by the driver):

   # cd /home/pkgsrc/pkgsrc/x11/xorg-server
   # make

2) Get the OpenChrome driver (as explained in the UniChrome wiki; I'm
building outside the tree)

   $ svn co
   $ cd unichrome
   $ xmkmf /home/pkgsrc/pkgsrc/x11/xorg-server/work/xc

So far so good, no problems yet.

3) Build it

   $ make

   This step fails, with the following:

In file included from via_memory.c:33:
rt/xf86drm.h:39:17: drm.h: No such file or directory
In file included from via_memory.c:33:
rt/xf86drm.h:224: error: parse error before "drm_context_t"
rt/xf86drm.h:224: warning: no semicolon at end of struct or union
rt/xf86drm.h:234: error: parse error before '}' token


In file included from via_drm.h:35,
                 from via_memory.c:38:
                 via_drmclient.h:27:17: drm.h: No such file or directory
                 In file included from via_memory.c:38:
                 via_drm.h:186: error: parse error before "drm_clip_rect_=
                 via_drm.h:186: warning: no semicolon at end of struct
or union
                 via_drm.h:208: error: parse error before '}' token
                 via_drm.h:208: warning: type defaults to `int' in
declaration o
f `drm_via_sarea_
                 via_drm.h:208: warning: data definition has no type or
                 via_drm.h:245: error: field `reply' has incomplete type
                 via_memory.c:86: warning: no previous prototype for


   There seems to be two errors occuring, both involving "drm.h". The
drm.h is not being located from
rt/xf86drm.h and from via_drmclient.h.

   "find . -name drm.h" in the /home/pkgsrc/pkgsrc/x11/xorg-server
directory reveals that the file is located in

   Just to get it working, I hard code the references to drm.h in
xf86drm.h and via_drmclient.h. This does get the driver built. And I
have verified that the driver works (Yay!).

   Normally, I would just think "Oh, the include path is wrong in the
make file. I'll fix it!". But truth be told, the build system is a
little bit overwhelming for me. The reason I'm posting this to both the
UniChrome and the NetBSD mailing lists is because I can't even determine
where the problem is.

   I figured as much as: "xmkmf" is a tool for making makefiles for X
related stuff(?). This program is supposed to set up the make file, so
that all relevant files are located. It seems that this tool, however,
does not add
to the appropriate include path.

   Could someone explain more in detail what is failing, why, and how to
fix it?

Kind regards,
Jan Danielsson

Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

Version: GnuPG v1.4.5 (NetBSD)