Files
buildroot/package/proftpd/proftpd.mk
Matt Weber fdea09b831 package/proftpd: prevent openssl pthread detection
The proftpd configure script doesn't use pkg-config to detect openssl
libraries. Instead, it just adds -lcrypto. Since openssl may be linked
with pthread, it tries to detect that by calling 'openssl version -f',
which gives the arguments with which openssl was compiled.

Since the openssl executable used is either host-openssl or the system
installed openssl, the output of 'openssl version -f' is useless in
Buildroot context. If the target toolchain doesn't have threads support,
it will wrongly pick up -pthread from host-openssl.

Fortunately there is a simple workaround: --without-openssl-cmdline says
that there is no openssl executable and skips the test, so -pthread is
not added. It turns out -pthread is never needed, even in static linking
cases, because openssl/libressl puts the thread support in a separate
object file that only gets linked in if the program actually uses
threads (which proftpd doesn't).

Fixes:
http://autobuild.buildroot.net/results/9c25c3cb3cf93b76c0538c5376a803641bf6575b

Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
[Rewrite commit log, after additional analysis and testing]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

(cherry picked from commit 51bb23652f)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2019-02-22 13:33:43 +01:00

78 lines
2.2 KiB
Makefile

################################################################################
#
# proftpd
#
################################################################################
PROFTPD_VERSION = 1.3.6
PROFTPD_SITE = ftp://ftp.proftpd.org/distrib/source
PROFTPD_LICENSE = GPL-2.0+
PROFTPD_LICENSE_FILES = COPYING
PROFTPD_CONF_ENV = \
ac_cv_func_setpgrp_void=yes \
ac_cv_func_setgrent_void=yes
PROFTPD_CONF_OPTS = \
--localstatedir=/var/run \
--disable-static \
--disable-curses \
--disable-ncurses \
--disable-facl \
--disable-dso \
--enable-shadow \
--with-gnu-ld \
--without-openssl-cmdline
ifeq ($(BR2_PACKAGE_PROFTPD_MOD_REWRITE),y)
PROFTPD_CONF_OPTS += --with-modules=mod_rewrite
endif
ifeq ($(BR2_PACKAGE_PROFTPD_MOD_REDIS),y)
PROFTPD_CONF_OPTS += --enable-redis
PROFTPD_DEPENDENCIES += hiredis
else
PROFTPD_CONF_OPTS += --disable-redis
endif
# configure script doesn't handle detection of %llu format string
# support for printing the file size when cross compiling, breaking
# access for large files.
# We unfortunately cannot AUTORECONF the package, so instead force it
# on if we know we support it
define PROFTPD_USE_LLU
$(SED) 's/HAVE_LU/HAVE_LLU/' $(@D)/configure
endef
PROFTPD_PRE_CONFIGURE_HOOKS += PROFTPD_USE_LLU
define PROFTPD_MAKENAMES
$(MAKE1) CC="$(HOSTCC)" CFLAGS="" LDFLAGS="" -C $(@D)/lib/libcap _makenames
endef
PROFTPD_POST_CONFIGURE_HOOKS = PROFTPD_MAKENAMES
PROFTPD_MAKE = $(MAKE1)
define PROFTPD_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/proftpd $(TARGET_DIR)/usr/sbin/proftpd
$(INSTALL) -m 0644 -D $(@D)/sample-configurations/basic.conf $(TARGET_DIR)/etc/proftpd.conf
endef
define PROFTPD_USERS
ftp -1 ftp -1 * /home/ftp - - Anonymous FTP User
endef
define PROFTPD_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/proftpd/S50proftpd $(TARGET_DIR)/etc/init.d/S50proftpd
endef
define PROFTPD_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/proftpd/proftpd.service \
$(TARGET_DIR)/usr/lib/systemd/system/proftpd.service
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
ln -sf ../../../../usr/lib/systemd/system/proftpd.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/proftpd.service
endef
$(eval $(autotools-package))