Blame m4/progtest.m4

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