diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-03-10 16:30:00 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-03-10 16:30:00 +0100 |
commit | c528917195498e03c8b776bbcfee4f41ea3a818f (patch) | |
tree | 6fc9e5e410191fcff45d4a2fdab5941b74139f70 | |
parent | 79bec06168a561bda99292b7a6be15aeffa4a70d (diff) | |
download | busybox-w32-c528917195498e03c8b776bbcfee4f41ea3a818f.tar.gz busybox-w32-c528917195498e03c8b776bbcfee4f41ea3a818f.tar.bz2 busybox-w32-c528917195498e03c8b776bbcfee4f41ea3a818f.zip |
build system: detect missing crypt and drop it from linking
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | Makefile.flags | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Makefile.flags b/Makefile.flags index 92aae6fb5..2c826bac1 100644 --- a/Makefile.flags +++ b/Makefile.flags | |||
@@ -97,13 +97,6 @@ CFLAGS += $(strip $(subst ",,$(CONFIG_EXTRA_CFLAGS))) | |||
97 | #")) | 97 | #")) |
98 | endif | 98 | endif |
99 | 99 | ||
100 | ifneq ($(CONFIG_CROSS_COMPILER_PREFIX),"arm-linux-androideabi-") | ||
101 | LDLIBS += m crypt | ||
102 | else | ||
103 | # Android libc has no crypt. TODO: make a generic CONFIG_LINK_WITH_CRYPT option? | ||
104 | LDLIBS += m | ||
105 | endif | ||
106 | |||
107 | # Note: both "" (string consisting of two quote chars) and empty string | 100 | # Note: both "" (string consisting of two quote chars) and empty string |
108 | # are possible, and should be skipped below. | 101 | # are possible, and should be skipped below. |
109 | ifneq ($(subst "",,$(CONFIG_SYSROOT)),) | 102 | ifneq ($(subst "",,$(CONFIG_SYSROOT)),) |
@@ -111,6 +104,14 @@ CFLAGS += --sysroot=$(CONFIG_SYSROOT) | |||
111 | export SYSROOT=$(CONFIG_SYSROOT) | 104 | export SYSROOT=$(CONFIG_SYSROOT) |
112 | endif | 105 | endif |
113 | 106 | ||
107 | # Android has no separate crypt library | ||
108 | CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}' | $(CC) $(CFLAGS) $(1) -lcrypt -o /dev/null -xc - >/dev/null 2>&1 && echo "y") | ||
109 | ifeq ($(CRYPT_AVAILABLE),y) | ||
110 | LDLIBS += m crypt | ||
111 | else | ||
112 | LDLIBS += m | ||
113 | endif | ||
114 | |||
114 | ifeq ($(CONFIG_PAM),y) | 115 | ifeq ($(CONFIG_PAM),y) |
115 | # libpam uses libpthread, so for static builds busybox must be linked to | 116 | # libpam uses libpthread, so for static builds busybox must be linked to |
116 | # libpthread. On some platforms that requires an explicit -lpthread, so | 117 | # libpthread. On some platforms that requires an explicit -lpthread, so |