summaryrefslogtreecommitdiff
path: root/package/sysvinit/0001-fix-libcrypt-test.patch
blob: 6c22436d74a53408260c9db8b5332a05df9a62b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Make the libcrypt test somewhat cross-compilation compliant

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Index: b/src/Makefile
===================================================================
--- a/src/Makefile
+++ b/src/Makefile
@@ -78,8 +78,9 @@ else
 endif
 
 # Additional libs for GNU libc.
-ifneq ($(wildcard /usr/lib*/libcrypt.a),)
-  SULOGINLIBS	+= -lcrypt
+HAS_LIBCRYPT=$(shell f=`mktemp` && echo 'int main(void) {}' | $(CC) -o $$f -xc - -lcrypt >/dev/null 2>&1 && echo yes; rm -f $$f)
+ifeq ($(HAS_LIBCRYPT),yes)
+  SULOGINLIBS += -lcrypt
 endif
 
 all:		$(BIN) $(SBIN) $(USRBIN)