source: trunk/third/enscript/aclocal.m4 @ 18539

Revision 18539, 18.3 KB checked in by ghudson, 22 years ago (diff)
The previous logic didn't work on a Solaris system with gettext installed. Bludgeon it into working in that case.
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.3
2
3dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
4dnl This Makefile.in is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13# Do all the work for Automake.  This macro actually does too much --
14# some checks are only needed if your package does certain things.
15# But this isn't really a big deal.
16
17# serial 1
18
19dnl Usage:
20dnl AM_INIT_AUTOMAKE(package,version, [no-define])
21
22AC_DEFUN(AM_INIT_AUTOMAKE,
23[AC_REQUIRE([AM_PROG_INSTALL])
24PACKAGE=[$1]
25AC_SUBST(PACKAGE)
26VERSION=[$2]
27AC_SUBST(VERSION)
28dnl test to see if srcdir already configured
29if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
30  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
31fi
32ifelse([$3],,
33AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
34AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
35AC_REQUIRE([AM_SANITY_CHECK])
36AC_REQUIRE([AC_ARG_PROGRAM])
37dnl FIXME This is truly gross.
38missing_dir=`cd $ac_aux_dir && pwd`
39AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44AC_REQUIRE([AC_PROG_MAKE_SET])])
45
46
47# serial 1
48
49AC_DEFUN(AM_PROG_INSTALL,
50[AC_REQUIRE([AC_PROG_INSTALL])
51test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
52AC_SUBST(INSTALL_SCRIPT)dnl
53])
54
55#
56# Check to make sure that the build environment is sane.
57#
58
59AC_DEFUN(AM_SANITY_CHECK,
60[AC_MSG_CHECKING([whether build environment is sane])
61# Just in case
62sleep 1
63echo timestamp > conftestfile
64# Do `set' in a subshell so we don't clobber the current shell's
65# arguments.  Must try -L first in case configure is actually a
66# symlink; some systems play weird games with the mod time of symlinks
67# (eg FreeBSD returns the mod time of the symlink's containing
68# directory).
69if (
70   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
71   if test "[$]*" = "X"; then
72      # -L didn't work.
73      set X `ls -t $srcdir/configure conftestfile`
74   fi
75   if test "[$]*" != "X $srcdir/configure conftestfile" \
76      && test "[$]*" != "X conftestfile $srcdir/configure"; then
77
78      # If neither matched, then we have a broken ls.  This can happen
79      # if, for instance, CONFIG_SHELL is bash and it inherits a
80      # broken ls alias from the environment.  This has actually
81      # happened.  Such a system could not be considered "sane".
82      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
83alias in your environment])
84   fi
85
86   test "[$]2" = conftestfile
87   )
88then
89   # Ok.
90   :
91else
92   AC_MSG_ERROR([newly created file is older than distributed files!
93Check your system clock])
94fi
95rm -f conftest*
96AC_MSG_RESULT(yes)])
97
98dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
99dnl The program must properly implement --version.
100AC_DEFUN(AM_MISSING_PROG,
101[AC_MSG_CHECKING(for working $2)
102# Run test in a subshell; some versions of sh will print an error if
103# an executable is not found, even if stderr is redirected.
104# Redirect stdin to placate older versions of autoconf.  Sigh.
105if ($2 --version) < /dev/null > /dev/null 2>&1; then
106   $1=$2
107   AC_MSG_RESULT(found)
108else
109   $1="$3/missing $2"
110   AC_MSG_RESULT(missing)
111fi
112AC_SUBST($1)])
113
114# Like AC_CONFIG_HEADER, but automatically create stamp file.
115
116AC_DEFUN(AM_CONFIG_HEADER,
117[AC_PREREQ([2.12])
118AC_CONFIG_HEADER([$1])
119dnl When config.status generates a header, we must update the stamp-h file.
120dnl This file resides in the same directory as the config header
121dnl that is generated.  We must strip everything past the first ":",
122dnl and everything past the last "/".
123AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
124ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
125<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
126<<am_indx=1
127for am_file in <<$1>>; do
128  case " <<$>>CONFIG_HEADERS " in
129  *" <<$>>am_file "*<<)>>
130    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
131    ;;
132  esac
133  am_indx=`expr "<<$>>am_indx" + 1`
134done<<>>dnl>>)
135changequote([,]))])
136
137
138# serial 1
139
140AC_DEFUN(AM_C_PROTOTYPES,
141[AC_REQUIRE([AM_PROG_CC_STDC])
142AC_REQUIRE([AC_PROG_CPP])
143AC_MSG_CHECKING([for function prototypes])
144if test "$am_cv_prog_cc_stdc" != no; then
145  AC_MSG_RESULT(yes)
146  AC_DEFINE(PROTOTYPES)
147  U= ANSI2KNR=
148else
149  AC_MSG_RESULT(no)
150  U=_ ANSI2KNR=./ansi2knr
151  # Ensure some checks needed by ansi2knr itself.
152  AC_HEADER_STDC
153  AC_CHECK_HEADERS(string.h)
154fi
155AC_SUBST(U)dnl
156AC_SUBST(ANSI2KNR)dnl
157])
158
159
160# serial 1
161
162# @defmac AC_PROG_CC_STDC
163# @maindex PROG_CC_STDC
164# @ovindex CC
165# If the C compiler in not in ANSI C mode by default, try to add an option
166# to output variable @code{CC} to make it so.  This macro tries various
167# options that select ANSI C on some system or another.  It considers the
168# compiler to be in ANSI C mode if it handles function prototypes correctly.
169#
170# If you use this macro, you should check after calling it whether the C
171# compiler has been set to accept ANSI C; if not, the shell variable
172# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
173# code in ANSI C, you can make an un-ANSIfied copy of it by using the
174# program @code{ansi2knr}, which comes with Ghostscript.
175# @end defmac
176
177AC_DEFUN(AM_PROG_CC_STDC,
178[AC_REQUIRE([AC_PROG_CC])
179AC_BEFORE([$0], [AC_C_INLINE])
180AC_BEFORE([$0], [AC_C_CONST])
181dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
182dnl a magic option to avoid problems with ANSI preprocessor commands
183dnl like #elif.
184dnl FIXME: can't do this because then AC_AIX won't work due to a
185dnl circular dependency.
186dnl AC_BEFORE([$0], [AC_PROG_CPP])
187AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
188AC_CACHE_VAL(am_cv_prog_cc_stdc,
189[am_cv_prog_cc_stdc=no
190ac_save_CC="$CC"
191# Don't try gcc -ansi; that turns off useful extensions and
192# breaks some systems' header files.
193# AIX                   -qlanglvl=ansi
194# Ultrix and OSF/1      -std1
195# HP-UX                 -Aa -D_HPUX_SOURCE
196# SVR4                  -Xc -D__EXTENSIONS__
197for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
198do
199  CC="$ac_save_CC $ac_arg"
200  AC_TRY_COMPILE(
201[#include <stdarg.h>
202#include <stdio.h>
203#include <sys/types.h>
204#include <sys/stat.h>
205/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
206struct buf { int x; };
207FILE * (*rcsopen) (struct buf *, struct stat *, int);
208static char *e (p, i)
209     char **p;
210     int i;
211{
212  return p[i];
213}
214static char *f (char * (*g) (char **, int), char **p, ...)
215{
216  char *s;
217  va_list v;
218  va_start (v,p);
219  s = g (p, va_arg (v,int));
220  va_end (v);
221  return s;
222}
223int test (int i, double x);
224struct s1 {int (*f) (int a);};
225struct s2 {int (*f) (double a);};
226int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
227int argc;
228char **argv;
229], [
230return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
231],
232[am_cv_prog_cc_stdc="$ac_arg"; break])
233done
234CC="$ac_save_CC"
235])
236if test -z "$am_cv_prog_cc_stdc"; then
237  AC_MSG_RESULT([none needed])
238else
239  AC_MSG_RESULT($am_cv_prog_cc_stdc)
240fi
241case "x$am_cv_prog_cc_stdc" in
242  x|xno) ;;
243  *) CC="$CC $am_cv_prog_cc_stdc" ;;
244esac
245])
246
247
248dnl AM_PROG_LEX
249dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
250AC_DEFUN(AM_PROG_LEX,
251[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
252AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
253AC_PROG_LEX
254AC_DECL_YYTEXT])
255
256# Macro to add for using GNU gettext.
257# Ulrich Drepper <drepper@cygnus.com>, 1995.
258
259# serial 2
260
261AC_DEFUN(AM_WITH_NLS,
262  [AC_MSG_CHECKING([whether NLS is requested])
263    dnl Default is enabled NLS
264    AC_ARG_ENABLE(nls,
265      [  --disable-nls           do not use Native Language Support],
266      USE_NLS=$enableval, USE_NLS=yes)
267    AC_MSG_RESULT($USE_NLS)
268    AC_SUBST(USE_NLS)
269
270    USE_INCLUDED_LIBINTL=no
271
272    dnl If we use NLS figure out what method
273    if test "$USE_NLS" = "yes"; then
274      AC_DEFINE(ENABLE_NLS)
275      AC_MSG_CHECKING([whether included gettext is requested])
276      AC_ARG_WITH(included-gettext,
277        [  --with-included-gettext use the GNU gettext library included here],
278        nls_cv_force_use_gnu_gettext=$withval,
279        nls_cv_force_use_gnu_gettext=no)
280      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
281
282      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
283      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
284        dnl User does not insist on using GNU NLS library.  Figure out what
285        dnl to use.  If gettext or catgets are available (in this order) we
286        dnl use this.  Else we have to fall back to GNU NLS library.
287        dnl catgets is only used if permitted by option --with-catgets.
288        nls_cv_header_intl=
289        nls_cv_header_libgt=
290        CATOBJEXT=NONE
291
292        AC_CHECK_HEADER(libintl.h,
293          [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
294            [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
295               gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
296
297           if :; then
298             AC_CHECK_LIB(intl, bindtextdomain)
299             AC_CHECK_LIB(intl, bindtextdomain,
300               [AC_CACHE_CHECK([for gettext in libintl],
301                 gt_cv_func_gettext_libintl,
302                 [AC_TRY_LINK([], [return (int) gettext ("")],
303                 gt_cv_func_gettext_libintl=yes,
304                 gt_cv_func_gettext_libintl=no)])])
305           fi
306
307           if test "$gt_cv_func_gettext_libc" = "yes" \
308              || test "$gt_cv_func_gettext_libintl" = "yes"; then
309              AC_DEFINE(HAVE_GETTEXT)
310              AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
311                [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
312              if test "$MSGFMT" != "no"; then
313                AC_CHECK_FUNCS(dcgettext)
314                AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
315                AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
316                  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
317                AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
318                               return _nl_msg_cat_cntr],
319                  [CATOBJEXT=.gmo
320                   DATADIRNAME=share],
321                  [CATOBJEXT=.mo
322                   DATADIRNAME=lib])
323                INSTOBJEXT=.mo
324              fi
325            fi
326        ])
327
328        if test "$CATOBJEXT" = "NONE"; then
329          AC_MSG_CHECKING([whether catgets can be used])
330          AC_ARG_WITH(catgets,
331            [  --with-catgets          use catgets functions if available],
332            nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
333          AC_MSG_RESULT($nls_cv_use_catgets)
334
335          if test "$nls_cv_use_catgets" = "yes"; then
336            dnl No gettext in C library.  Try catgets next.
337            AC_CHECK_LIB(i, main)
338            AC_CHECK_FUNC(catgets,
339              [AC_DEFINE(HAVE_CATGETS)
340               INTLOBJS="\$(CATOBJS)"
341               AC_PATH_PROG(GENCAT, gencat, no)dnl
342               if test "$GENCAT" != "no"; then
343                 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
344                 if test "$GMSGFMT" = "no"; then
345                   AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
346                    [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
347                 fi
348                 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
349                   [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
350                 USE_INCLUDED_LIBINTL=yes
351                 CATOBJEXT=.cat
352                 INSTOBJEXT=.cat
353                 DATADIRNAME=lib
354                 INTLDEPS="../intl/libintl.a"
355                 INTLLIBS=$INTLDEPS
356                 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
357                 nls_cv_header_intl=intl/libintl.h
358                 nls_cv_header_libgt=intl/libgettext.h
359               fi])
360          fi
361        fi
362
363        if test "$CATOBJEXT" = "NONE"; then
364          dnl Neither gettext nor catgets in included in the C library.
365          dnl Fall back on GNU gettext library.
366          nls_cv_use_gnu_gettext=yes
367        fi
368      fi
369
370      if test "$nls_cv_use_gnu_gettext" = "yes"; then
371        dnl Mark actions used to generate GNU NLS library.
372        INTLOBJS="\$(GETTOBJS)"
373        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
374          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
375        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
376        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
377          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
378        AC_SUBST(MSGFMT)
379        USE_INCLUDED_LIBINTL=yes
380        CATOBJEXT=.gmo
381        INSTOBJEXT=.mo
382        DATADIRNAME=share
383        INTLDEPS="../intl/libintl.a"
384        INTLLIBS=$INTLDEPS
385        LIBS=`echo $LIBS | sed -e 's/-lintl//'`
386        nls_cv_header_intl=intl/libintl.h
387        nls_cv_header_libgt=intl/libgettext.h
388      fi
389
390      dnl Test whether we really found GNU xgettext.
391      if test "$XGETTEXT" != ":"; then
392        dnl If it is no GNU xgettext we define it as : so that the
393        dnl Makefiles still can work.
394        if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
395          : ;
396        else
397          AC_MSG_RESULT(
398            [found xgettext programs is not GNU xgettext; ignore it])
399          XGETTEXT=":"
400        fi
401      fi
402
403      # We need to process the po/ directory.
404      POSUB=po
405    else
406      DATADIRNAME=share
407      nls_cv_header_intl=intl/libintl.h
408      nls_cv_header_libgt=intl/libgettext.h
409    fi
410
411    # If this is used in GNU gettext we have to set USE_NLS to `yes'
412    # because some of the sources are only built for this goal.
413    if test "$PACKAGE" = gettext; then
414      USE_NLS=yes
415      USE_INCLUDED_LIBINTL=yes
416    fi
417
418    dnl These rules are solely for the distribution goal.  While doing this
419    dnl we only have to keep exactly one list of the available catalogs
420    dnl in configure.in.
421    for lang in $ALL_LINGUAS; do
422      GMOFILES="$GMOFILES $lang.gmo"
423      POFILES="$POFILES $lang.po"
424    done
425
426    dnl Make all variables we use known to autoconf.
427    AC_SUBST(USE_INCLUDED_LIBINTL)
428    AC_SUBST(CATALOGS)
429    AC_SUBST(CATOBJEXT)
430    AC_SUBST(DATADIRNAME)
431    AC_SUBST(GMOFILES)
432    AC_SUBST(INSTOBJEXT)
433    AC_SUBST(INTLDEPS)
434    AC_SUBST(INTLLIBS)
435    AC_SUBST(INTLOBJS)
436    AC_SUBST(POFILES)
437    AC_SUBST(POSUB)
438  ])
439
440AC_DEFUN(AM_GNU_GETTEXT,
441  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
442   AC_REQUIRE([AC_PROG_CC])dnl
443   AC_REQUIRE([AC_ISC_POSIX])dnl
444   AC_REQUIRE([AC_HEADER_STDC])dnl
445   AC_REQUIRE([AC_C_CONST])dnl
446   AC_REQUIRE([AC_C_INLINE])dnl
447   AC_REQUIRE([AC_TYPE_OFF_T])dnl
448   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
449   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
450   AC_REQUIRE([AC_FUNC_MMAP])dnl
451
452   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
453unistd.h values.h])
454   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
455__argz_count __argz_stringify __argz_next])
456
457   if test "${ac_cv_func_stpcpy+set}" != "set"; then
458     AC_CHECK_FUNCS(stpcpy)
459   fi
460   if test "${ac_cv_func_stpcpy}" = "yes"; then
461     AC_DEFINE(HAVE_STPCPY)
462   fi
463
464   AM_LC_MESSAGES
465   AM_WITH_NLS
466
467   if test "x$CATOBJEXT" != "x"; then
468     if test "x$ALL_LINGUAS" = "x"; then
469       LINGUAS=
470     else
471       AC_MSG_CHECKING(for catalogs to be installed)
472       NEW_LINGUAS=
473       for lang in ${LINGUAS=$ALL_LINGUAS}; do
474         case "$ALL_LINGUAS" in
475          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
476         esac
477       done
478       LINGUAS=$NEW_LINGUAS
479       AC_MSG_RESULT($LINGUAS)
480     fi
481
482     dnl Construct list of names of catalog files to be constructed.
483     if test -n "$LINGUAS"; then
484       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
485     fi
486   fi
487
488   dnl Determine which catalog format we have (if any is needed)
489   dnl For now we know about two different formats:
490   dnl   Linux libc-5 and the normal X/Open format
491   test -d intl || mkdir intl
492   if test "$CATOBJEXT" = ".cat"; then
493     AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
494
495     dnl Transform the SED scripts while copying because some dumb SEDs
496     dnl cannot handle comments.
497     sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
498   fi
499   dnl po2tbl.sed is always needed.
500   sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
501     $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
502
503   dnl In the intl/Makefile.in we have a special dependency which makes
504   dnl only sense for gettext.  We comment this out for non-gettext
505   dnl packages.
506   if test "$PACKAGE" = "gettext"; then
507     GT_NO="#NO#"
508     GT_YES=
509   else
510     GT_NO=
511     GT_YES="#YES#"
512   fi
513   AC_SUBST(GT_NO)
514   AC_SUBST(GT_YES)
515
516   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
517   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
518   dnl Try to locate is.
519   MKINSTALLDIRS=
520   if test $ac_aux_dir; then
521     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
522   fi
523   if test -z $MKINSTALLDIRS; then
524     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
525   fi
526   AC_SUBST(MKINSTALLDIRS)
527
528   dnl *** For now the libtool support in intl/Makefile is not for real.
529   l=
530   AC_SUBST(l)
531
532   dnl Generate list of files to be processed by xgettext which will
533   dnl be included in po/Makefile.
534   test -d po || mkdir po
535   if test "x$srcdir" != "x."; then
536     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
537       posrcprefix="$srcdir/"
538     else
539       posrcprefix="../$srcdir/"
540     fi
541   else
542     posrcprefix="../"
543   fi
544   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
545        < $srcdir/po/POTFILES.in > po/POTFILES
546  ])
547
548# Search path for a program which passes the given test.
549# Ulrich Drepper <drepper@cygnus.com>, 1996.
550
551# serial 1
552
553dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
554dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
555AC_DEFUN(AM_PATH_PROG_WITH_TEST,
556[# Extract the first word of "$2", so it can be a program name with args.
557set dummy $2; ac_word=[$]2
558AC_MSG_CHECKING([for $ac_word])
559AC_CACHE_VAL(ac_cv_path_$1,
560[case "[$]$1" in
561  /*)
562  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
563  ;;
564  *)
565  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
566  for ac_dir in ifelse([$5], , $PATH, [$5]); do
567    test -z "$ac_dir" && ac_dir=.
568    if test -f $ac_dir/$ac_word; then
569      if [$3]; then
570        ac_cv_path_$1="$ac_dir/$ac_word"
571        break
572      fi
573    fi
574  done
575  IFS="$ac_save_ifs"
576dnl If no 4th arg is given, leave the cache variable unset,
577dnl so AC_PATH_PROGS will keep looking.
578ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
579])dnl
580  ;;
581esac])dnl
582$1="$ac_cv_path_$1"
583if test -n "[$]$1"; then
584  AC_MSG_RESULT([$]$1)
585else
586  AC_MSG_RESULT(no)
587fi
588AC_SUBST($1)dnl
589])
590
591# Check whether LC_MESSAGES is available in <locale.h>.
592# Ulrich Drepper <drepper@cygnus.com>, 1995.
593
594# serial 1
595
596AC_DEFUN(AM_LC_MESSAGES,
597  [if test $ac_cv_header_locale_h = yes; then
598    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
599      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
600       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
601    if test $am_cv_val_LC_MESSAGES = yes; then
602      AC_DEFINE(HAVE_LC_MESSAGES)
603    fi
604  fi])
605
Note: See TracBrowser for help on using the repository browser.