0

I am trying to build NgSpice as statically linked shared library. But I can't make this using autotools.

Armoken
  • 53
  • 4
  • Are you *creating* the build system or using an existing one? If the latter, then project documentation and `./configure --help` are your friends. With that said, i f building a static version is supported at all, then one of the more common ways to achieve it would involved passing the `--enable-static` option to `configure`. – John Bollinger Nov 10 '20 at 23:19
  • @JohnBollinger, I am using existsing build system of NgSpice project. And I don't need static library, but I need a standalone shared library. – Armoken Nov 11 '20 at 16:34
  • Sorry, you cannot merge shared libraries together (except on AIX), which is largely equivalent to what you're asking, because you need PIC code to build a shared library, and you don't generally find that in static libraries. – John Bollinger Nov 11 '20 at 18:38
  • @JohnBollinger excuse me, but I don't need to merge shared libraries. I need to merge static libraries into a single one standalone shared library (all NgSpice dependencies should be a parts of result standalone shared library). – Armoken Nov 11 '20 at 19:05
  • Perhaps I said that too briefly. Static libraries, such as static versions of NgSpice's external dependencies, generally do not contain PIC code, so they cannot normally be used to build shared libraries such as the one you want to produce. Shared-library versions of the external dependencies do contain PIC code, but they cannot be merged into other libraries, so they do not serve your purpose, either. There is no third option on any system I know about. – John Bollinger Nov 11 '20 at 19:11
  • @JohnBollinger but I found on my system /usr/lib/libc.a, /usr/lib/libm.a, /usr/lib/libncurses++.a. If they didn't contain the PIC code, they wouldn't make sense, would they? – Armoken Nov 11 '20 at 19:34
  • Of course they would. Static libraries containing non-PIC code (the usual kind), are useful for building static executables. They can also, unlike shared libraries, be partially or wholly merged together to form other static libraries. But indeed they are less useful than shared libraries on systems that rely primarily on dynamically-linked executables. Some such systems (RedHat-family Linuxes, for instance) have a policy of packaging them separately if at all, and not installing them by default. – John Bollinger Nov 11 '20 at 19:42

0 Answers0