@@ -136,13 +136,16 @@ enum FBCTOOLFLAG
136136 FBCTOOLFLAG_INVALID = 0 '' tool is disabled
137137 FBCTOOLFLAG_ASSUME_EXISTS = 1 '' assume the tool exists
138138 FBCTOOLFLAG_CAN_USE_ENVIRON = 2 '' allow path to tool to specified by environment variable
139+ FBCTOOLFLAG_FOUND = 4 '' tool was checked for
140+ FBCTOOLFLAG_RELYING_ON_SYSTEM = 8 '' tool is expected to be on system PATH
139141
140142 FBCTOOLFLAG_DEFAULT = FBCTOOLFLAG_ASSUME_EXISTS or FBCTOOLFLAG_CAN_USE_ENVIRON
141143end enum
142144
143145type FBCTOOLINFO
144146 name as zstring * 16
145147 flags as FBCTOOLFLAG
148+ path as zstring * (FB_MAXPATHLEN + 1 )
146149end type
147150
148151'' must be same order as enum FBCTOOL
@@ -411,13 +414,10 @@ private sub fbcFindBin _
411414 byref relying_on_system as integer _
412415 )
413416
414- static as integer lasttool = - 1 , last_relying_on_system
415- static as string lastpath
416-
417417 '' Re-use path from last time if possible
418- if ( lasttool = tool ) then
419- path = lastpath
420- relying_on_system = last_relying_on_system
418+ if ( ( fbctoolTB( tool ).flags and FBCTOOLFLAG_FOUND ) <> 0 ) then
419+ path = fbctoolTB( tool ).path
420+ relying_on_system = ((fbctoolTB( tool ).flags and FBCTOOLFLAG_RELYING_ON_SYSTEM) <> 0 )
421421 exit sub
422422 end if
423423
@@ -455,9 +455,12 @@ private sub fbcFindBin _
455455 # endif
456456 end if
457457
458- lasttool = tool
459- lastpath = path
460- last_relying_on_system = relying_on_system
458+
459+ fbctoolTB( tool ).path = path
460+ fbctoolTB( tool ).flags or = FBCTOOLFLAG_FOUND
461+ fbctoolTB( tool ).flags = iif( relying_on_system, _
462+ fbctoolTB( tool ).flags or FBCTOOLFLAG_RELYING_ON_SYSTEM, _
463+ fbctoolTB( tool ).flags and not FBCTOOLFLAG_RELYING_ON_SYSTEM )
461464end sub
462465
463466private function fbcRunBin _
0 commit comments