]> granicus.if.org Git - libevent/commitdiff
attempt to support OpenSSL in Makefile.nmake
authorPatrick Pelletier <code@funwithsoftware.org>
Sat, 9 Jun 2012 02:47:23 +0000 (19:47 -0700)
committerPatrick Pelletier <code@funwithsoftware.org>
Wed, 4 Jul 2012 05:50:24 +0000 (22:50 -0700)
Makefile.nmake
test/Makefile.nmake

index f0ec102320dc5bcb042f15a16877b7d050f5d19b..76a423b43c1e677c464cfa716e381a43e41a4106 100644 (file)
@@ -1,10 +1,19 @@
-# WATCH OUT!  This makefile is a work in progress.
+# WATCH OUT!  This makefile is a work in progress.             -*- makefile -*-
 #
 # I'm not very knowledgeable about MSVC and nmake beyond their most basic
 # aspects.  If anything here looks wrong to you, please let me know.
 
+# If you want OpenSSL support, uncomment and change to where your OpenSSL is
+# OPENSSL_DIR=c:\openssl
+
+!IFDEF OPENSSL_DIR
+SSL_CFLAGS=/I$(OPENSSL_DIR)\include /DEVENT__HAVE_OPENSSL
+!ELSE
+SSL_CFLAGS=
+!ENDIF
+
 # Needed for correctness
-CFLAGS=/IWIN32-Code /Iinclude /Icompat /DHAVE_CONFIG_H /I.
+CFLAGS=/IWIN32-Code /Iinclude /Icompat /DHAVE_CONFIG_H /I. $(SSL_CFLAGS)
 
 # For optimization and warnings
 CFLAGS=$(CFLAGS) /Ox /W3 /wd4996 /nologo
@@ -21,8 +30,16 @@ WIN_OBJS=win32select.obj evthread_win32.obj buffer_iocp.obj \
        event_iocp.obj bufferevent_async.obj
 EXTRA_OBJS=event_tagging.obj http.obj evdns.obj evrpc.obj
 
-ALL_OBJS=$(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS)
-STATIC_LIBS=libevent_core.lib libevent_extras.lib libevent.lib
+!IFDEF OPENSSL_DIR
+SSL_OBJS=bufferevent_openssl.obj
+SSL_LIBS=libevent_openssl.lib
+!ELSE
+SSL_OBJS=
+SSL_LIBS=
+!ENDIF
+
+ALL_OBJS=$(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS) $(SSL_OBJS)
+STATIC_LIBS=libevent_core.lib libevent_extras.lib libevent.lib $(SSL_LIBS)
 
 
 all: static_libs tests
@@ -38,12 +55,21 @@ libevent_extras.lib: $(EXTRA_OBJS)
 libevent.lib: $(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS)
        lib $(LIBFLAGS) $(CORE_OBJS) $(EXTRA_OBJS) $(WIN_OBJS) /out:libevent.lib
 
+libevent_openssl.lib: $(SSL_OBJS)
+       lib $(LIBFLAGS) $(SSL_OBJS) /out:libevent_openssl.lib
+
 clean:
        del $(ALL_OBJS)
        del $(STATIC_LIBS)
        cd test
        $(MAKE) /F Makefile.nmake clean
+       cd ..
 
 tests:
        cd test
+!IFDEF OPENSSL_DIR
+       $(MAKE) OPENSSL_DIR=$(OPENSSL_DIR) /F Makefile.nmake
+!ELSE
        $(MAKE) /F Makefile.nmake
+!ENDIF
+       cd ..
index 6f37db9b86ef398dbbb08a140b03ee764b6f46fb..f33ca530f716f2dad37def0b896fe4b4ea075c3a 100644 (file)
@@ -1,5 +1,16 @@
+# WATCH OUT!  This makefile is a work in progress.             -*- makefile -*-
 
-CFLAGS=/I.. /I../WIN32-Code /I../include /I../compat /DHAVE_CONFIG_H /DTINYTEST_LOCAL
+!IFDEF OPENSSL_DIR
+SSL_CFLAGS=/I$(OPENSSL_DIR)\include /DEVENT__HAVE_OPENSSL
+SSL_OBJS=regress_ssl.obj
+SSL_LIBS=..\libevent_openssl.lib $(OPENSSL_DIR)\lib\libeay32.lib $(OPENSSL_DIR)\lib\ssleay32.lib
+!ELSE
+SSL_CFLAGS=
+SSL_OBJS=
+SSL_LIBS=
+!ENDIF
+
+CFLAGS=/I.. /I../WIN32-Code /I../include /I../compat /DHAVE_CONFIG_H /DTINYTEST_LOCAL $(SSL_CFLAGS)
 
 CFLAGS=$(CFLAGS) /Ox /W3 /wd4996 /nologo
 
@@ -9,7 +20,7 @@ REGRESS_OBJS=regress.obj regress_buffer.obj regress_http.obj regress_dns.obj \
        regress_et.obj regress_bufferevent.obj \
        regress_listener.obj regress_util.obj tinytest.obj \
        regress_main.obj regress_minheap.obj regress_iocp.obj \
-       regress_thread.obj
+       regress_thread.obj $(SSL_OBJS)
 
 OTHER_OBJS=test-init.obj test-eof.obj test-weof.obj test-time.obj \
        bench.obj bench_cascade.obj bench_http.obj bench_httpclient.obj \
@@ -28,7 +39,7 @@ LIBS=..\libevent.lib ws2_32.lib shell32.lib advapi32.lib
 all: $(PROGRAMS)
 
 regress.exe: $(REGRESS_OBJS)
-       $(CC) $(CFLAGS) $(LIBS) $(REGRESS_OBJS)
+       $(CC) $(CFLAGS) $(LIBS) $(SSL_LIBS) $(REGRESS_OBJS)
 
 test-init.exe: test-init.obj
        $(CC) $(CFLAGS) $(LIBS) test-init.obj