$xcodePath -> $SDKROOT
SDKROOT is standard. In particular, this fixes the cmake build on Mac OS X 10.9.
This commit is contained in:
parent
bf0d518c67
commit
ac8775dd96
|
@ -309,12 +309,12 @@ stdenv.mkDerivation ({
|
|||
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 xcodePath=$(/usr/bin/xcrun --show-sdk-path); then
|
||||
configureFlagsArray+=(--with-native-system-header-dir=$xcodePath/usr/include)
|
||||
if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
|
||||
configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
|
||||
makeFlagsArray+=( \
|
||||
CFLAGS_FOR_BUILD=-F$xcodePath/System/Library/Frameworks \
|
||||
CFLAGS_FOR_TARGET=-F$xcodePath/System/Library/Frameworks \
|
||||
FLAGS_FOR_TARGET=-F$xcodePath/System/Library/Frameworks \
|
||||
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
|
||||
'';
|
||||
|
|
|
@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
|
|||
''
|
||||
# need headers from the Carbon.framework in /System/Library/Frameworks to
|
||||
# compile this on darwin -- not sure how to handle
|
||||
NIX_CFLAGS_COMPILE+=" -I$xcodePath/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"
|
||||
NIX_CFLAGS_COMPILE+=" -I$SDKROOT/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"
|
||||
|
||||
substituteInPlace examples/Makefile --replace "-fpascal-strings" ""
|
||||
'';
|
||||
|
|
|
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
|
|||
# compile this on darwin -- not sure how to handle
|
||||
preConfigure = stdenv.lib.optionalString stdenv.isDarwin
|
||||
''
|
||||
NIX_CFLAGS_COMPILE+=" -I$xcodePath/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"
|
||||
NIX_CFLAGS_COMPILE+=" -I$SDKROOT/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"
|
||||
'';
|
||||
|
||||
# Needed on Darwin.
|
||||
|
|
|
@ -15,9 +15,9 @@ import ../generic rec {
|
|||
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
|
||||
xargsFlags=" "
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.6
|
||||
xcodePath=$(/usr/bin/xcrun --show-sdk-path 2> /dev/null || true)
|
||||
export NIX_CFLAGS_COMPILE+=" --sysroot=/var/empty -idirafter $xcodePath/usr/include -F$xcodePath/System/Library/Frameworks -Wno-multichar -Wno-deprecated-declarations"
|
||||
export NIX_LDFLAGS_AFTER+=" -L$xcodePath/usr/lib"
|
||||
SDKROOT=$(/usr/bin/xcrun --show-sdk-path 2> /dev/null || true)
|
||||
export NIX_CFLAGS_COMPILE+=" --sysroot=/var/empty -idirafter $SDKROOT/usr/include -F$xcodePath/System/Library/Frameworks -Wno-multichar -Wno-deprecated-declarations"
|
||||
export NIX_LDFLAGS_AFTER+=" -L$SDKROOT/usr/lib"
|
||||
'' else "");
|
||||
|
||||
initialPath = (import ../common-path.nix) {pkgs = pkgs;};
|
||||
|
|
Loading…
Reference in New Issue