Received: by mail.netbsd.org (Postfix, from userid 605) id EEA7184D92; Fri, 31 May 2019 08:36:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 768B984CDF for ; Fri, 31 May 2019 08:36:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 3-jjDevT1Lhd for ; Fri, 31 May 2019 08:36:13 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 1FB4A84C81 for ; Fri, 31 May 2019 08:36:13 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 133C5FB15; Fri, 31 May 2019 08:36:13 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_155929177357510" MIME-Version: 1.0 Date: Fri, 31 May 2019 08:36:13 +0000 From: "David A. Holland" Subject: CVS commit: pkgsrc/math/mpfr To: pkgsrc-changes@NetBSD.org Reply-To: dholland@netbsd.org X-Mailer: log_accum Message-Id: <20190531083613.133C5FB15@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_155929177357510 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: dholland Date: Fri May 31 08:36:12 UTC 2019 Modified Files: pkgsrc/math/mpfr: builtin.mk Log Message: Replace mpfr's builtin.mk. The old one was abusive and wrong. Thanks to Joern Clausen for testing this one (something like a year ago...) Relevant to (at least) PR 52250 and PR 52244. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 pkgsrc/math/mpfr/builtin.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_155929177357510 Content-Disposition: inline Content-Length: 2940 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/math/mpfr/builtin.mk diff -u pkgsrc/math/mpfr/builtin.mk:1.3 pkgsrc/math/mpfr/builtin.mk:1.4 --- pkgsrc/math/mpfr/builtin.mk:1.3 Wed Sep 14 17:18:29 2011 +++ pkgsrc/math/mpfr/builtin.mk Fri May 31 08:36:12 2019 @@ -1,17 +1,76 @@ -# $NetBSD: builtin.mk,v 1.3 2011/09/14 17:18:29 hans Exp $ +# $NetBSD: builtin.mk,v 1.4 2019/05/31 08:36:12 dholland Exp $ BUILTIN_PKG:= mpfr -PKGCONFIG_FILE.mpfr= /usr/include/mpfr.h /usr/include/mpfr/mpfr.h -PKGCONFIG_BASE.mpfr= /usr +BUILTIN_FIND_HEADERS_VAR:= H_MPFR +BUILTIN_FIND_HEADERS.H_MPFR= mpfr.h mpfr/mpfr.h BUILTIN_VERSION_SCRIPT.mpfr= ${AWK} \ '/\#define[ \t]*MPFR_VERSION_STRING[ \t]/ { \ v = substr($$3, 2, length($$3)-2) } \ END { gsub("-p",".",v); print v }' -.include "../../mk/buildlink3/pkgconfig-builtin.mk" +.include "../../mk/buildlink3/bsd.builtin.mk" -.if !empty(USE_BUILTIN.mpfr:M[Yy][Ee][Ss]) -CONFIGURE_ARGS+= --with-mpfr-include=${FIND_FILES_mpfr:S/\/mpfr.h//} +### +### Determine if there is a built-in implementation of the package and +### set IS_BUILTIN. appropriately ("yes" or "no"). +### +.if !defined(IS_BUILTIN.mpfr) +IS_BUILTIN.mpfr= no +. if empty(H_MPFR:M__nonexistent__) && empty(H_MPFR:M${LOCALBASE}/*) +IS_BUILTIN.mpfr= yes +. endif .endif +MAKEVARS+= IS_BUILTIN.mpfr + +### +### If there is a built-in implementation, then set BUILTIN_PKG. to +### a package name to represent the built-in package. +### +.if !defined(BUILTIN_PKG.mpfr) && \ + !empty(IS_BUILTIN.mpfr:M[yY][eE][sS]) && \ + empty(H_MPFR:M__nonexistent__) +BUILTIN_VERSION.mpfr!= ${BUILTIN_VERSION_SCRIPT.mpfr} ${H_MPFR} +BUILTIN_PKG.mpfr= mpfr-${BUILTIN_VERSION.mpfr} +.endif +MAKEVARS+= BUILTIN_PKG.mpfr + +### +### Determine whether we should use the built-in implementation if it +### exists, and set USE_BUILTIN. appropriate ("yes" or "no"). +### +.if !defined(USE_BUILTIN.mpfr) +. if ${PREFER.mpfr} == "pkgsrc" +USE_BUILTIN.mpfr= no +. else +USE_BUILTIN.mpfr= ${IS_BUILTIN.mpfr} +. if defined(BUILTIN_PKG.mpfr) && !empty(IS_BUILTIN.mpfr:M[yY][eE][sS]) +USE_BUILTIN.mpfr= yes +. for _dep_ in ${BUILDLINK_API_DEPENDS.mpfr} +. if !empty(USE_BUILTIN.mpfr:M[yY][eE][sS]) +USE_BUILTIN.mpfr!= \ + if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.mpfr:Q}; then \ + ${ECHO} yes; \ + else \ + ${ECHO} no; \ + fi +. endif +. endfor +. endif +. endif # PREFER.mpfr +.endif +MAKEVARS+= USE_BUILTIN.mpfr + +CHECK_BUILTIN.mpfr?= no +.if !empty(CHECK_BUILTIN.mpfr:M[Nn][Oo]) +. if !empty(USE_BUILTIN.mpfr:M[Yy][Ee][Ss]) +MPFR_INCLUDE= ${H_MPFR:H} +CONFIGURE_ARGS+= --with-mpfr-include=${MPFR_INCLUDE} +BUILDLINK_INCDIRS.mpfr= ${MPFR_INCLUDE} +CONFIGURE_ARGS+= --with-mpfr-lib=${BUILDLINK_PREFIX.mpfr}/lib${LIBABISUFFIX} +BUILDLINK_LIBDIRS.mpfr= lib${LIBABISUFFIX} +CPPFLAGS+= -I${MPFR_INCLUDE} +CFLAGS+= -I${MPFR_INCLUDE} +. endif +.endif # CHECK_BUILTIN.mpfr --_----------=_155929177357510--