Tue Apr 28 21:08:34 2015 UTC ()
Ensure the wrapper directories are created before WRAPPER_TARGETS.


(jperkin)
diff -r1.23 -r1.24 pkgsrc/mk/cwrappers.mk

cvs diff -r1.23 -r1.24 pkgsrc/mk/cwrappers.mk (expand / switch to unified diff)

--- pkgsrc/mk/cwrappers.mk 2015/04/27 19:59:07 1.23
+++ pkgsrc/mk/cwrappers.mk 2015/04/28 21:08:34 1.24
@@ -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
7BUILD_DEPENDS+= cwrappers>=20150314:../../pkgtools/cwrappers 7BUILD_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.
10WRAPPER_DIR= ${WRKDIR}/.cwrapper 10WRAPPER_DIR= ${WRKDIR}/.cwrapper
11WRAPPER_BINDIR= ${WRAPPER_DIR}/bin 11WRAPPER_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.
14CWRAPPERS_SRC_DIR= ${LOCALBASE}/libexec/cwrappers 14CWRAPPERS_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)
59CWRAPPERS_TRANSFORM.imake+= I:${PREFIX}/lib/X11/config:${PREFIX}/lib/X11/config 59CWRAPPERS_TRANSFORM.imake+= I:${PREFIX}/lib/X11/config:${PREFIX}/lib/X11/config
60CWRAPPERS_APPEND.imake+= ${IMAKEOPTS} 60CWRAPPERS_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}
66generate-cwrappers: ${_target_} 66generate-cwrappers: ${_target_}
67.endfor 67.endfor
68 68
69generate-cwrappers: 69generate-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
115acquire-wrapper-lock: acquire-lock 114acquire-wrapper-lock: acquire-lock
116release-wrapper-lock: release-lock 115release-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
126real-wrapper: wrapper-message wrapper-vars pre-wrapper do-wrapper post-wrapper wrapper-cookie error-check 125real-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 
130wrapper-message: 128wrapper-message:
131 @${PHASE_MSG} "Creating toolchain wrappers for ${PKGNAME}" 129 @${PHASE_MSG} "Creating toolchain wrappers for ${PKGNAME}"
132 130
 131.PHONY: wrapper-dirs
 132wrapper-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
135do-wrapper: generate-cwrappers 137do-wrapper: generate-cwrappers
136 138
137.if !target(do-wrapper) 139.if !target(do-wrapper)
138do-wrapper: 140do-wrapper:
139 @${DO_NADA} 141 @${DO_NADA}
140.endif 142.endif
141 143
142.if !target(pre-wrapper) 144.if !target(pre-wrapper)
143pre-wrapper: 145pre-wrapper:
144 @${DO_NADA} 146 @${DO_NADA}
145.endif 147.endif