gnu: gcj-4.8, gcj: Update to default GCC version.
[jackhill/guix/guix.git] / gnu / packages / gcc.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages gcc)
23 #:use-module ((guix licenses)
24 #:select (gpl3+ gpl2+ lgpl2.1+ lgpl2.0+ fdl1.3+))
25 #:use-module (gnu packages)
26 #:use-module (gnu packages bootstrap)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages multiprecision)
29 #:use-module (gnu packages texinfo)
30 #:use-module (gnu packages doxygen)
31 #:use-module (gnu packages xml)
32 #:use-module (gnu packages docbook)
33 #:use-module (gnu packages graphviz)
34 #:use-module (gnu packages elf)
35 #:use-module (gnu packages perl)
36 #:use-module (guix packages)
37 #:use-module (guix download)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system trivial)
40 #:use-module (guix utils)
41 #:use-module (ice-9 regex))
42
43 (define %gcc-infrastructure
44 ;; Base URL for GCC's infrastructure.
45 "ftp://gcc.gnu.org/pub/gcc/infrastructure/")
46
47 (define (gcc-configure-flags-for-triplet target)
48 "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet.
49
50 The purpose of this procedure is to translate extended GNU triplets---e.g.,
51 where the OS part is overloaded to denote a specific ABI---into GCC
52 `configure' options. We take extended GNU triplets that glibc recognizes."
53 (cond ((string-match "^mips64el.*gnuabin?64$" target)
54 ;; Triplets recognized by glibc as denoting the N64 ABI; see
55 ;; ports/sysdeps/mips/preconfigure.
56 '("--with-abi=64"))
57
58 ((string-match "^arm.*-gnueabihf$" target)
59 '("--with-arch=armv7-a"
60 "--with-float=hard"
61 "--with-mode=thumb"
62 "--with-fpu=neon"))
63
64 (else
65 ;; TODO: Add `arm.*-gnueabi', etc.
66 '())))
67
68 (define-public gcc-4.7
69 (let* ((stripped? #t) ;whether to strip the compiler, not the libraries
70 (maybe-target-tools
71 (lambda ()
72 ;; Return the `_FOR_TARGET' variables that are needed when
73 ;; cross-compiling GCC.
74 (let ((target (%current-target-system)))
75 (if target
76 (map (lambda (var tool)
77 (string-append (string-append var "_FOR_TARGET")
78 "=" target "-" tool))
79 '("CC" "CXX" "LD" "AR" "NM" "RANLIB" "STRIP")
80 '("gcc" "g++" "ld" "ar" "nm" "ranlib" "strip"))
81 '()))))
82 (libdir
83 (let ((base '(or (assoc-ref outputs "lib")
84 (assoc-ref outputs "out"))))
85 (lambda ()
86 ;; Return the directory that contains lib/libgcc_s.so et al.
87 (if (%current-target-system)
88 `(string-append ,base "/" ,(%current-target-system))
89 base))))
90 (configure-flags
91 (lambda ()
92 ;; This is terrible. Since we have two levels of quasiquotation,
93 ;; we have to do this convoluted thing just so we can insert the
94 ;; contents of (maybe-target-tools).
95 (list 'quasiquote
96 (append
97 '("--enable-plugin"
98 "--enable-languages=c,c++"
99 "--disable-multilib"
100
101 ;; No pre-compiled libstdc++ headers, to save space.
102 "--disable-libstdcxx-pch"
103
104 "--with-local-prefix=/no-gcc-local-prefix"
105
106 ;; With a separate "lib" output, the build system
107 ;; incorrectly guesses GPLUSPLUS_INCLUDE_DIR, so force
108 ;; it. (Don't use a versioned sub-directory, that's
109 ;; unnecessary.)
110 ,(string-append "--with-gxx-include-dir="
111 (assoc-ref %outputs "out")
112 "/include/c++")
113
114 ,(let ((libc (assoc-ref %build-inputs "libc")))
115 (if libc
116 (string-append "--with-native-system-header-dir=" libc
117 "/include")
118 "--without-headers")))
119
120 ;; Pass the right options for the target triplet.
121 (let ((triplet
122 (or (%current-target-system)
123 (nix-system->gnu-triplet (%current-system)))))
124 (gcc-configure-flags-for-triplet triplet))
125
126 (maybe-target-tools))))))
127 (package
128 (name "gcc")
129 (version "4.7.4")
130 (source (origin
131 (method url-fetch)
132 (uri (string-append "mirror://gnu/gcc/gcc-"
133 version "/gcc-" version ".tar.bz2"))
134 (sha256
135 (base32
136 "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj"))))
137 (build-system gnu-build-system)
138
139 ;; Separate out the run-time support libraries because all the
140 ;; dynamic-linked objects depend on it.
141 (outputs '("out" ;commands, etc. (60+ MiB)
142 "lib" ;libgcc_s, libgomp, etc. (15+ MiB)
143 "debug")) ;debug symbols of run-time libraries
144
145 (inputs `(("gmp" ,gmp)
146 ("mpfr" ,mpfr)
147 ("mpc" ,mpc)
148 ("isl" ,isl)
149 ("cloog" ,cloog)
150 ("libelf" ,libelf)
151 ("zlib" ,zlib)))
152
153 ;; GCC is one of the few packages that doesn't ship .info files.
154 (native-inputs `(("texinfo" ,texinfo)))
155
156 (arguments
157 `(#:out-of-source? #t
158 #:configure-flags ,(configure-flags)
159 #:make-flags
160 ;; None of the flags below are needed when doing a Canadian cross.
161 ;; TODO: Simplify this.
162 ,(if (%current-target-system)
163 (if stripped?
164 ''("CFLAGS=-g0 -O2")
165 ''())
166 `(let* ((libc (assoc-ref %build-inputs "libc"))
167 (libc-native (or (assoc-ref %build-inputs "libc-native")
168 libc)))
169 `(,@(if libc
170 (list (string-append "LDFLAGS_FOR_TARGET="
171 "-B" libc "/lib "
172 "-Wl,-dynamic-linker "
173 "-Wl," libc
174 ,(glibc-dynamic-linker)))
175 '())
176
177 ;; Native programs like 'genhooks' also need that right.
178 ,(string-append "LDFLAGS="
179 "-Wl,-rpath=" libc-native "/lib "
180 "-Wl,-dynamic-linker "
181 "-Wl," libc-native ,(glibc-dynamic-linker))
182 ,(string-append "BOOT_CFLAGS=-O2 "
183 ,(if stripped? "-g0" "-g")))))
184
185 #:tests? #f
186
187 #:phases
188 (alist-cons-before
189 'configure 'pre-configure
190 (lambda* (#:key inputs outputs #:allow-other-keys)
191 (let ((libdir ,(libdir))
192 (libc (assoc-ref inputs "libc")))
193 (when libc
194 ;; The following is not performed for `--without-headers'
195 ;; cross-compiler builds.
196
197 ;; Join multi-line definitions of GLIBC_DYNAMIC_LINKER* into a
198 ;; single line, to allow the next step to work properly.
199 (for-each
200 (lambda (x)
201 (substitute* (find-files "gcc/config"
202 "^linux(64|-elf|-eabi)?\\.h$")
203 (("(#define GLIBC_DYNAMIC_LINKER.*)\\\\\n$" _ line)
204 line)))
205 '(1 2 3))
206
207 ;; Fix the dynamic linker's file name.
208 (substitute* (find-files "gcc/config"
209 "^(linux|gnu)(64|-elf|-eabi)?\\.h$")
210 (("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix)
211 (format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%"
212 suffix
213 (string-append libc ,(glibc-dynamic-linker)))))
214
215 ;; Tell where to find libstdc++, libc, and `?crt*.o', except
216 ;; `crt{begin,end}.o', which come with GCC.
217 (substitute* (find-files "gcc/config"
218 "^gnu-user.*\\.h$")
219 (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix)
220 ;; Help libgcc_s.so be found (see also below.) Always use
221 ;; '-lgcc_s' so that libgcc_s.so is always found by those
222 ;; programs that use 'pthread_cancel' (glibc dlopens
223 ;; libgcc_s.so when pthread_cancel support is needed, but
224 ;; having it in the application's RUNPATH isn't enough; see
225 ;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.)
226 ;;
227 ;; NOTE: The '-lgcc_s' added below needs to be removed in a
228 ;; later phase of %gcc-static. If you change the string
229 ;; below, make sure to update the relevant code in
230 ;; %gcc-static package as needed.
231 (format #f "#define GNU_USER_TARGET_LIB_SPEC \
232 \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
233 libc libc libdir suffix))
234 (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line)
235 (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
236 #define STANDARD_STARTFILE_PREFIX_2 \"\"
237 ~a"
238 libc line))))
239
240 ;; Don't retain a dependency on the build-time sed.
241 (substitute* "fixincludes/fixincl.x"
242 (("static char const sed_cmd_z\\[\\] =.*;")
243 "static char const sed_cmd_z[] = \"sed\";"))
244
245 (when (file-exists? "libbacktrace")
246 ;; GCC 4.8+ comes with libbacktrace. By default it builds
247 ;; with -Werror, which fails with a -Wcast-qual error in glibc
248 ;; 2.21's stdlib-bsearch.h. Remove -Werror.
249 (substitute* "libbacktrace/configure"
250 (("WARN_FLAGS=(.*)-Werror" _ flags)
251 (string-append "WARN_FLAGS=" flags)))
252
253 (when (file-exists? "libsanitizer/libbacktrace")
254 ;; Same in libsanitizer's bundled copy (!) found in 4.9+.
255 (substitute* "libsanitizer/libbacktrace/Makefile.in"
256 (("-Werror")
257 ""))))
258
259 ;; Add a RUNPATH to libstdc++.so so that it finds libgcc_s.
260 ;; See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354>
261 ;; and <http://bugs.gnu.org/20358>.
262 (substitute* "libstdc++-v3/src/Makefile.in"
263 (("^OPT_LDFLAGS = ")
264 "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
265
266 ;; Move libstdc++*-gdb.py to the "lib" output to avoid a
267 ;; circularity between "out" and "lib". (Note:
268 ;; --with-python-dir is useless because it imposes $(prefix) as
269 ;; the parent directory.)
270 (substitute* "libstdc++-v3/python/Makefile.in"
271 (("pythondir = .*$")
272 (string-append "pythondir = " libdir "/share"
273 "/gcc-$(gcc_version)/python\n")))
274
275 ;; Avoid another circularity between the outputs: this #define
276 ;; ends up in auto-host.h in the "lib" output, referring to
277 ;; "out". (This variable is used to augment cpp's search path,
278 ;; but there's nothing useful to look for here.)
279 (substitute* "gcc/config.in"
280 (("PREFIX_INCLUDE_DIR")
281 "PREFIX_INCLUDE_DIR_isnt_necessary_here"))))
282
283 (alist-cons-after
284 'configure 'post-configure
285 (lambda _
286 ;; Don't store configure flags, to avoid retaining references to
287 ;; build-time dependencies---e.g., `--with-ppl=/gnu/store/xxx'.
288 (substitute* "Makefile"
289 (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
290 "TOPLEVEL_CONFIGURE_ARGUMENTS=\n")))
291 %standard-phases))))
292
293 (native-search-paths
294 (list (search-path-specification
295 (variable "CPATH")
296 (files '("include")))
297 (search-path-specification
298 (variable "LIBRARY_PATH")
299 (files '("lib" "lib64")))))
300
301 (properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
302 (synopsis "GNU Compiler Collection")
303 (description
304 "GCC is the GNU Compiler Collection. It provides compiler front-ends
305 for several languages, including C, C++, Objective-C, Fortran, Java, Ada, and
306 Go. It also includes runtime support libraries for these languages.")
307 (license gpl3+)
308 (home-page "http://gcc.gnu.org/"))))
309
310 (define-public gcc-4.8
311 (package (inherit gcc-4.7)
312 (version "4.8.5")
313 (source (origin
314 (method url-fetch)
315 (uri (string-append "mirror://gnu/gcc/gcc-"
316 version "/gcc-" version ".tar.bz2"))
317 (sha256
318 (base32
319 "08yggr18v373a1ihj0rg2vd6psnic42b518xcgp3r9k81xz1xyr2"))
320 (patches (list (search-patch "gcc-arm-link-spec-fix.patch")))))))
321
322 (define-public gcc-4.9
323 (package (inherit gcc-4.8)
324 (version "4.9.3")
325 (source (origin
326 (method url-fetch)
327 (uri (string-append "mirror://gnu/gcc/gcc-"
328 version "/gcc-" version ".tar.bz2"))
329 (sha256
330 (base32
331 "0zmnm00d2a1hsd41g34bhvxzvxisa2l584q3p447bd91lfjv4ci3"))
332 (patches (list (search-patch "gcc-libvtv-runpath.patch")))))))
333
334 (define-public gcc-5
335 (package (inherit gcc-4.9)
336 (version "5.2.0")
337 (source (origin
338 (method url-fetch)
339 (uri (string-append "mirror://gnu/gcc/gcc-"
340 version "/gcc-" version ".tar.bz2"))
341 (sha256
342 (base32
343 "1bccp8a106xwz3wkixn65ngxif112vn90qf95m6lzpgpnl25p0sz"))
344 (patches (list (search-patch "gcc-5.0-libvtv-runpath.patch")))))))
345
346 (define-public gcc gcc-4.9)
347
348 (define-public (make-libstdc++ gcc)
349 "Return a libstdc++ package based on GCC. The primary use case is when
350 using compilers other than GCC."
351 (package
352 (inherit gcc)
353 (name "libstdc++")
354 (arguments
355 `(#:out-of-source? #t
356 #:phases (alist-cons-before
357 'configure 'chdir
358 (lambda _
359 (chdir "libstdc++-v3"))
360 %standard-phases)
361 #:configure-flags `("--disable-libstdcxx-pch"
362 ,(string-append "--with-gxx-include-dir="
363 (assoc-ref %outputs "out")
364 "/include"))))
365 (outputs '("out" "debug"))
366 (inputs '())
367 (native-inputs '())
368 (propagated-inputs '())
369 (synopsis "GNU C++ standard library")))
370
371 (define-public libstdc++-4.9
372 (make-libstdc++ gcc-4.9))
373
374 (define (make-libiberty gcc)
375 "Return a libiberty package based on GCC."
376 (package
377 (inherit gcc)
378 (name "libiberty")
379 (arguments
380 `(#:out-of-source? #t
381 #:phases
382 (modify-phases %standard-phases
383 (add-before 'configure 'chdir
384 (lambda _
385 (chdir "libiberty")
386 #t))
387 (replace
388 'install
389 (lambda* (#:key outputs #:allow-other-keys)
390 (let* ((out (assoc-ref outputs "out"))
391 (lib (string-append out "/lib/"))
392 (include (string-append out "/include/")))
393 (mkdir-p lib)
394 (mkdir-p include)
395 (copy-file "libiberty.a"
396 (string-append lib "libiberty.a"))
397 (copy-file "../include/libiberty.h"
398 (string-append include "libiberty.h"))
399 #t))))))
400 (inputs '())
401 (outputs '("out"))
402 (native-inputs '())
403 (propagated-inputs '())
404 (synopsis "Collection of subroutines used by various GNU programs")))
405
406 (define-public libiberty
407 (make-libiberty gcc))
408
409 (define* (custom-gcc gcc name languages #:key (separate-lib-output? #t))
410 "Return a custom version of GCC that supports LANGUAGES."
411 (package (inherit gcc)
412 (name name)
413 (outputs (if separate-lib-output?
414 (package-outputs gcc)
415 (delete "lib" (package-outputs gcc))))
416 (arguments
417 (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
418 (guix build utils)
419 (ice-9 regex)
420 (srfi srfi-1)
421 (srfi srfi-26))
422 ,@(package-arguments gcc))
423 ((#:configure-flags flags)
424 `(cons (string-append "--enable-languages="
425 ,(string-join languages ","))
426 (remove (cut string-match "--enable-languages.*" <>)
427 ,flags)))))))
428
429 (define-public gfortran-4.8
430 (custom-gcc gcc-4.8 "gfortran" '("fortran")))
431
432 (define-public gfortran-4.9
433 (custom-gcc gcc-4.9 "gfortran" '("fortran")))
434
435 (define-public gfortran
436 (custom-gcc gcc "gfortran" '("fortran")))
437
438 (define-public gccgo-4.8
439 (custom-gcc gcc-4.8 "gccgo" '("go")
440 ;; Suppress the separate "lib" output, because otherwise the
441 ;; "lib" and "out" outputs would refer to each other, creating
442 ;; a cyclic dependency. <http://debbugs.gnu.org/18101>
443 #:separate-lib-output? #f))
444
445 (define javac.in
446 (origin
447 (method url-fetch)
448 (uri (string-append "http://sources.gentoo.org/cgi-bin/viewvc.cgi/"
449 "gentoo-x86/dev-java/gcj-jdk/files/javac.in?revision=1.1"))
450 (file-name "javac.in")
451 (sha256 (base32
452 "1c3dk4z5yfj6ic2fn3lyxs27n6pmn2wy9k0r1s17lnkf1bzkrciv"))))
453
454 (define-public gcj
455 (package (inherit gcc)
456 (name "gcj")
457 (inputs
458 `(("fastjar" ,fastjar)
459 ("perl" ,perl)
460 ("javac.in" ,javac.in)
461 ("ecj-bootstrap" ,ecj-bootstrap)
462 ,@(package-inputs gcc)))
463 ;; Suppress the separate "lib" output, because otherwise the
464 ;; "lib" and "out" outputs would refer to each other, creating
465 ;; a cyclic dependency. <http://debbugs.gnu.org/18101>
466 (outputs
467 (delete "lib" (package-outputs gcc)))
468 (arguments
469 (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
470 (guix build utils)
471 (ice-9 regex)
472 (srfi srfi-1)
473 (srfi srfi-26))
474 ,@(package-arguments gcc))
475 ((#:configure-flags flags)
476 `(let ((ecj (assoc-ref %build-inputs "ecj-bootstrap")))
477 `("--enable-java-home"
478 "--enable-gjdoc"
479 ,(string-append "--with-ecj-jar=" ecj)
480 "--enable-languages=java"
481 ,@(remove (cut string-match "--enable-languages.*" <>)
482 ,flags))))
483 ((#:phases phases)
484 `(modify-phases ,phases
485 (add-after
486 'unpack 'add-lib-output-to-rpath
487 (lambda _
488 (substitute* "libjava/Makefile.in"
489 (("libgcj_bc_dummy_LINK = .* -shared" line)
490 (string-append line " -Wl,-rpath=$(libdir)"))
491 (("libgcj(_bc)?_la_LDFLAGS =" ldflags _)
492 (string-append ldflags " -Wl,-rpath=$(libdir)")))))
493 (add-after
494 'install 'install-javac-and-javap-wrappers
495 (lambda _
496 (let* ((javac (assoc-ref %build-inputs "javac.in"))
497 (ecj (assoc-ref %build-inputs "ecj-bootstrap"))
498 (gcj (assoc-ref %outputs "out"))
499 (gcjbin (string-append gcj "/bin/"))
500 (jvm (string-append gcj "/lib/jvm/"))
501 (target (string-append jvm "/bin/javac")))
502
503 (symlink (string-append gcjbin "jcf-dump")
504 (string-append jvm "/bin/javap"))
505
506 (copy-file ecj (string-append gcj "/share/java/ecj.jar"))
507
508 ;; Create javac wrapper from the template javac.in by
509 ;; replacing the @VARIABLES@ with paths.
510 (copy-file javac target)
511 (patch-shebang target)
512 (substitute* target
513 (("@JAVA@")
514 (string-append jvm "/bin/java"))
515 (("@ECJ_JAR@")
516 (string-append gcj "/share/java/ecj.jar"))
517 (("@RT_JAR@")
518 (string-append jvm "/jre/lib/rt.jar"))
519 (("@TOOLS_JAR@")
520 (string-append jvm "/lib/tools.jar")))
521 (chmod target #o755)
522 #t)))
523 (add-after
524 'install 'remove-broken-or-conflicting-files
525 (lambda _
526 (let ((out (assoc-ref %outputs "out")))
527 (for-each
528 delete-file
529 (append (find-files (string-append out "/lib/jvm/jre/lib")
530 "libjawt.so")
531 (find-files (string-append out "/bin")
532 ".*(c\\+\\+|cpp|g\\+\\+|gcc.*)"))))
533 #t))))))))
534
535 (define ecj-bootstrap
536 (origin
537 (method url-fetch)
538 (uri "ftp://sourceware.org/pub/java/ecj-4.9.jar")
539 (sha256
540 (base32
541 "1k9lgm3qamf6zy534pa2zwskr8mpiqrngbv1vw9j4y1ghrdyf1lm"))))
542
543 (define-public gcc-objc-4.8
544 (custom-gcc gcc-4.8 "gcc-objc" '("objc")))
545
546 (define-public gcc-objc++-4.8
547 (custom-gcc gcc-4.8 "gcc-objc++" '("obj-c++")))
548
549 (define (make-libstdc++-doc gcc)
550 "Return a package with the libstdc++ documentation for GCC."
551 (package
552 (inherit gcc)
553 (name "libstdc++-doc")
554 (version (package-version gcc))
555 (synopsis "GNU libstdc++ documentation")
556 (outputs '("out"))
557 (native-inputs `(("doxygen" ,doxygen)
558 ("texinfo" ,texinfo)
559 ("libxml2" ,libxml2)
560 ("libxslt" ,libxslt)
561 ("docbook-xml" ,docbook-xml)
562 ("docbook-xsl" ,docbook-xsl)
563 ("graphviz" ,graphviz))) ;for 'dot', invoked by 'doxygen'
564 (inputs '())
565 (propagated-inputs '())
566 (arguments
567 '(#:out-of-source? #t
568 #:tests? #f ;it's just documentation
569 #:phases (modify-phases %standard-phases
570 (add-before 'configure 'chdir
571 (lambda _
572 (chdir "libstdc++-v3")))
573 (add-before 'configure 'set-xsl-directory
574 (lambda* (#:key inputs #:allow-other-keys)
575 (let ((docbook (assoc-ref inputs "docbook-xsl")))
576 (substitute* (find-files "doc"
577 "^Makefile\\.in$")
578 (("@XSL_STYLE_DIR@")
579 (string-append
580 docbook "/xml/xsl/"
581 (strip-store-file-name docbook)))))))
582 (replace 'build
583 (lambda _
584 ;; XXX: There's also a 'doc-info' target, but it
585 ;; relies on docbook2X, which itself relies on
586 ;; DocBook 4.1.2, which is not really usable
587 ;; (lacks a catalog.xml.)
588 (zero? (system* "make"
589 "doc-html"
590 "doc-man"))))
591 (replace 'install
592 (lambda* (#:key outputs #:allow-other-keys)
593 (let ((out (assoc-ref outputs "out")))
594 (zero? (system* "make"
595 "doc-install-html"
596 "doc-install-man"))))))))))
597
598 (define-public libstdc++-doc-4.9
599 (make-libstdc++-doc gcc-4.9))
600
601 (define-public libstdc++-doc-5
602 (make-libstdc++-doc gcc-5))
603
604 (define-public isl
605 (package
606 (name "isl")
607 (version "0.11.1")
608 (source (origin
609 (method url-fetch)
610 (uri (list (string-append
611 "http://isl.gforge.inria.fr/isl-"
612 version
613 ".tar.bz2")
614 (string-append %gcc-infrastructure
615 name "-" version ".tar.gz")))
616 (sha256
617 (base32
618 "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9"))))
619 (build-system gnu-build-system)
620 (inputs `(("gmp" ,gmp)))
621 (home-page "http://isl.gforge.inria.fr/")
622 (synopsis
623 "Manipulating sets and relations of integer points \
624 bounded by linear constraints")
625 (description
626 "isl is a library for manipulating sets and relations of integer points
627 bounded by linear constraints. Supported operations on sets include
628 intersection, union, set difference, emptiness check, convex hull, (integer)
629 affine hull, integer projection, computing the lexicographic minimum using
630 parametric integer programming, coalescing and parametric vertex
631 enumeration. It also includes an ILP solver based on generalized basis
632 reduction, transitive closures on maps (which may encode infinite graphs),
633 dependence analysis and bounds on piecewise step-polynomials.")
634 (license lgpl2.1+)))
635
636 (define-public cloog
637 (package
638 (name "cloog")
639 (version "0.18.0")
640 (source
641 (origin
642 (method url-fetch)
643 (uri (list (string-append
644 "http://www.bastoul.net/cloog/pages/download/count.php3?url=cloog-"
645 version
646 ".tar.gz")
647 (string-append %gcc-infrastructure
648 name "-" version ".tar.gz")))
649 (sha256
650 (base32
651 "0a12rwfwp22zd0nlld0xyql11cj390rrq1prw35yjsw8wzfshjhw"))
652 (file-name (string-append name "-" version ".tar.gz"))))
653 (build-system gnu-build-system)
654 (inputs `(("gmp" ,gmp)
655 ("isl" ,isl)))
656 (arguments '(#:configure-flags '("--with-isl=system")))
657 (home-page "http://www.cloog.org/")
658 (synopsis "Library to generate code for scanning Z-polyhedra")
659 (description
660 "CLooG is a free software library to generate code for scanning
661 Z-polyhedra. That is, it finds a code (e.g., in C, FORTRAN...) that
662 reaches each integral point of one or more parameterized polyhedra.
663 CLooG has been originally written to solve the code generation problem
664 for optimizing compilers based on the polytope model. Nevertheless it
665 is used now in various area e.g., to build control automata for
666 high-level synthesis or to find the best polynomial approximation of a
667 function. CLooG may help in any situation where scanning polyhedra
668 matters. While the user has full control on generated code quality,
669 CLooG is designed to avoid control overhead and to produce a very
670 effective code.")
671 (license gpl2+)))
672
673 (define-public gnu-c-manual
674 (package
675 (name "gnu-c-manual")
676 (version "0.2.4")
677 (source (origin
678 (method url-fetch)
679 (uri (string-append "mirror://gnu/gnu-c-manual/gnu-c-manual-"
680 version ".tar.gz"))
681 (sha256
682 (base32
683 "0cf4503shr7hxkbrjfi9dky6q2lqk95bgbgbjmvj2s2x312kakd9"))))
684 (build-system gnu-build-system)
685 (native-inputs `(("texinfo" ,texinfo)))
686 (arguments
687 '(#:phases (modify-phases %standard-phases
688 (delete 'configure)
689 (delete 'check)
690 (replace 'build
691 (lambda _
692 (zero? (system* "make"
693 "gnu-c-manual.info"
694 "gnu-c-manual.html"))))
695 (replace 'install
696 (lambda* (#:key outputs #:allow-other-keys)
697 (let* ((out (assoc-ref outputs "out"))
698 (info (string-append out "/share/info"))
699 (html (string-append
700 out "/share/doc/gnu-c-manual")))
701 (mkdir-p info)
702 (mkdir-p html)
703
704 (for-each (lambda (file)
705 (copy-file file
706 (string-append info "/"
707 file)))
708 (find-files "." "\\.info(-[0-9])?$"))
709 (for-each (lambda (file)
710 (copy-file file
711 (string-append html "/"
712 file)))
713 (find-files "." "\\.html$"))
714 #t))))))
715 (synopsis "Reference manual for the C programming language")
716 (description
717 "This is a reference manual for the C programming language, as
718 implemented by the GNU C Compiler (gcc). As a reference, it is not intended
719 to be a tutorial of the language. Rather, it outlines all of the constructs
720 of the language. Library functions are not included.")
721 (home-page "http://www.gnu.org/software/gnu-c-manual")
722 (license fdl1.3+)))