--- java-gnome-4.1.1/configure	2011-07-11 04:34:06.000000000 +0000
+++ java-gnome-4.1.1.new/configure	2012-07-08 22:41:16.000000000 +0000
@@ -395,7 +395,7 @@
 		return
 	}
 
-	$output = `$program $args Hello 2>/dev/null`;
+	$output = `$program $args Hello`;
 	chomp $output;
 
 	if (($? != 0) || ($output ne "Hello")) {
@@ -629,6 +629,9 @@
 } elsif ( -f "/etc/SuSE-release" ) {
 	output "Open SuSE";
 	$os = "suse";
+} elsif ( -f "/etc/frugalware-release" ) {
+    output "Frugalware";
+    $os = "frugalware";
 } elsif ( -f "/etc/arch-release" ) {
 	output "Arch";
 	$os = "arch";
@@ -765,7 +768,12 @@
 		"JUnit test framework",
 		"junit",
 		"/usr/share/java/junit.jar");
-	
+} elsif ($os eq "frugalware") {
+
+	check_prereq(@junit_jars,
+		"JUnit test framework",
+		"junit",
+		"/usr/share/java/junit.jar");	
 	
 } else {
 	bail "failed!", "This OS not configured with defaults!\nTHIS IS AN INTERNAL ERROR, PLEASE FILE A BUG.";
@@ -1528,6 +1536,45 @@
 	check_jar($jar, "$vendor jar", $jar_candidate, "");
 	check_javadoc($javadoc, "$vendor javadoc", $javadoc_candidate, "");
 
+} elsif ($os eq "frugalware") {
+    check_compiler($ecj, "Eclipse ecj", which("ecj"), "-g -preserveAllLocals -nowarn -source 1.5 -target 1.5");
+
+	my $javac_candidate;
+	my $javah_candidate;
+	my $jar_candidate;
+	my $javadoc_candidate;
+	my $vendor;
+	if ($jdk_home) {
+		$javac_candidate = "$jdk_home/bin/javac";
+		$javah_candidate = "$jdk_home/bin/javah";
+		$jar_candidate = "$jdk_home/bin/jar";
+		$javadoc_candidate = "$jdk_home/bin/javadoc";
+		$vendor = "Specified";
+	} else {
+		$javac_candidate = "/usr/lib/java/bin/javac";
+		$javah_candidate = "/usr/lib/java/bin/javah";
+		$jar_candidate = "/usr/lib/java/bin/jar";
+		$javadoc_candidate = "/usr/lib/java/bin/javadoc";
+		$vendor = "Sun";
+	}
+	check_compiler($javac, "$vendor javac", $javac_candidate, "-g -source 1.5 -target 1.5");
+
+	# check for gcj
+	my $gcj_candidate;
+	if ($gcj_home) {
+		$gcj_candidate = "$gcj_home/bin/gcj";
+	} else {
+		$gcj_candidate = which("gcj");
+	}
+	check_compiler($gcjC, "GNU gcj -C (bytecode mode)", $gcj_candidate, "-C");
+
+	# check for kaffe's compiler
+	check_compiler($kaffec, "Kaffe javac", which("kaffec"), "");
+
+	check_jni_header_generator($javah, "$vendor javah", $javah_candidate, "-jni");
+	check_jar($jar, "$vendor jar", $jar_candidate, "");
+	check_javadoc($javadoc, "$vendor javadoc", $javadoc_candidate, "");
+
 } else {
 	bail "failed!", "This OS not configured with a workable Java compiler checks!\nTHIS IS AN INTERNAL ERROR, PLEASE FILE A BUG.";
 }
@@ -1927,6 +1974,52 @@
 
 	# check gij (the bytecode interpreter from the GCJ project)
 	my $gij_candidate;
+	if ($gcj_home) {
+		$gij_candidate = "$gcj_home/bin/gij";
+	} else {
+		$gij_candidate = which("gij");
+	}
+	check_runtime($gij, "GNU gij", $gij_candidate, "");
+
+	# check kaffe. See the comment about Kaffe above in the Debian block.
+	check_runtime($kaffe, "Kaffe VM", which("kaffe"), "");
+
+	# check jamvm (an elegant bytecode interpreter used by many in the
+	# CLASSPATH project to test new releases)
+	my $jamvm_candidate;
+	if ($jamvm_bin) {
+		$jamvm_candidate = "$jamvm_bin";
+	} else {
+		$jamvm_candidate = "/usr/bin/jamvm";
+	}
+	check_runtime($jamvm, "JamVM VM", $jamvm_candidate, "");
+
+	my $cacao_candidate;
+	if ($cacao_bin) {
+		$cacao_candidate = "$cacao_bin";
+	} else {
+		$cacao_candidate = "/usr/bin/cacao";
+	}
+	check_runtime($cacao, "CACAO VM", $cacao_candidate, "");
+
+} elsif ($os eq "frugalware") {
+	# check for a proper JDK/JRE java Virtual Machine. Red Hat is using
+	# the alternatives system symlinks to select JVMs, and then *again*
+	# to select versions. All the symlinks end up back in /usr/lib/jvm with
+	# predictable names, which makes this workable.
+	my $java_candidate;
+	my $vendor;
+	if ($jdk_home) {
+		$java_candidate = "$jdk_home/bin/java";
+		$vendor = "Specified";
+	} else {
+		$java_candidate = "/usr/lib/java/bin/java";
+		$vendor = "IBM";
+	}
+	check_runtime($java, "$vendor java VM", $java_candidate, "-cp . -client -ea");
+
+	# check gij (the bytecode interpreter from the GCJ project)
+	my $gij_candidate;
 	if ($gcj_home) {
 		$gij_candidate = "$gcj_home/bin/gij";
 	} else {
