why did no one notice ?
[platform/upstream/gst-plugins-good.git] / m4 / as-slurp-ffmpeg.m4
1 dnl slurp-ffmpeg.m4 0.1.0
2 dnl a macro to slurp in ffmpeg's cvs source inside a project tree
3 dnl taken from Autostar Sandbox, http://autostars.sourceforge.net/
4
5 dnl Usage:
6 dnl AS_SLURP_FFMPEG(DIRECTORY, DATE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
7 dnl
8 dnl Example:
9 dnl AM_PATH_FFMPEG(lib/ffmpeg, "2002-12-14 12:00 GMT")
10 nl
11
12 AC_DEFUN(AS_SLURP_FFMPEG,
13 [
14   # save original dir
15   DIRECTORY=`pwd`
16   # get/update cvs
17   if test ! -d $1; then mkdir -p $1; fi
18   cd $1
19
20   if test ! -d ffmpeg; then
21     # check out cvs code
22     AC_MSG_NOTICE(checking out ffmpeg cvs code from $2 into $1)
23     cvs -Q -d:pserver:anonymous@cvs.ffmpeg.sourceforge.net:/cvsroot/ffmpeg co -D $2 ffmpeg || FAILED=yes
24     cd ffmpeg
25   else
26     cd ffmpeg 
27     AC_MSG_NOTICE(updating ffmpeg cvs code)
28     cvs -Q update -dP -D $2 || FAILED=yes
29   fi
30   
31   # now configure it
32   ./configure
33
34   # now go back
35   cd $DIRECTORY
36
37   if test "x$FAILED" == "xyes"; then
38     [$4]
39   else
40     [$3]
41   fi
42 ])