diff --git a/configure b/configure
index 5008bca499e8dec05b544a49ec2c2896aad3d4f5..43e9e87dbea6e2eb4e80d765649164de7598edbe 100755
--- a/configure
+++ b/configure
@@ -867,7 +867,7 @@ EOF
 
 freetype2=no
 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
-  if test "`which freetype-config`" != ""; then
+  if freetype-config --version >/dev/null 2>&1 ; then
     if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs`  > /dev/null 2>&1 ; then
       freetype2=yes
     fi
@@ -885,6 +885,7 @@ EOF
 
 sdl_too_old=no
 sdl=no
+if sdl-config --version >/dev/null 2>&1 ; then
 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs`  > /dev/null 2>&1  ; then
 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
 if test "$_sdlversion" -lt 121 ; then
@@ -893,6 +894,7 @@ else
 sdl=yes
 fi
 fi
+fi
 
 case "`$cc -v 2>&1 | grep version`" in
     *gcc*)