| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: djbware.mk,v 1.26 2017/09/28 16:15:49 schmonz Exp $ | | 1 | # $NetBSD: djbware.mk,v 1.27 2020/03/20 19:40:39 rillig Exp $ |
2 | # | | 2 | # |
3 | # Makefile fragment for packages with djb-style build machinery | | 3 | # Makefile fragment for packages with djb-style build machinery |
4 | # | | 4 | # |
5 | # Common functions provided: | | 5 | # Common functions provided: |
6 | # * a boilerplate RESTRICTED clause | | 6 | # * a boilerplate RESTRICTED clause |
7 | # * typical defaults for BUILD_TARGET and INSTALL_TARGET | | 7 | # * typical defaults for BUILD_TARGET and INSTALL_TARGET |
8 | # * typical values for conf-* files | | 8 | # * typical values for conf-* files |
9 | # * replace inline definitions of errno with "#include <errno.h>" | | 9 | # * replace inline definitions of errno with "#include <errno.h>" |
10 | # | | 10 | # |
11 | # TODO: | | 11 | # TODO: |
12 | # * centralize handling of third-party manpages | | 12 | # * centralize handling of third-party manpages |
13 | # * centralize MASTER_SITES and SITES_foo | | 13 | # * centralize MASTER_SITES and SITES_foo |
14 | # * centralize compiler hack for arm{,32} | | 14 | # * centralize compiler hack for arm{,32} |
| @@ -19,26 +19,27 @@ | | | @@ -19,26 +19,27 @@ |
19 | # inet6 (off) | | 19 | # inet6 (off) |
20 | # pam (off) | | 20 | # pam (off) |
21 | # * set RESTRICTED automatically iff patches or other mods are applied | | 21 | # * set RESTRICTED automatically iff patches or other mods are applied |
22 | # * be unrestricted by default for bulk builds | | 22 | # * be unrestricted by default for bulk builds |
23 | # | | 23 | # |
24 | | | 24 | |
25 | .if !defined(DJBWARE_MK) | | 25 | .if !defined(DJBWARE_MK) |
26 | DJBWARE_MK= # defined | | 26 | DJBWARE_MK= # defined |
27 | | | 27 | |
28 | DJB_RESTRICTED?= YES | | 28 | DJB_RESTRICTED?= YES |
29 | DJB_MAKE_TARGETS?= YES | | 29 | DJB_MAKE_TARGETS?= YES |
30 | DJB_BUILD_TARGETS?= # empty | | 30 | DJB_BUILD_TARGETS?= # empty |
31 | DJB_INSTALL_TARGETS?= # empty | | 31 | DJB_INSTALL_TARGETS?= # empty |
| | | 32 | DJB_ERRNO_HACK?= YES |
32 | DJB_SLASHPACKAGE?= NO | | 33 | DJB_SLASHPACKAGE?= NO |
33 | .if !empty(DJB_SLASHPACKAGE:M[yY][eE][sS]) | | 34 | .if !empty(DJB_SLASHPACKAGE:M[yY][eE][sS]) |
34 | DJB_CONFIG_DIR?= ${WRKSRC}/src | | 35 | DJB_CONFIG_DIR?= ${WRKSRC}/src |
35 | DJB_BUILD_ARGS?= # empty | | 36 | DJB_BUILD_ARGS?= # empty |
36 | .else | | 37 | .else |
37 | DJB_CONFIG_DIR?= ${WRKSRC} | | 38 | DJB_CONFIG_DIR?= ${WRKSRC} |
38 | .endif | | 39 | .endif |
39 | DJB_CONFIG_PREFIX?= ${PREFIX} | | 40 | DJB_CONFIG_PREFIX?= ${PREFIX} |
40 | DJB_CONFIG_HOME?= conf-home | | 41 | DJB_CONFIG_HOME?= conf-home |
41 | DJB_CONFIG_CMDS?= ${DO_NADA} | | 42 | DJB_CONFIG_CMDS?= ${DO_NADA} |
42 | | | 43 | |
43 | .if !empty(DJB_RESTRICTED:M[yY][eE][sS]) | | 44 | .if !empty(DJB_RESTRICTED:M[yY][eE][sS]) |
44 | LICENSE= djb-nonlicense | | 45 | LICENSE= djb-nonlicense |
| @@ -72,36 +73,40 @@ do-configure: | | | @@ -72,36 +73,40 @@ do-configure: |
72 | ${ECHO} ${QMAILDIR} > conf-qmail; \ | | 73 | ${ECHO} ${QMAILDIR} > conf-qmail; \ |
73 | [ -f conf-bgincs ] && \ | | 74 | [ -f conf-bgincs ] && \ |
74 | ${ECHO} ${PREFIX}/include > conf-bgincs; \ | | 75 | ${ECHO} ${PREFIX}/include > conf-bgincs; \ |
75 | [ -f conf-bglibs ] && \ | | 76 | [ -f conf-bglibs ] && \ |
76 | ${ECHO} ${PREFIX}/lib > conf-bglibs; \ | | 77 | ${ECHO} ${PREFIX}/lib > conf-bglibs; \ |
77 | ${DJB_CONFIG_CMDS} | | 78 | ${DJB_CONFIG_CMDS} |
78 | .endif | | 79 | .endif |
79 | | | 80 | |
80 | .if !target(do-build) && !empty(DJB_SLASHPACKAGE:M[yY][eE][sS]) | | 81 | .if !target(do-build) && !empty(DJB_SLASHPACKAGE:M[yY][eE][sS]) |
81 | do-build: | | 82 | do-build: |
82 | cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} package/compile ${DJB_BUILD_ARGS} | | 83 | cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} package/compile ${DJB_BUILD_ARGS} |
83 | .endif | | 84 | .endif |
84 | | | 85 | |
| | | 86 | .if !empty(DJB_ERRNO_HACK:M[yY][eE][sS]) |
85 | PKG_SUPPORTED_OPTIONS+= djbware-errno-hack | | 87 | PKG_SUPPORTED_OPTIONS+= djbware-errno-hack |
86 | PKG_SUGGESTED_OPTIONS+= djbware-errno-hack | | 88 | PKG_SUGGESTED_OPTIONS+= djbware-errno-hack |
87 | | | 89 | |
88 | .include "bsd.fast.prefs.mk" | | 90 | .include "bsd.fast.prefs.mk" |
89 | | | 91 | |
90 | .if exists(${PKGDIR}/options.mk) | | 92 | .if exists(${PKGDIR}/options.mk) |
91 | . include "${PKGDIR}/options.mk" | | 93 | . include "${PKGDIR}/options.mk" |
92 | .else | | 94 | .else |
93 | # Note: This expression is the same as ${PKGBASE}, but the latter is | | 95 | # Note: This expression is the same as ${PKGBASE}, but the latter is |
94 | # not defined yet, so we cannot use it here. | | 96 | # not defined yet, so we cannot use it here. |
95 | PKG_OPTIONS_VAR= PKG_OPTIONS.${PKGNAME:C/-[0-9].*//} | | 97 | PKG_OPTIONS_VAR= PKG_OPTIONS.${PKGNAME:C/-[0-9].*//} |
96 | .include "bsd.options.mk" | | 98 | .include "bsd.options.mk" |
97 | .endif | | 99 | .endif |
98 | | | 100 | |
99 | .if !empty(PKG_OPTIONS:Mdjbware-errno-hack) | | 101 | .if !empty(PKG_OPTIONS:Mdjbware-errno-hack) |
100 | SUBST_CLASSES+= djbware | | 102 | SUBST_CLASSES+= djbware |
101 | SUBST_STAGE.djbware= do-configure | | 103 | SUBST_STAGE.djbware= do-configure |
102 | SUBST_FILES.djbware+= error.h | | 104 | SUBST_FILES.djbware+= error.h |
103 | SUBST_SED.djbware= -e 's|^extern\ int\ errno\;|\#include \<errno.h\>|' | | 105 | SUBST_SED.djbware= -e 's|^extern\ int\ errno\;|\#include \<errno.h\>|' |
104 | SUBST_MESSAGE.djbware= Correcting definition of errno. | | 106 | SUBST_MESSAGE.djbware= Correcting definition of errno. |
105 | .endif | | 107 | .endif |
| | | 108 | .else |
| | | 109 | .sinclude "${PKGDIR}/options.mk" |
| | | 110 | .endif |
106 | | | 111 | |
107 | .endif # DJBWARE_MK | | 112 | .endif # DJBWARE_MK |