changeset 3260:0c39aecdacad

PR2800: Files are missing from resources.jar 2016-07-26 Andrew John Hughes <gnu.andrew@redhat.com> PR2800: Files are missing from resources.jar * Makefile.am: (MIME_TYPE_CHECK_BUILD_DIR): Add build directory for mime type check. (MIME_TYPE_CHECK_SRCS): Specify sources for mime type check. (EXTRA_DIST): Distribute mime type check sources. (check-local): Depend on check-mimetype. (clean-tests): Depend on clean-check-mimetype. (clean-local): Depend on clean-mimetypecheck. (.PHONY): Depend on clean-check-mimetype, clean-mimetypecheck, clean-add-mime-types-file, clean-add-mime-types-file-debug and clean-add-mime-types-file-boot. (icedtea-against-icedtea): Depend on add-mime-types-file. (clean-icedtea-against-icedtea): Depend on clean-add-mime-types-file. (icedtea-debug-against-icedtea): Depend on add-mime-types-file-debug. (clean-icedtea-debug-against-icedtea): Depend on clean-add-mime-types-file-debug. (add-mime-types-file): Add a symlink to the system mime.types file if found. (clean-add-mime-types-file): Remove symlink to the system mime types file. (add-mime-types-file-debug): Add a symlink to the system mime.types file, if found, in the debug build. (clean-add-mime-types-file-debug): Remove symlink to the system mime types file in the debug build. (icedtea-against-ecj): Depend on add-mime-types-file-boot. (clean-icedtea-against-ecj): Depend on clean-add-mime-types-file-boot. (add-mime-types-file-boot): Add a symlink to the system mime.types file, if found, in the bootstrap build. (clean-add-mime-types-file-boot): Remove symlink to the system mime types file in the bootstrap build. (check-mimetype): Check that we can recognise a HTML file and (if system mime.types is available) a Java file. (clean-check-mimetype): Cleanup after check-mimetype. (mimetypecheck): Build the MIME type check. (clean-mimetypecheck): Remove MIME type check build. (install-data-local): Install the mime.types symlink. * acinclude.m4: (IT_CHECK_FOR_MIME_TYPES): Check for a system mime.types file and define MIME_TYPES_FILE_FOUND if located. * configure.ac: Invoke IT_CHECK_FOR_MIME_TYPES. * test/RH1195203.java: Testcase to get Java to print the MIME type of a file. 2015-05-16 Andrew John Hughes <gnu_andrew@member.fsf.org> PR2800: Files are missing from resources.jar * Makefile.am: (BUILD_SDK_DIR): Added. (BUILD_JRE_DIR): Likewise. (BUILD_JRE_ARCH_DIR): Redefine using BUILD_SDK_DIR. (BUILD_DEBUG_SDK_DIR): Added. (BUILD_DEBUG_JRE_DIR): Likewise. (BUILD_DEBUG_JRE_ARCH_DIR): Redefine using BUILD_DEBUG_SDK_DIR. (BUILD_BOOT_SDK_DIR): Added. (BUILD_BOOT_JRE_DIR): Likewise. (BUILD_BOOT_JRE_ARCH_DIR): Redefine using BUILD_BOOT_SDK_DIR. 2015-06-03 Andrew John Hughes <gnu.andrew@member.fsf.org> PR2800: Files are missing from resources.jar * Makefile.am: (BUILD_BOOT_JRE_ARCH_DIR): Added.
author Andrew John Hughes <gnu.andrew@redhat.com>
date Wed, 17 Aug 2016 03:35:59 +0100
parents 5f02205c65fb
children 25a95cf50cc8
files ChangeLog Makefile.am acinclude.m4 configure.ac test/RH1195203.java
diffstat 5 files changed, 250 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Aug 15 03:01:21 2016 +0100
+++ b/ChangeLog	Wed Aug 17 03:35:59 2016 +0100
@@ -1,3 +1,78 @@
+2016-07-26  Andrew John Hughes  <gnu.andrew@redhat.com>
+
+	PR2800: Files are missing from resources.jar
+	* Makefile.am:
+	(MIME_TYPE_CHECK_BUILD_DIR): Add build directory
+	for mime type check.
+	(MIME_TYPE_CHECK_SRCS): Specify sources for
+	mime type check.
+	(EXTRA_DIST): Distribute mime type check sources.
+	(check-local): Depend on check-mimetype.
+	(clean-tests): Depend on clean-check-mimetype.
+	(clean-local): Depend on clean-mimetypecheck.
+	(.PHONY): Depend on clean-check-mimetype,
+	clean-mimetypecheck, clean-add-mime-types-file,
+	clean-add-mime-types-file-debug and
+	clean-add-mime-types-file-boot.
+	(icedtea-against-icedtea): Depend on
+	add-mime-types-file.
+	(clean-icedtea-against-icedtea): Depend on
+	clean-add-mime-types-file.
+	(icedtea-debug-against-icedtea): Depend on
+	add-mime-types-file-debug.
+	(clean-icedtea-debug-against-icedtea): Depend on
+	clean-add-mime-types-file-debug.
+	(add-mime-types-file): Add a symlink to the
+	system mime.types file if found.
+	(clean-add-mime-types-file): Remove symlink
+	to the system mime types file.
+	(add-mime-types-file-debug): Add a symlink to the
+	system mime.types file, if found, in the debug build.
+	(clean-add-mime-types-file-debug): Remove symlink
+	to the system mime types file in the debug build.
+	(icedtea-against-ecj): Depend on add-mime-types-file-boot.
+	(clean-icedtea-against-ecj): Depend on
+	clean-add-mime-types-file-boot.
+	(add-mime-types-file-boot): Add a symlink to the
+	system mime.types file, if found, in the bootstrap build.
+	(clean-add-mime-types-file-boot): Remove symlink
+	to the system mime types file in the bootstrap build.
+	(check-mimetype): Check that we can recognise a HTML
+	file and (if system mime.types is available) a Java file.
+	(clean-check-mimetype): Cleanup after check-mimetype.
+	(mimetypecheck): Build the MIME type check.
+	(clean-mimetypecheck): Remove MIME type check build.
+	(install-data-local): Install the mime.types symlink.
+	* acinclude.m4:
+	(IT_CHECK_FOR_MIME_TYPES): Check for a system mime.types
+	file and define MIME_TYPES_FILE_FOUND if located.
+	* configure.ac:
+	Invoke IT_CHECK_FOR_MIME_TYPES.
+	* test/RH1195203.java: Testcase to get Java to print
+	the MIME type of a file.
+
+2015-05-16  Andrew John Hughes  <gnu_andrew@member.fsf.org>
+
+	PR2800: Files are missing from resources.jar
+	* Makefile.am:
+	(BUILD_SDK_DIR): Added.
+	(BUILD_JRE_DIR): Likewise.
+	(BUILD_JRE_ARCH_DIR): Redefine using BUILD_SDK_DIR.
+	(BUILD_DEBUG_SDK_DIR): Added.
+	(BUILD_DEBUG_JRE_DIR): Likewise.
+	(BUILD_DEBUG_JRE_ARCH_DIR): Redefine using
+	BUILD_DEBUG_SDK_DIR.
+	(BUILD_BOOT_SDK_DIR): Added.
+	(BUILD_BOOT_JRE_DIR): Likewise.
+	(BUILD_BOOT_JRE_ARCH_DIR): Redefine using
+	BUILD_BOOT_SDK_DIR.
+
+2015-06-03  Andrew John Hughes  <gnu.andrew@member.fsf.org>
+
+	PR2800: Files are missing from resources.jar
+	* Makefile.am:
+	(BUILD_BOOT_JRE_ARCH_DIR): Added.
+
 2016-07-17  Andrew John Hughes  <gnu.andrew@redhat.com>
 
 	PR3092: SystemTap is heavily confused
