Skip to content
  • Karl Wette's avatar
    Do not use $(..._la_LIBADD) to link against external libraries · 03942309
    Karl Wette authored and Adam Mercer's avatar Adam Mercer committed
    - $(..._la_LIBADD) appears late in the libtool linker command, after
      $(..._la_LDFLAGS); so any -L options in $(..._la_LDFLAGS) will appear
      before any .la library being linked in $(..._la_LIBADD). This can
      prevent the correct library being linked, e.g. if $(..._la_LDFLAGS)
      contains -L/usr/lib (e.g. from an external library .pc) and an
      old version of the .la library is install in /usr/lib
    - $(..._la_LDFLAGS) should always be ordered:
        ..._la_LDFLAGS = lib.la... $(AM_LDFLAGS) $(..._LDFLAGS) $(..._LIBS)
    - $(..._la_LIBADD) should only be used to link against libraries added
      to $(noinst_LTLIBRARIES) in the same Makefile, so automake/libtool
      knows these are local convenience libraries which are never relinked
    - Refs #5137
    (cherry picked from commit 89f16f7d45f51cfee90fc1ae70e5445999ea9690)
    Original: 6f8d5c9764f75fbd07a4e9ebc7bf820df280ba3f
    03942309