aboutsummaryrefslogtreecommitdiffstats
path: root/ftp
diff options
context:
space:
mode:
authormartymac <martymac@FreeBSD.org>2018-08-27 18:16:03 +0800
committermartymac <martymac@FreeBSD.org>2018-08-27 18:16:03 +0800
commitc4228281f694b5b914e08e237bc61ac90eaeb8d4 (patch)
tree6b954180cd898c5f287987a6a0867c4505a8f664 /ftp
parent4595055737bfc90a8598452b0b2efdd413e8de82 (diff)
downloadfreebsd-ports-gnome-c4228281f694b5b914e08e237bc61ac90eaeb8d4.tar.gz
freebsd-ports-gnome-c4228281f694b5b914e08e237bc61ac90eaeb8d4.tar.zst
freebsd-ports-gnome-c4228281f694b5b914e08e237bc61ac90eaeb8d4.zip
Fix build when selected SSL library is linked to libthr
When a non-default SSL library is used (GnuTLS, OpenSSL or LibreSSL from ports) and if it is linked to libthr, compilation fails with the following error : /usr/bin/ld: undefined reference to symbol `pthread_mutexattr_gettype@@FBSD_1.0' (try adding -lthr) //lib/libthr.so.3: could not read symbols: Bad value As OpenSSL-like ports (OpenSSL from base, OpenSSL and OpenSSL-devel from ports, LibreSSL and LibreSSL-devel from ports) may or may not be linked to libthr, fix build by detecting if the selected library is linked to libthr or not. PR: 230813 Submitted by: Pascal Christen <pascal.christen@hostpoint.ch>
Diffstat (limited to 'ftp')
-rw-r--r--ftp/lftp/Makefile14
1 files changed, 14 insertions, 0 deletions
diff --git a/ftp/lftp/Makefile b/ftp/lftp/Makefile
index 3e74c23abe1f..29ca40363885 100644
--- a/ftp/lftp/Makefile
+++ b/ftp/lftp/Makefile
@@ -56,6 +56,20 @@ post-install-DOCS-on:
.include <bsd.port.pre.mk>
+# Only link to libthr if necessary
+.if ${PORT_OPTIONS:MGNUTLS}
+NEED_PTHREAD= yes
+.else
+.if exists(${OPENSSLLIB}/libssl.so)
+NEED_PTHREAD!= ldd ${OPENSSLLIB}/libssl.so | ${GREP} -w 'libthr\.so' || ${ECHO_CMD}
+.else
+NEED_PTHREAD= # empty
+.endif
+.endif
+.if !empty(NEED_PTHREAD)
+LDFLAGS+= -pthread
+.endif
+
.if ${ARCH} == powerpc64
USE_GCC= yes
.endif