--- a/Makefile.am	Mon Aug 15 03:01:21 2016 +0100
+++ b/Makefile.am	Wed Aug 17 03:35:59 2016 +0100
@@ -34,12 +34,20 @@
 ICEDTEA_BOOT_DIR = $(abs_top_builddir)/bootstrap/icedtea
 JAMVM_IMPORT_PATH = $(abs_top_builddir)/jamvm/install/hotspot
 SERVER_DIR = hotspot/import/jre/lib/$(INSTALL_ARCH_DIR)/server
-BUILD_JRE_ARCH_DIR = $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)
-BUILD_DEBUG_JRE_ARCH_DIR = $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)
+BUILD_SDK_DIR = $(BUILD_OUTPUT_DIR)/j2sdk-image
+BUILD_JRE_DIR = $(BUILD_OUTPUT_DIR)/j2re-image
+BUILD_JRE_ARCH_DIR = $(BUILD_SDK_DIR)/jre/lib/$(INSTALL_ARCH_DIR)
+BUILD_DEBUG_SDK_DIR = $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image
+BUILD_DEBUG_JRE_DIR = $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image
+BUILD_DEBUG_JRE_ARCH_DIR = $(BUILD_DEBUG_SDK_DIR)/jre/lib/$(INSTALL_ARCH_DIR)
+BUILD_BOOT_SDK_DIR = $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image
+BUILD_BOOT_JRE_DIR = $(ECJ_BUILD_OUTPUT_DIR)/j2re-image
+BUILD_BOOT_JRE_ARCH_DIR = $(BUILD_BOOT_SDK_DIR)/jre/lib/$(INSTALL_ARCH_DIR)
 FONTCONFIG_PATH = openjdk/jdk/src/solaris/classes/sun/awt/fontconfigs
 REWRITER_BUILD_DIR = $(abs_top_builddir)/rewriter.build
 GENERATED_BUILD_DIR = $(abs_top_builddir)/generated.build
 CRYPTO_CHECK_BUILD_DIR = $(abs_top_builddir)/cryptocheck.build
