Why ar doesn't call ranlib on Mac?

Rainer Müller raimue at macports.org
Tue Mar 3 17:29:18 PST 2009


Alexy Khrabrov wrote:
> In building various Linux things from source on Mac, I've run into the  
> "archive has no table of contents" problem several times.  The fix is  
> invariably to go and stick ranlib after each ar.
> 
> Now I wonder, why don't we replace /usr/bin/ar with a wrapper calling  
> the ar and then ranlib if it's an ar c?  No more stupid ranlib  
> peppering then!

Make a patch which adds a 's' to the ar arguments and ask upstream to
apply it. Running 'ar s' is equivalent to ranlib.
Common usage is:
  ar rcs libfoo.a $LIBS

> And what's wrong with Macs anyways?  Why do we have to do it where  
> Linux folks are happy without it?

Mac OS X is based on BSD, not GNU/Linux. Welcome to the UNIX world!

Rainer


More information about the macports-users mailing list