diff options
author | Martin Kaiser <martin@kaiser.cx> | 2021-11-08 17:36:43 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-12-12 13:16:40 +0100 |
commit | 9b678807198611308cfd8b10427f9e08c62f7bec (patch) | |
tree | d28bc6fe36d23a551c8e6a79ade162c67defc495 /Makefile.flags | |
parent | b9fba185c570b52fccffa2b9ae39ba32a0860daf (diff) | |
download | busybox-w32-9b678807198611308cfd8b10427f9e08c62f7bec.tar.gz busybox-w32-9b678807198611308cfd8b10427f9e08c62f7bec.tar.bz2 busybox-w32-9b678807198611308cfd8b10427f9e08c62f7bec.zip |
Makefile.flags: use all cflags for crypt and rt checks
To check if libcrypt and librt are available, we check if we can
compile and link a simple test program.
These checks do not match the actual linking if CONFIG_STATIC is enabled.
For CONFIG_STATIC, CFLAGS_busybox is set to -static. The checks don't use
CFLAGS_busybox and detect a shared libcrypt or librt. If we link busybox
later and we have no static libcrypt or librt, linking will fail.
Update the libcrypt and librt checks to use CFLAGS_busybox.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'Makefile.flags')
-rw-r--r-- | Makefile.flags | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile.flags b/Makefile.flags index 667481983..c34356230 100644 --- a/Makefile.flags +++ b/Makefile.flags | |||
@@ -151,8 +151,8 @@ LDLIBS += m | |||
151 | # 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: |
152 | # 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 - |
153 | # fall back to using a temp file: | 153 | # fall back to using a temp file: |
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) | 154 | CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}' >bb_libtest.c; $(CC) $(CFLAGS) $(CFLAGS_busybox) -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) | 155 | RT_AVAILABLE := $(shell echo 'int main(void){return 0;}' >bb_libtest.c; $(CC) $(CFLAGS) $(CFLAGS_busybox) -lrt -o /dev/null bb_libtest.c >/dev/null 2>&1 && echo "y"; rm bb_libtest.c) |
156 | ifeq ($(CRYPT_AVAILABLE),y) | 156 | ifeq ($(CRYPT_AVAILABLE),y) |
157 | LDLIBS += crypt | 157 | LDLIBS += crypt |
158 | endif | 158 | endif |