+MIME_TYPE_CHECK_BUILD_DIR = $(abs_top_builddir)/test/mimetypecheck.build
 
 # Source directories
 
@@ -260,6 +268,7 @@
 
 REWRITER_SRCS = $(top_srcdir)/rewriter/com/redhat/rewriter/ClassRewriter.java
 CRYPTO_CHECK_SRCS = $(top_srcdir)/TestCryptoLevel.java
+MIME_TYPE_CHECK_SRCS = $(top_srcdir)/test/RH1195203.java
 
 # Relative path to JTreg tool
 JTREG_DIR = src/jtreg
@@ -972,16 +981,17 @@
 	rewriter/agpl-3.0.txt \
 	$(REWRITER_SRCS) \
 	$(TAPSET_TEST_SRCS) \
-	$(CRYPTO_CHECK_SRCS)
+	$(CRYPTO_CHECK_SRCS) \
+	$(MIME_TYPE_CHECK_SRCS)
 
 # Top-Level Targets
 # =================
 
 all-local: icedtea-against-icedtea
 
-check-local: jtregcheck check-tapset
-
-clean-tests: clean-jtreg clean-tapset-report
+check-local: jtregcheck check-tapset check-mimetype
+
+clean-tests: clean-jtreg clean-tapset-report clean-check-mimetype
 	if [ $(abs_top_srcdir) != $(abs_top_builddir) ] ; then \
 	  if [ -e test ] ; then \
 	    rmdir test ; \
@@ -994,7 +1004,7 @@
  clean-icedtea-against-ecj clean-extract-ecj clean-generated clean-replace-hotspot \
  clean-rewriter clean-rewrite-rhino clean-rt clean-bootstrap-directory \
  clean-bootstrap-directory-ecj clean-bootstrap-directory-symlink \
- clean-bootstrap-directory-symlink-ecj clean-fonts clean-cryptocheck
+ clean-bootstrap-directory-symlink-ecj clean-fonts clean-cryptocheck clean-mimetypecheck
 	if [ -e bootstrap ]; then \
 	  rmdir bootstrap ; \
 	fi
@@ -1023,7 +1033,7 @@
 	clean-tools-jar clean-copy clean-rt hotspot \
 	hotspot-helper clean-extra clean-jtreg clean-jtreg-reports \
 	clean-add-zero clean-add-zero-debug clean-icedtea clean-icedtea-debug \
-	clean-icedtea-against-ecj \
+	clean-icedtea-against-ecj clean-check-mimetype clean-mimetypecheck \
 	clean-jamvm clean-add-jamvm clean-add-jamvm-debug \
 	clean-cacao clean-add-cacao clean-add-cacao-debug \
 	clean-ports clean-overlay clean-extract-ecj clean-extract clean-extract-openjdk \
@@ -1034,7 +1044,8 @@
 	clean-add-pulseaudio-ecj clean-add-nss-ecj clean-add-tzdata-support-ecj clean-fonts \
 	clean-download-hotspot clean-tests clean-tapset-report jtregcheck clean-pax-mark-vm \
 	clean-pax-mark-vm-debug clean-pax-mark-vm-ecj clean-check-crypto clean-check-crypto-debug \
