Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] problem building a SDL app with buildroot
       [not found] <18ba4b30-2ac3-44e7-ae59-5ca40d8137b3@zimbra2.corp.accelance.fr>
@ 2012-11-08 10:21 ` Jeremy Rosen
  2012-11-08 10:49   ` Samuel Martin
  0 siblings, 1 reply; 5+ messages in thread
From: Jeremy Rosen @ 2012-11-08 10:21 UTC (permalink / raw)
  To: buildroot

Hello everybody

I am trying to compile and package an app that is using the sdl library and I have a problem

the program uses cmake as its build system and uses a small script called "sdl-config" to find the compile time parameters for sdl.

that script is provided by the sdl library, and when grepping the output/ directory I can find it installed in

output/host/usr/arm-unknown-linux-gnueabi/sysroot/usr/bin/sdl-config

however cmake seems not to be able to find it... I am not sure if the sysroot directory should be added to the path, and if not how I am supposed to have sdl apps find their configureation (I can probably overrid the path to sdl-config for my particual app, but I am wondering if there isn't a more generic problem with the way sdl is installed in the cross-compile environement)

relevent lines from the cmake configuration file :

CMakeCache.txt:SDL_CONFIG:STRING=sdl-config
CMakeLists.txt:	set(SDL_CONFIG "sdl-config" CACHE STRING "Path to sdl-config script")
CMakeLists.txt:	exec_program(${SDL_CONFIG} ARGS "--cflags" OUTPUT_VARIABLE SDL_CFLAGS)


thx a lot for the insight

Jeremy

fight key loggers : write some perl using vim

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] problem building a SDL app with buildroot
  2012-11-08 10:21 ` [Buildroot] problem building a SDL app with buildroot Jeremy Rosen
@ 2012-11-08 10:49   ` Samuel Martin
  2012-11-08 12:35     ` Jeremy Rosen
  2012-11-08 17:36     ` Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: Samuel Martin @ 2012-11-08 10:49 UTC (permalink / raw)
  To: buildroot

Hi Jeremy,

2012/11/8 Jeremy Rosen <jeremy.rosen@openwide.fr>:
> Hello everybody
>
> I am trying to compile and package an app that is using the sdl library and I have a problem
>
> the program uses cmake as its build system and uses a small script called "sdl-config" to find the compile time parameters for sdl.
>
> that script is provided by the sdl library, and when grepping the output/ directory I can find it installed in
>
> output/host/usr/arm-unknown-linux-gnueabi/sysroot/usr/bin/sdl-config
>
> however cmake seems not to be able to find it... I am not sure if the sysroot directory should be added to the path, and if not how I am supposed to have sdl apps find their configureation (I can probably overrid the path to sdl-config for my particual app, but I am wondering if there isn't a more generic problem with the way sdl is installed in the cross-compile environement)
>
> relevent lines from the cmake configuration file :
>
> CMakeCache.txt:SDL_CONFIG:STRING=sdl-config
> CMakeLists.txt: set(SDL_CONFIG "sdl-config" CACHE STRING "Path to sdl-config script")
> CMakeLists.txt: exec_program(${SDL_CONFIG} ARGS "--cflags" OUTPUT_VARIABLE SDL_CFLAGS)

As a quick fix, in your app *.mk file, you can try to add:
<your app prefix>_CONF_OPT += -DSDL_CONFIG="$(STAGING_DIR)/usr/bin/sdl-config"

You don't have to change anything in the sdl-config from the staging
area, it is already handled by the sdl package.


BTW, that an issue we are aware of, and we talked a bit about it
during the last Buildroot Dev Days.
We just need some time to work on and figure out the best way to fix this.


Regards,

-- 
Sam

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] problem building a SDL app with buildroot
  2012-11-08 10:49   ` Samuel Martin
@ 2012-11-08 12:35     ` Jeremy Rosen
  2012-11-08 17:36     ` Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Jeremy Rosen @ 2012-11-08 12:35 UTC (permalink / raw)
  To: buildroot

> > OUTPUT_VARIABLE SDL_CFLAGS)
> 
> As a quick fix, in your app *.mk file, you can try to add:
> <your app prefix>_CONF_OPT +=
> -DSDL_CONFIG="$(STAGING_DIR)/usr/bin/sdl-config"
> 

yup, I did that and it did fix my problem, thx... now i'm looking into some gettext problems, but that will be a seaparate email :)

> You don't have to change anything in the sdl-config from the staging
> area, it is already handled by the sdl package.
> 
> 
> BTW, that an issue we are aware of, and we talked a bit about it
> during the last Buildroot Dev Days.
> We just need some time to work on and figure out the best way to fix
> this.
> 
> 


fair enough, I wanted to make sure I didn't miss something obvious... the fix above is good enough for me until there is an official way of doing it

Regards
Jeremy


> Regards,
> 
> --
> Sam
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] problem building a SDL app with buildroot
  2012-11-08 10:49   ` Samuel Martin
  2012-11-08 12:35     ` Jeremy Rosen
@ 2012-11-08 17:36     ` Thomas Petazzoni
  2012-11-09 16:36       ` Samuel Martin
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2012-11-08 17:36 UTC (permalink / raw)
  To: buildroot

Samuel,

On Thu, 8 Nov 2012 11:49:58 +0100, Samuel Martin wrote:

> As a quick fix, in your app *.mk file, you can try to add:
> <your app prefix>_CONF_OPT += -DSDL_CONFIG="$(STAGING_DIR)/usr/bin/sdl-config"
> 
> You don't have to change anything in the sdl-config from the staging
> area, it is already handled by the sdl package.
> 
> BTW, that an issue we are aware of, and we talked a bit about it
> during the last Buildroot Dev Days.
> We just need some time to work on and figure out the best way to fix this.

We indeed discussed it, but as far as I understood, there isn't really
another solution than what we're doing at the moment. Options we
discussed where:

 (1) Install those <foo>-config scripts in $(HOST_DIR)/usr/bin. This
 isn't possible as they would clash with other <foo>-config scripts
 installed by host packages.

 (2) Create a special directory, which is in the PATH passed when
 configuring/building packages, in which we would install those
 <foo>-config script. This works quite OK when those <foo>-config
 scripts are self-contained (which is the case most of the time), but
 not necessarily if they are more elaborate.

So in general, I think we said it wasn't really worth the effort, and
it was probably a lot better to work on moving packages to pkg-config
instead.

For example, in this case, Jeremy should rather use the pkg-config
files of SDL to discover the right compiler/linker flags. pkg-config is
very nicely integrated with CMake, it should even simplify the
CMakeLists.txt.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] problem building a SDL app with buildroot
  2012-11-08 17:36     ` Thomas Petazzoni
