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