Here are updated patches.
diff -ur gcj-4.1-orig/debian/rules.defs gcj-4.1-4.1.2/debian/rules.defs --- gcj-4.1-orig/debian/rules.defs 2007-07-21 14:32:24.421620000 +0000 +++ gcj-4.1-4.1.2/debian/rules.defs 2007-07-21 15:27:40.000000000 +0000 @@ -304,7 +304,7 @@ java_no_cpus := #mips mipsel java_no_arches := armel -java_no_systems := hurd-i386 knetbsd-gnu netbsdelf-gnu +java_no_systems := knetbsd-gnu netbsdelf-gnu gcj_native_archs = alpha amd64 i386 ia64 mips mipsel powerpc s390 sparc ifneq (, $(filter $(DEB_TARGET_ARCH_CPU),$(java_no_cpus))) @@ -316,10 +316,6 @@ ifneq (, $(filter $(DEB_TARGET_ARCH),$(java_no_arches))) with_java := disabled for $(DEB_TARGET_ARCH) endif -ifeq ($(DEB_TARGET_ARCH),hurd-i386) - java_no_systems += hurd-i386 - with_java := disabled for architecure $(DEB_TARGET_ARCH_CPU) -endif ifdef DEB_CROSS with_java := disabled for cross compiler package endif @@ -354,7 +350,7 @@ ifeq ($(with_java),yes) with_java_alsa := yes with_java_plugin := yes - ifneq (,$(filter $(DEB_TARGET_GNU_SYSTEM), kfreebsd-gnu)) + ifneq (,$(filter $(DEB_TARGET_GNU_SYSTEM), kfreebsd-gnu gnu)) with_java_alsa := no endif endif diff -ur gcj-4.1-orig/debian/rules.patch gcj-4.1-4.1.2/debian/rules.patch --- gcj-4.1-orig/debian/rules.patch 2007-07-21 14:32:24.000000000 +0000 +++ gcj-4.1-4.1.2/debian/rules.patch 2007-07-21 15:28:02.000000000 +0000 @@ -212,6 +212,9 @@ ifeq ($(DEB_TARGET_ARCH_OS),netbsd) debian_patches += # netbsd-all-gcc netbsd-archs-gcc endif +ifeq ($(DEB_TARGET_ARCH_OS),hurd) + debian_patches += libjava-hurdfix +endif ifdef DEB_CROSS debian_patches += cross-include cross-fixes
#! /bin/sh -e
# Description: java support for GNU/Hurd # Author: Robert Millan, Petr Salinger, Samuel Thibault dir= if [ $# -eq 3 -a "$2" = '-d' ]; then pdir="-d $3" dir="$3/" elif [ $# -ne 1 ]; then echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1 fi case "$1" in -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0 #cd ${dir}gcc && autoconf ;; -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0 #rm ${dir}gcc/configure ;; *) echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1 esac exit 0 --- gcc-4.1.1/libjava/java/io/natFilePosix.cc.orig 2003-09-12 03:08:18.000000000 +0200 +++ gcc-4.1.1/libjava/java/io/natFilePosix.cc 2007-01-25 23:23:42.000000000 +0100 @@ -25,6 +25,7 @@ #endif #include <string.h> #include <utime.h> +#include <limits.h> #include <gcj/cni.h> #include <jvm.h> @@ -379,6 +380,10 @@ void java::io::File::init_native () { +#ifdef MAXPATHLEN maxPathLen = MAXPATHLEN; +#else + maxPathLen = INT_MAX; +#endif caseSensitive = true; } --- gcc-4.1.1/libjava/java/net/natVMInetAddressPosix.cc.orig 2007-01-26 15:27:19.000000000 +0000 +++ gcc-4.1.1/libjava/java/net/natVMInetAddressPosix.cc 2007-01-26 15:45:53.000000000 +0000 @@ -47,10 +47,25 @@ { char *chars; #ifdef HAVE_GETHOSTNAME +#ifdef MAXHOSTNAMELEN char buffer[MAXHOSTNAMELEN]; if (gethostname (buffer, MAXHOSTNAMELEN)) return NULL; chars = buffer; +#else + size_t size = 256; + while (1) { + char buffer[size]; + if (!gethostname (buffer, size-1)) + { + buffer[size-1] = 0; + return JvNewStringUTF (buffer); + } + else if (errno != ENAMETOOLONG) + return NULL; + size *= 2; + } +#endif #elif HAVE_UNAME struct utsname stuff; if (uname (&stuff) != 0) diff -ur gcj-4.1.1/libjava/libltdl/acinclude.m4 gcj-4.1.1/libjava/libltdl/acinclude.m4 --- gcj-4.1.1/libjava/libltdl/acinclude.m4 2006-05-12 13:35:07.000000000 +0200 +++ gcj-4.1.1/libjava/libltdl/acinclude.m4 2006-05-12 11:07:03.000000000 +0200 @@ -1413,7 +1413,7 @@ ;; # This must be Linux ELF. -linux*) +linux*|gnu*) version_type=linux need_lib_prefix=no need_version=no diff -ur gcj-4.1.1/libjava/libltdl/configure gcj-4.1.1/libjava/libltdl/configure --- gcj-4.1.1/libjava/libltdl/configure 2006-05-12 13:35:21.000000000 +0200 +++ gcj-4.1.1/libjava/libltdl/configure 2006-05-12 11:07:15.000000000 +0200 @@ -8380,7 +8380,7 @@ ;; # This must be Linux ELF. -linux*) +linux*|gnu*) version_type=linux need_lib_prefix=no need_version=no @@ -12021,7 +12021,7 @@ ;; # This must be Linux ELF. -linux*) +linux*|gnu*) version_type=linux need_lib_prefix=no need_version=no @@ -15097,7 +15097,7 @@ ;; # This must be Linux ELF. -linux*) +linux*|gnu*) version_type=linux need_lib_prefix=no need_version=no @@ -17380,7 +17380,7 @@ ;; # This must be Linux ELF. -linux*) +linux*|gnu*) version_type=linux need_lib_prefix=no need_version=no diff -ur gcj-4.1.1/libjava/configure.host gcj-4.1.1/libjava/configure.host --- gcj-4.1.1/libjava/configure.host 2006-09-07 01:00:37.000000000 +0200 +++ gcj-4.1.1/libjava/configure.host 2006-09-07 01:00:37.000000000 +0200 @@ -326,7 +326,7 @@ esac case "${host}" in - *linux*|*-kfreebsd*-gnu) + *linux*|*-kfreebsd*-gnu|*gnu*) use_libgcj_bc=yes ;; *)