automake
[Top][All Lists]
Advanced

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

How to set AR and ARFLAGS for Apple platforms?


From: Jeffrey Walton
Subject: How to set AR and ARFLAGS for Apple platforms?
Date: Sat, 4 Nov 2017 01:01:36 -0400

Hi Everyone,

I'm having trouble selecting the preferred AR in Makefiles on Apple
systems. The default value (even when calling AM_PROG_AR) is:

   $ egrep 'AR =|ARFLAGS =' Makefile
   AMTAR = $${TAR-tar}
   AR = ar
   ac_ct_AR = ar

On Apple systems we need Apple's libtool at /usr/bin/libtool (not to
be confused with Autotool's libtool). We need it for fat libraries and
cross-compiling for some platforms.

I tried the following in my configure.ac:

   AC_CANONICAL_HOST
   IS_APPLE=`echo $build | $EGREP -i -c 'apple'`
   if [ "$IS_APPLE" -ne 0 ]; then
      AC_SUBST([AR], ["/usr/bin/libtool"])
      AC_SUBST([ac_ct_AR], ["/usr/bin/libtool"])
      AC_SUBST([ARFLAGS], ["-static -o"])
   fi

But it does not fix all of them:

   autoupdate && autoreconf --force --install --warnings=all
   ./configure
   ...

And then:

   $ egrep 'AR =|ARFLAGS =' Makefile
   AMTAR = $${TAR-tar}
   AR = /usr/bin/libtool
   ARFLAGS = -static -o
   ac_ct_AR = ar

How does one set AR and ARFLAGS for Apple platforms?

Thanks in advance,

Jeff



reply via email to

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