[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/48: gnu: autoconf: Support cross-build.
From: |
guix-commits |
Subject: |
02/48: gnu: autoconf: Support cross-build. |
Date: |
Sun, 19 Apr 2020 10:22:05 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit d1a62bb64dfc1e48816ab70166ff4f0250ea18ea
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Sat Apr 18 19:49:54 2020 +0200
gnu: autoconf: Support cross-build.
Autoconf cannot be cross-built properly: it lacks the concept of
<tool>-for-build. It runs the host `autom4te' (a perl script) during build.
* gnu/packages/autotools.scm (autoconf)[inputs]: When cross-building, add
perl
and m4.
[native-inputs]: when cross-building, use -for-build names.
[arguments]: When cross-building, add `fake-cross-build' phase to substitute
m4 and perl.
---
gnu/packages/autotools.scm | 31 ++++++++++++++++++++++++++++---
1 file changed, 28 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm
index 99ca527..91d2c8a 100644
--- a/gnu/packages/autotools.scm
+++ b/gnu/packages/autotools.scm
@@ -55,12 +55,37 @@
(base32
"113nlmidxy9kjr45kg9x3ngar4951mvag1js2a3j8nxcz34wxsv4"))))
(build-system gnu-build-system)
+ (inputs
+ (if (%current-target-system)
+ `(("perl" ,perl)
+ ("m4" ,m4))
+ '()))
(native-inputs
- `(("perl" ,perl)
- ("m4" ,m4)))
+ (if (%current-target-system)
+ `(("perl-for-build" ,perl)
+ ("m4-for-build" ,m4))
+ `(("perl" ,perl)
+ ("m4" ,m4))))
;; XXX: testsuite: 209 and 279 failed. The latter is an impurity. It
;; should use our own "cpp" instead of "/lib/cpp".
- (arguments `(#:tests? #f))
+ (arguments
+ `(#:tests? #f
+ ,@(if (%current-target-system)
+ `(#:phases
+ (modify-phases %standard-phases
+ ;; Autoconf cannot be cross-built properly: it lacks the
+ ;; concept of <tool>-for-build. It even runs the host
+ ;; `autom4te' (a perl script) during build.
+ (add-after 'install 'fake-cross-build
+ (lambda* (#:key build inputs outputs #:allow-other-keys)
+ (let ((m4 (assoc-ref inputs "m4"))
+ (perl (assoc-ref inputs "perl"))
+ (out (assoc-ref outputs "out")))
+ (substitute* (find-files (string-append out "/bin"))
+ (("/gnu/store/[^/]*-m4-[^/]*") m4)
+ (("/gnu/store/[^/]*-perl-[^/]*") perl))
+ #t)))))
+ '())))
(home-page "https://www.gnu.org/software/autoconf/")
(synopsis "Create source code configuration scripts")
(description
- branch wip-hurd-vm created (now ba6bdb0), guix-commits, 2020/04/19
- 01/48: gnu: perl: Actually produce a host perl when cross-compiling., guix-commits, 2020/04/19
- 05/48: vm: Make the device node procedure a parameter., guix-commits, 2020/04/19
- 04/48: gnu: texinfo: Cross-build fix: Use host perl in host scripts., guix-commits, 2020/04/19
- 02/48: gnu: autoconf: Support cross-build.,
guix-commits <=
- 03/48: gnu: automake: Support cross-build., guix-commits, 2020/04/19
- 06/48: syscalls: 'readdir*' chooses between the Linux and Hurd code at run time., guix-commits, 2020/04/19
- 08/48: gnu: hurd: Fix references to /bin/w., guix-commits, 2020/04/19
- 11/48: gnu: Add dde-sources., guix-commits, 2020/04/19
- 13/48: gnu: hurd: Add NFS support., guix-commits, 2020/04/19
- 12/48: gnu: Add netdde., guix-commits, 2020/04/19
- 17/48: services: Add hurd-ttys-service-type., guix-commits, 2020/04/19
- 18/48: services: Add hurd-user-services-service-type., guix-commits, 2020/04/19
- 22/48: services: Add openssh-service as a Hurd service., guix-commits, 2020/04/19
- 15/48: services: Add hurd., guix-commits, 2020/04/19