curl-library
Re[8]: Static libcurl size under Windows
Date: Tue, 25 Apr 2017 17:35:59 +0300
Hi, Kees.
>>I need static libcurl.lib which uses static OpenSSL but does NOT contain it as
>>part of itself. Otherwise I would get link errors (symbol conflicts) when
>>building VirtualBox with both libcurl AND openssl. The first scenario gave me
>>exactly what I needed, but now in 7.54.0 it is deprecated. How do I get that
>>type of libcurl.lib now?
> If I remember well (it is some time ago that I have built curl 7.53.1 with
> openSSL 1.1.0e, using Visual Studio 2015, all static libs), the lib command in
> the makefilebuild.vc was not correct. There was a discussion with other people
> about the Windows build, but unfortunately I did not have time to make a git
> pull request. You may benefit from attached make files (the .org files are the
> original ones). Use it at your own risk. Store in the winbuild directory. The
> change that is important to you is in MakefileBuild.vc. See the changed lib command/MakefileBuild:375-381.
> My (64-bit release) build is called by using the following command (drive
> letters and path names are off course system/user dependent):
> nmake -f Makefile.vc mode=static VC=14 WITH_SSL=static WITH_ZLIB=static
> WITH_SSH2=static GEN_PDB=yes DEBUG=no MACHINE=x86
> SSL_CFLAGS="/IX:\common\thirdparty\OpenSSL\build\Windows\Win32\include"
> ZLIB_CFLAGS="/IX:\common\thirdparty\zlib\build\Windows\include"
> SSH2_CFLAGS="/IX:\common\thirdparty\libssh2\build\Windows\include"
> SSL_LIBS="libcrypto.lib libssl.lib" ZLIB_LIBS=zlib.lib SSH2_LIBS=libssh2.lib
> DEVEL_LFLAGS="/LIBPATH:X:\common\thirdparty\OpenSSL\build\Windows\Win32\lib
> /LIBPATH:X:\common\thirdparty\zlib\build\Windows\Win32\lib
> /LIBPATH:X:\common\thirdparty\libssh2\build\Windows\Win32\lib"
> I know that I used a quick & dirty workaround. Just check the diffs between
> the org and non-org file to see what I changed.
Thank you very much! I tried your makefiles, and indeed they produced the
"clean" static libs. I managed to achieve the same (or similar) result by
manually copying the last link.exe command from make log and removing all the
libs from it, leaving only objs, but I didn't have time to adapt the makefile
rules to do it properly.
BTW, you have probably used outdated original makefiles, because 7.54.0 contains
some code about OpenSSL 1.1.0 lib file names that yours doesn't. If you specify
SSL_LIBS manually it's OK, but otherwise it would fail when linking curl.exe or
libcurl.dll (in dynamic build). I'd suggest to replace the following
MakefileBuild.vc code (lines 137-139):
!IFNDEF SSL_LIBS
SSL_LIBS = libeay32.lib ssleay32.lib
!ENDIF
with this:
!IFNDEF SSL_LIBS
!IF EXISTS("$(DEVEL_LIB)\libssl.lib")
SSL_LIBS = libssl.lib libcrypto.lib
!ELSE
SSL_LIBS = libeay32.lib ssleay32.lib
!ENDIF
!ENDIF
Anyway, as I wrote in another mail, the large static libcurl.lib turned out to
be OK for building VirtualBox, it caused neither link conflicts, nor binary
size increase. So this issue is not as serious as I thought, but it's still
worth having the small lib, in case some other external projects rely on the
static version of libcurl and is not so tolerant to the library contents.
-- Bye. With best regards, Konstantin Vlasov. ------------------------------------------------------------------- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2017-04-25