>> If you want to test any of the front-ends, don’t forget to set
>> LIBRARY_PATH and LD_LIBRARY_PATH, like so:
>>
>> $ export 
>> LIBRARY_PATH=/nix/store/wmaxqx3p658v2yqjv00mss2shvn23h7a-glibc-2.18/lib
>> $ export 
>> LD_LIBRARY_PATH=/nix/store/kvhg0fszagsx5y80sq79bkmb7yqvjfmd-gcc-go-4.8.1/lib

> I guess that’s unnecessary when using ‘ld-wrapper’.

I know nothing about it.  Could you elaborate?

I tested each front end using the “hello, world” program.  Is it enough?

It was necessary to set some environment variables.  An example for
Fortran:

LIBRARY_PATH=/nix/var/nix/profiles/default/guix-profile/lib
LD_LIBRARY_PATH=/nix/store/jh5shyx6pg7m0dibdgl202pj7ryp5nvq-gfortran-4.8.2/lib
CPATH=/nix/var/nix/profiles/default/guix-profile/include
PATH=/nix/var/nix/profiles/default/guix-profile/bin:$PATH

May I push this patch to ‘master’?

From be260e7d9d4a7592129c0369eee52b156170d1cf Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov <[email protected]>
Date: Thu, 31 Oct 2013 19:54:36 +0000
Subject: [PATCH] gnu: Add GCC front ends for Fortran, Go, Objective C, and
 Objective C++.

* gnu/packages/gcc.scm (custom-gcc, gfortran-4.8, gccgo-4.8)
  (gcc-objc-4.8, gcc-objc++-4.8): New variables.
---
 gnu/packages/gcc.scm |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index dde0f0d..60bc5bb 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -27,6 +27,7 @@
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix utils)
   #:use-module (ice-9 regex))
 
 (define %gcc-infrastructure
@@ -211,6 +212,34 @@ Go.  It also includes standard libraries for these languages.")
               (base32
                "1j6dwgby4g3p3lz7zkss32ghr45zpdidrg8xvazvn91lqxv25p09"))))))
 
+(define (custom-gcc gcc name languages)
+  (package (inherit gcc)
+    (name name)
+    (arguments
+     (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
+                                                (guix build utils)
+                                                (ice-9 regex)
+                                                (srfi srfi-1)
+                                                (srfi srfi-26))
+                                               ,@(package-arguments gcc))
+       ((#:configure-flags flags)
+        `(cons (string-append "--enable-languages="
+                              ,(string-join languages ","))
+               (remove (cut string-match "--enable-languages.*" <>)
+                       ,flags)))))))
+
+(define-public gfortran-4.8
+  (custom-gcc gcc-4.8 "gfortran" '("fortran")))
+
+(define-public gccgo-4.8
+  (custom-gcc gcc-4.8 "gccgo" '("go")))
+
+(define-public gcc-objc-4.8
+  (custom-gcc gcc-4.8 "gcc-objc" '("objc")))
+
+(define-public gcc-objc++-4.8
+  (custom-gcc gcc-4.8 "gcc-objc++" '("obj-c++")))
+
 (define-public isl
   (package
     (name "isl")
-- 
1.7.9.5

Attachment: pgp7VJPfHUErO.pgp
Description: PGP signature

Reply via email to