Skip to content

Cross compiling with drm support not possible #270

@Stefichen5

Description

@Stefichen5

Describe the bug
I was trying to cross compile x11vnc (inside yocto) with --with-drm but I always got the following error message even though drm.h existed:

[...]
| In file included from ../../git/src/x11vnc.h:75,
|                  from ../../git/src/connections.c:35:
| /build/tmp/work/cortexa7t2hf-neon-vfpv4-dinos-linux-gnueabi/x11vnc/0.9.17+git/recipe-sysroot/usr/include/xf86drm.h:40:10: fatal error: drm.h: No such file or directory
|    40 | #include <drm.h>
|       |          ^~~~~~~
| compilation terminated.
[...]

During my investigation I found that configure.ac hardcodes the include dir to /usr/include/drm/ (https://github.com/LibVNC/x11vnc/blob/master/configure.ac#L79) even though it should be something like <sysrootdir>/usr/include/drm. Also, ssl uses $with_ssl/include.

My solution was:

-		CPPFLAGS="$saved_CPPFLAGS -I/usr/include/drm/"
+		CPPFLAGS="$saved_CPPFLAGS -I$with_drm/drm"

(and in yocto explicitly set the include dir like this: --with-drm=${RECIPE_SYSROOT}${includedir})

Unfortunately I am unable to properly test my patch for other platforms right now, so I am not able to open a MR. But if anyone can verify it, please feel free to do so.

To Reproduce
Try to cross compile x11vnc with --with-drm setting

Expected Behavior
Successful compilation

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions