2N/A# progtest.m4 serial 7 (gettext-0.18.2)
2N/Adnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc.
2N/Adnl This file is free software; the Free Software Foundation
2N/Adnl gives unlimited permission to copy and/or distribute it,
2N/Adnl with or without modifications, as long as this notice is preserved.
2N/Adnl
2N/Adnl This file can can be used in projects which are not available under
2N/Adnl the GNU General Public License or the GNU Library General Public
2N/Adnl License but which still want to provide support for the GNU gettext
2N/Adnl functionality.
2N/Adnl Please note that the actual code of the GNU gettext library is covered
2N/Adnl by the GNU Library General Public License, and the rest of the GNU
2N/Adnl gettext package package is covered by the GNU General Public License.
2N/Adnl They are *not* in the public domain.
2N/A
2N/Adnl Authors:
2N/Adnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2N/A
2N/AAC_PREREQ([2.50])
2N/A
2N/A# Search path for a program which passes the given test.
2N/A
2N/Adnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2N/Adnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2N/AAC_DEFUN([AM_PATH_PROG_WITH_TEST],
2N/A[
2N/A# Prepare PATH_SEPARATOR.
2N/A# The user is always right.
2N/Aif test "${PATH_SEPARATOR+set}" != set; then
2N/A # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
2N/A # contains only /bin. Note that ksh looks also at the FPATH variable,
2N/A # so we have to set that as well for the test.
2N/A PATH_SEPARATOR=:
2N/A (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
2N/A && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
2N/A || PATH_SEPARATOR=';'
2N/A }
2N/Afi
2N/A
2N/A# Find out how to test for executable files. Don't use a zero-byte file,
2N/A# as systems may use methods other than mode bits to determine executability.
2N/Acat >conf$$.file <<_ASEOF
2N/A#! /bin/sh
2N/Aexit 0
2N/A_ASEOF
2N/Achmod +x conf$$.file
2N/Aif test -x conf$$.file >/dev/null 2>&1; then
2N/A ac_executable_p="test -x"
2N/Aelse
2N/A ac_executable_p="test -f"
2N/Afi
2N/Arm -f conf$$.file
2N/A
2N/A# Extract the first word of "$2", so it can be a program name with args.
2N/Aset dummy $2; ac_word=[$]2
2N/AAC_MSG_CHECKING([for $ac_word])
2N/AAC_CACHE_VAL([ac_cv_path_$1],
2N/A[case "[$]$1" in
2N/A [[\\/]]* | ?:[[\\/]]*)
2N/A ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2N/A ;;
2N/A *)
2N/A ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2N/A for ac_dir in ifelse([$5], , $PATH, [$5]); do
2N/A IFS="$ac_save_IFS"
2N/A test -z "$ac_dir" && ac_dir=.
2N/A for ac_exec_ext in '' $ac_executable_extensions; do
2N/A if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2N/A echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
2N/A if [$3]; then
2N/A ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2N/A break 2
2N/A fi
2N/A fi
2N/A done
2N/A done
2N/A IFS="$ac_save_IFS"
2N/Adnl If no 4th arg is given, leave the cache variable unset,
2N/Adnl so AC_PATH_PROGS will keep looking.
2N/Aifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2N/A])dnl
2N/A ;;
2N/Aesac])dnl
2N/A$1="$ac_cv_path_$1"
2N/Aif test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2N/A AC_MSG_RESULT([$][$1])
2N/Aelse
2N/A AC_MSG_RESULT([no])
2N/Afi
2N/AAC_SUBST([$1])dnl
2N/A])