Bug#827787: gcc-6: improve gcj cross build

2016-06-21 Thread YunQiang Su
On Tue, 21 Jun 2016 10:17:45 +0800 YunQiang Su  wrote:
> Package: src:gcc-6
> Version: 6.1.1-7
>
> This patch produce gre/jdk/libgcj17 from cross build,
> and it also install libgcj.spec also.
> The above makes cross gcj works better.
>
> Please review this patch.
> I am not fully confident about it.

the this is the patch applied to gcc-6-cross

>
> --
> YunQiang Su
diff --git a/debian/control.alpha.in b/debian/control.alpha.in
index 34cf03d..af53cd2 100644
--- a/debian/control.alpha.in
+++ b/debian/control.alpha.in
@@ -2504,6 +2504,54 @@ Description: GNU Java compiler
  Java on platforms supported by the gcc compiler. It uses the
  gcc backend to generate optimized code.
 
+Package: gcj-GCC_VER-jre-CROSS_GNU_TYPE
+Architecture: @host_archs@
+Priority: extra
+Section: java
+Depends: gcj-GCC_VER-CROSS_GNU_TYPE (= ${gcc:Version}), ${dep:libcdev}, 
${shlibs:Depends}, ${misc:Depends}
+Suggests: gcj-GCC_VER-doc
+Description: GNU Java compiler
+ This is the GNU Java compiler, which compiles
+ Java on platforms supported by the gcc compiler. It uses the
+ gcc backend to generate optimized code.
+
+Package: gcj-GCC_VER-jdk-CROSS_GNU_TYPE
+Architecture: @host_archs@
+Priority: extra
+Section: java
+Depends: gcj-GCC_VER-jre-CROSS_GNU_TYPE (= ${gcc:Version}), ${dep:libcdev}, 
${shlibs:Depends}, ${misc:Depends}
+Suggests: gcj-GCC_VER-doc
+Description: GNU Java compiler
+ This is the GNU Java compiler, which compiles
+ Java on platforms supported by the gcc compiler. It uses the
+ gcc backend to generate optimized code.
+
+Package: libgcj17-CROSS_ARCH-cross
+Architecture: all
+Section: devel
+Priority: extra
+Depends: gcj-GCC_VER-CROSS_GNU_TYPE-base (= ${gcc:Version}), ${dep:libc}, 
${shlibs:Depends}, ${misc:Depends}
+Description: Java runtime library for use with gcj
+ This is the runtime that goes along with the gcj front end to gcc.
+ libgcj includes parts of the Java Class Libraries, 
+ plus glue to connect the libraries to the compiler and the underlying OS.
+ .
+ This package contains files for CROSS_ARCH architecture, for use in 
cross-compile
+ environment.
+
+Package: libgcj17-dev-CROSS_ARCH-cross
+Architecture: all
+Section: devel
+Priority: extra
+Depends: gcj-GCC_VER-CROSS_GNU_TYPE-base (= ${gcc:Version}), ${dep:libc}, 
${shlibs:Depends}, ${misc:Depends}
+Description: Java development headers for use with gcj
+ These are the development headers that go along with the gcj front end to gcc.
+ libgcj includes parts of the Java Class Libraries, 
+ plus glue to connect the libraries to the compiler and the underlying OS.
+ .
+ This package contains files for CROSS_ARCH architecture, for use in 
cross-compile
+ environment.
+
 Package: gdc-GCC_VER-CROSS_GNU_TYPE
 Architecture: @host_archs@
 Priority: extra
diff --git a/debian/control.arm64.in b/debian/control.arm64.in
index 34cf03d..af53cd2 100644
--- a/debian/control.arm64.in
+++ b/debian/control.arm64.in
@@ -2504,6 +2504,54 @@ Description: GNU Java compiler
  Java on platforms supported by the gcc compiler. It uses the
  gcc backend to generate optimized code.
 
