1 # $NetBSD: bsd.prefs.mk,v 1.335 2013/04/03 13:45:49 obache Exp $
3 # This file includes the mk.conf file, which contains the user settings.
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.
9 # When mk.conf is included by this file, the following variables are
13 # This variable is set to the list of Open Source licenses. See
14 # mk/license.mk for details.
17 # The platform for which the packages are built. It has the form
18 # ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}.
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.
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.
30 # Keywords: mk.conf user
33 .if
!defined
(BSD_PKG_MK
)
35 # Let mk.conf know that this is pkgsrc.
37 __PREFIX_SET__
:=${PREFIX}
39 # Set PATH if not already set
41 PATH
=/bin
:/usr
/bin
:/sbin
:/usr
/sbin
44 # Expand MAKE to a full path.
47 # allow for MAKE=./make and similar.
48 . if empty
(_MAKE
:M
/*) && !empty
(_MAKE
:M
*/*) && defined
(PWD
) && exists
(${PWD}/${MAKE})
49 _MAKE
:= ${PWD}/${MAKE}
51 . for _dir_ in
${PATH
:C
/\
:/ /g
}
53 . if exists
(${_dir_}/${MAKE})
54 _MAKE
:= ${_dir_}/${MAKE}
58 . if
!empty
(_MAKE
:M
/*)
59 MAKEFLAGS
+= _MAKE
=${_MAKE
:Q
}
64 .if exists
(/usr
/bin
/uname
)
66 .elif exists
(/bin
/uname
)
73 OPSYS
:= ${:!${UNAME} -s
!:S
/-//g
:S
/\
///g
:C
/^CYGWIN_.
*$/Cygwin
/}
74 MAKEFLAGS
+= OPSYS
=${OPSYS
:Q
}
77 # OS_VARIANT is used to differentiate operating systems which have a common
78 # basis but offer contrasting environments, for example Linux distributions
82 # The _CMD indirection allows code below to modify these values
83 # without executing the commands at all. Later, recursed make
84 # invocations will skip these blocks entirely thanks to MAKEFLAGS.
85 .if
!defined
(OS_VERSION
)
86 _OS_VERSION_CMD
= ${UNAME} -r
87 OS_VERSION
= ${_OS_VERSION_CMD
:sh
}
88 MAKEFLAGS
+= OS_VERSION
=${OS_VERSION
:Q
}
91 # Preload these for architectures not in all variations of bsd.own.mk,
92 # which do not match their GNU names exactly.
98 GNU_ARCH.m68000?
= m68010
99 GNU_ARCH.mips?
= mipsel
101 GNU_ARCH.sh3el?
= shle
102 NATIVE_MACHINE_GNU_ARCH?
= ${GNU_ARCH.
${NATIVE_MACHINE_ARCH}:U
${NATIVE_MACHINE_ARCH}}
103 MACHINE_GNU_ARCH?
= ${GNU_ARCH.
${MACHINE_ARCH}:U
${MACHINE_ARCH}}
105 ## If changes are made to how OS_VERSION is set below please keep
106 ## "pkgsrc/pkgtools/osabi/INSTALL" in-sync.
107 .if
${OPSYS} == "NetBSD"
110 .elif
${OPSYS} == "AIX"
111 LOWER_ARCH
!= _cpuid
=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $$1 }'`; \
112 if
/usr
/sbin
/lsattr
-El
$$_cpuid | grep
' POWER' >/dev
/null
2>&1; then \
117 MACHINE_ARCH?
= ${LOWER_ARCH}
118 . if exists
(/usr
/bin
/oslevel
)
119 _OS_VERSION
!= /usr
/bin
/oslevel
121 _OS_VERSION
!= echo
`${UNAME} -v`.
`${UNAME} -r`
123 OS_VERSION
= ${_OS_VERSION
:C
/([0-9]*\.
[0-9]*).
*/\
1/}
124 LOWER_OPSYS_VERSUFFIX
= ${_OS_VERSION}
128 .elif
${OPSYS} == "BSDOS"
131 .elif
${OPSYS} == "Cygwin"
134 . if
!defined
(LOWER_ARCH
)
135 LOWER_ARCH
!= ${UNAME} -m | sed
-e
's/i.86/i386/'
136 .
endif # !defined(LOWER_ARCH)
137 _OS_VERSION
!= ${UNAME} -r
138 OS_VERSION
= ${_OS_VERSION
:C
/\
(.
*\
)//}
139 OS_VARIANT
!= ${UNAME} -s
141 .elif
${OPSYS} == "Darwin"
143 .if empty
(OS_VERSION
:M
[1-9].
*.
*)
144 # Automatically select the ABI under Mac OS X Snow Leopard. We don't
145 # use this at the moment because too many third party programs don't
148 # _SYSCTL_HW_OPTIONAL_X86_64!= /usr/sbin/sysctl -n hw.optional.x86_64
149 # . if ${_SYSCTL_HW_OPTIONAL_X86_64} == "1"
156 LOWER_ARCH
.64= x86_64
157 LOWER_ARCH
= ${LOWER_ARCH.
${ABI}}
159 LOWER_ARCH
!= ${UNAME} -p
161 MACHINE_ARCH
= ${LOWER_ARCH}
162 MAKEFLAGS
+= LOWER_ARCH
=${LOWER_ARCH
:Q
}
163 LOWER_OPSYS_VERSUFFIX
= ${LOWER_OS_VERSION
:C
/([0-9]*).
*/\
1/}
166 .elif
${OPSYS} == "DragonFly"
167 OS_VERSION
:= ${OS_VERSION
:C
/-.
*$//}
168 LOWER_OPSYS?
= dragonfly
169 LOWER_ARCH
!= ${UNAME} -p
170 . if
${LOWER_ARCH} == "amd64"
173 MACHINE_ARCH
= ${LOWER_ARCH}
175 MAKEFLAGS
+= LOWER_ARCH
=${LOWER_ARCH
:Q
}
178 .elif
${OPSYS} == "FreeBSD"
179 OS_VERSION
:= ${OS_VERSION
:C
/-.
*$//}
180 LOWER_OPSYS?
= freebsd
181 LOWER_ARCH
!= ${UNAME} -p
182 . if
${LOWER_ARCH} == "amd64"
185 MACHINE_ARCH
= ${LOWER_ARCH}
187 MAKEFLAGS
+= LOWER_ARCH
=${LOWER_ARCH
:Q
}
188 LOWER_OPSYS_VERSUFFIX
= ${LOWER_OS_VERSION
:C
/([0-9]*).
*/\
1/}
189 . if
${LOWER_ARCH} == "i386"
192 LOWER_VENDOR?
= unknown
194 .elif
${OPSYS} == "Haiku"
196 . if
${MACHINE_ARCH} == "i386"
200 .elif
${OPSYS} == "Interix"
201 LOWER_OPSYS?
= interix
203 . if exists
(/usr
/lib
/libc.so
.5.2) || exists
(/usr
/lib
/x86
/libc.so
.5.2)
204 LOWER_OPSYS_VERSUFFIX
= ${LOWER_OS_VERSION
:C
/([0-9]*).
*/\
1/}
206 LOWER_OPSYS_VERSUFFIX?
= 3
207 . if exists
(/usr
/lib
/libc.so
.3.5)
209 . elif exists
(/usr
/lib
/libc.so
.3.1)
216 .elif
${OPSYS} == "MirBSD"
218 LOWER_OS_VERSION
= ${OS_VERSION}
219 LOWER_OPSYS_VERSUFFIX
= ${OS_VERSION}
221 LOWER_VENDOR?
= unknown
222 MACHINE_ARCH
= ${LOWER_ARCH}
223 MAKEFLAGS
+= LOWER_ARCH
=${LOWER_ARCH
:Q
}
225 .elif
!empty
(OPSYS
:MIRIX
*)
226 LOWER_ARCH
!= ${UNAME} -p
228 LOWER_OPSYS_VERSUFFIX?
= ${OS_VERSION}
231 .elif
${OPSYS} == "Linux"
232 OS_VERSION
:= ${OS_VERSION
:C
/-.
*$//}
234 . if
!defined
(LOWER_ARCH
)
235 LOWER_ARCH
!= ${UNAME} -m | sed
-e
's/i.86/i386/' -e
's/ppc/powerpc/'
236 .
endif # !defined(LOWER_ARCH)
237 MACHINE_ARCH
= ${LOWER_ARCH}
238 MAKEFLAGS
+= LOWER_ARCH
=${LOWER_ARCH
:Q
}
239 . if exists
(/etc
/debian_version
)
240 LOWER_VENDOR?
= debian
241 . elif exists
(/etc
/mandrake-release
)
242 LOWER_VENDOR?
= mandrake
243 . elif exists
(/etc
/redhat-version
)
244 LOWER_VENDOR?
= redhat
245 . elif exists
(/etc
/slackware-version
)
246 LOWER_VENDOR?
= slackware
247 . elif exists
(/etc
/ssdlinux_version
)
249 . elif
${LOWER_ARCH} == "i386"
252 LOWER_VENDOR?
= unknown
254 .elif
${OPSYS} == "OSF1"
255 LOWER_ARCH
!= ${UNAME} -p
256 MAKEFLAGS
+= LOWER_ARCH
=${LOWER_ARCH
:Q
}
257 MACHINE_ARCH?
= ${LOWER_ARCH}
258 OS_VERSION
:= ${OS_VERSION
:C
/^V
//}
260 LOWER_OPSYS_VERSUFFIX?
= ${OS_VERSION}
263 .elif
${OPSYS} == "HPUX"
264 OS_VERSION
:= ${OS_VERSION
:C
/^B.
//}
265 .if
${MACHINE_ARCH} == "9000"
269 LOWER_OPSYS_VERSUFFIX?
= ${OS_VERSION}
272 .elif
${OPSYS} == "SunOS"
274 . if
${MACHINE_ARCH} == "sparc"
275 SPARC_TARGET_ARCH?
= sparcv7
276 . elif
${MACHINE_ARCH} == "sun4"
278 SPARC_TARGET_ARCH?
= sparcv7
279 . elif
${MACHINE_ARCH} == "i86pc" ||
${MACHINE_ARCH} == "i86xpv" ||
${MACHINE_ARCH} == "i386"
281 LOWER_ARCH
.64= x86_64
282 LOWER_ARCH
= ${LOWER_ARCH.
${ABI}}
283 MACHINE_ARCH
= ${LOWER_ARCH}
284 . elif
${MACHINE_ARCH} == "unknown"
285 . if
!defined
(LOWER_ARCH
)
286 LOWER_ARCH
!= ${UNAME} -p
287 .
endif # !defined(LOWER_ARCH)
288 MAKEFLAGS
+= LOWER_ARCH
=${LOWER_ARCH
:Q
}
291 LOWER_OPSYS?
= solaris
292 LOWER_OPSYS_VERSUFFIX
= 2.
${OS_VERSION
:C
/5.
//}
293 _UNAME_V
!= ${UNAME} -v
294 . if
!empty
(_UNAME_V
:Mjoyent_
*)
298 .elif
${OPSYS} == "Minix"
300 LOWER_OPSYS
:= ${OPSYS
:tl
}
301 LDFLAGS
+= -lcompat_minix
-lminlib
303 .elif
!defined
(LOWER_OPSYS
)
304 LOWER_OPSYS
:= ${OPSYS
:tl
}
307 # Now commit the [LOWER_]OS_VERSION values computed above, eliding the :sh
308 OS_VERSION
:= ${OS_VERSION}
309 LOWER_OS_VERSION
:= ${OS_VERSION
:tl
}
311 MAKEFLAGS
+= LOWER_OPSYS
=${LOWER_OPSYS
:Q
}
313 LOWER_VENDOR?
= # empty ("arch--opsys")
314 LOWER_ARCH?
= ${MACHINE_GNU_ARCH}
315 # Expand now as MACHINE_ARCH can be overriden in mk.conf and
316 # LOWER_ARCH is typically derived from it.
317 NATIVE_LOWER_ARCH
:= ${LOWER_ARCH}
318 NATIVE_MACHINE_ARCH
:= ${MACHINE_ARCH}
320 NATIVE_MACHINE_PLATFORM?
= ${OPSYS}-${OS_VERSION}-${NATIVE_MACHINE_ARCH}
321 MACHINE_PLATFORM?
= ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}
322 NATIVE_MACHINE_GNU_PLATFORM?
= ${NATIVE_MACHINE_GNU_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS
:C
/[0-9]//g
}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
323 MACHINE_GNU_PLATFORM?
= ${MACHINE_GNU_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS
:C
/[0-9]//g
}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
325 # Needed to prevent an "install:" target from being created in bsd.own.mk.
326 NEED_OWN_INSTALL_TARGET
=no
328 # This prevents default use of the cross-tool harness in the "src" tree,
329 # in the odd possible case of someone extracting "pkgsrc" underneath "src".
331 MAKE_ENV
+= USETOOLS
=no
333 # Set this before <bsd.own.mk> does, since it doesn't know about Darwin
334 .if
${OPSYS} == "Darwin"
338 ACCEPTABLE_LICENSES?
= ${DEFAULT_ACCEPTABLE_LICENSES}
340 # Provide PKGPATH early on so that mk.conf can use it.
341 PKGPATH?
= ${.CURDIR
:C|.
*/([^
/]*/[^
/]*)$|\
1|
}
343 # Load the settings from MAKECONF, which is /etc/mk.conf by default.
344 .
include <bsd.own.mk
>
346 # /usr/share/mk/bsd.own.mk on NetBSD 1.3 does not define OBJECT_FMT
347 .if
!empty
(MACHINE_PLATFORM
:MNetBSD-1.3
*)
348 . if
${MACHINE_ARCH} == "alpha" || \
349 ${MACHINE_ARCH} == "mipsel" ||
${MACHINE_ARCH} == "mipseb" || \
350 ${MACHINE_ARCH} == "powerpc" ||
${MACHINE_ARCH} == "sparc64"
355 # override what bootstrap-pkgsrc sets, which isn't right for NetBSD
357 # XXX other ELF platforms in 1.4 need to be added to here.
358 .elif
!empty
(MACHINE_PLATFORM
:MNetBSD-1.4
*)
359 . if
${MACHINE_ARCH} == "alpha" || \
360 ${MACHINE_ARCH} == "mipsel" ||
${MACHINE_ARCH} == "mipseb" || \
361 ${MACHINE_ARCH} == "powerpc" ||
${MACHINE_ARCH} == "sparc64"
368 .if
${OPSYS} == "OpenBSD"
369 . if defined
(ELF_TOOLCHAIN
) && ${ELF_TOOLCHAIN} == "yes"
374 .elif
${OPSYS} == "DragonFly"
376 .elif
${OPSYS} == "MirBSD"
379 .elif
${OPSYS} == "AIX"
381 .elif
${OPSYS} == "OSF1"
383 .elif
${OPSYS} == "HPUX"
384 . if
${MACHINE_ARCH} == "ia64" ||
(defined
(ABI
) && ${ABI} == "64")
389 .elif
${OPSYS} == "Cygwin"
394 .if exists
(${.CURDIR
}/mk
/bsd.pkg.mk
)
395 _PKGSRC_TOPDIR
= ${.CURDIR
}
396 .elif exists
(${.CURDIR
}/..
/mk
/bsd.pkg.mk
)
397 _PKGSRC_TOPDIR
= ${.CURDIR
}/..
398 .elif exists
(${.CURDIR
}/..
/..
/mk
/bsd.pkg.mk
)
399 _PKGSRC_TOPDIR
= ${.CURDIR
}/..
/..
402 # include the defaults file
403 .
include "${_PKGSRC_TOPDIR}/mk/defaults/mk.conf"
407 SHAREMODE?
= ${DOCMODE}
409 .if defined
(PREFIX
) && (${PREFIX} != ${__PREFIX_SET__})
411 @
${ECHO_MSG} "You CANNOT set PREFIX manually or in mk.conf. Set LOCALBASE or X11BASE"
412 @
${ECHO_MSG} "depending on your needs. See the pkg system documentation for more info."
416 # Load the OS-specific definitions for program variables. Default to loading
417 # the NetBSD ones if an OS-specific file doesn't exist.
418 .if exists
(${_PKGSRC_TOPDIR}/mk
/platform
/${OPSYS}.mk
)
419 .
include "${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk"
421 .
include "${_PKGSRC_TOPDIR}/mk/platform/NetBSD.mk"
422 PKG_FAIL_REASON
+= "missing mk/platform/${OPSYS}.mk"
427 # A meta-package is a package that does not have any files and whose
428 # only purpose is to depend on other packages, giving that collection
431 # This variable must be set before including bsd.prefs.mk directly or
434 # Keywords: meta meta-package META_PACKAGE
436 .if defined
(META_PACKAGE
)
437 PKG_DESTDIR_SUPPORT
= user-destdir
443 USE_LANGUAGES
= # empty
450 # After 2011Q1, the default is to use DESTDIR.
452 # PKG_DESTDIR_SUPPORT can only be one of "none", "destdir", or "user-destdir".
453 PKG_DESTDIR_SUPPORT?
= user-destdir
455 .if
${PKG_DESTDIR_SUPPORT} == "none" || empty
(USE_DESTDIR
:M
[Yy
][Ee
][Ss
])
456 . if empty
(USE_DESTDIR
:M
[Yy
][Ee
][Ss
]) && empty
(USE_DESTDIR
:M
[Nn
][Oo
])
457 PKG_FAIL_REASON
+= "USE_DESTDIR must be either \`\`yes'' or \`\`no''"
460 .elif
${PKG_DESTDIR_SUPPORT} == "user-destdir"
461 _USE_DESTDIR
= user-destdir
462 .elif
${PKG_DESTDIR_SUPPORT} == "destdir"
463 _USE_DESTDIR
= destdir
465 PKG_FAIL_REASON
+= "PKG_DESTDIR_SUPPORT must be \`\`none'', \`\`destdir'', or \`\`user-destdir''."
468 # This stanza serves to warn the user; deciding to not build
469 # non-DESTDIR-capable packages when not in DESTDIR mode is above.
470 .if
${PKG_DESTDIR_SUPPORT} == "none"
471 WARNINGS
+= "[bsd.prefs.mk] The package ${PKGNAME} is missing DESTDIR support."
474 # When using staged installation, everything gets installed into
475 # ${DESTDIR}${PREFIX} instead of ${PREFIX} directly.
477 .if
${_USE_DESTDIR} != "no"
478 DESTDIR
= ${WRKDIR}/.destdir
479 . if
${_USE_DESTDIR} == "destdir"
480 _MAKE_PACKAGE_AS_ROOT
= yes
481 _MAKE_CLEAN_AS_ROOT
= yes
482 _MAKE_INSTALL_AS_ROOT
= yes
483 . elif
${_USE_DESTDIR} == "user-destdir"
484 _MAKE_PACKAGE_AS_ROOT
= no
485 _MAKE_CLEAN_AS_ROOT
= no
486 _MAKE_INSTALL_AS_ROOT
= no
492 _MAKE_CLEAN_AS_ROOT?
= no
493 # Whether to run the clean target as root.
494 _MAKE_INSTALL_AS_ROOT?
= yes
495 # Whether to run the install target as root.
496 _MAKE_PACKAGE_AS_ROOT?
= yes
497 # Whether to run the package target as root.
499 # When cross-compilation support is requested, the following options
500 # must be specified as well or guessable:
501 # - MACHINE_ARCH is set to TARGET_ARCH if set.
502 # - CROSS_DESTDIR is guessed from MAKEOBJDIR and MACHINE_ARCH.
503 # - PKG_DBDIR is expanded and prefixed with CROSS_DESTDIR
504 # - DESTDIR support is required
506 # _CROSS_DESTDIR is set for internal use to avoid conditionalising
509 .if
!empty
(USE_CROSS_COMPILE
:M
[yY
][eE
][sS
])
510 . if defined
(TARGET_ARCH
)
511 MACHINE_ARCH
= ${TARGET_ARCH}
513 CROSS_DESTDIR?
= ${MAKEOBJDIR}/destdir.
${MACHINE_ARCH}
514 . if
!exists
(${CROSS_DESTDIR}/usr
/include/stddef.h
)
515 PKG_FAIL_REASON
+= "The cross-compiling root ${CROSS_DESTDIR:Q} is incomplete"
517 _CROSS_DESTDIR
= ${CROSS_DESTDIR}
521 # Depends on MACHINE_ARCH override above
522 .if
${OPSYS} == "NetBSD"
523 . if
${OBJECT_FMT} == "ELF" && \
524 (${MACHINE_GNU_ARCH} == "arm" || \
525 ${MACHINE_ARCH} == "i386" || \
526 ${MACHINE_ARCH} == "m68k" || \
527 ${MACHINE_ARCH} == "m68000" || \
528 ${MACHINE_GNU_ARCH} == "sh" || \
529 ${MACHINE_GNU_ARCH} == "shle" || \
530 ${MACHINE_ARCH} == "sparc" || \
531 ${MACHINE_ARCH} == "vax")
536 PKG_INSTALLATION_TYPES?
= overwrite
537 # This is a whitespace-separated list of installation types supported
540 # *NOTE*: This variable *must* be set in the package Makefile *before*
541 # the inclusion of bsd.prefs.mk.
543 # Possible: any of: overwrite, pkgviews
546 # Set the style of installation to be performed for the package. The
547 # funky make variable modifiers just select the first word of the value
548 # stored in the referenced variable.
550 .for _pref_ in
${PKG_INSTALLATION_PREFS}
551 . if
!empty
(PKG_INSTALLATION_TYPES
:M
${_pref_})
552 PKG_INSTALLATION_TYPE?
= ${PKG_INSTALLATION_TYPES
:M
${_pref_}:S
/^
/_pkginsttype_
/1:M_pkginsttype_
*:S
/^_pkginsttype_
//}
555 PKG_INSTALLATION_TYPE?
= none
557 # if the system is IPv6-ready, compile with IPv6 support turned on.
558 .if empty
(_OPSYS_HAS_INET6
:M
[nN
][oO
])
566 .if
!empty
(X11_TYPE
:Mnative
)
567 . if
${OPSYS} == "SunOS"
568 # On Solaris, we default to using OpenWindows for X11.
569 X11BASE?
= /usr
/openwin
570 . elif
${OPSYS} == "Cygwin" ||
${OPSYS} == "IRIX" ||
${OPSYS} == "OSF1" ||
${OPSYS} == "HPUX"
572 . elif
!empty
(MACHINE_PLATFORM
:MDarwin-9.
*-*) || \
573 !empty
(MACHINE_PLATFORM
:MDarwin-10.
*-*) || \
574 !empty
(MACHINE_PLATFORM
:MDarwin-11.
*-*)
576 . elif
!empty
(MACHINE_PLATFORM
:MDarwin-??.
*-*)
578 . elif
${OPSYS} == "NetBSD" && ${X11FLAVOUR
:U
} == "Xorg"
580 . elif exists
(/usr
/X11R7
/lib
/libX11.so
)
586 CROSSBASE?
= ${LOCALBASE}/cross
588 .if defined
(FIX_SYSTEM_HEADERS
) && ${FIX_SYSTEM_HEADERS} == "yes" && \
589 !defined
(BOOTSTRAP_PKG
) && \
590 exists
(..
/..
/pkgtools
/compat_headers
/buildlink3.mk
)
591 .
include "../../pkgtools/compat_headers/buildlink3.mk"
594 .if
${X11_TYPE} == "modular"
595 X11BASE
= ${LOCALBASE}
598 X11PREFIX
= ${LOCALBASE}
600 # Default directory for font encodings
601 .if
${X11_TYPE} == "modular"
602 X11_ENCODINGSDIR?
= ${X11BASE}/share
/fonts
/X11
/encodings
604 X11_ENCODINGSDIR?
= ${X11BASE}/lib
/X11
/fonts
/encodings
607 IMAKE_MAN_SOURCE_PATH
= man
/man
609 IMAKE_LIBMAN_SUFFIX
= 3
610 IMAKE_KERNMAN_SUFFIX
= 4
611 IMAKE_FILEMAN_SUFFIX
= 5
612 IMAKE_GAMEMAN_SUFFIX
= 6
613 IMAKE_MISCMAN_SUFFIX
= 7
614 IMAKE_MAN_DIR
= ${IMAKE_MAN_SOURCE_PATH}1
615 IMAKE_LIBMAN_DIR
= ${IMAKE_MAN_SOURCE_PATH}3
616 IMAKE_KERNMAN_DIR
= ${IMAKE_MAN_SOURCE_PATH}4
617 IMAKE_FILEMAN_DIR
= ${IMAKE_MAN_SOURCE_PATH}5
618 IMAKE_GAMEMAN_DIR
= ${IMAKE_MAN_SOURCE_PATH}6
619 IMAKE_MISCMAN_DIR
= ${IMAKE_MAN_SOURCE_PATH}7
620 IMAKE_MANNEWSUFFIX
= ${IMAKE_MAN_SUFFIX}
621 IMAKE_MANINSTALL?
= maninstall
623 DEPOT_SUBDIR?
= packages
624 DEPOTBASE
= ${LOCALBASE}/${DEPOT_SUBDIR}
626 # LINK_RPATH_FLAG publicly exports the linker flag used to set the
627 # run-time library search path.
629 .if defined
(_OPSYS_LINKER_RPATH_FLAG
)
630 LINKER_RPATH_FLAG
= ${_OPSYS_LINKER_RPATH_FLAG}
632 LINKER_RPATH_FLAG?
= ${_LINKER_RPATH_FLAG}
635 # COMPILER_RPATH_FLAG publicly exports the compiler flag used to pass
636 # run-time library search path directives to the linker.
638 .if defined
(_OPSYS_COMPILER_RPATH_FLAG
)
639 COMPILER_RPATH_FLAG
= ${_OPSYS_COMPILER_RPATH_FLAG}
641 COMPILER_RPATH_FLAG?
= ${_COMPILER_RPATH_FLAG}
644 COMPILER_INCLUDE_DIRS?
= ${_OPSYS_INCLUDE_DIRS
:U
/usr
/include}
645 COMPILER_LIB_DIRS?
= ${_OPSYS_LIB_DIRS
:U
/usr
/lib
${LIBABISUFFIX} /lib
${LIBABISUFFIX}}
646 SYSTEM_DEFAULT_RPATH?
= ${_OPSYS_SYSTEM_RPATH
:U
/usr
/lib
}
648 # WHOLE_ARCHIVE_FLAG and NO_WHOLE_ARCHIVE_FLAG publically export the
649 # linker flags to extract all symbols from a static archive.
651 WHOLE_ARCHIVE_FLAG?
= ${_OPSYS_WHOLE_ARCHIVE_FLAG}
652 NO_WHOLE_ARCHIVE_FLAG?
= ${_OPSYS_NO_WHOLE_ARCHIVE_FLAG}
656 # Provide default values for TOOLs used by the top-level make.
657 USE_TOOLS
+= [ awk dirname echo grep pwd sed
test true
659 # These tools are used by the top-level make only in certain packages and
660 # should eventually be moved into those particular package Makefiles.
664 # These are tools used directly by bsd.prefs.mk and files included by
667 USE_TOOLS
+= awk
:pkgsrc cut
:pkgsrc echo
:pkgsrc pwd
:pkgsrc \
668 sed
:pkgsrc tr
:pkgsrc uname
:pkgsrc
670 .
include "${_PKGSRC_TOPDIR}/mk/tools/defaults.mk"
672 .if
!defined
(_PKGSRCDIR
)
673 _PKGSRCDIR
!= cd
${_PKGSRC_TOPDIR} && ${PWD_CMD}
674 MAKEFLAGS
+= _PKGSRCDIR
=${_PKGSRCDIR
:Q
}
676 PKGSRCDIR
= ${_PKGSRCDIR}
678 DISTDIR?
= ${PKGSRCDIR}/distfiles
679 PACKAGES?
= ${PKGSRCDIR}/packages
680 TEMPLATES?
= ${PKGSRCDIR}/templates
682 PATCHDIR?
= ${.CURDIR
}/patches
683 FILESDIR?
= ${.CURDIR
}/files
686 _PKGSRC_DEPS?
= # empty
687 _BUILTIN_PKGS?
= # empty
689 # If WRKOBJDIR is set, use that tree to build
690 .if defined
(WRKOBJDIR
)
691 BUILD_DIR?
= ${WRKOBJDIR}/${PKGPATH}
693 BUILD_DIR
!= cd
${.CURDIR
} && ${PWD_CMD}
696 # If OBJHOSTNAME is set, use first component of hostname in directory name.
697 # If OBJMACHINE is set, use ${MACHINE_ARCH} in the working directory name.
699 .if defined
(OBJHOSTNAME
)
700 . if
!defined
(_HOSTNAME
)
701 _HOSTNAME
!= ${UNAME} -n
702 MAKEFLAGS
+= _HOSTNAME
=${_HOSTNAME
:Q
}
704 WRKDIR_BASENAME?
= work.
${_HOSTNAME
:C|\..
*||
}
705 MAKEFLAGS
+= OBJHOSTNAME
=${OBJHOSTNAME
:Q
}
706 .elif defined
(OBJMACHINE
)
707 WRKDIR_BASENAME?
= work.
${MACHINE_ARCH}
708 MAKEFLAGS
+= OBJMACHINE
=${OBJMACHINE
:Q
}
710 WRKDIR_BASENAME?
= work
713 WRKDIR?
= ${BUILD_DIR}/${WRKDIR_BASENAME}
715 # There are many uses for a common log file, so define one that may be
716 # picked up and used by tools.mk, bsd.buildlink3.mk, etc.
718 WRKLOG?
= ${WRKDIR}/.work.log
720 PKG_DEFAULT_OPTIONS?
= # empty
721 PKG_OPTIONS?
= # empty
723 # we want this *before* compiler.mk, so that compiler.mk paths override them
724 .if
${X11_TYPE} != "modular" && defined
(USE_X11
)
725 PREPEND_PATH
+= ${X11BASE}/bin
727 PREPEND_PATH
+= ${LOCALBASE}/bin
729 # Wrapper framework definitions
730 .
include "wrapper/wrapper-defs.mk"
732 # Binary emulator framework definitions
733 .if defined
(EMUL_PLATFORMS
) && !empty
(EMUL_PLATFORMS
)
734 .
include "emulator/emulator-vars.mk"
737 # System features framework
738 .
include "features/features-vars.mk"
740 # Package system format definitions
741 .
include "pkgformat/bsd.pkgformat-vars.mk"
743 # Make variable definitions cache
744 .
include "bsd.makevars.mk"
746 # If MAKECONF is defined, then pass it down to all recursive make
747 # processes invoked by pkgsrc.
749 PKGSRC_MAKE_ENV
+= ${MAKECONF
:DMAKECONF
=${MAKECONF
:Q
}}
750 RECURSIVE_MAKE
= ${PKGSRC_SETENV} ${PKGSRC_MAKE_ENV} ${MAKE}
753 _USER_VARS.dirs
= DISTDIR LOCALBASE PACKAGES PKG_SYSCONFDIR WRKOBJDIR
754 _PKG_VARS.dirs
= WRKSRC PATCHDIR FILESDIR PKGDIR
755 _SYS_VARS.dirs
= WRKDIR DESTDIR PKG_SYSCONFBASEDIR
757 # List of 64bit operating systems with sizeof(int) != sizeof(void *).
758 # This can be used for software that is not 64bit clean.
760 # Keywords: ONLY_FOR_PLATFORM NOT_FOR_PLATFORM 64bit
762 LP64PLATFORMS
= *-*-alpha
*-*-sparc64
*-*-x86_64