Blame m4/progtest.m4

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