Blame m4/progtest.m4

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