Re: Build shared and static libs on the same run?

[email protected] Tue, 8 Apr 2025 10:38:26 +0900 (GMT+09:00)
Newsgroups gmane.comp.gnu.libtool.general
Message-ID <[email protected]>
------=_Part_2_29108904.1744076306749
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,

if I remember correctly, you need to pass both --enable-static and --enable=
-shared to get both.

On many systems, both are built with -fPIC now, to allow use of static libr=
aries in position-independent executables, I'm not sure if libtool handles =
this efficiently, but it mostly means longer build time.

=C2=A0=C2=A0 Simon

8 Apr 2025 08:52:45 Nate Bargmann <[email protected]>:

> Hi All.
>=20
> I've been involved with the Hamlib project for many years.=C2=A0 I seem t=
o
> recall that at one time both .so and .a libraries were built by libtool.
> The project uses Autoconf, Automake, and Libtool, so I think this list
> is the obvious choice to ask my question.
>=20
> I recent years I have observed that only .so binaries are built unless
> --enable-static is passed to the 'configure' script.=C2=A0 The result is =
that
> .a libraries are built but no .so libraries and all of the user
> executable programs are static linked to the new libraries.
>=20
> In 'configure.ac' the following macros are used:
>=20
> LT_PREREQ([2.2.6b])
> LT_INIT([win32-dll])
> LT_LANG([Windows Resource])
>=20
> As a test I tried with just a bare LT_INIT request and saw no change
> with only .so libraries being built by default.
>=20
> I am working through a list of issues of the project and one is a
> request to build both .so and .a libraries by default.=C2=A0 Hence the
> motivation for this email.
>=20
> I am building Hamlib on Debian GNU/Linux 12 with libtool 2.4.7.=C2=A0 I a=
lso
> do separate builds for MS Windows, but I don't that is a part of this
> discussion.=C2=A0 I can provide links to files for examination if request=
ed.
>=20
> - Nate
>=20
> --=20
> "The optimist proclaims that we live in the best of all
> possible worlds.=C2=A0 The pessimist fears this is true."
> Web: https://www.n0nb.us
> Projects: https://github.com/N0NB
> GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819
> NIT([win32-dll])

------=_Part_2_29108904.1744076306749
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

<html>
 <head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
 </head>
 <body>
  <span dir="ltr" style="margin-top:0; margin-bottom:0;">Hi,</span>
  <br>
  <br><span dir="ltr" style="margin-top:0; margin-bottom:0;">if I remember correctly, you need to pass both --enable-static and --enable-shared to get both.</span>
  <br>
  <br><span dir="ltr" style="margin-top:0; margin-bottom:0;">On many systems, both are built with -fPIC now, to allow use of static libraries in position-independent executables, I'm not sure if libtool handles this efficiently, but it mostly means longer build time.</span>
  <br>
  <br><span dir="ltr" style="margin-top:0; margin-bottom:0;">&nbsp;&nbsp; Simon</span>
  <br>
  <div class="fairemail_quote">
   <div dir="ltr">
    <p>8 Apr 2025 08:52:45 Nate Bargmann &lt;[email protected]&gt;:</p>
   </div>
   <blockquote style="margin:0;border-left:3px solid #ccc; padding-left:10px;">
    <div>
     Hi All. 
     <br>
     <br>
      I've been involved with the Hamlib project for many years.&nbsp; I seem to 
     <br>
      recall that at one time both .so and .a libraries were built by libtool. 
     <br>
      The project uses Autoconf, Automake, and Libtool, so I think this list 
     <br>
      is the obvious choice to ask my question. 
     <br>
     <br>
      I recent years I have observed that only .so binaries are built unless 
     <br>
      --enable-static is passed to the 'configure' script.&nbsp; The result is that 
     <br>
      .a libraries are built but no .so libraries and all of the user 
     <br>
      executable programs are static linked to the new libraries. 
     <br>
     <br>
      In 'configure.ac' the following macros are used: 
     <br>
     <br>
      LT_PREREQ([2.2.6b]) 
     <br>
      LT_INIT([win32-dll]) 
     <br>
      LT_LANG([Windows Resource]) 
     <br>
     <br>
      As a test I tried with just a bare LT_INIT request and saw no change 
     <br>
      with only .so libraries being built by default. 
     <br>
     <br>
      I am working through a list of issues of the project and one is a 
     <br>
      request to build both .so and .a libraries by default.&nbsp; Hence the 
     <br>
      motivation for this email. 
     <br>
     <br>
      I am building Hamlib on Debian GNU/Linux 12 with libtool 2.4.7.&nbsp; I also 
     <br>
      do separate builds for MS Windows, but I don't that is a part of this 
     <br>
      discussion.&nbsp; I can provide links to files for examination if requested. 
     <br>
     <br>
      - Nate 
     <br>
     <br>
      -- 
     <br>
      "The optimist proclaims that we live in the best of all 
     <br>
      possible worlds.&nbsp; The pessimist fears this is true." 
     <br>
      Web: https://www.n0nb.us 
     <br>
      Projects: https://github.com/N0NB 
     <br>
      GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819 
     <br>
      NIT([win32-dll]) 
     <br>
    </div>
   </blockquote>
  </div>
 </body>
</html>
------=_Part_2_29108904.1744076306749--