-AC_CHECK_LIB(SDL_image, IMG_Load,,
- AC_MSG_ERROR([SDL_image library required]))
+NP_FINDLIB([SDLMIXER], [SDL_mixer], [SDL_mixer >= 1.2],
+ NP_LANG_PROGRAM([#include <SDL_mixer.h>
+#if MIX_MAJOR_VERSION < 1
+# error SDLMix too old
+#else
+# if MIX_MAJOR_VERSION == 1
+# if MIX_MINOR_VERSION < 2
+# error SDLMix too old
+# endif
+# endif
+#endif], [Mix_OpenAudio(0, 0, 0, 0);]),
+ [], [-lSDL_mixer],
+ [],
+ [AC_MSG_ERROR([Please install SDLMixer >=1.2.2])],
+ [$SDL_CFLAGS], [$SDL_LIBS])
+
+NP_FINDLIB([SDLIMAGE], [SDL_image], [SDL_image >= 1.2],
+ NP_LANG_PROGRAM([#include <SDL_image.h>], [IMG_Load("");]),
+ [], [-lSDL_image],
+ [],
+ [AC_MSG_ERROR([Please install SDLImage >= 1.2.1])],
+ [$SDL_CFLAGS], [$SDL_LIBS])