gcc: Misc indentation and whitespace-in-string fixes

This commit is contained in:
John Ericson 2017-11-14 18:32:50 -05:00
parent 1c1207220f
commit ab77a6bb1e
7 changed files with 398 additions and 394 deletions

View file

@ -74,8 +74,8 @@ let version = "4.5.4";
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
optional (gccAbi != null) "--with-abi=${gccAbi}" ++ optional (gccAbi != null) "--with-abi=${gccAbi}" ++
# Ensure that -print-prog-name is able to find the correct programs. # Ensure that -print-prog-name is able to find the correct programs.
[ " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
" --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
(if crossMingw && crossStageStatic then [ (if crossMingw && crossStageStatic then [
"--with-headers=${libcCross}/include" "--with-headers=${libcCross}/include"
"--with-gcc" "--with-gcc"
@ -88,19 +88,21 @@ let version = "4.5.4";
"--enable-sjlj-exceptions" "--enable-sjlj-exceptions"
"--enable-threads=win32" "--enable-threads=win32"
"--disable-win32-registry" "--disable-win32-registry"
] else if crossStageStatic then [ ] else if crossStageStatic then [
"--disable-libssp --disable-nls" "--disable-libssp"
"--disable-nls"
"--without-headers" "--without-headers"
"--disable-threads" "--disable-threads"
"--disable-libmudflap" "--disable-libmudflap"
"--disable-libgomp " "--disable-libgomp"
"--disable-shared" "--disable-shared"
"--disable-decimal-float" # libdecnumber requires libc "--disable-decimal-float" # libdecnumber requires libc
] else [ ] else [
"--with-headers=${libcCross}/include" "--with-headers=${libcCross}/include"
"--enable-__cxa_atexit" "--enable-__cxa_atexit"
"--enable-long-long" "--enable-long-long"
] ++ (if crossMingw then [ ] ++
(if crossMingw then [
"--enable-threads=win32" "--enable-threads=win32"
"--enable-sjlj-exceptions" "--enable-sjlj-exceptions"
"--enable-hash-synchronization" "--enable-hash-synchronization"
@ -108,12 +110,11 @@ let version = "4.5.4";
"--disable-libssp" "--disable-libssp"
"--disable-nls" "--disable-nls"
"--with-dwarf2" "--with-dwarf2"
] else [ ] else [
"--enable-threads=posix" "--enable-threads=posix"
"--enable-nls" "--enable-nls"
"--disable-decimal-float" "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
]) # No final libdecnumber (it may work only in 386) ]));
);
stageNameAddon = if crossStageStatic then "-stage-static" else stageNameAddon = if crossStageStatic then "-stage-static" else
"-stage-final"; "-stage-final";
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
@ -274,11 +275,12 @@ stdenv.mkDerivation ({
# Java options # Java options
optionals langJava [ optionals langJava [
"--with-ecj-jar=${javaEcj} " "--with-ecj-jar=${javaEcj}"
# Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See
# <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>. # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
"--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " "--enable-java-home"
"--with-java-home=\${prefix}/lib/jvm/jre"
] ++ ] ++
optional javaAwtGtk "--enable-java-awt=gtk" ++ optional javaAwtGtk "--enable-java-awt=gtk" ++
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++

View file

@ -123,68 +123,66 @@ let version = "4.8.5";
optional (gccFloat != null) "--with-float=${gccFloat}" ++ optional (gccFloat != null) "--with-float=${gccFloat}" ++
optional (gccMode != null) "--with-mode=${gccMode}"; optional (gccMode != null) "--with-mode=${gccMode}";
/* Cross-gcc settings (build == host != target) */
/* Cross-gcc settings (build == host != target) */ /* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
crossConfigureFlags = crossConfigureFlags =
mkPlatformFlags targetPlatform ++ mkPlatformFlags targetPlatform ++
# Ensure that -print-prog-name is able to find the correct programs. # Ensure that -print-prog-name is able to find the correct programs.
[ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
"--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
(if crossMingw && crossStageStatic then (if crossMingw && crossStageStatic then [
[ "--with-headers=${libcCross}/include" "--with-headers=${libcCross}/include"
"--with-gcc" "--with-gcc"
"--with-gnu-as" "--with-gnu-as"
"--with-gnu-ld" "--with-gnu-ld"
"--with-gnu-ld" "--with-gnu-ld"
"--disable-shared" "--disable-shared"
"--disable-nls" "--disable-nls"
"--disable-debug" "--disable-debug"
"--enable-sjlj-exceptions" "--enable-sjlj-exceptions"
"--enable-threads=win32" "--enable-threads=win32"
"--disable-win32-registry" "--disable-win32-registry"
] else if crossStageStatic then ] else if crossStageStatic then [
[ "--disable-libssp --disable-nls" "--disable-libssp"
"--without-headers" "--disable-nls"
"--disable-threads " "--without-headers"
"--disable-libgomp " "--disable-threads"
"--disable-libquadmath" "--disable-libgomp"
"--disable-shared" "--disable-libquadmath"
"--disable-libatomic " # libatomic requires libc "--disable-shared"
"--disable-decimal-float" # libdecnumber requires libc "--disable-libatomic" # libatomic requires libc
] else "--disable-decimal-float" # libdecnumber requires libc
(if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] ] else [
else ["--with-headers=${getDev libcCross}/include"]) ++ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
[ "--enable-__cxa_atexit" else "--with-headers=${getDev libcCross}/include")
"--enable-long-long" "--enable-__cxa_atexit"
] ++ "--enable-long-long"
(if crossMingw then [ ] ++
"--enable-threads=win32" (if crossMingw then [
"--enable-sjlj-exceptions" "--enable-threads=win32"
"--enable-hash-synchronization" "--enable-sjlj-exceptions"
"--disable-libssp" "--enable-hash-synchronization"
"--disable-nls" "--disable-libssp"
"--with-dwarf2" "--disable-nls"
# I think noone uses shared gcc libs in mingw, so we better do the same. "--with-dwarf2"
# In any case, mingw32 g++ linking is broken by default with shared libs, # I think noone uses shared gcc libs in mingw, so we better do the same.
# unless adding "-lsupc++" to any linking command. I don't know why. # In any case, mingw32 g++ linking is broken by default with shared libs,
"--disable-shared" # unless adding "-lsupc++" to any linking command. I don't know why.
# To keep ABI compatibility with upstream mingw-w64 "--disable-shared"
"--enable-fully-dynamic-string" # To keep ABI compatibility with upstream mingw-w64
] else "--enable-fully-dynamic-string"
optionals (targetPlatform.libc == "uclibc") [ ] else
# In uclibc cases, libgomp needs an additional '-ldl' optionals (targetPlatform.libc == "uclibc") [
# and as I don't know how to pass it, I disable libgomp. # In uclibc cases, libgomp needs an additional '-ldl'
"--disable-libgomp" # and as I don't know how to pass it, I disable libgomp.
] ++ "--disable-libgomp"
[ "--enable-threads=posix" ] ++ [
"--enable-nls" "--enable-threads=posix"
"--disable-decimal-float" # No final libdecnumber (it may work only in 386) "--enable-nls"
] "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
) ]));
);
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
@ -347,7 +345,11 @@ stdenv.mkDerivation ({
# Optional features # Optional features
optional (isl != null) "--with-isl=${isl}" ++ optional (isl != null) "--with-isl=${isl}" ++
optional (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl" ++ optionals (cloog != null) [
"--with-cloog=${cloog}"
"--disable-cloog-version-check"
"--enable-cloog-backend=isl"
] ++
(if enableMultilib (if enableMultilib
then ["--enable-multilib" "--disable-libquadmath"] then ["--enable-multilib" "--disable-libquadmath"]
@ -359,11 +361,12 @@ stdenv.mkDerivation ({
# Java options # Java options
optionals langJava [ optionals langJava [
"--with-ecj-jar=${javaEcj} " "--with-ecj-jar=${javaEcj}"
# Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See
# <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>. # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
"--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " "--enable-java-home"
"--with-java-home=\${prefix}/lib/jvm/jre"
] ++ ] ++
optional javaAwtGtk "--enable-java-awt=gtk" ++ optional javaAwtGtk "--enable-java-awt=gtk" ++
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
@ -386,9 +389,9 @@ stdenv.mkDerivation ({
# Platform-specific flags # Platform-specific flags
optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
optionals hostPlatform.isSunOS [ optionals hostPlatform.isSunOS [
"--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit"
# On Illumos/Solaris GNU as is preferred # On Illumos/Solaris GNU as is preferred
"--with-gnu-as --without-gnu-ld" "--with-gnu-as" "--without-gnu-ld"
] ]
; ;

View file

@ -118,67 +118,65 @@ let version = "4.9.4";
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
crossConfigureFlags = crossConfigureFlags =
mkPlatformFlags targetPlatform ++ mkPlatformFlags targetPlatform ++
# Ensure that -print-prog-name is able to find the correct programs. # Ensure that -print-prog-name is able to find the correct programs.
[ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
"--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
(if crossMingw && crossStageStatic then (if crossMingw && crossStageStatic then [
[ "--with-headers=${libcCross}/include" "--with-headers=${libcCross}/include"
"--with-gcc" "--with-gcc"
"--with-gnu-as" "--with-gnu-as"
"--with-gnu-ld" "--with-gnu-ld"
"--with-gnu-ld" "--with-gnu-ld"
"--disable-shared" "--disable-shared"
"--disable-nls" "--disable-nls"
"--disable-debug" "--disable-debug"
"--enable-sjlj-exceptions" "--enable-sjlj-exceptions"
"--enable-threads=win32" "--enable-threads=win32"
"--disable-win32-registry" "--disable-win32-registry"
] else if crossStageStatic then ] else if crossStageStatic then [
[ "--disable-libssp" "--disable-libssp"
"--disable-nls" "--disable-nls"
"--without-headers" "--without-headers"
"--disable-threads " "--disable-threads"
"--disable-libgomp " "--disable-libgomp"
"--disable-libquadmath" "--disable-libquadmath"
"--disable-shared" "--disable-shared"
"--disable-libatomic " # libatomic requires libc "--disable-libatomic" # libatomic requires libc
"--disable-decimal-float" # libdecnumber requires libc "--disable-decimal-float" # libdecnumber requires libc
] else ] else [
(if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
else ["--with-headers=${getDev libcCross}/include"]) ++ else "--with-headers=${getDev libcCross}/include")
[ "--enable-__cxa_atexit" "--enable-__cxa_atexit"
"--enable-long-long" "--enable-long-long"
] ++ ] ++
(if crossMingw then [
(if crossMingw then [ "--enable-threads=win32"
"--enable-threads=win32" "--enable-sjlj-exceptions"
"--enable-sjlj-exceptions" "--enable-hash-synchronization"
"--enable-hash-synchronization" "--disable-libssp"
"--disable-libssp" "--disable-nls"
"--disable-nls" "--with-dwarf2"
"--with-dwarf2" # I think noone uses shared gcc libs in mingw, so we better do the same.
# I think noone uses shared gcc libs in mingw, so we better do the same. # In any case, mingw32 g++ linking is broken by default with shared libs,
# In any case, mingw32 g++ linking is broken by default with shared libs, # unless adding "-lsupc++" to any linking command. I don't know why.
# unless adding "-lsupc++" to any linking command. I don't know why. "--disable-shared"
"--disable-shared" # To keep ABI compatibility with upstream mingw-w64
# To keep ABI compatibility with upstream mingw-w64 "--enable-fully-dynamic-string"
"--enable-fully-dynamic-string" ] else
] else optionals (targetPlatform.libc == "uclibc") [
optionals (targetPlatform.libc == "uclibc") [ # libsanitizer requires netrom/netrom.h which is not
# libsanitizer requires netrom/netrom.h which is not # available in uclibc.
# available in uclibc. "--disable-libsanitizer"
"--disable-libsanitizer" # In uclibc cases, libgomp needs an additional '-ldl'
# In uclibc cases, libgomp needs an additional '-ldl' # and as I don't know how to pass it, I disable libgomp.
# and as I don't know how to pass it, I disable libgomp. "--disable-libgomp"
"--disable-libgomp" ] ++ [
] ++ "--enable-threads=posix"
[ "--enable-threads=posix" "--enable-nls"
"--enable-nls" "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
"--disable-decimal-float" # No final libdecnumber (it may work only in 386) ]));
])
);
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
@ -353,15 +351,20 @@ stdenv.mkDerivation ({
# Optional features # Optional features
optional (isl != null) "--with-isl=${isl}" ++ optional (isl != null) "--with-isl=${isl}" ++
optional (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl" ++ optionals (cloog != null) [
"--with-cloog=${cloog}"
"--disable-cloog-version-check"
"--enable-cloog-backend=isl"
] ++
# Java options # Java options
optionals langJava [ optionals langJava [
"--with-ecj-jar=${javaEcj} " "--with-ecj-jar=${javaEcj}"
# Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See
# <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>. # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
"--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " "--enable-java-home"
"--with-java-home=\${prefix}/lib/jvm/jre"
] ++ ] ++
optional javaAwtGtk "--enable-java-awt=gtk" ++ optional javaAwtGtk "--enable-java-awt=gtk" ++
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
@ -384,9 +387,9 @@ stdenv.mkDerivation ({
# Platform-specific flags # Platform-specific flags
optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
optionals hostPlatform.isSunOS [ optionals hostPlatform.isSunOS [
"--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit"
# On Illumos/Solaris GNU as is preferred # On Illumos/Solaris GNU as is preferred
"--with-gnu-as --without-gnu-ld" "--with-gnu-as" "--without-gnu-ld"
] ]
; ;
@ -427,7 +430,7 @@ stdenv.mkDerivation ({
optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++ optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++
optional javaAwtGtk "--enable-java-awt=gtk" ++ optional javaAwtGtk "--enable-java-awt=gtk" ++
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++
optional (cloog != null) "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" ++ optional (cloog != null) "--with-cloog=${cloog.crossDrv}" "--enable-cloog-backend=isl" ++
[ [
"--with-gmp=${gmp.crossDrv}" "--with-gmp=${gmp.crossDrv}"
"--with-mpfr=${mpfr.crossDrv}" "--with-mpfr=${mpfr.crossDrv}"

View file

@ -122,66 +122,65 @@ let version = "5.5.0";
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
crossConfigureFlags = crossConfigureFlags =
mkPlatformFlags targetPlatform ++ mkPlatformFlags targetPlatform ++
# Ensure that -print-prog-name is able to find the correct programs. # Ensure that -print-prog-name is able to find the correct programs.
[ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
"--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
(if crossMingw && crossStageStatic then (if crossMingw && crossStageStatic then [
[ "--with-headers=${libcCross}/include" "--with-headers=${libcCross}/include"
"--with-gcc" "--with-gcc"
"--with-gnu-as" "--with-gnu-as"
"--with-gnu-ld" "--with-gnu-ld"
"--with-gnu-ld" "--with-gnu-ld"
"--disable-shared" "--disable-shared"
"--disable-nls" "--disable-nls"
"--disable-debug" "--disable-debug"
"--enable-sjlj-exceptions" "--enable-sjlj-exceptions"
"--enable-threads=win32" "--enable-threads=win32"
"--disable-win32-registry" "--disable-win32-registry"
] else if crossStageStatic then ] else if crossStageStatic then [
[ "--disable-libssp --disable-nls" "--disable-libssp"
"--without-headers" "--disable-nls"
"--disable-threads " "--without-headers"
"--disable-libgomp " "--disable-threads"
"--disable-libquadmath" "--disable-libgomp"
"--disable-shared" "--disable-libquadmath"
"--disable-libatomic " # libatomic requires libc "--disable-shared"
"--disable-decimal-float" # libdecnumber requires libc "--disable-libatomic" # libatomic requires libc
] else "--disable-decimal-float" # libdecnumber requires libc
(if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] ] else [
else ["--with-headers=${getDev libcCross}/include"]) ++ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
[ "--enable-__cxa_atexit" else "--with-headers=${getDev libcCross}/include")
"--enable-long-long" "--enable-__cxa_atexit"
] ++ "--enable-long-long"
(if crossMingw then [ ] ++
"--enable-threads=win32" (if crossMingw then [
"--enable-sjlj-exceptions" "--enable-threads=win32"
"--enable-hash-synchronization" "--enable-sjlj-exceptions"
"--disable-libssp" "--enable-hash-synchronization"
"--disable-nls" "--disable-libssp"
"--with-dwarf2" "--disable-nls"
# I think noone uses shared gcc libs in mingw, so we better do the same. "--with-dwarf2"
# In any case, mingw32 g++ linking is broken by default with shared libs, # I think noone uses shared gcc libs in mingw, so we better do the same.
# unless adding "-lsupc++" to any linking command. I don't know why. # In any case, mingw32 g++ linking is broken by default with shared libs,
"--disable-shared" # unless adding "-lsupc++" to any linking command. I don't know why.
# To keep ABI compatibility with upstream mingw-w64 "--disable-shared"
"--enable-fully-dynamic-string" # To keep ABI compatibility with upstream mingw-w64
] else "--enable-fully-dynamic-string"
optionals (targetPlatform.libc == "uclibc") [ ] else
# libsanitizer requires netrom/netrom.h which is not optionals (targetPlatform.libc == "uclibc") [
# available in uclibc. # libsanitizer requires netrom/netrom.h which is not
"--disable-libsanitizer" # available in uclibc.
# In uclibc cases, libgomp needs an additional '-ldl' "--disable-libsanitizer"
# and as I don't know how to pass it, I disable libgomp. # In uclibc cases, libgomp needs an additional '-ldl'
"--disable-libgomp" # and as I don't know how to pass it, I disable libgomp.
] ++ "--disable-libgomp"
[ "--enable-threads=posix" ] ++ [
"--enable-nls" "--enable-threads=posix"
"--disable-decimal-float" # No final libdecnumber (it may work only in 386) "--enable-nls"
] "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
) ]));
);
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
@ -370,11 +369,12 @@ stdenv.mkDerivation ({
# Java options # Java options
optionals langJava [ optionals langJava [
"--with-ecj-jar=${javaEcj} " "--with-ecj-jar=${javaEcj}"
# Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See
# <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>. # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
"--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " "--enable-java-home"
"--with-java-home=\${prefix}/lib/jvm/jre"
] ++ ] ++
optional javaAwtGtk "--enable-java-awt=gtk" ++ optional javaAwtGtk "--enable-java-awt=gtk" ++
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
@ -397,9 +397,9 @@ stdenv.mkDerivation ({
# Platform-specific flags # Platform-specific flags
optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
optionals hostPlatform.isSunOS [ optionals hostPlatform.isSunOS [
"--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit"
# On Illumos/Solaris GNU as is preferred # On Illumos/Solaris GNU as is preferred
"--with-gnu-as --without-gnu-ld" "--with-gnu-as" "--without-gnu-ld"
] ]
; ;

View file

@ -119,67 +119,65 @@ let version = "6.4.0";
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
crossConfigureFlags = crossConfigureFlags =
mkPlatformFlags targetPlatform ++ mkPlatformFlags targetPlatform ++
# Ensure that -print-prog-name is able to find the correct programs. # Ensure that -print-prog-name is able to find the correct programs.
[ " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
" --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
(if crossMingw && crossStageStatic then (if crossMingw && crossStageStatic then [
[ "--with-headers=${libcCross}/include" "--with-headers=${libcCross}/include"
"--with-gcc" "--with-gcc"
"--with-gnu-as" "--with-gnu-as"
"--with-gnu-ld" "--with-gnu-ld"
"--with-gnu-ld" "--with-gnu-ld"
"--disable-shared" "--disable-shared"
"--disable-nls" "--disable-nls"
"--disable-debug" "--disable-debug"
"--enable-sjlj-exceptions" "--enable-sjlj-exceptions"
"--enable-threads=win32" "--enable-threads=win32"
"--disable-win32-registry" "--disable-win32-registry"
] else if crossStageStatic then [ ] else if crossStageStatic then [
"--disable-libssp" "--disable-libssp"
"--disable-nls" "--disable-nls"
"--without-headers" "--without-headers"
"--disable-threads" "--disable-threads"
"--disable-libgomp" "--disable-libgomp"
"--disable-libquadmath" "--disable-libquadmath"
"--disable-shared" "--disable-shared"
"--disable-libatomic" # libatomic requires libc "--disable-libatomic" # libatomic requires libc
"--disable-decimal-float" # libdecnumber requires libc "--disable-decimal-float" # libdecnumber requires libc
] else [
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
else "--with-headers=${getDev libcCross}/include")
"--enable-__cxa_atexit"
"--enable-long-long"
] ++
(if crossMingw then [
"--enable-threads=win32"
"--enable-sjlj-exceptions"
"--enable-hash-synchronization"
"--disable-libssp"
"--disable-nls"
"--with-dwarf2"
# I think noone uses shared gcc libs in mingw, so we better do the same.
# In any case, mingw32 g++ linking is broken by default with shared libs,
# unless adding "-lsupc++" to any linking command. I don't know why.
"--disable-shared"
# To keep ABI compatibility with upstream mingw-w64
"--enable-fully-dynamic-string"
] else ] else
(if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] optionals (targetPlatform.libc == "uclibc") [
else ["--with-headers=${getDev libcCross}/include"]) ++ # libsanitizer requires netrom/netrom.h which is not
# available in uclibc.
[ "--enable-__cxa_atexit" "--disable-libsanitizer"
"--enable-long-long" # In uclibc cases, libgomp needs an additional '-ldl'
] ++ # and as I don't know how to pass it, I disable libgomp.
"--disable-libgomp"
(if crossMingw then [ ] ++ [
"--enable-threads=win32" "--enable-threads=posix"
"--enable-sjlj-exceptions" "--enable-nls"
"--enable-hash-synchronization" "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
"--disable-libssp" ]));
"--disable-nls"
"--with-dwarf2"
# I think noone uses shared gcc libs in mingw, so we better do the same.
# In any case, mingw32 g++ linking is broken by default with shared libs,
# unless adding "-lsupc++" to any linking command. I don't know why.
"--disable-shared"
# To keep ABI compatibility with upstream mingw-w64
"--enable-fully-dynamic-string"
] else
optionals (targetPlatform.libc == "uclibc") [
# libsanitizer requires netrom/netrom.h which is not
# available in uclibc.
"--disable-libsanitizer"
# In uclibc cases, libgomp needs an additional '-ldl'
# and as I don't know how to pass it, I disable libgomp.
"--disable-libgomp" ] ++
[ "--enable-threads=posix"
"--enable-nls"
"--disable-decimal-float" # No final libdecnumber (it may work only in 386)
])
);
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
@ -372,7 +370,7 @@ stdenv.mkDerivation ({
# Java options # Java options
optionals langJava [ optionals langJava [
"--with-ecj-jar=${javaEcj} " "--with-ecj-jar=${javaEcj}"
# Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See
# <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>. # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
@ -399,9 +397,9 @@ stdenv.mkDerivation ({
# Platform-specific flags # Platform-specific flags
optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
optionals (hostPlatform.isSunOS) [ optionals (hostPlatform.isSunOS) [
" --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit"
# On Illumos/Solaris GNU as is preferred # On Illumos/Solaris GNU as is preferred
" --with-gnu-as --without-gnu-ld" "--with-gnu-as" "--without-gnu-ld"
] ]
; ;

View file

@ -117,67 +117,65 @@ let version = "7.2.0";
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
crossConfigureFlags = crossConfigureFlags =
mkPlatformFlags targetPlatform ++ mkPlatformFlags targetPlatform ++
# Ensure that -print-prog-name is able to find the correct programs. # Ensure that -print-prog-name is able to find the correct programs.
[ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
"--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
(if crossMingw && crossStageStatic then (if crossMingw && crossStageStatic then [
[ "--with-headers=${libcCross}/include" "--with-headers=${libcCross}/include"
"--with-gcc" "--with-gcc"
"--with-gnu-as" "--with-gnu-as"
"--with-gnu-ld" "--with-gnu-ld"
"--with-gnu-ld" "--with-gnu-ld"
"--disable-shared" "--disable-shared"
"--disable-nls" "--disable-nls"
"--disable-debug" "--disable-debug"
"--enable-sjlj-exceptions" "--enable-sjlj-exceptions"
"--enable-threads=win32" "--enable-threads=win32"
"--disable-win32-registry" "--disable-win32-registry"
] else if crossStageStatic then ] else if crossStageStatic then [
[ "--disable-libssp" "--disable-libssp"
"--disable-nls" "--disable-nls"
"--without-headers" "--without-headers"
"--disable-threads " "--disable-threads"
"--disable-libgomp " "--disable-libgomp"
"--disable-libquadmath" "--disable-libquadmath"
"--disable-shared" "--disable-shared"
"--disable-libatomic " # libatomic requires libc "--disable-libatomic" # libatomic requires libc
"--disable-decimal-float" # libdecnumber requires libc "--disable-decimal-float" # libdecnumber requires libc
] else ] else [
(if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
else ["--with-headers=${getDev libcCross}/include"]) ++ else "--with-headers=${getDev libcCross}/include")
[ "--enable-__cxa_atexit" "--enable-__cxa_atexit"
"--enable-long-long" "--enable-long-long"
] ++ ] ++
(if crossMingw then [
(if crossMingw then [ "--enable-threads=win32"
"--enable-threads=win32" "--enable-sjlj-exceptions"
"--enable-sjlj-exceptions" "--enable-hash-synchronization"
"--enable-hash-synchronization" "--disable-libssp"
"--disable-libssp" "--disable-nls"
"--disable-nls" "--with-dwarf2"
"--with-dwarf2" # I think noone uses shared gcc libs in mingw, so we better do the same.
# I think noone uses shared gcc libs in mingw, so we better do the same. # In any case, mingw32 g++ linking is broken by default with shared libs,
# In any case, mingw32 g++ linking is broken by default with shared libs, # unless adding "-lsupc++" to any linking command. I don't know why.
# unless adding "-lsupc++" to any linking command. I don't know why. "--disable-shared"
"--disable-shared" # To keep ABI compatibility with upstream mingw-w64
# To keep ABI compatibility with upstream mingw-w64 "--enable-fully-dynamic-string"
"--enable-fully-dynamic-string" ] else
] else optionals (targetPlatform.libc == "uclibc") [
optionals (targetPlatform.libc == "uclibc") [ # libsanitizer requires netrom/netrom.h which is not
# libsanitizer requires netrom/netrom.h which is not # available in uclibc.
# available in uclibc. "--disable-libsanitizer"
"--disable-libsanitizer" # In uclibc cases, libgomp needs an additional '-ldl'
# In uclibc cases, libgomp needs an additional '-ldl' # and as I don't know how to pass it, I disable libgomp.
# and as I don't know how to pass it, I disable libgomp. "--disable-libgomp"
"--disable-libgomp" ] ++ [
] ++ "--enable-threads=posix"
[ "--enable-threads=posix" "--enable-nls"
"--enable-nls" "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
"--disable-decimal-float" # No final libdecnumber (it may work only in 386) ]));
])
);
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
@ -365,11 +363,12 @@ stdenv.mkDerivation ({
# Java options # Java options
optionals langJava [ optionals langJava [
"--with-ecj-jar=${javaEcj} " "--with-ecj-jar=${javaEcj}"
# Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See
# <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>. # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
"--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " "--enable-java-home"
"--with-java-home=\${prefix}/lib/jvm/jre"
] ++ ] ++
optional javaAwtGtk "--enable-java-awt=gtk" ++ optional javaAwtGtk "--enable-java-awt=gtk" ++
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
@ -392,9 +391,9 @@ stdenv.mkDerivation ({
# Platform-specific flags # Platform-specific flags
optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
optionals hostPlatform.isSunOS [ optionals hostPlatform.isSunOS [
"--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit"
# On Illumos/Solaris GNU as is preferred # On Illumos/Solaris GNU as is preferred
"--with-gnu-as --without-gnu-ld" "--with-gnu-as" "--without-gnu-ld"
] ]
; ;

View file

@ -117,67 +117,65 @@ let version = "7-20170409";
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
crossConfigureFlags = crossConfigureFlags =
mkPlatformFlags targetPlatform ++ mkPlatformFlags targetPlatform ++
# Ensure that -print-prog-name is able to find the correct programs. # Ensure that -print-prog-name is able to find the correct programs.
[ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
"--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
(if crossMingw && crossStageStatic then (if crossMingw && crossStageStatic then [
[ "--with-headers=${libcCross}/include" "--with-headers=${libcCross}/include"
"--with-gcc" "--with-gcc"
"--with-gnu-as" "--with-gnu-as"
"--with-gnu-ld" "--with-gnu-ld"
"--with-gnu-ld" "--with-gnu-ld"
"--disable-shared" "--disable-shared"
"--disable-nls" "--disable-nls"
"--disable-debug" "--disable-debug"
"--enable-sjlj-exceptions" "--enable-sjlj-exceptions"
"--enable-threads=win32" "--enable-threads=win32"
"--disable-win32-registry" "--disable-win32-registry"
] else if crossStageStatic then ] else if crossStageStatic then [
[ "--disable-libssp" "--disable-libssp"
"--disable-nls" "--disable-nls"
"--without-headers" "--without-headers"
"--disable-threads " "--disable-threads"
"--disable-libgomp " "--disable-libgomp"
"--disable-libquadmath" "--disable-libquadmath"
"--disable-shared" "--disable-shared"
"--disable-libatomic " # libatomic requires libc "--disable-libatomic" # libatomic requires libc
"--disable-decimal-float" # libdecnumber requires libc "--disable-decimal-float" # libdecnumber requires libc
] else ] else [
(if crossDarwin then ["--with-sysroot=${getLib libcCross}/share/sysroot"] (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
else ["--with-headers=${getDev libcCross}/include"]) ++ else "--with-headers=${getDev libcCross}/include")
[ "--enable-__cxa_atexit" "--enable-__cxa_atexit"
"--enable-long-long" "--enable-long-long"
] ++ ] ++
(if crossMingw then [
(if crossMingw then [ "--enable-threads=win32"
"--enable-threads=win32" "--enable-sjlj-exceptions"
"--enable-sjlj-exceptions" "--enable-hash-synchronization"
"--enable-hash-synchronization" "--disable-libssp"
"--disable-libssp" "--disable-nls"
"--disable-nls" "--with-dwarf2"
"--with-dwarf2" # I think noone uses shared gcc libs in mingw, so we better do the same.
# I think noone uses shared gcc libs in mingw, so we better do the same. # In any case, mingw32 g++ linking is broken by default with shared libs,
# In any case, mingw32 g++ linking is broken by default with shared libs, # unless adding "-lsupc++" to any linking command. I don't know why.
# unless adding "-lsupc++" to any linking command. I don't know why. "--disable-shared"
"--disable-shared" # To keep ABI compatibility with upstream mingw-w64
# To keep ABI compatibility with upstream mingw-w64 "--enable-fully-dynamic-string"
"--enable-fully-dynamic-string" ] else
] else optionals (targetPlatform.libc == "uclibc") [
optionals (targetPlatform.libc == "uclibc") [ # libsanitizer requires netrom/netrom.h which is not
# libsanitizer requires netrom/netrom.h which is not # available in uclibc.
# available in uclibc. "--disable-libsanitizer"
"--disable-libsanitizer" # In uclibc cases, libgomp needs an additional '-ldl'
# In uclibc cases, libgomp needs an additional '-ldl' # and as I don't know how to pass it, I disable libgomp.
# and as I don't know how to pass it, I disable libgomp. "--disable-libgomp"
"--disable-libgomp" ] ++ [
] ++ "--enable-threads=posix"
[ "--enable-threads=posix" "--enable-nls"
"--enable-nls" "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
"--disable-decimal-float" # No final libdecnumber (it may work only in 386) ]));
])
);
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
@ -352,11 +350,12 @@ stdenv.mkDerivation ({
# Java options # Java options
optionals langJava [ optionals langJava [
"--with-ecj-jar=${javaEcj} " "--with-ecj-jar=${javaEcj}"
# Follow Sun's layout for the convenience of IcedTea/OpenJDK. See # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See
# <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>. # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
"--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre " "--enable-java-home"
"--with-java-home=\${prefix}/lib/jvm/jre"
] ++ ] ++
optional javaAwtGtk "--enable-java-awt=gtk" ++ optional javaAwtGtk "--enable-java-awt=gtk" ++
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
@ -379,9 +378,9 @@ stdenv.mkDerivation ({
# Platform-specific flags # Platform-specific flags
optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
optionals hostPlatform.isSunOS [ optionals hostPlatform.isSunOS [
"--enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit" "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit"
# On Illumos/Solaris GNU as is preferred # On Illumos/Solaris GNU as is preferred
"--with-gnu-as --without-gnu-ld" "--with-gnu-as" "--without-gnu-ld"
] ]
; ;