-	clean-check-crypto-boot clean-cryptocheck
+	clean-check-crypto-boot clean-cryptocheck clean-add-mime-types-file \
+	clean-add-mime-types-file-debug clean-add-mime-types-file-boot
 
 env:
 	@echo 'unset JAVA_HOME'
@@ -1748,27 +1759,28 @@
  stamps/add-jamvm.stamp stamps/add-cacao.stamp stamps/add-zero.stamp \
  stamps/add-systemtap.stamp stamps/add-pulseaudio.stamp stamps/add-nss.stamp \
  stamps/add-tzdata-support.stamp stamps/add-archive.stamp stamps/pax-mark-vm.stamp \
- stamps/check-crypto.stamp
+ stamps/check-crypto.stamp stamps/add-mime-types-file.stamp
 	mkdir -p stamps
 	touch $@
 
 clean-icedtea-against-icedtea: clean-add-jamvm clean-add-zero clean-add-cacao \
  clean-add-systemtap clean-add-pulseaudio clean-add-nss clean-add-tzdata-support \
- clean-add-archive clean-pax-mark-vm clean-check-crypto
+ clean-add-archive clean-pax-mark-vm clean-check-crypto clean-add-mime-types-file
 	rm -f stamps/icedtea-against-icedtea.stamp
 
 stamps/icedtea-debug-against-icedtea.stamp: stamps/icedtea-debug.stamp \
  stamps/add-jamvm-debug.stamp stamps/add-cacao-debug.stamp \
  stamps/add-zero-debug.stamp stamps/add-systemtap-debug.stamp stamps/add-pulseaudio-debug.stamp \
  stamps/add-nss-debug.stamp stamps/add-tzdata-support-debug.stamp stamps/add-archive-debug.stamp \
- stamps/pax-mark-vm-debug.stamp stamps/check-crypto-debug.stamp
+ stamps/pax-mark-vm-debug.stamp stamps/check-crypto-debug.stamp stamps/add-mime-types-file-debug.stamp
 	mkdir -p stamps
 	touch $@
 
 clean-icedtea-debug-against-icedtea: clean-add-zero-debug \
  clean-add-jamvm-debug clean-add-cacao-debug clean-add-systemtap-debug \
  clean-add-pulseaudio-debug clean-add-nss-debug clean-add-tzdata-support-debug \
- clean-add-archive-debug clean-pax-mark-vm-debug clean-check-crypto-debug
+ clean-add-archive-debug clean-pax-mark-vm-debug clean-check-crypto-debug \
+ clean-add-mime-types-file-debug
 	rm -f stamps/icedtea-debug-against-icedtea.stamp
 
 stamps/add-systemtap.stamp: stamps/icedtea.stamp
@@ -2080,6 +2092,34 @@
 clean-check-crypto-debug:
 	rm -f stamps/check-crypto-debug.stamp
 
+stamps/add-mime-types-file.stamp: stamps/icedtea.stamp
+if MIME_TYPES_FILE_FOUND
+	if [ -e $(BUILD_SDK_DIR)/jre/lib ] ; then \
+	  ln -sf $(MIME_TYPES_FILE) $(BUILD_SDK_DIR)/jre/lib/mime.types ; \
+	fi
+endif
+	touch $@
+
+clean-add-mime-types-file:
+	if [ -e $(BUILD_SDK_DIR)/jre/lib/mime.types ] ; then \
+	  rm -vf $(BUILD_SDK_DIR)/jre/lib/mime.types ; \
+	fi
+	rm -f stamps/add-mime-types-file.stamp
+
+stamps/add-mime-types-file-debug.stamp: stamps/icedtea-debug.stamp
+if MIME_TYPES_FILE_FOUND
+	if [ -e $(BUILD_DEBUG_SDK_DIR)/jre/lib ] ; then \
+	  ln -sf $(MIME_TYPES_FILE) $(BUILD_DEBUG_SDK_DIR)/jre/lib/mime.types ; \
+	fi
+endif
+	touch $@
+
+clean-add-mime-types-file-debug:
+	if [ -e $(BUILD_DEBUG_SDK_DIR)/jre/lib/mime.types ] ; then \
+	  rm -vf $(BUILD_DEBUG_SDK_DIR)/jre/lib/mime.types ; \
+	fi
+	rm -f stamps/add-mime-types-file-debug.stamp
+
 # OpenJDK ecj Targets
 # ===================
 
