From dbc617d28c3a05d7299365de1102ea19a3c19ff8 Mon Sep 17 00:00:00 2001
From: Martin Storsjo <martin@martin.st>
Date: Wed, 7 Apr 2010 09:20:02 +0300
Subject: [PATCH 3/3] Make crypto support configurable through make variables

---
 librtmp/Makefile |   10 ++++++++--
 librtmp/rtmp.h   |    2 --
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/librtmp/Makefile b/librtmp/Makefile
index dfa7f55..b34947f 100644
--- a/librtmp/Makefile
+++ b/librtmp/Makefile
@@ -14,7 +14,7 @@ REQ_OPENSSL=libssl,libcrypto
 CRYPTO_LIB=$(LIB_$(CRYPTO))
 CRYPTO_REQ=$(REQ_$(CRYPTO))
 
-DEF=-DRTMPDUMP_VERSION=\"$(VERSION)\" -DUSE_$(CRYPTO)
+DEF=-DRTMPDUMP_VERSION=\"$(VERSION)\"
 OPT=-O2
 CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT)
 
@@ -25,7 +25,13 @@ all:	librtmp.a
 clean:
 	rm -f *.o *.a
 
-librtmp.a: rtmp.o log.o amf.o hashswf.o parseurl.o
+OBJS = rtmp.o log.o amf.o parseurl.o
+ifneq ($(CRYPTO), no)
+    OBJS += hashswf.o
+    CFLAGS += -DCRYPTO -DUSE_$(CRYPTO)
+endif
+
+librtmp.a: $(OBJS)
 	$(AR) rs $@ $?
 
 log.o: log.c log.h Makefile
diff --git a/librtmp/rtmp.h b/librtmp/rtmp.h
index 43dd4a0..62f9d10 100644
--- a/librtmp/rtmp.h
+++ b/librtmp/rtmp.h
@@ -24,8 +24,6 @@
  *  http://www.gnu.org/copyleft/lgpl.html
  */
 
-#define CRYPTO
-
 #include <errno.h>
 #include <stdint.h>
 #include <stddef.h>
-- 
1.6.4.4

