| 1 |
AC_DEFUN([AM_TRY_LINK_SDL_IMAGE], |
| 2 |
[ |
| 3 |
AC_MSG_CHECKING([for SDL_image library (>= 1.2.0)]) |
| 4 |
|
| 5 |
old_CFLAGS="$CFLAGS" |
| 6 |
CFLAGS="$SDL_CFLAGS" |
| 7 |
old_LDFLAGS="$LDFLAGS" |
| 8 |
LDFLAGS="$SDL_LDFLAGS" |
| 9 |
old_LIBS="$LIBS" |
| 10 |
LIBS="$SDL_LIBS -lSDL_image" |
| 11 |
# echo "{Using CFLAGS='$CFLAGS' LDFLAGS='$LDFLAGS' LIBS='$LIBS'}" |
| 12 |
|
| 13 |
AC_TRY_LINK( |
| 14 |
[ |
| 15 |
#include <SDL_image.h> |
| 16 |
int main(int argc, char **argv) |
| 17 |
{ |
| 18 |
SDL_Surface *image = IMG_LoadXPM_RW((SDL_RWops *) 0); |
| 19 |
return image != image; |
| 20 |
} |
| 21 |
#undef main |
| 22 |
#define main suspended_main |
| 23 |
], |
| 24 |
[ |
| 25 |
], |
| 26 |
[ |
| 27 |
AC_MSG_RESULT([found]) |
| 28 |
], |
| 29 |
[ |
| 30 |
AC_MSG_ERROR([could not link with SDL_image. |
| 31 |
You can get it at http://www.libsdl.org/projects/SDL_image/]) |
| 32 |
]) |
| 33 |
|
| 34 |
CFLAGS="$old_CFLAGS" |
| 35 |
unset old_CFLAGS |
| 36 |
LDFLAGS="$old_LDFLAGS" |
| 37 |
unset old_LDFLAGS |
| 38 |
LIBS="$old_LIBS" |
| 39 |
unset old_LIBS |
| 40 |
] |
| 41 |
) |