@@ -2101,12 +2141,14 @@
 
 stamps/icedtea-against-ecj.stamp: stamps/icedtea-ecj.stamp stamps/add-systemtap-ecj.stamp \
  stamps/add-pulseaudio-ecj.stamp stamps/add-nss-ecj.stamp stamps/add-tzdata-support-ecj.stamp \
- stamps/add-archive-ecj.stamp stamps/pax-mark-vm-ecj.stamp stamps/check-crypto-boot.stamp
+ stamps/add-archive-ecj.stamp stamps/pax-mark-vm-ecj.stamp stamps/check-crypto-boot.stamp \
+ stamps/add-mime-types-file-boot.stamp
 	mkdir -p stamps
 	touch $@
 
 clean-icedtea-against-ecj: clean-add-systemtap-ecj clean-add-pulseaudio-ecj clean-add-nss-ecj \
- clean-add-tzdata-support-ecj clean-add-archive-ecj clean-pax-mark-vm-ecj clean-check-crypto-boot
+ clean-add-tzdata-support-ecj clean-add-archive-ecj clean-pax-mark-vm-ecj clean-check-crypto-boot \
+ clean-add-mime-types-file-boot
 	rm -f stamps/icedtea-against-ecj.stamp
 
 stamps/add-systemtap-ecj.stamp: stamps/icedtea-ecj.stamp
@@ -2264,6 +2306,20 @@
 clean-check-crypto-boot:
 	rm -f stamps/check-crypto-boot.stamp
 
+stamps/add-mime-types-file-boot.stamp: stamps/icedtea-ecj.stamp
+if MIME_TYPES_FILE_FOUND
+	if [ -e $(BUILD_BOOT_SDK_DIR)/jre/lib ] ; then \
+	  ln -sf $(MIME_TYPES_FILE) $(BUILD_BOOT_SDK_DIR)/jre/lib/mime.types ; \
+	fi
+endif
+	touch $@
+
+clean-add-mime-types-file-boot:
+	if [ -e $(BUILD_BOOT_SDK_DIR)/jre/lib/mime.types ] ; then \
+	  rm -vf $(BUILD_BOOT_SDK_DIR)/jre/lib/mime.types ; \
+	fi
+	rm -f stamps/add-mime-types-file-boot.stamp
+
 # Rebuild targets
 
 rebuild:
@@ -2682,7 +2738,7 @@
 # end additional VMs
 
 
-# jtreg
+# Test cases
 
 stamps/jtreg.stamp: stamps/icedtea-against-icedtea.stamp
 	rm -rf test/jtreg/classes
@@ -2817,6 +2873,35 @@
 	rm -f test/check-stap.log
 endif
 
+stamps/check-mimetype.stamp: stamps/mimetypecheck.stamp stamps/icedtea.stamp
+	if [ -e $(BUILD_SDK_DIR)/bin/java ] ; then \
+	  echo "<html><head/><body/></html>" > $(MIME_TYPE_CHECK_BUILD_DIR)/test.html ; \
+	  expected="text/html" ; \
+	  html=$$($(BUILD_SDK_DIR)/bin/java -cp $(MIME_TYPE_CHECK_BUILD_DIR) RH1195203 \
+	    $(MIME_TYPE_CHECK_BUILD_DIR)/test.html) ; \
+	  if test "x$${html}" != "x$${expected}" ; then \
+	    echo "MIME type test failed; expected $${expected}, got $${html}" ; \
+	    exit -1; \
+	  fi ; \
+	fi
+if MIME_TYPES_FILE_FOUND
+	if [ -e $(BUILD_SDK_DIR)/bin/java ] ; then \
+	  expected="text/x-java-source" ; \
+	  java=$$($(BUILD_SDK_DIR)/bin/java -cp $(MIME_TYPE_CHECK_BUILD_DIR) RH1195203 \
+	    $(MIME_TYPE_CHECK_SRCS)) ; \
+	  if test "x$${java}" != "x$${expected}"; then \
+	    echo "MIME type test failed; expected $${expected}, got $${java}" ; \
+	    exit -1; \
+	  fi ; \
+	fi
+endif
+	mkdir -p stamps
+	touch $@
+
+clean-check-mimetype:
+	rm -f $(MIME_TYPE_CHECK_BUILD_DIR)/test.html
+	rm -f stamps/check-mimetype.stamp
+
 # Support classes for non-OpenJDK bootstraps
 
 # rt.jar additional class files.
