Re: cl.exe and system types

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

 



On 2018-08-20 16:11, Sébastien Hinderer wrote:
> Dear all,
> 
> I am writing an autoconf script for a project which is supposed to
> compile under both Unix and Windows.
> 
> Under Windows, the project will be built under Cygwin but it should be
> possible to use both MingW and cl.exe to compile it.
> 
> For the MingW case, giving thee right --host= option works just fine.
> For the cl.exe case, though, I am not sure exactly what to do. Indeed
> when I run
> 
> ./configure CC=cl
> 
> Then configure detects the Microsoft C compiler properly. However the
> host and target types will be cygwin as the build type. I am wondering
> whether I should adjust host and target in case the C compiler is
> detected to be cl.exe?
> 
> Are there known examples of projects that handle this situation properly
> and where I could take inspiration from?
> 
> Many thanks in advance for any help / pointers!

If you add Automake to the mix, it can provide help with its "compile"
wrapper script which solves some issues. You need to add AM_PROG_CC_C_O
to your configure.ac to bring that in.

If you want to build DLLs, Libtool can do that using cl.exe

If you want to build plain old static archives, you use lib.exe for that
instead of falling back to MinGW ar. IIRC, you need to say AR=lib for that
though, and again, you need a wrapper from Automake (ar-lib, use AM_PROG_AR
to bring that in).

Libtool also knows how to use dumpbin instead of the MinGW nm, I think
you need to say NM="dumpbin -symbols" for that (or something like that).

So, the pieces are there, it's just not obvious how to put them together.
However, it's been a long time since I bothered. Something might have
died...

And of course, the source has to adapt to a lot of annoying crap.

Cheers,
Peter


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux