Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

View File

@@ -0,0 +1,168 @@
# $NetBSD: features-vars.mk,v 1.20 2012/03/02 16:19:17 hans Exp $
#
# The platforms that are supported by pkgsrc differ in the amount of
# functions they provide in the C library (libc). Functions that are
# typically available on NetBSD are provided in the libnbcompat package.
#
# This file defines a set of "features" that some packages require.
# Whenever a package makes use of them, it should list the features in
# the USE_FEATURES variable. (It serves a similar purpose as USE_TOOLS.)
#
# The *.c files that use the features must be patched a little. When
# there are missing features, the C preprocessor macro HAVE_NBCOMPAT_H
# will be defined to 1. In this case, the headers from the nbcompat
# directory must be included.
#
# === Example ===
#
# In the package Makefile:
#
# USE_FEATURES= err
#
# In the C files using the err*() or warn*() functions:
#
# #if defined(HAVE_NBCOMPAT_H)
# #include <nbcompat/config.h> /* needed for the other headers */
# #include <nbcompat/cdefs.h> /* needed for the other headers */
# #include <nbcompat/err.h>
# #else
# #include <err.h>
# #endif
#
# === Package-settable variables ===
#
# USE_FEATURES
# Lists the system features required by the package.
#
# Possible:
# * asprintf: The functions asprintf and vasprintf.
# * cdefs: The header sys/cdefs.h.
# * err: The functions err, verr, errx, verrx.
# * warn: The functions warn, vwarn, warnx, vwarnx.
# * fts_close, fts_open, fts_read, fts_set: Functions
# for filesystem traversal.
# * getopt_long: The GNU version of getopt.
# * getprogname, setprogname
# * glob
# * regcomp
# * snprintf, vsnprintf
# * utimes
# * nbcompat: All of the above.
#
# Default value: undefined
#
# === Variables defined by this file ===
#
# MISSING_FEATURES
# The features listed in USE_FEATURES that are missing on the
# current system. Also includes "inet6" if the system doesn't
# support IPv6.
#
# Keywords: feature features asprintf vasprintf cdefs err errx warn warnx
# Keywords: fts fts_open fts_read fts_set fts_close getopt_long
# Keywords: getprogname setprogname glob regcomp setenv snprintf vsnprintf
# Keywords: utimes libnbcompat nbcompat
_VARGROUPS+= features
_USER_VARS.features= # none
_PKG_VARS.features= USE_FEATURES
_SYS_VARS.features= MISSING_FEATURES
MISSING_FEATURES= # empty
USE_FEATURES?= # none
#
# Handle "inet6" feature specially -- we always add it to
# MISSING_FEATURES if the operating system doesn't support IPv6,
# regardless of whether or not "inet6" is a requested feature
# in USE_FEATURES.
#
.if defined(_OPSYS_HAS_INET6) && !empty(_OPSYS_HAS_INET6:M[nN][oO])
MISSING_FEATURES+= inet6
.endif
.for f in ${_OPSYS_MISSING_FEATURES}
. if !empty(USE_FEATURES:M${f})
MISSING_FEATURES+= ${f}
. endif
.endfor
.if !exists(/usr/include/sys/cdefs.h) && !empty(USE_FEATURES:Mcdefs)
MISSING_FEATURES+= cdefs
.endif
.for _feature_ in err warn
. if !empty(USE_FEATURES:M${_feature_})
. if (${OPSYS} != NetBSD) && (${OPSYS} != FreeBSD) && (${OPSYS} != DragonFly)
MISSING_FEATURES+= ${_feature_}
. endif
. endif
.endfor
.for _feature_ in fts_close fts_open fts_read fts_set
. if !empty(USE_FEATURES:M${_feature_})
. if !exists(/usr/include/fts.h)
MISSING_FEATURES+= ${_feature_}
. endif
. endif
.endfor
.for _feature_ in getopt_long
. if !empty(USE_FEATURES:M${_feature_})
. if !exists(/usr/include/getopt.h) || ${OPSYS} == "IRIX" || ${OPSYS} == "OSF1"
MISSING_FEATURES+= ${_feature_}
. endif
. endif
.endfor
.for _feature_ in getprogname setprogname
. if !empty(USE_FEATURES:M${_feature_})
. if (${OPSYS} != NetBSD) && (${OPSYS} != FreeBSD) && (${OPSYS} != DragonFly)
MISSING_FEATURES+= ${_feature_}
. endif
. endif
.endfor
.for _feature_ in glob
. if !empty(USE_FEATURES:M${_feature_})
. if !exists(/usr/include/glob.h)
MISSING_FEATURES+= ${_feature_}
. endif
. endif
.endfor
.for _feature_ in regcomp
. if !empty(USE_FEATURES:M${_feature_})
. if !exists(/usr/include/regex.h)
MISSING_FEATURES+= ${_feature_}
. endif
. endif
.endfor
.for _feature_ in setenv
. if !empty(USE_FEATURES:M${_feature_})
. if !empty(MACHINE_PLATFORM:MHPUX-11.11-hppa) # XXX too narrow?
MISSING_FEATURES+= ${_feature_}
. endif
. endif
.endfor
.for _feature_ in snprintf vsnprintf
. if !empty(USE_FEATURES:M${_feature_})
. if ${OPSYS} == "IRIX" || !empty(MACHINE_PLATFORM:MHPUX-11.11-hppa)
MISSING_FEATURES+= ${_feature_}
. endif
. endif
.endfor
.for _feature_ in utimes
. if !empty(USE_FEATURES:M${_feature_})
. if ${OPSYS} == "Interix"
MISSING_FEATURES+= ${_feature_}
. endif
. endif
.endfor
.if !empty(USE_FEATURES:Mnbcompat)
MISSING_FEATURES+= nbcompat
.endif

