Subject: drm.h; OpenChrome driver and NetBSD/amd64 3.0 - help fixing build
To: None <netbsd-users@netbsd.org, openchrome-users@openchrome.org>
From: Jan Danielsson <jan.m.danielsson@gmail.com>
List: netbsd-users
Date: 09/27/2006 21:19:33
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig1350494E6F7C055A8B688126
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 http://svn.openchrome.org/svn/trunk/unichrome
   $ 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:
/home/pkgsrc/pkgsrc/x11/xorg-server/work/xc/programs/Xserver/hw/xfree86/o=
s-suppo
rt/xf86drm.h:39:17: drm.h: No such file or directory
In file included from via_memory.c:33:
/home/pkgsrc/pkgsrc/x11/xorg-server/work/xc/programs/Xserver/hw/xfree86/o=
s-suppo
rt/xf86drm.h:224: error: parse error before "drm_context_t"
/home/pkgsrc/pkgsrc/x11/xorg-server/work/xc/programs/Xserver/hw/xfree86/o=
s-suppo
rt/xf86drm.h:224: warning: no semicolon at end of struct or union
/home/pkgsrc/pkgsrc/x11/xorg-server/work/xc/programs/Xserver/hw/xfree86/o=
s-suppo
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_=
t"
                 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_
                 t'
                 via_drm.h:208: warning: data definition has no type or
storage
class
                 via_drm.h:245: error: field `reply' has incomplete type
                 via_memory.c:86: warning: no previous prototype for
`viaOffScre
enLinear'

------------------------------------------------

   There seems to be two errors occuring, both involving "drm.h". The
drm.h is not being located from
/home/pkgsrc/pkgsrc/x11/xorg-server/work/xc/programs/Xserver/hw/xfree86/o=
s-suppo
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
/home/pkgsrc/pkgsrc/x11/xorg-server/work/xc/extras/drm/shared{,-core}/drm=
=2Eh.

   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
/home/pkgsrc/pkgsrc/x11/xorg-server/work/xc/extras/drm/[shared|shared-cor=
e]
to the appropriate include path.

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

--=20
Kind regards,
Jan Danielsson



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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (NetBSD)

iD8DBQFFGs7Fbgs4ia4rq9IRCmr9AKCm1OEC5GFrrSL+XDmB5/Y1bp67jgCgoOmQ
N9XSl9RxxZw3wnHrKkP8Uwo=
=SHS3
-----END PGP SIGNATURE-----

--------------enig1350494E6F7C055A8B688126--