~ppsspp/ppsspp/ffmpeg

« back to all changes in this revision

Viewing changes to version.sh

  • Committer: Henrik Rydgård
  • Date: 2014-01-03 10:44:32 UTC
  • Revision ID: git-v1:87c6c126784b1718bfa448ecf2e6a9fef781eb4e
Update our ffmpeg snapshot to a clone of the official repository.

This is because Maxim's at3plus support has been officially merged!

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
 
 
3
# Usage: version.sh <ffmpeg-root-dir> <output-version.h> <extra-version>
 
4
 
3
5
# check for git short hash
4
6
if ! test "$revision"; then
5
7
    revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
40
42
fi
41
43
 
42
44
NEW_REVISION="#define FFMPEG_VERSION \"$version\""
43
 
OLD_REVISION=$(cat version.h 2> /dev/null)
44
 
 
45
 
# Update version.h only on revision changes to avoid spurious rebuilds
 
45
OLD_REVISION=$(cat "$2" 2> /dev/null | head -3 | tail -1)
 
46
 
 
47
# String used for preprocessor guard
 
48
GUARD=$(echo "$2" | sed 's/\//_/' | sed 's/\./_/' | tr '[:lower:]' '[:upper:]' | sed 's/LIB//')
 
49
 
 
50
# Update version header only on revision changes to avoid spurious rebuilds
46
51
if test "$NEW_REVISION" != "$OLD_REVISION"; then
47
 
    echo "$NEW_REVISION" > "$2"
 
52
    cat << EOF > "$2"
 
53
#ifndef $GUARD
 
54
#define $GUARD
 
55
$NEW_REVISION
 
56
#endif /* $GUARD */
 
57
EOF
48
58
fi