2006-02-02 14:46:37 +01:00
|
|
|
# $NetBSD: bsd.prefs.mk,v 1.219 2006/02/02 13:46:37 joerg Exp $
|
1998-06-03 13:15:29 +02:00
|
|
|
#
|
|
|
|
# Make file, included to get the site preferences, if any. Should
|
|
|
|
# only be included by package Makefiles before any .if defined()
|
Implement some parts of proposals posted to tech-pkg:
- Define OS_VERSION in bsd.prefs.mk (...if not already defined). Previously
was only set in a conditional block in bsd.pkg.mk.
- Define new values, MACHINE_PLATFORM and MACHINE_GNU_PLATFORM, which
default to ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} and
${LOWER_OPSYS}-${LOWER_VENDOR}-${LOWER_ARCH} respectively.
(Probably should nuke LOWER_ARCH and rename LOWER_VENDOR to something
like MACHINE_GNU_VENDOR.)
- Use ${MACHINE_GNU_PLATFORM} as the argument to `--host' in GNU_CONFIGURE
packages.
- Allow for ONLY_FOR_PLATFORM and NOT_FOR_PLATFORM, lists of patterns
in csh(1) glob style which are matched against MACHINE_PLATFORM above
and take the place of {ONLY,NOT}_FOR_{ARCHS,OPSYS}. (For now, until
all pkgs are converted, provide backwards compatibility.) *Both* may
be defined, in which case NOT_FOR_PLATFORM takes precedence.
- Also do some significant aesthetic cleanup, based on the idea
`define platform-specific overrides first, then define a generic case
with the ?= operator'. Lots more of this to do yet.
1999-05-24 20:42:00 +02:00
|
|
|
# statements or modifications to "passed" variables (CFLAGS, LDFLAGS, ...),
|
|
|
|
# to make sure any variables defined in /etc/mk.conf, $MAKECONF, or
|
|
|
|
# the system defaults (sys.mk and bsd.own.mk) are used.
|
1998-06-03 13:15:29 +02:00
|
|
|
|
1999-05-24 00:10:01 +02:00
|
|
|
# Do not recursively include mk.conf, redefine OPSYS, include bsd.own.mk, etc.
|
2005-07-28 15:07:17 +02:00
|
|
|
|
|
|
|
# Some variables defined here:
|
|
|
|
# OPSYS
|
|
|
|
# The operating system name, as returned by ``uname -s''.
|
|
|
|
|
2005-05-14 03:51:52 +02:00
|
|
|
.if !defined(BSD_PKG_MK)
|
1999-05-24 00:10:01 +02:00
|
|
|
|
Implement some parts of proposals posted to tech-pkg:
- Define OS_VERSION in bsd.prefs.mk (...if not already defined). Previously
was only set in a conditional block in bsd.pkg.mk.
- Define new values, MACHINE_PLATFORM and MACHINE_GNU_PLATFORM, which
default to ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} and
${LOWER_OPSYS}-${LOWER_VENDOR}-${LOWER_ARCH} respectively.
(Probably should nuke LOWER_ARCH and rename LOWER_VENDOR to something
like MACHINE_GNU_VENDOR.)
- Use ${MACHINE_GNU_PLATFORM} as the argument to `--host' in GNU_CONFIGURE
packages.
- Allow for ONLY_FOR_PLATFORM and NOT_FOR_PLATFORM, lists of patterns
in csh(1) glob style which are matched against MACHINE_PLATFORM above
and take the place of {ONLY,NOT}_FOR_{ARCHS,OPSYS}. (For now, until
all pkgs are converted, provide backwards compatibility.) *Both* may
be defined, in which case NOT_FOR_PLATFORM takes precedence.
- Also do some significant aesthetic cleanup, based on the idea
`define platform-specific overrides first, then define a generic case
with the ?= operator'. Lots more of this to do yet.
1999-05-24 20:42:00 +02:00
|
|
|
# Let mk.conf know that this is pkgsrc.
|
2003-01-15 11:06:48 +01:00
|
|
|
BSD_PKG_MK=1
|
Implement some parts of proposals posted to tech-pkg:
- Define OS_VERSION in bsd.prefs.mk (...if not already defined). Previously
was only set in a conditional block in bsd.pkg.mk.
- Define new values, MACHINE_PLATFORM and MACHINE_GNU_PLATFORM, which
default to ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} and
${LOWER_OPSYS}-${LOWER_VENDOR}-${LOWER_ARCH} respectively.
(Probably should nuke LOWER_ARCH and rename LOWER_VENDOR to something
like MACHINE_GNU_VENDOR.)
- Use ${MACHINE_GNU_PLATFORM} as the argument to `--host' in GNU_CONFIGURE
packages.
- Allow for ONLY_FOR_PLATFORM and NOT_FOR_PLATFORM, lists of patterns
in csh(1) glob style which are matched against MACHINE_PLATFORM above
and take the place of {ONLY,NOT}_FOR_{ARCHS,OPSYS}. (For now, until
all pkgs are converted, provide backwards compatibility.) *Both* may
be defined, in which case NOT_FOR_PLATFORM takes precedence.
- Also do some significant aesthetic cleanup, based on the idea
`define platform-specific overrides first, then define a generic case
with the ?= operator'. Lots more of this to do yet.
1999-05-24 20:42:00 +02:00
|
|
|
__PREFIX_SET__:=${PREFIX}
|
1998-11-27 00:39:15 +01:00
|
|
|
|
2005-12-28 02:00:46 +01:00
|
|
|
# Set PATH if not already set
|
|
|
|
.if !defined(PATH)
|
|
|
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
|
|
|
.endif
|
|
|
|
|
2004-02-06 05:37:02 +01:00
|
|
|
# Expand MAKE to a full path.
|
|
|
|
.if !defined(_MAKE)
|
|
|
|
_MAKE:= ${MAKE}
|
|
|
|
. for _dir_ in ${PATH:C/\:/ /g}
|
|
|
|
. if empty(_MAKE:M/*)
|
|
|
|
. if exists(${_dir_}/${MAKE})
|
|
|
|
_MAKE:= ${_dir_}/${MAKE}
|
|
|
|
. endif
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. if !empty(_MAKE:M/*)
|
2004-02-06 20:04:24 +01:00
|
|
|
MAKEFLAGS+= _MAKE=${_MAKE:Q}
|
2004-02-06 05:37:02 +01:00
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
MAKE:= ${_MAKE}
|
|
|
|
|
1999-06-23 19:06:20 +02:00
|
|
|
.if exists(/usr/bin/uname)
|
|
|
|
UNAME=/usr/bin/uname
|
|
|
|
.elif exists(/bin/uname)
|
|
|
|
UNAME=/bin/uname
|
|
|
|
.else
|
|
|
|
UNAME=echo Unknown
|
|
|
|
.endif
|
|
|
|
|
2004-03-09 21:39:50 +01:00
|
|
|
.if exists(/usr/bin/cut)
|
|
|
|
CUT=/usr/bin/cut
|
|
|
|
.elif exists(/bin/cut)
|
|
|
|
CUT=/bin/cut
|
|
|
|
.else
|
|
|
|
CUT=echo Unknown
|
|
|
|
.endif
|
|
|
|
|
2005-05-14 03:51:52 +02:00
|
|
|
.if !defined(OPSYS)
|
2003-12-03 22:48:33 +01:00
|
|
|
OPSYS!= ${UNAME} -s | tr -d /
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= OPSYS=${OPSYS:Q}
|
2005-11-01 17:18:33 +01:00
|
|
|
.endif
|
2005-11-01 17:30:05 +01:00
|
|
|
|
|
|
|
# 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.
|
2005-05-14 03:51:52 +02:00
|
|
|
.if !defined(OS_VERSION)
|
2005-11-01 17:30:05 +01:00
|
|
|
_OS_VERSION_CMD= ${UNAME} -r
|
|
|
|
OS_VERSION= ${_OS_VERSION_CMD:sh}
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= OS_VERSION=${OS_VERSION:Q}
|
1998-06-03 13:15:29 +02:00
|
|
|
.endif
|
2005-05-14 03:51:52 +02:00
|
|
|
.if !defined(LOWER_OS_VERSION)
|
2005-11-01 17:30:05 +01:00
|
|
|
_LOWER_OS_VERSION_CMD= echo ${OS_VERSION} | tr 'A-Z' 'a-z'
|
|
|
|
LOWER_OS_VERSION= ${_LOWER_OS_VERSION_CMD:sh}
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= LOWER_OS_VERSION=${LOWER_OS_VERSION:Q}
|
2001-12-12 13:31:14 +01:00
|
|
|
.endif
|
1998-06-03 13:15:29 +02:00
|
|
|
|
2005-11-01 17:11:16 +01:00
|
|
|
# Preload these for architectures not in all variations of bsd.own.mk,
|
|
|
|
# which do not match their GNU names exactly.
|
2002-03-18 06:46:42 +01:00
|
|
|
GNU_ARCH.arm26?= arm
|
Implement some parts of proposals posted to tech-pkg:
- Define OS_VERSION in bsd.prefs.mk (...if not already defined). Previously
was only set in a conditional block in bsd.pkg.mk.
- Define new values, MACHINE_PLATFORM and MACHINE_GNU_PLATFORM, which
default to ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} and
${LOWER_OPSYS}-${LOWER_VENDOR}-${LOWER_ARCH} respectively.
(Probably should nuke LOWER_ARCH and rename LOWER_VENDOR to something
like MACHINE_GNU_VENDOR.)
- Use ${MACHINE_GNU_PLATFORM} as the argument to `--host' in GNU_CONFIGURE
packages.
- Allow for ONLY_FOR_PLATFORM and NOT_FOR_PLATFORM, lists of patterns
in csh(1) glob style which are matched against MACHINE_PLATFORM above
and take the place of {ONLY,NOT}_FOR_{ARCHS,OPSYS}. (For now, until
all pkgs are converted, provide backwards compatibility.) *Both* may
be defined, in which case NOT_FOR_PLATFORM takes precedence.
- Also do some significant aesthetic cleanup, based on the idea
`define platform-specific overrides first, then define a generic case
with the ?= operator'. Lots more of this to do yet.
1999-05-24 20:42:00 +02:00
|
|
|
GNU_ARCH.arm32?= arm
|
1999-08-12 16:16:25 +02:00
|
|
|
GNU_ARCH.i486?= i386
|
|
|
|
GNU_ARCH.i586?= i386
|
|
|
|
GNU_ARCH.i686?= i386
|
2002-03-18 06:46:42 +01:00
|
|
|
GNU_ARCH.m68000?= m68010
|
Implement some parts of proposals posted to tech-pkg:
- Define OS_VERSION in bsd.prefs.mk (...if not already defined). Previously
was only set in a conditional block in bsd.pkg.mk.
- Define new values, MACHINE_PLATFORM and MACHINE_GNU_PLATFORM, which
default to ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} and
${LOWER_OPSYS}-${LOWER_VENDOR}-${LOWER_ARCH} respectively.
(Probably should nuke LOWER_ARCH and rename LOWER_VENDOR to something
like MACHINE_GNU_VENDOR.)
- Use ${MACHINE_GNU_PLATFORM} as the argument to `--host' in GNU_CONFIGURE
packages.
- Allow for ONLY_FOR_PLATFORM and NOT_FOR_PLATFORM, lists of patterns
in csh(1) glob style which are matched against MACHINE_PLATFORM above
and take the place of {ONLY,NOT}_FOR_{ARCHS,OPSYS}. (For now, until
all pkgs are converted, provide backwards compatibility.) *Both* may
be defined, in which case NOT_FOR_PLATFORM takes precedence.
- Also do some significant aesthetic cleanup, based on the idea
`define platform-specific overrides first, then define a generic case
with the ?= operator'. Lots more of this to do yet.
1999-05-24 20:42:00 +02:00
|
|
|
GNU_ARCH.mips?= mipsel
|
2002-03-18 06:46:42 +01:00
|
|
|
GNU_ARCH.sh3eb?= sh
|
|
|
|
GNU_ARCH.sh3el?= shle
|
2005-11-01 17:11:16 +01:00
|
|
|
MACHINE_GNU_ARCH?= ${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
|
1998-08-19 18:23:40 +02:00
|
|
|
|
1999-07-08 09:58:42 +02:00
|
|
|
.if ${OPSYS} == "NetBSD"
|
|
|
|
LOWER_OPSYS?= netbsd
|
2001-08-24 11:00:44 +02:00
|
|
|
|
2005-11-01 17:18:33 +01:00
|
|
|
.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!= echo ${_OS_VERSION} | sed -e 's,\([0-9]*\.[0-9]*\).*,\1,'
|
|
|
|
LOWER_OS_VERSION= ${OS_VERSION}
|
|
|
|
LOWER_OPSYS_VERSUFFIX= ${_OS_VERSION}
|
|
|
|
LOWER_OPSYS?= aix
|
|
|
|
LOWER_VENDOR?= ibm
|
|
|
|
|
2003-12-11 23:35:50 +01:00
|
|
|
.elif ${OPSYS} == "BSDOS"
|
|
|
|
LOWER_OPSYS?= bsdi
|
|
|
|
|
2005-11-01 17:18:33 +01:00
|
|
|
.elif ${OPSYS} == "Darwin"
|
|
|
|
LOWER_OPSYS?= darwin
|
2002-11-17 16:11:40 +01:00
|
|
|
LOWER_ARCH!= ${UNAME} -p
|
|
|
|
MACHINE_ARCH= ${LOWER_ARCH}
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
|
2005-11-01 17:18:33 +01:00
|
|
|
LOWER_VENDOR?= apple
|
2002-11-17 16:11:40 +01:00
|
|
|
|
2004-10-31 23:05:02 +01:00
|
|
|
.elif ${OPSYS} == "DragonFly"
|
2006-01-12 15:57:19 +01:00
|
|
|
OS_VERSION:= ${OS_VERSION:C/-.*$//}
|
2004-10-31 23:05:02 +01:00
|
|
|
LOWER_OPSYS?= dragonfly
|
|
|
|
LOWER_ARCH!= ${UNAME} -p
|
|
|
|
MACHINE_ARCH= ${LOWER_ARCH}
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
|
2004-10-31 23:05:02 +01:00
|
|
|
LOWER_VENDOR?= pc
|
|
|
|
|
2005-11-01 17:18:33 +01:00
|
|
|
.elif ${OPSYS} == "FreeBSD"
|
|
|
|
LOWER_OPSYS?= freebsd
|
2003-04-21 03:54:33 +02:00
|
|
|
LOWER_ARCH!= ${UNAME} -p
|
2005-11-01 17:18:33 +01:00
|
|
|
MACHINE_ARCH= ${LOWER_ARCH}
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
|
2005-11-01 17:18:33 +01:00
|
|
|
LOWER_OPSYS_VERSUFFIX!= echo ${LOWER_OS_VERSION} | ${CUT} -c -1
|
|
|
|
. if ${LOWER_ARCH} == "i386"
|
|
|
|
LOWER_VENDOR?= pc
|
2002-10-12 19:17:22 +02:00
|
|
|
. endif
|
2005-11-01 17:30:05 +01:00
|
|
|
LOWER_VENDOR?= unknown
|
2005-11-01 17:18:33 +01:00
|
|
|
|
|
|
|
.elif ${OPSYS} == "Interix"
|
|
|
|
LOWER_OPSYS?= interix3
|
|
|
|
LOWER_VENDOR?= pc
|
2005-11-01 17:30:05 +01:00
|
|
|
. 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}
|
2005-11-01 17:18:33 +01:00
|
|
|
|
|
|
|
.elif !empty(OPSYS:MIRIX*)
|
|
|
|
LOWER_ARCH!= ${UNAME} -p
|
|
|
|
LOWER_OPSYS?= irix${OS_VERSION}
|
|
|
|
LOWER_VENDOR?= sgi
|
2001-08-24 11:00:44 +02:00
|
|
|
|
1999-07-08 09:58:42 +02:00
|
|
|
.elif ${OPSYS} == "Linux"
|
|
|
|
LOWER_OPSYS?= linux
|
2003-01-12 23:30:08 +01:00
|
|
|
MACHINE_ARCH:= ${MACHINE_ARCH:C/i.86/i386/}
|
2004-10-20 01:16:47 +02:00
|
|
|
MACHINE_ARCH:= ${MACHINE_ARCH:C/ppc/powerpc/}
|
2003-01-14 04:01:37 +01:00
|
|
|
. 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/'
|
2003-01-14 04:01:37 +01:00
|
|
|
. endif # !defined(LOWER_ARCH)
|
2003-07-09 13:38:17 +02:00
|
|
|
. if ${MACHINE_ARCH} == "unknown" || ${MACHINE_ARCH} == ""
|
2001-05-17 17:00:26 +02:00
|
|
|
MACHINE_ARCH= ${LOWER_ARCH}
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
|
2003-01-25 23:39:56 +01:00
|
|
|
. 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
|
2000-06-03 09:16:51 +02:00
|
|
|
. endif
|
2005-11-01 17:30:05 +01:00
|
|
|
LOWER_VENDOR?= unknown
|
1999-08-12 16:16:25 +02:00
|
|
|
|
2004-11-20 05:37:08 +01:00
|
|
|
.elif ${OPSYS} == "OSF1"
|
|
|
|
LOWER_ARCH!= ${UNAME} -p
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
|
2004-11-20 05:37:08 +01:00
|
|
|
MACHINE_ARCH?= ${LOWER_ARCH}
|
2005-11-01 17:30:05 +01:00
|
|
|
OS_VERSION:= ${OS_VERSION:C/^V//}
|
2004-11-20 05:37:08 +01:00
|
|
|
LOWER_OPSYS?= osf${OS_VERSION}
|
|
|
|
LOWER_VENDOR?= dec
|
|
|
|
|
2005-11-01 17:18:33 +01:00
|
|
|
.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)
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
|
2005-02-17 08:11:59 +01:00
|
|
|
. endif
|
2005-11-01 17:18:33 +01:00
|
|
|
LOWER_VENDOR?= sun
|
|
|
|
LOWER_OPSYS?= solaris
|
|
|
|
LOWER_OPSYS_VERSUFFIX= 2
|
2005-02-17 08:11:59 +01:00
|
|
|
|
1999-07-08 09:58:42 +02:00
|
|
|
.elif !defined(LOWER_OPSYS)
|
2003-01-12 23:36:14 +01:00
|
|
|
LOWER_OPSYS!= echo ${OPSYS} | tr A-Z a-z
|
Implement some parts of proposals posted to tech-pkg:
- Define OS_VERSION in bsd.prefs.mk (...if not already defined). Previously
was only set in a conditional block in bsd.pkg.mk.
- Define new values, MACHINE_PLATFORM and MACHINE_GNU_PLATFORM, which
default to ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} and
${LOWER_OPSYS}-${LOWER_VENDOR}-${LOWER_ARCH} respectively.
(Probably should nuke LOWER_ARCH and rename LOWER_VENDOR to something
like MACHINE_GNU_VENDOR.)
- Use ${MACHINE_GNU_PLATFORM} as the argument to `--host' in GNU_CONFIGURE
packages.
- Allow for ONLY_FOR_PLATFORM and NOT_FOR_PLATFORM, lists of patterns
in csh(1) glob style which are matched against MACHINE_PLATFORM above
and take the place of {ONLY,NOT}_FOR_{ARCHS,OPSYS}. (For now, until
all pkgs are converted, provide backwards compatibility.) *Both* may
be defined, in which case NOT_FOR_PLATFORM takes precedence.
- Also do some significant aesthetic cleanup, based on the idea
`define platform-specific overrides first, then define a generic case
with the ?= operator'. Lots more of this to do yet.
1999-05-24 20:42:00 +02:00
|
|
|
.endif
|
2001-08-24 11:00:44 +02:00
|
|
|
|
2005-11-01 17:30:05 +01:00
|
|
|
# Now commit the [LOWER_]OS_VERSION values computed above, eliding the :sh
|
|
|
|
LOWER_OS_VERSION:= ${LOWER_OS_VERSION}
|
|
|
|
OS_VERSION:= ${OS_VERSION}
|
|
|
|
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= LOWER_OPSYS=${LOWER_OPSYS:Q}
|
Implement some parts of proposals posted to tech-pkg:
- Define OS_VERSION in bsd.prefs.mk (...if not already defined). Previously
was only set in a conditional block in bsd.pkg.mk.
- Define new values, MACHINE_PLATFORM and MACHINE_GNU_PLATFORM, which
default to ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} and
${LOWER_OPSYS}-${LOWER_VENDOR}-${LOWER_ARCH} respectively.
(Probably should nuke LOWER_ARCH and rename LOWER_VENDOR to something
like MACHINE_GNU_VENDOR.)
- Use ${MACHINE_GNU_PLATFORM} as the argument to `--host' in GNU_CONFIGURE
packages.
- Allow for ONLY_FOR_PLATFORM and NOT_FOR_PLATFORM, lists of patterns
in csh(1) glob style which are matched against MACHINE_PLATFORM above
and take the place of {ONLY,NOT}_FOR_{ARCHS,OPSYS}. (For now, until
all pkgs are converted, provide backwards compatibility.) *Both* may
be defined, in which case NOT_FOR_PLATFORM takes precedence.
- Also do some significant aesthetic cleanup, based on the idea
`define platform-specific overrides first, then define a generic case
with the ?= operator'. Lots more of this to do yet.
1999-05-24 20:42:00 +02:00
|
|
|
|
2005-11-01 17:18:33 +01:00
|
|
|
LOWER_VENDOR?= # empty ("arch--opsys")
|
Implement some parts of proposals posted to tech-pkg:
- Define OS_VERSION in bsd.prefs.mk (...if not already defined). Previously
was only set in a conditional block in bsd.pkg.mk.
- Define new values, MACHINE_PLATFORM and MACHINE_GNU_PLATFORM, which
default to ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} and
${LOWER_OPSYS}-${LOWER_VENDOR}-${LOWER_ARCH} respectively.
(Probably should nuke LOWER_ARCH and rename LOWER_VENDOR to something
like MACHINE_GNU_VENDOR.)
- Use ${MACHINE_GNU_PLATFORM} as the argument to `--host' in GNU_CONFIGURE
packages.
- Allow for ONLY_FOR_PLATFORM and NOT_FOR_PLATFORM, lists of patterns
in csh(1) glob style which are matched against MACHINE_PLATFORM above
and take the place of {ONLY,NOT}_FOR_{ARCHS,OPSYS}. (For now, until
all pkgs are converted, provide backwards compatibility.) *Both* may
be defined, in which case NOT_FOR_PLATFORM takes precedence.
- Also do some significant aesthetic cleanup, based on the idea
`define platform-specific overrides first, then define a generic case
with the ?= operator'. Lots more of this to do yet.
1999-05-24 20:42:00 +02:00
|
|
|
LOWER_ARCH?= ${MACHINE_GNU_ARCH}
|
|
|
|
|
|
|
|
MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}
|
2003-10-23 20:11:49 +02:00
|
|
|
MACHINE_GNU_PLATFORM?= ${LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
|
Implement some parts of proposals posted to tech-pkg:
- Define OS_VERSION in bsd.prefs.mk (...if not already defined). Previously
was only set in a conditional block in bsd.pkg.mk.
- Define new values, MACHINE_PLATFORM and MACHINE_GNU_PLATFORM, which
default to ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} and
${LOWER_OPSYS}-${LOWER_VENDOR}-${LOWER_ARCH} respectively.
(Probably should nuke LOWER_ARCH and rename LOWER_VENDOR to something
like MACHINE_GNU_VENDOR.)
- Use ${MACHINE_GNU_PLATFORM} as the argument to `--host' in GNU_CONFIGURE
packages.
- Allow for ONLY_FOR_PLATFORM and NOT_FOR_PLATFORM, lists of patterns
in csh(1) glob style which are matched against MACHINE_PLATFORM above
and take the place of {ONLY,NOT}_FOR_{ARCHS,OPSYS}. (For now, until
all pkgs are converted, provide backwards compatibility.) *Both* may
be defined, in which case NOT_FOR_PLATFORM takes precedence.
- Also do some significant aesthetic cleanup, based on the idea
`define platform-specific overrides first, then define a generic case
with the ?= operator'. Lots more of this to do yet.
1999-05-24 20:42:00 +02:00
|
|
|
|
2004-02-14 04:26:09 +01:00
|
|
|
# Needed to prevent an "install:" target from being created in bsd.own.mk.
|
2001-09-21 17:28:35 +02:00
|
|
|
NEED_OWN_INSTALL_TARGET=no
|
|
|
|
|
2001-11-28 20:58:13 +01:00
|
|
|
# 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
|
|
|
|
|
2002-05-31 00:15:40 +02:00
|
|
|
# Set this before <bsd.own.mk> does, since it doesn't know about Darwin
|
|
|
|
.if ${OPSYS} == "Darwin"
|
|
|
|
OBJECT_FMT?= Mach-O
|
|
|
|
.endif
|
|
|
|
|
2005-11-10 10:09:26 +01:00
|
|
|
# Load the settings from MAKECONF, which is /etc/mk.conf by default.
|
2002-06-21 23:06:48 +02:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2002-06-21 19:49:47 +02:00
|
|
|
# /usr/share/mk/bsd.own.mk on NetBSD 1.3 does not define OBJECT_FMT
|
2003-12-10 14:59:07 +01:00
|
|
|
.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"
|
2002-06-21 19:49:47 +02:00
|
|
|
OBJECT_FMT?= ELF
|
2003-09-16 10:09:04 +02:00
|
|
|
. else
|
2002-06-21 19:49:47 +02:00
|
|
|
OBJECT_FMT?= a.out
|
2003-09-16 10:09:04 +02:00
|
|
|
. endif
|
2003-12-10 14:59:07 +01:00
|
|
|
# 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
|
2002-06-21 19:49:47 +02:00
|
|
|
.endif
|
|
|
|
|
2003-09-17 07:14:40 +02:00
|
|
|
.if ${OPSYS} == "OpenBSD"
|
|
|
|
. if defined(ELF_TOOLCHAIN) && ${ELF_TOOLCHAIN} == "yes"
|
|
|
|
OBJECT_FMT?= ELF
|
|
|
|
. else
|
|
|
|
OBJECT_FMT?= a.out
|
|
|
|
. endif
|
2005-02-19 02:28:14 +01:00
|
|
|
.elif ${OPSYS} == "DragonFly"
|
|
|
|
OBJECT_FMT= ELF
|
|
|
|
.elif ${OPSYS} == "AIX"
|
|
|
|
OBJECT_FMT= XCOFF
|
2004-10-31 23:05:02 +01:00
|
|
|
.endif
|
|
|
|
|
2004-09-27 14:00:56 +02:00
|
|
|
# Calculate depth
|
2004-10-06 22:59:40 +02:00
|
|
|
.if exists(${.CURDIR}/mk/bsd.pkg.mk)
|
2004-10-07 04:01:37 +02:00
|
|
|
_PKGSRC_TOPDIR= ${.CURDIR}
|
2004-09-27 14:00:56 +02:00
|
|
|
.elif exists(${.CURDIR}/../mk/bsd.pkg.mk)
|
2004-10-07 04:01:37 +02:00
|
|
|
_PKGSRC_TOPDIR= ${.CURDIR}/..
|
2004-10-06 22:59:40 +02:00
|
|
|
.elif exists(${.CURDIR}/../../mk/bsd.pkg.mk)
|
2004-10-07 04:01:37 +02:00
|
|
|
_PKGSRC_TOPDIR= ${.CURDIR}/../..
|
2004-09-27 14:00:56 +02:00
|
|
|
.endif
|
|
|
|
|
2001-09-18 23:30:05 +02:00
|
|
|
# include the defaults file
|
2004-10-07 04:01:37 +02:00
|
|
|
.if exists(${_PKGSRC_TOPDIR}/mk/defaults/mk.conf)
|
|
|
|
. include "${_PKGSRC_TOPDIR}/mk/defaults/mk.conf"
|
2001-09-18 23:30:05 +02:00
|
|
|
.endif
|
|
|
|
|
2005-07-15 20:27:48 +02:00
|
|
|
USE_TOOLS?= # empty
|
Make a distinction between the tools that pkgsrc needs and the tools
that a package needs. Tools that pkgsrc needs are listed in
PKGSRC_USE_TOOLS, and tools that a package needs on top of that are
listed in USE_TOOLS.
Define "TOOL" variables, e.g. SED, AWK, MKDIR, etc. for each of the
tools that pkgsrc needs, and "TOOLS_TOOL" variables, e.g. TOOLS_SED,
TOOLS_AWK, TOOLS_MKDIR, etc. for each of the tools that a package
needs. These variables contain the full command line to the real
command and arguments needed to invoke the tool.
2005-05-10 21:06:58 +02:00
|
|
|
|
2005-04-30 06:35:54 +02:00
|
|
|
# Provide default values for TOOLs used by the top-level make.
|
2005-07-15 20:27:48 +02:00
|
|
|
USE_TOOLS+= [ awk dirname echo grep pwd sed test true
|
2005-04-30 06:35:54 +02:00
|
|
|
|
|
|
|
# These tools are used by the top-level make only in certain packages and
|
|
|
|
# should eventually be moved into those particular package Makefiles.
|
|
|
|
#
|
2005-07-15 20:27:48 +02:00
|
|
|
USE_TOOLS+= date tr
|
2005-04-30 06:35:54 +02:00
|
|
|
|
|
|
|
.include "${_PKGSRC_TOPDIR}/mk/tools/defaults.mk"
|
|
|
|
|
2002-03-18 06:46:42 +01:00
|
|
|
.if ${OPSYS} == "NetBSD"
|
2003-09-16 10:09:04 +02:00
|
|
|
. 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")
|
2002-03-18 06:46:42 +01:00
|
|
|
APPEND_ELF= elf
|
2003-09-16 10:09:04 +02:00
|
|
|
. endif
|
2002-03-18 06:46:42 +01:00
|
|
|
.endif
|
|
|
|
|
Implement some parts of proposals posted to tech-pkg:
- Define OS_VERSION in bsd.prefs.mk (...if not already defined). Previously
was only set in a conditional block in bsd.pkg.mk.
- Define new values, MACHINE_PLATFORM and MACHINE_GNU_PLATFORM, which
default to ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} and
${LOWER_OPSYS}-${LOWER_VENDOR}-${LOWER_ARCH} respectively.
(Probably should nuke LOWER_ARCH and rename LOWER_VENDOR to something
like MACHINE_GNU_VENDOR.)
- Use ${MACHINE_GNU_PLATFORM} as the argument to `--host' in GNU_CONFIGURE
packages.
- Allow for ONLY_FOR_PLATFORM and NOT_FOR_PLATFORM, lists of patterns
in csh(1) glob style which are matched against MACHINE_PLATFORM above
and take the place of {ONLY,NOT}_FOR_{ARCHS,OPSYS}. (For now, until
all pkgs are converted, provide backwards compatibility.) *Both* may
be defined, in which case NOT_FOR_PLATFORM takes precedence.
- Also do some significant aesthetic cleanup, based on the idea
`define platform-specific overrides first, then define a generic case
with the ?= operator'. Lots more of this to do yet.
1999-05-24 20:42:00 +02:00
|
|
|
SHAREOWN?= ${DOCOWN}
|
|
|
|
SHAREGRP?= ${DOCGRP}
|
|
|
|
SHAREMODE?= ${DOCMODE}
|
1998-06-03 13:15:29 +02:00
|
|
|
|
1998-08-19 18:23:40 +02:00
|
|
|
.if defined(PREFIX) && (${PREFIX} != ${__PREFIX_SET__})
|
1998-08-11 21:30:48 +02:00
|
|
|
.BEGIN:
|
|
|
|
@${ECHO_MSG} "You can NOT 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
|
1999-05-24 00:10:01 +02:00
|
|
|
|
Implement some parts of proposals posted to tech-pkg:
- Define OS_VERSION in bsd.prefs.mk (...if not already defined). Previously
was only set in a conditional block in bsd.pkg.mk.
- Define new values, MACHINE_PLATFORM and MACHINE_GNU_PLATFORM, which
default to ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} and
${LOWER_OPSYS}-${LOWER_VENDOR}-${LOWER_ARCH} respectively.
(Probably should nuke LOWER_ARCH and rename LOWER_VENDOR to something
like MACHINE_GNU_VENDOR.)
- Use ${MACHINE_GNU_PLATFORM} as the argument to `--host' in GNU_CONFIGURE
packages.
- Allow for ONLY_FOR_PLATFORM and NOT_FOR_PLATFORM, lists of patterns
in csh(1) glob style which are matched against MACHINE_PLATFORM above
and take the place of {ONLY,NOT}_FOR_{ARCHS,OPSYS}. (For now, until
all pkgs are converted, provide backwards compatibility.) *Both* may
be defined, in which case NOT_FOR_PLATFORM takes precedence.
- Also do some significant aesthetic cleanup, based on the idea
`define platform-specific overrides first, then define a generic case
with the ?= operator'. Lots more of this to do yet.
1999-05-24 20:42:00 +02:00
|
|
|
# Preload all default values for CFLAGS, LDFLAGS, etc. before bsd.pkg.mk
|
|
|
|
# or a pkg Makefile modifies them.
|
1999-05-24 13:17:05 +02:00
|
|
|
.include <sys.mk>
|
|
|
|
|
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.
|
2004-10-07 04:01:37 +02:00
|
|
|
.if exists(${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk)
|
|
|
|
. include "${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk"
|
2005-01-27 05:16:47 +01:00
|
|
|
.else
|
2004-10-07 04:01:37 +02:00
|
|
|
. include "${_PKGSRC_TOPDIR}/mk/platform/NetBSD.mk"
|
2005-01-27 05:16:47 +01:00
|
|
|
PKG_FAIL_REASON+= "missing mk/platform/${OPSYS}.mk"
|
2001-06-14 18:04:06 +02:00
|
|
|
.endif
|
|
|
|
|
2004-04-26 19:29:33 +02:00
|
|
|
PKGDIRMODE?= 755
|
2004-01-21 19:13:27 +01:00
|
|
|
PKG_PHASE?= none
|
|
|
|
#
|
|
|
|
# The PHASES_AFTER_<phase> variables list every phase "greater than or
|
|
|
|
# equal to" <phase>.
|
|
|
|
#
|
Teach bsd.pkg.mk to create a phase-specific "makevars.mk" file that
caches variable definitions that were computed by make. These variables
are specified by listing them in MAKE_VARS, e.g.,
.if !defined(FOO)
FOO!= very_time_consuming_command
.endif
MAKE_VARS+= FOO
bsd.pkg.mk will include only the one generated during the most recent
phase. A particular phase's makevars.mk file consists of variable
definitions that are a superset of all of the ones produced in previous
phases of the build.
The caching is useful because bsd.pkg.mk invokes make recursively,
which in the example above has the potential to run the very time-consuming
command each time unless we cause FOO to be defined for the sub-make
processes. We don't cache via MAKE_FLAGS because MAKE_FLAGS isn't
consistently applied to every invocation of make, and also because
MAKE_FLAGS can overflow the maximum length of a make variable very
quickly if we add many values to it.
One important and desirable property of variables cached via MAKE_VARS
is that they only apply to the current package, and not to any
dependencies whose builds may have been triggered by the current
package.
The makevars.mk files are generated by new targets fetch-vars,
extract-vars, patch-vars, etc., and these targets are built during
the corresponding real-* target to ensure that they are being invoked
with PKG_PHASE set to the proper value.
Also, remove the variables cache file that bsd.wrapper.mk was generating
since the new makevars.mk files provide the same functionality at a
higher level. Change all WRAPPER_VARS definitions that were used by
the old wrapper-phase cache file into MAKE_VARS definitions.
2005-05-09 07:06:55 +02:00
|
|
|
ALL_PHASES= ${PHASES_AFTER_FETCH}
|
2004-01-27 03:36:59 +01:00
|
|
|
PHASES_AFTER_FETCH= fetch ${PHASES_AFTER_EXTRACT}
|
2004-01-21 19:13:27 +01:00
|
|
|
PHASES_AFTER_EXTRACT= extract ${PHASES_AFTER_PATCH}
|
|
|
|
PHASES_AFTER_PATCH= patch ${PHASES_AFTER_TOOLS}
|
Initial commit of a new wrapper script framework that encapsulates
the non-buildlink-related code and moves it out of mk/buildlink3 into
mk/wrapper. The buildlink3 code is modified to simply hook its
transformations into the wrapper script framework.
The wrapper script framework has some new features:
* Support automatically passing "ABI" flags to the compiler and linker
depending on the value of ${ABI}. Currently supports the SunPro
compiler with ${ABI} == 64 and the MIPSPro compiler with ${ABI} as
any of 32, n32, o32, and 64.
* making UnixWare GCC accept -rpath options and silently converting
them into an appropriate LD_RUN_PATH
* Add cmd-sink-interix-gcc and cmd-sink-interix-ld that errors out
when it sees -fpic/-fPIC and -shared/-Bshareable, respectively
(requested by <tv>).
* Much improved debugging output. It's possible to output the wrapper
work log in-line with normal output by setting WRAPPER_LOG to
"stderr".
Important differences in behaviour from the old buildlink3 code include:
* Only move the -l options to the end of the command line, leaving the
-L options in-place.
* Extend the autodetection of the libtool mode to detect "compile" and
"uninstall".
* Fix problem noted in both PR pkg/24760 and PR pkg/25500, where
-L/usr/lib/* was being mangled improperly.
* Remove the top-level "buildlink" target; instead, make buildlinking
occur as part of the "wrapper" target.
* mangle and sub-mangle are only meant to transform directories in
-I, -L, and rpath options, so remove the lines in
buildlink3/gen-transform.sh that transformed bare directories.
* Add the ability for the libtool wrapper to be called just to unwrap
an existing libtool archive by running:
libtool --mode=unwrap -o libfoo.la
The old --fix-la syntax no longer works.
20040818
========
* Initial release of a new wrapper script framework that encapsulates
the non-buildlink-related code and moves it out of mk/buildlink3.
These features include:
* making MIPSpro accept GCC options
* making MIPSpro "ucode" accept GCC options
* making SunPro accept GCC options
* making "ld" accept -Wl,* options and silently removing the "-Wl,"
* (NEW) making UnixWare GCC accept -rpath options and silently
converting them into an appropriate LD_RUN_PATH
One major benefit of this is that the buildlink3 code is now much
tighter and easier to understand since it concerns itself solely
with buildlink-related details. I haven't yet optimized the wrapper
cache, so the new wrapper scripts may take slightly longer to execute
than the old buildlink3 wrapper scripts, but I'll be improving this
over time.
20040821
========
* Move the inclusion of $cmd_sink outside of the main loop in wrapper.sh
so that the $cmd_sink script can be used to globally scan and process
the arguments. Move the LD_RUN_PATH code to a cmd-sink-unixware-gcc
script. Garbage-collect the now unused export_vars-related code.
* Add cmd-sink-aix-xlc for AIX xlc that munges -Wl,-R* into an
appropriate -blibpath option.
* Add cmd-sink-interix-gcc and cmd-sink-interix-ld that errors out
when it sees -fpic/-fPIC and -shared/-Bshareable, respectively
(requested by <tv>).
* Move the code that converts full paths to shared libraries into the
"-Ldir -llib" equivalents from the buildlink3 code into wrapper/logic.
Remove the same from bsd.buildlink3.mk and gen-transform.sh.
* Move the code that checks for absolute rpaths from the buildlink3
code into wrapper/arg-source. Remove the same from bsd.buildlink3.mk
and gen-transform.sh.
* Only move the -l options to the end of the command line, leaving the
-L options in-place.
* Add more debugging code.
20040824
========
* Fix quoting problems after arguments are transformed. Remove the
hack that was inserted that magically made almost everything work
because we do it the right way now.
* Move the inclusion of $logic outside of the main loop in wrapper.sh
so that the $logic script doesn't have to worry about underflowing
the argument buffer.
* Encapsulate the loop in wrapper.sh that fills the argument buffer
entirely within the arg-source script.
* Move from the logic script into the arg-source script the
transformations that merge or split arguments.
* Fix bug where skipargs was effectively being ignored if it was more
than 1.
* Handle the whitespace in transformations in the logic script that
turn one library option into multiple library options, e.g.
"-lreadline" -> "-ledit -ltermcap".
* Allow you to specify an environment variable WRAPPER_SKIP_TRANSFORM
for whether you wish to skip the transformation step in the logic
script. This is intended for testing purposes.
* Added check_prog() and init_lib() functions to the shell code library
to make it more reusable outside of the wrapper framework.
* Allow the msg_log() function to output to "stdout" or "stderr". If
you want to have all of the logging appear on the screen, then you
can now set WRAPPER_LOG=stderr.
* Make some of the script components not overridable on a per-wrapper
basis.
* Add a gen-transform.sh script that generates transformation sedfiles.
The "transform" script is used to transform arguments, while the
"untransform" script is used to unwrap files. Move the no-rpath
logic from buildlink3/gen-transform.sh into wrapper/gen-transform.sh
since it's not buildlink3-specific.
* Check for a non-empty blibpath before adding the option in
cmd-sink-aix-xlc.
* Extend the autodetection of the libtool mode to detect "compile" and
"uninstall".
* Add a cmd-sink-libtool script that doesn't pass linker options to
libtool unless we're in "link" mode.
* Set _USE_RPATH to "yes" for UnixWare so that the wrappers will see the
rpath options and convert them to a LD_RUN_PATH definition.
* Add more debugging code.
20040826
========
* Rewrite buildlink3/gen-transform.sh to produce more precise sed commands.
Drop some unused commands from the mini-language, and add a few more
that are more restrictive in their scope.
* Fix problem where repeated options weren't properly handled by some
of sed commands. It's not enough that they're "global replace",
since some patterns match separator characters before and after each
option. We must repeat those patterns twice to catch all instances
correctly.
* Fix problem noted in both PR pkg/24760 and PR pkg/25500, where
-L/usr/lib/* was being mangled improperly.
* Remove the top-level "buildlink" target; instead, make buildlinking
occur as part of the "wrapper" target.
* Add more debugging code.
20040828
========
* Added a head_queue function to shell-lib that returns the head of the
named queue without popping it off the front of the queue.
* Strip consecutive, repeated library options from the command line when
we read it in the logic script.
* Be more careful about not underflowing the argument buffer.
20040906
========
* shell-lib was moved into pkgsrc/mk/scripts; correct references to that
file in the wrapper code.
* Use opt-sub instead of sub-mangle when protecting -I/usr/include/*
and -L/usr/lib/* from buildlink transformations. This avoids adding
lines that look like "-I-I..." in the transformation sedfiles.
* mangle and sub-mangle are only meant to transform directories in
-I, -L, and rpath options, so remove the lines in
buildlink3/gen-transform.sh that transformed bare directories.
* Fix bug in strip-slashdot where the "." wasn't backquoted and thus
matched all characters instead of only the "." character.
* Change the libtool wrapper to use a modified buildcmd script that
doesn't rearrange any of the arguments. This should fix spurious
problems where libtool doesn't understand how to parse the command
line when the -l options are moved to the end of the argument list.
* Fix bug in the logic script where the $cachearg and $cachedarg
weren't being properly set at all times, which caused the cache to
contain the wrong transformed argument.
20040907
========
* Support automatically passing "ABI" flags to the compiler and linker
depending on the value of ${ABI}. Currently supports the SunPro
compiler with ${ABI} == 64 and the MIPSPro compiler with ${ABI} as
any of 32, n32, o32, and 64.
* Move back the code that splits absolute paths to shared libraries
from arg-source back into logic. This allows us to correctly skip
splitting those paths based on the previous option. Also add a
sanity check that the library name in the split argument doesn't
contain a "/" since shell globs are not as precise as REs.
* Don't transform the path given after --dynamic-linker (used by GNU
ld for ELF linkage).
* Add the ability for the libtool wrapper to be called just to unwrap
an existing libtool archive by running:
libtool --mode=unwrap -o libfoo.la
20040914
========
* Add a loop in libtool-fix-la to ensure that all of the options listed
in the dependency_libs lines of *.lai files are processed. This fixes
a buildlink3 leakage bug.
* Merge the gen-transform.sh scripts between buildlink3 and wrapper and
place them all in wrapper. This makes sense since the commands simply
allow for many types of transformations, which buildlink3 takes
advantage of, but there is nothing inherently buildlink-ish about
those commands.
* Don't directly manipulate SUBST_SED.unwrap. Instead, create the
value of SUBST_SED.unwrap by combining several other variables
(currently just _UNWRAP_SED) to ensure that the correct ordering is
preserved.
* Correct some confusing debugging messages.
2004-09-21 17:01:38 +02:00
|
|
|
PHASES_AFTER_TOOLS= tools ${PHASES_AFTER_WRAPPER}
|
|
|
|
PHASES_AFTER_WRAPPER= wrapper ${PHASES_AFTER_CONFIGURE}
|
2004-01-21 19:13:27 +01:00
|
|
|
PHASES_AFTER_CONFIGURE= configure ${PHASES_AFTER_BUILD}
|
|
|
|
PHASES_AFTER_BUILD= build ${PHASES_AFTER_INSTALL}
|
|
|
|
PHASES_AFTER_INSTALL= install ${PHASES_AFTER_PACKAGE}
|
|
|
|
PHASES_AFTER_PACKAGE= package
|
|
|
|
|
2005-11-10 10:48:04 +01:00
|
|
|
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
|
|
|
|
|
2004-01-23 18:55:17 +01:00
|
|
|
# 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
|
|
|
|
|
2002-12-18 07:18:14 +01:00
|
|
|
# if the system is IPv6-ready, compile with IPv6 support turned on.
|
2003-12-27 14:28:46 +01:00
|
|
|
.if defined(USE_INET6)
|
2005-12-02 18:08:49 +01:00
|
|
|
. if empty(USE_INET6:M[Yy][Ee][Ss])
|
2003-12-27 14:28:46 +01:00
|
|
|
USE_INET6= NO
|
2003-12-28 12:23:28 +01:00
|
|
|
. else
|
2003-12-27 14:28:46 +01:00
|
|
|
USE_INET6= YES
|
2003-12-28 12:23:28 +01:00
|
|
|
. endif
|
2005-12-02 18:08:49 +01:00
|
|
|
.elif empty(_OPSYS_HAS_INET6:M[nN][oO])
|
2003-12-27 14:28:46 +01:00
|
|
|
USE_INET6= YES
|
|
|
|
.else
|
|
|
|
USE_INET6= NO
|
|
|
|
.endif
|
2002-12-18 07:18:14 +01:00
|
|
|
|
2001-05-17 17:08:17 +02:00
|
|
|
LOCALBASE?= ${DESTDIR}/usr/pkg
|
2005-12-29 22:18:11 +01:00
|
|
|
.if !defined(X11_TYPE) || defined(X11_TYPE) && !empty(X11_TYPE:Mnative)
|
|
|
|
. if ${OPSYS} == "SunOS"
|
2002-10-21 23:46:00 +02:00
|
|
|
# On Solaris, we default to using OpenWindows for X11.
|
2004-07-30 09:38:01 +02:00
|
|
|
X11BASE?= ${DESTDIR}/usr/openwin
|
2005-12-29 22:18:11 +01:00
|
|
|
. else
|
2004-07-30 09:38:01 +02:00
|
|
|
X11BASE?= ${DESTDIR}/usr/X11R6
|
2005-12-29 22:18:11 +01:00
|
|
|
. endif
|
2002-10-21 23:46:00 +02:00
|
|
|
.endif
|
2004-07-30 09:38:01 +02:00
|
|
|
CROSSBASE?= ${LOCALBASE}/cross
|
2001-03-13 10:53:37 +01:00
|
|
|
|
2004-01-23 18:55:17 +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
|
|
|
|
.else
|
2004-04-04 09:09:38 +02:00
|
|
|
USE_XPKGWEDGE?= yes
|
2004-01-23 18:55:17 +01:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(_OPSYS_NEEDS_XPKGWEDGE) && \
|
|
|
|
!empty(_OPSYS_NEEDS_XPKGWEDGE:M[yY][eE][sS])
|
|
|
|
USE_XPKGWEDGE= yes
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${PKG_INSTALLATION_TYPE} == "pkgviews"
|
|
|
|
USE_XPKGWEDGE= yes
|
|
|
|
.endif
|
|
|
|
|
2005-11-09 02:06:48 +01:00
|
|
|
# Default installation prefix for meta-pkgs/XFree86 and
|
|
|
|
# meta-pkgs/xorg.
|
|
|
|
.if defined(X11_TYPE) && !empty(X11_TYPE:MXFree86)
|
|
|
|
X11ROOT_PREFIX?= XFree86
|
|
|
|
.elif defined(X11_TYPE) && !empty(X11_TYPE:Mxorg)
|
|
|
|
X11ROOT_PREFIX?= xorg
|
|
|
|
.else
|
|
|
|
X11ROOT_PREFIX?= # empty
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ((defined(X11_TYPE) && !empty(X11_TYPE:MXFree86) || \
|
|
|
|
defined(X11_TYPE) && !empty(X11_TYPE:Mxorg)) && \
|
|
|
|
defined(X11_TYPE) && empty(X11_TYPE:Mnative))
|
|
|
|
X11BASE?= ${LOCALBASE}/${X11ROOT_PREFIX}
|
|
|
|
.endif
|
|
|
|
|
2002-09-15 13:58:22 +02:00
|
|
|
# Set X11PREFIX to reflect the install directory of X11 packages.
|
|
|
|
# Set XMKMF_CMD properly if xpkgwedge is installed.
|
|
|
|
#
|
|
|
|
# The check for the existence of ${X11BASE}/lib/X11/config/xpkgwedge.def
|
|
|
|
# is to catch users of xpkgwedge<1.0.
|
|
|
|
#
|
2005-11-14 05:50:47 +01:00
|
|
|
.if !empty(USE_XPKGWEDGE:M[Yy][Ee][Ss])
|
2002-09-15 13:58:22 +02:00
|
|
|
X11PREFIX= ${LOCALBASE}
|
|
|
|
.else
|
|
|
|
X11PREFIX= ${X11BASE}
|
|
|
|
.endif
|
|
|
|
|
2003-09-02 08:59:37 +02:00
|
|
|
DEPOT_SUBDIR?= packages
|
|
|
|
DEPOTBASE= ${LOCALBASE}/${DEPOT_SUBDIR}
|
|
|
|
|
2004-08-27 08:29:06 +02:00
|
|
|
# LINK_RPATH_FLAG publicly exports the linker flag used to set the
|
|
|
|
# run-time library search path.
|
2003-03-14 20:37:30 +01:00
|
|
|
#
|
2004-08-27 08:29:06 +02:00
|
|
|
.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
|
2002-09-15 13:58:22 +02:00
|
|
|
|
2003-04-15 07:29:45 +02:00
|
|
|
# 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}
|
|
|
|
|
2005-05-14 03:51:52 +02:00
|
|
|
.if !defined(DIGEST)
|
2001-03-06 15:50:45 +01:00
|
|
|
DIGEST:= ${LOCALBASE}/bin/digest
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= DIGEST=${DIGEST:Q}
|
2001-03-06 15:50:45 +01:00
|
|
|
.endif
|
|
|
|
|
2001-03-13 10:53:37 +01:00
|
|
|
# Only add the DIGEST_VERSION value to MAKEFLAGS when we know
|
|
|
|
# we've got a valid version number, retrieved from the digest(1)
|
|
|
|
# binary. This is different to PKGTOOLS_VERSION, since, in that
|
2002-09-24 15:59:20 +02:00
|
|
|
# case, the build dies when pkg_info(1) is out of date.
|
2001-03-13 10:53:37 +01:00
|
|
|
|
2001-03-13 10:41:36 +01:00
|
|
|
.if !exists(${DIGEST})
|
|
|
|
DIGEST_VERSION= 20010301
|
|
|
|
.elif !defined(DIGEST_VERSION)
|
|
|
|
DIGEST_VERSION!= ${DIGEST} -V 2>/dev/null
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= DIGEST_VERSION=${DIGEST_VERSION:Q}
|
2001-03-06 15:50:45 +01:00
|
|
|
.endif
|
|
|
|
|
2003-09-02 08:59:37 +02:00
|
|
|
# This is the package database directory for the default view.
|
|
|
|
PKG_DBDIR?= ${DESTDIR}/var/db/pkg
|
|
|
|
|
|
|
|
# _PKG_DBDIR is the actual packages database directory where we register
|
|
|
|
# packages.
|
|
|
|
#
|
|
|
|
.if ${PKG_INSTALLATION_TYPE} == "overwrite"
|
|
|
|
_PKG_DBDIR= ${PKG_DBDIR}
|
|
|
|
.elif ${PKG_INSTALLATION_TYPE} == "pkgviews"
|
|
|
|
_PKG_DBDIR= ${DEPOTBASE}
|
|
|
|
.endif
|
|
|
|
|
2003-08-31 13:04:58 +02:00
|
|
|
PKG_ADD_CMD?= ${PKG_TOOLS_BIN}/pkg_add
|
|
|
|
PKG_ADMIN_CMD?= ${PKG_TOOLS_BIN}/pkg_admin
|
|
|
|
PKG_CREATE_CMD?= ${PKG_TOOLS_BIN}/pkg_create
|
|
|
|
PKG_DELETE_CMD?= ${PKG_TOOLS_BIN}/pkg_delete
|
|
|
|
PKG_INFO_CMD?= ${PKG_TOOLS_BIN}/pkg_info
|
2003-09-02 08:59:37 +02:00
|
|
|
PKG_VIEW_CMD?= ${PKG_TOOLS_BIN}/pkg_view
|
|
|
|
LINKFARM_CMD?= ${PKG_TOOLS_BIN}/linkfarm
|
2003-08-31 13:04:58 +02:00
|
|
|
|
2004-02-13 19:00:29 +01:00
|
|
|
.if !defined(PKGTOOLS_VERSION)
|
|
|
|
PKGTOOLS_VERSION!= ${PKG_INFO_CMD} -V 2>/dev/null || echo 20010302
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= PKGTOOLS_VERSION=${PKGTOOLS_VERSION:Q}
|
2004-02-13 19:00:29 +01:00
|
|
|
.endif
|
|
|
|
|
2003-09-02 08:59:37 +02:00
|
|
|
# The binary pkg_install tools all need to consistently to refer to the
|
|
|
|
# correct package database directory.
|
|
|
|
#
|
2004-02-14 12:28:28 +01:00
|
|
|
.if ${PKGTOOLS_VERSION} < 20030823
|
2005-11-24 14:24:10 +01:00
|
|
|
PKGTOOLS_ENV?= PKG_DBDIR=${_PKG_DBDIR:Q}
|
2004-02-13 19:00:29 +01:00
|
|
|
PKGTOOLS_ARGS?= # empty
|
|
|
|
.else
|
|
|
|
PKGTOOLS_ENV?= # empty
|
2005-11-24 14:24:10 +01:00
|
|
|
PKGTOOLS_ARGS?= -K ${_PKG_DBDIR:Q}
|
2004-02-13 19:00:29 +01:00
|
|
|
.endif
|
2003-09-02 08:59:37 +02:00
|
|
|
|
|
|
|
# Views are rooted in ${LOCALBASE}, all packages are depoted in
|
|
|
|
# ${DEPOTBASE}, and the package database directory for the default view
|
|
|
|
# is in ${PKG_DBDIR}.
|
|
|
|
#
|
|
|
|
PKG_VIEW_ARGS?= -W ${LOCALBASE} -d ${DEPOTBASE} -k ${PKG_DBDIR}
|
|
|
|
|
2005-11-28 22:46:47 +01:00
|
|
|
PKG_ADD?= ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADD_CMD} ${PKGTOOLS_ARGS}
|
|
|
|
PKG_ADMIN?= ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADMIN_CMD} ${PKGTOOLS_ARGS}
|
|
|
|
PKG_CREATE?= ${SETENV} ${PKGTOOLS_ENV} ${PKG_CREATE_CMD} ${PKGTOOLS_ARGS}
|
|
|
|
PKG_DELETE?= ${SETENV} ${PKGTOOLS_ENV} ${PKG_DELETE_CMD} ${PKGTOOLS_ARGS}
|
|
|
|
PKG_INFO?= ${SETENV} ${PKGTOOLS_ENV} ${PKG_INFO_CMD} ${PKGTOOLS_ARGS}
|
|
|
|
PKG_VIEW?= ${SETENV} ${PKGTOOLS_ENV} ${PKG_VIEW_CMD} ${PKG_VIEW_ARGS}
|
2003-09-02 08:59:37 +02:00
|
|
|
LINKFARM?= ${LINKFARM_CMD}
|
2002-09-24 23:54:49 +02:00
|
|
|
|
2003-09-13 07:55:14 +02:00
|
|
|
# "${PKG_BEST_EXISTS} pkgpattern" prints out the name of the installed
|
|
|
|
# package that best matches pkgpattern. Use this instead of
|
|
|
|
# "${PKG_INFO} -e pkgpattern" if the latter would return more than one
|
|
|
|
# package name.
|
|
|
|
#
|
2004-01-25 20:23:20 +01:00
|
|
|
PKG_BEST_EXISTS?= ${PKG_ADMIN} -b -d ${_PKG_DBDIR} -S lsbest
|
2003-09-13 07:55:14 +02:00
|
|
|
|
2004-02-14 04:26:09 +01:00
|
|
|
.if exists(${LOCALBASE}/bsd/share/mk/zoularis.mk)
|
|
|
|
PKG_FAIL_REASON+= 'You appear to have a deprecated Zoularis installation.'
|
|
|
|
PKG_FAIL_REASON+= 'Please update your system to bootstrap-pkgsrc and remove the'
|
|
|
|
PKG_FAIL_REASON+= '${LOCALBASE}/bsd directory.'
|
2004-02-14 04:33:39 +01:00
|
|
|
PKG_FAIL_REASON+= 'See http://mail-index.NetBSD.org/tech-pkg/2004/02/14/0004.html'
|
|
|
|
PKG_FAIL_REASON+= 'for more details.'
|
2001-03-23 16:47:21 +01:00
|
|
|
.endif
|
|
|
|
|
2002-10-19 22:33:59 +02:00
|
|
|
PKGPATH?= ${.CURDIR:C|.*/([^/]*/[^/]*)$|\1|}
|
2004-10-07 15:42:26 +02:00
|
|
|
.if !defined(_PKGSRCDIR)
|
|
|
|
_PKGSRCDIR!= cd ${_PKGSRC_TOPDIR} && ${PWD_CMD}
|
|
|
|
MAKEFLAGS+= _PKGSRCDIR=${_PKGSRCDIR:Q}
|
2004-10-07 04:01:37 +02:00
|
|
|
.endif
|
2004-10-07 15:42:26 +02:00
|
|
|
PKGSRCDIR= ${_PKGSRCDIR}
|
2002-10-19 22:33:59 +02:00
|
|
|
|
2004-10-07 04:01:37 +02:00
|
|
|
DISTDIR?= ${PKGSRCDIR}/distfiles
|
|
|
|
PACKAGES?= ${PKGSRCDIR}/packages
|
|
|
|
TEMPLATES?= ${PKGSRCDIR}/templates
|
2002-10-19 22:33:59 +02:00
|
|
|
|
|
|
|
PATCHDIR?= ${.CURDIR}/patches
|
|
|
|
SCRIPTDIR?= ${.CURDIR}/scripts
|
|
|
|
FILESDIR?= ${.CURDIR}/files
|
|
|
|
PKGDIR?= ${.CURDIR}
|
|
|
|
|
2003-08-21 18:16:46 +02:00
|
|
|
_PKGSRC_DEPS?= # empty
|
|
|
|
|
2002-10-19 22:33:59 +02:00
|
|
|
# If WRKOBJDIR is set, use that tree to build
|
2002-11-01 07:19:47 +01:00
|
|
|
.if defined(WRKOBJDIR)
|
2002-10-19 22:33:59 +02:00
|
|
|
BUILD_DIR?= ${WRKOBJDIR}/${PKGPATH}
|
|
|
|
.else
|
2003-01-15 21:55:38 +01:00
|
|
|
BUILD_DIR!= cd ${.CURDIR} && ${PWD_CMD}
|
|
|
|
.endif
|
2002-10-19 22:33:59 +02:00
|
|
|
|
|
|
|
# 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
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= _HOSTNAME=${_HOSTNAME:Q}
|
2002-10-19 22:33:59 +02:00
|
|
|
. endif
|
|
|
|
WRKDIR_BASENAME?= work.${_HOSTNAME:C|\..*||}
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= OBJHOSTNAME=${OBJHOSTNAME:Q}
|
2002-10-19 22:33:59 +02:00
|
|
|
.elif defined(OBJMACHINE)
|
|
|
|
WRKDIR_BASENAME?= work.${MACHINE_ARCH}
|
2005-12-05 23:07:07 +01:00
|
|
|
MAKEFLAGS+= OBJMACHINE=${OBJMACHINE:Q}
|
2002-10-19 22:33:59 +02:00
|
|
|
.else
|
|
|
|
WRKDIR_BASENAME?= work
|
2002-12-10 13:50:48 +01:00
|
|
|
.endif
|
2002-10-19 22:33:59 +02:00
|
|
|
|
|
|
|
WRKDIR?= ${BUILD_DIR}/${WRKDIR_BASENAME}
|
|
|
|
|
2003-08-16 10:39:17 +02:00
|
|
|
# There are many uses for a common log file, so define one that may be
|
2004-07-07 00:49:16 +02:00
|
|
|
# picked up and used by tools.mk, bsd.buildlink3.mk, etc.
|
2003-08-16 10:39:17 +02:00
|
|
|
#
|
|
|
|
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
|
|
|
|
|
2005-01-27 05:05:08 +01:00
|
|
|
# we want this *before* compiler.mk, so that compiler.mk paths override them
|
2005-04-08 22:11:53 +02:00
|
|
|
PREPEND_PATH+= ${USE_X11:D${X11BASE}/bin} ${LOCALBASE}/bin
|
2005-01-27 05:05:08 +01:00
|
|
|
|
2004-09-27 14:05:53 +02:00
|
|
|
# Wrapper framework definitions
|
2005-01-27 05:16:47 +01:00
|
|
|
.include "${PKGSRCDIR}/mk/wrapper/wrapper-defs.mk"
|
2004-09-27 14:05:53 +02:00
|
|
|
|
2005-06-01 19:05:19 +02:00
|
|
|
# Make variable definitions cache
|
|
|
|
.include "${PKGSRCDIR}/mk/bsd.makevars.mk"
|
|
|
|
|
2005-07-20 00:31:01 +02:00
|
|
|
USE_TOOLS+= awk:pkgsrc cut:pkgsrc echo:pkgsrc pwd:pkgsrc \
|
|
|
|
sed:pkgsrc tr:pkgsrc uname:pkgsrc
|
2005-07-17 00:33:18 +02:00
|
|
|
|
2003-01-15 11:06:48 +01:00
|
|
|
.endif # BSD_PKG_MK
|