📄 programs.m4
字号:
# This file is part of Autoconf. -*- Autoconf -*-# Checking for programs.# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002# Free Software Foundation, Inc.# This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2, or (at your option)# any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA# 02111-1307, USA.# As a special exception, the Free Software Foundation gives unlimited# permission to copy, distribute and modify the configure scripts that# are the output of Autoconf. You need not follow the terms of the GNU# General Public License when using or distributing such scripts, even# though portions of the text of Autoconf appear in them. The GNU# General Public License (GPL) does govern all other use of the material# that constitutes the Autoconf program.## Certain portions of the Autoconf source text are designed to be copied# (in certain cases, depending on the input) into the output of# Autoconf. We call these the "data" portions. The rest of the Autoconf# source text consists of comments plus executable code that decides which# of the data portions to output in any given case. We call these# comments and executable code the "non-data" portions. Autoconf never# copies any of the non-data portions into its output.## This special exception to the GPL applies to versions of Autoconf# released by the Free Software Foundation. When you make and# distribute a modified version of Autoconf, you may extend this special# exception to the GPL to apply to your modified version as well, *unless*# your modified version has the potential to copy into its output some# of the text that was the non-data portion of the version that you started# with. (In other words, unless your change moves or copies text from# the non-data portions to the data portions.) If your modification has# such potential, you must delete any notice of this special exception# to the GPL from your modified version.## Written by David MacKenzie, with help from# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,# Roland McGrath, Noah Friedman, david d zuhn, and many others.## ----------------------------- #### Generic checks for programs. #### ----------------------------- ### AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR,# [VALUE-IF-FOUND], [VALUE-IF-NOT-FOUND],# [PATH], [REJECT])# -----------------------------------------------------AC_DEFUN([AC_CHECK_PROG],[# Extract the first word of "$2", so it can be a program name with args.set dummy $2; ac_word=$[2]AC_MSG_CHECKING([for $ac_word])AC_CACHE_VAL(ac_cv_prog_$1,[if test -n "$$1"; then ac_cv_prog_$1="$$1" # Let the user override the test.elsem4_ifvaln([$6],[ ac_prog_rejected=no])dnl_AS_PATH_WALK([$5],[for ac_exec_ext in '' $ac_executable_extensions; do if AS_EXECUTABLE_P(["$as_dir/$ac_word$ac_exec_ext"]); thenm4_ifvaln([$6],[ if test "$as_dir/$ac_word$ac_exec_ext" = "$6"; then ac_prog_rejected=yes continue fi])dnl ac_cv_prog_$1="$3" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&AS_MESSAGE_LOG_FD break 2 fidone])m4_ifvaln([$6],[if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_$1 shift if test $[@%:@] != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set $1 to just the basename; use the full file name. shift ac_cv_prog_$1="$as_dir/$ac_word${1+' '}$[@]"m4_if([$2], [$4],[ else # Default is a loser. AC_MSG_ERROR([$1=$6 unacceptable, but no other $4 found in dnlm4_default([$5], [\$PATH])])])dnl fifi])dnldnl If no 4th arg is given, leave the cache variable unset,dnl so AC_CHECK_PROGS will keep looking.m4_ifvaln([$4],[ test -z "$ac_cv_prog_$1" && ac_cv_prog_$1="$4"])dnlfi])dnl$1=$ac_cv_prog_$1if test -n "$$1"; then AC_MSG_RESULT([$$1])else AC_MSG_RESULT([no])fiAC_SUBST($1)dnl])# AC_CHECK_PROG# AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND],# [PATH])# ------------------------------------------------------------------AC_DEFUN([AC_CHECK_PROGS],[for ac_prog in $2do AC_CHECK_PROG([$1], [$ac_prog], [$ac_prog], , [$4]) test -n "$$1" && breakdonem4_ifvaln([$3], [test -n "$$1" || $1="$3"])])# AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH])# -----------------------------------------------------------------------AC_DEFUN([AC_PATH_PROG],[# Extract the first word of "$2", so it can be a program name with args.set dummy $2; ac_word=$[2]AC_MSG_CHECKING([for $ac_word])AC_CACHE_VAL([ac_cv_path_$1],[case $$1 in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="$$1" # Let the user override the test with a path. ;; *) _AS_PATH_WALK([$4],[for ac_exec_ext in '' $ac_executable_extensions; do if AS_EXECUTABLE_P(["$as_dir/$ac_word$ac_exec_ext"]); then ac_cv_path_$1="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&AS_MESSAGE_LOG_FD break 2 fidone])dnl If no 3rd arg is given, leave the cache variable unset,dnl so AC_PATH_PROGS will keep looking.m4_ifvaln([$3],[ test -z "$ac_cv_path_$1" && ac_cv_path_$1="$3"])dnl ;;esac])dnlAC_SUBST([$1], [$ac_cv_path_$1])if test -n "$$1"; then AC_MSG_RESULT([$$1])else AC_MSG_RESULT([no])fi])# AC_PATH_PROG# AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND],# [PATH])# -----------------------------------------------------------------AC_DEFUN([AC_PATH_PROGS],[for ac_prog in $2do AC_PATH_PROG([$1], [$ac_prog], , [$4]) test -n "$$1" && breakdonem4_ifvaln([$3], [test -n "$$1" || $1="$3"])dnl])## -------------------------- #### Generic checks for tools. #### -------------------------- ### AC_CHECK_TOOL_PREFIX# --------------------AU_DEFUN([AC_CHECK_TOOL_PREFIX])# AC_PATH_TOOL(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH])# -----------------------------------------------------------------------# (Use different variables $1 and ac_pt_$1 so that cache vars don't conflict.)AC_DEFUN([AC_PATH_TOOL],[if test -n "$ac_tool_prefix"; then AC_PATH_PROG([$1], [${ac_tool_prefix}$2], , [$4])fiif test -z "$ac_cv_path_$1"; then ac_pt_$1=$$1 AC_PATH_PROG([ac_pt_$1], [$2], [$3], [$4]) $1=$ac_pt_$1else $1="$ac_cv_path_$1"fi])# AC_PATH_TOOL# AC_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH])# ------------------------------------------------------------------------# (Use different variables $1 and ac_ct_$1 so that cache vars don't conflict.)AC_DEFUN([AC_CHECK_TOOL],[if test -n "$ac_tool_prefix"; then AC_CHECK_PROG([$1], [${ac_tool_prefix}$2], [${ac_tool_prefix}$2], , [$4])fiif test -z "$ac_cv_prog_$1"; then ac_ct_$1=$$1 AC_CHECK_PROG([ac_ct_$1], [$2], [$2], [$3], [$4]) $1=$ac_ct_$1else $1="$ac_cv_prog_$1"fi])# AC_CHECK_TOOL# AC_CHECK_TOOLS(VARIABLE, PROGS-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND],# [PATH])# ------------------------------------------------------------------# Check for each tool in PROGS-TO-CHECK-FOR with the cross prefix. If# none can be found with a cross prefix, then use the first one that# was found without the cross prefix.AC_DEFUN([AC_CHECK_TOOLS],[if test -n "$ac_tool_prefix"; then for ac_prog in $2 do AC_CHECK_PROG([$1], [$ac_tool_prefix$ac_prog], [$ac_tool_prefix$ac_prog],, [$4]) test -n "$$1" && break donefiif test -z "$$1"; then ac_ct_$1=$$1 AC_CHECK_PROGS([ac_ct_$1], [$2], [$3], [$4]) $1=$ac_ct_$1fi])# AC_CHECK_TOOLS## ---------------- #### Specific tests. #### ---------------- ### Please, keep this section sorted.# (But of course when keeping related things together).# Check for gawk first since it's generally better.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -