Annotation of pkgsrc/mk/bsd.prefs.mk, Revision 1.284
1.284 ! joerg 1: # $NetBSD: bsd.prefs.mk,v 1.283 2008/05/24 03:40:35 tnn Exp $
1.263 rillig 2: #
3: # This file includes the mk.conf file, which contains the user settings.
4: #
5: # Packages should include this file before any of the .if directives, as
6: # well as before modifying variables like CFLAGS, LDFLAGS, and so on.
7: # Otherwise the behavior may be unexpected.
8: #
9: # When mk.conf is included by this file, the following variables are
10: # defined:
11: #
12: # ACCEPTABLE_LICENSES
13: # This variable is set to the list of Open Source licenses. See
14: # mk/license.mk for details.
15: #
16: # MACHINE_PLATFORM
17: # The platform for which the packages are built. It has the form
18: # ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}.
19: #
20: # NATIVE_MACHINE_PLATFORM
21: # The platform on which the packages are built. This is usually
22: # the same as ${MACHINE_PLATFORM}, but can be different when
23: # cross-building packages.
24: #
25: # PKGPATH
26: # The path of the package, relative to the pkgsrc top-level
27: # directory. Typical values look like editors/emacs or
28: # misc/openoffice-bin.
29: #
30: # Keywords: mk.conf user
1.1 agc 31: #
1.199 wiz 32:
1.192 rillig 33: .if !defined(BSD_PKG_MK)
1.5 tv 34:
1.7 tv 35: # Let mk.conf know that this is pkgsrc.
1.104 jlam 36: BSD_PKG_MK=1
1.7 tv 37: __PREFIX_SET__:=${PREFIX}
1.1 agc 38:
1.216 abs 39: # Set PATH if not already set
40: .if !defined(PATH)
41: PATH=/bin:/usr/bin:/sbin:/usr/sbin
42: .endif
43:
1.149 jlam 44: # Expand MAKE to a full path.
45: .if !defined(_MAKE)
46: _MAKE:= ${MAKE}
1.262 rillig 47: # allow for MAKE=./make and similar.
48: . if empty(_MAKE:M/*) && !empty(_MAKE:M*/*) && defined(PWD) && exists(${PWD}/${MAKE})
49: _MAKE:= ${PWD}/${MAKE}
50: . endif
1.149 jlam 51: . for _dir_ in ${PATH:C/\:/ /g}
52: . if empty(_MAKE:M/*)
53: . if exists(${_dir_}/${MAKE})
54: _MAKE:= ${_dir_}/${MAKE}
55: . endif
56: . endif
57: . endfor
58: . if !empty(_MAKE:M/*)
1.150 jlam 59: MAKEFLAGS+= _MAKE=${_MAKE:Q}
1.149 jlam 60: . endif
61: .endif
62: MAKE:= ${_MAKE}
63:
1.9 christos 64: .if exists(/usr/bin/uname)
65: UNAME=/usr/bin/uname
66: .elif exists(/bin/uname)
67: UNAME=/bin/uname
68: .else
69: UNAME=echo Unknown
70: .endif
71:
1.192 rillig 72: .if !defined(OPSYS)
1.249 joerg 73: OPSYS:= ${:!${UNAME} -s!:S/-//g:S/\///g}
1.215 rillig 74: MAKEFLAGS+= OPSYS=${OPSYS:Q}
1.17 mycroft 75: .endif
1.203 tv 76:
77: # The _CMD indirection allows code below to modify these values
78: # without executing the commands at all. Later, recursed make
79: # invocations will skip these blocks entirely thanks to MAKEFLAGS.
1.192 rillig 80: .if !defined(OS_VERSION)
1.203 tv 81: _OS_VERSION_CMD= ${UNAME} -r
82: OS_VERSION= ${_OS_VERSION_CMD:sh}
1.215 rillig 83: MAKEFLAGS+= OS_VERSION=${OS_VERSION:Q}
1.66 abs 84: .endif
1.1 agc 85:
1.201 tv 86: # Preload these for architectures not in all variations of bsd.own.mk,
87: # which do not match their GNU names exactly.
1.70 fredb 88: GNU_ARCH.arm26?= arm
1.7 tv 89: GNU_ARCH.arm32?= arm
1.12 christos 90: GNU_ARCH.i486?= i386
91: GNU_ARCH.i586?= i386
92: GNU_ARCH.i686?= i386
1.70 fredb 93: GNU_ARCH.m68000?= m68010
1.7 tv 94: GNU_ARCH.mips?= mipsel
1.70 fredb 95: GNU_ARCH.sh3eb?= sh
96: GNU_ARCH.sh3el?= shle
1.260 joerg 97: NATIVE_MACHINE_GNU_ARCH?= ${GNU_ARCH.${NATIVE_MACHINE_ARCH}:U${NATIVE_MACHINE_ARCH}}
98: MACHINE_GNU_ARCH?= ${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
1.3 tv 99:
1.10 agc 100: .if ${OPSYS} == "NetBSD"
101: LOWER_OPSYS?= netbsd
1.135 reed 102:
1.202 tv 103: .elif ${OPSYS} == "AIX"
104: LOWER_ARCH!= _cpuid=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $$1 }'`; \
105: if /usr/sbin/lsattr -El $$_cpuid | grep ' POWER' >/dev/null 2>&1; then \
106: echo rs6000; \
107: else \
108: echo powerpc; \
109: fi
110: MACHINE_ARCH?= ${LOWER_ARCH}
111: . if exists(/usr/bin/oslevel)
112: _OS_VERSION!= /usr/bin/oslevel
113: . else
114: _OS_VERSION!= echo `${UNAME} -v`.`${UNAME} -r`
115: . endif
1.258 joerg 116: OS_VERSION= ${_OS_VERSION:C/\([0-9]*\.[0-9]*\).*/\1/}
1.202 tv 117: LOWER_OPSYS_VERSUFFIX= ${_OS_VERSION}
118: LOWER_OPSYS?= aix
119: LOWER_VENDOR?= ibm
120:
1.135 reed 121: .elif ${OPSYS} == "BSDOS"
122: LOWER_OPSYS?= bsdi
1.90 grant 123:
1.202 tv 124: .elif ${OPSYS} == "Darwin"
125: LOWER_OPSYS?= darwin
126: LOWER_ARCH!= ${UNAME} -p
127: MACHINE_ARCH= ${LOWER_ARCH}
1.215 rillig 128: MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
1.257 joerg 129: LOWER_OPSYS_VERSUFFIX= ${LOWER_OS_VERSION:C/([0-9]*).*/\1/}
1.202 tv 130: LOWER_VENDOR?= apple
131:
132: .elif ${OPSYS} == "DragonFly"
1.218 joerg 133: OS_VERSION:= ${OS_VERSION:C/-.*$//}
1.202 tv 134: LOWER_OPSYS?= dragonfly
135: LOWER_ARCH!= ${UNAME} -p
136: MACHINE_ARCH= ${LOWER_ARCH}
1.215 rillig 137: MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
1.202 tv 138: LOWER_VENDOR?= pc
139:
1.90 grant 140: .elif ${OPSYS} == "FreeBSD"
1.252 joerg 141: OS_VERSION:= ${OS_VERSION:C/-.*$//}
1.90 grant 142: LOWER_OPSYS?= freebsd
143: LOWER_ARCH!= ${UNAME} -p
1.244 tonio 144: . if ${LOWER_ARCH} == "amd64"
145: MACHINE_ARCH= x86_64
146: . else
1.90 grant 147: MACHINE_ARCH= ${LOWER_ARCH}
1.244 tonio 148: . endif
1.215 rillig 149: MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
1.257 joerg 150: LOWER_OPSYS_VERSUFFIX= ${LOWER_OS_VERSION:C/([0-9]*).*/\1/}
1.91 grant 151: . if ${LOWER_ARCH} == "i386"
1.90 grant 152: LOWER_VENDOR?= pc
1.203 tv 153: . endif
1.91 grant 154: LOWER_VENDOR?= unknown
1.58 abs 155:
1.202 tv 156: .elif ${OPSYS} == "Interix"
1.272 tnn 157: LOWER_OPSYS?= interix
158: LOWER_OPSYS_VERSUFFIX?= 3
1.176 wiz 159: LOWER_VENDOR?= pc
1.203 tv 160: . if exists(/usr/lib/libc.so.3.5)
161: OS_VERSION= 3.5
162: . elif exists(/usr/lib/libc.so.3.1)
163: OS_VERSION= 3.1
164: . else
165: OS_VERSION= 3.0
166: . endif
1.176 wiz 167:
1.202 tv 168: .elif !empty(OPSYS:MIRIX*)
1.112 grant 169: LOWER_ARCH!= ${UNAME} -p
1.272 tnn 170: LOWER_OPSYS?= irix
171: LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION}
1.202 tv 172: LOWER_VENDOR?= sgi
1.58 abs 173:
1.10 agc 174: .elif ${OPSYS} == "Linux"
1.270 joerg 175: OS_VERSION:= ${OS_VERSION:C/-.*$//}
1.10 agc 176: LOWER_OPSYS?= linux
1.100 jschauma 177: MACHINE_ARCH:= ${MACHINE_ARCH:C/i.86/i386/}
1.174 ben 178: MACHINE_ARCH:= ${MACHINE_ARCH:C/ppc/powerpc/}
1.102 jschauma 179: . if !defined(LOWER_ARCH)
1.175 martti 180: LOWER_ARCH!= ${UNAME} -m | sed -e 's/i.86/i386/' -e 's/ppc/powerpc/'
1.102 jschauma 181: . endif # !defined(LOWER_ARCH)
1.275 joerg 182: . if ${LOWER_ARCH} == "x86_64"
183: MACHINE_ARCH= x86_64
184: . endif
1.115 abs 185: . if ${MACHINE_ARCH} == "unknown" || ${MACHINE_ARCH} == ""
1.35 abs 186: MACHINE_ARCH= ${LOWER_ARCH}
1.215 rillig 187: MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
1.106 jschauma 188: . endif
189: . if exists(/etc/debian_version)
190: LOWER_VENDOR?= debian
191: . elif exists(/etc/mandrake-release)
192: LOWER_VENDOR?= mandrake
193: . elif exists(/etc/redhat-version)
194: LOWER_VENDOR?= redhat
195: . elif exists(/etc/slackware-version)
196: LOWER_VENDOR?= slackware
197: . elif ${LOWER_ARCH} == "i386"
198: LOWER_VENDOR?= pc
1.203 tv 199: . endif
1.106 jschauma 200: LOWER_VENDOR?= unknown
1.12 christos 201:
1.177 grant 202: .elif ${OPSYS} == "OSF1"
203: LOWER_ARCH!= ${UNAME} -p
1.215 rillig 204: MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
1.177 grant 205: MACHINE_ARCH?= ${LOWER_ARCH}
1.203 tv 206: OS_VERSION:= ${OS_VERSION:C/^V//}
1.271 tnn 207: LOWER_OPSYS?= osf1
208: LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION}
1.177 grant 209: LOWER_VENDOR?= dec
210:
1.247 tnn 211: .elif ${OPSYS} == "HPUX"
212: OS_VERSION:= ${OS_VERSION:C/^B.//}
213: .if ${MACHINE_ARCH} == "9000"
214: MACHINE_ARCH= hppa
215: .endif
1.271 tnn 216: LOWER_OPSYS?= hpux
217: LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION}
218: LOWER_VENDOR?= hp
1.247 tnn 219:
1.202 tv 220: .elif ${OPSYS} == "SunOS"
221: . if ${MACHINE_ARCH} == "sparc"
222: SPARC_TARGET_ARCH?= sparcv7
223: . elif ${MACHINE_ARCH} == "sun4"
224: MACHINE_ARCH= sparc
225: SPARC_TARGET_ARCH?= sparcv7
1.278 tnn 226: . elif ${MACHINE_ARCH} == "i86pc" || ${MACHINE_ARCH} == "i86xpv"
1.202 tv 227: MACHINE_ARCH= i386
228: . elif ${MACHINE_ARCH} == "unknown"
229: . if !defined(LOWER_ARCH)
230: LOWER_ARCH!= ${UNAME} -p
231: . endif # !defined(LOWER_ARCH)
1.215 rillig 232: MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
1.181 grant 233: . endif
1.202 tv 234: LOWER_VENDOR?= sun
235: LOWER_OPSYS?= solaris
236: LOWER_OPSYS_VERSUFFIX= 2
1.181 grant 237:
1.10 agc 238: .elif !defined(LOWER_OPSYS)
1.277 tnn 239: LOWER_OPSYS:= ${OPSYS:tl}
1.17 mycroft 240: .endif
1.58 abs 241:
1.203 tv 242: # Now commit the [LOWER_]OS_VERSION values computed above, eliding the :sh
243: OS_VERSION:= ${OS_VERSION}
1.277 tnn 244: LOWER_OS_VERSION:= ${OS_VERSION:tl}
1.203 tv 245:
1.215 rillig 246: MAKEFLAGS+= LOWER_OPSYS=${LOWER_OPSYS:Q}
1.7 tv 247:
1.260 joerg 248: LOWER_VENDOR?= # empty ("arch--opsys")
249: LOWER_ARCH?= ${MACHINE_GNU_ARCH}
250: # Expand now as MACHINE_ARCH can be overriden in mk.conf and
251: # LOWER_ARCH is typically derived from it.
252: NATIVE_LOWER_ARCH:= ${LOWER_ARCH}
253: NATIVE_MACHINE_ARCH:= ${MACHINE_ARCH}
254:
255: NATIVE_MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${NATIVE_MACHINE_ARCH}
256: MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}
1.271 tnn 257: NATIVE_MACHINE_GNU_PLATFORM?= ${NATIVE_LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
258: MACHINE_GNU_PLATFORM?= ${LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
1.59 agc 259:
1.152 grant 260: # Needed to prevent an "install:" target from being created in bsd.own.mk.
1.60 tron 261: NEED_OWN_INSTALL_TARGET=no
1.65 tv 262:
263: # This prevents default use of the cross-tool harness in the "src" tree,
264: # in the odd possible case of someone extracting "pkgsrc" underneath "src".
265: USETOOLS= no
266: MAKE_ENV+= USETOOLS=no
1.71 schmonz 267:
268: # Set this before <bsd.own.mk> does, since it doesn't know about Darwin
269: .if ${OPSYS} == "Darwin"
270: OBJECT_FMT?= Mach-O
271: .endif
1.60 tron 272:
1.273 rillig 273: ACCEPTABLE_LICENSES?= ${DEFAULT_ACCEPTABLE_LICENSES}
1.263 rillig 274:
1.259 joerg 275: # Provide PKGPATH early on so that mk.conf can use it.
276: PKGPATH?= ${.CURDIR:C|.*/([^/]*/[^/]*)$|\1|}
277:
1.205 rillig 278: # Load the settings from MAKECONF, which is /etc/mk.conf by default.
1.73 jlam 279: .include <bsd.own.mk>
280:
1.72 jlam 281: # /usr/share/mk/bsd.own.mk on NetBSD 1.3 does not define OBJECT_FMT
1.134 grant 282: .if !empty(MACHINE_PLATFORM:MNetBSD-1.3*)
1.126 grant 283: . if ${MACHINE_ARCH} == "alpha" || \
284: ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
285: ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64"
1.72 jlam 286: OBJECT_FMT?= ELF
1.126 grant 287: . else
1.72 jlam 288: OBJECT_FMT?= a.out
1.134 grant 289: . endif
290: # override what bootstrap-pkgsrc sets, which isn't right for NetBSD
291: # 1.4.
292: # XXX other ELF platforms in 1.4 need to be added to here.
293: .elif !empty(MACHINE_PLATFORM:MNetBSD-1.4*)
294: . if ${MACHINE_ARCH} == "alpha" || \
295: ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
296: ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64"
297: OBJECT_FMT= ELF
298: . else
299: OBJECT_FMT= a.out
1.127 itojun 300: . endif
301: .endif
302:
303: .if ${OPSYS} == "OpenBSD"
304: . if defined(ELF_TOOLCHAIN) && ${ELF_TOOLCHAIN} == "yes"
305: OBJECT_FMT?= ELF
306: . else
307: OBJECT_FMT?= a.out
1.126 grant 308: . endif
1.182 grant 309: .elif ${OPSYS} == "DragonFly"
310: OBJECT_FMT= ELF
311: .elif ${OPSYS} == "AIX"
312: OBJECT_FMT= XCOFF
1.246 tnn 313: .elif ${OPSYS} == "OSF1"
314: OBJECT_FMT= ECOFF
1.247 tnn 315: .elif ${OPSYS} == "HPUX"
316: . if ${MACHINE_ARCH} == "ia64" || (defined(ABI) && ${ABI} == "64")
317: OBJECT_FMT= ELF
318: . else
319: OBJECT_FMT= SOM
320: . endif
1.176 wiz 321: .endif
322:
1.167 jlam 323: # Calculate depth
1.170 jlam 324: .if exists(${.CURDIR}/mk/bsd.pkg.mk)
1.171 jlam 325: _PKGSRC_TOPDIR= ${.CURDIR}
1.167 jlam 326: .elif exists(${.CURDIR}/../mk/bsd.pkg.mk)
1.171 jlam 327: _PKGSRC_TOPDIR= ${.CURDIR}/..
1.170 jlam 328: .elif exists(${.CURDIR}/../../mk/bsd.pkg.mk)
1.171 jlam 329: _PKGSRC_TOPDIR= ${.CURDIR}/../..
1.167 jlam 330: .endif
331:
1.59 agc 332: # include the defaults file
1.263 rillig 333: .include "${_PKGSRC_TOPDIR}/mk/defaults/mk.conf"
1.70 fredb 334:
1.7 tv 335: SHAREOWN?= ${DOCOWN}
336: SHAREGRP?= ${DOCGRP}
337: SHAREMODE?= ${DOCMODE}
1.1 agc 338:
1.3 tv 339: .if defined(PREFIX) && (${PREFIX} != ${__PREFIX_SET__})
1.2 tv 340: .BEGIN:
1.233 schwarz 341: @${ECHO_MSG} "You CANNOT set PREFIX manually or in mk.conf. Set LOCALBASE or X11BASE"
342: @${ECHO_MSG} "depending on your needs. See the pkg system documentation for more info."
1.2 tv 343: @${FALSE}
1.14 itojun 344: .endif
345:
1.42 skrll 346: # Load the OS-specific definitions for program variables. Default to loading
347: # the NetBSD ones if an OS-specific file doesn't exist.
1.171 jlam 348: .if exists(${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk)
349: . include "${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk"
1.179 tv 350: .else
1.171 jlam 351: . include "${_PKGSRC_TOPDIR}/mk/platform/NetBSD.mk"
1.179 tv 352: PKG_FAIL_REASON+= "missing mk/platform/${OPSYS}.mk"
1.97 schmonz 353: .endif
354:
1.160 tv 355: PKGDIRMODE?= 755
1.140 jlam 356:
1.284 ! joerg 357: # A meta-package is a package that does not have any files and whose
! 358: # only purpose is to depend on other packages, giving that collection
! 359: # a simple name.
! 360: #
! 361: # Keywords: meta meta-package META_PACKAGE
! 362: #
! 363: .if defined(META_PACKAGE)
! 364: PKG_DESTDIR_SUPPORT= user-destdir
! 365: NO_CONFIGURE= yes
! 366: NO_BUILD= yes
! 367: DISTFILES= # none
! 368: PLIST_SRC= # none
! 369: do-patch:
! 370: @${DO_NADA}
! 371: do-install:
! 372: @${DO_NADA}
! 373: .endif
! 374:
1.241 joerg 375: # PKG_DESTDIR_SUPPORT can only be one of "destdir" or "user-destdir".
376: USE_DESTDIR?= no
377: PKG_DESTDIR_SUPPORT?= # empty
378:
379: .if empty(PKG_DESTDIR_SUPPORT) || (empty(USE_DESTDIR:M[Yy][Ee][Ss]) && empty(USE_DESTDIR:M[Ff][Uu][Ll][Ll]))
380: _USE_DESTDIR= no
381: .elif ${PKG_DESTDIR_SUPPORT} == "user-destdir"
382: . if !empty(USE_DESTDIR:M[Ff][Uu][Ll][Ll])
383: _USE_DESTDIR= user-destdir
384: . else
385: _USE_DESTDIR= destdir
386: . endif
387: .elif ${PKG_DESTDIR_SUPPORT} == "destdir"
388: _USE_DESTDIR= destdir
389: .else
390: PKG_FAIL_REASON+= "PKG_DESTDIR_SUPPORT must be \`\`destdir'' or \`\`user-destdir''."
391: .endif
392:
393: # When using staged installation, everything gets installed into
394: # ${DESTDIR}${PREFIX} instead of ${PREFIX} directly.
395: #
396: .if ${_USE_DESTDIR} != "no"
397: DESTDIR= ${WRKDIR}/.destdir
398: . if ${_USE_DESTDIR} == "destdir"
399: _MAKE_PACKAGE_AS_ROOT= yes
400: _MAKE_CLEAN_AS_ROOT= yes
401: _MAKE_INSTALL_AS_ROOT= yes
402: . elif ${_USE_DESTDIR} == "user-destdir"
403: _MAKE_PACKAGE_AS_ROOT= no
404: _MAKE_CLEAN_AS_ROOT= no
405: _MAKE_INSTALL_AS_ROOT= no
406: . endif
407: .else
408: DESTDIR=
409: .endif
410:
1.239 joerg 411: _MAKE_CLEAN_AS_ROOT?= no
412: # Whether to run the clean target as root.
1.240 joerg 413: _MAKE_INSTALL_AS_ROOT?= yes
414: # Whether to run the install target as root.
1.239 joerg 415: _MAKE_PACKAGE_AS_ROOT?= yes
416: # Whether to run the package target as root.
417:
1.261 joerg 418: # When cross-compilation support is requested, the following options
419: # must be specified as well or guessable:
420: # - MACHINE_ARCH is set to TARGET_ARCH if set.
421: # - CROSS_DESTDIR is guessed from MAKEOBJDIR and MACHINE_ARCH.
422: # - PKG_DBDIR is expanded and prefixed with CROSS_DESTDIR
423: # - DESTDIR support is required
424: #
425: # _CROSS_DESTDIR is set for internal use to avoid conditionalising
426: # the use.
427:
428: .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
429: . if defined(TARGET_ARCH)
430: MACHINE_ARCH= ${TARGET_ARCH}
431: . endif
432: CROSS_DESTDIR?= ${MAKEOBJDIR}/destdir.${MACHINE_ARCH}
433: . if !exists(${CROSS_DESTDIR}/usr/include/stddef.h)
434: PKG_FAIL_REASON+= "The cross-compiling root ${CROSS_DESTDIR:Q} is incomplete"
435: . else
436: _CROSS_DESTDIR= ${CROSS_DESTDIR}
437: . endif
438: .endif
439:
1.264 joerg 440: # Depends on MACHINE_ARCH override above
441: .if ${OPSYS} == "NetBSD"
442: . if ${OBJECT_FMT} == "ELF" && \
443: (${MACHINE_GNU_ARCH} == "arm" || \
444: ${MACHINE_ARCH} == "i386" || \
445: ${MACHINE_ARCH} == "m68k" || \
446: ${MACHINE_ARCH} == "m68000" || \
447: ${MACHINE_GNU_ARCH} == "sh" || \
448: ${MACHINE_GNU_ARCH} == "shle" || \
449: ${MACHINE_ARCH} == "sparc" || \
450: ${MACHINE_ARCH} == "vax")
451: APPEND_ELF= elf
452: . endif
453: .endif
454:
1.206 rillig 455: PKG_INSTALLATION_TYPES?= overwrite
456: # This is a whitespace-separated list of installation types supported
457: # by the package.
458: #
459: # *NOTE*: This variable *must* be set in the package Makefile *before*
460: # the inclusion of bsd.prefs.mk.
461: #
462: # Possible: any of: overwrite, pkgviews
463: # Default: overwrite
464:
1.142 jlam 465: # Set the style of installation to be performed for the package. The
466: # funky make variable modifiers just select the first word of the value
467: # stored in the referenced variable.
468: #
469: .for _pref_ in ${PKG_INSTALLATION_PREFS}
470: . if !empty(PKG_INSTALLATION_TYPES:M${_pref_})
471: PKG_INSTALLATION_TYPE?= ${PKG_INSTALLATION_TYPES:M${_pref_}:S/^/_pkginsttype_/1:M_pkginsttype_*:S/^_pkginsttype_//}
472: . endif
473: .endfor
474: PKG_INSTALLATION_TYPE?= none
475:
1.97 schmonz 476: # if the system is IPv6-ready, compile with IPv6 support turned on.
1.267 jlam 477: .if empty(_OPSYS_HAS_INET6:M[nN][oO])
478: IPV6_READY= YES
1.136 tron 479: .else
1.267 jlam 480: IPV6_READY= NO
1.136 tron 481: .endif
1.22 agc 482:
1.238 joerg 483: LOCALBASE?= /usr/pkg
1.222 joerg 484: X11_TYPE?= native
1.232 schwarz 485: .if !empty(X11_TYPE:Mnative)
1.217 markd 486: . if ${OPSYS} == "SunOS"
1.87 jlam 487: # On Solaris, we default to using OpenWindows for X11.
1.238 joerg 488: X11BASE?= /usr/openwin
1.247 tnn 489: . elif ${OPSYS} == "IRIX" || ${OPSYS} == "OSF1" || ${OPSYS} == "HPUX"
1.238 joerg 490: X11BASE?= /usr
1.217 markd 491: . else
1.238 joerg 492: X11BASE?= /usr/X11R6
1.217 markd 493: . endif
1.87 jlam 494: .endif
1.163 xtraeme 495: CROSSBASE?= ${LOCALBASE}/cross
1.77 rh 496:
1.142 jlam 497: # If xpkgwedge.def is found, then clearly we're using xpkgwedge.
498: .if exists(${LOCALBASE}/lib/X11/config/xpkgwedge.def) || \
499: exists(${X11BASE}/lib/X11/config/xpkgwedge.def)
500: USE_XPKGWEDGE= yes
1.243 joerg 501: .elif ${PKG_INSTALLATION_TYPE} == "pkgviews"
1.142 jlam 502: USE_XPKGWEDGE= yes
1.243 joerg 503: .elif ${X11_TYPE} == "modular"
504: USE_XPKGWEDGE= no
505: .else
506: USE_XPKGWEDGE?= yes
1.142 jlam 507: .endif
508:
1.276 tnn 509: .if defined(FIX_SYSTEM_HEADERS) && ${FIX_SYSTEM_HEADERS} == "yes" && \
510: empty(PKGPATH:Mpkgtools/*) && empty(PKGPATH:M*/nbsed) && \
1.279 tnn 511: empty(PKGPATH:M*/nawk) && empty(PKGPATH:M*/bmake) && \
1.281 tnn 512: empty(PKGPATH:M*/install-sh) && empty(PKGPATH:M*/tnftp) && \
513: empty(PKGPATH:M*/pax) && \
1.283 tnn 514: exists(../../pkgtools/compat_headers/buildlink3.mk)
515: . include "../../pkgtools/compat_headers/buildlink3.mk"
1.276 tnn 516: .endif
517:
1.265 joerg 518: .if ${X11_TYPE} == "modular"
1.243 joerg 519: X11BASE= ${LOCALBASE}
1.204 reed 520: .endif
521:
1.209 rillig 522: .if !empty(USE_XPKGWEDGE:M[Yy][Ee][Ss])
1.77 rh 523: X11PREFIX= ${LOCALBASE}
524: .else
525: X11PREFIX= ${X11BASE}
526: .endif
527:
1.236 joerg 528: # Default directory for font encodings
529: X11_ENCODINGSDIR?= ${X11BASE}/lib/X11/fonts/encodings
530:
1.122 jlam 531: DEPOT_SUBDIR?= packages
532: DEPOTBASE= ${LOCALBASE}/${DEPOT_SUBDIR}
533:
1.165 jlam 534: # LINK_RPATH_FLAG publicly exports the linker flag used to set the
535: # run-time library search path.
1.107 jlam 536: #
1.165 jlam 537: .if defined(_OPSYS_LINKER_RPATH_FLAG)
538: LINKER_RPATH_FLAG= ${_OPSYS_LINKER_RPATH_FLAG}
539: .else
540: LINKER_RPATH_FLAG?= ${_LINKER_RPATH_FLAG}
541: .endif
542:
543: # COMPILER_RPATH_FLAG publicly exports the compiler flag used to pass
544: # run-time library search path directives to the linker.
545: #
546: .if defined(_OPSYS_COMPILER_RPATH_FLAG)
547: COMPILER_RPATH_FLAG= ${_OPSYS_COMPILER_RPATH_FLAG}
548: .else
549: COMPILER_RPATH_FLAG?= ${_COMPILER_RPATH_FLAG}
550: .endif
1.110 grant 551:
552: # WHOLE_ARCHIVE_FLAG and NO_WHOLE_ARCHIVE_FLAG publically export the
553: # linker flags to extract all symbols from a static archive.
1.263 rillig 554: #
1.110 grant 555: WHOLE_ARCHIVE_FLAG?= ${_OPSYS_WHOLE_ARCHIVE_FLAG}
556: NO_WHOLE_ARCHIVE_FLAG?= ${_OPSYS_NO_WHOLE_ARCHIVE_FLAG}
1.26 agc 557:
1.227 jlam 558: USE_TOOLS?= # empty
559:
560: # Provide default values for TOOLs used by the top-level make.
561: USE_TOOLS+= [ awk dirname echo grep pwd sed test true
562:
563: # These tools are used by the top-level make only in certain packages and
564: # should eventually be moved into those particular package Makefiles.
565: #
566: USE_TOOLS+= date tr
567:
568: # These are tools used directly by bsd.prefs.mk and files included by
569: # bsd.prefs.mk.
570: #
571: USE_TOOLS+= awk:pkgsrc cut:pkgsrc echo:pkgsrc pwd:pkgsrc \
572: sed:pkgsrc tr:pkgsrc uname:pkgsrc
573:
574: .include "${_PKGSRC_TOPDIR}/mk/tools/defaults.mk"
575:
1.173 jlam 576: .if !defined(_PKGSRCDIR)
577: _PKGSRCDIR!= cd ${_PKGSRC_TOPDIR} && ${PWD_CMD}
578: MAKEFLAGS+= _PKGSRCDIR=${_PKGSRCDIR:Q}
1.171 jlam 579: .endif
1.173 jlam 580: PKGSRCDIR= ${_PKGSRCDIR}
1.82 jlam 581:
1.226 jlam 582: DISTDIR?= ${PKGSRCDIR}/distfiles
1.171 jlam 583: PACKAGES?= ${PKGSRCDIR}/packages
584: TEMPLATES?= ${PKGSRCDIR}/templates
1.82 jlam 585:
1.226 jlam 586: PATCHDIR?= ${.CURDIR}/patches
1.82 jlam 587: FILESDIR?= ${.CURDIR}/files
588: PKGDIR?= ${.CURDIR}
1.120 gavan 589:
590: _PKGSRC_DEPS?= # empty
1.82 jlam 591:
592: # If WRKOBJDIR is set, use that tree to build
1.88 jlam 593: .if defined(WRKOBJDIR)
1.82 jlam 594: BUILD_DIR?= ${WRKOBJDIR}/${PKGPATH}
595: .else
1.105 jlam 596: BUILD_DIR!= cd ${.CURDIR} && ${PWD_CMD}
597: .endif
1.82 jlam 598:
599: # If OBJHOSTNAME is set, use first component of hostname in directory name.
600: # If OBJMACHINE is set, use ${MACHINE_ARCH} in the working directory name.
601: #
602: .if defined(OBJHOSTNAME)
603: . if !defined(_HOSTNAME)
1.93 wiz 604: _HOSTNAME!= ${UNAME} -n
1.215 rillig 605: MAKEFLAGS+= _HOSTNAME=${_HOSTNAME:Q}
1.82 jlam 606: . endif
607: WRKDIR_BASENAME?= work.${_HOSTNAME:C|\..*||}
1.215 rillig 608: MAKEFLAGS+= OBJHOSTNAME=${OBJHOSTNAME:Q}
1.82 jlam 609: .elif defined(OBJMACHINE)
610: WRKDIR_BASENAME?= work.${MACHINE_ARCH}
1.215 rillig 611: MAKEFLAGS+= OBJMACHINE=${OBJMACHINE:Q}
1.82 jlam 612: .else
613: WRKDIR_BASENAME?= work
1.93 wiz 614: .endif
1.82 jlam 615:
616: WRKDIR?= ${BUILD_DIR}/${WRKDIR_BASENAME}
1.119 jlam 617:
618: # There are many uses for a common log file, so define one that may be
1.162 wiz 619: # picked up and used by tools.mk, bsd.buildlink3.mk, etc.
1.119 jlam 620: #
621: WRKLOG?= ${WRKDIR}/.work.log
1.128 grant 622:
1.164 jlam 623: PKG_DEFAULT_OPTIONS?= # empty
624: PKG_OPTIONS?= # empty
625:
1.178 tv 626: # we want this *before* compiler.mk, so that compiler.mk paths override them
1.242 joerg 627: .if ${X11_TYPE} != "modular" && defined(USE_X11)
628: PREPEND_PATH+= ${X11BASE}/bin
629: .endif
630: PREPEND_PATH+= ${LOCALBASE}/bin
1.178 tv 631:
1.168 jlam 632: # Wrapper framework definitions
1.274 rillig 633: .include "wrapper/wrapper-defs.mk"
1.168 jlam 634:
1.254 jlam 635: # Binary emulator framework definitions
636: .if defined(EMUL_PLATFORMS) && !empty(EMUL_PLATFORMS)
1.274 rillig 637: . include "emulator/emulator-vars.mk"
1.254 jlam 638: .endif
639:
1.266 jlam 640: # System features framework
1.274 rillig 641: .include "features/features-vars.mk"
1.266 jlam 642:
1.226 jlam 643: # Package system flavor definitions
1.274 rillig 644: .include "flavor/bsd.flavor-vars.mk"
1.226 jlam 645:
1.194 jlam 646: # Make variable definitions cache
1.274 rillig 647: .include "bsd.makevars.mk"
1.194 jlam 648:
1.231 jlam 649: # If MAKECONF is defined, then pass it down to all recursive make
650: # processes invoked by pkgsrc.
651: #
652: PKGSRC_MAKE_ENV+= ${MAKECONF:DMAKECONF=${MAKECONF:Q}}
653: RECURSIVE_MAKE= ${SETENV} ${PKGSRC_MAKE_ENV} ${MAKE}
654:
1.269 rillig 655: _VARGROUPS+= dirs
656: _USER_VARS.dirs= DISTDIR LOCALBASE PACKAGES PKG_SYSCONFDIR WRKOBJDIR
657: _PKG_VARS.dirs= WRKSRC PATCHDIR FILESDIR PKGDIR
658: _SYS_VARS.dirs= WRKDIR DESTDIR PKG_SYSCONFBASEDIR
659:
1.104 jlam 660: .endif # BSD_PKG_MK
CVSweb <webmaster@jp.NetBSD.org>