+Package: gcj-GCC_VER-jre-CROSS_GNU_TYPE
+Architecture: @host_archs@
+Priority: extra
+Section: java
+Depends: gcj-GCC_VER-CROSS_GNU_TYPE (= ${gcc:Version}), ${dep:libcdev}, 
${shlibs:Depends}, ${misc:Depends}
+Suggests: gcj-GCC_VER-doc
+Description: GNU Java compiler
+ This is the GNU Java compiler, which compiles
+ Java on platforms supported by the gcc compiler. It uses the
+ gcc backend to generate optimized code.
+
+Package: gcj-GCC_VER-jdk-CROSS_GNU_TYPE
+Architecture: @host_archs@
+Priority: extra
+Section: java
+Depends: gcj-GCC_VER-jre-CROSS_GNU_TYPE (= ${gcc:Version}), ${dep:libcdev}, 
${shlibs:Depends}, ${misc:Depends}
+Suggests: gcj-GCC_VER-doc
+Description: GNU Java compiler
+ This is the GNU Java compiler, which compiles
+ Java on platforms supported by the gcc compiler. It uses the
+ gcc backend to generate optimized code.
+
+Package: libgcj17-CROSS_ARCH-cross
+Architecture: all
+Section: devel
+Priority: extra
+Depends: gcj-GCC_VER-CROSS_GNU_TYPE-base (= ${gcc:Version}), ${dep:libc}, 
${shlibs:Depends}, ${misc:Depends}
+Description: Java runtime library for use with gcj
+ This is the runtime that goes along with the gcj front end to gcc.
+ libgcj includes parts of the Java Class Libraries, 
+ plus glue to connect the libraries to the compiler and the underlying OS.
+ .
+ This package contains files for CROSS_ARCH architecture, for use in 
cross-compile
+ environment.
+
+Package: libgcj17-dev-CROSS_ARCH-cross
+Architecture: all
+Section: devel
+Priority: extra
+Depends: gcj-GCC_VER-CROSS_GNU_TYPE-base (= ${gcc:Version}), ${dep:libc}, 
${shlibs:Depends}, ${misc:Depends}
+Description: Java development headers for use with gcj
+ These are the development headers that go along with the gcj front end to gcc.
+ libgcj includes parts of the Java Class Libraries, 
+ plus glue to connect the libraries to the compiler and the underlying OS.
+ .
+ This package contains files for CROSS_ARCH architec

Bug#827787: gcc-6: improve gcj cross build

2016-06-20 Thread YunQiang Su
Package: src:gcc-6
Version: 6.1.1-7

This patch produce gre/jdk/libgcj17 from cross build,
and it also install libgcj.spec also.
The above makes cross gcj works better.

Please review this patch.
I am not fully confident about it.

