summaryrefslogtreecommitdiff
path: root/mk/features
diff options
context:
space:
mode:
authorhans <hans>2012-03-02 16:19:17 +0000
committerhans <hans>2012-03-02 16:19:17 +0000
commit3d79f193524f1b2bdee9cf962fd358e694c6fc61 (patch)
tree1889876b54adba65aa914eea35a7f6c37c90a352 /mk/features
parent43f0448603ae5fe9248c8c64f3c63b4bd45f0350 (diff)
downloadpkgsrc-3d79f193524f1b2bdee9cf962fd358e694c6fc61.tar.gz
Add feature "cdefs" to provide sys/cdefs.h from libnbcompat.
Diffstat (limited to 'mk/features')
-rw-r--r--mk/features/features-vars.mk9
-rw-r--r--mk/features/features.mk15
2 files changed, 16 insertions, 8 deletions
diff --git a/mk/features/features-vars.mk b/mk/features/features-vars.mk
index 4d2a2d8fec7..f397397e47e 100644
--- a/mk/features/features-vars.mk
+++ b/mk/features/features-vars.mk
@@ -1,4 +1,4 @@
-# $NetBSD: features-vars.mk,v 1.19 2008/06/14 08:55:58 joerg Exp $
+# $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
@@ -36,6 +36,7 @@
#
# 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
@@ -57,7 +58,7 @@
# current system. Also includes "inet6" if the system doesn't
# support IPv6.
#
-# Keywords: feature features asprintf vasprintf err errx warn warnx
+# 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
@@ -86,6 +87,10 @@ 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)
diff --git a/mk/features/features.mk b/mk/features/features.mk
index 725af3cd1d1..f6ebf70b7f2 100644
--- a/mk/features/features.mk
+++ b/mk/features/features.mk
@@ -1,4 +1,4 @@
-# $NetBSD: features.mk,v 1.6 2008/01/14 23:06:26 tnn Exp $
+# $NetBSD: features.mk,v 1.7 2012/03/02 16:19:17 hans Exp $
#
# This file is included by bsd.pkg.mk.
#
@@ -36,7 +36,7 @@ LIBS+= ${FEATURE_LIBS}
# libnbcompat provides many of the current features.
#
_FEATURE_USE_NBCOMPAT?= no
-. for f in asprintf err fts_close fts_open fts_read fts_set getopt_long glob nbcompat regcomp setenv snprintf utimes vsnprintf warn
+. 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
@@ -49,6 +49,9 @@ 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) || \
@@ -63,11 +66,11 @@ BUILDLINK_TARGETS+= features-glob-h
BUILDLINK_TARGETS+= features-regex-h
. endif
-. for _file_ in fts.h glob.h regex.h
-.PHONY: features-${_file_:S/./-/}
-features-${_file_:S/./-/}:
+. 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/${_file_:Q}; \
+ 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."; \