aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartekgola@gmail.com>2015-08-14 08:50:00 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2015-08-17 17:05:55 +0200
commitbb2fd67d0bfe16441d4b1d2e6ece83b04955b379 (patch)
tree574e0b495f07413ba7c4bb236e10591469a8b50d
parent718e228adcd7b9592b504b55217d13f4216a0450 (diff)
downloadbusybox-w32-bb2fd67d0bfe16441d4b1d2e6ece83b04955b379.tar.gz
busybox-w32-bb2fd67d0bfe16441d4b1d2e6ece83b04955b379.tar.bz2
busybox-w32-bb2fd67d0bfe16441d4b1d2e6ece83b04955b379.zip
Makefile: add missing libraries to LDLIBS
Static build with CONFIG_PAM fails on Debian Jessie due to undefined references to libdl and libaudit. Static build without pam, but with libcrypt required fails as well due to undefined references to libpthread. Fix these two cases by adding the missing libraries to LDLIBS when appropriate. Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--Makefile.flags18
1 files changed, 9 insertions, 9 deletions
diff --git a/Makefile.flags b/Makefile.flags
index a1ed1480a..bb90a08de 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -121,20 +121,20 @@ endif
121# fall back to using a temp file: 121# fall back to using a temp file:
122CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}' >crypttest.c; $(CC) $(CFLAGS) -lcrypt -o /dev/null crypttest.c >/dev/null 2>&1 && echo "y"; rm crypttest.c) 122CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}' >crypttest.c; $(CC) $(CFLAGS) -lcrypt -o /dev/null crypttest.c >/dev/null 2>&1 && echo "y"; rm crypttest.c)
123ifeq ($(CRYPT_AVAILABLE),y) 123ifeq ($(CRYPT_AVAILABLE),y)
124LDLIBS += m crypt 124LDLIBS += m crypt pthread
125else 125else
126LDLIBS += m 126LDLIBS += m
127endif 127endif
128 128
129ifeq ($(CONFIG_PAM),y) 129ifeq ($(CONFIG_PAM),y)
130# libpam uses libpthread, so for static builds busybox must be linked to 130# libpam uses libpthread, libdl and libaudit, so for static builds busybox
131# libpthread. On some platforms that requires an explicit -lpthread, so 131# must be linked to libpthread, libdl and libaudit. On some platforms that
132# it should be in LDLIBS. For non-static builds, scripts/trylink will 132# requires an explicit -lpthread, -ldl and -laudit, so it should be in
133# take care of removing -lpthread if possible. (Not bothering to check 133# LDLIBS. For non-static builds, scripts/trylink will take care of removing
134# CONFIG_STATIC because even in a non-static build it could be that the 134# these flags if possible. (Not bothering to check CONFIG_STATIC because
135# only libpam available is libpam.a, so -lpthread could still be 135# even in a non-static build it could be that the only libpam available is
136# needed.) 136# libpam.a, so -lpthread & Co. could still be needed.)
137LDLIBS += pam pam_misc pthread 137LDLIBS += pam pam_misc pthread dl audit
138endif 138endif
139 139
140ifeq ($(CONFIG_SELINUX),y) 140ifeq ($(CONFIG_SELINUX),y)