From 6a3b5487cbdcec3935b07e887c221afae0a4324c Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 30 Nov 2014 18:39:57 +0100 Subject: [PATCH] NMake build: added support for WinCNG build. --- NMakefile | 7 +++++-- win32/config.mk | 26 ++++++++++++++++++++------ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/NMakefile b/NMakefile index b15fd2e..07bc2dd 100644 --- a/NMakefile +++ b/NMakefile @@ -1,7 +1,10 @@ !include "win32/config.mk" -# only OpenSSL is supported with this build system +!if "$(WITH_WINCNG)" == "1" +!include "Makefile.WinCNG.inc" +!else !include "Makefile.OpenSSL.inc" +!endif !include "Makefile.inc" OBJECTS=$(CSOURCES:.c=.obj) @@ -14,6 +17,7 @@ all-sub: win32\objects.mk clean: -rmdir 2>NUL /s/q $(TARGET) + -del 2>NUL win32\objects.mk real-clean vclean: clean -del 2>NUL libssh2.dll @@ -21,7 +25,6 @@ real-clean vclean: clean -del 2>NUL libssh2.ilk -del 2>NUL libssh2.lib -del 2>NUL *.pdb - -del 2>NUL win32\objects.mk win32\objects.mk: Makefile.inc @echo OBJECTS = \>$@ diff --git a/win32/config.mk b/win32/config.mk index f0e514a..fe88152 100644 --- a/win32/config.mk +++ b/win32/config.mk @@ -1,19 +1,19 @@ # Tweak these for your system !if "$(OPENSSLINC)" == "" -OPENSSLINC=..\openssl-0.9.8x\inc32 +OPENSSLINC=..\openssl-0.9.8zc\inc32 !endif !if "$(OPENSSLLIB)" == "" -OPENSSLLIB=..\openssl-0.9.8x\out32dll +OPENSSLLIB=..\openssl-0.9.8zc\out32dll !endif !if "$(ZLIBINC)" == "" -ZLIBINC=-DLIBSSH2_HAVE_ZLIB=1 /I..\zlib-1.2.7 +ZLIBINC=..\zlib-1.2.8 !endif !if "$(ZLIBLIB)" == "" -ZLIBLIB=..\zlib-1.2.7 +ZLIBLIB=..\zlib-1.2.8 !endif !if "$(TARGET)" == "" @@ -29,11 +29,25 @@ CPPFLAGS=/Oi /O2 /Oy /GF /Y- /MD /DNDEBUG DLLFLAGS=/DEBUG /LD !endif -CPPFLAGS=/nologo /GL /Zi /EHsc $(CPPFLAGS) /Iwin32 /Iinclude /DLIBSSH2_OPENSSL /I$(OPENSSLINC) $(ZLIBINC) +CPPFLAGS=/nologo /GL /Zi /EHsc $(CPPFLAGS) /Iwin32 /Iinclude + +!if "$(WITH_WINCNG)" == "1" +CPPFLAGS=$(CPPFLAGS) /DLIBSSH2_WINCNG +# LIBS=bcrypt.lib crypt32.lib +!else +CPPFLAGS=$(CPPFLAGS) /DLIBSSH2_OPENSSL /I$(OPENSSLINC) +LIBS=$(OPENSSLLIB)\libeay32.lib $(OPENSSLLIB)\ssleay32.lib +!endif + +!if "$(WITH_ZLIB)" == "1" +CPPFLAGS=$(CPPFLAGS) /DLIBSSH2_HAVE_ZLIB /I$(ZLIBINC) +LIBS=$(ZLIBLIB)\zlib.lib +!endif + CFLAGS=$(CPPFLAGS) RCFLAGS=/Iinclude DLLFLAGS=$(CFLAGS) $(DLLFLAGS) -LIBS=$(OPENSSLLIB)\libeay32.lib $(OPENSSLLIB)\ssleay32.lib $(ZLIBLIB)\zlib.lib ws2_32.lib user32.lib advapi32.lib gdi32.lib +LIBS=$(LIBS) ws2_32.lib user32.lib advapi32.lib gdi32.lib INTDIR=$(TARGET)\$(SUBDIR)