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, 2017 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
6 ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages gcc)
25 #:use-module ((guix licenses)
26 #:select (gpl3+ gpl2+ lgpl2.1+ lgpl2.0+ fdl1.3+))
27 #:use-module (gnu packages)
28 #:use-module (gnu packages bootstrap)
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages multiprecision)
31 #:use-module (gnu packages texinfo)
32 #:use-module (gnu packages dejagnu)
33 #:use-module (gnu packages documentation)
34 #:use-module (gnu packages xml)
35 #:use-module (gnu packages docbook)
36 #:use-module (gnu packages graphviz)
37 #:use-module (gnu packages elf)
38 #:use-module (gnu packages perl)
39 #:use-module (guix packages)
40 #:use-module (guix download)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system trivial)
43 #:use-module (guix utils)
44 #:use-module (srfi srfi-1)
45 #:use-module (ice-9 regex))
47 (define %gcc-infrastructure
48 ;; Base URL for GCC's infrastructure.
49 "mirror://gcc/infrastructure/")
51 (define (gcc-configure-flags-for-triplet target)
52 "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet.
54 The purpose of this procedure is to translate extended GNU triplets---e.g.,
55 where the OS part is overloaded to denote a specific ABI---into GCC
56 `configure' options. We take extended GNU triplets that glibc recognizes."
57 (cond ((string-match "^mips64el.*gnuabin?64$" target)
58 ;; Triplets recognized by glibc as denoting the N64 ABI; see
59 ;; ports/sysdeps/mips/preconfigure.
62 ((string-match "^arm.*-gnueabihf$" target)
63 '("--with-arch=armv7-a"
69 ;; TODO: Add `arm.*-gnueabi', etc.
72 (define-public gcc-4.7
73 (let* ((stripped? #t) ;whether to strip the compiler, not the libraries
76 ;; Return the `_FOR_TARGET' variables that are needed when
77 ;; cross-compiling GCC.
78 (let ((target (%current-target-system)))
80 (map (lambda (var tool)
81 (string-append (string-append var "_FOR_TARGET")
83 '("CC" "CXX" "LD" "AR" "NM" "RANLIB" "STRIP")
84 '("gcc" "g++" "ld" "ar" "nm" "ranlib" "strip"))
87 (let ((base '(or (assoc-ref outputs "lib")
88 (assoc-ref outputs "out"))))
90 ;; Return the directory that contains lib/libgcc_s.so et al.
91 (if (%current-target-system)
92 `(string-append ,base "/" ,(%current-target-system))
96 ;; This is terrible. Since we have two levels of quasiquotation,
97 ;; we have to do this convoluted thing just so we can insert the
98 ;; contents of (maybe-target-tools).
102 "--enable-languages=c,c++"
106 ;; No pre-compiled libstdc++ headers, to save space.
107 "--disable-libstdcxx-pch"
109 "--with-local-prefix=/no-gcc-local-prefix"
111 ;; With a separate "lib" output, the build system
112 ;; incorrectly guesses GPLUSPLUS_INCLUDE_DIR, so force
113 ;; it. (Don't use a versioned sub-directory, that's
115 ,(string-append "--with-gxx-include-dir="
116 (assoc-ref %outputs "out")
119 ,(let ((libc (assoc-ref %build-inputs "libc")))
121 (string-append "--with-native-system-header-dir=" libc
123 "--without-headers")))
125 ;; Pass the right options for the target triplet.
127 (or (%current-target-system)
128 (nix-system->gnu-triplet (%current-system)))))
129 (gcc-configure-flags-for-triplet triplet))
131 (maybe-target-tools))))))
137 (uri (string-append "mirror://gnu/gcc/gcc-"
138 version "/gcc-" version ".tar.bz2"))
139 (patches (search-patches "gcc-4-compile-with-gcc-5.patch"))
142 "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj"))))
143 (build-system gnu-build-system)
145 ;; Separate out the run-time support libraries because all the
146 ;; dynamic-linked objects depend on it.
147 (outputs '("out" ;commands, etc. (60+ MiB)
148 "lib" ;libgcc_s, libgomp, etc. (15+ MiB)
149 "debug")) ;debug symbols of run-time libraries
151 (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|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
208 (("(#define (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$" _ line)
212 ;; Fix the dynamic linker's file name.
213 (substitute* (find-files "gcc/config"
214 "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
215 (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ \t]*).*$"
217 (format #f "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
219 (string-append libc ,(glibc-dynamic-linker)))))
221 ;; Tell where to find libstdc++, libc, and `?crt*.o', except
222 ;; `crt{begin,end}.o', which come with GCC.
223 (substitute* (find-files "gcc/config"
225 (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix)
226 ;; Help libgcc_s.so be found (see also below.) Always use
227 ;; '-lgcc_s' so that libgcc_s.so is always found by those
228 ;; programs that use 'pthread_cancel' (glibc dlopens
229 ;; libgcc_s.so when pthread_cancel support is needed, but
230 ;; having it in the application's RUNPATH isn't enough; see
231 ;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.)
233 ;; NOTE: The '-lgcc_s' added below needs to be removed in a
234 ;; later phase of %gcc-static. If you change the string
235 ;; below, make sure to update the relevant code in
236 ;; %gcc-static package as needed.
237 (format #f "#define GNU_USER_TARGET_LIB_SPEC \
238 \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
239 libc libc libdir suffix))
240 (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line)
241 (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
242 #define STANDARD_STARTFILE_PREFIX_2 \"\"
246 ;; The rs6000 (a.k.a. powerpc) config in GCC does not use
247 ;; GNU_USER_* defines. Do the above for this case.
249 "gcc/config/rs6000/sysv4.h"
250 (("#define LIB_LINUX_SPEC (.*)$" _ suffix)
251 (format #f "#define LIB_LINUX_SPEC \
252 \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
253 libc libc libdir suffix))
254 (("#define STARTFILE_LINUX_SPEC.*$" line)
255 (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
256 #define STANDARD_STARTFILE_PREFIX_2 \"\"
260 ;; Don't retain a dependency on the build-time sed.
261 (substitute* "fixincludes/fixincl.x"
262 (("static char const sed_cmd_z\\[\\] =.*;")
263 "static char const sed_cmd_z[] = \"sed\";"))
265 ;; Aarch64 support didn't land in GCC until the 4.8 series.
266 (when (file-exists? "gcc/config/aarch64")
267 ;; Force Aarch64 libdir to be /lib and not /lib64
268 (substitute* "gcc/config/aarch64/t-aarch64-linux"
271 (when (file-exists? "libbacktrace")
272 ;; GCC 4.8+ comes with libbacktrace. By default it builds
273 ;; with -Werror, which fails with a -Wcast-qual error in glibc
274 ;; 2.21's stdlib-bsearch.h. Remove -Werror.
275 (substitute* "libbacktrace/configure"
276 (("WARN_FLAGS=(.*)-Werror" _ flags)
277 (string-append "WARN_FLAGS=" flags)))
279 (when (file-exists? "libsanitizer/libbacktrace")
280 ;; Same in libsanitizer's bundled copy (!) found in 4.9+.
281 (substitute* "libsanitizer/libbacktrace/Makefile.in"
285 ;; Add a RUNPATH to libstdc++.so so that it finds libgcc_s.
286 ;; See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354>
287 ;; and <http://bugs.gnu.org/20358>.
288 (substitute* "libstdc++-v3/src/Makefile.in"
290 "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
292 ;; Move libstdc++*-gdb.py to the "lib" output to avoid a
293 ;; circularity between "out" and "lib". (Note:
294 ;; --with-python-dir is useless because it imposes $(prefix) as
295 ;; the parent directory.)
296 (substitute* "libstdc++-v3/python/Makefile.in"
298 (string-append "pythondir = " libdir "/share"
299 "/gcc-$(gcc_version)/python\n")))
301 ;; Avoid another circularity between the outputs: this #define
302 ;; ends up in auto-host.h in the "lib" output, referring to
303 ;; "out". (This variable is used to augment cpp's search path,
304 ;; but there's nothing useful to look for here.)
305 (substitute* "gcc/config.in"
306 (("PREFIX_INCLUDE_DIR")
307 "PREFIX_INCLUDE_DIR_isnt_necessary_here"))))
310 'configure 'post-configure
312 ;; Don't store configure flags, to avoid retaining references to
313 ;; build-time dependencies---e.g., `--with-ppl=/gnu/store/xxx'.
314 (substitute* "Makefile"
315 (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
316 "TOPLEVEL_CONFIGURE_ARGUMENTS=\n")))
320 ;; Use the language-specific variables rather than 'CPATH' because they
321 ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'.
322 ;; The intent is to allow headers that are in the search path to be
323 ;; treated as "system headers" (headers exempt from warnings) just like
324 ;; the typical /usr/include headers on an FHS system.
325 (list (search-path-specification
326 (variable "C_INCLUDE_PATH")
327 (files '("include")))
328 (search-path-specification
329 (variable "CPLUS_INCLUDE_PATH")
330 (files '("include")))
331 (search-path-specification
332 (variable "LIBRARY_PATH")
333 (files '("lib" "lib64")))))
335 (properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
336 (synopsis "GNU Compiler Collection")
338 "GCC is the GNU Compiler Collection. It provides compiler front-ends
339 for several languages, including C, C++, Objective-C, Fortran, Java, Ada, and
340 Go. It also includes runtime support libraries for these languages.")
342 (supported-systems (delete "aarch64-linux" %supported-systems))
343 (home-page "https://gcc.gnu.org/"))))
345 (define-public gcc-4.8
346 (package (inherit gcc-4.7)
350 (uri (string-append "mirror://gnu/gcc/gcc-"
351 version "/gcc-" version ".tar.bz2"))
354 "08yggr18v373a1ihj0rg2vd6psnic42b518xcgp3r9k81xz1xyr2"))
355 (patches (search-patches "gcc-arm-link-spec-fix.patch"))))
356 (supported-systems %supported-systems)
360 ,@(package-inputs gcc-4.7)))))
362 (define-public gcc-4.9
363 (package (inherit gcc-4.8)
367 (uri (string-append "mirror://gnu/gcc/gcc-"
368 version "/gcc-" version ".tar.bz2"))
371 "14l06m7nvcvb0igkbip58x59w3nq6315k6jcz3wr9ch1rn9d44bc"))
372 (patches (search-patches "gcc-arm-bug-71399.patch"
373 "gcc-libvtv-runpath.patch"))))
374 (native-inputs `(("texinfo" ,texinfo)))))
377 ;; Note: GCC >= 5 ships with .info files but 'make install' fails to install
378 ;; them in a VPATH build.
379 (package (inherit gcc-4.9)
383 (uri (string-append "mirror://gnu/gcc/gcc-"
384 version "/gcc-" version ".tar.bz2"))
387 "0fihlcy5hnksdxk0sn6bvgnyq8gfrgs8m794b1jxwd1dxinzg3b0"))
388 (patches (search-patches "gcc-arm-bug-71399.patch"
389 "gcc-strmov-store-file-names.patch"
390 "gcc-asan-powerpc-missing-include.patch"
391 "gcc-5.0-libvtv-runpath.patch"
392 "gcc-5-source-date-epoch-1.patch"
393 "gcc-5-source-date-epoch-2.patch"))))))
394 ;; TODO: gcc-5 doesn't need cloog.
397 ;; ,@(package-inputs gcc-4.7)))))
405 (uri (string-append "mirror://gnu/gcc/gcc-"
406 version "/gcc-" version ".tar.xz"))
409 "1m0lr7938lw5d773dkvwld90hjlcq2282517d1gwvrfzmwgg42w5"))
410 (patches (search-patches "gcc-strmov-store-file-names.patch"
411 "gcc-6-source-date-epoch-1.patch"
412 "gcc-6-source-date-epoch-2.patch"
413 "gcc-5.0-libvtv-runpath.patch"))))
416 ,@(package-inputs gcc-4.7)))))
424 (uri (string-append "mirror://gnu/gcc/gcc-"
425 version "/gcc-" version ".tar.xz"))
428 "16j7i0888j2f1yp9l0nhji6cq65dy6y4nwy8868a8njbzzwavxqw"))
429 (patches (search-patches "gcc-strmov-store-file-names.patch"
430 "gcc-5.0-libvtv-runpath.patch"))))
432 "GCC is the GNU Compiler Collection. It provides compiler front-ends
433 for several languages, including C, C++, Objective-C, Fortran, Ada, and Go.
434 It also includes runtime support libraries for these languages.")))
436 ;; Note: When changing the default gcc version, update
437 ;; the gcc-toolchain-* definitions and the gfortran definition
439 (define-public gcc gcc-5)
441 (define-public (make-libstdc++ gcc)
442 "Return a libstdc++ package based on GCC. The primary use case is when
443 using compilers other than GCC."
448 `(#:out-of-source? #t
449 #:phases (alist-cons-before
452 (chdir "libstdc++-v3"))
454 #:configure-flags `("--disable-libstdcxx-pch"
455 ,(string-append "--with-gxx-include-dir="
456 (assoc-ref %outputs "out")
458 (outputs '("out" "debug"))
461 (propagated-inputs '())
462 (synopsis "GNU C++ standard library")))
464 (define-public libstdc++-4.9
465 (make-libstdc++ gcc-4.9))
467 (define (make-libiberty gcc)
468 "Return a libiberty package based on GCC."
473 `(#:out-of-source? #t
475 (modify-phases %standard-phases
476 (add-before 'configure 'chdir
482 (lambda* (#:key outputs #:allow-other-keys)
483 (let* ((out (assoc-ref outputs "out"))
484 (lib (string-append out "/lib/"))
485 (include (string-append out "/include/")))
488 (copy-file "libiberty.a"
489 (string-append lib "libiberty.a"))
490 (copy-file "../include/libiberty.h"
491 (string-append include "libiberty.h"))
496 (propagated-inputs '())
497 (synopsis "Collection of subroutines used by various GNU programs")))
499 (define-public libiberty
500 (make-libiberty gcc))
502 (define* (custom-gcc gcc name languages
504 (search-paths (package-native-search-paths gcc))
505 #:key (separate-lib-output? #t))
506 "Return a custom version of GCC that supports LANGUAGES. Use SEARCH-PATHS
507 as the 'native-search-paths' field."
508 (package (inherit gcc)
510 (outputs (if separate-lib-output?
511 (package-outputs gcc)
512 (delete "lib" (package-outputs gcc))))
513 (native-search-paths search-paths)
515 (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
520 ,@(package-arguments gcc))
521 ((#:configure-flags flags)
522 `(cons (string-append "--enable-languages="
523 ,(string-join languages ","))
524 (remove (cut string-match "--enable-languages.*" <>)
527 `(modify-phases ,phases
528 (add-after 'install 'remove-broken-or-conflicting-files
529 (lambda* (#:key outputs #:allow-other-keys)
530 (for-each delete-file
531 (find-files (string-append (assoc-ref outputs "out") "/bin")
532 ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc.*)"))
535 (define %generic-search-paths
536 ;; This is the language-neutral search path for GCC. Entries in $CPATH are
537 ;; not considered "system headers", which means GCC can raise warnings for
538 ;; issues in those headers. 'CPATH' is the only one that works for
539 ;; front-ends not in the C family.
540 (list (search-path-specification
542 (files '("include")))
543 (search-path-specification
544 (variable "LIBRARY_PATH")
545 (files '("lib" "lib64")))))
547 (define-public gfortran-4.8
548 (custom-gcc gcc-4.8 "gfortran" '("fortran")
549 %generic-search-paths))
551 (define-public gfortran-4.9
552 (custom-gcc gcc-4.9 "gfortran" '("fortran")
553 %generic-search-paths))
555 (define-public gfortran-5
556 (custom-gcc gcc-5 "gfortran" '("fortran")
557 %generic-search-paths))
559 (define-public gfortran-6
560 (custom-gcc gcc-6 "gfortran" '("fortran")
561 %generic-search-paths))
563 (define-public gfortran-7
564 (custom-gcc gcc-7 "gfortran" '("fortran")
565 %generic-search-paths))
567 (define-public gfortran
568 ;; Note: Update this when GCC changes! We cannot use
569 ;; (custom-gcc gcc "fortran" …) because that would lead to a package object
570 ;; that is not 'eq?' with GFORTRAN-5, and thus 'fold-packages' would
571 ;; report two gfortran@5 that are in fact identical.
574 (define-public gccgo-4.9
575 (custom-gcc gcc-4.9 "gccgo" '("go")
576 %generic-search-paths
577 ;; Suppress the separate "lib" output, because otherwise the
578 ;; "lib" and "out" outputs would refer to each other, creating
579 ;; a cyclic dependency. <http://debbugs.gnu.org/18101>
580 #:separate-lib-output? #f))
582 (define-public gcc-objc-4.8
583 (custom-gcc gcc-4.8 "gcc-objc" '("objc")
584 (list (search-path-specification
585 (variable "OBJC_INCLUDE_PATH")
586 (files '("include")))
587 (search-path-specification
588 (variable "LIBRARY_PATH")
589 (files '("lib" "lib64"))))))
591 (define-public gcc-objc-4.9
592 (custom-gcc gcc-4.9 "gcc-objc" '("objc")
593 (list (search-path-specification
594 (variable "OBJC_INCLUDE_PATH")
595 (files '("include")))
596 (search-path-specification
597 (variable "LIBRARY_PATH")
598 (files '("lib" "lib64"))))))
600 (define-public gcc-objc-5
601 (custom-gcc gcc-5 "gcc-objc" '("objc")
602 (list (search-path-specification
603 (variable "OBJC_INCLUDE_PATH")
604 (files '("include")))
605 (search-path-specification
606 (variable "LIBRARY_PATH")
607 (files '("lib" "lib64"))))))
609 (define-public gcc-objc-6
610 (custom-gcc gcc-6 "gcc-objc" '("objc")
611 (list (search-path-specification
612 (variable "OBJC_INCLUDE_PATH")
613 (files '("include")))
614 (search-path-specification
615 (variable "LIBRARY_PATH")
616 (files '("lib" "lib64"))))))
618 (define-public gcc-objc-7
619 (custom-gcc gcc-7 "gcc-objc" '("objc")
620 (list (search-path-specification
621 (variable "OBJC_INCLUDE_PATH")
622 (files '("include")))
623 (search-path-specification
624 (variable "LIBRARY_PATH")
625 (files '("lib" "lib64"))))))
627 (define-public gcc-objc gcc-objc-5)
629 (define-public gcc-objc++-4.8
630 (custom-gcc gcc-4.8 "gcc-objc++" '("obj-c++")
631 (list (search-path-specification
632 (variable "OBJCPLUS_INCLUDE_PATH")
633 (files '("include")))
634 (search-path-specification
635 (variable "LIBRARY_PATH")
636 (files '("lib" "lib64"))))))
638 (define-public gcc-objc++-4.9
639 (custom-gcc gcc-4.9 "gcc-objc++" '("obj-c++")
640 (list (search-path-specification
641 (variable "OBJCPLUS_INCLUDE_PATH")
642 (files '("include")))
643 (search-path-specification
644 (variable "LIBRARY_PATH")
645 (files '("lib" "lib64"))))))
647 (define-public gcc-objc++-5
648 (custom-gcc gcc-5 "gcc-objc++" '("obj-c++")
649 (list (search-path-specification
650 (variable "OBJCPLUS_INCLUDE_PATH")
651 (files '("include")))
652 (search-path-specification
653 (variable "LIBRARY_PATH")
654 (files '("lib" "lib64"))))))
656 (define-public gcc-objc++-6
657 (custom-gcc gcc-6 "gcc-objc++" '("obj-c++")
658 (list (search-path-specification
659 (variable "OBJCPLUS_INCLUDE_PATH")
660 (files '("include")))
661 (search-path-specification
662 (variable "LIBRARY_PATH")
663 (files '("lib" "lib64"))))))
665 (define-public gcc-objc++-7
666 (custom-gcc gcc-7 "gcc-objc++" '("obj-c++")
667 (list (search-path-specification
668 (variable "OBJCPLUS_INCLUDE_PATH")
669 (files '("include")))
670 (search-path-specification
671 (variable "LIBRARY_PATH")
672 (files '("lib" "lib64"))))))
674 (define-public gcc-objc++ gcc-objc++-5)
676 (define (make-libstdc++-doc gcc)
677 "Return a package with the libstdc++ documentation for GCC."
680 (name "libstdc++-doc")
681 (version (package-version gcc))
682 (synopsis "GNU libstdc++ documentation")
684 (native-inputs `(("doxygen" ,doxygen)
688 ("docbook-xml" ,docbook-xml)
689 ("docbook-xsl" ,docbook-xsl)
690 ("graphviz" ,graphviz))) ;for 'dot', invoked by 'doxygen'
692 (propagated-inputs '())
694 '(#:out-of-source? #t
695 #:tests? #f ;it's just documentation
696 #:phases (modify-phases %standard-phases
697 (add-before 'configure 'chdir
699 (chdir "libstdc++-v3")))
700 (add-before 'configure 'set-xsl-directory
701 (lambda* (#:key inputs #:allow-other-keys)
702 (let ((docbook (assoc-ref inputs "docbook-xsl")))
703 (substitute* (find-files "doc"
708 (strip-store-file-name docbook)))))))
711 ;; XXX: There's also a 'doc-info' target, but it
712 ;; relies on docbook2X, which itself relies on
713 ;; DocBook 4.1.2, which is not really usable
714 ;; (lacks a catalog.xml.)
715 (zero? (system* "make"
719 (lambda* (#:key outputs #:allow-other-keys)
720 (let ((out (assoc-ref outputs "out")))
721 (zero? (system* "make"
723 "doc-install-man"))))))))))
725 (define-public libstdc++-doc-4.9
726 (make-libstdc++-doc gcc-4.9))
728 (define-public libstdc++-doc-5
729 (make-libstdc++-doc gcc-5))
737 (uri (list (string-append
738 "http://isl.gforge.inria.fr/isl-"
741 (string-append %gcc-infrastructure
742 name "-" version ".tar.gz")))
745 "06ybml6llhi4i56q90jnimbcgk1lpcdwhy9nxdxra2hxz3bhz2vb"))))
746 (build-system gnu-build-system)
747 (inputs `(("gmp" ,gmp)))
748 (home-page "http://isl.gforge.inria.fr/")
750 "Manipulating sets and relations of integer points \
751 bounded by linear constraints")
753 "isl is a library for manipulating sets and relations of integer points
754 bounded by linear constraints. Supported operations on sets include
755 intersection, union, set difference, emptiness check, convex hull, (integer)
756 affine hull, integer projection, computing the lexicographic minimum using
757 parametric integer programming, coalescing and parametric vertex
758 enumeration. It also includes an ILP solver based on generalized basis
759 reduction, transitive closures on maps (which may encode infinite graphs),
760 dependence analysis and bounds on piecewise step-polynomials.")
763 (define-public isl-0.11
770 (uri (list (string-append
771 "http://isl.gforge.inria.fr/isl-"
774 (string-append %gcc-infrastructure
775 name "-" version ".tar.gz")))
778 "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9"))
779 (patches (search-patches "isl-0.11.1-aarch64-support.patch"))))))
788 (uri (list (string-append
789 "http://www.bastoul.net/cloog/pages/download/count.php3?url=cloog-"
792 (string-append %gcc-infrastructure
793 name "-" version ".tar.gz")))
796 "0a12rwfwp22zd0nlld0xyql11cj390rrq1prw35yjsw8wzfshjhw"))
797 (file-name (string-append name "-" version ".tar.gz"))))
798 (build-system gnu-build-system)
799 (inputs `(("gmp" ,gmp)
801 (arguments '(#:configure-flags '("--with-isl=system")))
802 (home-page "http://www.cloog.org/")
803 (synopsis "Library to generate code for scanning Z-polyhedra")
805 "CLooG is a free software library to generate code for scanning
806 Z-polyhedra. That is, it finds a code (e.g., in C, FORTRAN...) that
807 reaches each integral point of one or more parameterized polyhedra.
808 CLooG has been originally written to solve the code generation problem
809 for optimizing compilers based on the polytope model. Nevertheless it
810 is used now in various area e.g., to build control automata for
811 high-level synthesis or to find the best polynomial approximation of a
812 function. CLooG may help in any situation where scanning polyhedra
813 matters. While the user has full control on generated code quality,
814 CLooG is designed to avoid control overhead and to produce a very
818 (define-public gnu-c-manual
820 (name "gnu-c-manual")
824 (uri (string-append "mirror://gnu/gnu-c-manual/gnu-c-manual-"
828 "1sfsj9256w18qzylgag2h5h377aq8in8929svblfnj9svfriqcys"))))
829 (build-system gnu-build-system)
830 (native-inputs `(("texinfo" ,texinfo)))
832 '(#:phases (modify-phases %standard-phases
837 (zero? (system* "make"
839 "gnu-c-manual.html"))))
841 (lambda* (#:key outputs #:allow-other-keys)
842 (let* ((out (assoc-ref outputs "out"))
843 (info (string-append out "/share/info"))
845 out "/share/doc/gnu-c-manual")))
849 (for-each (lambda (file)
851 (string-append info "/"
853 (find-files "." "\\.info(-[0-9])?$"))
854 (for-each (lambda (file)
856 (string-append html "/"
858 (find-files "." "\\.html$"))
860 (synopsis "Reference manual for the C programming language")
862 "This is a reference manual for the C programming language, as
863 implemented by the GNU C Compiler (gcc). As a reference, it is not intended
864 to be a tutorial of the language. Rather, it outlines all of the constructs
865 of the language. Library functions are not included.")
866 (home-page "https://www.gnu.org/software/gnu-c-manual/")