@@ -2876,6 +2961,19 @@
 	rm -rf $(CRYPTO_CHECK_BUILD_DIR)
 	rm -f stamps/cryptocheck.stamp
 
+# Mime Type Check
+
+stamps/mimetypecheck.stamp: $(INITIAL_BOOTSTRAP_LINK_STAMP)
+	mkdir -p $(MIME_TYPE_CHECK_BUILD_DIR)
+	$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
+	  -d $(MIME_TYPE_CHECK_BUILD_DIR) $(MIME_TYPE_CHECK_SRCS)
+	mkdir -p stamps
+	touch $@
+
+clean-mimetypecheck:
+	rm -rf $(MIME_TYPE_CHECK_BUILD_DIR)
+	rm -f stamps/mimetypecheck.stamp
+
 # Target Aliases
 # ===============
 
@@ -2893,6 +2991,12 @@
 
 add-jamvm-debug: stamps/add-jamvm-debug.stamp
 
+add-mime-types-file: stamps/add-mime-types-file.stamp
+
+add-mime-types-file-debug: stamps/add-mime-types-file-debug.stamp
+
+add-mime-types-file-boot: stamps/add-mime-types-file-boot.stamp
+
 add-nss: stamps/add-nss.stamp
 
 add-nss-debug: stamps/add-nss-debug.stamp
@@ -2937,6 +3041,8 @@
 
 check-crypto-debug: stamps/check-crypto-debug.stamp
 
+check-mimetype: stamps/check-mimetype.stamp
+
 cryptocheck: stamps/cryptocheck.stamp
 
 download: stamps/download.stamp
@@ -2987,6 +3093,8 @@
 
 liveconnect-dist: stamps/liveconnect-dist.stamp
 
+mimetypecheck: stamps/mimetypecheck.stamp
+
 native-ecj: stamps/native-ecj.stamp
 
 overlay: stamps/overlay.stamp
--- a/acinclude.m4	Mon Aug 15 03:01:21 2016 +0100
+++ b/acinclude.m4	Wed Aug 17 03:35:59 2016 +0100
@@ -2430,6 +2430,23 @@
   AC_SUBST(ENABLE_NON_NSS_CURVES)
 ])
 
+AC_DEFUN_ONCE([IT_CHECK_FOR_MIME_TYPES],
+[
+  MIME_TYPES_FILE="/etc/mime.types"
+  AC_MSG_CHECKING([for ${MIME_TYPES_FILE}])
+  if test -f ${MIME_TYPES_FILE}; then
+     mime_types_file_found=yes
+  else
+     mime_types_file_found=no
+  fi
+  AC_MSG_RESULT([$mime_types_file_found])
+  if test "x${mime_types_file_found}" = "xno"; then
+    AC_MSG_WARN([No system MIME types file found.])
+  fi
+  AC_SUBST([MIME_TYPES_FILE])
+  AM_CONDITIONAL(MIME_TYPES_FILE_FOUND, test "x${mime_types_file_found}" = "xyes")
+])
+
 AC_DEFUN_ONCE([IT_WITH_FONTS_DIR],
 [
   FONTS_DEFAULT=/usr/share/fonts
--- a/configure.ac	Mon Aug 15 03:01:21 2016 +0100
+++ b/configure.ac	Wed Aug 17 03:35:59 2016 +0100
@@ -51,6 +51,8 @@
 IT_OBTAIN_HG_REVISIONS
 AC_PATH_TOOL([LSB_RELEASE],[lsb_release])
 IT_WITH_GCJ
+IT_CHECK_FOR_MIME_TYPES
+
 IT_WITH_HOTSPOT_BUILD
 AC_PATH_TOOL([LINUX32],[linux32])
 IT_CHECK_GCC_VERSION
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/RH1195203.java	Wed Aug 17 03:35:59 2016 +0100
@@ -0,0 +1,32 @@
+/* RH1195203 -- Check correct recognition of mime types.
+   Copyright (C) 2015 Red Hat, Inc.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+import javax.activation.MimetypesFileTypeMap;
+
+public class RH1195203
+{
+    public static void main(String[] args)
+    {
+        if (args.length == 0)
+        {
+            System.err.println("No file specified.");
+            System.exit(-1);
+        }
+
+        System.out.println(MimetypesFileTypeMap.getDefaultFileTypeMap().getContentType(args[0]));
+    }
+}