Search Linux Wireless

[crda PATCH 3/5] Make it possible to switch gcrypt/openssl via knob.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Diego E. 'Flameeyes' Pettenò <flameeyes@xxxxxxxxx>

By building with "make USE_OPENSSL=1", OpenSSL will be used in
libcrypt's stead. This also allows for properly depend just on the
keys-*.c source file that is actually going to be used.

Note that the all target is moved up so that it still hits as default
target.

Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@xxxxxxxxx>
---

 Makefile |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index ec06534..4ac8495 100644
--- a/Makefile
+++ b/Makefile
@@ -6,11 +6,24 @@ REG_BIN?=/usr/lib/crda/regulatory.bin
 PUBKEY_DIR=pubkeys
 
 CFLAGS += -Wall -g
-#CFLAGS += -DUSE_OPENSSL `pkg-config --cflags openssl`
-#LDLIBS += `pkg-config --libs openssl`
+
+all: crda intersect
+	$(Q)$(MAKE) --no-print-directory -f Makefile verify
+
+ifeq ($(USE_OPENSSL),1)
+CFLAGS += -DUSE_OPENSSL `pkg-config --cflags openssl`
+LDLIBS += `pkg-config --libs openssl`
+
+reglib.o: keys-ssl.c
+
+else
 CFLAGS += -DUSE_GCRYPT
 LDLIBS += -lgcrypt
 
+reglib.o: keys-gcrypt.c
+
+endif
+
 MKDIR ?= mkdir -p
 INSTALL ?= install
 
@@ -22,9 +35,6 @@ Q=@
 NQ=@echo
 endif
 
-all: crda intersect
-	$(Q)$(MAKE) --no-print-directory -f Makefile verify
-
 keys-%.c: utils/key2pub.py $(PUBKEY_DIR)/$(wildcard *.pem)
 	$(NQ) '  GEN ' $@
 	$(Q)./utils/key2pub.py --$* $(PUBKEY_DIR)/*.pem > $@
@@ -33,8 +43,6 @@ keys-%.c: utils/key2pub.py $(PUBKEY_DIR)/$(wildcard *.pem)
 	$(NQ) '  CC  ' $@
 	$(Q)$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
 
-reglib.o: keys-ssl.c keys-gcrypt.c
-
 crda: reglib.o crda.o
 	$(NQ) '  LD  ' $@
 	$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ reglib.o crda.o `pkg-config --libs libnl-1` $(LDLIBS)

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux