···5566kde {
7788+ patches = [ ./pykde4-gcc-5.patch ];
99+810 # todo: polkit isn't found by the build system
9111012 buildInputs = [
-144
pkgs/development/compilers/gcc/4.3/builder.sh
···11-source $stdenv/setup
22-33-44-export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
55-mkdir $NIX_FIXINC_DUMMY
66-77-88-# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
99-# Thing.
1010-export CPP="gcc -E"
1111-1212-1313-if test "$noSysDirs" = "1"; then
1414-1515- if test -e $NIX_CC/nix-support/orig-libc; then
1616-1717- # Figure out what extra flags to pass to the gcc compilers
1818- # being generated to make sure that they use our glibc.
1919- extraCFlags="$(cat $NIX_CC/nix-support/libc-cflags)"
2020- extraLDFlags="$(cat $NIX_CC/nix-support/libc-ldflags) $(cat $NIX_CC/nix-support/libc-ldflags-before)"
2121-2222- # Use *real* header files, otherwise a limits.h is generated
2323- # that does not include Glibc's limits.h (notably missing
2424- # SSIZE_MAX, which breaks the build).
2525- export NIX_FIXINC_DUMMY=$(cat $NIX_CC/nix-support/orig-libc)/include
2626-2727- else
2828- # Hack: support impure environments.
2929- extraCFlags="-isystem /usr/include"
3030- extraLDFlags="-L/usr/lib64 -L/usr/lib"
3131- export NIX_FIXINC_DUMMY=/usr/include
3232- fi
3333-3434-3535- extraCFlags="-g0 -I$gmp/include -I$mpfr/include $extraCFlags"
3636- extraLDFlags="--strip-debug $extraLDFlags"
3737-3838- export NIX_EXTRA_CFLAGS=$extraCFlags
3939- for i in $extraLDFlags; do
4040- export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i"
4141- done
4242-4343- if test -n "$targetConfig"; then
4444- if test -z "$crossStageStatic"; then
4545- extraXCFlags="-B${libcCross}/lib -idirafter ${libcCross}/include"
4646- extraXLDFlags="-L${libcCross}/lib"
4747- export NIX_EXTRA_CFLAGS_TARGET=$extraXCFlags
4848- for i in $extraXLDFlags; do
4949- export NIX_EXTRA_LDFLAGS_TARGET="$NIX_EXTRA_LDFLAGS_TARGET -Wl,$i"
5050- done
5151- fi
5252-5353- makeFlagsArray=( \
5454- "${makeFlagsArray[@]}" \
5555- NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
5656- SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
5757- CFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET" \
5858- LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET" \
5959- )
6060- else
6161- export NIX_EXTRA_CFLAGS_TARGET=$NIX_EXTRA_CFLAGS
6262- export NIX_EXTRA_LDFLAGS_TARGET=$NIX_EXTRA_LDFLAGS
6363- makeFlagsArray=( \
6464- "${makeFlagsArray[@]}" \
6565- NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
6666- SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
6767- CFLAGS_FOR_BUILD="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
6868- CFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
6969- LDFLAGS_FOR_BUILD="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
7070- LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
7171- )
7272- fi
7373-7474- if test -n "$targetConfig" -a "$crossStageStatic" == 1; then
7575- # We don't want the gcc build to assume there will be a libc providing
7676- # limits.h in this stagae
7777- makeFlagsArray=( \
7878- "${makeFlagsArray[@]}" \
7979- LIMITS_H_TEST=false \
8080- )
8181- else
8282- makeFlagsArray=( \
8383- "${makeFlagsArray[@]}" \
8484- LIMITS_H_TEST=true \
8585- )
8686- fi
8787-fi
8888-8989-if test -n "$targetConfig"; then
9090- # The host strip will destroy everything in the target binaries otherwise
9191- dontStrip=1
9292-fi
9393-9494-preConfigure() {
9595- # Perform the build in a different directory.
9696- mkdir ../build
9797- cd ../build
9898- configureScript=../$sourceRoot/configure
9999-}
100100-101101-102102-postInstall() {
103103- # Remove precompiled headers for now. They are very big and
104104- # probably not very useful yet.
105105- find $out/include -name "*.gch" -exec rm -rf {} \; -prune
106106-107107- # Remove `fixincl' to prevent a retained dependency on the
108108- # previous gcc.
109109- rm -rf $out/libexec/gcc/*/*/install-tools
110110- rm -rf $out/lib/gcc/*/*/install-tools
111111-112112- # Get rid of some "fixed" header files
113113- rm -rf $out/lib/gcc/*/*/include/root
114114-115115- # Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks.
116116- for i in $out/bin/*-gcc*; do
117117- if cmp -s $out/bin/gcc $i; then
118118- ln -sfn gcc $i
119119- fi
120120- done
121121-122122- for i in $out/bin/*-c++* $out/bin/*-g++*; do
123123- if cmp -s $out/bin/g++ $i; then
124124- ln -sfn g++ $i
125125- fi
126126- done
127127-128128- eval "$postInstallGhdl"
129129-}
130130-131131-132132-if test -z "$targetConfig"; then
133133- if test -z "$profiledCompiler"; then
134134- buildFlags="bootstrap $buildFlags"
135135- else
136136- buildFlags="profiledbootstrap $buildFlags"
137137- fi
138138-else
139139-:
140140-# buildFlags="all-gcc all-target-libgcc $buildFlags"
141141-# installTargets="install-gcc install-target-libgcc"
142142-fi
143143-144144-genericBuild
···11-diff -ru gcc-4.3.1-orig/libgfortran/configure gcc-4.3.1/libgfortran/configure
22---- gcc-4.3.1-orig/libgfortran/configure 2008-06-06 16:49:11.000000000 +0200
33-+++ gcc-4.3.1/libgfortran/configure 2008-06-27 08:25:08.000000000 +0200
44-@@ -35405,6 +35405,11 @@
55- # A language specific compiler.
66- CC=$lt_compiler
77-88-+# Ugly hack to get libmudflap (and possibly other libraries) to build.
99-+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
1010-+# to Glibc gets lost. Here we forcibly add it to any invocation.
1111-+CC="\$CC $NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS"
1212-+
1313- # Is the compiler the GNU compiler?
1414- with_gcc=$GCC
1515-
···11-source $stdenv/setup
22-33-44-export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
55-mkdir $NIX_FIXINC_DUMMY
66-77-88-# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
99-# Thing.
1010-export CPP="gcc -E"
1111-1212-if test "$staticCompiler" = "1"; then
1313- EXTRA_LDFLAGS="-static"
1414-else
1515- EXTRA_LDFLAGS=""
1616-fi
1717-1818-if test "$noSysDirs" = "1"; then
1919-2020- if test -e $NIX_CC/nix-support/orig-libc; then
2121-2222- # Figure out what extra flags to pass to the gcc compilers
2323- # being generated to make sure that they use our glibc.
2424- extraFlags="$(cat $NIX_CC/nix-support/libc-cflags)"
2525- extraLDFlags="$(cat $NIX_CC/nix-support/libc-ldflags) $(cat $NIX_CC/nix-support/libc-ldflags-before)"
2626-2727- # Use *real* header files, otherwise a limits.h is generated
2828- # that does not include Glibc's limits.h (notably missing
2929- # SSIZE_MAX, which breaks the build).
3030- export NIX_FIXINC_DUMMY=$(cat $NIX_CC/nix-support/orig-libc)/include
3131-3232- # The path to the Glibc binaries such as `crti.o'.
3333- glibc_libdir="$(cat $NIX_CC/nix-support/orig-libc)/lib"
3434-3535- else
3636- # Hack: support impure environments.
3737- extraFlags="-isystem /usr/include"
3838- extraLDFlags="-L/usr/lib64 -L/usr/lib"
3939- glibc_libdir="/usr/lib"
4040- export NIX_FIXINC_DUMMY=/usr/include
4141- fi
4242-4343- extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY $extraFlags"
4444- extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
4545-4646- EXTRA_FLAGS="$extraFlags"
4747- for i in $extraLDFlags; do
4848- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,$i"
4949- done
5050-5151- if test -n "$targetConfig"; then
5252- # Cross-compiling, we need gcc not to read ./specs in order to build
5353- # the g++ compiler (after the specs for the cross-gcc are created).
5454- # Having LIBRARY_PATH= makes gcc read the specs from ., and the build
5555- # breaks. Having this variable comes from the default.nix code to bring
5656- # gcj in.
5757- unset LIBRARY_PATH
5858- unset CPATH
5959- if test -z "$crossStageStatic"; then
6060- EXTRA_FLAGS_TARGET="-g0 -O2 -B${libcCross}/lib -idirafter ${libcCross}/include"
6161- EXTRA_LDFLAGS_TARGET="-Wl,-L${libcCross}/lib"
6262- fi
6363- else
6464- if test -z "$NIX_CC_CROSS"; then
6565- EXTRA_FLAGS_TARGET="$EXTRA_FLAGS"
6666- EXTRA_LDFLAGS_TARGET="$EXTRA_LDFLAGS"
6767- else
6868- # This the case of cross-building the gcc.
6969- # We need special flags for the target, different than those of the build
7070- # Assertion:
7171- test -e $NIX_CC_CROSS/nix-support/orig-libc
7272-7373- # Figure out what extra flags to pass to the gcc compilers
7474- # being generated to make sure that they use our glibc.
7575- extraFlags="$(cat $NIX_CC_CROSS/nix-support/libc-cflags)"
7676- extraLDFlags="$(cat $NIX_CC_CROSS/nix-support/libc-ldflags) $(cat $NIX_CC_CROSS/nix-support/libc-ldflags-before)"
7777-7878- # Use *real* header files, otherwise a limits.h is generated
7979- # that does not include Glibc's limits.h (notably missing
8080- # SSIZE_MAX, which breaks the build).
8181- NIX_FIXINC_DUMMY_CROSS=$(cat $NIX_CC_CROSS/nix-support/orig-libc)/include
8282-8383- # The path to the Glibc binaries such as `crti.o'.
8484- glibc_libdir="$(cat $NIX_CC_CROSS/nix-support/orig-libc)/lib"
8585-8686- extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY_CROSS $extraFlags"
8787- extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
8888-8989- EXTRA_FLAGS_TARGET="$extraFlags"
9090- for i in $extraLDFlags; do
9191- EXTRA_LDFLAGS_TARGET="$EXTRA_LDFLAGS_TARGET -Wl,$i"
9292- done
9393- fi
9494- fi
9595-9696-9797- # CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find
9898- # the startfiles.
9999- # FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx
100100- # for the startfiles.
101101- makeFlagsArray=( \
102102- "${makeFlagsArray[@]}" \
103103- NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
104104- SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
105105- CFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
106106- CFLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
107107- FLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
108108- LDFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
109109- LDFLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
110110- )
111111-112112- if test -z "$targetConfig"; then
113113- makeFlagsArray=( \
114114- "${makeFlagsArray[@]}" \
115115- BOOT_CFLAGS="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
116116- BOOT_LDFLAGS="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
117117- )
118118- fi
119119-120120- if test -n "$targetConfig" -a "$crossStageStatic" == 1; then
121121- # We don't want the gcc build to assume there will be a libc providing
122122- # limits.h in this stagae
123123- makeFlagsArray=( \
124124- "${makeFlagsArray[@]}" \
125125- LIMITS_H_TEST=false \
126126- )
127127- else
128128- makeFlagsArray=( \
129129- "${makeFlagsArray[@]}" \
130130- LIMITS_H_TEST=true \
131131- )
132132- fi
133133-fi
134134-135135-if test -n "$targetConfig"; then
136136- # The host strip will destroy some important details of the objects
137137- dontStrip=1
138138-fi
139139-140140-preConfigure() {
141141- if test -n "$newlibSrc"; then
142142- tar xvf "$newlibSrc" -C ..
143143- ln -s ../newlib-*/newlib newlib
144144- # Patch to get armvt5el working:
145145- sed -i -e 's/ arm)/ arm*)/' newlib/configure.host
146146- fi
147147- # Bug - they packaged zlib
148148- if test -d "zlib"; then
149149- # This breaks the build without-headers, which should build only
150150- # the target libgcc as target libraries.
151151- # See 'configure:5370'
152152- rm -Rf zlib
153153- fi
154154-155155- # Perform the build in a different directory.
156156- mkdir ../build
157157- cd ../build
158158- configureScript=../$sourceRoot/configure
159159-}
160160-161161-162162-postInstall() {
163163- # Remove precompiled headers for now. They are very big and
164164- # probably not very useful yet.
165165- find $out/include -name "*.gch" -exec rm -rf {} \; -prune
166166-167167- # Remove `fixincl' to prevent a retained dependency on the
168168- # previous gcc.
169169- rm -rf $out/libexec/gcc/*/*/install-tools
170170- rm -rf $out/lib/gcc/*/*/install-tools
171171-172172- # Get rid of some "fixed" header files
173173- rm -rf $out/lib/gcc/*/*/include/root
174174-175175- # Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks.
176176- for i in $out/bin/*-gcc*; do
177177- if cmp -s $out/bin/gcc $i; then
178178- ln -sfn gcc $i
179179- fi
180180- done
181181-182182- for i in $out/bin/*-c++* $out/bin/*-g++*; do
183183- if cmp -s $out/bin/g++ $i; then
184184- ln -sfn g++ $i
185185- fi
186186- done
187187-188188- eval "$postInstallGhdl"
189189-}
190190-191191-192192-if test -z "$targetConfig" && test -z "$crossConfig"; then
193193- if test -z "$profiledCompiler"; then
194194- buildFlags="bootstrap $buildFlags"
195195- else
196196- buildFlags="profiledbootstrap $buildFlags"
197197- fi
198198-fi
199199-200200-genericBuild
-310
pkgs/development/compilers/gcc/4.4/default.nix
···11-{ stdenv, fetchurl, noSysDirs
22-, langC ? true, langCC ? true, langFortran ? false
33-, langJava ? false
44-, langAda ? false
55-, langVhdl ? false
66-, profiledCompiler ? false
77-, staticCompiler ? false
88-, enableShared ? true
99-, texinfo ? null
1010-, gmp, mpfr, gettext, which
1111-, ppl ? null, cloogppl ? null # used by the Graphite optimization framework
1212-, zlib ? null, boehmgc ? null
1313-, zip ? null, unzip ? null, pkgconfig ? null, gtk ? null, libart_lgpl ? null
1414-, libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
1515-, libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null
1616-, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
1717-, gnatboot ? null
1818-, enableMultilib ? false
1919-, name ? "gcc"
2020-, cross ? null
2121-, binutilsCross ? null
2222-, libcCross ? null
2323-, crossStageStatic ? true
2424-, gnat ? null
2525-}:
2626-2727-assert langJava -> zip != null && unzip != null
2828- && zlib != null && boehmgc != null;
2929-assert langAda -> gnatboot != null;
3030-assert langVhdl -> gnat != null;
3131-3232-with stdenv.lib;
3333-3434-let version = "4.4.7";
3535- javaEcj = fetchurl {
3636- # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
3737- # `configure' time.
3838-3939- # XXX: Eventually we might want to take it from upstream.
4040- url = "ftp://sourceware.org/pub/java/ecj-4.3.jar";
4141- sha256 = "0jz7hvc0s6iydmhgh5h2m15yza7p2rlss2vkif30vm9y77m97qcx";
4242- };
4343-4444- # Antlr (optional) allows the Java `gjdoc' tool to be built. We want a
4545- # binary distribution here to allow the whole chain to be bootstrapped.
4646- javaAntlr = fetchurl {
4747- url = http://www.antlr.org/download/antlr-3.1.3.jar;
4848- sha256 = "1f41j0y4kjydl71lqlvr73yagrs2jsg1fjymzjz66mjy7al5lh09";
4949- };
5050-5151- xlibs = [
5252- libX11 libXt libSM libICE libXtst libXrender libXrandr libXi
5353- xproto renderproto xextproto inputproto randrproto
5454- ];
5555-5656- javaAwtGtk = langJava && gtk != null;
5757-5858- /* Cross-gcc settings */
5959- gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
6060- gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
6161- gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
6262- withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
6363- withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
6464- withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
6565-6666- crossConfigureFlags =
6767- "--target=${cross.config}" +
6868- withArch +
6969- withCpu +
7070- withAbi +
7171- (if crossStageStatic then
7272- " --disable-libssp --disable-nls" +
7373- " --without-headers" +
7474- " --disable-threads " +
7575- " --disable-libmudflap " +
7676- " --disable-libgomp " +
7777- " --disable-shared" +
7878- " --disable-decimal-float" # libdecnumber requires libc
7979- else
8080- " --with-headers=${libcCross}/include" +
8181- " --enable-__cxa_atexit" +
8282- " --enable-long-long" +
8383- " --enable-threads=posix" +
8484- " --enable-nls" +
8585- " --disable-decimal-float" # No final libdecnumber (it may work only in 386)
8686- );
8787- stageNameAddon = if crossStageStatic then "-stage-static" else
8888- "-stage-final";
8989- crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
9090-9191-in
9292-9393-# We need all these X libraries when building AWT with GTK+.
9494-assert gtk != null -> (filter (x: x == null) xlibs) == [];
9595-9696-stdenv.mkDerivation ({
9797- name = "${name}-${version}" + crossNameAddon;
9898-9999- builder = ./builder.sh;
100100-101101- src = (import ./sources.nix) {
102102- inherit fetchurl optional version;
103103- inherit langC langCC langFortran langJava langAda;
104104- };
105105-106106- patches =
107107- [ ./pass-cxxcpp.patch
108108-109109- # libmudflap and libstdc++ receive the build CPP,
110110- # and not the target.
111111- # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42279
112112- ./target-cpp.patch
113113-114114- # Bad mixture of build/target flags
115115- ./libstdc++-target.patch
116116-117117- # Compatibility with newer Glibc.
118118- ./siginfo_t_fix.patch
119119- ]
120120- ++ optional noSysDirs ./no-sys-dirs.patch
121121- # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
122122- # target libraries and tools.
123123- ++ optional langAda ./gnat-cflags.patch
124124- ++ optional langVhdl ./ghdl-ortho-cflags.patch
125125- ++ optional (cross != null && cross.arch == "sparc64") ./pr41818.patch;
126126-127127- inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
128128- libcCross;
129129-130130- nativeBuildInputs = [ texinfo which ];
131131-132132- buildInputs = [ gmp mpfr gettext ]
133133- ++ (optional (ppl != null) ppl)
134134- ++ (optional (cloogppl != null) cloogppl)
135135- ++ (optional (zlib != null) zlib)
136136- ++ (optional (boehmgc != null) boehmgc)
137137- ++ (optionals langJava [zip unzip])
138138- ++ (optionals javaAwtGtk ([gtk pkgconfig libart_lgpl] ++ xlibs))
139139- ++ (optionals (cross != null) [binutilsCross])
140140- ++ (optionals langAda [gnatboot])
141141- ++ (optionals langVhdl [gnat])
142142- ;
143143-144144- configureFlags = "
145145- ${if enableMultilib then "" else "--disable-multilib"}
146146- ${if enableShared then "" else "--disable-shared"}
147147- ${if ppl != null then "--with-ppl=${ppl}" else ""}
148148- ${if cloogppl != null then "--with-cloog=${cloogppl}" else ""}
149149- ${if langJava then "--with-ecj-jar=${javaEcj}" else ""}
150150- ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
151151- ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
152152- --with-gmp=${gmp}
153153- --with-mpfr=${mpfr}
154154- --disable-libstdcxx-pch
155155- --without-included-gettext
156156- --with-system-zlib
157157- --enable-languages=${
158158- concatStrings (intersperse ","
159159- ( optional langC "c"
160160- ++ optional langCC "c++"
161161- ++ optional langFortran "fortran"
162162- ++ optional langJava "java"
163163- ++ optional langAda "ada"
164164- ++ optional langVhdl "vhdl"
165165- )
166166- )
167167- }
168168- ${if langAda then " --enable-libada" else ""}
169169- ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
170170- ${if cross != null then crossConfigureFlags else ""}
171171- ";
172172-173173- targetConfig = if cross != null then cross.config else null;
174174-175175- # Needed for the cross compilation to work
176176- AR = "ar";
177177- LD = "ld";
178178- CC = "gcc";
179179-180180- crossAttrs = {
181181- AR = "${stdenv.cross.config}-ar";
182182- LD = "${stdenv.cross.config}-ld";
183183- CC = "${stdenv.cross.config}-gcc";
184184- CXX = "${stdenv.cross.config}-gcc";
185185- AR_FOR_TARGET = "${stdenv.cross.config}-ar";
186186- LD_FOR_TARGET = "${stdenv.cross.config}-ld";
187187- CC_FOR_TARGET = "${stdenv.cross.config}-gcc";
188188- NM_FOR_TARGET = "${stdenv.cross.config}-nm";
189189- CXX_FOR_TARGET = "${stdenv.cross.config}-g++";
190190- # If we are making a cross compiler, cross != null
191191- NIX_CC_CROSS = if cross == null then "${stdenv.ccCross}" else "";
192192- configureFlags = "
193193- ${if enableMultilib then "" else "--disable-multilib"}
194194- ${if enableShared then "" else "--disable-shared"}
195195- ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
196196- ${if cloogppl != null then "--with-cloog=${cloogppl.crossDrv}" else ""}
197197- ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
198198- ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
199199- ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
200200- --with-gmp=${gmp.crossDrv}
201201- --with-mpfr=${mpfr.crossDrv}
202202- --disable-libstdcxx-pch
203203- --without-included-gettext
204204- --with-system-zlib
205205- --enable-languages=${
206206- concatStrings (intersperse ","
207207- ( optional langC "c"
208208- ++ optional langCC "c++"
209209- ++ optional langFortran "fortran"
210210- ++ optional langJava "java"
211211- ++ optional langAda "ada"
212212- ++ optional langVhdl "vhdl"
213213- )
214214- )
215215- }
216216- ${if langAda then " --enable-libada" else ""}
217217- ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
218218- ${if cross != null then crossConfigureFlags else ""}
219219- --target=${stdenv.cross.config}
220220- ";
221221- };
222222-223223- # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find
224224- # the library headers and binaries, regarless of the language being
225225- # compiled.
226226-227227- # Note: When building the Java AWT GTK+ peer, the build system doesn't
228228- # honor `--with-gmp' et al., e.g., when building
229229- # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just
230230- # add them to $CPATH and $LIBRARY_PATH in this case.
231231-232232- CPATH = concatStrings
233233- (intersperse ":" (map (x: x + "/include")
234234- (optionals langJava [ boehmgc zlib ]
235235- ++ optionals javaAwtGtk xlibs
236236- ++ optionals javaAwtGtk [ gmp mpfr ])));
237237-238238- LIBRARY_PATH = concatStrings
239239- (intersperse ":" (map (x: x + "/lib")
240240- (optionals langJava [ boehmgc zlib ]
241241- ++ optionals javaAwtGtk xlibs
242242- ++ optionals javaAwtGtk [ gmp mpfr ])));
243243-244244-245245- passthru = { inherit langC langCC langAda langFortran langVhdl
246246- enableMultilib version; isGNU = true; };
247247-248248- # ghdl does not build fine with parallel building
249249- # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46173
250250- #enableParallelBuilding = !langVhdl && !langAda;
251251-252252- meta = {
253253- homepage = http://gcc.gnu.org/;
254254- license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
255255- description = "GNU Compiler Collection, version ${version}";
256256-257257- longDescription = ''
258258- The GNU Compiler Collection includes compiler front ends for C, C++,
259259- Objective-C, Fortran, OpenMP for C/C++/Fortran, Java, and Ada, as well
260260- as libraries for these languages (libstdc++, libgcj, libgomp,...).
261261-262262- GCC development is a part of the GNU Project, aiming to improve the
263263- compiler used in the GNU system including the GNU/Linux variant.
264264- '';
265265-266266- maintainers = [
267267- # Add your name here!
268268- stdenv.lib.maintainers.viric
269269- ];
270270-271271- # Volunteers needed for the {Cyg,Dar}win ports of *PPL.
272272- # gnatboot is not available out of linux platforms, so we disable the darwin build
273273- # for the gnat (ada compiler).
274274- platforms = stdenv.lib.platforms.linux ++ optionals (langAda == false) [ "i686-darwin" ];
275275- };
276276-}
277277-// (if langVhdl then rec {
278278- name = "ghdl-0.29";
279279-280280- ghdlSrc = fetchurl {
281281- url = "http://ghdl.free.fr/ghdl-0.29.tar.bz2";
282282- sha256 = "15mlinr1lwljwll9ampzcfcrk9bk0qpdks1kxlvb70xf9zhh2jva";
283283- };
284284-285285- # Ghdl has some timestamps checks, storing file timestamps in '.cf' files.
286286- # As we will change the timestamps to 1970-01-01 00:00:01, we also set the
287287- # content of that .cf to that value. This way ghdl does not complain on
288288- # the installed object files from the basic libraries (ieee, ...)
289289- postInstallGhdl = ''
290290- pushd $out
291291- find . -name "*.cf" -exec \
292292- sed 's/[0-9]*\.000" /19700101000001.000" /g' -i {} \;
293293- popd
294294- '';
295295-296296- postUnpack = ''
297297- tar xvf ${ghdlSrc}
298298- mv ghdl-*/vhdl gcc*/gcc
299299- rm -Rf ghdl-*
300300- '';
301301-302302- meta = {
303303- homepage = "http://ghdl.free.fr/";
304304- license = stdenv.lib.licenses.gpl2Plus;
305305- description = "Complete VHDL simulator, using the GCC technology (gcc ${version})";
306306- maintainers = with stdenv.lib.maintainers; [viric];
307307- platforms = with stdenv.lib.platforms; linux;
308308- };
309309-310310-} else {}))
···11-diff --git a/libada/Makefile.in b/libada/Makefile.in
22-index f5057a0..337e0c6 100644
33---- a/libada/Makefile.in
44-+++ b/libada/Makefile.in
55-@@ -55,7 +55,7 @@ GCC_WARN_CFLAGS = $(LOOSE_WARN)
66- WARN_CFLAGS = @warn_cflags@
77-88- TARGET_LIBGCC2_CFLAGS=
99--GNATLIBCFLAGS= -g -O2
1010-+GNATLIBCFLAGS= -g -O2 $(CFLAGS)
1111- GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
1212- -DIN_RTS @have_getipinfo@
1313-1414---- a/gcc/ada/gcc-interface/Makefile.in
1515-+++ b/gcc/ada/gcc-interface/Makefile.in
1616-@@ -105,7 +105,7 @@ ADAFLAGS = -W -Wall -gnatpg -gnata
1717- SOME_ADAFLAGS =-gnata
1818- FORCE_DEBUG_ADAFLAGS = -g
1919- GNATLIBFLAGS = -gnatpg -nostdinc
2020--GNATLIBCFLAGS = -g -O2
2121-+GNATLIBCFLAGS = -g -O2 $(CFLAGS_FOR_TARGET)
2222- # Pretend that _Unwind_GetIPInfo is available for the target by default. This
2323- # should be autodetected during the configuration of libada and passed down to
2424- # here, but we need something for --disable-libada and hope for the best.
2525-@@ -1838,7 +1838,7 @@ ADA_INCLUDE_SRCS =\
2626-2727- LIBGNAT=../$(RTSDIR)/libgnat.a
2828-2929--GCC_LINK=$(CC) -static-libgcc $(ADA_INCLUDES)
3030-+GCC_LINK=$(CC) -static-libgcc $(CFLAGS_FOR_TARGET) $(ADA_INCLUDES)
3131-3232- # when compiling the tools, the runtime has to be first on the path so that
3333- # it hides the runtime files lying with the rest of the sources