Skip to contentSkip to conversation

Give sdl-config higher priority than pkg-config

PATCH In review Blue Swirl 3 participants 5 messages Feb 14, 2010

lore
Share & tools
lore

Blue Swirl

author
#0 lore raw

PATCH 1/1 Give sdl-config higher priority than pkg-config

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.

---
 configure |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
configure +4 -4
index 0a84b0e..aee1f2c 100755
@@ -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"
Signature · 1 line
1.6.2.4
#1 lore raw
Quoted 5 lines · Blue Swirl

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

author
#2 lore raw
Quoted 17 lines · Paolo Bonzini
Quoted 6 lines · Blue Swirl

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@
     ;;

Quoted 6 lines

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.

Right. I think this patch against ports/devel/sdl should do the trick:

patch-sdl_pc_in Sun Feb 14 14:10:50 2010 renamed from patch-sdl_pc_in.orig Sun Feb 14 14:08:41 2010 +1 -1
@@ -8,4 +8,4 @@
 -Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@
 -Cflags: -I${includedir}/SDL @SDL_CFLAGS@
 +Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ @X_LIBS@
-+Cflags: -I${includedir}/SDL @SDL_CFLAGS@ @X_CFLAGS@
++Cflags: -I${includedir} -I${includedir}/SDL @SDL_CFLAGS@ @X_CFLAGS@
#3 lore raw

patch-sdl_pc_in Sun Feb 14 14:10:50 2010 line 11

Quoted 11 lines

Right. I think this patch against ports/devel/sdl should do the trick:

patch-sdl_pc_in Sun Feb 14 14:10:50 2010 renamed from patch-sdl_pc_in.orig Sun Feb 14 14:08:41 2010 +1 -1
@@ -8,4 +8,4 @@
  -Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@
  -Cflags: -I${includedir}/SDL @SDL_CFLAGS@
  +Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ @X_LIBS@
-+Cflags: -I${includedir}/SDL @SDL_CFLAGS@ @X_CFLAGS@
++Cflags: -I${includedir} -I${includedir}/SDL @SDL_CFLAGS@ @X_CFLAGS@

Yep, thanks very much.

Paolo

#4 lore raw
In reply to Paolo Bonzini
Quoted 16 lines · Paolo Bonzini
Quoted 5 lines · Blue Swirl

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@
      ;;
Quoted 6 lines

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.

Signature · 2 lines
[email protected]
SDF Public Access UNIX System - http://sdf.lonestar.org