--- smpeg-0.4.5+cvs20030824.orig/smpeg.m4
+++ smpeg-0.4.5+cvs20030824/smpeg.m4
@@ -6,20 +6,25 @@
 # stolen from Manish Singh
 # Shamelessly stolen from Owen Taylor
 
-dnl AM_PATH_SMPEG([MINIMUM-VERSION, [ACTION-IF-FOUND [, 
-ACTION-IF-NOT-FOUND]]])
+dnl AM_PATH_SMPEG([MINIMUM-VERSION, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
 dnl Test for SMPEG, and define SMPEG_CFLAGS and SMPEG_LIBS
 dnl
-AC_DEFUN(AM_PATH_SMPEG,
+AC_DEFUN([AM_PATH_SMPEG],
 [dnl
 dnl Get the cflags and libraries from the smpeg-config script
 dnl
-AC_ARG_WITH(smpeg-prefix,[  --with-smpeg-prefix=PFX   Prefix where SMPEG is installed (optional)],
-            smpeg_prefix="$withval", smpeg_prefix="")
-AC_ARG_WITH(smpeg-exec-prefix,[  --with-smpeg-exec-prefix=PFX Exec prefix where SMPEG is installed (optional)],
-            smpeg_exec_prefix="$withval", smpeg_exec_prefix="")
-AC_ARG_ENABLE(smpegtest, [  --disable-smpegtest       Do not try to compile and run a test SMPEG program],
-                    , enable_smpegtest=yes)
+AC_ARG_WITH([smpeg-prefix],
+            AS_HELP_STRING([--with-smpeg-prefix=PFX],
+                           [Prefix where SMPEG is installed (optional)]),
+            [smpeg_prefix="$withval"], [smpeg_prefix=""])
+AC_ARG_WITH([smpeg-exec-prefix],
+            AS_HELP_STRING([--with-smpeg-exec-prefix=PFX],
+                           [Exec prefix where SMPEG is installed (optional)]),
+            [smpeg_exec_prefix="$withval"], [smpeg_exec_prefix=""])
+AC_ARG_ENABLE([smpegtest],
+              AS_HELP_STRING([--disable-smpegtest],
+                             [Do not try to compile and run a test SMPEG program]),
+              [], [enable_smpegtest=yes])
 
   if test x$smpeg_exec_prefix != x ; then
      smpeg_args="$smpeg_args --exec-prefix=$smpeg_exec_prefix"
@@ -34,9 +39,9 @@
      fi
   fi
 
-  AC_PATH_PROG(SMPEG_CONFIG, smpeg-config, no)
-  min_smpeg_version=ifelse([$1], ,0.2.7,$1)
-  AC_MSG_CHECKING(for SMPEG - version >= $min_smpeg_version)
+  AC_PATH_PROG([SMPEG_CONFIG], [smpeg-config], [no])
+  min_smpeg_version=ifelse([$1], [], [0.2.7], [$1])
+  AC_MSG_CHECKING([for SMPEG - version >= $min_smpeg_version])
   no_smpeg=""
   if test "$SMPEG_CONFIG" = "no" ; then
     no_smpeg=yes
@@ -60,7 +65,7 @@
 dnl checks the results of smpeg-config to some extent
 dnl
       rm -f conf.smpegtest
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -117,16 +122,16 @@
     }
 }
 
-],, no_smpeg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+]])],[],[no_smpeg=yes], [echo $ac_n "cross compiling; assumed OK... $ac_c"])
        CFLAGS="$ac_save_CFLAGS"
        LIBS="$ac_save_LIBS"
      fi
   fi
   if test "x$no_smpeg" = x ; then
-     AC_MSG_RESULT(yes)
-     ifelse([$2], , :, [$2])
+     AC_MSG_RESULT([yes])
+     ifelse([$2], [], [:], [$2])
   else
-     AC_MSG_RESULT(no)
+     AC_MSG_RESULT([no])
      if test "$SMPEG_CONFIG" = "no" ; then
        echo "*** The smpeg-config script installed by SMPEG could not be found"
        echo "*** If SMPEG was installed in PREFIX, make sure PREFIX/bin is in"
@@ -139,10 +144,11 @@
           echo "*** Could not run SMPEG test program, checking why..."
           CFLAGS="$CFLAGS $SMPEG_CFLAGS $SDL_CFLAGS"
           LIBS="$LIBS $SMPEG_LIBS $SDL_LIBS"
-          AC_TRY_LINK([
+          AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #include <stdio.h>
 #include "smpeg.h"
-],      [ return 0; ],
+]],
+        [[ return 0; ]])],
         [ echo "*** The test program compiled, but did not run. This usually means"
           echo "*** that the run-time linker is not finding SMPEG or finding the wrong"
           echo "*** version of SMPEG. If it is not finding SMPEG, you'll need to set your"
@@ -162,9 +168,9 @@
      fi
      SMPEG_CFLAGS=""
      SMPEG_LIBS=""
-     ifelse([$3], , :, [$3])
+     ifelse([$3], [], [:], [$3])
   fi
-  AC_SUBST(SMPEG_CFLAGS)
-  AC_SUBST(SMPEG_LIBS)
+  AC_SUBST([SMPEG_CFLAGS])
+  AC_SUBST([SMPEG_LIBS])
   rm -f conf.smpegtest
 ])
