Commit 68c5f603 authored by Gwenole Beauchesne's avatar Gwenole Beauchesne Committed by Austin Yuan

Android: try to auto generate <va/version.h>

parent 071658db
#!/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
......@@ -13,7 +13,16 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
va.c \
va_trace.c \
va_fool.c
va_fool.c
intermediates := $(local-intermediates-dir)
GEN := $(intermediates)/va_version.h
$(GEN): PRIVATE_GEN_VERSION := $(LOCAL_PATH)/../build/gen_version.sh
$(GEN): PRIVATE_INPUT_FILE := $(LOCAL_PATH)/va_version.h.in
$(GEN): PRIVATE_CUSTOM_TOOL = sh $(PRIVATE_GEN_VERSION) $(LOCAL_PATH)/.. $(PRIVATE_INPUT_FILE) > $@
$(GEN): $(LOCAL_PATH)/va_version.h $(PRIVATE_GEN_VERSION)
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
LOCAL_CFLAGS += \
-DANDROID \
......
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