[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unable to set AR and ARFLAGS for operating systems like OS X

From: Jeffrey Walton
Subject: Re: Unable to set AR and ARFLAGS for operating systems like OS X
Date: Sat, 4 Nov 2017 18:11:24 -0400

On Sat, Nov 4, 2017 at 12:30 PM, Jeffrey Walton <address@hidden> wrote:
> It looks like Autotools is not equipped to handle changes to AR and
> ARFLAGS. There is no AC_PROG_AR macro to find the correct AR and
> ARFLAGS for the platform and compiler.
> Trying to hack AR configuration information in configure.ac produces a
> non-working configuration due to hard-coding ARFLAGS like "cru":
>   IS_APPLE=`echo $build | $EGREP -i -c 'apple'`
>   if test "$IS_APPLE" -ne "0"; then
>      AC_SUBST([AR], ["/usr/bin/libtool"])
>      AC_SUBST([ARFLAGS], ["-static -o"])
>      AC_SUBST([ac_ct_AR], ["/usr/bin/libtool"])
>   fi
> OS X needs the following flags, otherwise building fat libraries and
> some cross-compiles fail.
>   AR = /usr/bin/libtool
>   ARFLAGS = -static -o
> Usage of AR and ARFLAGS on OS X must be:
>   $(AR) $(ARFLAGS) <library name> ...
> Similar problems are encountered on Solaris with SunCC. We need the
> following on the platform when SunCC is the compiler.
>   AR = $(CXX)
>   ARFLAGS = -xar -o
>   RANLIB = true

In case its need for Apple platforms:

   $ AR=/usr/bin/libtool ARFLAGS='-static -o' ./configure
   checking for a BSD-compatible install... /usr/bin/install -c
   checking dependency style of gcc... gcc3
   checking the archiver (/usr/bin/libtool) interface... unknown
   configure: error: could not determine /usr/bin/libtool interface


   $ /usr/bin/libtool -V
   Apple Inc. version cctools-862

/usr/bin/libtool --version, -v and --help produce errors. -V is the
only one that works.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]