From owner-freebsd-ports@freebsd.org Sat Jul 2 17:41:17 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 DD7FDB8FEC9 for ; Sat, 2 Jul 2016 17:41:17 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BEB872E53 for ; Sat, 2 Jul 2016 17:41:17 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u62Hf9xk096553; Sat, 2 Jul 2016 10:41:14 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201607021741.u62Hf9xk096553@gw.catspoiler.org> Date: Sat, 2 Jul 2016 10:41:09 -0700 (PDT) From: Don Lewis Subject: Re: what to do when base openssl isn't suitable To: FreeBSD@ShaneWare.Biz cc: freebsd-ports@FreeBSD.org In-Reply-To: <5777A241.4040108@ShaneWare.Biz> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii 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: Sat, 02 Jul 2016 17:41:18 -0000 On 2 Jul, Shane Ambler wrote: > On 02/07/2016 04:29, Don Lewis wrote: >> I've got a port that does not work with base openssl because it looks >> for libssl.pc. Other than that, I don't think it is picky about what >> flavor of ports ssl is installed. > > If it is looking for libssl.pc then it is using pkg-config to get the > CFLAGS/CXXFLAGS/LDFLAGS to use for openssl. > > Search the Makefiles for pkg-config openssl --cflags --libs or the > variable substituted equivalent, then patch it to suit. If you want to > use the system openssl then manually adding -lssl -lcrypto where it adds > the result from pkg-config should work. In this case, the configure script skips the call to pkg-config if $libssl_CFLAGS is set. I was able to get a successful build by passing the proper environment variables to configure without the need for patching it. This is what I added to the ports Makefile: .if ${SSL_DEFAULT} == base . if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000000 IGNORE= base OpenSSL in FreeBSD 9 is too old, specify a ports version of SSL by adding DEFAULT_VERSIONS+=ssl=... to /etc/make.conf and rebuild everything that needs SSL . else CONFIGURE_ENV+= libcrypto_CFLAGS="-I${OPENSSLINC}" \ libcrypto_LIBS="-L${OPENSSLLIB} -lcrypto" \ libssl_CFLAGS="-I${OPENSSLINC}" \ libssl_LIBS="-L${OPENSSLLIB} -lssl" . endif .endif