Fixes to make basic builds on Cygwin work again + additions to support x86_64-cygwin

This commit is contained in:
Sander van der Burg 2014-05-29 14:47:07 +02:00
parent 29da3bce27
commit 9ec52d6323
4 changed files with 16 additions and 4 deletions

View File

@ -7,7 +7,7 @@ rec {
freebsd = ["i686-freebsd" "x86_64-freebsd"]; freebsd = ["i686-freebsd" "x86_64-freebsd"];
openbsd = ["i686-openbsd" "x86_64-openbsd"]; openbsd = ["i686-openbsd" "x86_64-openbsd"];
netbsd = ["i686-netbsd" "x86_64-netbsd"]; netbsd = ["i686-netbsd" "x86_64-netbsd"];
cygwin = ["i686-cygwin"]; cygwin = ["i686-cygwin" "x86_64-cygwin"];
unix = linux ++ darwin ++ freebsd ++ openbsd; unix = linux ++ darwin ++ freebsd ++ openbsd;
all = linux ++ darwin ++ cygwin ++ freebsd ++ openbsd; all = linux ++ darwin ++ cygwin ++ freebsd ++ openbsd;
none = []; none = [];

View File

@ -54,6 +54,12 @@ stdenv.mkDerivation rec {
${optionalString stdenv.isArm '' ${optionalString stdenv.isArm ''
configureFlagsArray=(-Dldflags="-lm -lrt") configureFlagsArray=(-Dldflags="-lm -lrt")
''} ''}
${optionalString stdenv.isCygwin ''
cp cygwin/cygwin{,.bak}
echo "#define PERLIO_NOT_STDIO 0" > tmp
cat tmp cygwin/cygwin.c.bak > cygwin/cygwin.c
''}
''; '';
preBuild = optionalString (!(stdenv ? gcc && stdenv.gcc.nativeTools)) preBuild = optionalString (!(stdenv ? gcc && stdenv.gcc.nativeTools))
@ -64,7 +70,7 @@ stdenv.mkDerivation rec {
setupHook = ./setup-hook.sh; setupHook = ./setup-hook.sh;
doCheck = !stdenv.isDarwin; doCheck = stdenv.isLinux;
# some network-related tests don't work, mostly probably due to our sandboxing # some network-related tests don't work, mostly probably due to our sandboxing
testsToSkip = '' testsToSkip = ''

View File

@ -60,7 +60,12 @@ stdenv.mkDerivation {
else "./config"; else "./config";
configureFlags = "shared --libdir=lib --openssldir=etc/ssl" + configureFlags = "shared --libdir=lib --openssldir=etc/ssl" +
stdenv.lib.optionalString withCryptodev " -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"; stdenv.lib.optionalString withCryptodev " -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS" +
stdenv.lib.optionalString (stdenv.system == "x86_64-cygwin") " no-asm";
preBuild = stdenv.lib.optionalString (stdenv.system == "x86_64-cygwin") ''
sed -i -e "s|-march=i486|-march=x86-64|g" Makefile
'';
makeFlags = "MANDIR=$(out)/share/man"; makeFlags = "MANDIR=$(out)/share/man";

View File

@ -127,7 +127,8 @@ let
|| system == "x86_64-kfreebsd-gnu"; || system == "x86_64-kfreebsd-gnu";
isSunOS = system == "i686-solaris" isSunOS = system == "i686-solaris"
|| system == "x86_64-solaris"; || system == "x86_64-solaris";
isCygwin = system == "i686-cygwin"; isCygwin = system == "i686-cygwin"
|| system == "x86_64-cygwin";
isFreeBSD = system == "i686-freebsd" isFreeBSD = system == "i686-freebsd"
|| system == "x86_64-freebsd"; || system == "x86_64-freebsd";
isOpenBSD = system == "i686-openbsd" isOpenBSD = system == "i686-openbsd"