Thomas Vander Stichele | fae586d | 2003-01-05 11:31:42 +0000 | [diff] [blame] | 1 | dnl slurp-ffmpeg.m4 0.1.1 |
Thomas Vander Stichele | d367c10 | 2002-12-27 16:04:22 +0000 | [diff] [blame] | 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: |
Thomas Vander Stichele | fae586d | 2003-01-05 11:31:42 +0000 | [diff] [blame] | 6 | dnl AS_SLURP_FFMPEG(DIRECTORY, DATE, [ACTION-IF-WORKED [, ACTION-IF-NOT-WORKED]]]) |
Thomas Vander Stichele | d367c10 | 2002-12-27 16:04:22 +0000 | [diff] [blame] | 7 | dnl |
| 8 | dnl Example: |
Thomas Vander Stichele | fae586d | 2003-01-05 11:31:42 +0000 | [diff] [blame] | 9 | dnl AM_PATH_FFMPEG(lib/ffmpeg, 2002-12-14 12:00 GMT) |
| 10 | dnl |
| 11 | dnl make sure you have a Tag file in the dir where you check out that |
| 12 | dnl is the Tag of CVS you want to have checked out |
| 13 | dnl it should correspond to the DATE argument you supply, ie resolve to |
| 14 | dnl the same date |
| 15 | dnl (in an ideal world, cvs would understand it's own Tag file format as |
| 16 | dnl a date spec) |
Thomas Vander Stichele | d367c10 | 2002-12-27 16:04:22 +0000 | [diff] [blame] | 17 | |
Thomas Vander Stichele | fd831b8 | 2004-02-11 16:44:05 +0000 | [diff] [blame] | 18 | AC_DEFUN([AS_SLURP_FFMPEG], |
Thomas Vander Stichele | d367c10 | 2002-12-27 16:04:22 +0000 | [diff] [blame] | 19 | [ |
| 20 | # save original dir |
Benjamin Otte | f4a7caa | 2003-06-29 19:46:13 +0000 | [diff] [blame] | 21 | FAILED="" |
Thomas Vander Stichele | d367c10 | 2002-12-27 16:04:22 +0000 | [diff] [blame] | 22 | DIRECTORY=`pwd` |
| 23 | # get/update cvs |
| 24 | if test ! -d $1; then mkdir -p $1; fi |
Benjamin Otte | 803ff8f | 2003-11-24 04:08:47 +0000 | [diff] [blame] | 25 | dnl we need to check $srcdir/$1 or it will always checkout ffmpeg even if it is there |
| 26 | dnl at least when top_srcdir != top_builddir. |
| 27 | dnl FIXME: unfortunately this makes the checkout go into top_srcdir |
| 28 | cd $srcdir/$1 |
Thomas Vander Stichele | d367c10 | 2002-12-27 16:04:22 +0000 | [diff] [blame] | 29 | |
Christian Schaller | bc87339 | 2003-09-13 10:25:22 +0000 | [diff] [blame] | 30 | if test ! -e ffmpeg/README; then |
Thomas Vander Stichele | d367c10 | 2002-12-27 16:04:22 +0000 | [diff] [blame] | 31 | # check out cvs code |
| 32 | AC_MSG_NOTICE(checking out ffmpeg cvs code from $2 into $1) |
Jeremy Simon | 096dc55 | 2003-10-23 20:45:32 +0000 | [diff] [blame] | 33 | cvs -Q -z4 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co -D '$2' ffmpeg || FAILED=yes |
Thomas Vander Stichele | d367c10 | 2002-12-27 16:04:22 +0000 | [diff] [blame] | 34 | else |
Thomas Vander Stichele | fae586d | 2003-01-05 11:31:42 +0000 | [diff] [blame] | 35 | # compare against Tag file and see if it needs updating |
Benjamin Otte | f4a7caa | 2003-06-29 19:46:13 +0000 | [diff] [blame] | 36 | if test "`cat Tag`" == "$2"; then |
Thomas Vander Stichele | fae586d | 2003-01-05 11:31:42 +0000 | [diff] [blame] | 37 | AC_MSG_NOTICE(ffmpeg cvs code in sync) |
| 38 | else |
Thomas Vander Stichele | fae586d | 2003-01-05 11:31:42 +0000 | [diff] [blame] | 39 | cd ffmpeg |
Benjamin Otte | f4a7caa | 2003-06-29 19:46:13 +0000 | [diff] [blame] | 40 | AC_MSG_NOTICE(updating ffmpeg cvs code to $2) |
Jeremy Simon | 096dc55 | 2003-10-23 20:45:32 +0000 | [diff] [blame] | 41 | cvs -Q -z4 update -dP -D '$2' || FAILED=yes |
Benjamin Otte | f4a7caa | 2003-06-29 19:46:13 +0000 | [diff] [blame] | 42 | cd .. |
Thomas Vander Stichele | fae586d | 2003-01-05 11:31:42 +0000 | [diff] [blame] | 43 | fi |
Thomas Vander Stichele | d367c10 | 2002-12-27 16:04:22 +0000 | [diff] [blame] | 44 | fi |
Benjamin Otte | d79e4c6 | 2003-09-27 16:44:53 +0000 | [diff] [blame] | 45 | if test "x$FAILED" != "xyes"; then |
| 46 | echo "$2" > Tag |
| 47 | fi |
Thomas Vander Stichele | d367c10 | 2002-12-27 16:04:22 +0000 | [diff] [blame] | 48 | |
Thomas Vander Stichele | d367c10 | 2002-12-27 16:04:22 +0000 | [diff] [blame] | 49 | # now go back |
| 50 | cd $DIRECTORY |
| 51 | |
| 52 | if test "x$FAILED" == "xyes"; then |
| 53 | [$4] |
Thomas Vander Stichele | fae586d | 2003-01-05 11:31:42 +0000 | [diff] [blame] | 54 | false |
Thomas Vander Stichele | d367c10 | 2002-12-27 16:04:22 +0000 | [diff] [blame] | 55 | else |
| 56 | [$3] |
Thomas Vander Stichele | fae586d | 2003-01-05 11:31:42 +0000 | [diff] [blame] | 57 | true |
Thomas Vander Stichele | d367c10 | 2002-12-27 16:04:22 +0000 | [diff] [blame] | 58 | fi |
| 59 | ]) |