-- 
YunQiang Su
diff --git a/debian/control.m4 b/debian/control.m4
index 3010377..608b54c 100644
--- a/debian/control.m4
+++ b/debian/control.m4
@@ -20,6 +20,7 @@ define(`MAINTAINER', `Debian GCC Maintainers 
')
 
 define(`depifenabled', `ifelse(index(enabled_languages, `$1'), -1, `', `$2')')
 define(`ifenabled', `ifelse(index(enabled_languages, `$1'), -1, `dnl', `$2')')
+define(`ifenabled_newline', `ifelse(index(enabled_languages, `$1'), -1, `', 
`$2')')
 
 ifdef(`TARGET',`ifdef(`CROSS_ARCH',`',`undefine(`MULTIARCH')')')
 define(`CROSS_ARCH', ifdef(`CROSS_ARCH', CROSS_ARCH, `all'))
@@ -4045,9 +4046,7 @@ Description: GCJ byte code and native compiler for 
Java(TM)
  Java(tm) source and bytecode files. The compiler can also generate class
  files.
  .
-ifdef(`TARGET',`'dnl
-,` Install the gcj`'PV`'TS-jdk package for a more complete SDK environment.
-')`'dnl
+ Install the gcj`'PV`'TS-jdk package for a more complete SDK environment.
 ')`'dnl gcj
 
 ifenabled(`libgcj',`
@@ -4064,7 +4063,6 @@ Description: Java runtime library (common files)
  This package contains files shared by Classpath and libgcj libraries.
 ')`'dnl libgcjcommon
 
-
 Package: gcj`'PV-jdk`'TS
 Section: java
 Architecture: any
@@ -4085,12 +4083,15 @@ Description: GCJ and Classpath development tools for 
Java(TM)
  The package contains as well a collection of wrapper scripts and symlinks.
  It is meant to provide a Java-SDK-like interface to the GCJ tool set.
 
+ifdef(`TARGET',`',`
 Package: gcj`'PV-jre-headless`'TS
 Priority: ifdef(`TARGET',`extra',`PRI(optional)')
 Section: java
 Architecture: any
-Depends: BASEDEP, gcj`'PV-jre-lib`'TS (>= ${gcj:SoftVersion}), 
libdep(gcj`'LIBGCJ_EXT,,>=,${gcj:Version}), ${dep:prctl}, ${shlibs:Depends}, 
${misc:Depends}
-Suggests: fastjar, gcj`'PV-jdk`'TS (= ${gcj:Version}), 
libdep(gcj`'LIBGCJ_EXT-awt,,>=,${gcj:Version})
+Depends: BASEDEP, gcj`'PV-jre-lib (>= ${gcj:SoftVersion}), 
libdep(gcj`'LIBGCJ_EXT,,>=,${gcj:Version}), ${dep:prctl}, ${shlibs:Depends}, 
${misc:Depends}
+Suggests: fastjar, gcj`'PV-jdk`'TS (= ${gcj:Version}), 
`'ifenabled_newline(`libgcjawt',dnl
+ libdep(gcj`'LIBGCJ_EXT-awt,,>=,${gcj:Version})`'dnl
+)
 Provides: java5-runtime-headless, java2-runtime-headless, 
java1-runtime-headless, java-runtime-headless
 BUILT_USING`'dnl
 Description: Java runtime environment using GIJ/Classpath (headless version)
@@ -4102,12 +4103,15 @@ Description: Java runtime environment using 
GIJ/Classpath (headless version)
  The package contains as well a collection of wrapper scripts and symlinks.
  It is meant to provide a Java-RTE-like interface to the GIJ/GCJ tool set,
  limited to the headless tools and libraries.
+')`'dnl TARGET
 
 Package: gcj`'PV-jre`'TS
 Section: java
 Architecture: any
 Priority: ifdef(`TARGET',`extra',`PRI(optional)')
-Depends: BASEDEP, gcj`'PV-jre-headless`'TS (= ${gcj:Version}), 
libdep(gcj`'LIBGCJ_EXT-awt,,>=,${gcj:Version}), ${shlibs:Depends}, 
${misc:Depends}
+Depends: BASEDEP, ${shlibs:Depends}, ${misc:Depends}, 
ifdef(`TARGET',`',gcj`'PV-jre-headless`'TS (= ${gcj:Version})`,') 
`'ifenabled_newline(`libgcjawt',dnl
+ libdep(gcj`'LIBGCJ_EXT-awt,,>=,${gcj:Version})`'dnl
+)
 Provides: java5-runtime, java2-runtime, java1-runtime, java-runtime
 BUILT_USING`'dnl
 Description: Java runtime environment using GIJ/Classpath
@@ -4127,8 +4131,10 @@ ifdef(`MULTIARCH', `Pre-Depends: ${misc:Pre-Depends}
 Multi-Arch: same
 ')`'dnl
 Depends: SOFTBASEDEP, libgcj-common (>= 1:4.1.1-21), ${shlibs:Depends}, 
${misc:Depends}
-Recommends: gcj`'PV-jre-lib`'TS (>= ${gcj:SoftVersion})
-Suggests: libdbgdep(gcj`'GCJ_SO-dbg,), 
libdep(gcj`'LIBGCJ_EXT-awt,,=,${gcj:Version})
+Recommends: gcj`'PV-jre-lib (>= ${gcj:SoftVersion})
+Suggests: libdbgdep(gcj`'GCJ_SO-dbg,), `'ifenabled_newline(`libgcjawt',dnl
+ libdep(gcj`'LIBGCJ_EXT-awt,,=,${gcj:Version})`'dnl
+)
 BUILT_USING`'dnl
 Description: Java runtime library for use with gcj
  This is the runtime that goes along with the gcj front end to
@@ -4138,7 +4144,8 @@ Description: Java runtime library for use with gcj
  To show file names and line numbers in stack traces, the packages
  libgcj`'GCJ_SO-dbg and binutils are required.
 
-Package: gcj`'PV-jre-lib`'TS
+ifdef(`TARGET',`',`
+Package: gcj`'PV-jre-lib
 Section: java
 Architecture: all
 Priority: PRI(optional)
@@ -4146,6 +4153,7 @@ Depends: SOFTBASEDEP, 
libdep(gcj`'LIBGCJ_EXT,,>=,${gcj:SoftVersion}), ${misc:Dep
 BUILT_USING`'dnl
 Description: Java runtime library for use with gcj (jar files)
  This is the jar file that goes along with the gcj front end to gcc.
+')`'dnl TARGET
 
 ifenabled(`gcjbc',`
 Package: libgcj-bc
@@ -4164,6 +4172,7 @@ Description: Link time only library for use with gcj
  libgcj.so changes.
 ')`'dnl gcjbc
 
+ifenabled(`libgcjawt',`
 Package: libgcj`'LIBGCJ_EXT-a