[HEADS UP] ar(1) front-end committed. (notes for cross compile)

Marcel Moolenaar xcllnt at mac.com
Fri Feb 22 17:52:36 UTC 2008


On Feb 22, 2008, at 2:24 AM, Ruslan Ermilov wrote:

>>> - Handle upgrades nicely: use GNU ar(1) during the build on older
>>>  systems, and use BSD ar(1) on newer systems.
>>
>> If we need GNU ar for the upgrade path - then lets just install it  
>> (and
>> its manage) as gnu-ar and let that be that.
>>
> I don't get you, GNU ar(1) is always installed.  Only the name is
> changes.  But let me explain more about the upgrades.
>
> Currently, we always build binutils as part of cross-tools, including
> GNU ar(1) and ranlib(1).  These binaries are then used during the  
> build.
> The BSD ar(1) doesn't need to be a cross-tool -- it doesn't depend on
> TARGET_ARCH/TARGET and is platform-neutral.

I'm very pleased to read this. Thank you Kai, Joseph and
Tim of course!

> Unfortunalely, since we provide the WITH_GNUAR option, we don't know  
> if
> /usr/bin/ar and /usr/bin/ranlib are GNU or BSD versions, so we should
> always bootstrap BSD ar(1).

Can we determine this at runtime by running ar -v. If
the output is more than 20 lines, it's GNU ar :-)

Seriously: we could run ar --version (provided we add
the support for that to BSD ar) and check the first
word. It's either GNU or BSD (provided the output of
BSD ar starts with BSD).

This should eliminate any and all kind of guessing and
should help in getting FreeBSD buildable on non-FreeBSD
systems as well.

Just a thought...

-- 
Marcel Moolenaar
xcllnt at mac.com




More information about the freebsd-current mailing list