|
1 | 1 | # |
2 | | -# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. |
| 2 | +# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | # |
5 | 5 | # This code is free software; you can redistribute it and/or modify it |
@@ -186,7 +186,6 @@ AC_DEFUN([UTIL_CHECK_WINENV_EXEC_TYPE], |
186 | 186 | # it need to be in the PATH. |
187 | 187 | # $1: The name of the variable to fix |
188 | 188 | # $2: Where to look for the command (replaces $PATH) |
189 | | -# $3: set to NOFIXPATH to skip prefixing FIXPATH, even if needed on platform |
190 | 189 | AC_DEFUN([UTIL_FIXUP_EXECUTABLE], |
191 | 190 | [ |
192 | 191 | input="[$]$1" |
@@ -282,10 +281,6 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE], |
282 | 281 | fi |
283 | 282 | fi |
284 | 283 |
|
285 | | - if test "x$3" = xNOFIXPATH; then |
286 | | - fixpath_prefix="" |
287 | | - fi |
288 | | -
|
289 | 284 | # Now join together the path and the arguments once again |
290 | 285 | new_complete="$fixpath_prefix$new_path$arguments" |
291 | 286 | $1="$new_complete" |
@@ -379,7 +374,6 @@ AC_DEFUN([UTIL_SETUP_TOOL], |
379 | 374 | # $1: variable to set |
380 | 375 | # $2: executable name (or list of names) to look for |
381 | 376 | # $3: [path] |
382 | | -# $4: set to NOFIXPATH to skip prefixing FIXPATH, even if needed on platform |
383 | 377 | AC_DEFUN([UTIL_LOOKUP_PROGS], |
384 | 378 | [ |
385 | 379 | UTIL_SETUP_TOOL($1, [ |
@@ -421,10 +415,8 @@ AC_DEFUN([UTIL_LOOKUP_PROGS], |
421 | 415 |
|
422 | 416 | # If we have FIXPATH enabled, strip all instances of it and prepend |
423 | 417 | # a single one, to avoid double fixpath prefixing. |
424 | | - if test "x$4" != xNOFIXPATH; then |
425 | | - [ if [[ $FIXPATH != "" && $result =~ ^"$FIXPATH " ]]; then ] |
426 | | - result="\$FIXPATH ${result#"$FIXPATH "}" |
427 | | - fi |
| 418 | + [ if [[ $FIXPATH != "" && $result =~ ^"$FIXPATH " ]]; then ] |
| 419 | + result="\$FIXPATH ${result#"$FIXPATH "}" |
428 | 420 | fi |
429 | 421 | AC_MSG_RESULT([$result]) |
430 | 422 | break 2; |
@@ -515,6 +507,24 @@ AC_DEFUN([UTIL_ADD_FIXPATH], |
515 | 507 | fi |
516 | 508 | ]) |
517 | 509 |
|
| 510 | +################################################################################ |
| 511 | +# Return a path to the executable binary from a command line, stripping away |
| 512 | +# any FIXPATH prefix or arguments. The resulting value can be checked for |
| 513 | +# existence using "test -e". The result is returned in a variable named |
| 514 | +# "$1_EXECUTABLE". |
| 515 | +# |
| 516 | +# $1: variable describing the command to get the binary for |
| 517 | +AC_DEFUN([UTIL_GET_EXECUTABLE], |
| 518 | +[ |
| 519 | + # Strip the FIXPATH prefix, if any |
| 520 | + fixpath_stripped="[$]$1" |
| 521 | + [ if [[ $FIXPATH != "" && $fixpath_stripped =~ ^"$FIXPATH " ]]; then ] |
| 522 | + fixpath_stripped="${fixpath_stripped#"$FIXPATH "}" |
| 523 | + fi |
| 524 | + # Remove any arguments following the binary |
| 525 | + $1_EXECUTABLE="${fixpath_stripped%% *}" |
| 526 | +]) |
| 527 | + |
518 | 528 | ################################################################################ |
519 | 529 | AC_DEFUN([UTIL_REMOVE_SYMBOLIC_LINKS], |
520 | 530 | [ |
|
0 commit comments