From 466940c55e101fd9d8c4b813361d2d90c11006ee Mon Sep 17 00:00:00 2001 From: Bjarke Istrup Pedersen Date: Sun, 16 Aug 2009 09:47:56 +0300 Subject: [PATCH] Use LDFLAGS in all linker commands When building hostapd and wpa_supplicant, the build system does not respect the LDFLAGS selected in the environment in some cases. [Bug 311] --- hostapd/Makefile | 10 +++++----- wpa_supplicant/Makefile | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hostapd/Makefile b/hostapd/Makefile index de28dbc41..d9126a322 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile @@ -605,11 +605,11 @@ install: all BCHECK=../src/drivers/build.hostapd hostapd: $(BCHECK) $(OBJS) - $(CC) -o hostapd $(OBJS) $(LIBS) + $(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) OBJS_c = hostapd_cli.o ../src/common/wpa_ctrl.o ../src/utils/os_$(CONFIG_OS).o hostapd_cli: $(OBJS_c) - $(CC) -o hostapd_cli $(OBJS_c) + $(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) ../src/crypto/rc4.o ../src/crypto/md5.o ifdef CONFIG_INTERNAL_MD5 @@ -628,10 +628,10 @@ HOBJS += ../src/crypto/aes-internal-enc.o endif nt_password_hash: $(NOBJS) - $(CC) -o nt_password_hash $(NOBJS) $(LIBS_n) + $(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n) hlr_auc_gw: $(HOBJS) - $(CC) -o hlr_auc_gw $(HOBJS) $(LIBS_h) + $(CC) $(LDFLAGS) -o hlr_auc_gw $(HOBJS) $(LIBS_h) clean: $(MAKE) -C ../src clean @@ -670,7 +670,7 @@ TEST_SRC_MILENAGE = ../src/hlr_auc_gw/milenage.c ../src/crypto/aes-internal.c .. ../src/crypto/aes-wrap.c \ ../src/utils/common.c ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).c test-milenage: $(TEST_SRC_MILENAGE) - $(CC) -o test-milenage -Wall -Werror $(TEST_SRC_MILENAGE) \ + $(CC) $(LDFLAGS) -o test-milenage -Wall -Werror $(TEST_SRC_MILENAGE) \ -DTEST_MAIN_MILENAGE -I. \ -I../src/crypto -I../src/utils ./test-milenage diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile index 945546068..78daca509 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -1135,27 +1135,27 @@ win_if_list: win_if_list.c $(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w) eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c - $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ + $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ -Deap_peer_psk_register=eap_peer_method_dynamic_init eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c - $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ + $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ -Deap_peer_pax_register=eap_peer_method_dynamic_init eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c - $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ + $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ -Deap_peer_sake_register=eap_peer_method_dynamic_init eap_wsc.so: ../src/eap_peer/eap_wsc.c ../src/eap_common/eap_wsc_common.c ../src/wps/wps.c - $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ + $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ -Deap_peer_wsc_register=eap_peer_method_dynamic_init eap_ikev2.so: ../src/eap_peer/eap_ikev2.c ../src/eap_peer/ikev2.c ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.c - $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ + $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ -Deap_peer_ikev2_register=eap_peer_method_dynamic_init %.so: %.c - $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \ + $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \ -D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init Q=@