Commit c3c73f13 authored by Sean McGovern's avatar Sean McGovern Committed by Fiona Glaser

configure: don't generate a git version number if .git isn't present

parent 12f9d499
#!/bin/bash
[ -n "$1" ] && cd $1
git_version() {
trap 'rm -f config.git-hash' EXIT
git rev-list HEAD | sort > config.git-hash
LOCALVER=`wc -l config.git-hash | awk '{print $1}'`
if [ $LOCALVER \> 1 ] ; then
......@@ -14,11 +17,13 @@ if [ $LOCALVER \> 1 ] ; then
VER="${VER}M"
fi
VER="$VER $(git rev-list HEAD -n 1 | cut -c 1-7)"
echo "#define X264_VERSION \" r$VER\""
else
echo "#define X264_VERSION \"\""
VER="x"
VERSION=" r$VER"
fi
rm -f config.git-hash
}
VER="x"
VERSION=""
[ -d .git ] && (type git >/dev/null 2>&1) && git_version
echo "#define X264_VERSION \"$VERSION\""
API=`grep '#define X264_BUILD' < x264.h | sed -e 's/.* \([1-9][0-9]*\).*/\1/'`
echo "#define X264_POINTVER \"0.$API.$VER\""
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment