| Summary: | SDL_image should use .pc files when possible | ||
|---|---|---|---|
| Product: | SDL_image | Reporter: | Mike Frysinger <vapier> |
| Component: | misc | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
sdl-image-find-lib-cross.patch
libsdl-sdl-m4-pkg-config.patch libsdl-sdl-m4-pkg-config.2.patch sdl-image-pkg-config-png.patch |
||
|
Description
Mike Frysinger
2007-12-10 16:47:36 UTC
I'm not very familiar with the pkg-config system. Can you supply a patch? Thanks! Created attachment 240 [details]
sdl-image-find-lib-cross.patch
sorry, i didnt see your reply
this patch makes it so find_lib() does not look in /usr/local/lib and /usr/lib when cross-compiling as that can easily cause troubles
Created attachment 241 [details]
libsdl-sdl-m4-pkg-config.patch
here's the fun one ... this updates libsdl's sdl.m4 so that it uses sdl.pc (and pkg-config) before sdl-config
the order preference is:
- use sdl configure options first from user
- try to use sdl.pc/pkg-config
- try to use sdl-config/SDL_CONFIG
so really all this does is insert pkg-config before the normal default logic
I applied your configure.in patch, thanks! The sdl.m4 patch didn't cleanly apply though, can you update it for the latest SDL snapshot? http://www.libsdl.org/tmp/SDL-1.2.zip Thanks! Created attachment 382 [details]
libsdl-sdl-m4-pkg-config.2.patch
applied rev 3493 and rev 3532 manually to get the patch to apply
Are you creating the diff against the current SDL_image in subversion? sam-lantingas-mac-pro:SDL_image hercules$ patch -l -p2 <~/Downloads/libsdl-sdl-m4-pkg-config.2.patch patching file acinclude/sdl.m4 Hunk #1 FAILED at 19. this bug started out as "SDL_image should do XXX", but the m4 problems SDL_image isnt specific to it. the problematic code comes from SDL itself, so the patch applies to trunk/SDL/sdl.m4. once the original version gets fixed, it'll propagate to all the other packages. It doesn't quite work here... ./configure: line 20603: syntax error near unexpected token `SDL,' ./configure: line 20603: ` PKG_CHECK_MODULES(SDL, sdl >= $min_sdl_version,' do you not have pkg-config installed on your system ? it provides that m4 macro via its pkg.m4 ... guess the AM_PATH_SDL should be updated like so: @@ -10,5 +10,6 @@ dnl AC_DEFUN([AM_PATH_SDL], -[dnl +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl dnl Get the cflags and libraries from the sdl-config script dnl Okay, I tried that...
configure.in:87: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
acinclude/sdl.m4:203: AM_PATH_SDL is expanded from...
configure.in:87: the top level
configure.in:87: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
acinclude/sdl.m4:203: AM_PATH_SDL is expanded from...
configure.in:87: the top level
configure.in:87: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
acinclude/sdl.m4:203: AM_PATH_SDL is expanded from...
configure.in:87: the top level
configure.in:1: error: possibly undefined macro: dnl
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure:20608: error: possibly undefined macro: AC_MSG_RESULT
adding the AC_REQUIRE wont fix your original problem (no pkg.m4 on your system), it'll only make the failure obvious at an earlier point (from a sometimes-syntax error to an autoconf error) you still need to install the pkgconfig program and the associated pkg.m4: http://pkgconfig.freedesktop.org/wiki/ i dont think it's unreasonable to expect developers who are running autotools to have this installed Okay, I applied your changes to sdl.m4 to SDL 1.3 and the SDL_* libraries I maintain, and added pkg.m4 to the libraries. I didn't want to make that change to SDL 1.2 because anyone who updates to the release will suddenly have an unexpected pkg.m4 dependency. Can you provide a patch for the png support? It should fall back to the current system if pkg-config isn't available. Thanks! Created attachment 395 [details]
sdl-image-pkg-config-png.patch
i think the current handling of autotool files is broken ... but i guess it doesnt matter since i'm not the SDL maintainer. since you're including pkg.m4 in svn, no one who updates will have a dependency on pkg.m4.
at any rate, this patch should convert SDL_image's png lookup to pkg-config
Should there be equivalent changes for libjpeg and libtiff? Do you have suggestions on improving the autotools support? Thanks! the jpeg/tiff packages dont provide .pc files, so they wouldnt work imo, generated autotool files shouldnt be in svn. it does mean that people need more development packages installed in order to use the development svn, but i think that is how it should be. i dont imagine you want to impose these higher requirements on people which is why you copy so much to acinclude/ and such. Yes, that's true. My general philosophy is to try to work on as many different environments as possible. :) |