How to switch between shared library output and executable output in libtool/autotools projects?

StackOverflow https://stackoverflow.com/questions/4391882

  •  10-10-2019
  •  | 
  •  

Question

I have some autotools-managed project. Apart from source code files it has autogen.sh, configure.ac, Makefile.am, src/Makefile.am.

  1. How to find out looking at these file if it is a library or application? For example, in Qt I have "TEMPLATE = app" or "TEMPLATE = lib" which decides this. What is it in autotools?

  2. How to switch from generating a executable application to generating the library and back?

Was it helpful?

Solution

In your Makefile.am you should have something that looks like:

bin_PROGRAMS = foo (or sbin or something else depending on where it lands)

Change that to:

lib_LTLIBRARIES = foo.la

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top