Since MacPorts is not compatible with /usr/local *, whenever I install/update ports with MacPorts I would
sudo mv /usr/local /usr/local.bak
and after I am done building MacPorts stuff
sudo mv /usr/local.bak /usr/local
This works and solves a lot of the previous mysterious build errors. However it is very cumbersome and sometimes I don't remember to do this, either the "before" step or the "after" step, and have to fix it afterward.
Is there a better way to avoid this conflict?
EDIT
* see these links for examples/suggestions of temporarily moving /usr/local as a solution to MacPort build problems.
http://stackoverflow.com/questions/1827377/install-git-core-svn-fails-with-macport
