[BACK]Return to pkg-build-options.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / mk

Annotation of pkgsrc/mk/pkg-build-options.mk, Revision 1.9

1.9     ! wiz         1: # $NetBSD: pkg-build-options.mk,v 1.8 2009/03/20 19:25:01 joerg Exp $
1.1       rillig      2: #
                      3: # This procedure determines the PKG_OPTIONS that have been in effect
1.2       rillig      4: # when the package ${pkgbase} has been built. When the package is not
                      5: # yet installed, the current PKG_OPTIONS are queried.
1.1       rillig      6: #
                      7: # Parameters:
                      8: #      pkgbase
                      9: #              The basename of the package.
                     10: #
                     11: # Returns:
                     12: #      PKG_BUILD_OPTIONS.${pkgbase}
                     13: #              The build options of the package.
                     14: #
                     15: # Example:
                     16: #      pkgbase := wine
                     17: #      .include "../../mk/pkg-build-options.mk"
                     18: #
1.6       rillig     19: # Keywords: options pkg-build-options PKG_BUILD_OPTIONS
                     20: #
1.3       rillig     21:
1.7       dsl        22: .include "bsd.fast.prefs.mk"
1.1       rillig     23:
1.8       joerg      24: # For the check for inclusion from non-buildlink3.mk, it is irrelevant
                     25: # whether BUILDLINK_TREE was empty or undefined, so defining it here
                     26: # avoids dealing one case.
                     27: BUILDLINK_TREE?=
                     28:
                     29: # Counting words doesn't work as expected for empty strings, they
                     30: # still have one word.  Older make doesn't like the code without
                     31: # variable assignment for unknown reasons.
                     32: _BUILDLINK_TREE_WITH:= ${BUILDLINK_TREE:M-*:[\#]}
                     33: _BUILDLINK_TREE_WITHOUT:= ${BUILDLINK_TREE:N-*:[\#]}
                     34: .if (empty(BUILDLINK_TREE:M-*) && empty(BUILDLINK_TREE:N-*)) || \
                     35:     (!empty(BUILDLINK_TREE:M-*) && !empty(BUILDLINK_TREE:N-*) && \
                     36:      ${_BUILDLINK_TREE_WITH} == ${_BUILDLINK_TREE_WITHOUT})
                     37: .  for b in ${pkgbase}
                     38: PKG_BUILD_OPTIONS.${b}=
                     39: PKG_FAIL_REASON+=      "[pkg-build-options.mk] This file may only be included from a buildlink3.mk file (pkgbase=${b})."
                     40: .  endfor
                     41: .else
1.1       rillig     42: .  for b in ${pkgbase}
                     43: .    if !defined(PKG_BUILD_OPTIONS.${b})
                     44: PKG_BUILD_OPTIONS.${b} != \
1.4       rillig     45:        echo ""; \
1.9     ! wiz        46:        ${PKG_INFO} -Q PKG_OPTIONS ${b} 2>/dev/null \
1.3       rillig     47:        || { cd ${BUILDLINK_PKGSRCDIR.${b}} \
                     48:             && ${MAKE} ${MAKEFLAGS} show-var VARNAME=PKG_OPTIONS; }
1.1       rillig     49:
                     50: MAKEFLAGS+=    PKG_BUILD_OPTIONS.${b}=${PKG_BUILD_OPTIONS.${b}:Q}
                     51: .    endif
                     52:
                     53: MAKEVARS+=     PKG_BUILD_OPTIONS.${b}
                     54: .  endfor
                     55: .endif

CVSweb <webmaster@jp.NetBSD.org>