Autotools: Difference between revisions

From miki
Jump to navigation Jump to search
Line 1: Line 1:
== Basic usage ==
The default sequence is:
<source lang="bash">
autoreconf -ivf
./configure # Possibly add things like: --prefix=/usr
make
sudo make install
</source>

== Configure ==
== Configure ==
=== Add extra link flags or libraries ===
=== Add extra link flags or libraries ===

Revision as of 06:55, 26 October 2017

Basic usage

The default sequence is:

autoreconf -ivf
./configure             # Possibly add things like: --prefix=/usr
make
sudo make install

Configure

Add extra link flags or libraries

To add extra link flags (like location of libraries), use LDFLAGS:

./configure LDFLAGS="-L/path/to/libs"

To add extra libraries, use LDLIBS:

./configure LDLIBS="-lintl -liconv"
  • Note: Don't use LDFLAGS to add extra libraries, because it appears before list of source objects, and hence will be ignored by gcc.
  • Note: If LDLIBS does not work, try LIBS instead.