guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

183/192: gnu: gcc-core-mesboot: Cleanup.


From: Jan Nieuwenhuizen
Subject: 183/192: gnu: gcc-core-mesboot: Cleanup.
Date: Mon, 3 Sep 2018 16:25:24 -0400 (EDT)

janneke pushed a commit to branch wip-bootstrap
in repository guix.

commit 38f907cf305f6cdac85d8bea8987a1042fd23a6b
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Mon Sep 3 14:09:48 2018 +0200

    gnu: gcc-core-mesboot: Cleanup.
    
    * gnu/packages/commencement.scm (gcc-core-mesboot): Cleanup.
---
 gnu/packages/commencement.scm | 98 +++++++++++++++++++++----------------------
 1 file changed, 49 insertions(+), 49 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index be89ed3..c929282 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -721,6 +721,7 @@
      (native-inputs `(("binutils" ,binutils-mesboot0)
                       ("tcc" ,tcc-boot)
 
+                      ("bash" ,%bootstrap-coreutils&co)
                       ("coreutils" ,%bootstrap-coreutils&co)
                       ("diffutils" ,diffutils-mesboot)
                       ("make" ,make-mesboot0)))
@@ -731,6 +732,14 @@
         #:tests? #f
         #:parallel-build? #f
         #:strip-binaries? #f
+        #:configure-flags
+        (let ((out (assoc-ref %outputs "out")))
+          `("--enable-static"
+            "--disable-shared"
+            "--disable-werror"
+            "--build=i686-unknown-linux-gnu"
+            "--host=i686-unknown-linux-gnu"
+            ,(string-append "--prefix=" out)))
         #:make-flags (list
                       "CC=tcc -static -D __GLIBC_MINOR__=6"
                       "OLDCC=tcc -static -D __GLIBC_MINOR__=6"
@@ -749,55 +758,33 @@
                    (srfi srfi-1))
         #:phases
         (modify-phases %standard-phases
-          (replace 'configure
+          ;; gcc-2.95.3 needs more traditional configure
+          (add-before 'configure 'setenv
             (lambda* (#:key outputs #:allow-other-keys)
               (let ((out (assoc-ref outputs "out"))
+                    (bash (assoc-ref %build-inputs "bash"))
                     (tcc (assoc-ref %build-inputs "tcc"))
-                    (cppflags (string-append
-                               " -D __STDC__=1"
-                               " -D __GLIBC_MINOR__=6")))
-                (setenv "PATH"
-                        (string-append
-                         (assoc-ref %build-inputs "binutils") "/bin"
-                         ":" (assoc-ref %build-inputs "tcc") "/bin"
-
-                         ":" (assoc-ref %build-inputs "coreutils") "/bin"
-                         ":" (assoc-ref %build-inputs "diffutils") "/bin"
-                         ":" (assoc-ref %build-inputs "make") "/bin"))
-
-                ;; no info at this stage
-                (delete-file-recursively "texinfo")
-                (system "touch gcc/cpp.info gcc/gcc.info")
-
-                (setenv "CONFIG_SHELL" (string-append
-                                        (assoc-ref %build-inputs "coreutils")
-                                        "/bin/sh"))
-                (unsetenv "LANG")
-                (unsetenv "C_INCLUDE_PATH") ; flex
-                (unsetenv "LIBRARY_PATH")
+                    (cppflags " -D __GLIBC_MINOR__=6"))
+                (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
                 (setenv "CPPFLAGS" cppflags)
-                (setenv "C_INCLUDE_PATH" (string-append tcc "/include"))
-                (setenv "CC" (string-append "tcc -static" " " cppflags))
-                (setenv "CC_FOR_BUILD" (string-append "tcc -static" " " 
cppflags))
-                (setenv "CPP" (string-append "tcc -E" " " cppflags))
-
-                (format (current-error-port) "PATH=~a\n" (getenv "PATH"))
-                (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv 
"C_INCLUDE_PATH"))
-                (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv 
"LIBRARY_PATH"))
-
+                (setenv "CC" (string-append "tcc" cppflags))
+                (setenv "CC_FOR_BUILD" (string-append "tcc" cppflags))
+                (setenv "CPP" (string-append "tcc -E" cppflags))
                 (with-output-to-file "config.cache"
                   (lambda _
                     (display "
 ac_cv_c_float_format='IEEE (little-endian)'
-")))
-                (and
-                 (zero?
-                  (system* "./configure"
-                           "--disable-shared"
-                           "--enable-static"
-                           "--build=i686-unknown-linux-gnu"
-                           "--host=i686-unknown-linux-gnu"
-                           (string-append "--prefix=" out)))))))
+"))))))
+          (replace 'configure
+            (lambda* (#:key configure-flags  #:allow-other-keys)
+              (format (current-error-port)
+                      "running ./configure ~a\n" (string-join configure-flags))
+              (apply invoke "./configure" configure-flags)))
+          (add-after 'configure 'remove-info
+            (lambda _
+              ;; no info at this stage
+              (delete-file-recursively "texinfo")
+              (invoke "touch" "gcc/cpp.info" "gcc/gcc.info")))
           (add-after 'install 'install2
             (lambda* (#:key outputs #:allow-other-keys)
               (let* ((tcc (assoc-ref %build-inputs "tcc"))
@@ -812,15 +799,28 @@ ac_cv_c_float_format='IEEE (little-endian)'
                  (copy-file "gcc/libgcc2.a" (string-append out 
"/lib/libgcc2.a"))
                  (copy-file (string-append tcc "/lib/libtcc1.a")
                             (string-append out "/lib/libtcc1.a"))
-                 (zero? (system* "ar" "r" (string-append gcc-dir "/libc.a")
-                                 (string-append tcc-lib "/libc+gnu.o")
-                                 (string-append tcc-lib "/libtcc1.o")))
-                 (zero? (system* "ar" "r" (string-append out "/lib/libc.a")
-                                 (string-append tcc-lib "/libc+gnu.o")
-                                 (string-append tcc-lib "/libtcc1.o")))
-                 (system* "ls" "-ltrF" gcc-dir)
+                 (invoke "ar" "r" (string-append gcc-dir "/libc.a")
+                         (string-append tcc-lib "/libc+gnu.o")
+                         (string-append tcc-lib "/libtcc1.o"))
+                 (invoke "ar" "r" (string-append out "/lib/libc.a")
+                         (string-append tcc-lib "/libc+gnu.o")
+                         (string-append tcc-lib "/libtcc1.o"))
+                 (invoke "ls" "-ltrF" gcc-dir)
                  (copy-recursively (string-append tcc "/include")
-                                   (string-append out "/include"))))))))))))
+                                   (string-append out "/include"))
+                 #t)))))))
+     (native-search-paths
+      ;; Use the language-specific variables rather than 'CPATH' because they
+      ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'.
+      ;; The intent is to allow headers that are in the search path to be
+      ;; treated as "system headers" (headers exempt from warnings) just like
+      ;; the typical /usr/include headers on an FHS system.
+      (list (search-path-specification
+             (variable "C_INCLUDE_PATH")
+             (files '("include" 
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include")))
+            (search-path-specification
+             (variable "LIBRARY_PATH")
+             (files '("lib"))))))))
 
 (define-public mesboot-headers
   (package-with-bootstrap-guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]