From owner-svn-ports-all@freebsd.org Mon Aug 27 10:16:04 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8294610836B4; Mon, 27 Aug 2018 10:16:04 +0000 (UTC) (envelope-from martymac@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C6B4887EC; Mon, 27 Aug 2018 10:16:04 +0000 (UTC) (envelope-from martymac@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06E0D1C40A; Mon, 27 Aug 2018 10:16:04 +0000 (UTC) (envelope-from martymac@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7RAG3x1094079; Mon, 27 Aug 2018 10:16:03 GMT (envelope-from martymac@FreeBSD.org) Received: (from martymac@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7RAG3Vi094078; Mon, 27 Aug 2018 10:16:03 GMT (envelope-from martymac@FreeBSD.org) Message-Id: <201808271016.w7RAG3Vi094078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: martymac set sender to martymac@FreeBSD.org using -f From: Ganael LAPLANCHE Date: Mon, 27 Aug 2018 10:16:03 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r478188 - head/ftp/lftp X-SVN-Group: ports-head X-SVN-Commit-Author: martymac X-SVN-Commit-Paths: head/ftp/lftp X-SVN-Commit-Revision: 478188 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2018 10:16:04 -0000 Author: martymac Date: Mon Aug 27 10:16:03 2018 New Revision: 478188 URL: https://svnweb.freebsd.org/changeset/ports/478188 Log: 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 Modified: head/ftp/lftp/Makefile Modified: head/ftp/lftp/Makefile ============================================================================== --- head/ftp/lftp/Makefile Mon Aug 27 10:05:44 2018 (r478187) +++ head/ftp/lftp/Makefile Mon Aug 27 10:16:03 2018 (r478188) @@ -56,6 +56,20 @@ post-install-DOCS-on: .include +# 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