nixpkgs/pkgs/stdenv/stdenv-build.sh
Eelco Dolstra 1dda526c66 * Added the GNU C Library (glibc), a big step towards full Nixification of
the build and execution environment.

  This is very useful.  For example, it allows packages built on a SuSE 
  8.2 system to run on a SuSE 8.1 system (this is because 8.2 has a newer 
  glibc; packages built against it cannot be dynamically linked against 
  older glibcs).

  Of course, Fix packages should not directly import glibc since that is 
  very system-specific.  Rather, they should import stdenv/stdenv.fix and 
  in their build scripts source in $stdenv/setup, which will setup the 
  right environment variables.  The idea is that stdenv.fix provides the 
  basic C/Unix build environment (C compiler, POSIX utilities, etc.).

  Note that only the ATerm package currently uses this.

svn path=/nixpkgs/trunk/; revision=203
2003-07-24 15:15:48 +00:00

23 lines
422 B
Bash
Executable file

#! /bin/sh
export PATH=/bin:/usr/bin
mkdir $out || exit 1
mkdir $out/bin || exit 1
echo "export PATH=$out/bin:/bin:/usr/bin" >> $out/setup || exit 1
gcc=/usr/bin/gcc
sed \
-e s^@GCC\@^$gcc^g \
-e s^@LIBC\@^$glibc^g \
< $gccwrapper > $out/bin/gcc || exit 1
chmod +x $out/bin/gcc || exit 1
sed \
-e s^@GCC\@^$g++^g \
-e s^@LIBC\@^$glibc^g \
< $gccwrapper > $out/bin/g++ || exit 1
chmod +x $out/bin/g++ || exit 1