Browse Source

vsftpd: fix musl compatibility

Make vsftpd to compile with musl, while preserving uclibc compatibility.

When using musl:
* disable UTMPX functionality
* disable -lnsl option in upstream Makefile

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Hannu Nyman 9 years ago
parent
commit
bc7c3799d4
2 changed files with 23 additions and 2 deletions
  1. 10
    2
      net/vsftpd/Makefile
  2. 13
    0
      net/vsftpd/patches/006-musl-compatibility.patch

+ 10
- 2
net/vsftpd/Makefile View File

@@ -1,5 +1,5 @@
1 1
 #
2
-# Copyright (C) 2006-2014 OpenWrt.org
2
+# Copyright (C) 2006-2015 OpenWrt.org
3 3
 #
4 4
 # This is free software, licensed under the GNU General Public License v2.
5 5
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=vsftpd
11 11
 PKG_VERSION:=3.0.2
12
-PKG_RELEASE:=4
12
+PKG_RELEASE:=5
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=https://security.appspot.com/downloads/
@@ -49,8 +49,15 @@ endef
49 49
 
50 50
 Package/vsftpd-tls/conffiles=$(Package/vsftpd/conffiles)
51 51
 
52
+ifneq ($(CONFIG_USE_MUSL),)
53
+  NLSSTRING:=-lcrypt
54
+else
55
+  NLSSTRING:=-lcrypt -lnsl
56
+endif
57
+
52 58
 ifeq ($(BUILD_VARIANT),notls)
53 59
  define Build/Compile
60
+	$(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
54 61
 	$(MAKE) -C $(PKG_BUILD_DIR) \
55 62
 		CC="$(TARGET_CC)" \
56 63
 		CFLAGS="$(TARGET_CFLAGS)" \
@@ -63,6 +70,7 @@ ifeq ($(BUILD_VARIANT),tls)
63 70
  define Build/Compile
64 71
 	$(SED) 's/#undef VSF_BUILD_SSL/#define VSF_BUILD_SSL/' $(PKG_BUILD_DIR)/builddefs.h
65 72
 	$(SED) 's/-lcrypt -lnsl/-lcrypt -lnsl -lssl -lcrypto/' $(PKG_BUILD_DIR)/Makefile
73
+	$(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
66 74
 	$(MAKE) -C $(PKG_BUILD_DIR) \
67 75
 		CC="$(TARGET_CC)" \
68 76
 		CFLAGS="$(TARGET_CFLAGS)" \

+ 13
- 0
net/vsftpd/patches/006-musl-compatibility.patch View File

@@ -0,0 +1,13 @@
1
+--- a/sysdeputil.c
2
++++ b/sysdeputil.c
3
+@@ -58,7 +58,9 @@
4
+ #define VSF_SYSDEP_HAVE_SHADOW
5
+ #define VSF_SYSDEP_HAVE_USERSHELL
6
+ #define VSF_SYSDEP_HAVE_LIBCAP
7
+-#define VSF_SYSDEP_HAVE_UTMPX
8
++#if defined(__GLIBC__) || defined(__UCLIBC__)
9
++  #define VSF_SYSDEP_HAVE_UTMPX
10
++#endif
11
+ 
12
+ #define __USE_GNU
13
+ #include <utmpx.h>