| @@ -1,43 +1,61 @@ | | | @@ -1,43 +1,61 @@ |
1 | # $NetBSD: builtin.mk,v 1.8 2014/03/10 11:56:02 jperkin Exp $ | | 1 | # $NetBSD: builtin.mk,v 1.9 2014/04/22 12:21:15 obache Exp $ |
2 | | | 2 | |
3 | BUILTIN_PKG:= xextproto | | 3 | BUILTIN_PKG:= xextproto |
4 | | | 4 | |
5 | BUILTIN_FIND_FILES_VAR:= H_XEXTPROTO | | 5 | BUILTIN_FIND_FILES_VAR:= H_XEXTPROTO PC_XEXTPROTO |
6 | BUILTIN_FIND_FILES.H_XEXTPROTO= \ | | 6 | BUILTIN_FIND_FILES.H_XEXTPROTO= \ |
7 | ${X11BASE}/include/X11/extensions/extutil.h | | 7 | ${X11BASE}/include/X11/extensions/extutil.h |
| | | 8 | BUILTIN_FIND_FILES.PC_XEXTPROTO= ${X11BASE}/lib/pkgconfig/xextproto.pc |
| | | 9 | BUILTIN_FIND_FILES.PC_XEXTPROTO+= ${X11BASE}/lib${LIBABISUFFIX}/pkgconfig/xextproto.pc |
| | | 10 | BUILTIN_FIND_FILES.PC_XEXTPROTO+= ${X11BASE}/share/pkgconfig/xextproto.pc |
8 | | | 11 | |
9 | .include "../../mk/buildlink3/bsd.builtin.mk" | | 12 | .include "../../mk/buildlink3/bsd.builtin.mk" |
10 | | | 13 | |
11 | ### | | 14 | ### |
12 | ### Determine if there is a built-in implementation of the package and | | 15 | ### Determine if there is a built-in implementation of the package and |
13 | ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). | | 16 | ### set IS_BUILTIN.<pkg> appropriately ("yes" or "no"). |
14 | ### | | 17 | ### |
15 | .if ${X11BASE} == ${LOCALBASE} | | 18 | .if ${X11BASE} == ${LOCALBASE} |
16 | IS_BUILTIN.xextproto= no | | 19 | IS_BUILTIN.xextproto= no |
17 | .elif !defined(IS_BUILTIN.xextproto) | | 20 | .elif !defined(IS_BUILTIN.xextproto) |
18 | IS_BUILTIN.xextproto= no | | 21 | IS_BUILTIN.xextproto= no |
19 | # | | 22 | # |
20 | # Here, we skip checking whether the files are under ${LOCALBASE} since | | 23 | # Here, we skip checking whether the files are under ${LOCALBASE} since |
21 | # we'll consider this X11 package to be built-in even if it's a part | | 24 | # we'll consider this X11 package to be built-in even if it's a part |
22 | # of one of the pkgsrc-installed X11 distributions. | | 25 | # of one of the pkgsrc-installed X11 distributions. |
23 | # | | 26 | # |
24 | . if empty(H_XEXTPROTO:M__nonexistent__) | | 27 | . if empty(H_XEXTPROTO:M__nonexistent__) |
25 | IS_BUILTIN.xextproto= yes | | 28 | IS_BUILTIN.xextproto= yes |
26 | . endif | | 29 | . endif |
27 | .endif | | 30 | .endif |
28 | MAKEVARS+= IS_BUILTIN.xextproto | | 31 | MAKEVARS+= IS_BUILTIN.xextproto |
29 | | | 32 | |
30 | ### | | 33 | ### |
| | | 34 | ### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to |
| | | 35 | ### a package name to represent the built-in package. |
| | | 36 | ### |
| | | 37 | .if !defined(BUILTIN_PKG.xextproto) && \ |
| | | 38 | !empty(IS_BUILTIN.xextproto:M[yY][eE][sS]) |
| | | 39 | . if empty(PC_XEXTPROTO:M__nonexistent__) |
| | | 40 | BUILTIN_VERSION.xextproto!= ${SED} -n -e 's/Version: //p' ${PC_XEXTPROTO} |
| | | 41 | . else |
| | | 42 | BUILTIN_VERSION.xextproto!= 1.0.1 |
| | | 43 | . endif |
| | | 44 | BUILTIN_PKG.xextproto= xextproto-${BUILTIN_VERSION.xextproto} |
| | | 45 | .endif |
| | | 46 | MAKEVARS+= BUILTIN_PKG.xextproto |
| | | 47 | |
| | | 48 | ### |
31 | ### Determine whether we should use the built-in implementation if it | | 49 | ### Determine whether we should use the built-in implementation if it |
32 | ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no"). | | 50 | ### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no"). |
33 | ### | | 51 | ### |
34 | .if !defined(USE_BUILTIN.xextproto) | | 52 | .if !defined(USE_BUILTIN.xextproto) |
35 | . if ${PREFER.xextproto} == "pkgsrc" | | 53 | . if ${PREFER.xextproto} == "pkgsrc" |
36 | USE_BUILTIN.xextproto= no | | 54 | USE_BUILTIN.xextproto= no |
37 | . else | | 55 | . else |
38 | USE_BUILTIN.xextproto= ${IS_BUILTIN.xextproto} | | 56 | USE_BUILTIN.xextproto= ${IS_BUILTIN.xextproto} |
39 | . if defined(BUILTIN_PKG.xextproto) && \ | | 57 | . if defined(BUILTIN_PKG.xextproto) && \ |
40 | !empty(IS_BUILTIN.xextproto:M[yY][eE][sS]) | | 58 | !empty(IS_BUILTIN.xextproto:M[yY][eE][sS]) |
41 | USE_BUILTIN.xextproto= yes | | 59 | USE_BUILTIN.xextproto= yes |
42 | . for _dep_ in ${BUILDLINK_API_DEPENDS.xextproto} | | 60 | . for _dep_ in ${BUILDLINK_API_DEPENDS.xextproto} |
43 | . if !empty(USE_BUILTIN.xextproto:M[yY][eE][sS]) | | 61 | . if !empty(USE_BUILTIN.xextproto:M[yY][eE][sS]) |
| @@ -56,36 +74,37 @@ MAKEVARS+= USE_BUILTIN.xextproto | | | @@ -56,36 +74,37 @@ MAKEVARS+= USE_BUILTIN.xextproto |
56 | | | 74 | |
57 | ### | | 75 | ### |
58 | ### The section below only applies if we are not including this file | | 76 | ### The section below only applies if we are not including this file |
59 | ### solely to determine whether a built-in implementation exists. | | 77 | ### solely to determine whether a built-in implementation exists. |
60 | ### | | 78 | ### |
61 | | | 79 | |
62 | .include "../../mk/x11.builtin.mk" | | 80 | .include "../../mk/x11.builtin.mk" |
63 | | | 81 | |
64 | CHECK_BUILTIN.xextproto?= no | | 82 | CHECK_BUILTIN.xextproto?= no |
65 | .if !empty(CHECK_BUILTIN.xextproto:M[nN][oO]) | | 83 | .if !empty(CHECK_BUILTIN.xextproto:M[nN][oO]) |
66 | | | 84 | |
67 | # If we are using the builtin version, check whether it has a xextproto.pc | | 85 | # If we are using the builtin version, check whether it has a xextproto.pc |
68 | # file or not. If the latter, generate a fake one. | | 86 | # file or not. If the latter, generate a fake one. |
69 | . if !empty(USE_BUILTIN.xextproto:M[Yy][Ee][Ss]) | | 87 | . if !empty(USE_BUILTIN.xextproto:M[Yy][Ee][Ss]) && \ |
| | | 88 | !empty(PC_XEXTPROTO:M__nonexistent__) |
70 | BUILDLINK_TARGETS+= xextproto-fake-pc | | 89 | BUILDLINK_TARGETS+= xextproto-fake-pc |
71 | | | 90 | |
72 | xextproto-fake-pc: | | 91 | xextproto-fake-pc: |
73 | ${RUN} \ | | 92 | ${RUN} \ |
74 | for dir in lib lib${LIBABISUFFIX} share; do \ | | 93 | for dir in lib lib${LIBABISUFFIX} share; do \ |
75 | ${TEST} -f ${BUILDLINK_PREFIX.xextproto}/$${dir}/pkgconfig/xextproto.pc && exit; \ | | 94 | ${TEST} -f ${BUILDLINK_PREFIX.xextproto}/$${dir}/pkgconfig/xextproto.pc && exit; \ |
76 | done; \ | | 95 | done; \ |
77 | src=${BUILDLINK_PREFIX.xextproto}/lib/pkgconfig/xextproto.pc; \ | | 96 | src=${BUILDLINK_PREFIX.xextproto}/lib/pkgconfig/xextproto.pc; \ |
78 | dst=${BUILDLINK_DIR}/lib/pkgconfig/xextproto.pc; \ | | 97 | dst=${BUILDLINK_DIR}/lib/pkgconfig/xextproto.pc; \ |
79 | ${MKDIR} ${BUILDLINK_DIR}/lib/pkgconfig; \ | | 98 | ${MKDIR} ${BUILDLINK_DIR}/lib/pkgconfig; \ |
80 | if ${TEST} -f $${src}; then \ | | 99 | if ${TEST} -f $${src}; then \ |
81 | ${LN} -sf $${src} $${dst}; \ | | 100 | ${LN} -sf $${src} $${dst}; \ |
82 | else \ | | 101 | else \ |
83 | { ${ECHO} "Name: XExtensions"; \ | | 102 | { ${ECHO} "Name: XExtensions"; \ |
84 | ${ECHO} "Description: Sundry X extension headers"; \ | | 103 | ${ECHO} "Description: Sundry X extension headers"; \ |
85 | ${ECHO} "Version: 1.0.1"; \ | | 104 | ${ECHO} "Version: ${BUILTIN_VERSION.xextproto}"; \ |
86 | ${ECHO} "Cflags: -I${BUILDLINK_PREFIX.xextproto}/include"; \ | | 105 | ${ECHO} "Cflags: -I${BUILDLINK_PREFIX.xextproto}/include"; \ |
87 | } >$${dst}; \ | | 106 | } >$${dst}; \ |
88 | fi | | 107 | fi |
89 | . endif | | 108 | . endif |
90 | | | 109 | |
91 | .endif # CHECK_BUILTIN.xextproto | | 110 | .endif # CHECK_BUILTIN.xextproto |