82
mk/features/features.mk Normal file
View File

@@ -0,0 +1,82 @@
# $NetBSD: features.mk,v 1.7 2012/03/02 16:19:17 hans Exp $
#
# This file is included by bsd.pkg.mk.
#
# Variables defined by this file:
#
# FEATURE_CPPFLAGS
# FEATURE_LDFLAGS
# FEATURE_LIBS
# Preprocessor and linker flags needed to build and to link against
# the headers and libraries that supply the features missing from
# the system.
#
.if defined(MISSING_FEATURES)
#
# Handle "inet6" feature specially -- "inet6" could be in
# MISSING_FEATURES even though it's not requested in USE_FEATURES
# so check that it appears in both before failing the package
# build.
#
. if !empty(USE_FEATURES:Minet6)
. if !empty(MISSING_FEATURES:Minet6)
PKG_FAIL_REASON+= "${PKGNAME} requires IPv6 support"
. endif
. endif
FEATURE_CPPFLAGS= # empty
FEATURE_LDFLAGS= # empty
FEATURE_LIBS= # empty
CPPFLAGS+= ${FEATURE_CPPFLAGS}
LDFLAGS+= ${FEATURE_LDFLAGS}
LIBS+= ${FEATURE_LIBS}
# libnbcompat provides many of the current features.
#
_FEATURE_USE_NBCOMPAT?= no
. for f in asprintf cdefs err fts_close fts_open fts_read fts_set getopt_long glob nbcompat regcomp setenv snprintf utimes vsnprintf warn
. if !empty(MISSING_FEATURES:M${f})
_FEATURE_USE_NBCOMPAT= yes
. endif
. endfor
. if ${_FEATURE_USE_NBCOMPAT} == "yes"
. include "${PKGSRCDIR}/pkgtools/libnbcompat/inplace.mk"
FEATURE_CPPFLAGS+= ${CPPFLAGS.nbcompat}
FEATURE_LDFLAGS+= ${LDFLAGS.nbcompat}
FEATURE_LIBS+= ${LDADD.nbcompat}
. endif
. if (${_FEATURE_USE_NBCOMPAT} == "yes") && !empty(MISSING_FEATURES:Mcdefs)
BUILDLINK_TARGETS+= features-sys-cdefs-h
. endif
. if (${_FEATURE_USE_NBCOMPAT} == "yes") && \
(!empty(MISSING_FEATURES:Mfts_close) || \
!empty(MISSING_FEATURES:Mfts_open) || \
!empty(MISSING_FEATURES:Mfts_read) || \
!empty(MISSING_FEATURES:Mfts_set))
BUILDLINK_TARGETS+= features-fts-h
. endif
. if (${_FEATURE_USE_NBCOMPAT} == "yes") && !empty(MISSING_FEATURES:Mglob)
BUILDLINK_TARGETS+= features-glob-h
. endif
. if (${_FEATURE_USE_NBCOMPAT} == "yes") && !empty(MISSING_FEATURES:Mregcomp)
BUILDLINK_TARGETS+= features-regex-h
. endif
. for _file_ in fts.h glob.h regex.h sys/cdefs.h
.PHONY: features-${_file_:S/./-/:S/\//-/}
features-${_file_:S/./-/:S/\//-/}:
${RUN}set -e; \
nbcompat_header=${LIBNBCOMPAT_SRCDIR:Q}/nbcompat/`${BASENAME} ${_file_:Q}`; \
header=${BUILDLINK_DIR:Q}/include/${_file_:Q}; \
if ${TEST} ! -f "$$header" -a -f "$$nbcompat_header"; then \
${ECHO_BUILDLINK_MSG} "Creating $$header."; \
${MKDIR} `${DIRNAME} "$$header"`; \
${LN} -s "$$nbcompat_header" "$$header"; \
fi
. endfor
.endif # MISSING_FEATURES