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

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

 



On Mon, 23 May 2011, Jeff King wrote:
> On Mon, May 23, 2011 at 12:04:44AM -0700, Jakub Narebski wrote:
> 
> > > 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.
> 
> It should work fine if you set the make variables appropriately for the
> target platform. But I've never tried it. Didn't msysgit people
> cross-compile for a while (or maybe still do)?

Well, the vague sketch of an idea is for Makefile to set uname_*
variables depending on the contents of `host` / `HOST` build variable,
so that detection is based on the target OS.

> > ./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)?
> 
> I know very little about autoconf internals, but what would
> CPU-VENDOR-OS look like? Your CPU is probably some arm variant, though
> it will vary from device to device. Your kernel is Linux. The special
> steps in this case are about some weird userspace issues. So the
> equivalent would be more like finding a Linux distro that ships a crappy
> libc.  I guess that is what the "vendor" slot is for?

Well, http://www.gmplib.org/list-archives/gmp-bugs/2011-January/002156.html
says that it is

  $ ./configure --host=arm-linux-androideabi

(though I am not sure if it shouldn't be arm-androideabi-linux instead).
 
> But even if you somehow tell autoconf or the Makefile "yes, this is
> android", you are still going to need to manually specify the set of
> knobs that should be tweaked in that case.

See first paragraph of my reply.

> Whether you call it "ANDROID=YesPlease" or some other form.

I think it is better to solve more generic issue of cross-compiling
Git rather than solving narrow issue of cross-compiling Git on Android.

Of course we still need the part that sets variables appropriately
when we are compiling for Android (whether natively, or cross-compiling).
-- 
Jakub Narebski
Poland
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]