Message ID | 20190708095913.3460-27-m.othacehe@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | Fix cross-compilation issues | expand |
Mathieu Othacehe <m.othacehe@gmail.com> writes: > * gnu/packages/shells.scm (tcsh)[arguments]: Replace "cc" by "gcc" as > native gethost compiler when cross-compiling. LGTM.
Mathieu Othacehe <m.othacehe@gmail.com> writes: > * gnu/packages/shells.scm (tcsh)[arguments]: Replace "cc" by "gcc" as > native gethost compiler when cross-compiling. > --- > gnu/packages/shells.scm | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm > index f8c0fdf71f..6eed89396e 100644 > --- a/gnu/packages/shells.scm > +++ b/gnu/packages/shells.scm > @@ -11,6 +11,7 @@ > ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net> > ;;; Copyright © 2019 Meiyo Peng <meiyo.peng@gmail.com> > ;;; Copyright © 2019 Timothy Sample <samplet@ngyro.com> > +;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com> > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -356,6 +357,14 @@ written by Paul Haahr and Byron Rakitzis.") > (arguments > `(#:phases > (modify-phases %standard-phases > + ,@(if (%current-target-system) > + '((add-before 'configure 'set-cross-cc > + (lambda _ > + (substitute* "configure" > + (("CC_FOR_GETHOST=\"cc\"") > + "CC_FOR_GETHOST=\"gcc\"")) > + #t))) > + '()) Actually, can we pass this in #:configure-flags instead? Maybe even also for the native build?
>> @@ -356,6 +357,14 @@ written by Paul Haahr and Byron Rakitzis.") >> (arguments >> `(#:phases >> (modify-phases %standard-phases >> + ,@(if (%current-target-system) >> + '((add-before 'configure 'set-cross-cc >> + (lambda _ >> + (substitute* "configure" >> + (("CC_FOR_GETHOST=\"cc\"") >> + "CC_FOR_GETHOST=\"gcc\"")) >> + #t))) >> + '()) > > Actually, can we pass this in #:configure-flags instead? Maybe even > also for the native build? Sadly I think we cannot. The problematic piece is: --8<---------------cut here---------------start------------->8--- dnl Require build CC to create gethost helper when cross building if test "x${cross_compiling}" = xyes ; then CC_FOR_GETHOST="cc" else CC_FOR_GETHOST="\$(CC)" fi AC_SUBST(CC_FOR_GETHOST) --8<---------------cut here---------------end--------------->8--- CC_FOR_GETHOST cannot be overwritten by a configure-flag. Mathieu
diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm index f8c0fdf71f..6eed89396e 100644 --- a/gnu/packages/shells.scm +++ b/gnu/packages/shells.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2019 Meiyo Peng <meiyo.peng@gmail.com> ;;; Copyright © 2019 Timothy Sample <samplet@ngyro.com> +;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -356,6 +357,14 @@ written by Paul Haahr and Byron Rakitzis.") (arguments `(#:phases (modify-phases %standard-phases + ,@(if (%current-target-system) + '((add-before 'configure 'set-cross-cc + (lambda _ + (substitute* "configure" + (("CC_FOR_GETHOST=\"cc\"") + "CC_FOR_GETHOST=\"gcc\"")) + #t))) + '()) (add-before 'check 'patch-test-scripts (lambda _ ;; Take care of pwd