gcc: fix darwin building

- disable bootstrap builds on Darwin
- remove xcrun calls
- check if patchelf is available before using
- apply darwin patch for gcc4.9
- fixes #16047
- fixes #14812
This commit is contained in:
Matthew Bauer
2016-06-19 23:07:10 -05:00
parent 20a8349d62
commit f05bb6d23f
6 changed files with 21 additions and 54 deletions
+1 -10
View File
@@ -198,7 +198,7 @@ let version = "6.1.0";
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
bootstrap = cross == null;
bootstrap = cross == null && !stdenv.isDarwin;
in
@@ -306,15 +306,6 @@ stdenv.mkDerivation ({
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
makeFlagsArray+=( \
CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \
CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
)
fi
'';
dontDisableStatic = true;