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>
This commit is contained in:
parent
52b28091fd
commit
3b0f173db6
2 changed files with 23 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (C) 2006-2014 OpenWrt.org
|
# Copyright (C) 2006-2015 OpenWrt.org
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=vsftpd
|
PKG_NAME:=vsftpd
|
||||||
PKG_VERSION:=3.0.2
|
PKG_VERSION:=3.0.2
|
||||||
PKG_RELEASE:=4
|
PKG_RELEASE:=5
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://security.appspot.com/downloads/
|
PKG_SOURCE_URL:=https://security.appspot.com/downloads/
|
||||||
|
@ -48,8 +48,15 @@ endef
|
||||||
|
|
||||||
Package/vsftpd-tls/conffiles=$(Package/vsftpd/conffiles)
|
Package/vsftpd-tls/conffiles=$(Package/vsftpd/conffiles)
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_USE_MUSL),)
|
||||||
|
NLSSTRING:=-lcrypt
|
||||||
|
else
|
||||||
|
NLSSTRING:=-lcrypt -lnsl
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(BUILD_VARIANT),notls)
|
ifeq ($(BUILD_VARIANT),notls)
|
||||||
define Build/Compile
|
define Build/Compile
|
||||||
|
$(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
|
||||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||||
CC="$(TARGET_CC)" \
|
CC="$(TARGET_CC)" \
|
||||||
CFLAGS="$(TARGET_CFLAGS)" \
|
CFLAGS="$(TARGET_CFLAGS)" \
|
||||||
|
@ -62,6 +69,7 @@ ifeq ($(BUILD_VARIANT),tls)
|
||||||
define Build/Compile
|
define Build/Compile
|
||||||
$(SED) 's/#undef VSF_BUILD_SSL/#define VSF_BUILD_SSL/' $(PKG_BUILD_DIR)/builddefs.h
|
$(SED) 's/#undef VSF_BUILD_SSL/#define VSF_BUILD_SSL/' $(PKG_BUILD_DIR)/builddefs.h
|
||||||
$(SED) 's/-lcrypt -lnsl/-lcrypt -lnsl -lssl -lcrypto/' $(PKG_BUILD_DIR)/Makefile
|
$(SED) 's/-lcrypt -lnsl/-lcrypt -lnsl -lssl -lcrypto/' $(PKG_BUILD_DIR)/Makefile
|
||||||
|
$(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
|
||||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||||
CC="$(TARGET_CC)" \
|
CC="$(TARGET_CC)" \
|
||||||
CFLAGS="$(TARGET_CFLAGS)" \
|
CFLAGS="$(TARGET_CFLAGS)" \
|
||||||
|
|
13
net/vsftpd/patches/006-musl-compatibility.patch
Normal file
13
net/vsftpd/patches/006-musl-compatibility.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
--- a/sysdeputil.c
|
||||||
|
+++ b/sysdeputil.c
|
||||||
|
@@ -58,7 +58,9 @@
|
||||||
|
#define VSF_SYSDEP_HAVE_SHADOW
|
||||||
|
#define VSF_SYSDEP_HAVE_USERSHELL
|
||||||
|
#define VSF_SYSDEP_HAVE_LIBCAP
|
||||||
|
-#define VSF_SYSDEP_HAVE_UTMPX
|
||||||
|
+#if defined(__GLIBC__) || defined(__UCLIBC__)
|
||||||
|
+ #define VSF_SYSDEP_HAVE_UTMPX
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#define __USE_GNU
|
||||||
|
#include <utmpx.h>
|
Loading…
Reference in a new issue