curl-library
RE: proposed changes for winbuild makefile
Date: Tue, 17 Jan 2017 09:28:53 +0000
Anyhow, the MakefileBuild.vc 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 MakefileBuild.vc is not funny stuff to read and understand (but UNIX makefiles can be complex too).
Kees
-----Original Message-----
From: curl-library [mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Rod Widdowson
Sent: Tuesday, January 17, 2017 10:11
To: 'libcurl development' <curl-library_at_cool.haxx.se>
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...
https://git.shibboleth.net/view/?p=cpp-msbuild.git;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
different
> 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 Makefile.vc 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 Makefile.vc. And the clean target in MakefileBuild.vc was unreachable, due to some tests.
This has
> been fixed, and nmake -f Makefile.vc mode=static clean now works.
Great news!. Thanks.
> - Minor cleanup in MakefileBuild.vc: 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.
Rod
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
- application/x-zip-compressed attachment: makefile.win.patch.zip