Blame m4/progtest.m4

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