Fri May 31 08:36:12 2019 UTC ()
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.


(dholland)
diff -r1.3 -r1.4 pkgsrc/math/mpfr/builtin.mk

cvs diff -r1.3 -r1.4 pkgsrc/math/mpfr/builtin.mk (expand / switch to unified diff)

--- pkgsrc/math/mpfr/builtin.mk 2011/09/14 17:18:29 1.3
+++ pkgsrc/math/mpfr/builtin.mk 2019/05/31 08:36:12 1.4
@@ -1,17 +1,76 @@ @@ -1,17 +1,76 @@
1# $NetBSD: builtin.mk,v 1.3 2011/09/14 17:18:29 hans Exp $ 1# $NetBSD: builtin.mk,v 1.4 2019/05/31 08:36:12 dholland Exp $
2 2
3BUILTIN_PKG:= mpfr 3BUILTIN_PKG:= mpfr
4 4
5PKGCONFIG_FILE.mpfr= /usr/include/mpfr.h /usr/include/mpfr/mpfr.h 5BUILTIN_FIND_HEADERS_VAR:= H_MPFR
6PKGCONFIG_BASE.mpfr= /usr 6BUILTIN_FIND_HEADERS.H_MPFR= mpfr.h mpfr/mpfr.h
7 7
8BUILTIN_VERSION_SCRIPT.mpfr= ${AWK} \ 8BUILTIN_VERSION_SCRIPT.mpfr= ${AWK} \
9 '/\#define[ \t]*MPFR_VERSION_STRING[ \t]/ { \ 9 '/\#define[ \t]*MPFR_VERSION_STRING[ \t]/ { \
10 v = substr($$3, 2, length($$3)-2) } \ 10 v = substr($$3, 2, length($$3)-2) } \
11 END { gsub("-p",".",v); print v }' 11 END { gsub("-p",".",v); print v }'
12 12
13.include "../../mk/buildlink3/pkgconfig-builtin.mk" 13.include "../../mk/buildlink3/bsd.builtin.mk"
14 14
15.if !empty(USE_BUILTIN.mpfr:M[Yy][Ee][Ss]) 15###
16CONFIGURE_ARGS+= --with-mpfr-include=${FIND_FILES_mpfr:S/\/mpfr.h//} 16### Determine if there is a built-in implementation of the package and
 17### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
 18###
 19.if !defined(IS_BUILTIN.mpfr)
 20IS_BUILTIN.mpfr= no
 21. if empty(H_MPFR:M__nonexistent__) && empty(H_MPFR:M${LOCALBASE}/*)
 22IS_BUILTIN.mpfr= yes
 23. endif
17.endif 24.endif
 25MAKEVARS+= IS_BUILTIN.mpfr
 26
 27###
 28### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
 29### a package name to represent the built-in package.
 30###
 31.if !defined(BUILTIN_PKG.mpfr) && \
 32 !empty(IS_BUILTIN.mpfr:M[yY][eE][sS]) && \
 33 empty(H_MPFR:M__nonexistent__)
 34BUILTIN_VERSION.mpfr!= ${BUILTIN_VERSION_SCRIPT.mpfr} ${H_MPFR}
 35BUILTIN_PKG.mpfr= mpfr-${BUILTIN_VERSION.mpfr}
 36.endif
 37MAKEVARS+= BUILTIN_PKG.mpfr
 38
 39###
 40### Determine whether we should use the built-in implementation if it
 41### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
 42###
 43.if !defined(USE_BUILTIN.mpfr)
 44. if ${PREFER.mpfr} == "pkgsrc"
 45USE_BUILTIN.mpfr= no
 46. else
 47USE_BUILTIN.mpfr= ${IS_BUILTIN.mpfr}
 48. if defined(BUILTIN_PKG.mpfr) && !empty(IS_BUILTIN.mpfr:M[yY][eE][sS])
 49USE_BUILTIN.mpfr= yes
 50. for _dep_ in ${BUILDLINK_API_DEPENDS.mpfr}
 51. if !empty(USE_BUILTIN.mpfr:M[yY][eE][sS])
 52USE_BUILTIN.mpfr!= \
 53 if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.mpfr:Q}; then \
 54 ${ECHO} yes; \
 55 else \
 56 ${ECHO} no; \
 57 fi
 58. endif
 59. endfor
 60. endif
 61. endif # PREFER.mpfr
 62.endif
 63MAKEVARS+= USE_BUILTIN.mpfr
 64
 65CHECK_BUILTIN.mpfr?= no
 66.if !empty(CHECK_BUILTIN.mpfr:M[Nn][Oo])
 67. if !empty(USE_BUILTIN.mpfr:M[Yy][Ee][Ss])
 68MPFR_INCLUDE= ${H_MPFR:H}
 69CONFIGURE_ARGS+= --with-mpfr-include=${MPFR_INCLUDE}
 70BUILDLINK_INCDIRS.mpfr= ${MPFR_INCLUDE}
 71CONFIGURE_ARGS+= --with-mpfr-lib=${BUILDLINK_PREFIX.mpfr}/lib${LIBABISUFFIX}
 72BUILDLINK_LIBDIRS.mpfr= lib${LIBABISUFFIX}
 73CPPFLAGS+= -I${MPFR_INCLUDE}
 74CFLAGS+= -I${MPFR_INCLUDE}
 75. endif
 76.endif # CHECK_BUILTIN.mpfr