Fri Feb 15 09:22:50 2013 UTC ()
check requirement of uac manifest, it is required for Windows Vista
(aka NT-6.0) and later.


(obache)
diff -r1.1984 -r1.1985 pkgsrc/mk/bsd.pkg.mk
diff -r1.1 -r1.2 pkgsrc/mk/platform/Cygwin.mk

cvs diff -r1.1984 -r1.1985 pkgsrc/mk/bsd.pkg.mk (switch to unified diff)

--- pkgsrc/mk/bsd.pkg.mk 2013/02/10 13:04:08 1.1984
+++ pkgsrc/mk/bsd.pkg.mk 2013/02/15 09:22:50 1.1985
@@ -1,805 +1,807 @@ @@ -1,805 +1,807 @@
1# $NetBSD: bsd.pkg.mk,v 1.1984 2013/02/10 13:04:08 obache Exp $ 1# $NetBSD: bsd.pkg.mk,v 1.1985 2013/02/15 09:22:50 obache Exp $
2# 2#
3# This file is in the public domain. 3# This file is in the public domain.
4# 4#
5# Please see the pkgsrc/doc/guide manual for details on the 5# Please see the pkgsrc/doc/guide manual for details on the
6# variables used in this make file template. 6# variables used in this make file template.
7# 7#
8# Default sequence for "all" is: 8# Default sequence for "all" is:
9# 9#
10# bootstrap-depends 10# bootstrap-depends
11# fetch 11# fetch
12# checksum 12# checksum
13# depends 13# depends
14# tools 14# tools
15# extract 15# extract
16# patch 16# patch
17# wrapper 17# wrapper
18# configure 18# configure
19# build 19# build
20# 20#
21 21
22.include "misc/common.mk" 22.include "misc/common.mk"
23 23
24############################################################################ 24############################################################################
25# Transform package Makefile variables and set defaults 25# Transform package Makefile variables and set defaults
26# This is the early set used directly or indirectly in 26# This is the early set used directly or indirectly in
27# the phase variables. 27# the phase variables.
28############################################################################ 28############################################################################
29 29
30##### PKGBASE, PKGNAME[_NOREV], PKGVERSION 30##### PKGBASE, PKGNAME[_NOREV], PKGVERSION
31 31
32PKGBASE?= ${PKGNAME:C/-[^-]*$//} 32PKGBASE?= ${PKGNAME:C/-[^-]*$//}
33PKGVERSION?= ${PKGNAME:C/^.*-//} 33PKGVERSION?= ${PKGNAME:C/^.*-//}
34.if defined(PKGREVISION) && !empty(PKGREVISION) && (${PKGREVISION} != "0") 34.if defined(PKGREVISION) && !empty(PKGREVISION) && (${PKGREVISION} != "0")
35. if defined(PKGNAME) 35. if defined(PKGNAME)
36PKGNAME_NOREV:= ${PKGNAME} 36PKGNAME_NOREV:= ${PKGNAME}
37PKGNAME:= ${PKGNAME}nb${PKGREVISION} 37PKGNAME:= ${PKGNAME}nb${PKGREVISION}
38. else 38. else
39PKGNAME?= ${DISTNAME}nb${PKGREVISION} 39PKGNAME?= ${DISTNAME}nb${PKGREVISION}
40PKGNAME_NOREV= ${DISTNAME} 40PKGNAME_NOREV= ${DISTNAME}
41. endif 41. endif
42.else 42.else
43PKGNAME?= ${DISTNAME} 43PKGNAME?= ${DISTNAME}
44PKGNAME_NOREV= ${PKGNAME} 44PKGNAME_NOREV= ${PKGNAME}
45.endif 45.endif
46PKGVERSION_NOREV= ${PKGNAME_NOREV:C/^.*-//} 46PKGVERSION_NOREV= ${PKGNAME_NOREV:C/^.*-//}
47 47
48# Fail-safe in the case of circular dependencies 48# Fail-safe in the case of circular dependencies
49.if defined(_PKGSRC_DEPS) && defined(PKGNAME) && !empty(_PKGSRC_DEPS:M${PKGNAME}) 49.if defined(_PKGSRC_DEPS) && defined(PKGNAME) && !empty(_PKGSRC_DEPS:M${PKGNAME})
50PKG_FAIL_REASON+= "Circular dependency detected" 50PKG_FAIL_REASON+= "Circular dependency detected"
51.endif 51.endif
52 52
53#### 53####
54 54
55############################################################################ 55############################################################################
56# Allow various phases to define the default variables 56# Allow various phases to define the default variables
57############################################################################ 57############################################################################
58.if defined(EMUL_PLATFORMS) && !empty(EMUL_PLATFORMS) 58.if defined(EMUL_PLATFORMS) && !empty(EMUL_PLATFORMS)
59. include "emulator/emulator.mk" 59. include "emulator/emulator.mk"
60.endif 60.endif
61 61
62.include "features/features.mk" 62.include "features/features.mk"
63 63
64.include "pkgformat/bsd.pkgformat-vars.mk" 64.include "pkgformat/bsd.pkgformat-vars.mk"
65.include "check/bsd.check-vars.mk" 65.include "check/bsd.check-vars.mk"
66.include "depends/bsd.depends-vars.mk" 66.include "depends/bsd.depends-vars.mk"
67.include "fetch/bsd.fetch-vars.mk" 67.include "fetch/bsd.fetch-vars.mk"
68.include "checksum/bsd.checksum-vars.mk" 68.include "checksum/bsd.checksum-vars.mk"
69.include "extract/bsd.extract-vars.mk" 69.include "extract/bsd.extract-vars.mk"
70.include "patch/bsd.patch-vars.mk" 70.include "patch/bsd.patch-vars.mk"
71.include "configure/bsd.configure-vars.mk" 71.include "configure/bsd.configure-vars.mk"
72.include "build/bsd.build-vars.mk" 72.include "build/bsd.build-vars.mk"
73.include "install/bsd.install-vars.mk" 73.include "install/bsd.install-vars.mk"
74 74
75.include "bsd.pkg.error.mk" 75.include "bsd.pkg.error.mk"
76 76
77.include "bsd.hacks.mk" 77.include "bsd.hacks.mk"
78 78
79############################################################################ 79############################################################################
80# Transform package Makefile variables and set defaults 80# Transform package Makefile variables and set defaults
81############################################################################ 81############################################################################
82 82
83MKCRYPTO?= YES # build crypto packages by default 83MKCRYPTO?= YES # build crypto packages by default
84 84
85##### Others 85##### Others
86 86
87BUILD_DEPENDS?= # empty 87BUILD_DEPENDS?= # empty
88COMMENT?= (no description) 88COMMENT?= (no description)
89DEPENDS?= # empty 89DEPENDS?= # empty
90DESCR_SRC?= ${PKGDIR}/DESCR 90DESCR_SRC?= ${PKGDIR}/DESCR
91INTERACTIVE_STAGE?= none 91INTERACTIVE_STAGE?= none
92.if defined(OWNER) 92.if defined(OWNER)
93MAINTAINER=${OWNER} 93MAINTAINER=${OWNER}
94.else 94.else
95MAINTAINER?= pkgsrc-users@NetBSD.org 95MAINTAINER?= pkgsrc-users@NetBSD.org
96.endif 96.endif
97PKGWILDCARD?= ${PKGBASE}-[0-9]* 97PKGWILDCARD?= ${PKGBASE}-[0-9]*
98SVR4_PKGNAME?= ${PKGNAME} 98SVR4_PKGNAME?= ${PKGNAME}
99WRKSRC?= ${WRKDIR}/${DISTNAME} 99WRKSRC?= ${WRKDIR}/${DISTNAME}
100 100
101# Override for SU_CMD user check 101# Override for SU_CMD user check
102_SU_ROOT_USER?= ${ROOT_USER} 102_SU_ROOT_USER?= ${ROOT_USER}
103REAL_ROOT_USER?= ${ROOT_USER} 103REAL_ROOT_USER?= ${ROOT_USER}
104REAL_ROOT_GROUP?= ${ROOT_GROUP} 104REAL_ROOT_GROUP?= ${ROOT_GROUP}
105 105
106.if (defined(INSTALL_UNSTRIPPED) && !empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) || defined(DEBUG_FLAGS) 106.if (defined(INSTALL_UNSTRIPPED) && !empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) || defined(DEBUG_FLAGS)
107_INSTALL_UNSTRIPPED= # set (flag used by platform/*.mk) 107_INSTALL_UNSTRIPPED= # set (flag used by platform/*.mk)
108.endif 108.endif
109 109
110##### Transform USE_* into dependencies 110##### Transform USE_* into dependencies
111 111
112.include "bsd.pkg.use.mk" 112.include "bsd.pkg.use.mk"
113 113
114############################################################################ 114############################################################################
115# Sanity checks 115# Sanity checks
116############################################################################ 116############################################################################
117 117
118.if defined(BUILDLINK_DEPTH) || defined(BUILDLINK_PACKAGES) || \ 118.if defined(BUILDLINK_DEPTH) || defined(BUILDLINK_PACKAGES) || \
119 defined(BUILDLINK_DEPENDS) || defined(BUILDLINK_ORDER) 119 defined(BUILDLINK_DEPENDS) || defined(BUILDLINK_ORDER)
120PKG_FAIL_REASON+= "Out-dated buildlink3.mk detected, please update" 120PKG_FAIL_REASON+= "Out-dated buildlink3.mk detected, please update"
121.endif 121.endif
122 122
123# PKG_INSTALLATION_TYPE can only be one of two values: "pkgviews" or 123# PKG_INSTALLATION_TYPE can only be one of two values: "pkgviews" or
124# "overwrite". 124# "overwrite".
125.if (${PKG_INSTALLATION_TYPE} != "pkgviews") && \ 125.if (${PKG_INSTALLATION_TYPE} != "pkgviews") && \
126 (${PKG_INSTALLATION_TYPE} != "overwrite") 126 (${PKG_INSTALLATION_TYPE} != "overwrite")
127PKG_FAIL_REASON+= "PKG_INSTALLATION_TYPE must be \`\`pkgviews'' or \`\`overwrite''." 127PKG_FAIL_REASON+= "PKG_INSTALLATION_TYPE must be \`\`pkgviews'' or \`\`overwrite''."
128.endif 128.endif
129 129
130.if empty(PKG_INSTALLATION_TYPES:M${PKG_INSTALLATION_TYPE}) 130.if empty(PKG_INSTALLATION_TYPES:M${PKG_INSTALLATION_TYPE})
131PKG_FAIL_REASON+= "This package doesn't support PKG_INSTALLATION_TYPE=${PKG_INSTALLATION_TYPE}." 131PKG_FAIL_REASON+= "This package doesn't support PKG_INSTALLATION_TYPE=${PKG_INSTALLATION_TYPE}."
132.endif 132.endif
133 133
134.if !defined(CATEGORIES) || !defined(DISTNAME) 134.if !defined(CATEGORIES) || !defined(DISTNAME)
135PKG_FAIL_REASON+='CATEGORIES and DISTNAME are mandatory.' 135PKG_FAIL_REASON+='CATEGORIES and DISTNAME are mandatory.'
136.endif 136.endif
137 137
138.if defined(PKG_PATH) 138.if defined(PKG_PATH)
139PKG_FAIL_REASON+='Please unset PKG_PATH before doing pkgsrc work!' 139PKG_FAIL_REASON+='Please unset PKG_PATH before doing pkgsrc work!'
140.endif 140.endif
141 141
142# Allow variables to be set on a per-OS basis 142# Allow variables to be set on a per-OS basis
143OPSYSVARS+= CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LIBS 143OPSYSVARS+= CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LIBS
144.for _var_ in ${OPSYSVARS:O} 144.for _var_ in ${OPSYSVARS:O}
145. if defined(${_var_}.${OPSYS}) 145. if defined(${_var_}.${OPSYS})
146${_var_}+= ${${_var_}.${OPSYS}} 146${_var_}+= ${${_var_}.${OPSYS}}
147. elif defined(${_var_}.*) 147. elif defined(${_var_}.*)
148${_var_}+= ${${_var_}.*} 148${_var_}+= ${${_var_}.*}
149. endif 149. endif
150.endfor 150.endfor
151 151
152CPPFLAGS+= ${CPP_PRECOMP_FLAGS} 152CPPFLAGS+= ${CPP_PRECOMP_FLAGS}
153 153
154# To sanitise environment set PKGSRC_SETENV=${SETENV} -i 154# To sanitise environment set PKGSRC_SETENV=${SETENV} -i
155PKGSRC_SETENV?= ${SETENV} 155PKGSRC_SETENV?= ${SETENV}
156 156
157ALL_ENV+= CC=${CC:Q} 157ALL_ENV+= CC=${CC:Q}
158ALL_ENV+= CFLAGS=${CFLAGS:M*:Q} 158ALL_ENV+= CFLAGS=${CFLAGS:M*:Q}
159ALL_ENV+= CPPFLAGS=${CPPFLAGS:M*:Q} 159ALL_ENV+= CPPFLAGS=${CPPFLAGS:M*:Q}
160ALL_ENV+= CXX=${CXX:Q} 160ALL_ENV+= CXX=${CXX:Q}
161ALL_ENV+= CXXFLAGS=${CXXFLAGS:M*:Q} 161ALL_ENV+= CXXFLAGS=${CXXFLAGS:M*:Q}
162ALL_ENV+= COMPILER_RPATH_FLAG=${COMPILER_RPATH_FLAG:Q} 162ALL_ENV+= COMPILER_RPATH_FLAG=${COMPILER_RPATH_FLAG:Q}
163ALL_ENV+= F77=${FC:Q} 163ALL_ENV+= F77=${FC:Q}
164ALL_ENV+= FC=${FC:Q} 164ALL_ENV+= FC=${FC:Q}
165ALL_ENV+= FFLAGS=${FFLAGS:M*:Q} 165ALL_ENV+= FFLAGS=${FFLAGS:M*:Q}
166ALL_ENV+= LANG=C 166ALL_ENV+= LANG=C
167ALL_ENV+= LC_COLLATE=C 167ALL_ENV+= LC_COLLATE=C
168ALL_ENV+= LC_CTYPE=C 168ALL_ENV+= LC_CTYPE=C
169ALL_ENV+= LC_MESSAGES=C 169ALL_ENV+= LC_MESSAGES=C
170ALL_ENV+= LC_MONETARY=C 170ALL_ENV+= LC_MONETARY=C
171ALL_ENV+= LC_NUMERIC=C 171ALL_ENV+= LC_NUMERIC=C
172ALL_ENV+= LC_TIME=C 172ALL_ENV+= LC_TIME=C
173ALL_ENV+= LDFLAGS=${LDFLAGS:M*:Q} 173ALL_ENV+= LDFLAGS=${LDFLAGS:M*:Q}
174ALL_ENV+= LINKER_RPATH_FLAG=${LINKER_RPATH_FLAG:Q} 174ALL_ENV+= LINKER_RPATH_FLAG=${LINKER_RPATH_FLAG:Q}
175ALL_ENV+= PATH=${PATH:Q}:${LOCALBASE}/bin:${X11BASE}/bin 175ALL_ENV+= PATH=${PATH:Q}:${LOCALBASE}/bin:${X11BASE}/bin
176ALL_ENV+= PREFIX=${PREFIX} 176ALL_ENV+= PREFIX=${PREFIX}
177 177
178# This variable can be added to MAKE_ENV to ease installation of packages 178# This variable can be added to MAKE_ENV to ease installation of packages
179# that use BSD-style Makefiles. 179# that use BSD-style Makefiles.
180BSD_MAKE_ENV= BINOWN=${BINOWN} BINGRP=${BINGRP} 180BSD_MAKE_ENV= BINOWN=${BINOWN} BINGRP=${BINGRP}
181BSD_MAKE_ENV+= GAMEOWN=${GAMEOWN} GAMEGRP=${GAMEGRP} 181BSD_MAKE_ENV+= GAMEOWN=${GAMEOWN} GAMEGRP=${GAMEGRP}
182BSD_MAKE_ENV+= MANOWN=${MANOWN} MANGRP=${MANGRP} 182BSD_MAKE_ENV+= MANOWN=${MANOWN} MANGRP=${MANGRP}
183BSD_MAKE_ENV+= SHAREOWN=${SHAREOWN} SHAREGRP=${SHAREGRP} 183BSD_MAKE_ENV+= SHAREOWN=${SHAREOWN} SHAREGRP=${SHAREGRP}
184BSD_MAKE_ENV+= DOCOWN=${DOCOWN} DOCGRP=${DOCGRP} 184BSD_MAKE_ENV+= DOCOWN=${DOCOWN} DOCGRP=${DOCGRP}
185BSD_MAKE_ENV+= BINMODE=${BINMODE} NONBINMODE=${NONBINMODE} 185BSD_MAKE_ENV+= BINMODE=${BINMODE} NONBINMODE=${NONBINMODE}
186BSD_MAKE_ENV+= BINDIR=${PREFIX}/bin 186BSD_MAKE_ENV+= BINDIR=${PREFIX}/bin
187BSD_MAKE_ENV+= INCSDIR=${PREFIX}/include 187BSD_MAKE_ENV+= INCSDIR=${PREFIX}/include
188BSD_MAKE_ENV+= LIBDIR=${PREFIX}/lib 188BSD_MAKE_ENV+= LIBDIR=${PREFIX}/lib
189BSD_MAKE_ENV+= MANDIR=${PREFIX}/${PKGMANDIR} 189BSD_MAKE_ENV+= MANDIR=${PREFIX}/${PKGMANDIR}
190BSD_MAKE_ENV+= STRIPFLAG=${_STRIPFLAG_INSTALL:Q} 190BSD_MAKE_ENV+= STRIPFLAG=${_STRIPFLAG_INSTALL:Q}
191BSD_MAKE_ENV+= MANINSTALL=${MANINSTALL:Q} 191BSD_MAKE_ENV+= MANINSTALL=${MANINSTALL:Q}
192BSD_MAKE_ENV+= MKCATPAGES=${MKCATPAGES:Q} 192BSD_MAKE_ENV+= MKCATPAGES=${MKCATPAGES:Q}
193BSD_MAKE_ENV+= MKHTML=no 193BSD_MAKE_ENV+= MKHTML=no
194 194
195_BUILD_DEFS= ${BUILD_DEFS} 195_BUILD_DEFS= ${BUILD_DEFS}
196_BUILD_DEFS+= LOCALBASE 196_BUILD_DEFS+= LOCALBASE
197_BUILD_DEFS+= PKGGNUDIR 197_BUILD_DEFS+= PKGGNUDIR
198_BUILD_DEFS+= PKGINFODIR 198_BUILD_DEFS+= PKGINFODIR
199_BUILD_DEFS+= PKGMANDIR 199_BUILD_DEFS+= PKGMANDIR
200_BUILD_DEFS+= _USE_DESTDIR 200_BUILD_DEFS+= _USE_DESTDIR
201 201
202# Store the result in the +BUILD_INFO file so we can query for the build 202# Store the result in the +BUILD_INFO file so we can query for the build
203# options using "pkg_info -Q PKG_OPTIONS <pkg>". 203# options using "pkg_info -Q PKG_OPTIONS <pkg>".
204# 204#
205.if defined(PKG_SUPPORTED_OPTIONS) && defined(PKG_OPTIONS) 205.if defined(PKG_SUPPORTED_OPTIONS) && defined(PKG_OPTIONS)
206_BUILD_DEFS+= PKG_OPTIONS 206_BUILD_DEFS+= PKG_OPTIONS
207.endif 207.endif
208 208
209.if empty(DEPOT_SUBDIR) 209.if empty(DEPOT_SUBDIR)
210PKG_FAIL_REASON+= "DEPOT_SUBDIR may not be empty." 210PKG_FAIL_REASON+= "DEPOT_SUBDIR may not be empty."
211.endif 211.endif
212 212
213# Store the build options for multi-packages, i.e. packages that can 213# Store the build options for multi-packages, i.e. packages that can
214# be built with multiple versions of Apache, Python, Ruby, PHP etc. 214# be built with multiple versions of Apache, Python, Ruby, PHP etc.
215# 215#
216.if defined(MULTI) 216.if defined(MULTI)
217_BUILD_DEFS+= MULTI 217_BUILD_DEFS+= MULTI
218.endif 218.endif
219 219
220# ZERO_FILESIZE_P exits with a successful return code if the given file 220# ZERO_FILESIZE_P exits with a successful return code if the given file
221# has zero length. 221# has zero length.
222# NONZERO_FILESIZE_P exits with a successful return code if the given file 222# NONZERO_FILESIZE_P exits with a successful return code if the given file
223# has nonzero length. 223# has nonzero length.
224# 224#
225_ZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 1 : 0; }' 225_ZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 1 : 0; }'
226_NONZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 0 : 1; }' 226_NONZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 0 : 1; }'
227 227
228# Automatically increase process limit where necessary for building. 228# Automatically increase process limit where necessary for building.
229_ULIMIT_CMD= ${UNLIMIT_RESOURCES:@_lim_@${ULIMIT_CMD_${_lim_}};@} 229_ULIMIT_CMD= ${UNLIMIT_RESOURCES:@_lim_@${ULIMIT_CMD_${_lim_}};@}
230 230
231_NULL_COOKIE= ${WRKDIR}/.null 231_NULL_COOKIE= ${WRKDIR}/.null
232 232
233# Miscellaneous overridable commands: 233# Miscellaneous overridable commands:
234SHCOMMENT?= ${ECHO_MSG} >/dev/null '***' 234SHCOMMENT?= ${ECHO_MSG} >/dev/null '***'
235 235
236LIBABISUFFIX?= 236LIBABISUFFIX?=
237 237
238TOUCH_FLAGS?= -f 238TOUCH_FLAGS?= -f
239 239
240# A few aliases for *-install targets 240# A few aliases for *-install targets
241INSTALL= ${TOOLS_INSTALL} # XXX override sys.mk 241INSTALL= ${TOOLS_INSTALL} # XXX override sys.mk
242INSTALL_PROGRAM?= \ 242INSTALL_PROGRAM?= \
243 ${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} 243 ${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
244INSTALL_GAME?= \ 244INSTALL_GAME?= \
245 ${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEMODE} 245 ${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEMODE}
246INSTALL_SCRIPT?= \ 246INSTALL_SCRIPT?= \
247 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} 247 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
248INSTALL_LIB?= \ 248INSTALL_LIB?= \
249 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} 249 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
250INSTALL_DATA?= \ 250INSTALL_DATA?= \
251 ${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} 251 ${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}
252INSTALL_GAME_DATA?= \ 252INSTALL_GAME_DATA?= \
253 ${INSTALL} ${COPY} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDATAMODE} 253 ${INSTALL} ${COPY} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDATAMODE}
254INSTALL_MAN?= \ 254INSTALL_MAN?= \
255 ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} 255 ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
256INSTALL_PROGRAM_DIR?= \ 256INSTALL_PROGRAM_DIR?= \
257 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${PKGDIRMODE} 257 ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${PKGDIRMODE}
258INSTALL_GAME_DIR?= \ 258INSTALL_GAME_DIR?= \
259 ${INSTALL} -d -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDIRMODE} 259 ${INSTALL} -d -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDIRMODE}
260INSTALL_SCRIPT_DIR?= \ 260INSTALL_SCRIPT_DIR?= \
261 ${INSTALL_PROGRAM_DIR} 261 ${INSTALL_PROGRAM_DIR}
262INSTALL_LIB_DIR?= \ 262INSTALL_LIB_DIR?= \
263 ${INSTALL_PROGRAM_DIR} 263 ${INSTALL_PROGRAM_DIR}
264INSTALL_DATA_DIR?= \ 264INSTALL_DATA_DIR?= \
265 ${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${PKGDIRMODE} 265 ${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${PKGDIRMODE}
266INSTALL_MAN_DIR?= \ 266INSTALL_MAN_DIR?= \
267 ${INSTALL} -d -o ${MANOWN} -g ${MANGRP} -m ${PKGDIRMODE} 267 ${INSTALL} -d -o ${MANOWN} -g ${MANGRP} -m ${PKGDIRMODE}
268 268
269INSTALL_MACROS= BSD_INSTALL_PROGRAM=${INSTALL_PROGRAM:Q} \ 269INSTALL_MACROS= BSD_INSTALL_PROGRAM=${INSTALL_PROGRAM:Q} \
270 BSD_INSTALL_SCRIPT=${INSTALL_SCRIPT:Q} \ 270 BSD_INSTALL_SCRIPT=${INSTALL_SCRIPT:Q} \
271 BSD_INSTALL_LIB=${INSTALL_LIB:Q} \ 271 BSD_INSTALL_LIB=${INSTALL_LIB:Q} \
272 BSD_INSTALL_DATA=${INSTALL_DATA:Q} \ 272 BSD_INSTALL_DATA=${INSTALL_DATA:Q} \
273 BSD_INSTALL_MAN=${INSTALL_MAN:Q} \ 273 BSD_INSTALL_MAN=${INSTALL_MAN:Q} \
274 BSD_INSTALL=${INSTALL:Q} \ 274 BSD_INSTALL=${INSTALL:Q} \
275 BSD_INSTALL_PROGRAM_DIR=${INSTALL_PROGRAM_DIR:Q} \ 275 BSD_INSTALL_PROGRAM_DIR=${INSTALL_PROGRAM_DIR:Q} \
276 BSD_INSTALL_SCRIPT_DIR=${INSTALL_SCRIPT_DIR:Q} \ 276 BSD_INSTALL_SCRIPT_DIR=${INSTALL_SCRIPT_DIR:Q} \
277 BSD_INSTALL_LIB_DIR=${INSTALL_LIB_DIR:Q} \ 277 BSD_INSTALL_LIB_DIR=${INSTALL_LIB_DIR:Q} \
278 BSD_INSTALL_DATA_DIR=${INSTALL_DATA_DIR:Q} \ 278 BSD_INSTALL_DATA_DIR=${INSTALL_DATA_DIR:Q} \
279 BSD_INSTALL_MAN_DIR=${INSTALL_MAN_DIR:Q} \ 279 BSD_INSTALL_MAN_DIR=${INSTALL_MAN_DIR:Q} \
280 BSD_INSTALL_GAME=${INSTALL_GAME:Q} \ 280 BSD_INSTALL_GAME=${INSTALL_GAME:Q} \
281 BSD_INSTALL_GAME_DATA=${INSTALL_GAME_DATA:Q} \ 281 BSD_INSTALL_GAME_DATA=${INSTALL_GAME_DATA:Q} \
282 BSD_INSTALL_GAME_DIR=${INSTALL_GAME_DIR:Q} 282 BSD_INSTALL_GAME_DIR=${INSTALL_GAME_DIR:Q}
283MAKE_ENV+= ${INSTALL_MACROS:M*} 283MAKE_ENV+= ${INSTALL_MACROS:M*}
284SCRIPTS_ENV+= ${INSTALL_MACROS:M*} 284SCRIPTS_ENV+= ${INSTALL_MACROS:M*}
285 285
286# If pkgsrc is supposed to ensure that tests are run before installation 286# If pkgsrc is supposed to ensure that tests are run before installation
287# of the package, then the build targets should be "build test", otherwise 287# of the package, then the build targets should be "build test", otherwise
288# just "build" suffices. 288# just "build" suffices.
289# 289#
290.if !empty(PKGSRC_RUN_TEST:M[yY][eE][sS]) 290.if !empty(PKGSRC_RUN_TEST:M[yY][eE][sS])
291_PKGSRC_BUILD_TARGETS= build test 291_PKGSRC_BUILD_TARGETS= build test
292.else 292.else
293_PKGSRC_BUILD_TARGETS= build 293_PKGSRC_BUILD_TARGETS= build
294.endif 294.endif
295 295
296# OVERRIDE_DIRDEPTH represents the common directory depth under 296# OVERRIDE_DIRDEPTH represents the common directory depth under
297# ${WRKSRC} up to which we find the files that need to be 297# ${WRKSRC} up to which we find the files that need to be
298# overridden. By default, we search two levels down, i.e., 298# overridden. By default, we search two levels down, i.e.,
299# */*/file. 299# */*/file.
300# 300#
301OVERRIDE_DIRDEPTH?= 2 301OVERRIDE_DIRDEPTH?= 2
302 302
303# Handle alternatives 303# Handle alternatives
304# 304#
305.include "alternatives.mk" 305.include "alternatives.mk"
306 306
307# Define SMART_MESSAGES in /etc/mk.conf for messages giving the tree 307# Define SMART_MESSAGES in /etc/mk.conf for messages giving the tree
308# of dependencies for building, and the current target. 308# of dependencies for building, and the current target.
309_PKGSRC_IN?= ===${SMART_MESSAGES:D> ${.TARGET} [${PKGNAME}${_PKGSRC_DEPS}] ===} 309_PKGSRC_IN?= ===${SMART_MESSAGES:D> ${.TARGET} [${PKGNAME}${_PKGSRC_DEPS}] ===}
310 310
311# Used to print all the '===>' style prompts - override this to turn them off. 311# Used to print all the '===>' style prompts - override this to turn them off.
312ECHO_MSG?= ${ECHO} 312ECHO_MSG?= ${ECHO}
313PHASE_MSG?= ${ECHO_MSG} ${_PKGSRC_IN:Q}\> 313PHASE_MSG?= ${ECHO_MSG} ${_PKGSRC_IN:Q}\>
314STEP_MSG?= ${ECHO_MSG} "=>" 314STEP_MSG?= ${ECHO_MSG} "=>"
315INFO_MSG?= ${ECHO_MSG} "INFO:" 315INFO_MSG?= ${ECHO_MSG} "INFO:"
316WARNING_MSG?= ${ECHO_MSG} 1>&2 "WARNING:" 316WARNING_MSG?= ${ECHO_MSG} 1>&2 "WARNING:"
317ERROR_MSG?= ${ECHO_MSG} 1>&2 "ERROR:" 317ERROR_MSG?= ${ECHO_MSG} 1>&2 "ERROR:"
318FAIL_MSG?= ${FAIL} ${ERROR_MSG} 318FAIL_MSG?= ${FAIL} ${ERROR_MSG}
319 319
320WARNING_CAT?= ${SED} -e "s|^|WARNING: |" 1>&2 320WARNING_CAT?= ${SED} -e "s|^|WARNING: |" 1>&2
321ERROR_CAT?= ${SED} -e "s|^|ERROR: |" 1>&2 321ERROR_CAT?= ${SED} -e "s|^|ERROR: |" 1>&2
322 322
323# How to do nothing. Override if you, for some strange reason, would rather 323# How to do nothing. Override if you, for some strange reason, would rather
324# do something. 324# do something.
325DO_NADA?= ${TRUE} 325DO_NADA?= ${TRUE}
326 326
327# the FAIL command executes its arguments and then exits with a non-zero 327# the FAIL command executes its arguments and then exits with a non-zero
328# status. 328# status.
329FAIL?= ${SH} ${PKGSRCDIR}/mk/scripts/fail 329FAIL?= ${SH} ${PKGSRCDIR}/mk/scripts/fail
330 330
331# 331#
332# Config file related settings - see doc/pkgsrc.txt 332# Config file related settings - see doc/pkgsrc.txt
333# 333#
334PKG_SYSCONFVAR?= ${PKGBASE} 334PKG_SYSCONFVAR?= ${PKGBASE}
335PKG_SYSCONFSUBDIR?= # empty 335PKG_SYSCONFSUBDIR?= # empty
336.if ${PKG_INSTALLATION_TYPE} == "overwrite" 336.if ${PKG_INSTALLATION_TYPE} == "overwrite"
337PKG_SYSCONFDEPOTBASE= # empty 337PKG_SYSCONFDEPOTBASE= # empty
338PKG_SYSCONFBASEDIR= ${PKG_SYSCONFBASE} 338PKG_SYSCONFBASEDIR= ${PKG_SYSCONFBASE}
339.else 339.else
340. if !empty(PKG_SYSCONFBASE:M${PREFIX}) || \ 340. if !empty(PKG_SYSCONFBASE:M${PREFIX}) || \
341 !empty(PKG_SYSCONFBASE:M${PREFIX}/*) 341 !empty(PKG_SYSCONFBASE:M${PREFIX}/*)
342PKG_SYSCONFDEPOTBASE= # empty 342PKG_SYSCONFDEPOTBASE= # empty
343PKG_SYSCONFBASEDIR= ${PKG_SYSCONFBASE} 343PKG_SYSCONFBASEDIR= ${PKG_SYSCONFBASE}
344. else 344. else
345PKG_SYSCONFDEPOTBASE= ${PKG_SYSCONFBASE}/${DEPOT_SUBDIR} 345PKG_SYSCONFDEPOTBASE= ${PKG_SYSCONFBASE}/${DEPOT_SUBDIR}
346PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDEPOTBASE}/${PKGNAME} 346PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDEPOTBASE}/${PKGNAME}
347. endif 347. endif
348.endif 348.endif
349.if empty(PKG_SYSCONFSUBDIR) 349.if empty(PKG_SYSCONFSUBDIR)
350DFLT_PKG_SYSCONFDIR:= ${PKG_SYSCONFBASEDIR} 350DFLT_PKG_SYSCONFDIR:= ${PKG_SYSCONFBASEDIR}
351.else 351.else
352DFLT_PKG_SYSCONFDIR:= ${PKG_SYSCONFBASEDIR}/${PKG_SYSCONFSUBDIR} 352DFLT_PKG_SYSCONFDIR:= ${PKG_SYSCONFBASEDIR}/${PKG_SYSCONFSUBDIR}
353.endif 353.endif
354PKG_SYSCONFDIR= ${DFLT_PKG_SYSCONFDIR} 354PKG_SYSCONFDIR= ${DFLT_PKG_SYSCONFDIR}
355.if defined(PKG_SYSCONFDIR.${PKG_SYSCONFVAR}) 355.if defined(PKG_SYSCONFDIR.${PKG_SYSCONFVAR})
356PKG_SYSCONFDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}} 356PKG_SYSCONFDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}}
357PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}} 357PKG_SYSCONFBASEDIR= ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}}
358PKG_SYSCONFDEPOTBASE= # empty 358PKG_SYSCONFDEPOTBASE= # empty
359.endif 359.endif
360PKG_SYSCONFDIR_PERMS?= ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755 360PKG_SYSCONFDIR_PERMS?= ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
361 361
362ALL_ENV+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q} 362ALL_ENV+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q}
363_BUILD_DEFS+= PKG_SYSCONFBASEDIR PKG_SYSCONFDIR 363_BUILD_DEFS+= PKG_SYSCONFBASEDIR PKG_SYSCONFDIR
364 364
365# These are all of the tools use by pkgsrc Makefiles. This should 365# These are all of the tools use by pkgsrc Makefiles. This should
366# eventually be split up into lists of tools required by different 366# eventually be split up into lists of tools required by different
367# phases of a pkgsrc build. 367# phases of a pkgsrc build.
368# 368#
369USE_TOOLS+= \ 369USE_TOOLS+= \
370 [ awk basename cat chgrp chmod chown cmp cp cut dirname echo \ 370 [ awk basename cat chgrp chmod chown cmp cp cut dirname echo \
371 egrep env false file find grep head hostname id install ln ls \ 371 egrep env false file find grep head hostname id install ln ls \
372 mkdir mv printf pwd rm rmdir sed sh sort \ 372 mkdir mv printf pwd rm rmdir sed sh sort \
373 tail test touch tr true wc xargs 373 tail test touch tr true wc xargs
374 374
375# bsd.wrapper.mk 375# bsd.wrapper.mk
376USE_TOOLS+= expr 376USE_TOOLS+= expr
377 377
378# bsd.bulk-pkg.mk uses certain tools 378# bsd.bulk-pkg.mk uses certain tools
379.if defined(BATCH) 379.if defined(BATCH)
380USE_TOOLS+= tee tsort 380USE_TOOLS+= tee tsort
381.endif 381.endif
382 382
383# INSTALL/DEINSTALL script framework 383# INSTALL/DEINSTALL script framework
384.include "pkginstall/bsd.pkginstall.mk" 384.include "pkginstall/bsd.pkginstall.mk"
385 385
386# Locking 386# Locking
387.include "internal/locking.mk" 387.include "internal/locking.mk"
388 388
389# Tools 389# Tools
390.include "tools/bsd.tools.mk" 390.include "tools/bsd.tools.mk"
391 391
392# Barrier 392# Barrier
393.include "bsd.pkg.barrier.mk" 393.include "bsd.pkg.barrier.mk"
394 394
395# Unprivileged builds 395# Unprivileged builds
396.include "unprivileged.mk" 396.include "unprivileged.mk"
397 397
398# If NO_BUILD is defined, default to not needing a compiler. 398# If NO_BUILD is defined, default to not needing a compiler.
399.if defined(NO_BUILD) 399.if defined(NO_BUILD)
400USE_LANGUAGES?= # empty 400USE_LANGUAGES?= # empty
401.endif 401.endif
402 402
403# Get the proper dependencies and set the PATH to use the compiler 403# Get the proper dependencies and set the PATH to use the compiler
404# named in PKGSRC_COMPILER. 404# named in PKGSRC_COMPILER.
405# 405#
406.include "compiler.mk" 406.include "compiler.mk"
407 407
408#Fake up a home directory 408#Fake up a home directory
409WRAPPER_TARGETS+= fake-home 409WRAPPER_TARGETS+= fake-home
410FAKEHOMEDIR= ${WRKDIR}/.home 410FAKEHOMEDIR= ${WRKDIR}/.home
411ALL_ENV+= HOME=${FAKEHOMEDIR} 411ALL_ENV+= HOME=${FAKEHOMEDIR}
412.PHONY: fake-home 412.PHONY: fake-home
413fake-home: ${FAKEHOMEDIR} 413fake-home: ${FAKEHOMEDIR}
414${FAKEHOMEDIR}: 414${FAKEHOMEDIR}:
415 ${RUN} ${MKDIR} ${.TARGET} 415 ${RUN} ${MKDIR} ${.TARGET}
416 416
417.include "wrapper/bsd.wrapper.mk" 417.include "wrapper/bsd.wrapper.mk"
418 418
419.if defined(ABI_DEPENDS) || defined(BUILD_ABI_DEPENDS) 419.if defined(ABI_DEPENDS) || defined(BUILD_ABI_DEPENDS)
420. if !empty(USE_ABI_DEPENDS:M[yY][eE][sS]) 420. if !empty(USE_ABI_DEPENDS:M[yY][eE][sS])
421DEPENDS+= ${ABI_DEPENDS} 421DEPENDS+= ${ABI_DEPENDS}
422BUILD_DEPENDS+= ${BUILD_ABI_DEPENDS} 422BUILD_DEPENDS+= ${BUILD_ABI_DEPENDS}
423. else 423. else
424_BUILD_DEFS+= USE_ABI_DEPENDS 424_BUILD_DEFS+= USE_ABI_DEPENDS
425. endif 425. endif
426.endif 426.endif
427 427
428# Find out the PREFIX of dependencies where the PREFIX is needed at build time. 428# Find out the PREFIX of dependencies where the PREFIX is needed at build time.
429.if defined(EVAL_PREFIX) 429.if defined(EVAL_PREFIX)
430FIND_PREFIX:= ${EVAL_PREFIX} 430FIND_PREFIX:= ${EVAL_PREFIX}
431. include "find-prefix.mk" 431. include "find-prefix.mk"
432.endif 432.endif
433 433
434.if !defined(_PATH_ORIG) 434.if !defined(_PATH_ORIG)
435_PATH_ORIG:= ${PATH} 435_PATH_ORIG:= ${PATH}
436MAKEFLAGS+= _PATH_ORIG=${_PATH_ORIG:Q} 436MAKEFLAGS+= _PATH_ORIG=${_PATH_ORIG:Q}
437.endif 437.endif
438 438
439.if !empty(PREPEND_PATH:M*) 439.if !empty(PREPEND_PATH:M*)
440# This is very Special. Because PREPEND_PATH is set with += in reverse order, 440# This is very Special. Because PREPEND_PATH is set with += in reverse order,
441# this command reverses the order again (since bootstrap bmake doesn't 441# this command reverses the order again (since bootstrap bmake doesn't
442# yet support the :[-1..1] construct). 442# yet support the :[-1..1] construct).
443_PATH_CMD= \ 443_PATH_CMD= \
444 path=${_PATH_ORIG:Q}; \ 444 path=${_PATH_ORIG:Q}; \
445 for i in ${PREPEND_PATH}; do path="$$i:$$path"; done; \ 445 for i in ${PREPEND_PATH}; do path="$$i:$$path"; done; \
446 ${ECHO} "$$path" 446 ${ECHO} "$$path"
447PATH= ${_PATH_CMD:sh} # DOES NOT use :=, to defer evaluation 447PATH= ${_PATH_CMD:sh} # DOES NOT use :=, to defer evaluation
448.endif 448.endif
449 449
450################################################################ 450################################################################
451# Many ways to disable a package. 451# Many ways to disable a package.
452# 452#
453# Ignore packages that can't be resold if building for a CDROM. 453# Ignore packages that can't be resold if building for a CDROM.
454# 454#
455# Don't build a package if it's restricted and we don't want to 455# Don't build a package if it's restricted and we don't want to
456# get into that. 456# get into that.
457# 457#
458# Don't build any package that utilizes strong cryptography, for 458# Don't build any package that utilizes strong cryptography, for
459# when the law of the land forbids it. 459# when the law of the land forbids it.
460# 460#
461# Don't attempt to build packages against X if we don't have X. 461# Don't attempt to build packages against X if we don't have X.
462# 462#
463# Don't build a package if it's broken. 463# Don't build a package if it's broken.
464################################################################ 464################################################################
465.if ${X11_TYPE} == "xorg" 465.if ${X11_TYPE} == "xorg"
466PKG_FAIL_REASON+= "Support for X11_TYPE=xorg was removed." 466PKG_FAIL_REASON+= "Support for X11_TYPE=xorg was removed."
467PKG_FAIL_REASON+= "Please switch to X11_TYPE=modular." 467PKG_FAIL_REASON+= "Please switch to X11_TYPE=modular."
468X11_TYPE:= native 468X11_TYPE:= native
469X11BASE:= /usr 469X11BASE:= /usr
470.endif 470.endif
471 471
472.if !defined(NO_SKIP) 472.if !defined(NO_SKIP)
473. if (defined(NO_BIN_ON_CDROM) && defined(FOR_CDROM)) 473. if (defined(NO_BIN_ON_CDROM) && defined(FOR_CDROM))
474PKG_FAIL_REASON+= "${PKGNAME} may not be placed in binary form on a CDROM:" \ 474PKG_FAIL_REASON+= "${PKGNAME} may not be placed in binary form on a CDROM:" \
475 " "${NO_BIN_ON_CDROM:Q} 475 " "${NO_BIN_ON_CDROM:Q}
476. endif 476. endif
477. if (defined(NO_SRC_ON_CDROM) && defined(FOR_CDROM)) 477. if (defined(NO_SRC_ON_CDROM) && defined(FOR_CDROM))
478PKG_FAIL_REASON+= "${PKGNAME} may not be placed in source form on a CDROM:" \ 478PKG_FAIL_REASON+= "${PKGNAME} may not be placed in source form on a CDROM:" \
479 " "${NO_SRC_ON_CDROM:Q} 479 " "${NO_SRC_ON_CDROM:Q}
480. endif 480. endif
481. if (defined(RESTRICTED) && defined(NO_RESTRICTED)) 481. if (defined(RESTRICTED) && defined(NO_RESTRICTED))
482PKG_FAIL_REASON+= "${PKGNAME} is restricted:" \ 482PKG_FAIL_REASON+= "${PKGNAME} is restricted:" \
483 " "${RESTRICTED:Q} 483 " "${RESTRICTED:Q}
484. endif 484. endif
485. if !(${MKCRYPTO} == "YES" || ${MKCRYPTO} == yes) 485. if !(${MKCRYPTO} == "YES" || ${MKCRYPTO} == yes)
486. if defined(CRYPTO) 486. if defined(CRYPTO)
487PKG_FAIL_REASON+= "${PKGNAME} may not be built, because it utilizes strong cryptography" 487PKG_FAIL_REASON+= "${PKGNAME} may not be built, because it utilizes strong cryptography"
488. endif 488. endif
489. endif 489. endif
490. if defined(USE_X11) && (${X11_TYPE} == "native") && !exists(${X11BASE}) 490. if defined(USE_X11) && (${X11_TYPE} == "native") && !exists(${X11BASE})
491PKG_FAIL_REASON+= "${PKGNAME} uses X11, but ${X11BASE} not found" 491PKG_FAIL_REASON+= "${PKGNAME} uses X11, but ${X11BASE} not found"
492. endif 492. endif
493. if defined(BROKEN) 493. if defined(BROKEN)
494PKG_FAIL_REASON+= "${PKGNAME} is marked as broken:" ${BROKEN:Q} 494PKG_FAIL_REASON+= "${PKGNAME} is marked as broken:" ${BROKEN:Q}
495. endif 495. endif
496 496
497.include "license.mk" 497.include "license.mk"
498 498
499# Define __PLATFORM_OK only if the OS matches the pkg's allowed list. 499# Define __PLATFORM_OK only if the OS matches the pkg's allowed list.
500. if defined(ONLY_FOR_PLATFORM) && !empty(ONLY_FOR_PLATFORM) 500. if defined(ONLY_FOR_PLATFORM) && !empty(ONLY_FOR_PLATFORM)
501. for __tmp__ in ${ONLY_FOR_PLATFORM} 501. for __tmp__ in ${ONLY_FOR_PLATFORM}
502. if ${MACHINE_PLATFORM:M${__tmp__}} != "" 502. if ${MACHINE_PLATFORM:M${__tmp__}} != ""
503__PLATFORM_OK?= yes 503__PLATFORM_OK?= yes
504. endif # MACHINE_PLATFORM 504. endif # MACHINE_PLATFORM
505. endfor # __tmp__ 505. endfor # __tmp__
506. else # !ONLY_FOR_PLATFORM 506. else # !ONLY_FOR_PLATFORM
507__PLATFORM_OK?= yes 507__PLATFORM_OK?= yes
508. endif # ONLY_FOR_PLATFORM 508. endif # ONLY_FOR_PLATFORM
509. for __tmp__ in ${NOT_FOR_PLATFORM} 509. for __tmp__ in ${NOT_FOR_PLATFORM}
510. if ${MACHINE_PLATFORM:M${__tmp__}} != "" 510. if ${MACHINE_PLATFORM:M${__tmp__}} != ""
511. undef __PLATFORM_OK 511. undef __PLATFORM_OK
512. endif # MACHINE_PLATFORM 512. endif # MACHINE_PLATFORM
513. endfor # __tmp__ 513. endfor # __tmp__
514. if !defined(__PLATFORM_OK) 514. if !defined(__PLATFORM_OK)
515PKG_FAIL_REASON+= "${PKGNAME} is not available for ${MACHINE_PLATFORM}" 515PKG_FAIL_REASON+= "${PKGNAME} is not available for ${MACHINE_PLATFORM}"
516. endif # !__PLATFORM_OK 516. endif # !__PLATFORM_OK
517.endif 517.endif
518 518
519# Add these defs to the ones dumped into +BUILD_DEFS 519# Add these defs to the ones dumped into +BUILD_DEFS
520_BUILD_DEFS+= PKGPATH 520_BUILD_DEFS+= PKGPATH
521_BUILD_DEFS+= OPSYS OS_VERSION MACHINE_ARCH MACHINE_GNU_ARCH 521_BUILD_DEFS+= OPSYS OS_VERSION MACHINE_ARCH MACHINE_GNU_ARCH
522_BUILD_DEFS+= ABI 522_BUILD_DEFS+= ABI
523_BUILD_DEFS+= CPPFLAGS CFLAGS FFLAGS LDFLAGS 523_BUILD_DEFS+= CPPFLAGS CFLAGS FFLAGS LDFLAGS
524_BUILD_DEFS+= OBJECT_FMT LICENSE RESTRICTED 524_BUILD_DEFS+= OBJECT_FMT LICENSE RESTRICTED
525_BUILD_DEFS+= NO_SRC_ON_FTP NO_SRC_ON_CDROM 525_BUILD_DEFS+= NO_SRC_ON_FTP NO_SRC_ON_CDROM
526_BUILD_DEFS+= NO_BIN_ON_FTP NO_BIN_ON_CDROM 526_BUILD_DEFS+= NO_BIN_ON_FTP NO_BIN_ON_CDROM
527 527
528.if defined(OSVERSION_SPECIFIC) 528.if defined(OSVERSION_SPECIFIC)
529_BUILD_DEFS+= OSVERSION_SPECIFIC 529_BUILD_DEFS+= OSVERSION_SPECIFIC
530DEPENDS+= osabi-${OPSYS}-${OS_VERSION}:../../pkgtools/osabi 530DEPENDS+= osabi-${OPSYS}-${OS_VERSION}:../../pkgtools/osabi
531.endif # OSVERSION_SPECIFIC 531.endif # OSVERSION_SPECIFIC
532 532
533.for _pkg_ in ${_BUILTIN_PKGS} 533.for _pkg_ in ${_BUILTIN_PKGS}
534. if defined(USE_BUILTIN.${_pkg_}) && \ 534. if defined(USE_BUILTIN.${_pkg_}) && \
535 !empty(USE_BUILTIN.${_pkg_}:M[yY][eE][sS]) && \ 535 !empty(USE_BUILTIN.${_pkg_}:M[yY][eE][sS]) && \
536 defined(BUILTIN_PKG.${_pkg_}) && !empty(BUILTIN_PKG.${_pkg_}) 536 defined(BUILTIN_PKG.${_pkg_}) && !empty(BUILTIN_PKG.${_pkg_})
537BUILTIN_PKGS+= ${BUILTIN_PKG.${_pkg_}} 537BUILTIN_PKGS+= ${BUILTIN_PKG.${_pkg_}}
538. endif 538. endif
539.endfor 539.endfor
540.if defined(BUILTIN_PKGS) 540.if defined(BUILTIN_PKGS)
541_BUILD_DEFS+= BUILTIN_PKGS 541_BUILD_DEFS+= BUILTIN_PKGS
542.endif 542.endif
543 543
544.if defined(GLIBC_VERSION) 544.if defined(GLIBC_VERSION)
545_BUILD_DEFS+= GLIBC_VERSION 545_BUILD_DEFS+= GLIBC_VERSION
546.endif # GLIBC_VERSION 546.endif # GLIBC_VERSION
547 547
548.PHONY: all 548.PHONY: all
549.if !target(all) 549.if !target(all)
550all: ${_PKGSRC_BUILD_TARGETS} 550all: ${_PKGSRC_BUILD_TARGETS}
551.endif 551.endif
552 552
553.PHONY: makedirs 553.PHONY: makedirs
554makedirs: ${WRKDIR} 554makedirs: ${WRKDIR}
555 555
556${WRKDIR}: 556${WRKDIR}:
557.if !defined(KEEP_WRKDIR) 557.if !defined(KEEP_WRKDIR)
558. if ${WRKDIR_LOCKTYPE} != "none" 558. if ${WRKDIR_LOCKTYPE} != "none"
559 ${RUN} ${TEST} -f ${_WRKDIR_LOCKFILE} || ${RM} -fr ${WRKDIR} 559 ${RUN} ${TEST} -f ${_WRKDIR_LOCKFILE} || ${RM} -fr ${WRKDIR}
560. endif 560. endif
561.endif 561.endif
562 ${RUN} umask 077 && ${MKDIR} ${WRKDIR} 562 ${RUN} umask 077 && ${MKDIR} ${WRKDIR}
563 563
564# Create a symlink from ${WRKDIR} to the package directory if 564# Create a symlink from ${WRKDIR} to the package directory if
565# CREATE_WRKDIR_SYMLINK is "yes". 565# CREATE_WRKDIR_SYMLINK is "yes".
566# 566#
567CREATE_WRKDIR_SYMLINK?= no 567CREATE_WRKDIR_SYMLINK?= no
568 568
569.if defined(WRKOBJDIR) && !empty(CREATE_WRKDIR_SYMLINK:M[Yy][Ee][Ss]) 569.if defined(WRKOBJDIR) && !empty(CREATE_WRKDIR_SYMLINK:M[Yy][Ee][Ss])
570makedirs: ${.CURDIR}/${WRKDIR_BASENAME} 570makedirs: ${.CURDIR}/${WRKDIR_BASENAME}
571${.CURDIR}/${WRKDIR_BASENAME}: 571${.CURDIR}/${WRKDIR_BASENAME}:
572. if ${WRKDIR_LOCKTYPE} != "none" 572. if ${WRKDIR_LOCKTYPE} != "none"
573 ${RUN} ${TEST} -f ${_WRKDIR_LOCKFILE} || ${RM} -f ${.TARGET} 573 ${RUN} ${TEST} -f ${_WRKDIR_LOCKFILE} || ${RM} -f ${.TARGET}
574. endif 574. endif
575 ${RUN} \ 575 ${RUN} \
576 if ${LN} -s ${WRKDIR} ${.TARGET} 2>/dev/null; then \ 576 if ${LN} -s ${WRKDIR} ${.TARGET} 2>/dev/null; then \
577 ${ECHO_MSG} "${.TARGET:T} -> ${WRKDIR}"; \ 577 ${ECHO_MSG} "${.TARGET:T} -> ${WRKDIR}"; \
578 fi 578 fi
579.endif 579.endif
580 580
581.include "pkgformat/bsd.pkgformat.mk" 581.include "pkgformat/bsd.pkgformat.mk"
582 582
583.include "depends/bsd.depends.mk" 583.include "depends/bsd.depends.mk"
584.include "check/bsd.check.mk" 584.include "check/bsd.check.mk"
585.include "fetch/bsd.fetch.mk" 585.include "fetch/bsd.fetch.mk"
586.include "checksum/bsd.checksum.mk" 586.include "checksum/bsd.checksum.mk"
587.include "extract/bsd.extract.mk" 587.include "extract/bsd.extract.mk"
588.include "patch/bsd.patch.mk" 588.include "patch/bsd.patch.mk"
589.include "configure/bsd.configure.mk" 589.include "configure/bsd.configure.mk"
590.include "build/bsd.build.mk" 590.include "build/bsd.build.mk"
591.include "install/bsd.install.mk" 591.include "install/bsd.install.mk"
592.include "package/bsd.package.mk" 592.include "package/bsd.package.mk"
593 593
594.include "bsd.pkg.clean.mk" 594.include "bsd.pkg.clean.mk"
595.include "bsd.pkg.update.mk" 595.include "bsd.pkg.update.mk"
596 596
597# su-target is a macro target that does just-in-time su-to-root before 597# su-target is a macro target that does just-in-time su-to-root before
598# reinvoking the make process as root. It acquires root privileges and 598# reinvoking the make process as root. It acquires root privileges and
599# invokes a new make process with the target named "su-${.TARGET}". 599# invokes a new make process with the target named "su-${.TARGET}".
600# 600#
601# MAKEFLAGS.su-${.TARGET} 601# MAKEFLAGS.su-${.TARGET}
602# The additional flags that are passed to the make process. 602# The additional flags that are passed to the make process.
603# 603#
604 604
605_ROOT_CMD= cd ${.CURDIR} && \ 605_ROOT_CMD= cd ${.CURDIR} && \
606 ${PKGSRC_SETENV} ${PKGSRC_MAKE_ENV} \ 606 ${PKGSRC_SETENV} ${PKGSRC_MAKE_ENV} \
607 PATH=${_PATH_ORIG:Q}:${SU_CMD_PATH_APPEND:Q} \ 607 PATH=${_PATH_ORIG:Q}:${SU_CMD_PATH_APPEND:Q} \
608 ${MAKE} ${MAKEFLAGS} _PKGSRC_BARRIER=yes \ 608 ${MAKE} ${MAKEFLAGS} _PKGSRC_BARRIER=yes \
609 PKG_DEBUG_LEVEL=${PKG_DEBUG_LEVEL:Q} \ 609 PKG_DEBUG_LEVEL=${PKG_DEBUG_LEVEL:Q} \
610 su-${.TARGET} ${MAKEFLAGS.su-${.TARGET}} 610 su-${.TARGET} ${MAKEFLAGS.su-${.TARGET}}
611 611
612.PHONY: su-target 612.PHONY: su-target
613su-target: .USE 613su-target: .USE
614 ${RUN} \ 614 ${RUN} \
615 case ${PRE_CMD.su-${.TARGET}:Q}"" in \ 615 case ${PRE_CMD.su-${.TARGET}:Q}"" in \
616 "") ;; \ 616 "") ;; \
617 *) ${PRE_CMD.su-${.TARGET}} ;; \ 617 *) ${PRE_CMD.su-${.TARGET}} ;; \
618 esac; \ 618 esac; \
619 if ${TEST} `${ID} -u` = `${ID} -u ${_SU_ROOT_USER}`; then \ 619 if ${TEST} `${ID} -u` = `${ID} -u ${_SU_ROOT_USER}`; then \
620 ${_ROOT_CMD}; \ 620 ${_ROOT_CMD}; \
621 else \ 621 else \
622 case ${PRE_ROOT_CMD:Q}"" in \ 622 case ${PRE_ROOT_CMD:Q}"" in \
623 ${TRUE:Q}"") ;; \ 623 ${TRUE:Q}"") ;; \
624 *) ${WARNING_MSG} "Running: "${PRE_ROOT_CMD:Q} ;; \ 624 *) ${WARNING_MSG} "Running: "${PRE_ROOT_CMD:Q} ;; \
625 esac; \ 625 esac; \
626 ${PRE_ROOT_CMD}; \ 626 ${PRE_ROOT_CMD}; \
627 ${STEP_MSG} "Becoming \`\`${_SU_ROOT_USER}'' to make su-${.TARGET} (`${ECHO} ${SU_CMD} | ${AWK} '{ print $$1 }'`)"; \ 627 ${STEP_MSG} "Becoming \`\`${_SU_ROOT_USER}'' to make su-${.TARGET} (`${ECHO} ${SU_CMD} | ${AWK} '{ print $$1 }'`)"; \
628 ${SU_CMD} ${_ROOT_CMD:Q}; \ 628 ${SU_CMD} ${_ROOT_CMD:Q}; \
629 ${STEP_MSG} "Dropping \`\`${_SU_ROOT_USER}'' privileges."; \ 629 ${STEP_MSG} "Dropping \`\`${_SU_ROOT_USER}'' privileges."; \
630 fi 630 fi
631 631
632################################################################ 632################################################################
633# Some more targets supplied for users' convenience 633# Some more targets supplied for users' convenience
634################################################################ 634################################################################
635 635
636# Run pkglint: 636# Run pkglint:
637.PHONY: lint 637.PHONY: lint
638lint: 638lint:
639 ${RUN} ${LOCALBASE}/bin/pkglint 639 ${RUN} ${LOCALBASE}/bin/pkglint
640 640
641# List of flags to pass to pkg_add(1) for bin-install: 641# List of flags to pass to pkg_add(1) for bin-install:
642 642
643BIN_INSTALL_FLAGS?= # -v 643BIN_INSTALL_FLAGS?= # -v
644.if ${PKG_INSTALLATION_TYPE} == "pkgviews" 644.if ${PKG_INSTALLATION_TYPE} == "pkgviews"
645PKG_ARGS_ADD= -W ${LOCALBASE} -w ${DEFAULT_VIEW} 645PKG_ARGS_ADD= -W ${LOCALBASE} -w ${DEFAULT_VIEW}
646.endif 646.endif
647_BIN_INSTALL_FLAGS= ${BIN_INSTALL_FLAGS} 647_BIN_INSTALL_FLAGS= ${BIN_INSTALL_FLAGS}
648.if defined(_AUTOMATIC) && !empty(_AUTOMATIC:M[Yy][Ee][Ss]) 648.if defined(_AUTOMATIC) && !empty(_AUTOMATIC:M[Yy][Ee][Ss])
649_BIN_INSTALL_FLAGS+= -A 649_BIN_INSTALL_FLAGS+= -A
650.endif 650.endif
651_BIN_INSTALL_FLAGS+= ${PKG_ARGS_ADD} 651_BIN_INSTALL_FLAGS+= ${PKG_ARGS_ADD}
652 652
653_SHORT_UNAME_R= ${:!${UNAME} -r!:C@\.([0-9]*)[_.-].*@.\1@} # n.n[_.]anything => n.n 653_SHORT_UNAME_R= ${:!${UNAME} -r!:C@\.([0-9]*)[_.-].*@.\1@} # n.n[_.]anything => n.n
654 654
655.include "install/bin-install.mk" 655.include "install/bin-install.mk"
656 656
657.PHONY: show-pkgtools-version 657.PHONY: show-pkgtools-version
658.if !target(show-pkgtools-version) 658.if !target(show-pkgtools-version)
659show-pkgtools-version: 659show-pkgtools-version:
660 @${ECHO} ${PKGTOOLS_VERSION} 660 @${ECHO} ${PKGTOOLS_VERSION}
661.endif 661.endif
662 662
663# convenience target, to display make variables from command line 663# convenience target, to display make variables from command line
664# i.e. "make show-var VARNAME=var", will print var's value 664# i.e. "make show-var VARNAME=var", will print var's value
665# 665#
666# See also: 666# See also:
667# show-vars, show-subdir-var 667# show-vars, show-subdir-var
668# 668#
669.PHONY: show-var 669.PHONY: show-var
670show-var: 670show-var:
671 @${ECHO} ${${VARNAME}:Q} 671 @${ECHO} ${${VARNAME}:Q}
672 672
673# enhanced version of target above, to display multiple variables 673# enhanced version of target above, to display multiple variables
674.PHONY: show-vars 674.PHONY: show-vars
675show-vars: 675show-vars:
676.for VARNAME in ${VARNAMES} 676.for VARNAME in ${VARNAMES}
677 @${ECHO} ${${VARNAME}:Q} 677 @${ECHO} ${${VARNAME}:Q}
678.endfor 678.endfor
679 679
680# displays multiple variables as shell expressions 680# displays multiple variables as shell expressions
681# VARS is space separated list of VARNAME:shellvarname 681# VARS is space separated list of VARNAME:shellvarname
682.PHONY: show-vars-eval 682.PHONY: show-vars-eval
683show-vars-eval: 683show-vars-eval:
684.for var in ${VARS} 684.for var in ${VARS}
685 @${ECHO} ${var:C/^.*://}="${${var:C/:.*$//}:Q}" 685 @${ECHO} ${var:C/^.*://}="${${var:C/:.*$//}:Q}"
686.endfor 686.endfor
687 687
688LICENSE_FILE?= ${PKGSRCDIR}/licenses/${LICENSE} 688LICENSE_FILE?= ${PKGSRCDIR}/licenses/${LICENSE}
689 689
690.if !target(show-license) 690.if !target(show-license)
691show-license show-licence: .PHONY 691show-license show-licence: .PHONY
692 @license=${LICENSE:Q}; \ 692 @license=${LICENSE:Q}; \
693 license_file=${LICENSE_FILE:Q}; \ 693 license_file=${LICENSE_FILE:Q}; \
694 pager=${PAGER:Q}; \ 694 pager=${PAGER:Q}; \
695 case "$$pager" in "") pager=${CAT:Q};; esac; \ 695 case "$$pager" in "") pager=${CAT:Q};; esac; \
696 case "$$license" in "") exit 0;; esac; \ 696 case "$$license" in "") exit 0;; esac; \
697 if ${TEST} -f "$$license_file"; then \ 697 if ${TEST} -f "$$license_file"; then \
698 $$pager "$$license_file"; \ 698 $$pager "$$license_file"; \
699 else \ 699 else \
700 ${ECHO} "Generic $$license information not available"; \ 700 ${ECHO} "Generic $$license information not available"; \
701 ${ECHO} "See the package description (pkg_info -d ${PKGNAME}) for more information."; \ 701 ${ECHO} "See the package description (pkg_info -d ${PKGNAME}) for more information."; \
702 fi 702 fi
703.endif 703.endif
704 704
705# This target is defined in bsd.options.mk for packages that use 705# This target is defined in bsd.options.mk for packages that use
706# the options framework. 706# the options framework.
707.if !target(show-options) 707.if !target(show-options)
708.PHONY: show-options 708.PHONY: show-options
709show-options: 709show-options:
710 @${ECHO} This package does not use the options framework. 710 @${ECHO} This package does not use the options framework.
711.endif 711.endif
712 712
713# Depend is generally meaningless for arbitrary packages, but if someone wants 713# Depend is generally meaningless for arbitrary packages, but if someone wants
714# one they can override this. This is just to catch people who've gotten into 714# one they can override this. This is just to catch people who've gotten into
715# the habit of typing `${MAKE} depend all install' as a matter of course. 715# the habit of typing `${MAKE} depend all install' as a matter of course.
716# 716#
717.PHONY: depend 717.PHONY: depend
718.if !target(depend) 718.if !target(depend)
719depend: 719depend:
720.endif 720.endif
721 721
722# Same goes for tags 722# Same goes for tags
723.PHONY: tags 723.PHONY: tags
724.if !target(tags) 724.if !target(tags)
725tags: 725tags:
726.endif 726.endif
727 727
728.include "plist/bsd.plist.mk" 728.include "plist/bsd.plist.mk"
729 729
730.include "bsd.utils.mk" 730.include "bsd.utils.mk"
731 731
732.include "subst.mk" 732.include "subst.mk"
733 733
734# 734#
735# For bulk build targets (bulk-install, bulk-package), the 735# For bulk build targets (bulk-install, bulk-package), the
736# BATCH variable must be set in /etc/mk.conf: 736# BATCH variable must be set in /etc/mk.conf:
737# 737#
738.if defined(BATCH) 738.if defined(BATCH)
739. include "bulk/bsd.bulk-pkg.mk" 739. include "bulk/bsd.bulk-pkg.mk"
740.endif 740.endif
741 741
742# README generation code. 742# README generation code.
743.include "bsd.pkg.readme.mk" 743.include "bsd.pkg.readme.mk"
744 744
745# Create a PKG_ERROR_HANDLER shell command for each class listed in 745# Create a PKG_ERROR_HANDLER shell command for each class listed in
746# PKG_ERROR_CLASSES. The error handler is meant to be invoked within 746# PKG_ERROR_CLASSES. The error handler is meant to be invoked within
747# a make target. 747# a make target.
748# 748#
749.for _class_ in ${PKG_ERROR_CLASSES} 749.for _class_ in ${PKG_ERROR_CLASSES}
750PKG_ERROR_HANDLER.${_class_}?= { \ 750PKG_ERROR_HANDLER.${_class_}?= { \
751 ec=$$?; \ 751 ec=$$?; \
752 for str in ${PKG_ERROR_MSG.${_class_}}; do \ 752 for str in ${PKG_ERROR_MSG.${_class_}}; do \
753 ${PHASE_MSG} "$$str"; \ 753 ${PHASE_MSG} "$$str"; \
754 done; \ 754 done; \
755 exit $$ec; \ 755 exit $$ec; \
756 } 756 }
757.endfor 757.endfor
758 758
759# Cache variables listed in MAKEVARS in a phase-specific "makevars.mk" 759# Cache variables listed in MAKEVARS in a phase-specific "makevars.mk"
760# file. These variables are effectively passed to sub-make processes 760# file. These variables are effectively passed to sub-make processes
761# that are invoked on the same Makefile. 761# that are invoked on the same Makefile.
762# 762#
763.for _phase_ in ${_ALL_PHASES} 763.for _phase_ in ${_ALL_PHASES}
764${_MAKEVARS_MK.${_phase_}}: ${WRKDIR} 764${_MAKEVARS_MK.${_phase_}}: ${WRKDIR}
765 ${RUN}${RM} -f ${.TARGET}.tmp 765 ${RUN}${RM} -f ${.TARGET}.tmp
766. for _var_ in ${MAKEVARS:O:u} 766. for _var_ in ${MAKEVARS:O:u}
767. if defined(${_var_}) 767. if defined(${_var_})
768 ${RUN} \ 768 ${RUN} \
769 ${ECHO} ${_var_}"= "${${_var_}:Q} >> ${.TARGET}.tmp 769 ${ECHO} ${_var_}"= "${${_var_}:Q} >> ${.TARGET}.tmp
770. endif 770. endif
771. endfor 771. endfor
772 ${RUN} \ 772 ${RUN} \
773 if ${TEST} -f ${.TARGET}.tmp; then \ 773 if ${TEST} -f ${.TARGET}.tmp; then \
774 ( ${ECHO} ".if !defined(_MAKEVARS_MK)"; \ 774 ( ${ECHO} ".if !defined(_MAKEVARS_MK)"; \
775 ${ECHO} "_MAKEVARS_MK= defined"; \ 775 ${ECHO} "_MAKEVARS_MK= defined"; \
776 ${ECHO} ""; \ 776 ${ECHO} ""; \
777 ${CAT} ${.TARGET}.tmp; \ 777 ${CAT} ${.TARGET}.tmp; \
778 ${ECHO} ""; \ 778 ${ECHO} ""; \
779 ${ECHO} ".endif # _MAKEVARS_MK"; \ 779 ${ECHO} ".endif # _MAKEVARS_MK"; \
780 ) > ${.TARGET}; \ 780 ) > ${.TARGET}; \
781 ${RM} -f ${.TARGET}.tmp; \ 781 ${RM} -f ${.TARGET}.tmp; \
782 fi 782 fi
783 ${RUN}${TOUCH} ${TOUCH_FLAGS} ${.TARGET} 783 ${RUN}${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
784.endfor 784.endfor
785 785
786.if make(pbulk-index) || make(pbulk-index-item) || make(pbulk-save-wrkdir) 786.if make(pbulk-index) || make(pbulk-index-item) || make(pbulk-save-wrkdir)
787.include "pbulk/pbulk-index.mk" 787.include "pbulk/pbulk-index.mk"
788.endif 788.endif
789 789
790.if ${OPSYS} == "Cygwin" && defined(UAC_REQD_EXECS) && !empty(UAC_REQD_EXECS) 790.if defined(_OPSYS_REQUIRE_UAC_MANIFEST) && !empty(_OPSYS_REQUIRE_UAC_MANIFEST:M[Yy][Ee][Ss])
791. include "misc/uac-manifest.mk" 791. if defined(UAC_REQD_EXECS) && !empty(UAC_REQD_EXECS)
 792.include "misc/uac-manifest.mk"
 793. endif
792.endif 794.endif
793 795
794.if defined(PKG_DEVELOPER) && ${PKG_DEVELOPER} != "no" 796.if defined(PKG_DEVELOPER) && ${PKG_DEVELOPER} != "no"
795. include "misc/developer.mk" 797. include "misc/developer.mk"
796.endif 798.endif
797.include "misc/show.mk" 799.include "misc/show.mk"
798.if make(debug) 800.if make(debug)
799. include "bsd.pkg.debug.mk" 801. include "bsd.pkg.debug.mk"
800.endif 802.endif
801.include "misc/warnings.mk" 803.include "misc/warnings.mk"
802.if make(import) 804.if make(import)
803.include "misc/import.mk" 805.include "misc/import.mk"
804.endif 806.endif
805.include "misc/can-be-built-here.mk" 807.include "misc/can-be-built-here.mk"

cvs diff -r1.1 -r1.2 pkgsrc/mk/platform/Cygwin.mk (switch to unified diff)

--- pkgsrc/mk/platform/Cygwin.mk 2013/02/10 12:25:18 1.1
+++ pkgsrc/mk/platform/Cygwin.mk 2013/02/15 09:22:50 1.2
@@ -1,89 +1,95 @@ @@ -1,89 +1,95 @@
1# $NetBSD: Cygwin.mk,v 1.1 2013/02/10 12:25:18 obache Exp $ 1# $NetBSD: Cygwin.mk,v 1.2 2013/02/15 09:22:50 obache Exp $
2# 2#
3# Variable definitions for the Windows with Cygwin. 3# Variable definitions for the Windows with Cygwin.
4 4
5### 5###
6### Overrides to standard BSD .mk files 6### Overrides to standard BSD .mk files
7### 7###
8 8
9# "catinstall" not yet supported as there's no shipped [gn]roff 9# "catinstall" not yet supported as there's no shipped [gn]roff
10MANINSTALL= maninstall 10MANINSTALL= maninstall
11MAKE_FLAGS+= MKCATPAGES=no NOLINT=1 11MAKE_FLAGS+= MKCATPAGES=no NOLINT=1
12 12
13### 13###
14### Alternate defaults to global pkgsrc settings, to help avoid 14### Alternate defaults to global pkgsrc settings, to help avoid
15### some of the excessive Interix fork(2) overhead, and reduce the 15### some of the excessive Interix fork(2) overhead, and reduce the
16### amount of settings required in the user's mk.conf 16### amount of settings required in the user's mk.conf
17### 17###
18 18
19INSTALL?= ${PREFIX}/bin/install-sh 19INSTALL?= ${PREFIX}/bin/install-sh
20PAX?= ${PREFIX}/bin/nbpax 20PAX?= ${PREFIX}/bin/nbpax
21 21
22.if defined(BATCH) 22.if defined(BATCH)
23BULK_PREREQ+= lang/perl5 23BULK_PREREQ+= lang/perl5
24USE_BULK_BROKEN_CHECK?= no 24USE_BULK_BROKEN_CHECK?= no
25USE_BULK_TIMESTAMPS?= no 25USE_BULK_TIMESTAMPS?= no
26.endif 26.endif
27 27
28### 28###
29### Platform definitions common to pkgsrc/mk/platform/*.mk 29### Platform definitions common to pkgsrc/mk/platform/*.mk
30### 30###
31 31
32ECHO_N?= ${ECHO} -n 32ECHO_N?= ${ECHO} -n
33IMAKE_MAKE?= ${GMAKE} # program which gets invoked by imake 33IMAKE_MAKE?= ${GMAKE} # program which gets invoked by imake
34IMAKEOPTS+= -DBuildHtmlManPages=NO 34IMAKEOPTS+= -DBuildHtmlManPages=NO
35PKGLOCALEDIR?= share 35PKGLOCALEDIR?= share
36PS?= /bin/ps 36PS?= /bin/ps
37SU?= /bin/su 37SU?= /bin/su
38TYPE?= type # Shell builtin 38TYPE?= type # Shell builtin
39 39
40USERADD?= ${LOCALBASE}/sbin/useradd 40USERADD?= ${LOCALBASE}/sbin/useradd
41GROUPADD?= ${LOCALBASE}/sbin/groupadd 41GROUPADD?= ${LOCALBASE}/sbin/groupadd
42_PKG_USER_HOME?= # empty by default 42_PKG_USER_HOME?= # empty by default
43_USER_DEPENDS= user>=20040426:../../sysutils/user_interix 43_USER_DEPENDS= user>=20040426:../../sysutils/user_interix
44 44
45CPP_PRECOMP_FLAGS?= # unset 45CPP_PRECOMP_FLAGS?= # unset
46CONFIG_RPATH_OVERRIDE?= config.rpath */config.rpath */*/config.rpath 46CONFIG_RPATH_OVERRIDE?= config.rpath */config.rpath */*/config.rpath
47DEF_UMASK?= 002 47DEF_UMASK?= 002
48EXPORT_SYMBOLS_LDFLAGS?=-Wl,-E # add symbols to the dynamic symbol table 48EXPORT_SYMBOLS_LDFLAGS?=-Wl,-E # add symbols to the dynamic symbol table
49 49
50MOTIF_TYPE_DEFAULT?= motif # default 2.0 compatible libs type 50MOTIF_TYPE_DEFAULT?= motif # default 2.0 compatible libs type
51NOLOGIN?= /bin/false 51NOLOGIN?= /bin/false
52PKG_TOOLS_BIN?= ${LOCALBASE}/sbin 52PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
53PKGDIRMODE?= 775 53PKGDIRMODE?= 775
54# ROOT_USER might be numeric in the special case of Administrator; canonify it: 54# ROOT_USER might be numeric in the special case of Administrator; canonify it:
55ROOT_CMD?= ${SU} - "$$(id -un ${ROOT_USER})" -c 55ROOT_CMD?= ${SU} - "$$(id -un ${ROOT_USER})" -c
56ROOT_USER?= ${BINOWN} 56ROOT_USER?= ${BINOWN}
57ROOT_GROUP?= id -g Administraotr 57ROOT_GROUP?= id -g Administraotr
58TOUCH_FLAGS?= 58TOUCH_FLAGS?=
59ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d` 59ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
60ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s` 60ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
61ULIMIT_CMD_memorysize?= ulimit -v `ulimit -H -v` 61ULIMIT_CMD_memorysize?= ulimit -v `ulimit -H -v`
62 62
63_OPSYS_HAS_INET6= yes # IPv6 is standard 63_OPSYS_HAS_INET6= yes # IPv6 is standard
64_OPSYS_HAS_JAVA= no # Java is not standard 64_OPSYS_HAS_JAVA= no # Java is not standard
65_OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages 65_OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
66_OPSYS_HAS_OSSAUDIO= no # libossaudio is available 66_OPSYS_HAS_OSSAUDIO= no # libossaudio is available
67_OPSYS_PERL_REQD= 5.8.3nb1 # base version of perl required 67_OPSYS_PERL_REQD= 5.8.3nb1 # base version of perl required
68_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads 68_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
69_OPSYS_SHLIB_TYPE= PEwin # shared lib type 69_OPSYS_SHLIB_TYPE= PEwin # shared lib type
70_PATCH_CAN_BACKUP= yes # native patch(1) can make backups 70_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
71_PATCH_BACKUP_ARG?= -b -V simple -z # switch to patch(1) for backup suffix 71_PATCH_BACKUP_ARG?= -b -V simple -z # switch to patch(1) for backup suffix
72_USE_RPATH= no # add rpath to LDFLAGS 72_USE_RPATH= no # add rpath to LDFLAGS
73 73
74# flags passed to the linker to extract all symbols from static archives. 74# flags passed to the linker to extract all symbols from static archives.
75# this is GNU ld. 75# this is GNU ld.
76_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive 76_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive
77_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive 77_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive
78 78
79_STRIPFLAG_CC?= ${_INSTALL_UNSTRIPPED:D:U-s} # cc(1) option to strip 79_STRIPFLAG_CC?= ${_INSTALL_UNSTRIPPED:D:U-s} # cc(1) option to strip
80_STRIPFLAG_INSTALL?= ${_INSTALL_UNSTRIPPED:D:U-s} # install(1) option to strip 80_STRIPFLAG_INSTALL?= ${_INSTALL_UNSTRIPPED:D:U-s} # install(1) option to strip
81 81
82DEFAULT_SERIAL_DEVICE?= /dev/ttyS0 82DEFAULT_SERIAL_DEVICE?= /dev/ttyS0
83SERIAL_DEVICES?= /dev/ttyS0 /dev/ttyS1 /dev/ttyS2 /dev/ttyS3 83SERIAL_DEVICES?= /dev/ttyS0 /dev/ttyS1 /dev/ttyS2 /dev/ttyS3
84 84
85_OPSYS_CAN_CHECK_SHLIBS= no # can't use readelf in check/bsd.check-vars.mk 85_OPSYS_CAN_CHECK_SHLIBS= no # can't use readelf in check/bsd.check-vars.mk
86 86
87# check for maximum command line length and set it in configure's environment, 87# check for maximum command line length and set it in configure's environment,
88# to avoid a test required by the libtool script that takes forever. 88# to avoid a test required by the libtool script that takes forever.
89_OPSYS_MAX_CMDLEN_CMD= ${ECHO} 262144 89_OPSYS_MAX_CMDLEN_CMD= ${ECHO} 262144
 90
 91# check for requirement of uac-manifest.
 92.if !empty(OS_VARIANT:MCYGWIN_NT-[6-9].*)
 93_OPSYS_REQUIRE_UAC_MANIFEST= yes
 94.endif
 95