Patchwork Give sdl-config higher priority than pkg-config

login
register
mail settings
Submitter Blue Swirl
Date Feb. 14, 2010, 7:23 a.m.
Message ID <f43fc5581002132323j734da576ubb58151dc9dd5840@mail.gmail.com>
Download mbox | patch
Permalink /patch/45289/
State New
Headers show

Comments

Blue Swirl - Feb. 14, 2010, 7:23 a.m.
On OpenBSD, pkg-config sdl --cflags forgets to add -I/usr/local/include
which is needed for iconv.h (included from SDL.h). This makes SDL
detection fail.

Try sdl-config first, only if it fails try pkg-config.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 configure |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
Paolo Bonzini - Feb. 14, 2010, 12:04 p.m.
On 02/14/2010 08:23 AM, Blue Swirl wrote:
> On OpenBSD, pkg-config sdl --cflags forgets to add -I/usr/local/include
> which is needed for iconv.h (included from SDL.h). This makes SDL
> detection fail.
>
> Try sdl-config first, only if it fails try pkg-config.

This breaks cross-compilation.  I'm CCing the OpenBSD package maintainer 
so that he can fix it.

Upstream SDL has

     --cflags)
       echo -I@includedir@/SDL @SDL_CFLAGS@
       ;;

in sdl-config.in and

Cflags: -I${includedir}/SDL @SDL_CFLAGS@

in sdl.pc.in, while OpenBSD has different values, so he modified 
sdl-config apparently but not sdl.pc.in.

Paolo
Jacob Meuser - Feb. 14, 2010, 3:19 p.m.
On Sun, Feb 14, 2010 at 01:04:31PM +0100, Paolo Bonzini wrote:
> On 02/14/2010 08:23 AM, Blue Swirl wrote:
> >On OpenBSD, pkg-config sdl --cflags forgets to add -I/usr/local/include
> >which is needed for iconv.h (included from SDL.h). This makes SDL
> >detection fail.
> >
> >Try sdl-config first, only if it fails try pkg-config.
> 
> This breaks cross-compilation.  I'm CCing the OpenBSD package
> maintainer so that he can fix it.
> 
> Upstream SDL has
> 
>     --cflags)
>       echo -I@includedir@/SDL @SDL_CFLAGS@
>       ;;
> 
> in sdl-config.in and
> 
> Cflags: -I${includedir}/SDL @SDL_CFLAGS@
> 
> in sdl.pc.in, while OpenBSD has different values, so he modified
> sdl-config apparently but not sdl.pc.in.

that was done before I became maintainer.  anyway, I'll fix it after
ports unlocks.  thanks for the notice.

Patch

diff --git a/configure b/configure
index 0a84b0e..aee1f2c 100755
--- a/configure
+++ b/configure
@@ -1036,12 +1036,12 @@  fi
 ##########################################
 # SDL probe

-if $pkgconfig sdl --modversion >/dev/null 2>&1; then
-  sdlconfig="$pkgconfig sdl"
-  _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
-elif has sdl-config; then
+if has sdl-config; then
   sdlconfig='sdl-config'
   _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'`
+elif $pkgconfig sdl --modversion >/dev/null 2>&1; then
+  sdlconfig="$pkgconfig sdl"
+  _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
 else
   if test "$sdl" = "yes" ; then
     feature_not_found "sdl"