* 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
This commit is contained in:
@@ -1,41 +1,17 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Set up the initial path.
|
||||
for i in $initialPath; do
|
||||
PATH=$PATH:$i/bin
|
||||
done
|
||||
. $stdenv/setup
|
||||
|
||||
# Make output directories.
|
||||
mkdir $out || exit 1
|
||||
mkdir $out/bin || exit 1
|
||||
|
||||
# Create the setup script.
|
||||
sed \
|
||||
-e "s^@OUT@^$out^g" \
|
||||
-e "s^@PREHOOK@^$prehook^g" \
|
||||
-e "s^@POSTHOOK@^$posthook^g" \
|
||||
-e "s^@INITIALPATH@^$initialPath^g" \
|
||||
-e "s^@PARAM1@^$param1^g" \
|
||||
-e "s^@PARAM2@^$param2^g" \
|
||||
-e "s^@PARAM3@^$param3^g" \
|
||||
-e "s^@PARAM4@^$param4^g" \
|
||||
-e "s^@PARAM5@^$param5^g" \
|
||||
-e "s^@preHook@^$preHook^g" \
|
||||
-e "s^@postHook@^$postHook^g" \
|
||||
-e "s^@initialPath@^$initialPath^g" \
|
||||
-e "s^@gcc@^$gcc^g" \
|
||||
-e "s^@param1@^$param1^g" \
|
||||
-e "s^@param2@^$param2^g" \
|
||||
-e "s^@param3@^$param3^g" \
|
||||
-e "s^@param4@^$param4^g" \
|
||||
-e "s^@param5@^$param5^g" \
|
||||
< $setup > $out/setup || exit 1
|
||||
|
||||
# Create the gcc wrapper.
|
||||
sed \
|
||||
-e 's^@GCC\@^$NIX_CC^g' \
|
||||
< $gccwrapper > $out/bin/gcc || exit 1
|
||||
chmod +x $out/bin/gcc || exit 1
|
||||
ln -s gcc $out/bin/cc || exit 1
|
||||
|
||||
# Create the g++ wrapper.
|
||||
sed \
|
||||
-e 's^@GCC\@^$NIX_CXX^g' \
|
||||
< $gccwrapper > $out/bin/g++ || exit 1
|
||||
chmod +x $out/bin/g++ || exit 1
|
||||
ln -s g++ $out/bin/c++ || exit 1
|
||||
|
||||
# Create the ld wrapper.
|
||||
cp $ldwrapper $out/bin/ld || exit 1
|
||||
chmod +x $out/bin/ld || exit 1
|
||||
|
||||
Reference in New Issue
Block a user