#26247: Various libusb libraries have same base name; please make each unique ---------------------------------------------------+------------------------ Reporter: michaelld@… | Owner: macports-tickets@… Type: enhancement | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Resolution: | Keywords: Port: libusb, libusb-compat, libusb-legacy | ---------------------------------------------------+------------------------ Changes (by michaelld@…): * status: closed => reopened * resolution: invalid => Comment: This is an enhancement request more than a bug report; maybe a little bit of each. I'm reopening this ticket for your re-consideration given the below. Let me give you another scenario, which BTW is what is happening that prompted this issue. I'm linking to both 'libfoo' and 'libusb' legacy (but, I have the other libusb's installed as well since they are used by other ports). libfoo comes back with: {{{ FOO_LDFLAGS="-L${prefix}/lib -lfoo" }}} and libusb comes back with: {{{ LIBUSB_LDFLAGS="-L${prefix}/lib/libusb-legacy -lusb" }}} Now when I link, I see: {{{ gcc -o bar bar.o ${FOO_LDFLAGS} ${LIBUSB_LDFLAGS} }}} so, which version of -lusb is used, the one in ${prefix}/lib or the one in ${prefix}/lib/libusb-legacy? I can tell you from testing it that it's the former because GCC will search for undetermined libraries in the order in which -L is places on the command line. I would have to go into the Makefile and change the link command to read: {{{ gcc -o foo foo.c ${LIBUSB_LDFLAGS} ${FOO_LDFLAGS} }}} in order to find the correct version of -lusb, which I really don't want to do because, among other reasons, it's not guaranteed to work with the next version of BAR. Now, OTOH, if the library names are unique (i.e., "-lusb-legacy" is used), then that's not an issue no matter where they are located. And, given that BAR retrieves the LIBUSB info via PKGCONFIG, renaming the library is already handled robustly. -- Ticket URL: <http://trac.macports.org/ticket/26247#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS