make/autoconf/basics.m4
changeset 58669 931ec3339786
parent 58549 9d9317fad3fe
child 58679 9c3209ff7550
child 59120 fc68b2cdfeeb
equal deleted inserted replaced
58668:eda750f21308 58669:931ec3339786
   487 
   487 
   488       # First remove it from the list of overridden variables, so we can test
   488       # First remove it from the list of overridden variables, so we can test
   489       # for unknown variables in the end.
   489       # for unknown variables in the end.
   490       CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
   490       CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
   491 
   491 
       
   492       tool_override=[$]$1
       
   493       AC_MSG_NOTICE([User supplied override $1="$tool_override"])
       
   494 
   492       # Check if we try to supply an empty value
   495       # Check if we try to supply an empty value
   493       if test "x[$]$1" = x; then
   496       if test "x$tool_override" = x; then
   494         AC_MSG_NOTICE([Setting user supplied tool $1= (no value)])
       
   495         AC_MSG_CHECKING([for $1])
   497         AC_MSG_CHECKING([for $1])
   496         AC_MSG_RESULT([disabled])
   498         AC_MSG_RESULT([disabled])
   497       else
   499       else
       
   500         # Split up override in command part and argument part
       
   501         tool_and_args=($tool_override)
       
   502         [ tool_command=${tool_and_args[0]} ]
       
   503         [ unset 'tool_and_args[0]' ]
       
   504         [ tool_args=${tool_and_args[@]} ]
       
   505 
   498         # Check if the provided tool contains a complete path.
   506         # Check if the provided tool contains a complete path.
   499         tool_specified="[$]$1"
   507         tool_basename="${tool_command##*/}"
   500         tool_basename="${tool_specified##*/}"
   508         if test "x$tool_basename" = "x$tool_command"; then
   501         if test "x$tool_basename" = "x$tool_specified"; then
       
   502           # A command without a complete path is provided, search $PATH.
   509           # A command without a complete path is provided, search $PATH.
   503           AC_MSG_NOTICE([Will search for user supplied tool $1=$tool_basename])
   510           AC_MSG_NOTICE([Will search for user supplied tool "$tool_basename"])
   504           AC_PATH_PROG($1, $tool_basename)
   511           AC_PATH_PROG($1, $tool_basename)
   505           if test "x[$]$1" = x; then
   512           if test "x[$]$1" = x; then
   506             AC_MSG_ERROR([User supplied tool $tool_basename could not be found])
   513             AC_MSG_ERROR([User supplied tool $1="$tool_basename" could not be found])
   507           fi
   514           fi
   508         else
   515         else
   509           # Otherwise we believe it is a complete path. Use it as it is.
   516           # Otherwise we believe it is a complete path. Use it as it is.
   510           AC_MSG_NOTICE([Will use user supplied tool $1=$tool_specified])
   517           AC_MSG_NOTICE([Will use user supplied tool "$tool_command"])
   511           AC_MSG_CHECKING([for $1])
   518           AC_MSG_CHECKING([for $tool_command])
   512           if test ! -x "$tool_specified"; then
   519           if test ! -x "$tool_command"; then
   513             AC_MSG_RESULT([not found])
   520             AC_MSG_RESULT([not found])
   514             AC_MSG_ERROR([User supplied tool $1=$tool_specified does not exist or is not executable])
   521             AC_MSG_ERROR([User supplied tool $1="$tool_command" does not exist or is not executable])
   515           fi
   522           fi
   516           AC_MSG_RESULT([$tool_specified])
   523            $1="$tool_command"
       
   524           AC_MSG_RESULT([found])
       
   525         fi
       
   526         if test "x$tool_args" != x; then
       
   527           # If we got arguments, re-append them to the command after the fixup.
       
   528           $1="[$]$1 $tool_args"
   517         fi
   529         fi
   518       fi
   530       fi
   519     fi
   531     fi
   520     $3
   532     $3
   521   fi
   533   fi