diff options
author | obache <obache@pkgsrc.org> | 2010-05-02 23:59:29 +0000 |
---|---|---|
committer | obache <obache@pkgsrc.org> | 2010-05-02 23:59:29 +0000 |
commit | 0a410cf402eef3cc56876659ee046166b1a527cc (patch) | |
tree | 572d2f0d1aa131fde9a14f395386b399a358f395 /mk | |
parent | e676f33c2e79174abcbeb812d3aaa8c753ede7af (diff) | |
download | pkgsrc-0a410cf402eef3cc56876659ee046166b1a527cc.tar.gz |
Fixes r1.3, and recommit.
Assign with expansion to avoid confusion if this file is included multiply.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/buildlink3/find-files.mk | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/mk/buildlink3/find-files.mk b/mk/buildlink3/find-files.mk index ee9c98be7c1..0398e9ebc1e 100644 --- a/mk/buildlink3/find-files.mk +++ b/mk/buildlink3/find-files.mk @@ -1,4 +1,4 @@ -# $NetBSD: find-files.mk,v 1.4 2010/05/02 20:26:13 wiz Exp $ +# $NetBSD: find-files.mk,v 1.5 2010/05/02 23:59:29 obache Exp $ # # Copyright (c) 2005 The NetBSD Foundation, Inc. # All rights reserved. @@ -83,17 +83,30 @@ USE_TOOLS+= grep . if !defined(${_var_}) ${_var_}= __nonexistent__ . for _file_ in ${BUILTIN_FIND_FILES.${_var_}} -. if !empty(${_var_}:M__nonexistent__) && exists(${_file_}) +. if !empty(${_var_}:M__nonexistent__) +_real_file_= __noexistent__ +. if exists(${_file_}) +_real_file_= ${_file_} +. endif +. if !empty(_real_file_:M__noexistent__) && defined(BEINCLUDES) && !empty(BEINCLUDES) +. for _try_file_ in ${BEINCLUDES:S/;/ /g:=${_file_:S/\/usr\/include\//\//g}} +. if !empty(_real_file_:M__noexistent__) && exists(${_try_file_}) +_real_file_= ${_try_file_} +. endif +. endfor +. endif +. if empty(_real_file_:M__noexistent__) . if !defined(BUILTIN_FIND_GREP.${_var_}) -${_var_}= ${_file_} +${_var_}:= ${_real_file_} . else ${_var_}!= \ - if ${GREP} -q ${BUILTIN_FIND_GREP.${_var_}:Q} ${_file_:Q}; then \ - ${ECHO} ${_file_:Q}; \ + if ${GREP} -q ${BUILTIN_FIND_GREP.${_var_}:Q} ${_real_file_:Q}; then \ + ${ECHO} ${_real_file_:Q}; \ else \ ${ECHO} __nonexistent__; \ fi . endif +. endif . endif . endfor . endif |