sysadmin: is there a manifesto on environment settings for macports?

Darren Weber dweber at
Thu Apr 9 16:25:51 PDT 2009

Is there a general manifesto on how to configure OSX for macports?

I see the following documents online, but they don't answer all my questions
for macports:

The installation of macports proposes a user-specific environment (using
~/.profile or similar, but I wonder if that resolves path issues when using
sudo or for system deamons, etc.).

An issue that I have is with the dynamic linker unable to resolve some
library paths at run-time.  I would like to see a document on macport wisdom
for dyld.

In my explorations today, to resolve some environment settings, I found a
few places where the environment is configured (I'm using bash).

I see the following system path settings available:

/etc/paths.d/*  (used by /usr/libexec/path_helper, called from /etc/profile
[and elsewhere?])

For bash, there are a few /etc files around:
/etc/profile (which calls path_helper and it handles at /etc/paths.d/*)

For csh, there are /etc/csh.* files.

In the user domain, there are the usual suspects (~/.bashrc, ~/.profile,
~/.cshrc, ~/.login, etc.).  Then there is a sneeky OSX specific environment
file in ~/.MacOSX/environment.plist.  The macports installation recommends
using the *nix convention of setting up the environment in the shell login
profiles (.profile, .bashrc, etc.).

What about dynamic library path configuration (for dyld)?  What is the best
way to configure this for macports?  Should settings apply at the system
level (I would assume so) or at the user level (probably not).  I currently
have one env setting for postgresql83 (and I think this one is user

When building libraries, is there a general philosophy on using rpath?  I'm
confused about this, eg consider:

I've found that rpath can be a problem because macports builds into a
destroot.  When I use rpath outside of a destroot, it works fine, but I
don't understand how to use it with a destroot, as in macports.  If a port
should use rpath, how should a port set RPATH correctly (maybe a relative
path to ${prefix})?  Or, should a port update a DYLD path setting so that
run-time dependencies get resolved (see options for path settings in `man
dyld` and maybe ports should set a system or user equivalent to

See also:

Take care, Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-users mailing list