[Bug 190592] New: [exp-run] Support LIBS variable (like LDFLAGS)

no-reply-bugzilla-daemon at freebsd.org no-reply-bugzilla-daemon at freebsd.org
Tue Jun 3 22:11:26 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=190592

            Bug ID: 190592
           Summary: [exp-run] Support LIBS variable (like LDFLAGS)
           Product: Ports Tree
           Version: Latest
          Hardware: Any
                OS: Any
            Status: Needs Triage
          Severity: Affects Only Me
          Priority: ---
         Component: Infrastructure
          Assignee: freebsd-ports-bugs at FreeBSD.org
          Reporter: tijl at FreeBSD.org

Created attachment 143345
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=143345&action=edit
patch

When a port builds two libraries with libtool with one linking to the other,
libtool will relink that library on installation.  I currently don't fully
understand why it does this, but the way it does this in combination with
staging means we need to be careful with things like
LDFLAGS+=-L${LOCALBASE}/lib.

During build phase when linking a library libA with libB using for instance
../libBsrc/libB.la, libtool will replace that path with ../libBsrc/libB.so and
there's no problem.

During staging phase however libtool relinks libA with
"-L${STAGEDIR}${PREFIX}/lib -lB".  It is important that this -L option precedes
other -L options like -L${LOCALBASE}/lib, otherwise a pre-installed libB might
be linked in instead of the freshly built one.

Somewhat simplified the linker command line looks like:
${CC} ${src_LDFLAGS} ${LDFLAGS} ${src_LIBS} ${LIBS}
where src_LDFLAGS and src_LIBS are controlled by upstream and LDFLAGS and LIBS
can be controlled by us.  Normally "../libBsrc/libB.la" would be part of
src_LIBS which means we need to put flags like -L${LOCALBASE}/lib in LIBS
instead of LDFLAGS like most ports currently do.

Some ports already use LIBS.  The attached patch improves support for that.

- Add LIBS=${LIBS} to MAKE_ENV and CONFIGURE_ENV.
- Add an option helper for LIBS.
- Add a sanity check for LDFLAGS containing -L and/or -l options.  (Currently
only when GNU_CONFIGURE is defined.)
- While here, add a sanity check for CFLAGS containing -D and/or -I options. 
(Currently only when GNU_CONFIGURE is defined.)
- Adjust all ports that already use LIBS.  Also remove references to
PTHREAD_CFLAGS and PTHREAD_LIBS while here.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list