From 6f085e7a94450288e08c4d8d9858083d20bf246c Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 30 May 2013 20:07:39 +0100 Subject: [PATCH] autotools: run ndk-build when 'make android' is invoked to simplify the build steps --- Makefile.am | 12 +++++++++--- README.md | 15 +++++---------- configure.ac | 5 +++++ 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Makefile.am b/Makefile.am index dfdde30f..6fe3af95 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,7 @@ DATADIR=$(PREFIX)/share/espeak-data PLATFORM=big_endian -.PHONY: all clean distclean espeak-phoneme-data +.PHONY: android all clean distclean espeak-phoneme-data EXTRA_DIST= @@ -118,7 +118,10 @@ espeak-data/phsource/dir.stamp: phsource/ph_* phsource/phonemes phsource/intonat espeak-data/phontab: src/espeakedit espeak-data/dictsource/dir.stamp espeak-data/phsource/dir.stamp ESPEAK_DATA_PATH=$(PWD) src/espeakedit --compile -##### android language data packs: +##### android targets: + +jni: + cd android && ndk-build android/res/raw/espeakdata.zip: espeak-data/phontab dictionaries mkdir -pv android/res/raw @@ -130,7 +133,10 @@ android/res/raw/espeakdata.zip: espeak-data/phontab dictionaries android/res/raw/espeakdata_version: android/res/raw/espeakdata.zip sha1sum $< | awk '{ print $$1 }' > $@ -android: android/res/raw/espeakdata.zip android/res/raw/espeakdata_version +android: \ + jni \ + android/res/raw/espeakdata.zip \ + android/res/raw/espeakdata_version ##### dictionaries: diff --git a/README.md b/README.md index 4724b102..0fa472de 100644 --- a/README.md +++ b/README.md @@ -23,17 +23,12 @@ If you are building on the command line, you will also need: ## Building eSpeak -1. Generate the build files and get the required git submodules by running: +The eSpeak language data file and the JNI bindings needed for the Android +APK can be build using the following commands: - $ ./autogen.sh -1. Build the `libttsespeak.so` file by running: - - $ cd android - $ ndk-build -2. Build the `android/res/raw/espeakdata.zip` file by running: - - $ ./configure --prefix=/usr - $ make android + $ ./autogen.sh + $ ./configure --prefix=/usr + $ make android ## Building the APK with Eclipse diff --git a/configure.ac b/configure.ac index 3e81da50..c77c6eba 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,11 @@ AC_PROG_CXX AC_PROG_MAKE_SET AC_PROG_LIBTOOL +AC_CHECK_PROG(NDKBUILD_CHECK,[ndk-build],yes) +if test x"$NDKBUILD_CHECK" != xyes ; then + AC_MSG_ERROR([Please ensure that the Android NDK is installed and ndk-build is usable from the command line.]) +fi + dnl ================================================================ dnl getopt checks. dnl ================================================================