From owner-freebsd-ports@freebsd.org Sun May 22 19:03:21 2016 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A37AB45BD6 for ; Sun, 22 May 2016 19:03:21 +0000 (UTC) (envelope-from db@db.net) Received: from diana.db.net (unknown [IPv6:2620:64:0:1:223:7dff:fea2:c8f2]) by mx1.freebsd.org (Postfix) with ESMTP id 7CDEA1F1E for ; Sun, 22 May 2016 19:03:21 +0000 (UTC) (envelope-from db@db.net) Received: from night.db.net (localhost [127.0.0.1]) by diana.db.net (Postfix) with ESMTP id CB50A2AA45F for ; Sun, 22 May 2016 13:02:38 -0600 (MDT) Received: by night.db.net (Postfix, from userid 1000) id 3414C1CDE4; Sun, 22 May 2016 15:03:12 -0400 (EDT) Date: Sun, 22 May 2016 15:03:12 -0400 From: Diane Bruce To: freebsd-ports@FreeBSD.org Subject: cmake and rpath problems Message-ID: <20160522190312.GA99013@night.db.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 19:03:21 -0000 This is a heads up about a bug some of you have run into and I've reported here. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208120 To summarize: any binary or .so object linked using cmake will indeed have a DT_RPATH entry, but it gets stripped out on install. I worked around this with comms/sdr-wspr by stripping the Fortran Flags to determine the RPATH and setting it manually in CMakeLists.txt +# temporary ugly hack +string(REGEX MATCH "-rpath=.*" CMAKE_RPATH_ARG ${CMAKE_Fortran_FLAGS} ) +string(SUBSTRING ${CMAKE_RPATH_ARG} 7 -1 CMAKE_RPATH) +set(CMAKE_INSTALL_RPATH ${CMAKE_RPATH} ) I know other ports have run into this. Diane -- - db@FreeBSD.org db@db.net http://www.db.net/~db