[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Building a library as both static and dynamic
From: |
Ludovic Courtès |
Subject: |
Re: Building a library as both static and dynamic |
Date: |
Mon, 05 Oct 2020 15:39:14 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Hi,
Greg Hogan <code@greghogan.com> skribis:
> Is there a best practice or example for building a library twice, both
> static and dynamic? I submitted patch #43620, and in working on
> another library have the same issue. These are cmake builds with a
> parameter declaration for either a static or dynamic build, not
> both. I would like to create a single package with both “out” and
> “static” outputs, which looks to be standard across Guix.
Yes, a “static” output is the preferred method if you want to keep .a
files around.
> One idea is to run the configure / make / make install phases
> twice. modify-phases does not currently support copying phases (though
> add-after could work with the right function reference from
> cmake-build) and #:configure-flags would need to be set differently.
Build systems from Autoconf/Automake/Libtool and those using CMake can
produce both shared libraries (position-independent code, PIC) and
static libraries at once. No need to run it twice.
HTH,
Ludo’.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Building a library as both static and dynamic,
Ludovic Courtès <=