git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git configure/make does not honor ARFLAGS

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Sep 16, 2015, 19:38 UTC
Message-ID
<20150916193856.GA15738@flurp.local>
In-Reply-To
<CAPc5daXjnLduFOD5au+wV0AN6EXTUWTM6JQ66U+0DwzVhk3YcA@mail.gmail.com>
On Sun, Sep 13, 2015 at 10:52:36PM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> On Sun, Sep 13, 2015 at 9:59 PM, Jeff King <peff@peff.net> wrote:
> >
> > My follow-up question was going to be: is this something we should be
> > setting in config.mak.uname for appropriate versions of Darwin? It
> > wasn't clear to me from Eric's description if this is something that
> > particular versions need, or just something that people who want to
> > build Universal binaries would choose to use.
> 
> My preference is not to worry anything about config.mak.uname
> ourselves, until somebody who does work on the ports proposes
> to do something concrete.

Normal 'ar' works for non-multi-architecture-binaries (MAB); 'libtool' is only needed when building Universal. Unfortunately, there probably isn't a reliable way to auto-detect a Universal build. Back in the NextStep days, projects would support MAB via a TARGET_ARCHS variable:

    make TARGET_ARCHS='m68k i386 sparc hppa'

And, for project's which didn't understand that, you'd just have to specify build flags which the Makefile did understand:

    make CFLAGS='-arch ppc -arch i386' LDFLAGS='-arch ppc -arch i386'

or, just make ad-hoc modifications to the Makefile if it didn't even respect those variables. So, I don't think there's really a good way to detect MAB builds.

On the other hand, as far as I know, it's *always* safe to replace 'ar' with 'libtool' on this platform, so we could just do it unconditionally.

--- 8< ---
diff --git a/config.mak.uname b/config.mak.uname
index be5cbec..e7970dd 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -88,6 +88,8 @@ ifeq ($(uname_S),SCO_SV)
 	TAR = gtar
 endif
 ifeq ($(uname_S),Darwin)
+	AR = libtool
+	ARFLAGS = -static -o
 	NEEDS_CRYPTO_WITH_SSL = YesPlease
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
--- 8< ---

I've tested this on modern Mac OS X, Yosemite 10.10.5 (x86_64), and
ancient Snow Leopard 10.5.8 PowerPC (circa 2009), and it works fine
in both cases, so perhaps that's the way to go.

My one concern, however, would be people who've installed GNU libtool
and have that in PATH before Apple's tools.
Previous: Junio C HamanoNext: Eric Sunshine
Message 9 of 12 in “Git configure/make does not honor ARFLAGS”
  1. Jeffrey WaltonAug 30, 2015
  2. Jeff KingSep 13, 2015
  3. Eric SunshineSep 13, 2015
  4. Jeffrey WaltonSep 13, 2015
  5. Jeff KingSep 14, 2015
  6. Junio C HamanoSep 14, 2015
  7. Jeff KingSep 14, 2015
  8. Junio C HamanoSep 14, 2015
  9. Eric SunshineSep 16, 2015
  10. Eric SunshineSep 16, 2015
  11. Jeffrey WaltonSep 14, 2015
  12. Junio C HamanoSep 15, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.