diff options
author | Gwenole Beauchesne <gbeauchesne@splitted-desktop.com> | 2010-10-29 11:35:50 +0200 |
---|---|---|
committer | Austin Yuan <shengquan.yuan@gmail.com> | 2010-12-21 11:29:35 +0800 |
commit | 68c5f603d868707488184146801b0d87782f0161 (patch) | |
tree | 1416b9859124e4973f4c34fbe8b9f840906c33ae /build | |
parent | 071658db3952cecf2c4eda424af231b1a07cd1bf (diff) | |
download | libva-68c5f603d868707488184146801b0d87782f0161.tar.gz |
Android: try to auto generate <va/version.h>
Diffstat (limited to 'build')
-rw-r--r-- | build/gen_version.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/build/gen_version.sh b/build/gen_version.sh new file mode 100644 index 0000000..dd01d95 --- /dev/null +++ b/build/gen_version.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +libva_topdir="$1" +version_h_in="$2" + +parse_configure_ac() { + sed -n "/^m4_define.*${1}.*\[\([0-9]*\)\].*/s//\1/p" ${libva_topdir}/configure.ac +} + +parse_configure() { + sed -n "/^${1}=\([0-9]*\)/s//\1/p" ${libva_topdir}/configure +} + +if test -f "${libva_topdir}/configure.ac"; then + libva_major_version=`parse_configure_ac libva_major_version` + libva_minor_version=`parse_configure_ac libva_minor_version` + libva_micro_version=`parse_configure_ac libva_micro_version` +elif test -f "${libva_topdir}/configure"; then + libva_major_version=`parse_configure LIBVA_MAJOR_VERSION` + libva_minor_version=`parse_configure LIBVA_MINOR_VERSION` + libva_micro_version=`parse_configure LIBVA_MICRO_VERSION` +else + echo "ERROR: configure or configure.ac file not found in $libva_topdir/" + exit 1 +fi +libva_version="$libva_major_version.$libva_minor_version.$libva_micro_version" + +sed -e "s/@LIBVA_MAJOR_VERSION@/${libva_major_version}/" \ + -e "s/@LIBVA_MINOR_VERSION@/${libva_minor_version}/" \ + -e "s/@LIBVA_MICRO_VERSION@/${libva_micro_version}/" \ + -e "s/@LIBVA_VERSION@/${libva_version}/" \ + $version_h_in |