autoconf
[Top][All Lists]
Advanced

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

Re: compiling 2 files with different compilers based on --host and --bui


From: Keith Marshall
Subject: Re: compiling 2 files with different compilers based on --host and --build
Date: Mon, 28 Jul 2008 21:14:16 +0100
User-agent: KMail/1.9.9

On Monday 28 July 2008 19:54:01 address@hidden wrote:
> I have 2 files : foo.c and bar.c
>
> when I cross compile, i want to compile foo.c with the host compiler
> and bar.c with the current compiler
>
> Is it possible if I pass values to --build and --host ?

Yes, it is possible, if you set the package up suitably; usually you 
will segregate the files to be compiled with the build compiler into a 
separate directory from those to be compiled with the host compiler.  
For an example, you could take a look at how I did for the `man' 
package for MinGW: http://mingw.cvs.sourceforge.net/mingw/man/

(In this package, sources in the `tools' directory are compiled for the 
build platform, while the remainder of the package is compiled for the 
host).

> for example:
>
> ./configure --build=i686-pc-linux-gnu --host=mingw
>
> foo.c is compiled with mingw32-gcc (or whatever its name is)
> bar.c is compiled with my usual gcc

FTR, your example is not self-consistent: if your cross compiler is 
called `mingw32-gcc', then you must specify `--host=mingw32' when you 
run configure.

Regards,
Keith.




reply via email to

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