| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: builtin.mk,v 1.7 2020/09/03 08:58:42 prlw1 Exp $ | | 1 | # $NetBSD: builtin.mk,v 1.8 2023/01/09 13:25:11 wiz Exp $ |
2 | | | 2 | |
3 | BUILTIN_PKG:= mpfr | | 3 | BUILTIN_PKG:= mpfr |
4 | | | 4 | |
5 | BUILTIN_FIND_HEADERS_VAR:= H_MPFR | | 5 | BUILTIN_FIND_HEADERS_VAR:= H_MPFR |
6 | BUILTIN_FIND_HEADERS.H_MPFR= mpfr.h mpfr/mpfr.h | | 6 | BUILTIN_FIND_HEADERS.H_MPFR= mpfr.h mpfr/mpfr.h |
7 | | | 7 | |
8 | BUILTIN_VERSION_SCRIPT.mpfr= ${AWK} \ | | 8 | BUILTIN_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/bsd.builtin.mk" | | 13 | .include "../../mk/buildlink3/bsd.builtin.mk" |
14 | | | 14 | |
| @@ -19,56 +19,56 @@ BUILTIN_VERSION_SCRIPT.mpfr= ${AWK} \ | | | @@ -19,56 +19,56 @@ BUILTIN_VERSION_SCRIPT.mpfr= ${AWK} \ |
19 | .if !defined(IS_BUILTIN.mpfr) | | 19 | .if !defined(IS_BUILTIN.mpfr) |
20 | IS_BUILTIN.mpfr= no | | 20 | IS_BUILTIN.mpfr= no |
21 | . if empty(H_MPFR:M__nonexistent__) && empty(H_MPFR:M${LOCALBASE}/*) | | 21 | . if empty(H_MPFR:M__nonexistent__) && empty(H_MPFR:M${LOCALBASE}/*) |
22 | IS_BUILTIN.mpfr= yes | | 22 | IS_BUILTIN.mpfr= yes |
23 | . endif | | 23 | . endif |
24 | .endif | | 24 | .endif |
25 | MAKEVARS+= IS_BUILTIN.mpfr | | 25 | MAKEVARS+= IS_BUILTIN.mpfr |
26 | | | 26 | |
27 | ### | | 27 | ### |
28 | ### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to | | 28 | ### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to |
29 | ### a package name to represent the built-in package. | | 29 | ### a package name to represent the built-in package. |
30 | ### | | 30 | ### |
31 | .if !defined(BUILTIN_PKG.mpfr) && \ | | 31 | .if !defined(BUILTIN_PKG.mpfr) && \ |
32 | !empty(IS_BUILTIN.mpfr:M[yY][eE][sS]) && \ | | 32 | ${IS_BUILTIN.mpfr:tl} == yes && \ |
33 | empty(H_MPFR:M__nonexistent__) | | 33 | empty(H_MPFR:M__nonexistent__) |
34 | BUILTIN_VERSION.mpfr!= ${BUILTIN_VERSION_SCRIPT.mpfr} ${H_MPFR} | | 34 | BUILTIN_VERSION.mpfr!= ${BUILTIN_VERSION_SCRIPT.mpfr} ${H_MPFR} |
35 | BUILTIN_PKG.mpfr= mpfr-${BUILTIN_VERSION.mpfr} | | 35 | BUILTIN_PKG.mpfr= mpfr-${BUILTIN_VERSION.mpfr} |
36 | .endif | | 36 | .endif |
37 | MAKEVARS+= BUILTIN_PKG.mpfr | | 37 | MAKEVARS+= BUILTIN_PKG.mpfr |
38 | | | 38 | |
39 | ### | | 39 | ### |
40 | ### Determine whether we should use the built-in implementation if it | | 40 | ### Determine whether we should use the built-in implementation if it |
41 | ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no"). | | 41 | ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no"). |
42 | ### | | 42 | ### |
43 | .if !defined(USE_BUILTIN.mpfr) | | 43 | .if !defined(USE_BUILTIN.mpfr) |
44 | . if ${PREFER.mpfr} == "pkgsrc" | | 44 | . if ${PREFER.mpfr} == "pkgsrc" |
45 | USE_BUILTIN.mpfr= no | | 45 | USE_BUILTIN.mpfr= no |
46 | . else | | 46 | . else |
47 | USE_BUILTIN.mpfr= ${IS_BUILTIN.mpfr} | | 47 | USE_BUILTIN.mpfr= ${IS_BUILTIN.mpfr} |
48 | . if defined(BUILTIN_PKG.mpfr) && !empty(IS_BUILTIN.mpfr:M[yY][eE][sS]) | | 48 | . if defined(BUILTIN_PKG.mpfr) && ${IS_BUILTIN.mpfr:tl} == yes |
49 | USE_BUILTIN.mpfr= yes | | 49 | USE_BUILTIN.mpfr= yes |
50 | . for _dep_ in ${BUILDLINK_API_DEPENDS.mpfr} | | 50 | . for _dep_ in ${BUILDLINK_API_DEPENDS.mpfr} |
51 | . if !empty(USE_BUILTIN.mpfr:M[yY][eE][sS]) | | 51 | . if ${USE_BUILTIN.mpfr:tl} == yes |
52 | USE_BUILTIN.mpfr!= \ | | 52 | USE_BUILTIN.mpfr!= \ |
53 | if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.mpfr:Q}; then \ | | 53 | if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.mpfr:Q}; then \ |
54 | ${ECHO} yes; \ | | 54 | ${ECHO} yes; \ |
55 | else \ | | 55 | else \ |
56 | ${ECHO} no; \ | | 56 | ${ECHO} no; \ |
57 | fi | | 57 | fi |
58 | . endif | | 58 | . endif |
59 | . endfor | | 59 | . endfor |
60 | . endif | | 60 | . endif |
61 | . endif # PREFER.mpfr | | 61 | . endif # PREFER.mpfr |
62 | .endif | | 62 | .endif |
63 | MAKEVARS+= USE_BUILTIN.mpfr | | 63 | MAKEVARS+= USE_BUILTIN.mpfr |
64 | | | 64 | |
65 | CHECK_BUILTIN.mpfr?= no | | 65 | CHECK_BUILTIN.mpfr?= no |
66 | .if !empty(CHECK_BUILTIN.mpfr:M[Nn][Oo]) | | 66 | .if ${CHECK_BUILTIN.mpfr:tl} == no |
67 | . if !empty(USE_BUILTIN.mpfr:M[Yy][Ee][Ss]) | | 67 | . if ${USE_BUILTIN.mpfr:tl} == yes |
68 | MPFR_INCLUDE= ${H_MPFR:H} | | 68 | MPFR_INCLUDE= ${H_MPFR:H} |
69 | BUILDLINK_INCDIRS.mpfr= ${MPFR_INCLUDE} | | 69 | BUILDLINK_INCDIRS.mpfr= ${MPFR_INCLUDE} |
70 | BUILDLINK_LIBDIRS.mpfr= lib${LIBABISUFFIX} | | 70 | BUILDLINK_LIBDIRS.mpfr= lib${LIBABISUFFIX} |
71 | CPPFLAGS+= -I${MPFR_INCLUDE} | | 71 | CPPFLAGS+= -I${MPFR_INCLUDE} |
72 | CFLAGS+= -I${MPFR_INCLUDE} | | 72 | CFLAGS+= -I${MPFR_INCLUDE} |
73 | . endif | | 73 | . endif |
74 | .endif # CHECK_BUILTIN.mpfr | | 74 | .endif # CHECK_BUILTIN.mpfr |