xref: /netbsd-src/external/gpl2/diffutils/dist/m4/progtest.m4 (revision 75f6d617e282811cb173c2ccfbf5df0dd71f7045)
1*75f6d617Schristos# progtest.m4 serial 2 (gettext-0.10.40)
2*75f6d617Schristosdnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
3*75f6d617Schristosdnl This file is free software, distributed under the terms of the GNU
4*75f6d617Schristosdnl General Public License.  As a special exception to the GNU General
5*75f6d617Schristosdnl Public License, this file may be distributed as part of a program
6*75f6d617Schristosdnl that contains a configuration script generated by Autoconf, under
7*75f6d617Schristosdnl the same distribution terms as the rest of that program.
8*75f6d617Schristosdnl
9*75f6d617Schristosdnl This file can can be used in projects which are not available under
10*75f6d617Schristosdnl the GNU General Public License or the GNU Library General Public
11*75f6d617Schristosdnl License but which still want to provide support for the GNU gettext
12*75f6d617Schristosdnl functionality.
13*75f6d617Schristosdnl Please note that the actual code of the GNU gettext library is covered
14*75f6d617Schristosdnl by the GNU Library General Public License, and the rest of the GNU
15*75f6d617Schristosdnl gettext package package is covered by the GNU General Public License.
16*75f6d617Schristosdnl They are *not* in the public domain.
17*75f6d617Schristos
18*75f6d617Schristosdnl Authors:
19*75f6d617Schristosdnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
20*75f6d617Schristos
21*75f6d617Schristos# Search path for a program which passes the given test.
22*75f6d617Schristos
23*75f6d617Schristosdnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
24*75f6d617Schristosdnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
25*75f6d617SchristosAC_DEFUN([AM_PATH_PROG_WITH_TEST],
26*75f6d617Schristos[# Extract the first word of "$2", so it can be a program name with args.
27*75f6d617Schristosset dummy $2; ac_word=[$]2
28*75f6d617SchristosAC_MSG_CHECKING([for $ac_word])
29*75f6d617SchristosAC_CACHE_VAL(ac_cv_path_$1,
30*75f6d617Schristos[case "[$]$1" in
31*75f6d617Schristos  /*)
32*75f6d617Schristos  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
33*75f6d617Schristos  ;;
34*75f6d617Schristos  *)
35*75f6d617Schristos  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
36*75f6d617Schristos  for ac_dir in ifelse([$5], , $PATH, [$5]); do
37*75f6d617Schristos    test -z "$ac_dir" && ac_dir=.
38*75f6d617Schristos    if test -f $ac_dir/$ac_word; then
39*75f6d617Schristos      if [$3]; then
40*75f6d617Schristos	ac_cv_path_$1="$ac_dir/$ac_word"
41*75f6d617Schristos	break
42*75f6d617Schristos      fi
43*75f6d617Schristos    fi
44*75f6d617Schristos  done
45*75f6d617Schristos  IFS="$ac_save_ifs"
46*75f6d617Schristosdnl If no 4th arg is given, leave the cache variable unset,
47*75f6d617Schristosdnl so AC_PATH_PROGS will keep looking.
48*75f6d617Schristosifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
49*75f6d617Schristos])dnl
50*75f6d617Schristos  ;;
51*75f6d617Schristosesac])dnl
52*75f6d617Schristos$1="$ac_cv_path_$1"
53*75f6d617Schristosif test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
54*75f6d617Schristos  AC_MSG_RESULT([$]$1)
55*75f6d617Schristoselse
56*75f6d617Schristos  AC_MSG_RESULT(no)
57*75f6d617Schristosfi
58*75f6d617SchristosAC_SUBST($1)dnl
59*75f6d617Schristos])
60