Skip to contentSkip to conversation

SDL2 depends on shared libraries, but Config.in depends on BR2_STATIC_LIBS ?

Buildroot Koen Martens 2 participants 4 messages Nov 17, 2019

lore
Share & tools
lore
#0 lore raw

Hi,

I'm updating linuxconsoletools. However, I'm running into issues with test-pkg. There is an optional binary for force-feedback testing that requires SDL2.

SDL2 seems to require shared library support (in that it includes dlfcn.h somewhere along the line), however this is not declared in package/sdl2/Config.in. In fact, there is an odd comment at the bottom of that file:

comment "sdl2 needs a toolchain w/ dynamic library"
depends on BR2_STATIC_LIBS

Isn't it contradictory to say 'needs dynamic library' but then depend on BR2_STATIC_LIBS??

As a work-around, in my linuxconsoletools Config.in i've added 'depends on BR2_SHARED_LIBS' to prevent the build failures with test-pkg, but that feels like an ugly way to fix this. It feels like SDL2 should declare its dependency on BR2_SHARED_LIBS instead of me declaring it?

This has left me a bit confused.

Cheers,

Koen

#1 lore raw
Quoted 9 lines · Koen Martens

Hi,

I'm updating linuxconsoletools. However, I'm running into issues with test-pkg. There is an optional binary for force-feedback testing that requires SDL2.

SDL2 seems to require shared library support (in that it includes dlfcn.h somewhere along the line), however this is not declared in package/sdl2/Config.in.

Yes it is, line 3 of this file has:

depends on !BR2_STATIC_LIBS

(not static means dynamic. It's put that way because it covers both the SHARED and the STATIC_SHARED options.)

Quoted 8 lines

In fact, there is an odd comment
at the bottom of that file:

comment "sdl2 needs a toolchain w/ dynamic library"
depends on BR2_STATIC_LIBS

Isn't it contradictory to say 'needs dynamic library' but then depend on BR2_STATIC_LIBS??

The *comment* is only shown when you don't have dynamic library support. The
early condition hides the package completely in menuconfig when dynamic library is not available, so it would look as if Buildroot doesn't have this package. That's why we add the comment (and to make it easy for people to see what htey need to change in the toolchain to have support for it).

Quoted 2 lines

As a work-around, in my linuxconsoletools Config.in i've added 'depends on BR2_SHARED_LIBS' to prevent the build failures

You should add this dependency to BR2_PACKAGE_LINUXCONSOLETOOLS_FORCEFEEDBACK
only, and you should make it 'depends on !BR2_STATIC_LIBS'. Also, you should add a comment like sdl2 has. So, you should end up with:

config BR2_PACKAGE_LINUXCONSOLETOOLS_FORCEFEEDBACK
bool "force-feedback utilities"
depends on !BR2_STATIC_LIBS
select BR2_PACKAGE_SDL2
help
Build force-feedback driver utilities (fftest, ffmvforce, ffset, ffcfstress).

comment "force-feedback utilities needs a toolchain w/ dynamic library"
depends on BR2_STATIC_LIBS

Regards,
Arnout

Quoted 15 lines

with test-pkg, but that feels like an ugly way to fix this. It feels like SDL2 should declare its dependency on BR2_SHARED_LIBS instead of me declaring it?

This has left me a bit confused.

Cheers,

Koen

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#2 lore raw
Quoted 18 lines · Arnout Vandecappelle
Quoted 3 lines · Koen Martens

SDL2 seems to require shared library support (in that it includes dlfcn.h somewhere along the line), however this is not declared in package/sdl2/Config.in.

Yes it is, line 3 of this file has:

depends on !BR2_STATIC_LIBS

(not static means dynamic. It's put that way because it covers both the SHARED and the STATIC_SHARED options.)

Quoted 6 lines

In fact, there is an odd comment
at the bottom of that file:

comment "sdl2 needs a toolchain w/ dynamic library"
depends on BR2_STATIC_LIBS

Quoted 8 lines
Quoted 2 lines

Isn't it contradictory to say 'needs dynamic library' but then depend on BR2_STATIC_LIBS??

The *comment* is only shown when you don't have dynamic library support. The
early condition hides the package completely in menuconfig when dynamic library is not available, so it would look as if Buildroot doesn't have this package. That's why we add the comment (and to make it easy for people to see what htey need to change in the toolchain to have support for it).

Ah, right, makes sense. Thanks for pointing that out. I'm still not sure why I then need to depend on !BR2_STATIC_LIBS in a package that depends on SDL2. Shouldn't SDL2 depending on !BR2_STATIC_LIBS be enough to not build linuxconsoletools with the force-feedback utilities by test-pkg ?

Maybe i'm missing something obvious again, but I'm not in the habbit of working on buildroot daily anymore and am recovering from a flu, so I might not be thinking straight atm.

Cheers,

Koen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20191117/33eb0c8b/attachment.asc>

#3 lore raw
Quoted 28 lines · Koen Martens
Quoted 18 lines · Arnout Vandecappelle
Quoted 3 lines · Koen Martens

SDL2 seems to require shared library support (in that it includes dlfcn.h somewhere along the line), however this is not declared in package/sdl2/Config.in.

Yes it is, line 3 of this file has:

depends on !BR2_STATIC_LIBS

(not static means dynamic. It's put that way because it covers both the SHARED and the STATIC_SHARED options.)

Quoted 6 lines

In fact, there is an odd comment
at the bottom of that file:

comment "sdl2 needs a toolchain w/ dynamic library"
depends on BR2_STATIC_LIBS

Quoted 8 lines
Quoted 2 lines

Isn't it contradictory to say 'needs dynamic library' but then depend on BR2_STATIC_LIBS??

The *comment* is only shown when you don't have dynamic library support. The
early condition hides the package completely in menuconfig when dynamic library is not available, so it would look as if Buildroot doesn't have this package. That's why we add the comment (and to make it easy for people to see what htey need to change in the toolchain to have support for it).

Quoted 4 lines

Ah, right, makes sense. Thanks for pointing that out. I'm still not sure why I then need to depend on !BR2_STATIC_LIBS in a package that depends on SDL2. Shouldn't SDL2 depending on !BR2_STATIC_LIBS be enough to not build linuxconsoletools with the force-feedback utilities by test-pkg ?

That would indeed be a lot better, but unfortunately Kconfig doesn't allow it.
It is not able to infer the dependency from the select line. And of course, the comment would be even more impossible to infer.

Regards,
Arnout

Quoted 8 lines

Maybe i'm missing something obvious again, but I'm not in the habbit of working on buildroot daily anymore and am recovering from a flu, so I might not be thinking straight atm.

Cheers,

Koen