2017-09-28 18:15:49 +02:00
|
|
|
# $NetBSD: djbware.mk,v 1.26 2017/09/28 16:15:49 schmonz Exp $
|
2005-03-23 01:50:06 +01:00
|
|
|
#
|
|
|
|
# Makefile fragment for packages with djb-style build machinery
|
|
|
|
#
|
|
|
|
# Common functions provided:
|
|
|
|
# * a boilerplate RESTRICTED clause
|
|
|
|
# * typical defaults for BUILD_TARGET and INSTALL_TARGET
|
|
|
|
# * typical values for conf-* files
|
2005-03-23 02:45:34 +01:00
|
|
|
# * replace inline definitions of errno with "#include <errno.h>"
|
2005-03-23 01:50:06 +01:00
|
|
|
#
|
|
|
|
# TODO:
|
2005-08-15 21:44:13 +02:00
|
|
|
# * centralize handling of third-party manpages
|
|
|
|
# * centralize MASTER_SITES and SITES_foo
|
|
|
|
# * centralize compiler hack for arm{,32}
|
|
|
|
# * common install script for compatibility with default conf-home pathnames
|
|
|
|
# * PKG_OPTIONS (default):
|
|
|
|
# djbware-errno-hack (off)
|
|
|
|
# djbware-pathname-compat (on)
|
|
|
|
# inet6 (off)
|
|
|
|
# pam (off)
|
2005-03-23 01:50:06 +01:00
|
|
|
# * set RESTRICTED automatically iff patches or other mods are applied
|
2005-08-15 21:44:13 +02:00
|
|
|
# * be unrestricted by default for bulk builds
|
2005-03-23 01:50:06 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
.if !defined(DJBWARE_MK)
|
|
|
|
DJBWARE_MK= # defined
|
|
|
|
|
|
|
|
DJB_RESTRICTED?= YES
|
2005-08-24 06:47:10 +02:00
|
|
|
DJB_MAKE_TARGETS?= YES
|
2005-03-23 01:50:06 +01:00
|
|
|
DJB_BUILD_TARGETS?= # empty
|
|
|
|
DJB_INSTALL_TARGETS?= # empty
|
2006-01-11 10:26:52 +01:00
|
|
|
DJB_SLASHPACKAGE?= NO
|
|
|
|
.if !empty(DJB_SLASHPACKAGE:M[yY][eE][sS])
|
|
|
|
DJB_CONFIG_DIR?= ${WRKSRC}/src
|
2006-04-02 19:40:19 +02:00
|
|
|
DJB_BUILD_ARGS?= # empty
|
2006-01-11 10:26:52 +01:00
|
|
|
.else
|
|
|
|
DJB_CONFIG_DIR?= ${WRKSRC}
|
|
|
|
.endif
|
2005-03-23 01:50:06 +01:00
|
|
|
DJB_CONFIG_PREFIX?= ${PREFIX}
|
|
|
|
DJB_CONFIG_HOME?= conf-home
|
|
|
|
DJB_CONFIG_CMDS?= ${DO_NADA}
|
|
|
|
|
|
|
|
.if !empty(DJB_RESTRICTED:M[yY][eE][sS])
|
2006-04-29 16:25:37 +02:00
|
|
|
LICENSE= djb-nonlicense
|
|
|
|
|
2007-08-13 07:01:18 +02:00
|
|
|
RESTRICTED= modified source and binaries may not be distributed
|
2005-03-23 01:50:06 +01:00
|
|
|
NO_BIN_ON_CDROM= ${RESTRICTED}
|
|
|
|
NO_BIN_ON_FTP= ${RESTRICTED}
|
|
|
|
.endif
|
|
|
|
|
2005-08-24 06:47:10 +02:00
|
|
|
.if !empty(DJB_MAKE_TARGETS:M[yY][eE][sS])
|
2005-03-23 01:50:06 +01:00
|
|
|
BUILD_TARGET?= it ${DJB_BUILD_TARGETS}
|
|
|
|
INSTALL_TARGET?= setup check ${DJB_INSTALL_TARGETS}
|
2005-08-24 06:47:10 +02:00
|
|
|
.endif
|
2005-03-23 01:50:06 +01:00
|
|
|
|
2005-08-19 15:47:26 +02:00
|
|
|
.if !defined(NO_CONFIGURE) && !target(do-configure)
|
2005-03-23 01:50:06 +01:00
|
|
|
do-configure:
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN}cd ${DJB_CONFIG_DIR}; \
|
2005-03-23 01:50:06 +01:00
|
|
|
for i in conf-*; do ${CP} $${i} $${i}.orig_dist; done; \
|
2010-03-15 18:27:32 +01:00
|
|
|
${ECHO} ${DESTDIR:Q}${DJB_CONFIG_PREFIX:Q} > conf-destdir; \
|
2005-03-23 01:50:06 +01:00
|
|
|
[ -f ${DJB_CONFIG_HOME} ] && \
|
|
|
|
${ECHO} ${DJB_CONFIG_PREFIX} > ${DJB_CONFIG_HOME}; \
|
|
|
|
[ -f conf-cc ] && \
|
2006-08-02 04:25:46 +02:00
|
|
|
${ECHO} ${CC:Q} ${CFLAGS:Q} ${CPPFLAGS:Q} > conf-cc; \
|
2005-03-23 01:50:06 +01:00
|
|
|
[ -f conf-ld ] && \
|
2006-08-02 04:25:46 +02:00
|
|
|
${ECHO} ${CC:Q} ${_STRIPFLAG_CC} ${LDFLAGS:Q} > conf-ld;\
|
2005-03-23 01:50:06 +01:00
|
|
|
[ -f conf-bin ] && \
|
|
|
|
${ECHO} ${DJB_CONFIG_PREFIX}/bin > conf-bin; \
|
|
|
|
[ -f conf-man ] && \
|
2008-05-20 21:30:01 +02:00
|
|
|
${ECHO} ${DJB_CONFIG_PREFIX}/${PKGMANDIR} > conf-man; \
|
2005-03-23 01:50:06 +01:00
|
|
|
[ -f conf-qmail ] && \
|
|
|
|
${ECHO} ${QMAILDIR} > conf-qmail; \
|
2005-07-18 20:26:47 +02:00
|
|
|
[ -f conf-bgincs ] && \
|
2017-09-28 18:15:49 +02:00
|
|
|
${ECHO} ${PREFIX}/include > conf-bgincs; \
|
2005-07-18 20:26:47 +02:00
|
|
|
[ -f conf-bglibs ] && \
|
2017-09-28 18:15:49 +02:00
|
|
|
${ECHO} ${PREFIX}/lib > conf-bglibs; \
|
2005-03-23 01:50:06 +01:00
|
|
|
${DJB_CONFIG_CMDS}
|
|
|
|
.endif
|
|
|
|
|
2006-01-11 10:26:52 +01:00
|
|
|
.if !target(do-build) && !empty(DJB_SLASHPACKAGE:M[yY][eE][sS])
|
|
|
|
do-build:
|
2014-11-27 21:31:22 +01:00
|
|
|
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} package/compile ${DJB_BUILD_ARGS}
|
2006-01-11 10:26:52 +01:00
|
|
|
.endif
|
|
|
|
|
2005-08-19 06:44:09 +02:00
|
|
|
PKG_SUPPORTED_OPTIONS+= djbware-errno-hack
|
2005-10-05 07:46:54 +02:00
|
|
|
PKG_SUGGESTED_OPTIONS+= djbware-errno-hack
|
2005-08-19 06:44:09 +02:00
|
|
|
|
2007-10-17 12:43:36 +02:00
|
|
|
.include "bsd.fast.prefs.mk"
|
2005-08-19 06:44:09 +02:00
|
|
|
|
|
|
|
.if exists(${PKGDIR}/options.mk)
|
|
|
|
. include "${PKGDIR}/options.mk"
|
|
|
|
.else
|
2005-11-11 08:10:06 +01:00
|
|
|
# Note: This expression is the same as ${PKGBASE}, but the latter is
|
|
|
|
# not defined yet, so we cannot use it here.
|
|
|
|
PKG_OPTIONS_VAR= PKG_OPTIONS.${PKGNAME:C/-[0-9].*//}
|
2007-10-17 12:43:36 +02:00
|
|
|
.include "bsd.options.mk"
|
2005-08-19 06:44:09 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !empty(PKG_OPTIONS:Mdjbware-errno-hack)
|
|
|
|
SUBST_CLASSES+= djbware
|
|
|
|
SUBST_STAGE.djbware= do-configure
|
2005-12-18 21:25:35 +01:00
|
|
|
SUBST_FILES.djbware+= error.h
|
2005-08-19 06:44:09 +02:00
|
|
|
SUBST_SED.djbware= -e 's|^extern\ int\ errno\;|\#include \<errno.h\>|'
|
2006-01-21 11:10:42 +01:00
|
|
|
SUBST_MESSAGE.djbware= Correcting definition of errno.
|
2005-08-19 06:44:09 +02:00
|
|
|
.endif
|
|
|
|
|
2005-03-23 01:50:06 +01:00
|
|
|
.endif # DJBWARE_MK
|