libelf: Update configure script and config.guess and config.sub.

The current configure script is too old to find the cross-compiler
and support variables passed as arguments. Also, config.guess and
config.sub are too old to recognise powerpc64 and aarch64.  Solve
this by regenerating the 'configure' script and replacing
'config.guess' and 'config.sub'.

* gnu/packages/elf.scm
  (libelf)[arguments]<#:phases>{configure}: Remove phase.
  (libelf)[arguments]<#:phases>{delete-configure}: Regenerate
  the configure script and replace 'config.guess' and 'config.sub'.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
This commit is contained in:
Maxime Devos 2021-07-14 13:13:06 +02:00 committed by Mathieu Othacehe
parent 5a88b8df00
commit 731b714e92
No known key found for this signature in database
GPG Key ID: 8354763531769CA6
1 changed files with 28 additions and 16 deletions

View File

@ -9,6 +9,7 @@
;;; Copyright © 2020 Mark Wielaard <mark@klomp.org> ;;; Copyright © 2020 Mark Wielaard <mark@klomp.org>
;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de> ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2021 Leo Le Bouter <lle-bout@zaclys.net> ;;; Copyright © 2021 Leo Le Bouter <lle-bout@zaclys.net>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -32,6 +33,7 @@
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module ((guix licenses) #:select (gpl3+ lgpl3+ lgpl2.0+)) #:use-module ((guix licenses) #:select (gpl3+ lgpl3+ lgpl2.0+))
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages autotools)
#:use-module (gnu packages compression) #:use-module (gnu packages compression)
#:use-module (gnu packages documentation) #:use-module (gnu packages documentation)
#:use-module (gnu packages gcc) #:use-module (gnu packages gcc)
@ -205,22 +207,32 @@ static analysis of the ELF binaries at hand.")
(arguments (arguments
`(#:phases `(#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(replace 'configure ;; This old 'configure' script doesn't support cross-compilation
(lambda* (#:key outputs #:allow-other-keys) ;; well. I.e., it fails to find the cross-compiler. Also,
;; This old `configure' script doesn't support ;; the old `configure' script doesn't support variables passed as
;; variables passed as arguments. ;; arguments. A third problem is that config.sub is too old to
(let ((out (assoc-ref outputs "out"))) ;; recognise aarch64 and powerpc64le.
(setenv "CONFIG_SHELL" (which "bash")) ;;
(invoke "./configure" ;; Solve this by regenerating the configure script and letting
(string-append "--prefix=" out) ;; autoreconf update 'config.sub'. While 'config.sub' is updated
,@(if (string=? "powerpc64le-linux" ;; anyway, update 'config.guess' as well.
(%current-system)) (add-before 'bootstrap 'delete-configure
'("--host=powerpc64le-unknown-linux-gnu") (lambda* (#:key native-inputs inputs #:allow-other-keys)
'()) (delete-file "configure")
,@(if (string=? "aarch64-linux" (delete-file "config.sub")
(%current-system)) (delete-file "config.guess")
'("--host=aarch64-unknown-linux-gnu") (for-each (lambda (file)
'())))))))) (install-file
(string-append
(assoc-ref (or native-inputs inputs) "automake")
"/share/automake-"
,(version-major+minor (package-version automake))
"/" file) "."))
'("config.sub" "config.guess")))))))
(native-inputs
`(("autoconf" ,autoconf)
;; For up-to-date 'config.guess' and 'config.sub'
("automake" ,automake)))
(home-page (string-append "https://web.archive.org/web/20181111033959/" (home-page (string-append "https://web.archive.org/web/20181111033959/"
"http://www.mr511.de/software/english.html")) "http://www.mr511.de/software/english.html"))
(synopsis "ELF object file access library") (synopsis "ELF object file access library")