Bug 683 - SDL-dfb does not select directfb
Summary: SDL-dfb does not select directfb
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2009-10-27 15:33 UTC by Damien Couroussé
Modified: 2009-11-22 20:04 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Damien Couroussé 2009-10-27 15:33:19 UTC
Hello,

I got a compilation error with SDL-dfb selected while directfb was not selected. The compilation reported something like:

(...)


o
./src/video/directfb/SDL_DirectFB_events.c:32:22: error: directfb.h: No such file or directory
In file included from ./src/video/directfb/SDL_DirectFB_events.c:38:
./src/video/directfb/SDL_DirectFB_video.h:40: error: expected specifier-qualifier-list before 'IDirectFB'
./src/video/directfb/SDL_DirectFB_video.h:60: error: expected declaration specifiers or '...' before 'DFBResult'
./src/video/directfb/SDL_DirectFB_events.c:43: error: expected ')' before '*' token
./src/video/directfb/SDL_DirectFB_events.c:44: error: expected ')' before '*' token
./src/video/directfb/SDL_DirectFB_events.c: In function 'DirectFB_PumpEvents':
./src/video/directfb/SDL_DirectFB_events.c:51: error: 'DFBInputEvent' undeclared (first use in this function)
./src/video/directfb/SDL_DirectFB_events.c:51: error: (Each undeclared identifier is reported only once
./src/video/directfb/SDL_DirectFB_events.c:51: error: for each function it appears in.)
./src/video/directfb/SDL_DirectFB_events.c:51: error: expected ';' before 'evt'
./src/video/directfb/SDL_DirectFB_events.c:53: error: 'struct SDL_PrivateVideoData' has no member named 'eventbuffer'
./src/video/directfb/SDL_DirectFB_events.c:53: error: 'struct SDL_PrivateVideoData' has no member named 'eventbuffer'
./src/video/directfb/SDL_DirectFB_events.c:54: error: 'evt' undeclared (first use in this function)
./src/video/directfb/SDL_DirectFB_events.c:54: error: 'DFB_OK' undeclared (first use in this function)
./src/video/directfb/SDL_DirectFB_events.c:60: error: 'DIET_BUTTONPRESS' undeclared (first use in this function)
./src/video/directfb/SDL_DirectFB_events.c:64: error: 'DIET_BUTTONRELEASE' undeclared (first use in this function)
./src/video/directfb/SDL_DirectFB_events.c:68: error: 'DIET_KEYPRESS' undeclared (first use in this function)
(...)

Hence I think BR2_PACKAGE_SDL_DIRECTFB should select BR2_PACKAGE_DIRECTFB : 
diff --git a/package/sdl/Config.in b/package/sdl/Config.in
index 7cba524..ae8b597 100644
--- a/package/sdl/Config.in
+++ b/package/sdl/Config.in
@@ -13,6 +13,7 @@ config BR2_PACKAGE_SDL_FBCON
 
 config BR2_PACKAGE_SDL_DIRECTFB
        bool "SDL DirectFB video driver"
+       select BR2_PACKAGE_DIRECTFB
 
 config BR2_PACKAGE_SDL_QTOPIA
        bool "SDL Qtopia video driver"


Cheers,
Damien
Comment 1 Thomas Petazzoni 2009-10-27 16:01:49 UTC
Thanks Damien for reporting the issue.

I'm wondering whether we should use a select as you suggested, or a depends on. We usually use "select" so that the user doesn't need to care about missing dependencies. But in the case of DirectFB, many things can (and should ?) be configured at the DirectFB level, so I'm not sure that selecting DirectFB behind the user's back is good.

something like:

 config BR2_PACKAGE_SDL_DIRECTFB
        bool "SDL DirectFB video driver"
+       depends on BR2_PACKAGE_DIRECTFB

+ comment "sdl-dfb requires directfb support"
+        depends on !BR2_PACKAGE_DIRECTFB

Peter, your opinion on this ?
Comment 2 Peter Korsgaard 2009-10-27 16:28:28 UTC
(In reply to comment #1)
> Thanks Damien for reporting the issue.
> 
> I'm wondering whether we should use a select as you suggested, or a depends on.
> We usually use "select" so that the user doesn't need to care about missing
> dependencies. But in the case of DirectFB, many things can (and should ?) be
> configured at the DirectFB level, so I'm not sure that selecting DirectFB
> behind the user's back is good.
> 
> something like:
> 
>  config BR2_PACKAGE_SDL_DIRECTFB
>         bool "SDL DirectFB video driver"
> +       depends on BR2_PACKAGE_DIRECTFB
> 
> + comment "sdl-dfb requires directfb support"
> +        depends on !BR2_PACKAGE_DIRECTFB
> 
> Peter, your opinion on this ?

We should imho use depends on (and also for the qt/x11 backends) similar to how it is done for E.G. libgtk2.

Notice that the dependencies in the makefile are likewise missing.
Comment 3 Peter Korsgaard 2009-11-22 20:04:47 UTC
Thanks, fixed in git (351b67960)