aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.flags13
1 files changed, 8 insertions, 5 deletions
diff --git a/Makefile.flags b/Makefile.flags
index 3b02bfaac..667481983 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -145,18 +145,21 @@ CFLAGS += --sysroot=$(CONFIG_SYSROOT)
145export SYSROOT=$(CONFIG_SYSROOT) 145export SYSROOT=$(CONFIG_SYSROOT)
146endif 146endif
147 147
148# libm may be needed for dc, awk, ntpd
149LDLIBS += m
148# Android has no separate crypt library 150# Android has no separate crypt library
149# gcc-4.2.1 fails if we try to feed C source on stdin: 151# gcc-4.2.1 fails if we try to feed C source on stdin:
150# echo 'int main(void){return 0;}' | $(CC) $(CFLAGS) -lcrypt -o /dev/null -xc - 152# echo 'int main(void){return 0;}' | $(CC) $(CFLAGS) -lcrypt -o /dev/null -xc -
151# fall back to using a temp file: 153# fall back to using a temp file:
152CRYPT_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) 154CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}' >bb_libtest.c; $(CC) $(CFLAGS) -lcrypt -o /dev/null bb_libtest.c >/dev/null 2>&1 && echo "y"; rm bb_libtest.c)
155RT_AVAILABLE := $(shell echo 'int main(void){return 0;}' >bb_libtest.c; $(CC) $(CFLAGS) -lrt -o /dev/null bb_libtest.c >/dev/null 2>&1 && echo "y"; rm bb_libtest.c)
153ifeq ($(CRYPT_AVAILABLE),y) 156ifeq ($(CRYPT_AVAILABLE),y)
154LDLIBS += m rt crypt 157LDLIBS += crypt
155else
156LDLIBS += m rt
157endif 158endif
158# libm may be needed for dc, awk, ntpd
159# librt may be needed for clock_gettime() 159# librt may be needed for clock_gettime()
160ifeq ($(RT_AVAILABLE),y)
161LDLIBS += rt
162endif
160 163
161# libpam may use libpthread, libdl and/or libaudit. 164# libpam may use libpthread, libdl and/or libaudit.
162# On some platforms that requires an explicit -lpthread, -ldl, -laudit. 165# On some platforms that requires an explicit -lpthread, -ldl, -laudit.