@ 2012-11-09 16:36       ` Samuel Martin
  0 siblings, 0 replies; 5+ messages in thread
From: Samuel Martin @ 2012-11-09 16:36 UTC (permalink / raw)
  To: buildroot

Hi Thomas, Jemery, all,

2012/11/8 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
> Samuel,
>
> On Thu, 8 Nov 2012 11:49:58 +0100, Samuel Martin wrote:
>
>> As a quick fix, in your app *.mk file, you can try to add:
>> <your app prefix>_CONF_OPT += -DSDL_CONFIG="$(STAGING_DIR)/usr/bin/sdl-config"
>>
>> You don't have to change anything in the sdl-config from the staging
>> area, it is already handled by the sdl package.
>>
>> BTW, that an issue we are aware of, and we talked a bit about it
>> during the last Buildroot Dev Days.
>> We just need some time to work on and figure out the best way to fix this.
>
> We indeed discussed it, but as far as I understood, there isn't really
> another solution than what we're doing at the moment. Options we
> discussed where:
>
>  (1) Install those <foo>-config scripts in $(HOST_DIR)/usr/bin. This
>  isn't possible as they would clash with other <foo>-config scripts
>  installed by host packages.
>
>  (2) Create a special directory, which is in the PATH passed when
>  configuring/building packages, in which we would install those
>  <foo>-config script. This works quite OK when those <foo>-config
>  scripts are self-contained (which is the case most of the time), but
>  not necessarily if they are more elaborate.
>
> So in general, I think we said it wasn't really worth the effort, and
> it was probably a lot better to work on moving packages to pkg-config
> instead.
Thomas, you're right.

> For example, in this case, Jeremy should rather use the pkg-config
> files of SDL to discover the right compiler/linker flags. pkg-config is
> very nicely integrated with CMake, it should even simplify the
> CMakeLists.txt.

Jeremy, actually it's weird that you need to find the sdl-config
binary because CMake provide a package for SDL.
So, as much as possible, it should use the CMake way: using FindSDL.
See: http://www.cmake.org/cmake/help/v2.8.10/cmake.html#module:FindSDL


Regards,

-- 
Sam

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-11-09 16:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <18ba4b30-2ac3-44e7-ae59-5ca40d8137b3@zimbra2.corp.accelance.fr>
2012-11-08 10:21 ` [Buildroot] problem building a SDL app with buildroot Jeremy Rosen
2012-11-08 10:49   ` Samuel Martin
2012-11-08 12:35     ` Jeremy Rosen
2012-11-08 17:36     ` Thomas Petazzoni
2012-11-09 16:36       ` Samuel Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox