Blame m4/progtest.m4

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