diff options
-rw-r--r-- | Makefile.flags | 13 |
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) | |||
145 | export SYSROOT=$(CONFIG_SYSROOT) | 145 | export SYSROOT=$(CONFIG_SYSROOT) |
146 | endif | 146 | endif |
147 | 147 | ||
148 | # libm may be needed for dc, awk, ntpd | ||
149 | LDLIBS += 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: |
152 | 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) | 154 | CRYPT_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) |
155 | RT_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) | ||
153 | ifeq ($(CRYPT_AVAILABLE),y) | 156 | ifeq ($(CRYPT_AVAILABLE),y) |
154 | LDLIBS += m rt crypt | 157 | LDLIBS += crypt |
155 | else | ||
156 | LDLIBS += m rt | ||
157 | endif | 158 | endif |
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() |
160 | ifeq ($(RT_AVAILABLE),y) | ||
161 | LDLIBS += rt | ||
162 | endif | ||
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. |