2010-05-19 23:28:57 +02:00
|
|
|
{ fetchgit, stdenv, autoconf, automake, libtool
|
|
|
|
, machHeaders, hurdHeaders, hurd
|
|
|
|
, cross ? null, gccCross ? null, glibcCross ? null }:
|
|
|
|
|
|
|
|
assert (cross != null) -> (gccCross != null) && (glibcCross != null);
|
|
|
|
|
|
|
|
let
|
2010-06-15 17:01:15 +02:00
|
|
|
date = "20100512";
|
2010-05-19 23:28:57 +02:00
|
|
|
|
2010-06-15 17:01:15 +02:00
|
|
|
# Use the `tschwinge/Peter_Herbolzheimer' branch as prescribed in
|
2010-05-19 23:28:57 +02:00
|
|
|
# <http://www.gnu.org/software/hurd/hurd/building/cross-compiling.html>.
|
2010-06-15 17:01:15 +02:00
|
|
|
rev = "c4bb52770f0b6703bef76c5abdd08663b46b4dc9";
|
2010-05-19 23:28:57 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation ({
|
|
|
|
name = "libpthread-hurd-${date}";
|
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://git.sv.gnu.org/hurd/libpthread.git";
|
|
|
|
sha256 = "1wya9kfmqgn04l995a25p4hxfwddjahfmhdzljb4cribw0bqdizg";
|
|
|
|
inherit rev;
|
|
|
|
};
|
|
|
|
|
|
|
|
buildNativeInputs = [ autoconf automake libtool ];
|
|
|
|
buildInputs = [ machHeaders hurdHeaders hurd ]
|
|
|
|
++ stdenv.lib.optional (gccCross != null) gccCross;
|
|
|
|
|
|
|
|
preConfigure = "autoreconf -vfi";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "GNU Hurd's libpthread";
|
|
|
|
|
|
|
|
license = "LGPLv2+";
|
|
|
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.ludo ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
(if cross != null
|
|
|
|
then {
|
|
|
|
crossConfig = cross.config;
|
|
|
|
|
|
|
|
# Tell gcc where to find `crt1.o' et al. This is specified in two
|
|
|
|
# different ways: one for gcc as run from `configure', and one for linking
|
|
|
|
# libpthread.so (by default `libtool --mode=link' swallows `-B', hence
|
|
|
|
# this workaround; see
|
|
|
|
# <http://lists.gnu.org/archive/html/bug-libtool/2010-05/msg00012.html>.)
|
|
|
|
LDFLAGS = "-B${glibcCross}/lib";
|
|
|
|
makeFlags = [ "LDFLAGS=-Wc,-B${glibcCross}/lib" ];
|
|
|
|
|
|
|
|
# Help the linker find glibc.
|
|
|
|
CPATH = "${glibcCross}/include";
|
|
|
|
LIBRARY_PATH = "${glibcCross}/lib";
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
# Extra target LDFLAGS to allow the cross-linker to find the
|
|
|
|
# dependencies of the cross libpthread.so, namely libihash.so.
|
2010-07-15 16:06:09 +02:00
|
|
|
# Note: these are raw `ld' flags, so `-Wl,' must be prepended when using
|
|
|
|
# `gcc'.
|
2010-05-19 23:28:57 +02:00
|
|
|
#
|
|
|
|
# This is actually only useful while building the final cross-gcc, since
|
|
|
|
# afterwards gcc-cross-wrapper should add the relevant flags.
|
2010-07-15 16:06:09 +02:00
|
|
|
TARGET_LDFLAGS = "-rpath-link=${hurd}/lib";
|
2010-05-19 23:28:57 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
else { }))
|