VirtualBox

Changeset 2223 in kBuild


Ignore:
Timestamp:
Jan 8, 2009 1:10:56 AM (16 years ago)
Author:
bird
Message:

header.kmk: Added KB_FN_OPT_TEST_SHORT, KB_FN_OPT_TEST_LONG and KB_FN_OPT_TEST_SHORT_LONG. Removed LEXTOOL from PROPS_TOOL (moved to the lex unit).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/header.kmk

    r2182 r2223  
    55
    66#
    7 # Copyright (c) 2004-2008 knut st. osmundsen <[email protected]>
     7# Copyright (c) 2004-2009 knut st. osmundsen <[email protected]>
    88#
    99# This file is part of kBuild.
     
    670670TARGET_PATH = $(PATH_TARGET)/$(1)
    671671
     672##
     673# Checks if the specified short option ($1) is found in the flags ($2),
     674# assuming getopt style options.
     675#
     676# @returns $3 if present, $4 not.
     677#
     678# @param   $1   The option (single char!).
     679# @param   $2   The option arguments.
     680# @param   $3   Eval and return if present.
     681# @param   $4   Eval and return if not present.
     682#
     683# @todo    May confuse option values starting with '-' for options.
     684# @remarks Invoke like this: $(evalcall KB_FN_OPT_TEST_SHORT,d,$(flags),present,not-present)
     685#
     686define KB_FN_OPT_TEST_SHORT
     687local options := $(translate $(strip $(filter -%,$(filter-out --%,$2))),$(SP)-,)
     688local .RETURN := $(if-expr $(pos $1,$(options)) != 0,$3,$4)
     689endef
     690
     691##
     692# Checks if the specified long option ($1) is found in the flags ($2),
     693# assuming getopt style options.
     694#
     695# @returns $3 if present, $4 not.
     696#
     697# @param   $1   The long option, dashes included. No % chars.
     698# @param   $2   The option arguments.
     699# @param   $3   Eval and return if present.
     700# @param   $4   Eval and return if not present.
     701#
     702# @todo    May confuse option values starting with '--' for options.
     703# @remarks Invoke like this: $(evalcall KBFN_OPT_TEST_SHORT,--defined,$(flags),present,not-present)
     704#
     705define KB_FN_OPT_TEST_LONG
     706local options := $(filter-out =delete=%,$(subst :, =delete=,$(subst =, =delete=,$2)))
     707local .RETURN := $(if-expr "$(filter $1,$(options))" != "",$3,$4)
     708endef
     709
     710##
     711# Checks if the specified short ($1) or long ($2) option is found in the flags ($2),
     712# assuming getopt style options.
     713#
     714# @returns $4 if present, $5 not.
     715#
     716# @param   $1   The short option (single char!).
     717# @param   $2   The long option, dashes included. No % chars.
     718# @param   $3   The option arguments.
     719# @param   $4   Eval and return if present.
     720# @param   $5   Eval and return if not present.
     721#
     722# @todo    May confuse option values starting with '--' for options.
     723# @remarks Invoke like this: $(evalcall KB_FN_OPT_TEST_SHORT_LONG,d,--defined,$(flags),present,not-present)
     724#
     725define KB_FN_OPT_TEST_SHORT_LONG
     726local short_options := $(translate $(strip $(filter -%,$(filter-out --%,$3))),$(SP)-,)
     727local long_options := $(filter-out =delete=%,$(subst :, =delete=,$(subst =, =delete=,$3)))
     728local .RETURN := $(if-expr $(pos $1,$(short_options)) != 0 || "$(filter $2,$(long_options))" != "",$4,$5)
     729endef
     730
     731
    672732
    673733#
     
    725785## PROPS_TOOLS
    726786# This is a subset of PROPS_SINGLE.
    727 PROPS_TOOLS := TOOL CTOOL CXXTOOL OBJCTOOL ASTOOL RCTOOL ARTOOL LDTOOL LEXTOOL FETCHTOOL UNPACKTOOL PATCHTOOL
     787PROPS_TOOLS := TOOL CTOOL CXXTOOL OBJCTOOL ASTOOL RCTOOL ARTOOL LDTOOL FETCHTOOL UNPACKTOOL PATCHTOOL
    728788
    729789## PROPS_SINGLE
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette