Commit | Line | Data |
---|---|---|
e9c0b944 | 1 | ;;; GNU Guix --- Functional package management for GNU |
61af1014 | 2 | ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
270b501e | 3 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> |
e2808a4a | 4 | ;;; Copyright © 2014 Ricardo Wurmus <rekado@elephly.net> |
ed2b1c4f | 5 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> |
e9c0b944 LC |
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) | |
c6d7e299 LC |
23 | #:use-module ((guix licenses) |
24 | #:select (gpl3+ gpl2+ lgpl2.1+ lgpl2.0+)) | |
e9c0b944 LC |
25 | #:use-module (gnu packages) |
26 | #:use-module (gnu packages bootstrap) | |
27 | #:use-module (gnu packages compression) | |
28 | #:use-module (gnu packages multiprecision) | |
c8ebc821 | 29 | #:use-module (gnu packages texinfo) |
3e778ad3 | 30 | #:use-module (gnu packages elf) |
38cf2ba0 | 31 | #:use-module (gnu packages perl) |
e9c0b944 LC |
32 | #:use-module (guix packages) |
33 | #:use-module (guix download) | |
ca16cb96 | 34 | #:use-module (guix build-system gnu) |
74574fd1 | 35 | #:use-module (guix build-system trivial) |
fdd6c726 | 36 | #:use-module (guix utils) |
ca16cb96 | 37 | #:use-module (ice-9 regex)) |
e9c0b944 | 38 | |
832abc76 LC |
39 | (define %gcc-infrastructure |
40 | ;; Base URL for GCC's infrastructure. | |
41 | "ftp://gcc.gnu.org/pub/gcc/infrastructure/") | |
42 | ||
76e639a0 | 43 | (define (gcc-configure-flags-for-triplet target) |
ca16cb96 LC |
44 | "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet. |
45 | ||
46 | The purpose of this procedure is to translate extended GNU triplets---e.g., | |
47 | where the OS part is overloaded to denote a specific ABI---into GCC | |
48 | `configure' options. We take extended GNU triplets that glibc recognizes." | |
49 | (cond ((string-match "^mips64el.*gnuabin?64$" target) | |
50 | ;; Triplets recognized by glibc as denoting the N64 ABI; see | |
51 | ;; ports/sysdeps/mips/preconfigure. | |
52 | '("--with-abi=64")) | |
3f00ff8b MW |
53 | |
54 | ((string-match "^arm.*-gnueabihf$" target) | |
55 | '("--with-arch=armv7-a" | |
56 | "--with-float=hard" | |
57 | "--with-mode=thumb" | |
58 | ||
59 | ;; See <https://wiki.debian.org/ArmHardFloatPort/VfpComparison#FPU> | |
60 | "--with-fpu=vfpv3-d16")) | |
61 | ||
ca16cb96 | 62 | (else |
3f00ff8b | 63 | ;; TODO: Add `arm.*-gnueabi', etc. |
ca16cb96 LC |
64 | '()))) |
65 | ||
e9c0b944 | 66 | (define-public gcc-4.7 |
de1d41f9 | 67 | (let* ((stripped? #t) ; TODO: make this a parameter |
6b9229ca | 68 | (install-target |
5c860cec LC |
69 | (lambda () |
70 | ;; The 'install-strip' rule uses the native 'strip' instead of | |
71 | ;; 'TARGET-strip' when cross-compiling. Thus, use 'install' in that | |
72 | ;; case. | |
73 | (if (and stripped? (not (%current-target-system))) | |
74 | "install-strip" | |
75 | "install"))) | |
de1d41f9 LC |
76 | (maybe-target-tools |
77 | (lambda () | |
78 | ;; Return the `_FOR_TARGET' variables that are needed when | |
79 | ;; cross-compiling GCC. | |
80 | (let ((target (%current-target-system))) | |
81 | (if target | |
82 | (map (lambda (var tool) | |
83 | (string-append (string-append var "_FOR_TARGET") | |
84 | "=" target "-" tool)) | |
85 | '("CC" "CXX" "LD" "AR" "NM" "RANLIB" "STRIP") | |
86 | '("gcc" "g++" "ld" "ar" "nm" "ranlib" "strip")) | |
87 | '())))) | |
7e3c9f74 LC |
88 | (libdir |
89 | (let ((base '(or (assoc-ref outputs "lib") | |
90 | (assoc-ref outputs "out")))) | |
91 | (lambda () | |
92 | ;; Return the directory that contains lib/libgcc_s.so et al. | |
93 | (if (%current-target-system) | |
94 | `(string-append ,base "/" ,(%current-target-system)) | |
95 | base)))) | |
de1d41f9 LC |
96 | (configure-flags |
97 | (lambda () | |
98 | ;; This is terrible. Since we have two levels of quasiquotation, | |
99 | ;; we have to do this convoluted thing just so we can insert the | |
100 | ;; contents of (maybe-target-tools). | |
101 | (list 'quasiquote | |
102 | (append | |
103 | '("--enable-plugin" | |
104 | "--enable-languages=c,c++" | |
105 | "--disable-multilib" | |
106 | ||
06213498 LC |
107 | ;; No pre-compiled libstdc++ headers, to save space. |
108 | "--disable-libstdcxx-pch" | |
109 | ||
de1d41f9 LC |
110 | "--with-local-prefix=/no-gcc-local-prefix" |
111 | ||
84e6756c LC |
112 | ;; With a separate "lib" output, the build system |
113 | ;; incorrectly guesses GPLUSPLUS_INCLUDE_DIR, so force | |
114 | ;; it. (Don't use a versioned sub-directory, that's | |
115 | ;; unnecessary.) | |
116 | ,(string-append "--with-gxx-include-dir=" | |
117 | (assoc-ref %outputs "out") | |
118 | "/include/c++") | |
119 | ||
de1d41f9 LC |
120 | ,(let ((libc (assoc-ref %build-inputs "libc"))) |
121 | (if libc | |
122 | (string-append "--with-native-system-header-dir=" libc | |
123 | "/include") | |
124 | "--without-headers"))) | |
125 | ||
76e639a0 MW |
126 | ;; Pass the right options for the target triplet. |
127 | (let ((triplet | |
128 | (or (%current-target-system) | |
129 | (nix-system->gnu-triplet (%current-system))))) | |
130 | (gcc-configure-flags-for-triplet triplet)) | |
ca16cb96 | 131 | |
de1d41f9 | 132 | (maybe-target-tools)))))) |
e9c0b944 | 133 | (package |
de1d41f9 | 134 | (name "gcc") |
d2e2f142 | 135 | (version "4.7.4") |
de1d41f9 LC |
136 | (source (origin |
137 | (method url-fetch) | |
138 | (uri (string-append "mirror://gnu/gcc/gcc-" | |
139 | version "/gcc-" version ".tar.bz2")) | |
140 | (sha256 | |
141 | (base32 | |
d2e2f142 | 142 | "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj")))) |
de1d41f9 | 143 | (build-system gnu-build-system) |
84e6756c LC |
144 | |
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 | ||
de1d41f9 LC |
150 | (inputs `(("gmp" ,gmp) |
151 | ("mpfr" ,mpfr) | |
152 | ("mpc" ,mpc) | |
153 | ("isl" ,isl) | |
154 | ("cloog" ,cloog) | |
155 | ("libelf" ,libelf) | |
156 | ("zlib" ,zlib))) | |
c8ebc821 LC |
157 | |
158 | ;; GCC is one of the few packages that doesn't ship .info files. | |
159 | (native-inputs `(("texinfo" ,texinfo))) | |
160 | ||
de1d41f9 LC |
161 | (arguments |
162 | `(#:out-of-source? #t | |
163 | #:strip-binaries? ,stripped? | |
164 | #:configure-flags ,(configure-flags) | |
165 | #:make-flags | |
fd0b2766 LC |
166 | ;; None of the flags below are needed when doing a Canadian cross. |
167 | ;; TODO: Simplify this. | |
168 | ,(if (%current-target-system) | |
169 | (if stripped? | |
170 | ''("CFLAGS=-g0 -O2") | |
171 | ''()) | |
172 | `(let* ((libc (assoc-ref %build-inputs "libc")) | |
173 | (libc-native (or (assoc-ref %build-inputs "libc-native") | |
174 | libc))) | |
175 | `(,@(if libc | |
176 | (list (string-append "LDFLAGS_FOR_TARGET=" | |
177 | "-B" libc "/lib " | |
178 | "-Wl,-dynamic-linker " | |
179 | "-Wl," libc | |
180 | ,(glibc-dynamic-linker))) | |
181 | '()) | |
182 | ||
183 | ;; Native programs like 'genhooks' also need that right. | |
184 | ,(string-append "LDFLAGS=" | |
185 | "-Wl,-rpath=" libc-native "/lib " | |
186 | "-Wl,-dynamic-linker " | |
187 | "-Wl," libc-native ,(glibc-dynamic-linker)) | |
188 | ,(string-append "BOOT_CFLAGS=-O2 " | |
189 | ,(if stripped? "-g0" "-g"))))) | |
de1d41f9 LC |
190 | |
191 | #:tests? #f | |
dfc8bb20 | 192 | |
de1d41f9 LC |
193 | #:phases |
194 | (alist-cons-before | |
195 | 'configure 'pre-configure | |
196 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
7e3c9f74 | 197 | (let ((libdir ,(libdir)) |
84e6756c | 198 | (libc (assoc-ref inputs "libc"))) |
de1d41f9 LC |
199 | (when libc |
200 | ;; The following is not performed for `--without-headers' | |
201 | ;; cross-compiler builds. | |
202 | ||
91c47bef MW |
203 | ;; Join multi-line definitions of GLIBC_DYNAMIC_LINKER* into a |
204 | ;; single line, to allow the next step to work properly. | |
205 | (for-each | |
206 | (lambda (x) | |
207 | (substitute* (find-files "gcc/config" | |
3f00ff8b | 208 | "^linux(64|-elf|-eabi)?\\.h$") |
91c47bef MW |
209 | (("(#define GLIBC_DYNAMIC_LINKER.*)\\\\\n$" _ line) |
210 | line))) | |
211 | '(1 2 3)) | |
212 | ||
de1d41f9 LC |
213 | ;; Fix the dynamic linker's file name. |
214 | (substitute* (find-files "gcc/config" | |
3f00ff8b | 215 | "^linux(64|-elf|-eabi)?\\.h$") |
de1d41f9 LC |
216 | (("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix) |
217 | (format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%" | |
218 | suffix | |
219 | (string-append libc ,(glibc-dynamic-linker))))) | |
220 | ||
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" | |
06213498 LC |
224 | "^gnu-user.*\\.h$") |
225 | (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix) | |
fa1e2f3d MW |
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 | |
a7bf595f | 231 | ;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.) |
270b501e MW |
232 | ;; |
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. | |
06213498 | 237 | (format #f "#define GNU_USER_TARGET_LIB_SPEC \ |
fa1e2f3d | 238 | \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib -lgcc_s}} \" ~a" |
84e6756c | 239 | libc libc libdir libdir suffix)) |
06213498 | 240 | (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line) |
de1d41f9 | 241 | (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\" |
e9c0b944 | 242 | #define STANDARD_STARTFILE_PREFIX_2 \"\" |
06213498 | 243 | ~a" |
de1d41f9 LC |
244 | libc line)))) |
245 | ||
246 | ;; Don't retain a dependency on the build-time sed. | |
247 | (substitute* "fixincludes/fixincl.x" | |
248 | (("static char const sed_cmd_z\\[\\] =.*;") | |
84e6756c LC |
249 | "static char const sed_cmd_z[] = \"sed\";")) |
250 | ||
21e583de LC |
251 | ;; Add a RUNPATH to libstdc++.so so that it finds libgcc_s. |
252 | ;; See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354> | |
253 | ;; and <http://bugs.gnu.org/20358>. | |
254 | (substitute* "libstdc++-v3/src/Makefile.in" | |
255 | (("^OPT_LDFLAGS = ") | |
256 | "OPT_LDFLAGS = -Wl,-rpath=$(libdir) ")) | |
257 | ||
84e6756c LC |
258 | ;; Move libstdc++*-gdb.py to the "lib" output to avoid a |
259 | ;; circularity between "out" and "lib". (Note: | |
260 | ;; --with-python-dir is useless because it imposes $(prefix) as | |
261 | ;; the parent directory.) | |
262 | (substitute* "libstdc++-v3/python/Makefile.in" | |
263 | (("pythondir = .*$") | |
264 | (string-append "pythondir = " libdir "/share" | |
265 | "/gcc-$(gcc_version)/python\n"))) | |
266 | ||
267 | ;; Avoid another circularity between the outputs: this #define | |
268 | ;; ends up in auto-host.h in the "lib" output, referring to | |
269 | ;; "out". (This variable is used to augment cpp's search path, | |
270 | ;; but there's nothing useful to look for here.) | |
271 | (substitute* "gcc/config.in" | |
272 | (("PREFIX_INCLUDE_DIR") | |
273 | "PREFIX_INCLUDE_DIR_isnt_necessary_here")))) | |
de1d41f9 LC |
274 | |
275 | (alist-cons-after | |
276 | 'configure 'post-configure | |
277 | (lambda _ | |
278 | ;; Don't store configure flags, to avoid retaining references to | |
6f58d582 | 279 | ;; build-time dependencies---e.g., `--with-ppl=/gnu/store/xxx'. |
de1d41f9 LC |
280 | (substitute* "Makefile" |
281 | (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest) | |
282 | "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))) | |
283 | (alist-replace 'install | |
284 | (lambda* (#:key outputs #:allow-other-keys) | |
285 | (zero? | |
5c860cec | 286 | (system* "make" ,(install-target)))) |
de1d41f9 LC |
287 | %standard-phases))))) |
288 | ||
289 | (native-search-paths | |
290 | (list (search-path-specification | |
291 | (variable "CPATH") | |
af070955 | 292 | (files '("include"))) |
de1d41f9 LC |
293 | (search-path-specification |
294 | (variable "LIBRARY_PATH") | |
af070955 | 295 | (files '("lib" "lib64"))))) |
de1d41f9 LC |
296 | |
297 | (properties `((gcc-libc . ,(assoc-ref inputs "libc")))) | |
298 | (synopsis "GNU Compiler Collection") | |
299 | (description | |
a22dc0c4 LC |
300 | "GCC is the GNU Compiler Collection. It provides compiler front-ends |
301 | for several languages, including C, C++, Objective-C, Fortran, Java, Ada, and | |
79c311b8 | 302 | Go. It also includes runtime support libraries for these languages.") |
de1d41f9 LC |
303 | (license gpl3+) |
304 | (home-page "http://gcc.gnu.org/")))) | |
832abc76 | 305 | |
3b401612 | 306 | (define-public gcc-4.8 |
3b401612 | 307 | (package (inherit gcc-4.7) |
0d12bc74 | 308 | (version "4.8.4") |
3b401612 | 309 | (source (origin |
7e35b9dd LC |
310 | (method url-fetch) |
311 | (uri (string-append "mirror://gnu/gcc/gcc-" | |
312 | version "/gcc-" version ".tar.bz2")) | |
313 | (sha256 | |
314 | (base32 | |
315 | "15c6gwm6dzsaagamxkak5smdkf1rdfbqqjs9jdbrp3lbg4ism02a")) | |
9e759402 LC |
316 | |
317 | ;; ARM 'link' spec issue reported at | |
318 | ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65711> and | |
319 | ;; <https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01387.html>. | |
7e35b9dd | 320 | (patches (list (search-patch "gcc-arm-link-spec-fix.patch"))))))) |
3b401612 | 321 | |
571aa6cd | 322 | (define-public gcc-4.9 |
7e35b9dd | 323 | (package (inherit gcc-4.8) |
3b1bba4c | 324 | (version "4.9.2") |
571aa6cd | 325 | (source (origin |
7e35b9dd LC |
326 | (method url-fetch) |
327 | (uri (string-append "mirror://gnu/gcc/gcc-" | |
328 | version "/gcc-" version ".tar.bz2")) | |
329 | (sha256 | |
330 | (base32 | |
331 | "1pbjp4blk2ycaa6r3jmw4ky5f1s9ji3klbqgv8zs2sl5jn1cj810")) | |
332 | (patches (map search-patch | |
333 | '("gcc-arm-link-spec-fix.patch" | |
334 | "gcc-libvtv-runpath.patch"))))))) | |
571aa6cd | 335 | |
60e2d5fe | 336 | (define-public gcc-5.1 |
7e35b9dd | 337 | (package (inherit gcc-4.9) |
60e2d5fe MW |
338 | (version "5.1.0") |
339 | (source (origin | |
7e35b9dd LC |
340 | (method url-fetch) |
341 | (uri (string-append "mirror://gnu/gcc/gcc-" | |
342 | version "/gcc-" version ".tar.bz2")) | |
343 | (sha256 | |
344 | (base32 | |
345 | "1bd5vj4px3s8nlakbgrh38ynxq4s654m6nxz7lrj03mvkkwgvnmp")) | |
167a05aa LC |
346 | (patches (map search-patch |
347 | '("gcc-arm-link-spec-fix.patch" | |
348 | "gcc-5.0-libvtv-runpath.patch"))))))) | |
60e2d5fe | 349 | |
c4df90a5 | 350 | (define* (custom-gcc gcc name languages #:key (separate-lib-output? #t)) |
fdd6c726 NK |
351 | "Return a custom version of GCC that supports LANGUAGES." |
352 | (package (inherit gcc) | |
353 | (name name) | |
c4df90a5 MW |
354 | (outputs (if separate-lib-output? |
355 | (package-outputs gcc) | |
356 | (delete "lib" (package-outputs gcc)))) | |
fdd6c726 NK |
357 | (arguments |
358 | (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system) | |
359 | (guix build utils) | |
360 | (ice-9 regex) | |
361 | (srfi srfi-1) | |
362 | (srfi srfi-26)) | |
363 | ,@(package-arguments gcc)) | |
364 | ((#:configure-flags flags) | |
365 | `(cons (string-append "--enable-languages=" | |
366 | ,(string-join languages ",")) | |
367 | (remove (cut string-match "--enable-languages.*" <>) | |
368 | ,flags))))))) | |
369 | ||
370 | (define-public gfortran-4.8 | |
371 | (custom-gcc gcc-4.8 "gfortran" '("fortran"))) | |
372 | ||
373 | (define-public gccgo-4.8 | |
c4df90a5 MW |
374 | (custom-gcc gcc-4.8 "gccgo" '("go") |
375 | ;; Suppress the separate "lib" output, because otherwise the | |
376 | ;; "lib" and "out" outputs would refer to each other, creating | |
377 | ;; a cyclic dependency. <http://debbugs.gnu.org/18101> | |
378 | #:separate-lib-output? #f)) | |
fdd6c726 | 379 | |
ed2b1c4f AE |
380 | (define javac.in |
381 | (origin | |
382 | (method url-fetch) | |
383 | (uri (string-append "http://sources.gentoo.org/cgi-bin/viewvc.cgi/" | |
61af1014 LC |
384 | "gentoo-x86/dev-java/gcj-jdk/files/javac.in?revision=1.1")) |
385 | (file-name "javac.in") | |
ed2b1c4f AE |
386 | (sha256 (base32 |
387 | "1c3dk4z5yfj6ic2fn3lyxs27n6pmn2wy9k0r1s17lnkf1bzkrciv")))) | |
388 | ||
74574fd1 RW |
389 | (define-public gcj-4.8 |
390 | (package (inherit gcc-4.8) | |
391 | (name "gcj") | |
392 | (inputs | |
393 | `(("fastjar" ,fastjar) | |
394 | ("perl" ,perl) | |
ed2b1c4f | 395 | ("javac.in" ,javac.in) |
74574fd1 RW |
396 | ("ecj-bootstrap" ,ecj-bootstrap-4.8) |
397 | ,@(package-inputs gcc-4.8))) | |
398 | ;; Suppress the separate "lib" output, because otherwise the | |
399 | ;; "lib" and "out" outputs would refer to each other, creating | |
400 | ;; a cyclic dependency. <http://debbugs.gnu.org/18101> | |
401 | (outputs | |
402 | (delete "lib" (package-outputs gcc-4.8))) | |
403 | (arguments | |
404 | (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system) | |
405 | (guix build utils) | |
406 | (ice-9 regex) | |
407 | (srfi srfi-1) | |
408 | (srfi srfi-26)) | |
409 | ,@(package-arguments gcc-4.8)) | |
410 | ((#:configure-flags flags) | |
411 | `(let ((ecj (assoc-ref %build-inputs "ecj-bootstrap"))) | |
412 | `("--enable-java-home" | |
413 | "--enable-gjdoc" | |
414 | ,(string-append "--with-ecj-jar=" ecj) | |
415 | "--enable-languages=java" | |
416 | ,@(remove (cut string-match "--enable-languages.*" <>) | |
417 | ,flags)))) | |
ad12c43e RW |
418 | ((#:phases phases) |
419 | `(modify-phases ,phases | |
420 | (add-after | |
421 | 'unpack 'add-lib-output-to-rpath | |
422 | (lambda _ | |
423 | (substitute* "libjava/Makefile.in" | |
424 | (("libgcj_bc_dummy_LINK = .* -shared" line) | |
425 | (string-append line " -Wl,-rpath=$(libdir)")) | |
426 | (("libgcj(_bc)?_la_LDFLAGS =" ldflags _) | |
427 | (string-append ldflags " -Wl,-rpath=$(libdir)"))))) | |
428 | (add-after | |
429 | 'install 'install-javac-and-javap-wrappers | |
430 | (lambda _ | |
431 | (let* ((javac (assoc-ref %build-inputs "javac.in")) | |
432 | (ecj (assoc-ref %build-inputs "ecj-bootstrap")) | |
433 | (gcj (assoc-ref %outputs "out")) | |
434 | (gcjbin (string-append gcj "/bin/")) | |
435 | (jvm (string-append gcj "/lib/jvm/")) | |
436 | (target (string-append jvm "/bin/javac"))) | |
437 | ||
438 | (symlink (string-append gcjbin "jcf-dump") | |
439 | (string-append jvm "/bin/javap")) | |
440 | ||
441 | (copy-file ecj (string-append gcj "/share/java/ecj.jar")) | |
442 | ||
443 | ;; Create javac wrapper from the template javac.in by | |
444 | ;; replacing the @VARIABLES@ with paths. | |
445 | (copy-file javac target) | |
446 | (patch-shebang target) | |
447 | (substitute* target | |
448 | (("@JAVA@") | |
449 | (string-append jvm "/bin/java")) | |
450 | (("@ECJ_JAR@") | |
451 | (string-append gcj "/share/java/ecj.jar")) | |
452 | (("@RT_JAR@") | |
453 | (string-append jvm "/jre/lib/rt.jar")) | |
454 | (("@TOOLS_JAR@") | |
455 | (string-append jvm "/lib/tools.jar"))) | |
456 | (chmod target #o755) | |
457 | #t))) | |
458 | (add-after | |
5f6887e8 RW |
459 | 'install 'remove-broken-or-conflicting-files |
460 | (lambda _ | |
461 | (let ((out (assoc-ref %outputs "out"))) | |
462 | (for-each | |
463 | delete-file | |
464 | (append (find-files (string-append out "/lib/jvm/jre/lib") | |
465 | "libjawt.so") | |
466 | (find-files (string-append out "/bin") | |
467 | ".*(c\\+\\+|cpp|g\\+\\+|gcc.*)")))) | |
ad12c43e | 468 | #t)))))))) |
74574fd1 RW |
469 | |
470 | (define ecj-bootstrap-4.8 | |
471 | (origin | |
472 | (method url-fetch) | |
473 | (uri "ftp://sourceware.org/pub/java/ecj-4.8.jar") | |
474 | (sha256 | |
475 | (base32 | |
476 | "10fpqfbdzff1zcbxzh66xc8xbij9saykcj4xzm19wk9p3n7i5zcq")))) | |
477 | ||
fdd6c726 NK |
478 | (define-public gcc-objc-4.8 |
479 | (custom-gcc gcc-4.8 "gcc-objc" '("objc"))) | |
480 | ||
481 | (define-public gcc-objc++-4.8 | |
482 | (custom-gcc gcc-4.8 "gcc-objc++" '("obj-c++"))) | |
483 | ||
832abc76 LC |
484 | (define-public isl |
485 | (package | |
486 | (name "isl") | |
487 | (version "0.11.1") | |
488 | (source (origin | |
489 | (method url-fetch) | |
490 | (uri (list (string-append | |
590a4904 | 491 | "http://isl.gforge.inria.fr/isl-" |
832abc76 LC |
492 | version |
493 | ".tar.bz2") | |
494 | (string-append %gcc-infrastructure | |
495 | name "-" version ".tar.gz"))) | |
496 | (sha256 | |
497 | (base32 | |
498 | "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9")))) | |
499 | (build-system gnu-build-system) | |
500 | (inputs `(("gmp" ,gmp))) | |
590a4904 | 501 | (home-page "http://isl.gforge.inria.fr/") |
832abc76 | 502 | (synopsis |
9e771e3b LC |
503 | "Manipulating sets and relations of integer points \ |
504 | bounded by linear constraints") | |
832abc76 LC |
505 | (description |
506 | "isl is a library for manipulating sets and relations of integer points | |
35b9e423 | 507 | bounded by linear constraints. Supported operations on sets include |
832abc76 LC |
508 | intersection, union, set difference, emptiness check, convex hull, (integer) |
509 | affine hull, integer projection, computing the lexicographic minimum using | |
510 | parametric integer programming, coalescing and parametric vertex | |
35b9e423 | 511 | enumeration. It also includes an ILP solver based on generalized basis |
832abc76 LC |
512 | reduction, transitive closures on maps (which may encode infinite graphs), |
513 | dependence analysis and bounds on piecewise step-polynomials.") | |
514 | (license lgpl2.1+))) | |
515 | ||
516 | (define-public cloog | |
517 | (package | |
518 | (name "cloog") | |
519 | (version "0.18.0") | |
520 | (source | |
521 | (origin | |
522 | (method url-fetch) | |
523 | (uri (list (string-append | |
524 | "http://www.bastoul.net/cloog/pages/download/count.php3?url=cloog-" | |
525 | version | |
526 | ".tar.gz") | |
527 | (string-append %gcc-infrastructure | |
528 | name "-" version ".tar.gz"))) | |
529 | (sha256 | |
530 | (base32 | |
531 | "0a12rwfwp22zd0nlld0xyql11cj390rrq1prw35yjsw8wzfshjhw")) | |
532 | (file-name (string-append name "-" version ".tar.gz")))) | |
533 | (build-system gnu-build-system) | |
534 | (inputs `(("gmp" ,gmp) | |
535 | ("isl" ,isl))) | |
536 | (arguments '(#:configure-flags '("--with-isl=system"))) | |
537 | (home-page "http://www.cloog.org/") | |
9e771e3b | 538 | (synopsis "Library to generate code for scanning Z-polyhedra") |
832abc76 LC |
539 | (description |
540 | "CLooG is a free software library to generate code for scanning | |
541 | Z-polyhedra. That is, it finds a code (e.g., in C, FORTRAN...) that | |
542 | reaches each integral point of one or more parameterized polyhedra. | |
543 | CLooG has been originally written to solve the code generation problem | |
544 | for optimizing compilers based on the polytope model. Nevertheless it | |
545 | is used now in various area e.g., to build control automata for | |
546 | high-level synthesis or to find the best polynomial approximation of a | |
547 | function. CLooG may help in any situation where scanning polyhedra | |
548 | matters. While the user has full control on generated code quality, | |
549 | CLooG is designed to avoid control overhead and to produce a very | |
550 | effective code.") | |
551 | (license gpl2+))) | |
5c126b64 | 552 |