Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-04-14 20:01:53 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2021-04-14 20:01:53 +0300
commiteb1b2902b8b7b7effdba711645288c64884fd3e7 (patch)
tree2079c843850bdd744641d43fc35d80695309a027 /Makefile.flags
parent7c813fbabfa672e74a387ab457b9fa39ca1a57aa (diff)
Makefile.flags: add a test for -lrt availability
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'Makefile.flags')
-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)
export SYSROOT=$(CONFIG_SYSROOT)
endif
+# libm may be needed for dc, awk, ntpd
+LDLIBS += m
# Android has no separate crypt library
# gcc-4.2.1 fails if we try to feed C source on stdin:
# echo 'int main(void){return 0;}' | $(CC) $(CFLAGS) -lcrypt -o /dev/null -xc -
# 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)
+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)
+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)
ifeq ($(CRYPT_AVAILABLE),y)
-LDLIBS += m rt crypt
-else
-LDLIBS += m rt
+LDLIBS += crypt
endif
-# libm may be needed for dc, awk, ntpd
# librt may be needed for clock_gettime()
+ifeq ($(RT_AVAILABLE),y)
+LDLIBS += rt
+endif
# libpam may use libpthread, libdl and/or libaudit.
# On some platforms that requires an explicit -lpthread, -ldl, -laudit.