'chmod --reference' is not available on Mac OS X. Keeping the original file and directing edits into it preserves permissions and removes the need to chmod. (Tried 'sed -i' for inplace editing but unfortunately it isn't portable either.)
For example if libtool is being run as 'libtool --mode=execute ...' This fixes commit 4cf4f2b66f.
4cf4f2b66f
Add a libtool wrapper which kills dependency_libs in libtool *.la files, to ensure that libtool doesn't add unnecessary extra libraries when linking. See http://lists.fedoraproject.org/pipermail/devel/2010-November/146343.html