summary refs log tree commit diff
path: root/pkgs/build-support/gcc-wrapper/setup-hook.sh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2004-03-08 16:02:46 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2004-03-08 16:02:46 +0000
commitce50734cf067496ae50d1a6fd139fc03de283cbc (patch)
tree8603be7a557177d8646093c4edf7bdb097577b11 /pkgs/build-support/gcc-wrapper/setup-hook.sh
parent1b8e9faf08d2bb5fe83464d8380dabc52982f935 (diff)
* Started reorganising stdenv:
  - gcc/ld-wrappers have been factored out into a separate
    derivation.  This allows a working gcc to be installed in the user
    environment.  (Previously the Nix gcc didn't work because it
    needed a whole bunch of flags to point to glibc.)
    
  - Better modularity: packages can specify hooks into the setup
    scripts.  For instance, setup no longer knows about the
    PKG_CONFIG_PATH variable; pkgconfig can set it up instead.

  - gcc not longer depends on binutils.  This simplifies the bootstrap
    process.

svn path=/nixpkgs/trunk/; revision=816
Diffstat (limited to 'pkgs/build-support/gcc-wrapper/setup-hook.sh')
-rw-r--r--pkgs/build-support/gcc-wrapper/setup-hook.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkgs/build-support/gcc-wrapper/setup-hook.sh b/pkgs/build-support/gcc-wrapper/setup-hook.sh
new file mode 100644
index 0000000000000..a4c52ba803d7e
--- /dev/null
+++ b/pkgs/build-support/gcc-wrapper/setup-hook.sh
@@ -0,0 +1,15 @@
+addCVars () {
+    if test -d $1/include; then
+        export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$1/include"
+    fi
+
+    if test -d $1/lib; then
+        export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib -rpath $1/lib"
+    fi
+}
+
+envHooks=(${envHooks[@]} addCVars)
+
+if test -z "@isNative@"; then
+    PATH=$PATH:@gcc@/bin:@glibc@/bin
+fi