EXTRA_DSO_LIBS

  • Revision slug: EXTRA_DSO_LIBS
  • Revision title: EXTRA_DSO_LIBS
  • Revision id: 148412
  • Created:
  • Creator: Benjamin Smedberg
  • Is current revision? No
  • Comment no wording changes; page display name changed to 'EXTRA_DSO_LIBS'

Revision Content

EXTRA_DSO_LIBS is a convenience variable. You set it to a list of libraries to link against, and rules.mk automatically creates the appropriate linker flags (e.g. -lfoo on Linux or foo.lib on Windows). rules.mk does not use this variable directly; the makefile must set it and then include it in EXTRA_DSO_LDOPTS.

Set By

Tree makefiles set EXTRA_DSO_LIBS before including rules.mk.

Example

{{ :en/Standard_Makefile_Header() }}

LIBRARY_NAME = example
FORCE_SHARED_LIB = 1

EXTRA_DSO_LIBS = \
  foo \
  bar \
  $(NULL)

include $(topsrcdir)/config/rules.mk

# rules.mk converts EXTRA_DSO_LIBS to -lfoo -lbar

EXTRA_DSO_LDOPTS = \
  $(EXTRA_DSO_LIBS) \
  $(XPCOM_GLUE_LDOPTS) \
  $(NSPR_LIBS) \
  $(NULL)

 

Revision Source

<p><code>EXTRA_DSO_LIBS</code> is a convenience variable. You set it to a list of libraries to link against, and <code><a href="/en/Rules.mk" title="en/Rules.mk">rules.mk</a></code> automatically creates the appropriate linker flags (e.g. <code>-lfoo</code> on Linux or <code>foo.lib</code> on Windows). <code><a href="/en/Rules.mk" title="en/Rules.mk">rules.mk</a></code> does not use this variable directly; the makefile must set it and then include it in <code><a href="/en/EXTRA_DSO_LDOPTS" title="en/EXTRA_DSO_LDOPTS">EXTRA_DSO_LDOPTS</a></code>.</p>
<h3 id="Set_By" name="Set_By">Set By</h3>
<p>Tree makefiles set <code>EXTRA_DSO_LIBS</code> before including <code><a href="/en/Rules.mk" title="en/Rules.mk">rules.mk</a></code>.</p>
<h3 id="Example" name="Example">Example</h3>
<p>{{ :en/Standard_Makefile_Header() }}</p>
<pre class="eval"><a href="/en/LIBRARY_NAME" title="en/LIBRARY_NAME">LIBRARY_NAME</a> = example
<a href="/en/FORCE_SHARED_LIB" title="en/FORCE_SHARED_LIB">FORCE_SHARED_LIB</a> = 1

<strong>EXTRA_DSO_LIBS</strong> = \
  foo \
  bar \
  $(NULL)

include $(topsrcdir)/config/rules.mk

<strong># rules.mk converts EXTRA_DSO_LIBS to -lfoo -lbar</strong>

<a href="/en/EXTRA_DSO_LDOPTS" title="en/EXTRA_DSO_LDOPTS">EXTRA_DSO_LDOPTS</a> = \
  $(<strong>EXTRA_DSO_LIBS</strong>) \
  $(<a href="/en/XPCOM_GLUE_LDOPTS" title="en/XPCOM_GLUE_LDOPTS">XPCOM_GLUE_LDOPTS</a>) \
  $(<a href="/en/NSPR_LIBS" title="en/NSPR_LIBS">NSPR_LIBS</a>) \
  $(NULL)
</pre>
<p> </p>
Revert to this revision