+ Correction for uninstalled sdl image lib
[melted] / src / modules / sdl / configure
index 1c40fac..af5568c 100755 (executable)
@@ -1,11 +1,27 @@
-#!/bin/bash
+#!/bin/sh
 
 if [ "$help" != "1" ]
 then
 
-cat << EOF >> ../consumers.dat
-sdl                            libmltsdl.so
-EOF
+       sdl-config --version > /dev/null 2>&1
+       disable_sdl=$?
+
+       if [ "$disable_sdl" = "0" ]
+       then
+               echo > config.mak
+               image=`sdl-config --prefix`/include/SDL/SDL_image.h
+               echo "sdl                               libmltsdl$LIBSUF" >> ../consumers.dat
+               echo "sdl_preview               libmltsdl$LIBSUF" >> ../consumers.dat
+               echo "sdl_still                 libmltsdl$LIBSUF" >> ../consumers.dat
+               if [ -f "$image" ]
+               then
+                       echo "sdl_image                 libmltsdl$LIBSUF" >> ../producers.dat
+                       echo "WITH_SDL_IMAGE=1" >> config.mak
+               fi
+       else
+               echo "- sdl development libs not found: disabling"
+               touch ../disable-sdl
+       fi
 
 fi