Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specified drm location for FreeBSD + fixed anonymous union #91

Closed
wants to merge 3 commits into from

Conversation

hun7err
Copy link

@hun7err hun7err commented Feb 27, 2013

Under FreeBSD there's no <libdrm/drm.h> but the other possibility mentioned in compton.h - <drm/drm.h> . I used FreeBSD define to check the system and specify another header location. There was also a strange mistake with an anonymous union which I commented out to make it work.
Leaving those matters aside compton is a great app, keep up the good work!

@richardgv
Copy link
Collaborator

Thanks for your patch, firstly. :-)

The anonymous union issue is caused by a known bug in <gcc-4.6. You could find more details here < #86 (comment) >. Sorry, I'm not particularly pleased to add workarounds for compiler bugs, and I believe any distros using a broken compiler should apply the compiler-specific patch themselves. (And actually there are more than one compiler bugs that could affect compton, here's another bug in gcc-4.7.0 that mess compton up.)

As for the DRM header location issue, sorry, it's my fault. libdrm does provide a pkg-config info file but I never use it somehow. This is the solution I'm thinking about:

diff --git a/Makefile b/Makefile
index 16644c0..75a1099 100644
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,7 @@ endif

 # ==== DRM VSync ====
 ifeq "$(NO_VSYNC_DRM)" ""
+  INCS += $(shell pkg-config --cflags libdrm)
   CFG += -DCONFIG_VSYNC_DRM
 endif

diff --git a/src/compton.h b/src/compton.h
index 7c8c958..aea21cb 100644
--- a/src/compton.h
+++ b/src/compton.h
@@ -23,7 +23,7 @@
 // We references some definitions in drm.h, which could also be found in
 // /usr/src/linux/include/drm/drm.h, but that path is probably even less
 // reliable than libdrm
-#include <libdrm/drm.h>
+#include <drm.h>
 #include <sys/ioctl.h>
 #include <errno.h>
 #endif

Presently my local git tree is very dirty (I'm working on the new OpenGL backend). Would you mind if I push out those changes later after I finish the work at hand?

@hun7err
Copy link
Author

hun7err commented Feb 27, 2013

Sorry about the union, I didn't know about the bug. Seems I need to find and apply a respective patch ;)
The modification of Makefile you provided is so much more universal and more clean than mine that I have really nothing to complain about. Actually, I'd like to thank you because I didn't even of such possibility until now (of course it works under fbsd, checked it beforehand). There's nothing that stopped compilation or caused strange behaviour so I probably won't commit anything in the near future [meaning you can merge changes anytime you want] :)

Thank you very much again!

@richardgv
Copy link
Collaborator

I've pushed the fix of drm.h location (and not the anonymous union one) to richardgv-dev branch. Thanks. :-)

@richardgv richardgv closed this in e3eca7a Mar 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants