pkgsrc/mk/bsd.prefs.mk

638 lines
18 KiB
Makefile
Raw Normal View History

# $NetBSD: bsd.prefs.mk,v 1.266 2007/09/07 21:55:44 jlam Exp $
#
# This file includes the mk.conf file, which contains the user settings.
#
# Packages should include this file before any of the .if directives, as
# well as before modifying variables like CFLAGS, LDFLAGS, and so on.
# Otherwise the behavior may be unexpected.
#
# When mk.conf is included by this file, the following variables are
# defined:
#
# ACCEPTABLE_LICENSES
# This variable is set to the list of Open Source licenses. See
# mk/license.mk for details.
#
# MACHINE_PLATFORM
# The platform for which the packages are built. It has the form
# ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}.
#
# NATIVE_MACHINE_PLATFORM
# The platform on which the packages are built. This is usually
# the same as ${MACHINE_PLATFORM}, but can be different when
# cross-building packages.
#
# PKGPATH
# The path of the package, relative to the pkgsrc top-level
# directory. Typical values look like editors/emacs or
# misc/openoffice-bin.
#
# Keywords: mk.conf user
#
2005-07-28 15:07:17 +02:00
.if !defined(BSD_PKG_MK)
# Let mk.conf know that this is pkgsrc.
BSD_PKG_MK=1
__PREFIX_SET__:=${PREFIX}
# Set PATH if not already set
.if !defined(PATH)
PATH=/bin:/usr/bin:/sbin:/usr/sbin
.endif
# Expand MAKE to a full path.
.if !defined(_MAKE)
_MAKE:= ${MAKE}
# allow for MAKE=./make and similar.
. if empty(_MAKE:M/*) && !empty(_MAKE:M*/*) && defined(PWD) && exists(${PWD}/${MAKE})
_MAKE:= ${PWD}/${MAKE}
. endif
. for _dir_ in ${PATH:C/\:/ /g}
. if empty(_MAKE:M/*)
. if exists(${_dir_}/${MAKE})
_MAKE:= ${_dir_}/${MAKE}
. endif
. endif
. endfor
. if !empty(_MAKE:M/*)
MAKEFLAGS+= _MAKE=${_MAKE:Q}
. endif
.endif
MAKE:= ${_MAKE}
.if exists(/usr/bin/uname)
UNAME=/usr/bin/uname
.elif exists(/bin/uname)
UNAME=/bin/uname
.else
UNAME=echo Unknown
.endif
.if !defined(OPSYS)
OPSYS:= ${:!${UNAME} -s!:S/-//g:S/\///g}
MAKEFLAGS+= OPSYS=${OPSYS:Q}
.endif
# The _CMD indirection allows code below to modify these values
# without executing the commands at all. Later, recursed make
# invocations will skip these blocks entirely thanks to MAKEFLAGS.
.if !defined(OS_VERSION)
_OS_VERSION_CMD= ${UNAME} -r
OS_VERSION= ${_OS_VERSION_CMD:sh}
MAKEFLAGS+= OS_VERSION=${OS_VERSION:Q}
.endif
.if !defined(LOWER_OS_VERSION)
_LOWER_OS_VERSION_CMD= echo ${OS_VERSION:Q} | tr 'A-Z' 'a-z'
LOWER_OS_VERSION= ${_LOWER_OS_VERSION_CMD:sh}
MAKEFLAGS+= LOWER_OS_VERSION=${LOWER_OS_VERSION:Q}
.endif
# Preload these for architectures not in all variations of bsd.own.mk,
# which do not match their GNU names exactly.
GNU_ARCH.arm26?= arm
GNU_ARCH.arm32?= arm
1999-08-12 16:16:25 +02:00
GNU_ARCH.i486?= i386
GNU_ARCH.i586?= i386
GNU_ARCH.i686?= i386
GNU_ARCH.m68000?= m68010
GNU_ARCH.mips?= mipsel
GNU_ARCH.sh3eb?= sh
GNU_ARCH.sh3el?= shle
NATIVE_MACHINE_GNU_ARCH?= ${GNU_ARCH.${NATIVE_MACHINE_ARCH}:U${NATIVE_MACHINE_ARCH}}
MACHINE_GNU_ARCH?= ${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
.if ${OPSYS} == "NetBSD"
LOWER_OPSYS?= netbsd
.elif ${OPSYS} == "AIX"
LOWER_ARCH!= _cpuid=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $$1 }'`; \
if /usr/sbin/lsattr -El $$_cpuid | grep ' POWER' >/dev/null 2>&1; then \
echo rs6000; \
else \
echo powerpc; \
fi
MACHINE_ARCH?= ${LOWER_ARCH}
. if exists(/usr/bin/oslevel)
_OS_VERSION!= /usr/bin/oslevel
. else
_OS_VERSION!= echo `${UNAME} -v`.`${UNAME} -r`
. endif
OS_VERSION= ${_OS_VERSION:C/\([0-9]*\.[0-9]*\).*/\1/}
LOWER_OS_VERSION= ${OS_VERSION}
LOWER_OPSYS_VERSUFFIX= ${_OS_VERSION}
LOWER_OPSYS?= aix
LOWER_VENDOR?= ibm
.elif ${OPSYS} == "BSDOS"
LOWER_OPSYS?= bsdi
.elif ${OPSYS} == "Darwin"
LOWER_OPSYS?= darwin
LOWER_ARCH!= ${UNAME} -p
MACHINE_ARCH= ${LOWER_ARCH}
MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
LOWER_OPSYS_VERSUFFIX= ${LOWER_OS_VERSION:C/([0-9]*).*/\1/}
LOWER_VENDOR?= apple
.elif ${OPSYS} == "DragonFly"
OS_VERSION:= ${OS_VERSION:C/-.*$//}
LOWER_OPSYS?= dragonfly
LOWER_ARCH!= ${UNAME} -p
MACHINE_ARCH= ${LOWER_ARCH}
MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
LOWER_VENDOR?= pc
.elif ${OPSYS} == "FreeBSD"
OS_VERSION:= ${OS_VERSION:C/-.*$//}
LOWER_OPSYS?= freebsd
LOWER_ARCH!= ${UNAME} -p
. if ${LOWER_ARCH} == "amd64"
MACHINE_ARCH= x86_64
. else
MACHINE_ARCH= ${LOWER_ARCH}
. endif
MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
LOWER_OPSYS_VERSUFFIX= ${LOWER_OS_VERSION:C/([0-9]*).*/\1/}
. if ${LOWER_ARCH} == "i386"
LOWER_VENDOR?= pc
. endif
LOWER_VENDOR?= unknown
.elif ${OPSYS} == "Interix"
LOWER_OPSYS?= interix3
LOWER_VENDOR?= pc
. if exists(/usr/lib/libc.so.3.5)
OS_VERSION= 3.5
. elif exists(/usr/lib/libc.so.3.1)
OS_VERSION= 3.1
. else
OS_VERSION= 3.0
. endif
LOWER_OS_VERSION= ${OS_VERSION}
.elif !empty(OPSYS:MIRIX*)
LOWER_ARCH!= ${UNAME} -p
LOWER_OPSYS?= irix${OS_VERSION}
LOWER_VENDOR?= sgi
.elif ${OPSYS} == "Linux"
LOWER_OPSYS?= linux
MACHINE_ARCH:= ${MACHINE_ARCH:C/i.86/i386/}
MACHINE_ARCH:= ${MACHINE_ARCH:C/ppc/powerpc/}
. if !defined(LOWER_ARCH)
2004-10-20 07:42:55 +02:00
LOWER_ARCH!= ${UNAME} -m | sed -e 's/i.86/i386/' -e 's/ppc/powerpc/'
. endif # !defined(LOWER_ARCH)
. if ${MACHINE_ARCH} == "unknown" || ${MACHINE_ARCH} == ""
MACHINE_ARCH= ${LOWER_ARCH}
MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
. endif
. if exists(/etc/debian_version)
LOWER_VENDOR?= debian
. elif exists(/etc/mandrake-release)
LOWER_VENDOR?= mandrake
. elif exists(/etc/redhat-version)
LOWER_VENDOR?= redhat
. elif exists(/etc/slackware-version)
LOWER_VENDOR?= slackware
. elif ${LOWER_ARCH} == "i386"
LOWER_VENDOR?= pc
. endif
LOWER_VENDOR?= unknown
1999-08-12 16:16:25 +02:00
.elif ${OPSYS} == "OSF1"
LOWER_ARCH!= ${UNAME} -p
MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
MACHINE_ARCH?= ${LOWER_ARCH}
OS_VERSION:= ${OS_VERSION:C/^V//}
LOWER_OPSYS?= osf${OS_VERSION}
LOWER_VENDOR?= dec
2007-04-14 16:17:49 +02:00
.elif ${OPSYS} == "HPUX"
OS_VERSION:= ${OS_VERSION:C/^B.//}
.if ${MACHINE_ARCH} == "9000"
MACHINE_ARCH= hppa
.endif
LOWER_VENDOR= hp
LOWER_OPSYS?= hpux${OS_VERSION}
.elif ${OPSYS} == "SunOS"
. if ${MACHINE_ARCH} == "sparc"
SPARC_TARGET_ARCH?= sparcv7
. elif ${MACHINE_ARCH} == "sun4"
MACHINE_ARCH= sparc
SPARC_TARGET_ARCH?= sparcv7
. elif ${MACHINE_ARCH} == "i86pc"
MACHINE_ARCH= i386
. elif ${MACHINE_ARCH} == "unknown"
. if !defined(LOWER_ARCH)
LOWER_ARCH!= ${UNAME} -p
. endif # !defined(LOWER_ARCH)
MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
. endif
LOWER_VENDOR?= sun
LOWER_OPSYS?= solaris
LOWER_OPSYS_VERSUFFIX= 2
.elif !defined(LOWER_OPSYS)
LOWER_OPSYS!= echo ${OPSYS} | tr A-Z a-z
.endif
# Now commit the [LOWER_]OS_VERSION values computed above, eliding the :sh
LOWER_OS_VERSION:= ${LOWER_OS_VERSION}
OS_VERSION:= ${OS_VERSION}
MAKEFLAGS+= LOWER_OPSYS=${LOWER_OPSYS:Q}
LOWER_VENDOR?= # empty ("arch--opsys")
LOWER_ARCH?= ${MACHINE_GNU_ARCH}
# Expand now as MACHINE_ARCH can be overriden in mk.conf and
# LOWER_ARCH is typically derived from it.
NATIVE_LOWER_ARCH:= ${LOWER_ARCH}
NATIVE_MACHINE_ARCH:= ${MACHINE_ARCH}
NATIVE_MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${NATIVE_MACHINE_ARCH}
MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}
NATIVE_MACHINE_GNU_PLATFORM?= ${NATIVE_LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
MACHINE_GNU_PLATFORM?= ${LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
# Needed to prevent an "install:" target from being created in bsd.own.mk.
NEED_OWN_INSTALL_TARGET=no
# This prevents default use of the cross-tool harness in the "src" tree,
# in the odd possible case of someone extracting "pkgsrc" underneath "src".
USETOOLS= no
MAKE_ENV+= USETOOLS=no
# Set this before <bsd.own.mk> does, since it doesn't know about Darwin
.if ${OPSYS} == "Darwin"
OBJECT_FMT?= Mach-O
.endif
# 2007Q3: uncomment this
#ACCEPTABLE_LICENSES?= ${DEFAULT_ACCEPTABLE_LICENSES}
# Provide PKGPATH early on so that mk.conf can use it.
PKGPATH?= ${.CURDIR:C|.*/([^/]*/[^/]*)$|\1|}
# Load the settings from MAKECONF, which is /etc/mk.conf by default.
.include <bsd.own.mk>
# /usr/share/mk/bsd.own.mk on NetBSD 1.3 does not define OBJECT_FMT
.if !empty(MACHINE_PLATFORM:MNetBSD-1.3*)
2003-09-16 10:09:04 +02:00
. if ${MACHINE_ARCH} == "alpha" || \
${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64"
OBJECT_FMT?= ELF
2003-09-16 10:09:04 +02:00
. else
OBJECT_FMT?= a.out
2003-09-16 10:09:04 +02:00
. endif
# override what bootstrap-pkgsrc sets, which isn't right for NetBSD
# 1.4.
# XXX other ELF platforms in 1.4 need to be added to here.
.elif !empty(MACHINE_PLATFORM:MNetBSD-1.4*)
. if ${MACHINE_ARCH} == "alpha" || \
${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64"
OBJECT_FMT= ELF
. else
OBJECT_FMT= a.out
. endif
.endif
.if ${OPSYS} == "OpenBSD"
. if defined(ELF_TOOLCHAIN) && ${ELF_TOOLCHAIN} == "yes"
OBJECT_FMT?= ELF
. else
OBJECT_FMT?= a.out
. endif
.elif ${OPSYS} == "DragonFly"
OBJECT_FMT= ELF
.elif ${OPSYS} == "AIX"
OBJECT_FMT= XCOFF
2007-04-11 21:09:24 +02:00
.elif ${OPSYS} == "OSF1"
OBJECT_FMT= ECOFF
2007-04-14 16:17:49 +02:00
.elif ${OPSYS} == "HPUX"
. if ${MACHINE_ARCH} == "ia64" || (defined(ABI) && ${ABI} == "64")
OBJECT_FMT= ELF
. else
OBJECT_FMT= SOM
. endif
.endif
# Calculate depth
.if exists(${.CURDIR}/mk/bsd.pkg.mk)
_PKGSRC_TOPDIR= ${.CURDIR}
.elif exists(${.CURDIR}/../mk/bsd.pkg.mk)
_PKGSRC_TOPDIR= ${.CURDIR}/..
.elif exists(${.CURDIR}/../../mk/bsd.pkg.mk)
_PKGSRC_TOPDIR= ${.CURDIR}/../..
.endif
# include the defaults file
.include "${_PKGSRC_TOPDIR}/mk/defaults/mk.conf"
SHAREOWN?= ${DOCOWN}
SHAREGRP?= ${DOCGRP}
SHAREMODE?= ${DOCMODE}
.if defined(PREFIX) && (${PREFIX} != ${__PREFIX_SET__})
.BEGIN:
2006-08-26 21:07:00 +02:00
@${ECHO_MSG} "You CANNOT set PREFIX manually or in mk.conf. Set LOCALBASE or X11BASE"
@${ECHO_MSG} "depending on your needs. See the pkg system documentation for more info."
@${FALSE}
.endif
2001-06-14 18:04:06 +02:00
# Load the OS-specific definitions for program variables. Default to loading
# the NetBSD ones if an OS-specific file doesn't exist.
.if exists(${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk)
. include "${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk"
.else
. include "${_PKGSRC_TOPDIR}/mk/platform/NetBSD.mk"
PKG_FAIL_REASON+= "missing mk/platform/${OPSYS}.mk"
2001-06-14 18:04:06 +02:00
.endif
PKGDIRMODE?= 755
# PKG_DESTDIR_SUPPORT can only be one of "destdir" or "user-destdir".
USE_DESTDIR?= no
PKG_DESTDIR_SUPPORT?= # empty
.if empty(PKG_DESTDIR_SUPPORT) || (empty(USE_DESTDIR:M[Yy][Ee][Ss]) && empty(USE_DESTDIR:M[Ff][Uu][Ll][Ll]))
_USE_DESTDIR= no
.elif ${PKG_DESTDIR_SUPPORT} == "user-destdir"
. if !empty(USE_DESTDIR:M[Ff][Uu][Ll][Ll])
_USE_DESTDIR= user-destdir
. else
_USE_DESTDIR= destdir
. endif
.elif ${PKG_DESTDIR_SUPPORT} == "destdir"
_USE_DESTDIR= destdir
.else
PKG_FAIL_REASON+= "PKG_DESTDIR_SUPPORT must be \`\`destdir'' or \`\`user-destdir''."
.endif
# When using staged installation, everything gets installed into
# ${DESTDIR}${PREFIX} instead of ${PREFIX} directly.
#
.if ${_USE_DESTDIR} != "no"
DESTDIR= ${WRKDIR}/.destdir
. if ${_USE_DESTDIR} == "destdir"
_MAKE_PACKAGE_AS_ROOT= yes
_MAKE_CLEAN_AS_ROOT= yes
_MAKE_INSTALL_AS_ROOT= yes
. elif ${_USE_DESTDIR} == "user-destdir"
_MAKE_PACKAGE_AS_ROOT= no
_MAKE_CLEAN_AS_ROOT= no
_MAKE_INSTALL_AS_ROOT= no
. endif
.else
DESTDIR=
.endif
_MAKE_CLEAN_AS_ROOT?= no
# Whether to run the clean target as root.
_MAKE_INSTALL_AS_ROOT?= yes
# Whether to run the install target as root.
_MAKE_PACKAGE_AS_ROOT?= yes
# Whether to run the package target as root.
# When cross-compilation support is requested, the following options
# must be specified as well or guessable:
# - MACHINE_ARCH is set to TARGET_ARCH if set.
# - CROSS_DESTDIR is guessed from MAKEOBJDIR and MACHINE_ARCH.
# - PKG_DBDIR is expanded and prefixed with CROSS_DESTDIR
# - DESTDIR support is required
#
# _CROSS_DESTDIR is set for internal use to avoid conditionalising
# the use.
.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
. if defined(TARGET_ARCH)
MACHINE_ARCH= ${TARGET_ARCH}
. endif
CROSS_DESTDIR?= ${MAKEOBJDIR}/destdir.${MACHINE_ARCH}
. if !exists(${CROSS_DESTDIR}/usr/include/stddef.h)
PKG_FAIL_REASON+= "The cross-compiling root ${CROSS_DESTDIR:Q} is incomplete"
. else
_CROSS_DESTDIR= ${CROSS_DESTDIR}
. endif
.endif
# Depends on MACHINE_ARCH override above
.if ${OPSYS} == "NetBSD"
. if ${OBJECT_FMT} == "ELF" && \
(${MACHINE_GNU_ARCH} == "arm" || \
${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH} == "m68k" || \
${MACHINE_ARCH} == "m68000" || \
${MACHINE_GNU_ARCH} == "sh" || \
${MACHINE_GNU_ARCH} == "shle" || \
${MACHINE_ARCH} == "sparc" || \
${MACHINE_ARCH} == "vax")
APPEND_ELF= elf
. endif
.endif
PKG_INSTALLATION_TYPES?= overwrite
# This is a whitespace-separated list of installation types supported
# by the package.
#
# *NOTE*: This variable *must* be set in the package Makefile *before*
# the inclusion of bsd.prefs.mk.
#
# Possible: any of: overwrite, pkgviews
# Default: overwrite
# Set the style of installation to be performed for the package. The
# funky make variable modifiers just select the first word of the value
# stored in the referenced variable.
#
.for _pref_ in ${PKG_INSTALLATION_PREFS}
. if !empty(PKG_INSTALLATION_TYPES:M${_pref_})
PKG_INSTALLATION_TYPE?= ${PKG_INSTALLATION_TYPES:M${_pref_}:S/^/_pkginsttype_/1:M_pkginsttype_*:S/^_pkginsttype_//}
. endif
.endfor
PKG_INSTALLATION_TYPE?= none
# if the system is IPv6-ready, compile with IPv6 support turned on.
.if defined(USE_INET6)
. if empty(USE_INET6:M[Yy][Ee][Ss])
USE_INET6= NO
. else
USE_INET6= YES
. endif
.elif empty(_OPSYS_HAS_INET6:M[nN][oO])
USE_INET6= YES
.else
USE_INET6= NO
.endif
LOCALBASE?= /usr/pkg
X11_TYPE?= native
.if !empty(X11_TYPE:Mnative)
. if ${OPSYS} == "SunOS"
# On Solaris, we default to using OpenWindows for X11.
X11BASE?= /usr/openwin
2007-04-14 16:17:49 +02:00
. elif ${OPSYS} == "IRIX" || ${OPSYS} == "OSF1" || ${OPSYS} == "HPUX"
X11BASE?= /usr
. else
X11BASE?= /usr/X11R6
. endif
.endif
CROSSBASE?= ${LOCALBASE}/cross
2001-03-13 10:53:37 +01:00
# If xpkgwedge.def is found, then clearly we're using xpkgwedge.
.if exists(${LOCALBASE}/lib/X11/config/xpkgwedge.def) || \
exists(${X11BASE}/lib/X11/config/xpkgwedge.def)
USE_XPKGWEDGE= yes
.elif defined(_OPSYS_NEEDS_XPKGWEDGE) && \
!empty(_OPSYS_NEEDS_XPKGWEDGE:M[yY][eE][sS])
USE_XPKGWEDGE= yes
.elif ${PKG_INSTALLATION_TYPE} == "pkgviews"
USE_XPKGWEDGE= yes
.elif ${X11_TYPE} == "modular"
USE_XPKGWEDGE= no
.else
USE_XPKGWEDGE?= yes
.endif
.if ${X11_TYPE} == "modular"
X11BASE= ${LOCALBASE}
.endif
2005-11-14 05:50:47 +01:00
.if !empty(USE_XPKGWEDGE:M[Yy][Ee][Ss])
X11PREFIX= ${LOCALBASE}
.else
X11PREFIX= ${X11BASE}
.endif
# Default directory for font encodings
X11_ENCODINGSDIR?= ${X11BASE}/lib/X11/fonts/encodings
DEPOT_SUBDIR?= packages
DEPOTBASE= ${LOCALBASE}/${DEPOT_SUBDIR}
# LINK_RPATH_FLAG publicly exports the linker flag used to set the
# run-time library search path.
#
.if defined(_OPSYS_LINKER_RPATH_FLAG)
LINKER_RPATH_FLAG= ${_OPSYS_LINKER_RPATH_FLAG}
.else
LINKER_RPATH_FLAG?= ${_LINKER_RPATH_FLAG}
.endif
# COMPILER_RPATH_FLAG publicly exports the compiler flag used to pass
# run-time library search path directives to the linker.
#
.if defined(_OPSYS_COMPILER_RPATH_FLAG)
COMPILER_RPATH_FLAG= ${_OPSYS_COMPILER_RPATH_FLAG}
.else
COMPILER_RPATH_FLAG?= ${_COMPILER_RPATH_FLAG}
.endif
# WHOLE_ARCHIVE_FLAG and NO_WHOLE_ARCHIVE_FLAG publically export the
# linker flags to extract all symbols from a static archive.
#
WHOLE_ARCHIVE_FLAG?= ${_OPSYS_WHOLE_ARCHIVE_FLAG}
NO_WHOLE_ARCHIVE_FLAG?= ${_OPSYS_NO_WHOLE_ARCHIVE_FLAG}
USE_TOOLS?= # empty
# Provide default values for TOOLs used by the top-level make.
USE_TOOLS+= [ awk dirname echo grep pwd sed test true
# These tools are used by the top-level make only in certain packages and
# should eventually be moved into those particular package Makefiles.
#
USE_TOOLS+= date tr
# These are tools used directly by bsd.prefs.mk and files included by
# bsd.prefs.mk.
#
USE_TOOLS+= awk:pkgsrc cut:pkgsrc echo:pkgsrc pwd:pkgsrc \
sed:pkgsrc tr:pkgsrc uname:pkgsrc
.include "${_PKGSRC_TOPDIR}/mk/tools/defaults.mk"
.if !defined(_PKGSRCDIR)
_PKGSRCDIR!= cd ${_PKGSRC_TOPDIR} && ${PWD_CMD}
MAKEFLAGS+= _PKGSRCDIR=${_PKGSRCDIR:Q}
.endif
PKGSRCDIR= ${_PKGSRCDIR}
DISTDIR?= ${PKGSRCDIR}/distfiles
PACKAGES?= ${PKGSRCDIR}/packages
TEMPLATES?= ${PKGSRCDIR}/templates
PATCHDIR?= ${.CURDIR}/patches
FILESDIR?= ${.CURDIR}/files
PKGDIR?= ${.CURDIR}
_PKGSRC_DEPS?= # empty
# If WRKOBJDIR is set, use that tree to build
2002-11-01 07:19:47 +01:00
.if defined(WRKOBJDIR)
BUILD_DIR?= ${WRKOBJDIR}/${PKGPATH}
.else
BUILD_DIR!= cd ${.CURDIR} && ${PWD_CMD}
.endif
# If OBJHOSTNAME is set, use first component of hostname in directory name.
# If OBJMACHINE is set, use ${MACHINE_ARCH} in the working directory name.
#
.if defined(OBJHOSTNAME)
. if !defined(_HOSTNAME)
2002-12-10 13:50:48 +01:00
_HOSTNAME!= ${UNAME} -n
MAKEFLAGS+= _HOSTNAME=${_HOSTNAME:Q}
. endif
WRKDIR_BASENAME?= work.${_HOSTNAME:C|\..*||}
MAKEFLAGS+= OBJHOSTNAME=${OBJHOSTNAME:Q}
.elif defined(OBJMACHINE)
WRKDIR_BASENAME?= work.${MACHINE_ARCH}
MAKEFLAGS+= OBJMACHINE=${OBJMACHINE:Q}
.else
WRKDIR_BASENAME?= work
2002-12-10 13:50:48 +01:00
.endif
WRKDIR?= ${BUILD_DIR}/${WRKDIR_BASENAME}
# There are many uses for a common log file, so define one that may be
# picked up and used by tools.mk, bsd.buildlink3.mk, etc.
#
WRKLOG?= ${WRKDIR}/.work.log
bsd.options.mk provides boilerplate code for standard naming conventions for handling per-package build options. Before including this file, the following variables should be defined: PKG_OPTIONS_VAR This is a list of the name of the make(1) variables that contain the options the user wishes to select. This variable should be set in a package Makefile. E.g., PKG_OPTIONS_VAR= WIBBLE_OPTIONS or PKG_OPTIONS_VAR= FOO_OPTIONS BAR_OPTIONS PKG_SUPPORTED_OPTIONS This is a list of build options supported by the package. This variable should be set in a package Makefile. E.g., PKG_SUPPORTED_OPTIONS= kerberos ldap ssl Optionally, the following variables may also be defined: PKG_DEFAULT_OPTIONS This is a list the options that should be built into every package, if that option is supported. This variable should be set in /etc/mk.conf. ${PKG_OPTIONS_VAR} (the variables named in PKG_OPTIONS_VAR) These variables list the selected build options and override any default options given in PKG_DEFAULT_OPTIONS. If any of the options begin with a '-', then that option is always removed from the selected build options, e.g. PKG_DEFAULT_OPTIONS= kerberos ldap sasl PKG_OPTIONS_VAR= WIBBLE_OPTIONS WIBBLE_OPTIONS= ${PKG_DEFAULT_OPTIONS} -sasl # implies PKG_OPTIONS == "kerberos ldap" or PKG_OPTIONS_VAR= WIBBLE_OPTIONS WIBBLE_OPTIONS= kerberos -ldap ldap # implies PKG_OPTIONS == "kerberos" This variable should be set in /etc/mk.conf. PKG_FAIL_UNSUPPORTED_OPTIONS If this is set to "yes", then the presence of unsupported options in PKG_OPTIONS.<pkg> (see below) causes the build to fail. Set this to "no" to silently ignore unsupported options. Default: "yes". After including this file, the following variables are defined: PKG_OPTIONS This is the list of the selected build options, properly filtered to remove unsupported and duplicate options. Example usage: -------------8<-------------8<-------------8<-------------8<------------- # Global and legacy options .if defined(USE_OPENLDAP) || defined(USE_SASL2) . if !defined(PKG_OPTIONS.wibble) . if defined(USE_OPENLDAP) && !empty(USE_OPENLDAP:M[yY][eE][sS]) PKG_OPTIONS.wibble+= ldap . endif . if defined(USE_SASL2) && !empty(USE_SASL2:M[yY][eE][sS]) PKG_OPTIONS.wibble+= sasl . endif . endif .endif PKG_OPTIONS_VAR= PKG_OPTIONS.wibble PKG_SUPPORTED_OPTIONS= ldap sasl .include "../../mk/bsd.options.mk" # Package-specific option-handling ### ### LDAP support ### .if !empty(PKG_OPTIONS:Mldap) . include "../../databases/openldap/buildlink3.mk" CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} .endif ### ### SASL authentication ### .if !empty(PKG_OPTIONS:Msasl) . include "../../security/cyrus-sasl2/buildlink3.mk" CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} .endif -------------8<-------------8<-------------8<-------------8<-------------
2004-07-30 22:59:08 +02:00
PKG_DEFAULT_OPTIONS?= # empty
PKG_OPTIONS?= # empty
# we want this *before* compiler.mk, so that compiler.mk paths override them
.if ${X11_TYPE} != "modular" && defined(USE_X11)
PREPEND_PATH+= ${X11BASE}/bin
.endif
PREPEND_PATH+= ${LOCALBASE}/bin
# Wrapper framework definitions
.include "${PKGSRCDIR}/mk/wrapper/wrapper-defs.mk"
* Add new emulator framework in pkgsrc/mk/emulator that handles all binary-only packages that require binary "emulation" on the native operating system. Please see pkgsrc/mk/emulator/README for more details. * Teach the plist framework to automatically use any existing PLIST.${EMUL_PLATFORM} as part of the default PLIST_SRC definition. * Convert all of the binary-only packages in pkgsrc to use the emulator framework. Most of them have been tested to install and deinstall correctly. This involves the following cleanup actions: * Remove use of custom PLIST code and use PLIST.${EMUL_PLATFORM} more consistently. * Simplify packages by using default INSTALL and DEINSTALL scripts instead of custom INSTALL/DEINSTALL code. * Remove "SUSE_COMPAT32" and "PKG_OPTIONS.suse" from pkgsrc. Packages only need to state exactly which emulations they support, and the framework handles any i386-on-x86_64 or sparc-on-sparc64 uses. * Remove "USE_NATIVE_LINUX" from pkgsrc. The framework will automatically detect when the package is installing on Linux. Specific changes to packages include: * Bump the PKGREVISIONs for all of the suse100* and suse91* packages due to changes in the +INSTALL/+DEINSTALL scripts used in all of the packages. * Remove pkgsrc/emulators/suse_linux, which is unused by any packages. * cad/lc -- remove custom code to create the distinfo file for all supported platforms; just use "emul-fetch" and "emul-distinfo" instead. * lang/Cg-compiler -- install the shared libraries under ${EMULDIR} instead of ${PREFIX}/lib so that compiled programs will find the shared libraries. * mail/thunderbird-bin-nightly -- update to latest binary distributions for supported platforms. * multimedia/ns-flash -- update Linux version to 9.0.48 as the older version is no longer available for interactive fetch. * security/uvscan -- set LD_LIBRARY_PATH explicitly so that it's not necessary to install library symlinks into ${EMULDIR}/usr/local/lib. * www/firefox-bin-flash -- update Linux version to 9.0.48 as the older version is no longer available for interactive fetch.
2007-07-29 07:18:36 +02:00
# Binary emulator framework definitions
.if defined(EMUL_PLATFORMS) && !empty(EMUL_PLATFORMS)
. include "${PKGSRCDIR}/mk/emulator/emulator-vars.mk"
.endif
# System features framework
.include "${PKGSRCDIR}/mk/features/features-vars.mk"
# Package system flavor definitions
.include "${PKGSRCDIR}/mk/flavor/bsd.flavor-vars.mk"
# Make variable definitions cache
.include "${PKGSRCDIR}/mk/bsd.makevars.mk"
# If MAKECONF is defined, then pass it down to all recursive make
# processes invoked by pkgsrc.
#
PKGSRC_MAKE_ENV+= ${MAKECONF:DMAKECONF=${MAKECONF:Q}}
RECURSIVE_MAKE= ${SETENV} ${PKGSRC_MAKE_ENV} ${MAKE}
.endif # BSD_PKG_MK