VirtualBox

Changeset 2491 in kBuild


Ignore:
Timestamp:
Jul 22, 2011 11:17:10 AM (14 years ago)
Author:
bird
Message:

header.kmk: Use firstdefined if present.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/header.kmk

    r2488 r2491  
    746746# Similar to firstword, except it returns the value of first defined variable.
    747747# @param        $1              list of variables to probe.
    748 define FIRST-DEFINED-VAR
    749  if "$1" != ""
    750   local var := $(word 1,$1)
    751   ifdef $(var)
    752    local .RETURN := $(strip $($(var)))
     748if1of ($(KMK_FEATURES), firstdefined)
     749 define FIRST-DEFINED-VAR
     750  local .RETURN := $(strip $(firstdefined $1, value))
     751 endef
     752else
     753 define FIRST-DEFINED-VAR
     754  if "$1" != ""
     755   local var := $(word 1,$1)
     756   ifdef $(var)
     757    local .RETURN := $(strip $($(var)))
     758   else
     759    local .RETURN := $(evalcall FIRST-DEFINED-VAR, $(wordlist 2,32,$1))
     760   endif
    753761  else
    754    local .RETURN := $(evalcall FIRST-DEFINED-VAR, $(wordlist 2,32,$1))
     762   local .RETURN :=
    755763  endif
    756  else
    757   local .RETURN :=
    758  endif
    759 endef
     764 endef
     765endif
    760766
    761767## Figure out where to put object files.
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