about summary refs log tree commit diff
path: root/pkgs/development/compilers/gcc-4.4
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-07-29 15:13:01 +0000
committerLudovic Courtès <ludo@gnu.org>2009-07-29 15:13:01 +0000
commit9ddd85f35682d9b7552469b5af40c526efdd39f8 (patch)
treea1c1c9e578113952677c8895ab8a1af4d2ca0772 /pkgs/development/compilers/gcc-4.4
parentbe4437bed03f5d07b28abc4a57155d134232162b (diff)
downloadnixlib-9ddd85f35682d9b7552469b5af40c526efdd39f8.tar
nixlib-9ddd85f35682d9b7552469b5af40c526efdd39f8.tar.gz
nixlib-9ddd85f35682d9b7552469b5af40c526efdd39f8.tar.bz2
nixlib-9ddd85f35682d9b7552469b5af40c526efdd39f8.tar.lz
nixlib-9ddd85f35682d9b7552469b5af40c526efdd39f8.tar.xz
nixlib-9ddd85f35682d9b7552469b5af40c526efdd39f8.tar.zst
nixlib-9ddd85f35682d9b7552469b5af40c526efdd39f8.zip
GCJ 4.4: Add libXrender; work around glitches in the Java/AWT build system.
svn path=/nixpkgs/trunk/; revision=16502
Diffstat (limited to 'pkgs/development/compilers/gcc-4.4')
-rw-r--r--pkgs/development/compilers/gcc-4.4/default.nix23
1 files changed, 17 insertions, 6 deletions
diff --git a/pkgs/development/compilers/gcc-4.4/default.nix b/pkgs/development/compilers/gcc-4.4/default.nix
index fc6592fbe7b2..e632982a4340 100644
--- a/pkgs/development/compilers/gcc-4.4/default.nix
+++ b/pkgs/development/compilers/gcc-4.4/default.nix
@@ -10,7 +10,7 @@
 , zlib ? null, boehmgc ? null
 , zip ? null, unzip ? null, pkgconfig ? null, gtk ? null, libart_lgpl ? null
 , libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
-, xproto ? null
+, libXrender ? null, xproto ? null
 , enableMultilib ? false
 , name ? "gcc"
 }:
@@ -30,7 +30,8 @@ let version = "4.4.1";
       url = "ftp://sourceware.org/pub/java/ecj-4.3.jar";
       sha256 = "0jz7hvc0s6iydmhgh5h2m15yza7p2rlss2vkif30vm9y77m97qcx";
     };
-    xlibs = [ libX11 libXt libSM libICE libXtst xproto ];
+    xlibs = [ libX11 libXt libSM libICE libXtst libXrender xproto ];
+    javaAwtGtk = langJava && gtk != null;
 
 in
 
@@ -77,15 +78,18 @@ stdenv.mkDerivation ({
     ++ (optional (zlib != null) zlib)
     ++ (optional (boehmgc != null) boehmgc)
     ++ (optionals langJava [zip unzip])
-    ++ (optionals (gtk != null) [gtk pkgconfig libart_lgpl] ++ xlibs)
+    ++ (optionals javaAwtGtk [gtk pkgconfig libart_lgpl] ++ xlibs)
     ;
 
+  # TODO: Use a binary distribution of Antlr for Java, needed to build
+  # `gjdoc' (see `--with-antlr-jar=ANTLR').
+
   configureFlags = "
     ${if enableMultilib then "" else "--disable-multilib"}
     ${if ppl != null then "--with-ppl=${ppl}" else ""}
     ${if cloogppl != null then "--with-cloog=${cloogppl}" else ""}
     ${if langJava then "--with-ecj-jar=${javaEcj}" else ""}
-    ${if (langJava && gtk != null) then "--enable-java-awt=gtk" else ""}
+    ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
     --with-gmp=${gmp}
     --with-mpfr=${mpfr}
     --disable-libstdcxx-pch
@@ -108,17 +112,24 @@ stdenv.mkDerivation ({
   # the library headers and binaries, regarless of the language being
   # compiled.
 
+  # Note: When building the Java AWT GTK+ peer, the build system doesn't
+  # honor `--with-gmp' et al., e.g., when building
+  # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just
+  # add them to $CPATH and $LIBRARY_PATH in this case.
+
   CPATH = concatStrings
             (intersperse ":" (map (x: x + "/include")
                                   ([ zlib ]
                                    ++ optional  langJava boehmgc
-                                   ++ optionals (gtk != null) xlibs)));
+                                   ++ optionals javaAwtGtk xlibs
+                                   ++ optionals javaAwtGtk [ gmp mpfr ])));
 
   LIBRARY_PATH = concatStrings
                    (intersperse ":" (map (x: x + "/lib")
                                          ([ zlib ]
                                           ++ optional  langJava boehmgc
-                                          ++ optionals (gtk != null) xlibs)));
+                                          ++ optionals javaAwtGtk xlibs
+                                          ++ optionals javaAwtGtk [ gmp mpfr ])));
 
 
   passthru = { inherit langC langCC langFortran langTreelang enableMultilib; };