···1-source $stdenv/setup
2-3-4-export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
5-mkdir $NIX_FIXINC_DUMMY
6-7-export X_CFLAGS="-I${gmp}/include -I${mpfr}/include -L${gmp}/lib -L${mpfr}/lib";
8-9-# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
10-# Thing.
11-export CPP="gcc -E"
12-13-14-if test "$noSysDirs" = "1"; then
15-16- if test -e $NIX_GCC/nix-support/orig-libc; then
17-18- # Figure out what extra flags to pass to the gcc compilers
19- # being generated to make sure that they use our glibc.
20- extraCFlags="$(cat $NIX_GCC/nix-support/libc-cflags)"
21- extraLDFlags="$(cat $NIX_GCC/nix-support/libc-ldflags) $(cat $NIX_GCC/nix-support/libc-ldflags-before)"
22-23- # Use *real* header files, otherwise a limits.h is generated
24- # that does not include Glibc's limits.h (notably missing
25- # SSIZE_MAX, which breaks the build).
26- export NIX_FIXINC_DUMMY=$(cat $NIX_GCC/nix-support/orig-libc)/include
27-28- else
29- # Hack: support impure environments.
30- extraCFlags="-isystem /usr/include"
31- extraLDFlags="-L/usr/lib64 -L/usr/lib"
32- export NIX_FIXINC_DUMMY=/usr/include
33- fi
34-35- extraCFlags="-g0 $extraCFlags"
36- extraLDFlags="--strip-debug $extraLDFlags"
37-38- export NIX_EXTRA_CFLAGS=$extraCFlags
39- for i in $extraLDFlags; do
40- export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i"
41- done
42-43- makeFlagsArray=( \
44- NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
45- SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
46- LIMITS_H_TEST=true \
47- X_CFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
48- LDFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
49- LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
50- )
51-fi
52-53-54-preConfigure=preConfigure
55-preConfigure() {
56- # Perform the build in a different directory.
57- mkdir ../build
58- cd ../build
59- configureScript=../$sourceRoot/configure
60-}
61-62-63-postInstall=postInstall
64-postInstall() {
65- # Remove precompiled headers for now. They are very big and
66- # probably not very useful yet.
67- find $out/include -name "*.gch" -exec rm -rf {} \; -prune
68-69- # Remove `fixincl' to prevent a retained dependency on the
70- # previous gcc.
71- rm -rf $out/libexec/gcc/*/*/install-tools
72-73- # Get rid of some "fixed" header files
74- rm -rf $out/lib/gcc/*/*/include/root
75-}
76-77-78-if test -z "$staticCompiler"; then
79- if test -z "$profiledCompiler"; then
80- buildFlags="bootstrap $buildFlags"
81- else
82- buildFlags="profiledbootstrap $buildFlags"
83- fi
84-fi
85-86-genericBuild
···1-source $stdenv/setup
2-3-4-export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
5-mkdir $NIX_FIXINC_DUMMY
6-7-export X_CFLAGS="-I${gmp}/include -I${mpfr}/include -L${gmp}/lib -L${mpfr}/lib";
8-9-# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
10-# Thing.
11-export CPP="gcc -E"
12-13-14-if test "$noSysDirs" = "1"; then
15-16- if test -e $NIX_GCC/nix-support/orig-libc; then
17-18- # Figure out what extra flags to pass to the gcc compilers
19- # being generated to make sure that they use our glibc.
20- extraCFlags="$(cat $NIX_GCC/nix-support/libc-cflags)"
21- extraLDFlags="$(cat $NIX_GCC/nix-support/libc-ldflags) $(cat $NIX_GCC/nix-support/libc-ldflags-before)"
22-23- # Use *real* header files, otherwise a limits.h is generated
24- # that does not include Glibc's limits.h (notably missing
25- # SSIZE_MAX, which breaks the build).
26- export NIX_FIXINC_DUMMY=$(cat $NIX_GCC/nix-support/orig-libc)/include
27-28- else
29- # Hack: support impure environments.
30- extraCFlags="-isystem /usr/include"
31- extraLDFlags="-L/usr/lib64 -L/usr/lib"
32- export NIX_FIXINC_DUMMY=/usr/include
33- fi
34-35- extraCFlags="-g0 $extraCFlags"
36- extraLDFlags="--strip-debug $extraLDFlags"
37-38- export NIX_EXTRA_CFLAGS=$extraCFlags
39- for i in $extraLDFlags; do
40- export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i"
41- done
42-43- makeFlagsArray=( \
44- NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
45- SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
46- LIMITS_H_TEST=true \
47- X_CFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
48- LDFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
49- LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
50- )
51-fi
52-53-54-preConfigure=preConfigure
55-preConfigure() {
56- # Perform the build in a different directory.
57- mkdir ../build
58- cd ../build
59- configureScript=../$sourceRoot/configure
60-}
61-62-63-postInstall=postInstall
64-postInstall() {
65- # Remove precompiled headers for now. They are very big and
66- # probably not very useful yet.
67- find $out/include -name "*.gch" -exec rm -rf {} \; -prune
68-69- # Remove `fixincl' to prevent a retained dependency on the
70- # previous gcc.
71- rm -rf $out/libexec/gcc/*/*/install-tools
72-73- # Get rid of some "fixed" header files
74- rm -rf $out/lib/gcc/*/*/include/root
75-}
76-77-78-if test -z "$staticCompiler"; then
79- if test -z "$profiledCompiler"; then
80- buildFlags="bootstrap $buildFlags"
81- else
82- buildFlags="profiledbootstrap $buildFlags"
83- fi
84-fi
85-86-genericBuild