aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLloyd Pique <lpique@google.com>2016-07-06 18:12:59 -0700
committerTreeHugger Robot <treehugger-gerrit@google.com>2016-07-07 17:53:30 +0000
commitcf7e256453b7b59d456aff9a28823751ceee908d (patch)
tree6c547d1106816939b89c02777ebb8f1bc1934463
parent97c0f573a86250ff0009610df2925451e4013958 (diff)
downloadwayland-cf7e256453b7b59d456aff9a28823751ceee908d.tar.gz
cheets: Removed hardcoded version from Android.mk
Instead the build file now extracts the version from configure.ac. This makes it easier to uprev by just getting new files without having to remember to touch Android.mk. TEST=wayland-version.h defines version "1.11.0" (current version) Change-Id: Ic7d0054de2e1028c8818ecd4caa441116c65fdae
-rw-r--r--Android.mk26
1 files changed, 13 insertions, 13 deletions
diff --git a/Android.mk b/Android.mk
index 60da2d0..fa3d2d4 100644
--- a/Android.mk
+++ b/Android.mk
@@ -17,17 +17,6 @@ LOCAL_PATH := $(call my-dir)
WAYLAND_CFLAGS := -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes
WAYLAND_CFLAGS += -Wmissing-prototypes -fvisibility=hidden -Wno-pointer-arith
-WAYLAND_VERSION_MAJOR := 1
-WAYLAND_VERSION_MINOR := 9
-WAYLAND_VERSION_MICRO := 91
-WAYLAND_VERSION := "1.9.91"
-
-WAYLAND_TEMPLATE_SUBST := -e s/@WAYLAND_VERSION_MAJOR@/$(WAYLAND_VERSION_MAJOR)/
-WAYLAND_TEMPLATE_SUBST += -e s/@WAYLAND_VERSION_MINOR@/$(WAYLAND_VERSION_MINOR)/
-WAYLAND_TEMPLATE_SUBST += -e s/@WAYLAND_VERSION_MICRO@/$(WAYLAND_VERSION_MICRO)/
-WAYLAND_TEMPLATE_SUBST += -e s/@WAYLAND_VERSION@/$(WAYLAND_VERSION)/
-
-
###############################################################################
# Build wayland_scanner, used to generate code
@@ -118,14 +107,25 @@ $(GEN) : $(LOCAL_PATH)/src/%-client-protocol.h : $(LOCAL_PATH)/protocol/%.xml
$(call local-intermediates-dir)/export_includes : $(GEN)
# --- Generate wayland-version.h from wayland-version.h.in
+# This process does some simple text substitution based on values defined in configure.ac
# We must put the output where the users of the library can see it.
GEN := $(addprefix $(LOCAL_PATH)/src/, \
wayland-version.h \
)
LOCAL_ADDITIONAL_DEPENDENCIES += $(GEN)
$(GEN) : PRIVATE_PATH := $(LOCAL_PATH)
-$(GEN) : PRIVATE_CUSTOM_TOOL = sed $(WAYLAND_TEMPLATE_SUBST) < $< > $@
-$(GEN) : $(LOCAL_PATH)/src/%.h : $(LOCAL_PATH)/src/%.h.in
+$(GEN) : PRIVATE_CUSTOM_TOOL = \
+ export WAYLAND_VERSION_MAJOR=$$(grep -o -E 'define..wayland_major_version.+' $(PRIVATE_PATH)/configure.ac | grep -o -E '[0-9]+') ; \
+ export WAYLAND_VERSION_MINOR=$$(grep -o -E 'define..wayland_minor_version.+' $(PRIVATE_PATH)/configure.ac | grep -o -E '[0-9]+') ; \
+ export WAYLAND_VERSION_MICRO=$$(grep -o -E 'define..wayland_micro_version.+' $(PRIVATE_PATH)/configure.ac | grep -o -E '[0-9]+') ; \
+ export WAYLAND_VERSION="$${WAYLAND_VERSION_MAJOR}.$${WAYLAND_VERSION_MINOR}.$${WAYLAND_VERSION_MICRO}" ; \
+ sed \
+ -e s/@WAYLAND_VERSION_MAJOR@/$${WAYLAND_VERSION_MAJOR}/ \
+ -e s/@WAYLAND_VERSION_MINOR@/$${WAYLAND_VERSION_MINOR}/ \
+ -e s/@WAYLAND_VERSION_MICRO@/$${WAYLAND_VERSION_MICRO}/ \
+ -e s/@WAYLAND_VERSION_MICRO@/$${WAYLAND_VERSION_MICRO}/ \
+ -e s/@WAYLAND_VERSION@/$${WAYLAND_VERSION}/ < $< > $@
+$(GEN) : $(LOCAL_PATH)/src/%.h : $(LOCAL_PATH)/src/%.h.in | $(LOCAL_PATH)/configure.ac
$(transform-generated-source)
# Note: The line above must be indented with tabs.