diff options
author | Ludovic Courtès <ludo@gnu.org> | 2010-05-19 21:32:19 +0000 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2010-05-19 21:32:19 +0000 |
commit | 63abc2ed86acfc39022d7674ccee66663a3451b8 (patch) | |
tree | 6d3d52654151f88d00b2b9de4fc74aeee88d78c4 /pkgs/development/compilers/gcc-4.5/default.nix | |
parent | 91e31476227c8783b616b3f72e8ad94f3c55aab4 (diff) | |
download | nixlib-63abc2ed86acfc39022d7674ccee66663a3451b8.tar nixlib-63abc2ed86acfc39022d7674ccee66663a3451b8.tar.gz nixlib-63abc2ed86acfc39022d7674ccee66663a3451b8.tar.bz2 nixlib-63abc2ed86acfc39022d7674ccee66663a3451b8.tar.lz nixlib-63abc2ed86acfc39022d7674ccee66663a3451b8.tar.xz nixlib-63abc2ed86acfc39022d7674ccee66663a3451b8.tar.zst nixlib-63abc2ed86acfc39022d7674ccee66663a3451b8.zip |
GCC 4.5: Add support for a separate libpthread; rearrange target flags handling.
svn path=/nixpkgs/trunk/; revision=21905
Diffstat (limited to 'pkgs/development/compilers/gcc-4.5/default.nix')
-rw-r--r-- | pkgs/development/compilers/gcc-4.5/default.nix | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/pkgs/development/compilers/gcc-4.5/default.nix b/pkgs/development/compilers/gcc-4.5/default.nix index 8ec79d7c43d9..f5e4c67761e9 100644 --- a/pkgs/development/compilers/gcc-4.5/default.nix +++ b/pkgs/development/compilers/gcc-4.5/default.nix @@ -24,6 +24,7 @@ , libcCross ? null , crossStageStatic ? true , gnat ? null +, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd }: assert langTreelang -> bison != null && flex != null; @@ -212,15 +213,29 @@ stdenv.mkDerivation ({ (optionals (zlib != null) [ zlib ] ++ optionals langJava [ boehmgc ] ++ optionals javaAwtGtk xlibs - ++ optionals javaAwtGtk [ gmp mpfr ]))); + ++ optionals javaAwtGtk [ gmp mpfr ] + ++ optional (libpthread != null) libpthread + ++ optional (libpthreadCross != null) libpthreadCross))); LIBRARY_PATH = concatStrings (intersperse ":" (map (x: x + "/lib") (optionals (zlib != null) [ zlib ] ++ optionals langJava [ boehmgc ] ++ optionals javaAwtGtk xlibs - ++ optionals javaAwtGtk [ gmp mpfr ]))); - + ++ optionals javaAwtGtk [ gmp mpfr ] + ++ optional (libpthread != null) libpthread))); + + EXTRA_TARGET_CFLAGS = + if cross != null && libcCross != null + then "-g0 -O2 -idirafter ${libcCross}/include" + else null; + + EXTRA_TARGET_LDFLAGS = + if cross != null && libcCross != null + then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" + + (optionalString (libpthreadCross != null) + " -L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}") + else null; passthru = { inherit langC langCC langAda langFortran langTreelang langVhdl enableMultilib; }; |