aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authormat <mat@FreeBSD.org>2015-07-01 20:11:16 +0800
committermat <mat@FreeBSD.org>2015-07-01 20:11:16 +0800
commita38043e933c1c59036dce545e2cd6d003b38a434 (patch)
treec001c2276a0940cf57f57f670c1824077d9ed3b4 /Mk
parentb5885ed0b137c179bdfc2d87acef262ac263b86f (diff)
downloadfreebsd-ports-gnome-a38043e933c1c59036dce545e2cd6d003b38a434.tar.gz
freebsd-ports-gnome-a38043e933c1c59036dce545e2cd6d003b38a434.tar.zst
freebsd-ports-gnome-a38043e933c1c59036dce545e2cd6d003b38a434.zip
Introduce target option helpers.
With hat: portmgr Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D2944
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.options.mk17
-rw-r--r--Mk/bsd.port.mk28
2 files changed, 31 insertions, 14 deletions
diff --git a/Mk/bsd.options.mk b/Mk/bsd.options.mk
index a7760c3baf02..f02cfd195d57 100644
--- a/Mk/bsd.options.mk
+++ b/Mk/bsd.options.mk
@@ -135,6 +135,7 @@ _OPTIONS_FLAGS= ALL_TARGET CATEGORIES CFLAGS CONFIGURE_ENV CONFLICTS \
MAKE_ENV PATCHFILES PATCH_SITES PLIST_DIRS PLIST_DIRSTRY \
PLIST_FILES PLIST_SUB SUB_FILES SUB_LIST USES
_OPTIONS_DEPENDS= PKG FETCH EXTRACT PATCH BUILD LIB RUN
+_OPTIONS_TARGETS= fetch extract patch configure build install package stage
# Set the default values for the global options, as defined by portmgr
.if !defined(NOPORTDOCS)
@@ -410,6 +411,12 @@ WITH_DEBUG= yes
ALL_OPTIONS= ${OPTIONS_DEFINE}
.endif
+.for target in ${_OPTIONS_TARGETS}
+.for prepost in pre post
+_OPTIONS_${prepost}_${target}?=
+.endfor
+.endfor
+
.for opt in ${COMPLETE_OPTIONS_LIST} ${OPTIONS_SLAVE} ${OPTIONS_EXCLUDE_${ARCH}} ${OPTIONS_EXCLUDE}
# PLIST_SUB
PLIST_SUB?=
@@ -463,6 +470,11 @@ ${flags}+= ${${opt}_${flags}}
${deptype}_DEPENDS+= ${${opt}_${deptype}_DEPENDS}
. endif
. endfor
+. for target in ${_OPTIONS_TARGETS}
+. for prepost in pre post
+_OPTIONS_${prepost}_${target}+= ${prepost}-${target}-${opt}-on
+. endfor
+. endfor
. else
. if defined(${opt}_USE_OFF)
. for option in ${${opt}_USE_OFF}
@@ -495,6 +507,11 @@ ${flags}+= ${${opt}_${flags}_OFF}
${deptype}_DEPENDS+= ${${opt}_${deptype}_DEPENDS_OFF}
. endif
. endfor
+. for target in ${_OPTIONS_TARGETS}
+. for prepost in pre post
+_OPTIONS_${prepost}_${target}+= ${prepost}-${target}-${opt}-off
+. endfor
+. endfor
. endif
.endfor
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 58a2eb1fe62d..c95af6ab0022 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -5721,33 +5721,33 @@ _SANITY_SEQ= post-chroot pre-everything check-makefile \
_PKG_DEP= check-sanity
_PKG_SEQ= pkg-depends
_FETCH_DEP= pkg
-_FETCH_SEQ= fetch-depends pre-fetch pre-fetch-script \
- do-fetch fetch-specials post-fetch post-fetch-script
+_FETCH_SEQ= fetch-depends pre-fetch ${_OPTIONS_pre_fetch} pre-fetch-script \
+ do-fetch fetch-specials post-fetch ${_OPTIONS_post_fetch} post-fetch-script
_EXTRACT_DEP= fetch
_EXTRACT_SEQ= check-build-conflicts extract-message checksum extract-depends \
- clean-wrkdir ${WRKDIR} pre-extract pre-extract-script do-extract \
- post-extract post-extract-script
+ clean-wrkdir ${WRKDIR} pre-extract ${_OPTIONS_pre_extract} pre-extract-script do-extract \
+ post-extract ${_OPTIONS_post_extract} post-extract-script
_PATCH_DEP= extract
_PATCH_SEQ= ask-license patch-message patch-depends pathfix dos2unix fix-shebang \
- pre-patch \
- pre-patch-script do-patch charsetfix-post-patch post-patch post-patch-script
+ pre-patch ${_OPTIONS_pre_patch} \
+ pre-patch-script do-patch charsetfix-post-patch post-patch ${_OPTIONS_post_patch} post-patch-script
_CONFIGURE_DEP= patch
_CONFIGURE_SEQ= build-depends lib-depends configure-message \
- pre-configure pre-configure-script \
+ pre-configure ${_OPTIONS_pre_configure} pre-configure-script \
run-autotools do-autoreconf patch-libtool run-autotools-fixup do-configure \
- post-configure post-configure-script
+ post-configure ${_OPTIONS_post_configure} post-configure-script
_BUILD_DEP= configure
-_BUILD_SEQ= build-message pre-build pre-build-script do-build \
- post-build post-build-script
+_BUILD_SEQ= build-message pre-build ${_OPTIONS_pre_build} pre-build-script do-build \
+ post-build ${_OPTIONS_post_build} post-build-script
_STAGE_DEP= build
-_STAGE_SEQ= stage-message stage-dir run-depends lib-depends apply-slist pre-install generate-plist \
+_STAGE_SEQ= stage-message stage-dir run-depends lib-depends apply-slist pre-install ${_OPTIONS_pre_install} ${_OPTIONS_pre_stage} generate-plist \
pre-su-install
# ${POST_PLIST} must be after anything that modifies TMPPLIST
_STAGE_SEQ+= create-users-groups do-install \
kmod-post-install fix-perl-things \
- webplugin-post-install post-install post-install-script \
- move-uniquefiles patch-lafiles post-stage compress-man \
+ webplugin-post-install post-install ${_OPTIONS_post_install} post-install-script \
+ move-uniquefiles patch-lafiles post-stage ${_OPTIONS_post_stage} compress-man \
install-rc-script install-ldconfig-file install-license \
install-desktop-entries add-plist-info add-plist-docs \
add-plist-examples add-plist-data add-plist-post \
@@ -5760,7 +5760,7 @@ _INSTALL_SEQ= install-message run-depends lib-depends check-already-installed
_INSTALL_SUSEQ= fake-pkg security-check
_PACKAGE_DEP= stage
-_PACKAGE_SEQ= package-message pre-package pre-package-script do-package post-package-script
+_PACKAGE_SEQ= package-message pre-package ${_OPTIONS_pre_package} pre-package-script do-package ${_OPTIONS_post_package} post-package-script
# Enforce order for -jN builds