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