summary refs log tree commit diff
path: root/pkgs/development/compilers/gcc
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2016-09-14 22:19:28 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2016-09-15 17:58:09 -0500
commit8610a344740776639f7161e5a47196418695d6fe (patch)
treeee82e373db5d6b82e9f508c4504541392bad9c22 /pkgs/development/compilers/gcc
parentc7e0fbcbc80c402ce53a9677b11a01d792b80c0d (diff)
downloadnixlib-8610a344740776639f7161e5a47196418695d6fe.tar
nixlib-8610a344740776639f7161e5a47196418695d6fe.tar.gz
nixlib-8610a344740776639f7161e5a47196418695d6fe.tar.bz2
nixlib-8610a344740776639f7161e5a47196418695d6fe.tar.lz
nixlib-8610a344740776639f7161e5a47196418695d6fe.tar.xz
nixlib-8610a344740776639f7161e5a47196418695d6fe.tar.zst
nixlib-8610a344740776639f7161e5a47196418695d6fe.zip
gcc: use special native system headers for darwin
Darwin systems need to be able to find CoreFoundation headers as well as
libc headers. Somehow, gcc doesn't accept any "framework" parameters
that would normally be used to include CoreFoundation in this
situation.

HACK: Instead, this adds a derivation that combines the two. The result
works but probably not a good long term solution.

ALTERNATIVES: Maybe sending patches in to GCC to allow
"native-system-framework" configure flag to get this found.
Diffstat (limited to 'pkgs/development/compilers/gcc')
-rw-r--r--pkgs/development/compilers/gcc/4.8/default.nix5
-rw-r--r--pkgs/development/compilers/gcc/4.9/default.nix5
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix5
-rw-r--r--pkgs/development/compilers/gcc/6/default.nix5
4 files changed, 16 insertions, 4 deletions
diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix
index 1b9e4bf666cf..088e06835720 100644
--- a/pkgs/development/compilers/gcc/4.8/default.nix
+++ b/pkgs/development/compilers/gcc/4.8/default.nix
@@ -33,6 +33,7 @@
 , libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
 , stripped ? true
 , gnused ? null
+, darwin ? null
 }:
 
 assert langJava     -> zip != null && unzip != null
@@ -358,7 +359,9 @@ stdenv.mkDerivation ({
       )
     }
     ${if cross == null
-      then " --with-native-system-header-dir=${getDev stdenv.libc}/include"
+      then if stdenv.isDarwin
+        then " --with-native-system-header-dir=${darwin.usr-include}"
+        else " --with-native-system-header-dir=${getDev stdenv.libc}/include"
       else ""}
     ${if langAda then " --enable-libada" else ""}
     ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix
index 71edda0937f8..1db7dadb1e3f 100644
--- a/pkgs/development/compilers/gcc/4.9/default.nix
+++ b/pkgs/development/compilers/gcc/4.9/default.nix
@@ -33,6 +33,7 @@
 , libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
 , stripped ? true
 , gnused ? null
+, darwin ? null
 }:
 
 assert langJava     -> zip != null && unzip != null
@@ -365,7 +366,9 @@ stdenv.mkDerivation ({
       )
     }
     ${if cross == null
-      then " --with-native-system-header-dir=${getDev stdenv.libc}/include"
+      then if stdenv.isDarwin
+        then " --with-native-system-header-dir=${darwin.usr-include}"
+        else " --with-native-system-header-dir=${getDev stdenv.libc}/include"
       else ""}
     ${if langAda then " --enable-libada" else ""}
     ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index e84c677408c3..c1db89d7c384 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -35,6 +35,7 @@
 , gnused ? null
 , binutils ? null
 , cloog # unused; just for compat with gcc4, as we override the parameter on some places
+, darwin ? null
 }:
 
 assert langJava     -> zip != null && unzip != null
@@ -363,7 +364,9 @@ stdenv.mkDerivation ({
       )
     }
     ${if cross == null
-      then " --with-native-system-header-dir=${getDev stdenv.libc}/include"
+      then if stdenv.isDarwin
+        then " --with-native-system-header-dir=${darwin.usr-include}"
+        else " --with-native-system-header-dir=${getDev stdenv.libc}/include"
       else ""}
     ${if langAda then " --enable-libada" else ""}
     ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix
index b33437ee868c..530d835620af 100644
--- a/pkgs/development/compilers/gcc/6/default.nix
+++ b/pkgs/development/compilers/gcc/6/default.nix
@@ -35,6 +35,7 @@
 , gnused ? null
 , binutils ? null
 , cloog # unused; just for compat with gcc4, as we override the parameter on some places
+, darwin ? null
 }:
 
 assert langJava     -> zip != null && unzip != null
@@ -361,7 +362,9 @@ stdenv.mkDerivation ({
       )
     }
     ${if cross == null
-      then " --with-native-system-header-dir=${getDev stdenv.libc}/include"
+      then if stdenv.isDarwin
+        then " --with-native-system-header-dir=${darwin.usr-include}"
+        else " --with-native-system-header-dir=${getDev stdenv.libc}/include"
       else ""}
     ${if langAda then " --enable-libada" else ""}
     ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}