1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014, 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
6 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages gcc)
24 #:use-module ((guix licenses)
25 #:select (gpl3+ gpl2+ lgpl2.1+ lgpl2.0+ fdl1.3+))
26 #:use-module (gnu packages)
27 #:use-module (gnu packages bootstrap)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages multiprecision)
30 #:use-module (gnu packages texinfo)
31 #:use-module (gnu packages dejagnu)
32 #:use-module (gnu packages documentation)
33 #:use-module (gnu packages xml)
34 #:use-module (gnu packages docbook)
35 #:use-module (gnu packages graphviz)
36 #:use-module (gnu packages elf)
37 #:use-module (gnu packages perl)
38 #:use-module (guix packages)
39 #:use-module (guix download)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system trivial)
42 #:use-module (guix utils)
43 #:use-module (srfi srfi-1)
44 #:use-module (ice-9 regex))
46 (define %gcc-infrastructure
47 ;; Base URL for GCC's infrastructure.
48 "mirror://gcc/infrastructure/")
50 (define (gcc-configure-flags-for-triplet target)
51 "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet.
53 The purpose of this procedure is to translate extended GNU triplets---e.g.,
54 where the OS part is overloaded to denote a specific ABI---into GCC
55 `configure' options. We take extended GNU triplets that glibc recognizes."
56 (cond ((string-match "^mips64el.*gnuabin?64$" target)
57 ;; Triplets recognized by glibc as denoting the N64 ABI; see
58 ;; ports/sysdeps/mips/preconfigure.
61 ((string-match "^arm.*-gnueabihf$" target)
62 '("--with-arch=armv7-a"
68 ;; TODO: Add `arm.*-gnueabi', etc.
71 (define-public gcc-4.7
72 (let* ((stripped? #t) ;whether to strip the compiler, not the libraries
75 ;; Return the `_FOR_TARGET' variables that are needed when
76 ;; cross-compiling GCC.
77 (let ((target (%current-target-system)))
79 (map (lambda (var tool)
80 (string-append (string-append var "_FOR_TARGET")
82 '("CC" "CXX" "LD" "AR" "NM" "RANLIB" "STRIP")
83 '("gcc" "g++" "ld" "ar" "nm" "ranlib" "strip"))
86 (let ((base '(or (assoc-ref outputs "lib")
87 (assoc-ref outputs "out"))))
89 ;; Return the directory that contains lib/libgcc_s.so et al.
90 (if (%current-target-system)
91 `(string-append ,base "/" ,(%current-target-system))
95 ;; This is terrible. Since we have two levels of quasiquotation,
96 ;; we have to do this convoluted thing just so we can insert the
97 ;; contents of (maybe-target-tools).
101 "--enable-languages=c,c++"
105 ;; No pre-compiled libstdc++ headers, to save space.
106 "--disable-libstdcxx-pch"
108 "--with-local-prefix=/no-gcc-local-prefix"
110 ;; With a separate "lib" output, the build system
111 ;; incorrectly guesses GPLUSPLUS_INCLUDE_DIR, so force
112 ;; it. (Don't use a versioned sub-directory, that's
114 ,(string-append "--with-gxx-include-dir="
115 (assoc-ref %outputs "out")
118 ,(let ((libc (assoc-ref %build-inputs "libc")))
120 (string-append "--with-native-system-header-dir=" libc
122 "--without-headers")))
124 ;; Pass the right options for the target triplet.
126 (or (%current-target-system)
127 (nix-system->gnu-triplet (%current-system)))))
128 (gcc-configure-flags-for-triplet triplet))
130 (maybe-target-tools))))))
136 (uri (string-append "mirror://gnu/gcc/gcc-"
137 version "/gcc-" version ".tar.bz2"))
140 "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj"))))
141 (build-system gnu-build-system)
143 ;; Separate out the run-time support libraries because all the
144 ;; dynamic-linked objects depend on it.
145 (outputs '("out" ;commands, etc. (60+ MiB)
146 "lib" ;libgcc_s, libgomp, etc. (15+ MiB)
147 "debug")) ;debug symbols of run-time libraries
149 (inputs `(("gmp" ,gmp)
157 ;; GCC < 5 is one of the few packages that doesn't ship .info files.
158 ;; Newer texinfos fail to build the manual, so we use an older one.
159 (native-inputs `(("texinfo" ,texinfo-5)))
162 `(#:out-of-source? #t
163 #:configure-flags ,(configure-flags)
165 ;; None of the flags below are needed when doing a Canadian cross.
166 ;; TODO: Simplify this.
167 ,(if (%current-target-system)
171 `(let* ((libc (assoc-ref %build-inputs "libc"))
172 (libc-native (or (assoc-ref %build-inputs "libc-native")
175 (list (string-append "LDFLAGS_FOR_TARGET="
177 "-Wl,-dynamic-linker "
179 ,(glibc-dynamic-linker)))
182 ;; Native programs like 'genhooks' also need that right.
183 ,(string-append "LDFLAGS="
184 "-Wl,-rpath=" libc-native "/lib "
185 "-Wl,-dynamic-linker "
186 "-Wl," libc-native ,(glibc-dynamic-linker))
187 ,(string-append "BOOT_CFLAGS=-O2 "
188 ,(if stripped? "-g0" "-g")))))
194 'configure 'pre-configure
195 (lambda* (#:key inputs outputs #:allow-other-keys)
196 (let ((libdir ,(libdir))
197 (libc (assoc-ref inputs "libc")))
199 ;; The following is not performed for `--without-headers'
200 ;; cross-compiler builds.
202 ;; Join multi-line definitions of GLIBC_DYNAMIC_LINKER* into a
203 ;; single line, to allow the next step to work properly.
206 (substitute* (find-files "gcc/config"
207 "^linux(64|-elf|-eabi)?\\.h$")
208 (("(#define GLIBC_DYNAMIC_LINKER.*)\\\\\n$" _ line)
212 ;; Fix the dynamic linker's file name.
213 (substitute* (find-files "gcc/config"
214 "^(linux|gnu)(64|-elf|-eabi)?\\.h$")
215 (("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix)
216 (format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%"
218 (string-append libc ,(glibc-dynamic-linker)))))
220 ;; Tell where to find libstdc++, libc, and `?crt*.o', except
221 ;; `crt{begin,end}.o', which come with GCC.
222 (substitute* (find-files "gcc/config"
224 (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix)
225 ;; Help libgcc_s.so be found (see also below.) Always use
226 ;; '-lgcc_s' so that libgcc_s.so is always found by those
227 ;; programs that use 'pthread_cancel' (glibc dlopens
228 ;; libgcc_s.so when pthread_cancel support is needed, but
229 ;; having it in the application's RUNPATH isn't enough; see
230 ;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.)
232 ;; NOTE: The '-lgcc_s' added below needs to be removed in a
233 ;; later phase of %gcc-static. If you change the string
234 ;; below, make sure to update the relevant code in
235 ;; %gcc-static package as needed.
236 (format #f "#define GNU_USER_TARGET_LIB_SPEC \
237 \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
238 libc libc libdir suffix))
239 (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line)
240 (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
241 #define STANDARD_STARTFILE_PREFIX_2 \"\"
245 ;; Don't retain a dependency on the build-time sed.
246 (substitute* "fixincludes/fixincl.x"
247 (("static char const sed_cmd_z\\[\\] =.*;")
248 "static char const sed_cmd_z[] = \"sed\";"))
250 (when (file-exists? "libbacktrace")
251 ;; GCC 4.8+ comes with libbacktrace. By default it builds
252 ;; with -Werror, which fails with a -Wcast-qual error in glibc
253 ;; 2.21's stdlib-bsearch.h. Remove -Werror.
254 (substitute* "libbacktrace/configure"
255 (("WARN_FLAGS=(.*)-Werror" _ flags)
256 (string-append "WARN_FLAGS=" flags)))
258 (when (file-exists? "libsanitizer/libbacktrace")
259 ;; Same in libsanitizer's bundled copy (!) found in 4.9+.
260 (substitute* "libsanitizer/libbacktrace/Makefile.in"
264 ;; Add a RUNPATH to libstdc++.so so that it finds libgcc_s.
265 ;; See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354>
266 ;; and <http://bugs.gnu.org/20358>.
267 (substitute* "libstdc++-v3/src/Makefile.in"
269 "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
271 ;; Move libstdc++*-gdb.py to the "lib" output to avoid a
272 ;; circularity between "out" and "lib". (Note:
273 ;; --with-python-dir is useless because it imposes $(prefix) as
274 ;; the parent directory.)
275 (substitute* "libstdc++-v3/python/Makefile.in"
277 (string-append "pythondir = " libdir "/share"
278 "/gcc-$(gcc_version)/python\n")))
280 ;; Avoid another circularity between the outputs: this #define
281 ;; ends up in auto-host.h in the "lib" output, referring to
282 ;; "out". (This variable is used to augment cpp's search path,
283 ;; but there's nothing useful to look for here.)
284 (substitute* "gcc/config.in"
285 (("PREFIX_INCLUDE_DIR")
286 "PREFIX_INCLUDE_DIR_isnt_necessary_here"))))
289 'configure 'post-configure
291 ;; Don't store configure flags, to avoid retaining references to
292 ;; build-time dependencies---e.g., `--with-ppl=/gnu/store/xxx'.
293 (substitute* "Makefile"
294 (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
295 "TOPLEVEL_CONFIGURE_ARGUMENTS=\n")))
299 ;; Use the language-specific variables rather than 'CPATH' because they
300 ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'.
301 ;; The intent is to allow headers that are in the search path to be
302 ;; treated as "system headers" (headers exempt from warnings) just like
303 ;; the typical /usr/include headers on an FHS system.
304 (list (search-path-specification
305 (variable "C_INCLUDE_PATH")
306 (files '("include")))
307 (search-path-specification
308 (variable "CPLUS_INCLUDE_PATH")
309 (files '("include")))
310 (search-path-specification
311 (variable "LIBRARY_PATH")
312 (files '("lib" "lib64")))))
314 (properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
315 (synopsis "GNU Compiler Collection")
317 "GCC is the GNU Compiler Collection. It provides compiler front-ends
318 for several languages, including C, C++, Objective-C, Fortran, Java, Ada, and
319 Go. It also includes runtime support libraries for these languages.")
321 (home-page "http://gcc.gnu.org/"))))
323 (define-public gcc-4.8
324 (package (inherit gcc-4.7)
328 (uri (string-append "mirror://gnu/gcc/gcc-"
329 version "/gcc-" version ".tar.bz2"))
332 "08yggr18v373a1ihj0rg2vd6psnic42b518xcgp3r9k81xz1xyr2"))
333 (patches (search-patches "gcc-arm-link-spec-fix.patch"))))))
335 (define-public gcc-4.9
336 (package (inherit gcc-4.7)
340 (uri (string-append "mirror://gnu/gcc/gcc-"
341 version "/gcc-" version ".tar.bz2"))
344 "14l06m7nvcvb0igkbip58x59w3nq6315k6jcz3wr9ch1rn9d44bc"))
345 (patches (search-patches "gcc-arm-bug-71399.patch"
346 "gcc-libvtv-runpath.patch"))))
347 (native-inputs `(("texinfo" ,texinfo)))))
350 ;; Note: GCC >= 5 ships with .info files but 'make install' fails to install
351 ;; them in a VPATH build.
352 (package (inherit gcc-4.9)
356 (uri (string-append "mirror://gnu/gcc/gcc-"
357 version "/gcc-" version ".tar.bz2"))
360 "0fihlcy5hnksdxk0sn6bvgnyq8gfrgs8m794b1jxwd1dxinzg3b0"))
361 (patches (search-patches "gcc-strmov-store-file-names.patch"
362 "gcc-5.0-libvtv-runpath.patch"))))))
370 (uri (string-append "mirror://gnu/gcc/gcc-"
371 version "/gcc-" version ".tar.bz2"))
374 "17xjz30jb65hcf714vn9gcxvrrji8j20xm7n33qg1ywhyzryfsph"))
375 (patches (search-patches "gcc-strmov-store-file-names.patch"
376 "gcc-5.0-libvtv-runpath.patch"))))))
378 ;; Note: When changing the default gcc version, update
379 ;; the gcc-toolchain-* definitions accordingly.
380 (define-public gcc gcc-4.9)
382 (define-public (make-libstdc++ gcc)
383 "Return a libstdc++ package based on GCC. The primary use case is when
384 using compilers other than GCC."
389 `(#:out-of-source? #t
390 #:phases (alist-cons-before
393 (chdir "libstdc++-v3"))
395 #:configure-flags `("--disable-libstdcxx-pch"
396 ,(string-append "--with-gxx-include-dir="
397 (assoc-ref %outputs "out")
399 (outputs '("out" "debug"))
402 (propagated-inputs '())
403 (synopsis "GNU C++ standard library")))
405 (define-public libstdc++-4.9
406 (make-libstdc++ gcc-4.9))
408 (define (make-libiberty gcc)
409 "Return a libiberty package based on GCC."
414 `(#:out-of-source? #t
416 (modify-phases %standard-phases
417 (add-before 'configure 'chdir
423 (lambda* (#:key outputs #:allow-other-keys)
424 (let* ((out (assoc-ref outputs "out"))
425 (lib (string-append out "/lib/"))
426 (include (string-append out "/include/")))
429 (copy-file "libiberty.a"
430 (string-append lib "libiberty.a"))
431 (copy-file "../include/libiberty.h"
432 (string-append include "libiberty.h"))
437 (propagated-inputs '())
438 (synopsis "Collection of subroutines used by various GNU programs")))
440 (define-public libiberty
441 (make-libiberty gcc))
443 (define* (custom-gcc gcc name languages
445 (search-paths (package-native-search-paths gcc))
446 #:key (separate-lib-output? #t))
447 "Return a custom version of GCC that supports LANGUAGES. Use SEARCH-PATHS
448 as the 'native-search-paths' field."
449 (package (inherit gcc)
451 (outputs (if separate-lib-output?
452 (package-outputs gcc)
453 (delete "lib" (package-outputs gcc))))
454 (native-search-paths search-paths)
456 (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
461 ,@(package-arguments gcc))
462 ((#:configure-flags flags)
463 `(cons (string-append "--enable-languages="
464 ,(string-join languages ","))
465 (remove (cut string-match "--enable-languages.*" <>)
468 `(modify-phases ,phases
469 (add-after 'install 'remove-broken-or-conflicting-files
470 (lambda* (#:key outputs #:allow-other-keys)
471 (for-each delete-file
472 (find-files (string-append (assoc-ref outputs "out") "/bin")
473 ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc.*)"))
476 (define %generic-search-paths
477 ;; This is the language-neutral search path for GCC. Entries in $CPATH are
478 ;; not considered "system headers", which means GCC can raise warnings for
479 ;; issues in those headers. 'CPATH' is the only one that works for
480 ;; front-ends not in the C family.
481 (list (search-path-specification
483 (files '("include")))
484 (search-path-specification
485 (variable "LIBRARY_PATH")
486 (files '("lib" "lib64")))))
488 (define-public gfortran-4.8
489 (custom-gcc gcc-4.8 "gfortran" '("fortran")
490 %generic-search-paths))
492 (define-public gfortran-4.9
493 (custom-gcc gcc-4.9 "gfortran" '("fortran")
494 %generic-search-paths))
496 (define-public gfortran
497 ;; Note: Update this when GCC changes! We cannot use
498 ;; (custom-gcc gcc "fortran" …) because that would lead to a package object
499 ;; that is not 'eq?' with GFORTRAN-4.9, and thus 'fold-packages' would
500 ;; report two gfortran@4.9 that are in fact identical.
503 (define-public gfortran-5
504 (custom-gcc gcc-5 "gfortran" '("fortran")
505 %generic-search-paths))
507 (define-public gccgo-4.9
508 (custom-gcc gcc-4.9 "gccgo" '("go")
509 %generic-search-paths
510 ;; Suppress the separate "lib" output, because otherwise the
511 ;; "lib" and "out" outputs would refer to each other, creating
512 ;; a cyclic dependency. <http://debbugs.gnu.org/18101>
513 #:separate-lib-output? #f))
518 (uri (string-append "http://sources.gentoo.org/cgi-bin/viewvc.cgi/"
519 "gentoo-x86/dev-java/gcj-jdk/files/javac.in?revision=1.1"))
520 (file-name "javac.in")
522 "1c3dk4z5yfj6ic2fn3lyxs27n6pmn2wy9k0r1s17lnkf1bzkrciv"))))
525 (package (inherit gcc)
527 (version (package-version gcc))
529 `(("fastjar" ,fastjar)
531 ("javac.in" ,javac.in)
532 ("ecj-bootstrap" ,ecj-bootstrap)
533 ,@(package-inputs gcc)))
535 `(("dejagnu" ,dejagnu)
536 ,@(if (string-prefix? "armhf" (or (%current-system)
537 (%current-target-system)))
538 `(("arm-patch" ,(origin
540 (uri (search-patch "gcj-arm-mode.patch"))
543 "1z15xs5yx6qinnb572swzxrn9f668sw7ga5280q3gznj1jyrynfn")))))
545 ,@(package-native-inputs gcc)))
546 (native-search-paths %generic-search-paths)
548 ;; Suppress the separate "lib" output, because otherwise the
549 ;; "lib" and "out" outputs would refer to each other, creating
550 ;; a cyclic dependency. <http://debbugs.gnu.org/18101>
552 (delete "lib" (package-outputs gcc)))
554 (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
559 #:test-target "check-target-libjava"
560 ,@(package-arguments gcc))
562 ((#:configure-flags flags)
563 `(let ((ecj (assoc-ref %build-inputs "ecj-bootstrap")))
564 `("--enable-java-home"
566 ,(string-append "--with-ecj-jar=" ecj)
567 "--enable-languages=java"
568 ,@(remove (cut string-match "--enable-languages.*" <>)
571 `(modify-phases ,phases
572 ;; Conditionally add phase to apply patch
573 ,@(if (string-prefix? "armhf" (or (%current-system)
574 (%current-target-system)))
575 `((add-after 'unpack 'apply-arm-patch
576 (lambda* (#:key inputs #:allow-other-keys)
577 (zero? (system* "patch" "-p1"
578 "-i" (assoc-ref inputs "arm-patch"))))))
581 'unpack 'add-lib-output-to-rpath
583 (substitute* "libjava/Makefile.in"
584 (("libgcj_bc_dummy_LINK = .* -shared" line)
585 (string-append line " -Wl,-rpath=$(libdir)"))
586 (("libgcj(_bc)?_la_LDFLAGS =" ldflags _)
587 (string-append ldflags " -Wl,-rpath=$(libdir)")))))
589 'unpack 'patch-testsuite
590 ;; dejagnu-1.6 removes the 'absolute' command
592 ;; This test fails on armhf. It seems harmless enough to disable it.
593 (for-each delete-file '("libjava/testsuite/libjava.lang/Throw_2.java"
594 "libjava/testsuite/libjava.lang/Throw_2.out"
595 "libjava/testsuite/libjava.lang/Throw_2.jar"))
596 (substitute* "libjava/testsuite/lib/libjava.exp"
597 (("absolute") "file normalize"))
600 'install 'install-javac-and-javap-wrappers
602 (let* ((javac (assoc-ref %build-inputs "javac.in"))
603 (ecj (assoc-ref %build-inputs "ecj-bootstrap"))
604 (gcj (assoc-ref %outputs "out"))
605 (gcjbin (string-append gcj "/bin/"))
606 (jvm (string-append gcj "/lib/jvm/"))
607 (target (string-append jvm "/bin/javac")))
609 (symlink (string-append gcjbin "jcf-dump")
610 (string-append jvm "/bin/javap"))
612 (copy-file ecj (string-append gcj "/share/java/ecj.jar"))
614 ;; Create javac wrapper from the template javac.in by
615 ;; replacing the @VARIABLES@ with paths.
616 (copy-file javac target)
617 (patch-shebang target)
620 (string-append jvm "/bin/java"))
622 (string-append gcj "/share/java/ecj.jar"))
624 (string-append jvm "/jre/lib/rt.jar"))
626 (string-append jvm "/lib/tools.jar")))
630 'install 'remove-broken-or-conflicting-files
632 (let ((out (assoc-ref %outputs "out")))
635 (append (find-files (string-append out "/lib/jvm/jre/lib")
637 (find-files (string-append out "/bin")
638 ".*(c\\+\\+|cpp|g\\+\\+|gcc.*)"))))
641 (define ecj-bootstrap
644 (uri "ftp://sourceware.org/pub/java/ecj-4.9.jar")
647 "1k9lgm3qamf6zy534pa2zwskr8mpiqrngbv1vw9j4y1ghrdyf1lm"))))
649 (define-public gcc-objc-4.8
650 (custom-gcc gcc-4.8 "gcc-objc" '("objc")
651 (list (search-path-specification
652 (variable "OBJC_INCLUDE_PATH")
653 (files '("include")))
654 (search-path-specification
655 (variable "LIBRARY_PATH")
656 (files '("lib" "lib64"))))))
658 (define-public gcc-objc-4.9
659 (custom-gcc gcc-4.9 "gcc-objc" '("objc")
660 (list (search-path-specification
661 (variable "OBJC_INCLUDE_PATH")
662 (files '("include")))
663 (search-path-specification
664 (variable "LIBRARY_PATH")
665 (files '("lib" "lib64"))))))
667 (define-public gcc-objc gcc-objc-4.9)
669 (define-public gcc-objc++-4.8
670 (custom-gcc gcc-4.8 "gcc-objc++" '("obj-c++")
671 (list (search-path-specification
672 (variable "OBJCPLUS_INCLUDE_PATH")
673 (files '("include")))
674 (search-path-specification
675 (variable "LIBRARY_PATH")
676 (files '("lib" "lib64"))))))
678 (define-public gcc-objc++-4.9
679 (custom-gcc gcc-4.9 "gcc-objc++" '("obj-c++")
680 (list (search-path-specification
681 (variable "OBJCPLUS_INCLUDE_PATH")
682 (files '("include")))
683 (search-path-specification
684 (variable "LIBRARY_PATH")
685 (files '("lib" "lib64"))))))
687 (define-public gcc-objc++ gcc-objc++-4.9)
689 (define (make-libstdc++-doc gcc)
690 "Return a package with the libstdc++ documentation for GCC."
693 (name "libstdc++-doc")
694 (version (package-version gcc))
695 (synopsis "GNU libstdc++ documentation")
697 (native-inputs `(("doxygen" ,doxygen)
701 ("docbook-xml" ,docbook-xml)
702 ("docbook-xsl" ,docbook-xsl)
703 ("graphviz" ,graphviz))) ;for 'dot', invoked by 'doxygen'
705 (propagated-inputs '())
707 '(#:out-of-source? #t
708 #:tests? #f ;it's just documentation
709 #:phases (modify-phases %standard-phases
710 (add-before 'configure 'chdir
712 (chdir "libstdc++-v3")))
713 (add-before 'configure 'set-xsl-directory
714 (lambda* (#:key inputs #:allow-other-keys)
715 (let ((docbook (assoc-ref inputs "docbook-xsl")))
716 (substitute* (find-files "doc"
721 (strip-store-file-name docbook)))))))
724 ;; XXX: There's also a 'doc-info' target, but it
725 ;; relies on docbook2X, which itself relies on
726 ;; DocBook 4.1.2, which is not really usable
727 ;; (lacks a catalog.xml.)
728 (zero? (system* "make"
732 (lambda* (#:key outputs #:allow-other-keys)
733 (let ((out (assoc-ref outputs "out")))
734 (zero? (system* "make"
736 "doc-install-man"))))))))))
738 (define-public libstdc++-doc-4.9
739 (make-libstdc++-doc gcc-4.9))
741 (define-public libstdc++-doc-5
742 (make-libstdc++-doc gcc-5))
750 (uri (list (string-append
751 "http://isl.gforge.inria.fr/isl-"
754 (string-append %gcc-infrastructure
755 name "-" version ".tar.gz")))
758 "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9"))
759 (patches (search-patches "isl-0.11.1-aarch64-support.patch"))))
760 (build-system gnu-build-system)
761 (inputs `(("gmp" ,gmp)))
762 (home-page "http://isl.gforge.inria.fr/")
764 "Manipulating sets and relations of integer points \
765 bounded by linear constraints")
767 "isl is a library for manipulating sets and relations of integer points
768 bounded by linear constraints. Supported operations on sets include
769 intersection, union, set difference, emptiness check, convex hull, (integer)
770 affine hull, integer projection, computing the lexicographic minimum using
771 parametric integer programming, coalescing and parametric vertex
772 enumeration. It also includes an ILP solver based on generalized basis
773 reduction, transitive closures on maps (which may encode infinite graphs),
774 dependence analysis and bounds on piecewise step-polynomials.")
784 (uri (list (string-append
785 "http://www.bastoul.net/cloog/pages/download/count.php3?url=cloog-"
788 (string-append %gcc-infrastructure
789 name "-" version ".tar.gz")))
792 "0a12rwfwp22zd0nlld0xyql11cj390rrq1prw35yjsw8wzfshjhw"))
793 (file-name (string-append name "-" version ".tar.gz"))))
794 (build-system gnu-build-system)
795 (inputs `(("gmp" ,gmp)
797 (arguments '(#:configure-flags '("--with-isl=system")))
798 (home-page "http://www.cloog.org/")
799 (synopsis "Library to generate code for scanning Z-polyhedra")
801 "CLooG is a free software library to generate code for scanning
802 Z-polyhedra. That is, it finds a code (e.g., in C, FORTRAN...) that
803 reaches each integral point of one or more parameterized polyhedra.
804 CLooG has been originally written to solve the code generation problem
805 for optimizing compilers based on the polytope model. Nevertheless it
806 is used now in various area e.g., to build control automata for
807 high-level synthesis or to find the best polynomial approximation of a
808 function. CLooG may help in any situation where scanning polyhedra
809 matters. While the user has full control on generated code quality,
810 CLooG is designed to avoid control overhead and to produce a very
814 (define-public gnu-c-manual
816 (name "gnu-c-manual")
820 (uri (string-append "mirror://gnu/gnu-c-manual/gnu-c-manual-"
824 "1sfsj9256w18qzylgag2h5h377aq8in8929svblfnj9svfriqcys"))))
825 (build-system gnu-build-system)
826 (native-inputs `(("texinfo" ,texinfo)))
828 '(#:phases (modify-phases %standard-phases
833 (zero? (system* "make"
835 "gnu-c-manual.html"))))
837 (lambda* (#:key outputs #:allow-other-keys)
838 (let* ((out (assoc-ref outputs "out"))
839 (info (string-append out "/share/info"))
841 out "/share/doc/gnu-c-manual")))
845 (for-each (lambda (file)
847 (string-append info "/"
849 (find-files "." "\\.info(-[0-9])?$"))
850 (for-each (lambda (file)
852 (string-append html "/"
854 (find-files "." "\\.html$"))
856 (synopsis "Reference manual for the C programming language")
858 "This is a reference manual for the C programming language, as
859 implemented by the GNU C Compiler (gcc). As a reference, it is not intended
860 to be a tutorial of the language. Rather, it outlines all of the constructs
861 of the language. Library functions are not included.")
862 (home-page "http://www.gnu.org/software/gnu-c-manual")