aboutsummaryrefslogtreecommitdiff
path: root/Makefile.flags
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-09-04 04:20:51 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2015-09-04 04:20:51 +0200
commit2156e228537065f04e5f862e186421df0db36612 (patch)
tree8cb99f48b95c858fb3b699c7c97c4b2e2d429f3a /Makefile.flags
parent26c423d9a8d455af59cbce70ff932c95842a2ba1 (diff)
downloadbusybox-2156e228537065f04e5f862e186421df0db36612.tar.gz
Makefile.flags: survive a build system which has no pthread
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'Makefile.flags')
-rw-r--r--Makefile.flags7
1 files changed, 6 insertions, 1 deletions
diff --git a/Makefile.flags b/Makefile.flags
index bb90a08de..b29b06839 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -121,11 +121,16 @@ endif
# fall back to using a temp file:
CRYPT_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)
ifeq ($(CRYPT_AVAILABLE),y)
-LDLIBS += m crypt pthread
+LDLIBS += m crypt
else
LDLIBS += m
endif
+PTHREAD_AVAILABLE := $(shell echo 'int main(void){return 0;}' >pthreadtest.c; $(CC) $(CFLAGS) -lpthread -o /dev/null pthreadtest.c >/dev/null 2>&1 && echo "y"; rm pthreadtest.c)
+ifeq ($(PTHREAD_AVAILABLE),y)
+LDLIBS += pthread
+endif
+
ifeq ($(CONFIG_PAM),y)
# libpam uses libpthread, libdl and libaudit, so for static builds busybox
# must be linked to libpthread, libdl and libaudit. On some platforms that