aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/INSTALL11
-rw-r--r--java/Makefile.in120
2 files changed, 100 insertions, 31 deletions
diff --git a/java/INSTALL b/java/INSTALL
index 1d6f1535647..91916c6586c 100644
--- a/java/INSTALL
+++ b/java/INSTALL
@@ -158,10 +158,13 @@ the NDK r10b or later. We wanted to make Emacs work on even older
158versions of Android, but they are missing the required JNI graphics 158versions of Android, but they are missing the required JNI graphics
159library that allows Emacs to display text from C code. 159library that allows Emacs to display text from C code.
160 160
161Due to an extremely nasty bug in the Android 2.2 system, the generated 161There is an extremely nasty bug in the Android 2.2 system, the upshot of
162Emacs package cannot be compressed in builds for Android 2.2. As a 162which is that large files within the generated Emacs package cannot be
163result, the Emacs package will be approximately 100 megabytes larger 163compressed in builds for Android 2.2, so that the Emacs package will be
164than a compressed package for a newer version of Android. 164approximately 15 megabytes larger than a compressed package for a newer
165version of Android. For such systems the `zip' utility is also required
166to produce packages that will not be misinterpreted by the package
167manager.
165 168
166 169
167BUILDING C++ DEPENDENCIES 170BUILDING C++ DEPENDENCIES
diff --git a/java/Makefile.in b/java/Makefile.in
index 802da0b9e36..20d595eb3ca 100644
--- a/java/Makefile.in
+++ b/java/Makefile.in
@@ -44,10 +44,20 @@ ANDROID_JAR = @ANDROID_JAR@
44ANDROID_ABI = @ANDROID_ABI@ 44ANDROID_ABI = @ANDROID_ABI@
45ANDROID_SDK_18_OR_EARLIER = @ANDROID_SDK_18_OR_EARLIER@ 45ANDROID_SDK_18_OR_EARLIER = @ANDROID_SDK_18_OR_EARLIER@
46ANDROID_SDK_8_OR_EARLIER = @ANDROID_SDK_8_OR_EARLIER@ 46ANDROID_SDK_8_OR_EARLIER = @ANDROID_SDK_8_OR_EARLIER@
47ZIP = @ZIP@
47WARN_JAVAFLAGS = @WARN_JAVAFLAGS@ 48WARN_JAVAFLAGS = @WARN_JAVAFLAGS@
48JAVAFLAGS = $(WARN_JAVAFLAGS) -classpath "$(ANDROID_JAR):$(srcdir)" 49JAVAFLAGS = $(WARN_JAVAFLAGS) -classpath "$(ANDROID_JAR):$(srcdir)"
49FIND_DELETE = @FIND_DELETE@ 50FIND_DELETE = @FIND_DELETE@
50 51
52ifneq (,$(ANDROID_SDK_8_OR_EARLIER))
53# gzip is invoked to compress installed .el and some .txt files, on SDK
54# 8 and earlier, where ZIP compression is unavailable.
55GZIP_PROG = @GZIP_PROG@
56else
57GZIP_PROG =
58endif
59
60
51# Android 4.3 and earlier require Emacs to be signed with a different 61# Android 4.3 and earlier require Emacs to be signed with a different
52# digital signature algorithm. 62# digital signature algorithm.
53 63
@@ -188,7 +198,7 @@ $(libsrc)/asset-directory-tool:
188# There is no need to depend on NDK_BUILD_SHARED as libemacs.so 198# There is no need to depend on NDK_BUILD_SHARED as libemacs.so
189# does already. 199# does already.
190 200
191.PHONY: install_temp install_temp/assets/directory-tree 201.PHONY: install_temp
192install_temp: $(CROSS_BINS) $(CROSS_LIBS) $(RESOURCE_FILES) 202install_temp: $(CROSS_BINS) $(CROSS_LIBS) $(RESOURCE_FILES)
193 $(AM_V_GEN) 203 $(AM_V_GEN)
194# Make the working directory for this stuff 204# Make the working directory for this stuff
@@ -223,6 +233,54 @@ install_temp: $(CROSS_BINS) $(CROSS_LIBS) $(RESOURCE_FILES)
223 rm -rf $${subdir}/[mM]akefile*[.-]in ; \ 233 rm -rf $${subdir}/[mM]akefile*[.-]in ; \
224 rm -rf $${subdir}/Makefile; \ 234 rm -rf $${subdir}/Makefile; \
225 done 235 done
236# Compress files if AAPT otherwise will not.
237 $(AM_V_SILENT) \
238 [ -z "${GZIP_PROG}" ] || { \
239 echo "Compressing large *.el *.info etc. ..." && \
240 cd "install_temp/assets/lisp" && \
241 for f in `find . -name "*.elc" \( -size +1536 -o \
242 -size 1536 \) -print \
243 | sed 's/.elc$$/.el/'`; do \
244 ${GZIP_PROG} -9n "$$f"; \
245 done; \
246 ${GZIP_PROG} -9n "../etc/publicsuffix.txt"; \
247 find ../info -name "*.elc" -size 1536 -o -size +1536 \
248 | xargs ${GZIP_PROG} -9n ; \
249 }
250# Produce metadata files providing build information and suchlike.
251 $(AM_V_SILENT) \
252 { (cd $(top_srcdir) \
253 && git rev-parse HEAD || echo "Unknown") \
254 && (git rev-parse --abbrev-ref HEAD \
255 || echo "Unknown") } 2> /dev/null > \
256 install_temp/assets/version
257 $(AM_V_SILENT) \
258 { hostname; date +%s; } > install_temp/assets/build_info
259# Produce the file index.
260 $(AM_V_SILENT) $(libsrc)/asset-directory-tool \
261 install_temp/assets install_temp/assets/directory-tree
262# If the package targets Android 2.2, move compressable and
263# non-compressable assets to separate directories.
264 $(AM_V_SILENT) \
265 if [ -z "${ANDROID_SDK_8_OR_EARLIER}" ]; then :; else \
266 echo "Moving large and gzipped files to separate directories...">&2;\
267 mkdir -p install_temp/assets_raw; \
268 cd install_temp/assets; \
269 find . \( -size +1536 -o -size 1536 \) \
270 \( \! -name '*.gz' \) -type f > files.txt; \
271 tar cf ../assets_raw/largefiles.tar -T files.txt; \
272 cat files.txt | xargs rm; \
273 cd ../assets_raw && tar xf largefiles.tar \
274 && rm largefiles.tar; \
275 cd ..; \
276 mkdir -p assets_gz; \
277 find assets -name '*.gz' -type f > files.txt; \
278 tar cf assets_gz/gzfiles.tar -T files.txt; \
279 cat files.txt | xargs rm; \
280 cd assets_gz && tar xf gzfiles.tar \
281 && rm gzfiles.tar; \
282 rm ../assets/files.txt; \
283 fi
226# Generate the directory tree for those directories. 284# Generate the directory tree for those directories.
227# Install architecture dependents to lib/$(ANDROID_ABI). This 285# Install architecture dependents to lib/$(ANDROID_ABI). This
228# perculiar naming scheme is required to make Android preserve these 286# perculiar naming scheme is required to make Android preserve these
@@ -252,35 +310,43 @@ ifneq ($(NDK_BUILD_SHARED),)
252 install_temp/lib/$(ANDROID_ABI) 310 install_temp/lib/$(ANDROID_ABI)
253endif 311endif
254 312
255install_temp/assets/directory-tree: $(libsrc)/asset-directory-tool \ 313emacs.apk-in: install_temp AndroidManifest.xml classes.dex
256 install_temp install_temp/assets/version \
257 install_temp/assets/build_info
258 $(AM_V_GEN) $(libsrc)/asset-directory-tool install_temp/assets \
259 install_temp/assets/directory-tree
260
261install_temp/assets/version: install_temp
262 $(AM_V_GEN) { (cd $(top_srcdir) \
263 && git rev-parse HEAD || echo "Unknown") \
264 && (git rev-parse --abbrev-ref HEAD \
265 || echo "Unknown") } 2> /dev/null > $@
266
267install_temp/assets/build_info: install_temp
268 $(AM_V_GEN) { hostname; date +%s; } > $@
269
270emacs.apk-in: install_temp install_temp/assets/directory-tree \
271 AndroidManifest.xml install_temp/assets/version \
272 install_temp/assets/build_info classes.dex
273# Package everything. Redirect the generated R.java to install_temp, as 314# Package everything. Redirect the generated R.java to install_temp, as
274# it must already have been generated as a prerequisite of 315# it must already have been generated as a prerequisite of
275# classes.dex's. 316# classes.dex's. If ANDROID_SDK_8_OR_EARLIER, compress those files
276 $(AM_V_AAPT) $(AAPT) p -I "$(ANDROID_JAR)" -F $@ \ 317# which are smaller than 1536 blocks (i.e. 768 kib), the maximum the
277 -f -M AndroidManifest.xml $(AAPT_ASSET_ARGS) \ 318# asset manager on such old systems can decompress.
278 -A install_temp/assets \ 319#
279 -S $(top_srcdir)/java/res -J install_temp 320# The elaborate dance with zip serves to disable the automatic
321# decompression of *.gz files in aapt.
322#
323# One more consideration is that timestamps should be preserved in
324# packaged libraries, as on Android 2.2 the package manager retains
325# existing libraries from previous installations if a new package's
326# libraries are not more recent.
327 $(AM_V_AAPT) \
328 if [ -z "$(ANDROID_SDK_8_OR_EARLIER)" ]; then \
329 $(AAPT) p -I "$(ANDROID_JAR)" -F $@ \
330 -f -M AndroidManifest.xml $(AAPT_ASSET_ARGS) \
331 -A install_temp/assets \
332 -S $(top_srcdir)/java/res -J install_temp; \
333 cd install_temp; \
334 $(AAPT) add ../$@ `find lib -type f`; \
335 else \
336 echo "Packaging files not eligible for compression...">&2;\
337 $(AAPT) p -I "$(ANDROID_JAR)" -F $@ \
338 -f -M AndroidManifest.xml -A install_temp/assets_raw\
339 -S $(top_srcdir)/java/res -J install_temp -0 ""; \
340 echo "Packaging files eligible for compression...">&2;\
341 cd install_temp; find assets -type f \
342 | xargs $(ZIP) ../$@ &> /dev/null; \
343 echo "Packagging files already compressed...">&2; \
344 cd assets_gz; find assets -type f \
345 | xargs $(ZIP) ../../$@ &> /dev/null; \
346 echo "Packaging shared libraries and code..." >&2; \
347 cd ..; $(ZIP) ../$@ `find lib -type f`; \
348 fi
280 $(AM_V_SILENT) $(AAPT) a $@ classes.dex 349 $(AM_V_SILENT) $(AAPT) a $@ classes.dex
281 $(AM_V_SILENT) pushd install_temp &> /dev/null; \
282 $(AAPT) add ../$@ `find lib -type f`; \
283 popd &> /dev/null
284 $(AM_V_SILENT) rm -rf install_temp 350 $(AM_V_SILENT) rm -rf install_temp
285 351
286# Makefile itself. 352# Makefile itself.