[PATCH] Create and use LIBS_t for eapol_test

Alan T. DeKok aland
Sun Sep 11 03:28:05 PDT 2011


So that the various hardware drivers are not included.
---
 wpa_supplicant/Makefile |   39 ++++++++++++++++++++++++++-------------
 1 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index de4d6ad..6686848 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -83,6 +83,20 @@ OBJS += ../src/utils/os_$(CONFIG_OS).o
 OBJS_p += ../src/utils/os_$(CONFIG_OS).o
 OBJS_c += ../src/utils/os_$(CONFIG_OS).o
 
+ifdef CONFIG_IEEE8021X_EAPOL
+# IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
+CFLAGS += -DIEEE8021X_EAPOL
+OBJS += ../src/eapol_supp/eapol_supp_sm.o
+OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o
+NEED_EAP_COMMON=y
+ifdef CONFIG_DYNAMIC_EAP_METHODS
+CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
+LIBS += -ldl -rdynamic
+endif
+endif
+
+LIBS_t := $(LIBS)
+
 ifdef CONFIG_WPA_TRACE
 CFLAGS += -DWPA_TRACE
 OBJS += ../src/utils/trace.o
@@ -637,18 +651,6 @@ endif
 endif
 endif
 
-ifdef CONFIG_IEEE8021X_EAPOL
-# IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
-CFLAGS += -DIEEE8021X_EAPOL
-OBJS += ../src/eapol_supp/eapol_supp_sm.o
-OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o
-NEED_EAP_COMMON=y
-ifdef CONFIG_DYNAMIC_EAP_METHODS
-CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
-LIBS += -ldl -rdynamic
-endif
-endif
-
 ifdef CONFIG_AP
 NEED_80211_COMMON=y
 NEED_EAP_COMMON=y
@@ -811,6 +813,7 @@ ifdef TLS_FUNCS
 CFLAGS += -DEAP_TLS_OPENSSL
 OBJS += ../src/crypto/tls_openssl.o
 LIBS += -lssl
+LIBS_t += -lssl
 endif
 OBJS += ../src/crypto/crypto_openssl.o
 OBJS_p += ../src/crypto/crypto_openssl.o
@@ -819,6 +822,7 @@ OBJS += ../src/crypto/fips_prf_openssl.o
 endif
 LIBS += -lcrypto
 LIBS_p += -lcrypto
+LIBS_t += -lcrypto
 endif
 
 ifeq ($(CONFIG_TLS), gnutls)
@@ -828,6 +832,7 @@ LIBS += -lgnutls -lgpg-error
 ifdef CONFIG_GNUTLS_EXTRA
 CFLAGS += -DCONFIG_GNUTLS_EXTRA
 LIBS += -lgnutls-extra
+LIBS_t += -lgnutls-extra
 endif
 endif
 OBJS += ../src/crypto/crypto_gnutls.o
@@ -837,6 +842,7 @@ OBJS += ../src/crypto/fips_prf_gnutls.o
 endif
 LIBS += -lgcrypt
 LIBS_p += -lgcrypt
+LIBS_t += -lgcrypt
 CONFIG_INTERNAL_SHA256=y
 CONFIG_INTERNAL_RC4=y
 CONFIG_INTERNAL_DH_GROUP5=y
@@ -860,6 +866,7 @@ ifeq ($(CONFIG_TLS), nss)
 ifdef TLS_FUNCS
 OBJS += ../src/crypto/tls_nss.o
 LIBS += -lssl3
+LIBS_t += -lssl3
 endif
 OBJS += ../src/crypto/crypto_nss.o
 OBJS_p += ../src/crypto/crypto_nss.o
@@ -868,6 +875,7 @@ OBJS += ../src/crypto/fips_prf_nss.o
 endif
 LIBS += -lnss3
 LIBS_p += -lnss3
+LIBS_t += -lnss3
 CONFIG_INTERNAL_MD4=y
 CONFIG_INTERNAL_DH_GROUP5=y
 endif
@@ -911,6 +919,7 @@ OBJS += ../src/crypto/crypto_libtomcrypt.o
 OBJS_p += ../src/crypto/crypto_libtomcrypt.o
 LIBS += -ltomcrypt -ltfm
 LIBS_p += -ltomcrypt -ltfm
+LIBS_t += -ltomcrypt -ltfm
 CONFIG_INTERNAL_SHA256=y
 CONFIG_INTERNAL_RC4=y
 CONFIG_INTERNAL_DH_GROUP5=y
@@ -928,6 +937,7 @@ endif
 else
 LIBS += -ltommath
 LIBS_p += -ltommath
+LIBS_t += -ltommath
 endif
 CONFIG_INTERNAL_AES=y
 CONFIG_INTERNAL_DES=y
@@ -966,6 +976,7 @@ ifdef CONFIG_SMARTCARD
 ifndef CONFIG_NATIVE_WINDOWS
 ifneq ($(CONFIG_L2_PACKET), freebsd)
 LIBS += -ldl
+LIBS_t += -ldl
 endif
 endif
 endif
@@ -1197,8 +1208,10 @@ CFLAGS += -DCONFIG_NATIVE_WINDOWS
 LIBS += -lws2_32 -lgdi32 -lcrypt32
 LIBS_c += -lws2_32
 LIBS_p += -lws2_32 -lgdi32
+LIBS_t += -lws2_32 -lgdi32
 ifeq ($(CONFIG_CRYPTO), cryptoapi)
 LIBS_p += -lcrypt32
+LIBS_t += -lcrypt32
 endif
 endif
 
@@ -1376,7 +1389,7 @@ wpa_supplicant: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
 	@$(E) "  LD " $@
 
 eapol_test: .config $(OBJS_t)
-	$(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
+	$(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS_t)
 	@$(E) "  LD " $@
 
 preauth_test: .config $(OBJS_t2) 
-- 
1.7.4.1


--------------040803010209060801080004--



More information about the Hostap mailing list