summary refs log tree commit diff
path: root/distro
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-08-30 23:03:11 +0200
committerLudovic Courtès <ludo@gnu.org>2012-08-30 23:03:11 +0200
commita436d2018ec6a46fcb6e5c74fa7575789e23dd98 (patch)
treefbff404b86b265bc4bd64d621d62f8f082976685 /distro
parentdcd60f439830ba58f7b89f028973e77ed414cb86 (diff)
downloadguix-a436d2018ec6a46fcb6e5c74fa7575789e23dd98.tar.gz
distro: gcc: Do not store configure flags in the resulting binaries.
* distro/base.scm (gcc-4.7): Add a `post-configure' phase to clear
  `TOPLEVEL_CONFIGURE_ARGUMENTS' in the top-level `Makefile'.
Diffstat (limited to 'distro')
-rw-r--r--distro/base.scm24
1 files changed, 16 insertions, 8 deletions
diff --git a/distro/base.scm b/distro/base.scm
index 06f6dbbb7a..fdb0c688fb 100644
--- a/distro/base.scm
+++ b/distro/base.scm
@@ -631,14 +631,22 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.")
                                           (string-append line "\n")
                                           'pre libc "/lib/" 1 "crt" 2 ".o"
                                           'post)))))
-         (alist-replace 'install
-                        (lambda* (#:key outputs #:allow-other-keys)
-                          (zero?
-                           (system* "make"
-                                    ,(if stripped?
-                                         "install-strip"
-                                         "install"))))
-                        %standard-phases))))
+         (alist-cons-after
+          'configure 'post-configure
+          (lambda _
+            ;; Don't store configure flags, to avoid retaining references to
+            ;; build-time dependencies---e.g., `--with-ppl=/nix/store/xxx'.
+            (substitute* "Makefile"
+              (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
+               "TOPLEVEL_CONFIGURE_ARGUMENTS=\n")))
+          (alist-replace 'install
+                         (lambda* (#:key outputs #:allow-other-keys)
+                           (zero?
+                            (system* "make"
+                                     ,(if stripped?
+                                          "install-strip"
+                                          "install"))))
+                         %standard-phases)))))
 
      (properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
      (description "The GNU Compiler Collection")