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

Cross-compiling git (was: [PATCHv2] add Android support)

From
Jakub Narebski <jnareb@gmail.com>
Date
May 23, 2011, 07:04 UTC
Message-ID
<m3k4dhzynr.fsf_-_@localhost.localdomain>
In-Reply-To
<20110519122026.GA30240@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 30 quoted lines
> On Thu, May 19, 2011 at 01:37:53PM +0200, Rafael Gieschke wrote:
> 
> > > (3) Add uname_S = Android (Makefile).
> > > 
> > > The first two would become much easier to justify if presented that
> > > way. At least you won't hear from anybody "we don't want that much code to
> > > not to run git on a phone!", as it is not entirely implausible to imagine
> > > environments without support for one or both of these two facilities.
> > 
> > So, you would prefer to leave out ANDROID and use something like "ifeq
> > ($(uname_S),Android)", so you will have to compile using make
> > uname_S=Android? I would be fine with that, too. But I would also be
> > fine with having to specify the build options on the command line or
> > using a config.mak if you want to keep Android out of the Makefile.
> 
> The point of uname_S is that it would be found automatically. Sadly,
> There is nothing helpful in uname to tell us that we are on android:
> 
>   $ uname -a
>   Linux localhost 2.6.37.4-cyanogenmod-01332-g7f230e8 #1 PREEMPT Tue Apr
>   12 12:54:14 EDT 2011 armv7l GNU/Linux
> 
> You could obviously guess from Linux on that architecture, but that
> seems flaky to me. You can also figure it out by looking around the
> filesystem, but that is not something I'm excited about having the
> Makefile do.
> 
> So I think we are probably stuck either with the user setting an ANDROID
> meta-flag that sets the other flags appropriately, or leaving it up to
> the user to provide a sane config.mak.

By the way, how well Git supports cross-compiling (which from the thread is necessity to generate binaries for Android)? `uname -a` trick works only when compiling on same machine.

./configure supports --host and --build options, but I don't know if it pass them down to make somehow. ANDROID=YesPlease seems wasteful: what about setting HOST or MACHINE, or even uname_* variables, or just using Autoconf's `host` (in the form of CPU-VENDOR-OS)?

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Rafael GieschkeNext: Jeff King
Message 8 of 13 in “[PATCHv2] add Android support”
  1. Rafael GieschkeMay 16, 2011
  2. Junio C HamanoMay 19, 2011
  3. Rafael GieschkeMay 19, 2011
  4. Jeff KingMay 19, 2011
  5. Rafael GieschkeMay 19, 2011
  6. Jeff KingMay 19, 2011
  7. Rafael GieschkeMay 19, 2011
  8. Cross-compiling git (was: [PATCHv2] add Android support)Jakub Narebski, May 23, 2011
  9. Jeff KingMay 23, 2011
  10. Jakub NarebskiMay 25, 2011
  11. Jeff KingMay 25, 2011
  12. Junio C HamanoMay 19, 2011
  13. Tor ArntsenMay 23, 2011

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.