curl / Mailing Lists / curl-library / Single Mail


RE: proposed changes for winbuild makefile

From: Kees Dekker <>
Date: Tue, 17 Jan 2017 09:28:53 +0000

Anyhow, the is fairly complex (IMO too complex). This is because the name of the target depends at runtime whether a DLL or static curl library is built. I don’t have time now to fix this all, but normally (similar to UNIX makefiles) you get what you ask, i.e. targets for all things exist, and you will build what you want. For that reason, creating the DLL by using the static library will greatly simplify the makefile and remove a lot of the !IF constructs. Unfortunately, Visual studio also produces an import library (a stub to use the DLL) when making a DLL.

I discovered another bug in my previous patch. When passing -L<openssllibdir> etc, all objects from the openSSL (and zlib and libssh2 etc) are aggregated in the libcurl_a.lib. This has been fixed in attached patch. If working with a patch is a problem, I will try to see how I can make a github pull request. Sorry for this new diff. I also removed some more duplicate variable assignment. The is not funny stuff to read and understand (but UNIX makefiles can be complex too).


-----Original Message-----
From: curl-library [] On Behalf Of Rod Widdowson
Sent: Tuesday, January 17, 2017 10:11
To: 'libcurl development' <>
Subject: RE: proposed changes for winbuild makefile

I'd need to see how we would build with this (we build mostly WITH_xxx=dll), but a priori it addresses many of the problems that we
are currently addressing the MAKE="NMAKE /e" trick...;a=blob;f=dependencies/libcurl-new.bat;hb=HEAD

> I had to solve some things to be able to build curl with zlib, libssh2 and openSSL libraries at a different location, and with
> names.

That’s one example of what we need.

> - The openSSL libraries have been renamed as of openSSL 1.1.0x.
As is that.

> An example of calling the make is: nmake -f mode=static VC=14 WITH_SSL=static WITH_ZLIB=static WITH_SSH2=static
> GEN_PDB=yes DEBUG=no MACHINE=x64 SSL_CFLAGS="/I$(OpenSSLIncDir)" ZLIB_CFLAGS="/I$(ZlibIncDir)"
> SSH2_CFLAGS="/I$(Libssh2IncDir)" SSL_LIBS="libcrypto.lib libssl.lib" ZLIB_LIBS=zlib.lib SSH2_LIBS=libssh2.lib
> DEVEL_LFLAGS="/LIBPATH:$(OpenSSLLibDir) /LIBPATH:$(ZlibLibDir) /LIBPATH:$(Libssh2LibDir)". The $(xxx) are variables that point to
> the actual include and library paths.

That looks about what we'd need. I'm assuming that somewhere in there is an inferred "ENABLE_WINSSL=no"

Is there the option of setting BASE_NAME and BASE_NAME_DEBUG? we need that (to keep the dll name space separate).

> -          There was no clean target in And the clean target in was unreachable, due to some tests.
This has
> been fixed, and nmake -f mode=static clean now works.

Great news!. Thanks.

> -          Minor cleanup in DEVEL_BIN was not used.

> This is my first contribution to this mailing list. Not sure whether all information is provided. The patch is in *NIX style
format and can
> be applied by using the patch tool.

Hmm. Let's see whether git can eat it, failing that I guess that the Unix support in "Anniversary Edition" will eat it.

I'll try and review this this week.


List admin:

List admin:

Received on 2017-01-17