Patchwork [05/11] gnu: gmp: build shared library for mingw.

login
register
mail settings
Submitter Jan Nieuwenhuizen
Date May 8, 2016, 8:42 p.m.
Message ID <1462740169-15029-6-git-send-email-janneke@gnu.org>
Download mbox | patch
Permalink /patch/12148/
State New
Headers show

Comments

Jan Nieuwenhuizen - May 8, 2016, 8:42 p.m.
* gnu/packages/multiprecision.scm (gmp)[MINGW]: Use --enable-shared.
---
 gnu/packages/multiprecision.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
Andy Wingo - May 9, 2016, 7:20 a.m.
On Sun 08 May 2016 22:42, Jan Nieuwenhuizen <janneke@gnu.org> writes:

> * gnu/packages/multiprecision.scm (gmp)[MINGW]: Use --enable-shared.
> ---
>  gnu/packages/multiprecision.scm | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm
> index 9924323..8c1a9b7 100644
> --- a/gnu/packages/multiprecision.scm
> +++ b/gnu/packages/multiprecision.scm
> @@ -3,6 +3,7 @@
>  ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
>  ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
>  ;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
> +;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -49,7 +50,13 @@
>                  '(;; Build a "fat binary", with routines for several
>                    ;; sub-architectures.
>                    "--enable-fat"
> -                  "--enable-cxx")))
> +                  "--enable-cxx"
> +                  ,@(cond ((mingw-target?)
> +                           ;; Static and shared cannot be built in one go:
> +                           ;; they produce different headers.  We need shared.
> +                           `("--disable-static"
> +                             "--enable-shared"))
> +                          (else '())))))
>     (synopsis "Multiple-precision arithmetic library")
>     (description
>      "GMP is a library for arbitrary precision arithmetic, operating on

LGTM.  A bit of a shame that mingw is an abnormal architecture in this
way -- i.e. other targets will have both static and shared libraries,
but not this one.  Oh well, this does look to be the right thing for
now.
Jan Nieuwenhuizen - May 14, 2016, 8:27 p.m.
Andy Wingo writes:

>> +                  ,@(cond ((mingw-target?)
>> +                           ;; Static and shared cannot be built in one go:
>> +                           ;; they produce different headers.  We need shared.
>> +                           `("--disable-static"
>> +                             "--enable-shared"))
>> +                          (else '())))))
>>     (synopsis "Multiple-precision arithmetic library")
>>     (description
>>      "GMP is a library for arbitrary precision arithmetic, operating on
>
> LGTM.  A bit of a shame that mingw is an abnormal architecture in this
> way -- i.e. other targets will have both static and shared libraries,
> but not this one.  Oh well, this does look to be the right thing for
> now.

Okay, thanks.  Yes, I can imagine that when we find that this change is
needed for more packages/libraries we may want to make a function for
it.

Greetings, Jan

Patch

diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm
index 9924323..8c1a9b7 100644
--- a/gnu/packages/multiprecision.scm
+++ b/gnu/packages/multiprecision.scm
@@ -3,6 +3,7 @@ 
 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -49,7 +50,13 @@ 
                 '(;; Build a "fat binary", with routines for several
                   ;; sub-architectures.
                   "--enable-fat"
-                  "--enable-cxx")))
+                  "--enable-cxx"
+                  ,@(cond ((mingw-target?)
+                           ;; Static and shared cannot be built in one go:
+                           ;; they produce different headers.  We need shared.
+                           `("--disable-static"
+                             "--enable-shared"))
+                          (else '())))))
    (synopsis "Multiple-precision arithmetic library")
    (description
     "GMP is a library for arbitrary precision arithmetic, operating on