| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: cwrappers.mk,v 1.23 2015/04/27 19:59:07 jperkin Exp $ | | 1 | # $NetBSD: cwrappers.mk,v 1.24 2015/04/28 21:08:34 jperkin Exp $ |
2 | # | | 2 | # |
3 | # This Makefile fragment implements integration of pkgtools/cwrappers. | | 3 | # This Makefile fragment implements integration of pkgtools/cwrappers. |
4 | | | 4 | |
5 | .include "../../mk/buildlink3/bsd.buildlink3.mk" | | 5 | .include "../../mk/buildlink3/bsd.buildlink3.mk" |
6 | | | 6 | |
7 | BUILD_DEPENDS+= cwrappers>=20150314:../../pkgtools/cwrappers | | 7 | BUILD_DEPENDS+= cwrappers>=20150314:../../pkgtools/cwrappers |
8 | | | 8 | |
9 | # Public variables used by pkgsrc infrastructure and packages. | | 9 | # Public variables used by pkgsrc infrastructure and packages. |
10 | WRAPPER_DIR= ${WRKDIR}/.cwrapper | | 10 | WRAPPER_DIR= ${WRKDIR}/.cwrapper |
11 | WRAPPER_BINDIR= ${WRAPPER_DIR}/bin | | 11 | WRAPPER_BINDIR= ${WRAPPER_DIR}/bin |
12 | | | 12 | |
13 | # XXX This should be PREFIX, but USE_CROSSBASE overrides it. | | 13 | # XXX This should be PREFIX, but USE_CROSSBASE overrides it. |
14 | CWRAPPERS_SRC_DIR= ${LOCALBASE}/libexec/cwrappers | | 14 | CWRAPPERS_SRC_DIR= ${LOCALBASE}/libexec/cwrappers |
| @@ -57,27 +57,26 @@ CWRAPPERS_APPEND.cpp+= -I${PREFIX}/incl | | | @@ -57,27 +57,26 @@ CWRAPPERS_APPEND.cpp+= -I${PREFIX}/incl |
57 | | | 57 | |
58 | .if defined(USE_IMAKE) || !empty(USE_TOOLS:Mimake) | | 58 | .if defined(USE_IMAKE) || !empty(USE_TOOLS:Mimake) |
59 | CWRAPPERS_TRANSFORM.imake+= I:${PREFIX}/lib/X11/config:${PREFIX}/lib/X11/config | | 59 | CWRAPPERS_TRANSFORM.imake+= I:${PREFIX}/lib/X11/config:${PREFIX}/lib/X11/config |
60 | CWRAPPERS_APPEND.imake+= ${IMAKEOPTS} | | 60 | CWRAPPERS_APPEND.imake+= ${IMAKEOPTS} |
61 | .endif | | 61 | .endif |
62 | | | 62 | |
63 | .PHONY: generate-cwrappers | | 63 | .PHONY: generate-cwrappers |
64 | | | 64 | |
65 | .for _target_ in ${WRAPPER_TARGETS} | | 65 | .for _target_ in ${WRAPPER_TARGETS} |
66 | generate-cwrappers: ${_target_} | | 66 | generate-cwrappers: ${_target_} |
67 | .endfor | | 67 | .endfor |
68 | | | 68 | |
69 | generate-cwrappers: | | 69 | generate-cwrappers: |
70 | ${RUN}${MKDIR} ${CWRAPPERS_CONFIG_DIR} ${WRAPPER_BINDIR} | | | |
71 | .for wrappee in as cxx cc cpp f77 imake ld libtool shlibtool | | 70 | .for wrappee in as cxx cc cpp f77 imake ld libtool shlibtool |
72 | ${RUN}echo worklog=${WRKLOG:Q} > ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} | | 71 | ${RUN}echo worklog=${WRKLOG:Q} > ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} |
73 | ${RUN}echo wrksrc=${WRKSRC:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} | | 72 | ${RUN}echo wrksrc=${WRKSRC:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} |
74 | ${RUN}case ${wrappee} in *libtool) ;; *) echo path=${_PATH_ORIG:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}};; esac | | 73 | ${RUN}case ${wrappee} in *libtool) ;; *) echo path=${_PATH_ORIG:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}};; esac |
75 | ${RUN}echo exec_path=${WRAPPER_BINDIR}/${CWRAPPERS_ALIASES.${wrappee}:[1]} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} | | 74 | ${RUN}echo exec_path=${WRAPPER_BINDIR}/${CWRAPPERS_ALIASES.${wrappee}:[1]} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} |
76 | ${RUN}echo exec=${CWRAPPERS_WRAPPEE.${wrappee}:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} | | 75 | ${RUN}echo exec=${CWRAPPERS_WRAPPEE.${wrappee}:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} |
77 | . for cmd in ${WRAPPER_REORDER_CMDS} | | 76 | . for cmd in ${WRAPPER_REORDER_CMDS} |
78 | ${RUN}echo reorder=${cmd:S/^reorder://:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} | | 77 | ${RUN}echo reorder=${cmd:S/^reorder://:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} |
79 | . endfor | | 78 | . endfor |
80 | . for cmd in ${CWRAPPERS_TRANSFORM.${wrappee}} ${_CWRAPPERS_TRANSFORM} | | 79 | . for cmd in ${CWRAPPERS_TRANSFORM.${wrappee}} ${_CWRAPPERS_TRANSFORM} |
81 | ${RUN}echo transform=${cmd:u:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} | | 80 | ${RUN}echo transform=${cmd:u:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} |
82 | . endfor | | 81 | . endfor |
83 | . for cmd in ${CWRAPPERS_APPEND.${wrappee}:U} | | 82 | . for cmd in ${CWRAPPERS_APPEND.${wrappee}:U} |
| @@ -113,33 +112,36 @@ wrapper: barrier | | | @@ -113,33 +112,36 @@ wrapper: barrier |
113 | | | 112 | |
114 | .PHONY: acquire-wrapper-lock release-wrapper-lock | | 113 | .PHONY: acquire-wrapper-lock release-wrapper-lock |
115 | acquire-wrapper-lock: acquire-lock | | 114 | acquire-wrapper-lock: acquire-lock |
116 | release-wrapper-lock: release-lock | | 115 | release-wrapper-lock: release-lock |
117 | | | 116 | |
118 | .if exists(${_COOKIE.wrapper}) | | 117 | .if exists(${_COOKIE.wrapper}) |
119 | ${_COOKIE.wrapper}: | | 118 | ${_COOKIE.wrapper}: |
120 | @${DO_NADA} | | 119 | @${DO_NADA} |
121 | .else | | 120 | .else |
122 | ${_COOKIE.wrapper}: real-wrapper | | 121 | ${_COOKIE.wrapper}: real-wrapper |
123 | .endif | | 122 | .endif |
124 | | | 123 | |
125 | .PHONY: real-wrapper | | 124 | .PHONY: real-wrapper |
126 | real-wrapper: wrapper-message wrapper-vars pre-wrapper do-wrapper post-wrapper wrapper-cookie error-check | | 125 | real-wrapper: wrapper-message wrapper-dirs wrapper-vars pre-wrapper do-wrapper post-wrapper wrapper-cookie error-check |
127 | | | 126 | |
128 | .PHONY: wrapper-message | | 127 | .PHONY: wrapper-message |
129 | | | | |
130 | wrapper-message: | | 128 | wrapper-message: |
131 | @${PHASE_MSG} "Creating toolchain wrappers for ${PKGNAME}" | | 129 | @${PHASE_MSG} "Creating toolchain wrappers for ${PKGNAME}" |
132 | | | 130 | |
| | | 131 | .PHONY: wrapper-dirs |
| | | 132 | wrapper-dirs: |
| | | 133 | ${RUN}${MKDIR} ${CWRAPPERS_CONFIG_DIR} ${WRAPPER_BINDIR} |
| | | 134 | |
133 | .PHONY: pre-wrapper do-wrapper post-wrapper | | 135 | .PHONY: pre-wrapper do-wrapper post-wrapper |
134 | | | 136 | |
135 | do-wrapper: generate-cwrappers | | 137 | do-wrapper: generate-cwrappers |
136 | | | 138 | |
137 | .if !target(do-wrapper) | | 139 | .if !target(do-wrapper) |
138 | do-wrapper: | | 140 | do-wrapper: |
139 | @${DO_NADA} | | 141 | @${DO_NADA} |
140 | .endif | | 142 | .endif |
141 | | | 143 | |
142 | .if !target(pre-wrapper) | | 144 | .if !target(pre-wrapper) |
143 | pre-wrapper: | | 145 | pre-wrapper: |
144 | @${DO_NADA} | | 146 | @${DO_NADA} |
145 | .endif | | 147 | .endif |