01e38f9371
against the right dynamic libraries. set-env.sh add the right linker flags to the NIX_LDFLAGS environment variable, which is passed by gcc-wrapper to the linker. (In many cases these flags could just be passed through LDFLAGS to configure scripts; however, in many other cases this doesn't work properly.) --This line, and those below, will be ignored-- M pkgs/atk/atk-build.sh M pkgs/glibc/glibc-build.sh M pkgs/expat/expat-build.sh M pkgs/freetype/freetype-build.sh M pkgs/system/populate-linkdirs.pl M pkgs/sdf2/sdf2-build.sh M pkgs/pspell/pspell-build.sh M pkgs/subversion/subversion-build.sh M pkgs/helpers/set-env.sh M pkgs/pango/pango-build.sh M pkgs/strategoxt/strategoxt-build.sh M pkgs/aterm/aterm-build.sh M pkgs/libxml2/libxml2-build.sh M pkgs/glib-1/glib-build.sh M pkgs/glib/glib-build.sh M pkgs/pan/pan.fix M pkgs/pan/pan-build.sh M pkgs/libxslt/libxslt-build.sh M pkgs/httpd/httpd-build.sh M pkgs/openssl/openssl-build.sh M pkgs/gtkspell/gtkspell-build.sh M pkgs/fontconfig/fontconfig.fix M pkgs/fontconfig/fontconfig-build.sh M pkgs/gnet/gnet-build.sh M pkgs/gtk+-1/gtk+-build.sh M pkgs/gtk+/gtk+-build.sh M pkgs/stdenv/gcc-wrapper.sh M pkgs/stdenv/stdenv-build.sh M pkgs/db4/db4-build.sh M pkgs/db4/db4.fix M pkgs/MPlayer/MPlayer-build.sh M pkgs/swig/swig-build.sh svn path=/nixpkgs/trunk/; revision=213
29 lines
684 B
Bash
Executable file
29 lines
684 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
|
|
echo "export NIX_CFLAGS=\"-isystem $glibc/include \$NIX_CFLAGS\"" >> $out/setup || exit 1
|
|
echo "export NIX_LDFLAGS=\"-L $glibc/lib -Wl,-dynamic-linker,$glibc/lib/ld-linux.so.2,-rpath,$glibc/lib \$NIX_LDFLAGS\"" >> $out/setup || exit 1
|
|
|
|
gcc=/usr/bin/gcc
|
|
|
|
sed \
|
|
-e s^@GCC\@^$gcc^g \
|
|
< $gccwrapper > $out/bin/gcc || exit 1
|
|
chmod +x $out/bin/gcc || exit 1
|
|
|
|
ln -s gcc $out/bin/cc
|
|
|
|
gplusplus=/usr/bin/g++
|
|
|
|
sed \
|
|
-e s^@GCC\@^$gplusplus^g \
|
|
< $gccwrapper > $out/bin/g++ || exit 1
|
|
chmod +x $out/bin/g++ || exit 1
|
|
|
|
ln -s g++ $out/bin/c++
|