Preventing other software from linking against MacPorts libraries

Bill Cole macportsusers-20171215 at billmail.scconsult.com
Thu May 9 12:39:27 UTC 2024


On 2024-05-09 at 02:03:15 UTC-0400 (Thu, 9 May 2024 00:03:15 -0600)
Smith via macports-users <smitty_decoy at mac.com>
is rumored to have said:

> Hello,
>
> I occasionally run into a problem where I'm building software from a 
> tarball or a git clone outside of MacPorts, and the build process 
> somehow ends up linking or trying to link against libraries in the 
> MacPorts space (/opt/local). How can I prevent this from happening? 
> Sometimes I just end up deleting /opt/local to get it to build and 
> then re-install MacPorts, which can be painful or at least tiresome. I 
> have to assume there is a better way or that I'm doing something 
> wrong?
>
> Thanks in advance for any thoughts,

When building software outside of MacPorts, you should cleanse your 
environment of any clues that /opt/local/ is a place to look for 
software. Remove /opt/local/bin and /opt/local/sbin from your PATH when 
running any 'configure' script (or other GNU auto* tools) that looks for 
tools and libraries.

Any software that is meant to be multiplatform should have some 
mechanism for explicitly setting where to find libraries, such as 
options to an autoconf-based configure script. You can use those or 
(less ideal) just manually obliterate any hints of /opt/local in the 
Makefiles created by the configure script.

-- 
Bill Cole
bill at scconsult.com or billcole at apache.org
(AKA @grumpybozo at toad.social and many *@billmail.scconsult.com 
addresses)
Not Currently Available For Hire


More information about the macports-users mailing list