should use sdl-config for static build not pkg-config

Bug #984516 reported by Kenneth Salerno
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Thomas Huth

Bug Description

In the configure script when a user wants to compile a static QEMU and enable SDL support (i.e. ./configure --static --enable-sdl):

pkg-config does not have an option "--static-libs". For correct results (to find the static archive libSDL.a) you need to use sdl-config --static-libs.

This is how I get it to work for me anyway:

diff --git a/configure b/configure
index 2d62d12..3de4c9b 100755
--- a/configure
+++ b/configure
@@ -1548,7 +1548,7 @@ int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
 EOF
   sdl_cflags=`$sdlconfig --cflags 2> /dev/null`
   if test "$static" = "yes" ; then
- sdl_libs=`$sdlconfig --static-libs 2>/dev/null`
+ sdl_libs=`${SDL_CONFIG-${cross_prefix}sdl-config} --static-libs`
   else
     sdl_libs=`$sdlconfig --libs 2> /dev/null`
   fi

Tags: sdl static
Revision history for this message
Kenneth Salerno (kennethsalerno) wrote :

Sorry, I stripped out the "2>/dev/null" when I was debugging and forgot to add it back in:

diff --git a/configure b/configure
index 2d62d12..3de4c9b 100755
--- a/configure
+++ b/configure
@@ -1548,7 +1548,7 @@ int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
 EOF
   sdl_cflags=`$sdlconfig --cflags 2> /dev/null`
   if test "$static" = "yes" ; then
- sdl_libs=`$sdlconfig --static-libs 2>/dev/null`
+ sdl_libs=`${SDL_CONFIG-${cross_prefix}sdl-config} --static-libs 2>/dev/null`
   else
     sdl_libs=`$sdlconfig --libs 2> /dev/null`
   fi

Revision history for this message
Stefan Weil (ubuntu-weilnetz) wrote :

pkg-config supports --static, and QEMU uses it.

Please try whether

   pkg-config --libs --static sdl

gives the correct flags with your distribution. If not, that distribution is buggy.

Revision history for this message
Kenneth Salerno (kennethsalerno) wrote :

you are correct, can we switch the parameter from "--static-libs" to "--libs --static" ?

diff --git a/configure b/configure
index 2d62d12..b0cedd2 100755
--- a/configure
+++ b/configure
@@ -1548,7 +1548,7 @@ int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
 EOF
   sdl_cflags=`$sdlconfig --cflags 2> /dev/null`
   if test "$static" = "yes" ; then
- sdl_libs=`$sdlconfig --static-libs 2>/dev/null`
+ sdl_libs=`$sdlconfig --libs --static 2>/dev/null`
   else
     sdl_libs=`$sdlconfig --libs 2> /dev/null`
   fi

Revision history for this message
Thomas Huth (th-huth) wrote :
Changed in qemu:
status: New → Fix Committed
assignee: nobody → Thomas Huth (th-huth)
Thomas Huth (th-huth)
Changed in qemu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.