[Top][All Lists]

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

Re: cl.exe and system types

From: Peter Rosin
Subject: Re: cl.exe and system types
Date: Tue, 21 Aug 2018 16:14:19 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

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 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

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


reply via email to

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