Increase minor version number (to 2.10.91) to help tools detect the new
[platform/upstream/binutils.git] / bfd / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
14 AC_DEFUN(BFD_BINARY_FOPEN,
15 [AC_REQUIRE([AC_CANONICAL_SYSTEM])
16 case "${host}" in
17 changequote(,)dnl
18 *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
19 changequote([,])dnl
20   AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
21 esac])dnl
22
23 dnl Get a default for CC_FOR_BUILD to put into Makefile.
24 AC_DEFUN(BFD_CC_FOR_BUILD,
25 [# Put a plausible default for CC_FOR_BUILD in Makefile.
26 if test -z "$CC_FOR_BUILD"; then
27   if test "x$cross_compiling" = "xno"; then
28     CC_FOR_BUILD='$(CC)'
29   else
30     CC_FOR_BUILD=gcc
31   fi
32 fi
33 AC_SUBST(CC_FOR_BUILD)
34 # Also set EXEEXT_FOR_BUILD.
35 if test "x$cross_compiling" = "xno"; then
36   EXEEXT_FOR_BUILD='$(EXEEXT)'
37 else
38   AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
39     [rm -f conftest*
40      echo 'int main () { return 0; }' > conftest.c
41      bfd_cv_build_exeext=
42      ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
43      for file in conftest.*; do
44        case $file in
45        *.c | *.o | *.obj | *.ilk | *.pdb) ;;
46        *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
47        esac
48      done
49      rm -f conftest*
50      test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
51   EXEEXT_FOR_BUILD=""
52   test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
53 fi
54 AC_SUBST(EXEEXT_FOR_BUILD)])dnl
55
56 dnl See whether we need a declaration for a function.
57 AC_DEFUN(BFD_NEED_DECLARATION,
58 [AC_MSG_CHECKING([whether $1 must be declared])
59 AC_CACHE_VAL(bfd_cv_decl_needed_$1,
60 [AC_TRY_COMPILE([
61 #include <stdio.h>
62 #ifdef HAVE_STRING_H
63 #include <string.h>
64 #else
65 #ifdef HAVE_STRINGS_H
66 #include <strings.h>
67 #endif
68 #endif
69 #ifdef HAVE_STDLIB_H
70 #include <stdlib.h>
71 #endif
72 #ifdef HAVE_UNISTD_H
73 #include <unistd.h>
74 #endif],
75 [char *(*pfn) = (char *(*)) $1],
76 bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
77 AC_MSG_RESULT($bfd_cv_decl_needed_$1)
78 if test $bfd_cv_decl_needed_$1 = yes; then
79   AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
80             [Define if $1 is not declared in system header files.])
81 fi
82 ])dnl
83
84 dnl Check for existence of a type $1 in sys/procfs.h
85
86 AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE,
87 [AC_MSG_CHECKING([for $1 in sys/procfs.h])
88  AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
89    [AC_TRY_COMPILE([
90 #define _SYSCALL32
91 #include <sys/procfs.h>],
92       [$1 avar],
93       bfd_cv_have_sys_procfs_type_$1=yes,
94       bfd_cv_have_sys_procfs_type_$1=no
95    )])
96  if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
97    AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
98              [Define if <sys/procfs.h> has $1.])
99  fi
100  AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
101 ])
102
103
104 dnl Check for existence of member $2 in type $1 in sys/procfs.h
105
106 AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER,
107 [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
108  AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
109    [AC_TRY_COMPILE([
110 #define _SYSCALL32
111 #include <sys/procfs.h>],
112       [$1 avar; void* aref = (void*) &avar.$2],
113       bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
114       bfd_cv_have_sys_procfs_type_member_$1_$2=no
115    )])
116  if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
117    AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
118              [Define if <sys/procfs.h> has $1.$2.])
119  fi
120  AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
121 ])
122
123 sinclude(../libtool.m4)
124 dnl The lines below arrange for aclocal not to bring libtool.m4
125 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
126 dnl to add a definition of LIBTOOL to Makefile.in.
127 ifelse(yes,no,[
128 AC_DEFUN([AM_PROG_LIBTOOL],)
129 AC_DEFUN([AM_DISABLE_SHARED],)
130 AC_SUBST(LIBTOOL)
131 ])
132
133 sinclude(../gettext.m4)
134 ifelse(yes,no,[
135 AC_DEFUN([CY_WITH_NLS],)
136 AC_SUBST(INTLLIBS)
137 ])
138
139 # Do all the work for Automake.  This macro actually does too much --
140 # some checks are only needed if your package does certain things.
141 # But this isn't really a big deal.
142
143 # serial 1
144
145 dnl Usage:
146 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
147
148 AC_DEFUN(AM_INIT_AUTOMAKE,
149 [AC_REQUIRE([AC_PROG_INSTALL])
150 PACKAGE=[$1]
151 AC_SUBST(PACKAGE)
152 VERSION=[$2]
153 AC_SUBST(VERSION)
154 dnl test to see if srcdir already configured
155 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
156   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
157 fi
158 ifelse([$3],,
159 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
160 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
161 AC_REQUIRE([AM_SANITY_CHECK])
162 AC_REQUIRE([AC_ARG_PROGRAM])
163 dnl FIXME This is truly gross.
164 missing_dir=`cd $ac_aux_dir && pwd`
165 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
166 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
167 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
168 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
169 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
170 AC_REQUIRE([AC_PROG_MAKE_SET])])
171
172 #
173 # Check to make sure that the build environment is sane.
174 #
175
176 AC_DEFUN(AM_SANITY_CHECK,
177 [AC_MSG_CHECKING([whether build environment is sane])
178 # Just in case
179 sleep 1
180 echo timestamp > conftestfile
181 # Do `set' in a subshell so we don't clobber the current shell's
182 # arguments.  Must try -L first in case configure is actually a
183 # symlink; some systems play weird games with the mod time of symlinks
184 # (eg FreeBSD returns the mod time of the symlink's containing
185 # directory).
186 if (
187    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
188    if test "[$]*" = "X"; then
189       # -L didn't work.
190       set X `ls -t $srcdir/configure conftestfile`
191    fi
192    if test "[$]*" != "X $srcdir/configure conftestfile" \
193       && test "[$]*" != "X conftestfile $srcdir/configure"; then
194
195       # If neither matched, then we have a broken ls.  This can happen
196       # if, for instance, CONFIG_SHELL is bash and it inherits a
197       # broken ls alias from the environment.  This has actually
198       # happened.  Such a system could not be considered "sane".
199       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
200 alias in your environment])
201    fi
202
203    test "[$]2" = conftestfile
204    )
205 then
206    # Ok.
207    :
208 else
209    AC_MSG_ERROR([newly created file is older than distributed files!
210 Check your system clock])
211 fi
212 rm -f conftest*
213 AC_MSG_RESULT(yes)])
214
215 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
216 dnl The program must properly implement --version.
217 AC_DEFUN(AM_MISSING_PROG,
218 [AC_MSG_CHECKING(for working $2)
219 # Run test in a subshell; some versions of sh will print an error if
220 # an executable is not found, even if stderr is redirected.
221 # Redirect stdin to placate older versions of autoconf.  Sigh.
222 if ($2 --version) < /dev/null > /dev/null 2>&1; then
223    $1=$2
224    AC_MSG_RESULT(found)
225 else
226    $1="$3/missing $2"
227    AC_MSG_RESULT(missing)
228 fi
229 AC_SUBST($1)])
230
231 # Like AC_CONFIG_HEADER, but automatically create stamp file.
232
233 AC_DEFUN(AM_CONFIG_HEADER,
234 [AC_PREREQ([2.12])
235 AC_CONFIG_HEADER([$1])
236 dnl When config.status generates a header, we must update the stamp-h file.
237 dnl This file resides in the same directory as the config header
238 dnl that is generated.  We must strip everything past the first ":",
239 dnl and everything past the last "/".
240 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
241 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
242 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
243 <<am_indx=1
244 for am_file in <<$1>>; do
245   case " <<$>>CONFIG_HEADERS " in
246   *" <<$>>am_file "*<<)>>
247     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
248     ;;
249   esac
250   am_indx=`expr "<<$>>am_indx" + 1`
251 done<<>>dnl>>)
252 changequote([,]))])
253
254 # Add --enable-maintainer-mode option to configure.
255 # From Jim Meyering
256
257 # serial 1
258
259 AC_DEFUN(AM_MAINTAINER_MODE,
260 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
261   dnl maintainer-mode is disabled by default
262   AC_ARG_ENABLE(maintainer-mode,
263 [  --enable-maintainer-mode enable make rules and dependencies not useful
264                           (and sometimes confusing) to the casual installer],
265       USE_MAINTAINER_MODE=$enableval,
266       USE_MAINTAINER_MODE=no)
267   AC_MSG_RESULT($USE_MAINTAINER_MODE)
268   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
269   MAINT=$MAINTAINER_MODE_TRUE
270   AC_SUBST(MAINT)dnl
271 ]
272 )
273
274 # Define a conditional.
275
276 AC_DEFUN(AM_CONDITIONAL,
277 [AC_SUBST($1_TRUE)
278 AC_SUBST($1_FALSE)
279 if $2; then
280   $1_TRUE=
281   $1_FALSE='#'
282 else
283   $1_TRUE='#'
284   $1_FALSE=
285 fi])
286
287 # This file is derived from `gettext.m4'.  The difference is that the
288 # included macros assume Cygnus-style source and build trees.
289
290 # Macro to add for using GNU gettext.
291 # Ulrich Drepper <drepper@cygnus.com>, 1995.
292 #
293 # This file file be copied and used freely without restrictions.  It can
294 # be used in projects which are not available under the GNU Public License
295 # but which still want to provide support for the GNU gettext functionality.
296 # Please note that the actual code is *not* freely available.
297
298 # serial 3
299
300 AC_DEFUN(CY_WITH_NLS,
301   [AC_MSG_CHECKING([whether NLS is requested])
302     dnl Default is enabled NLS
303     AC_ARG_ENABLE(nls,
304       [  --disable-nls           do not use Native Language Support],
305       USE_NLS=$enableval, USE_NLS=yes)
306     AC_MSG_RESULT($USE_NLS)
307     AC_SUBST(USE_NLS)
308
309     USE_INCLUDED_LIBINTL=no
310
311     dnl If we use NLS figure out what method
312     if test "$USE_NLS" = "yes"; then
313       AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
314       AC_MSG_CHECKING([whether included gettext is requested])
315       AC_ARG_WITH(included-gettext,
316         [  --with-included-gettext use the GNU gettext library included here],
317         nls_cv_force_use_gnu_gettext=$withval,
318         nls_cv_force_use_gnu_gettext=no)
319       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
320
321       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
322       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
323         dnl User does not insist on using GNU NLS library.  Figure out what
324         dnl to use.  If gettext or catgets are available (in this order) we
325         dnl use this.  Else we have to fall back to GNU NLS library.
326         dnl catgets is only used if permitted by option --with-catgets.
327         nls_cv_header_intl=
328         nls_cv_header_libgt=
329         CATOBJEXT=NONE
330
331         AC_CHECK_HEADER(libintl.h,
332           [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
333             [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
334                gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
335
336            if test "$gt_cv_func_gettext_libc" != "yes"; then
337              AC_CHECK_LIB(intl, bindtextdomain,
338                [AC_CACHE_CHECK([for gettext in libintl],
339                  gt_cv_func_gettext_libintl,
340                  [AC_TRY_LINK([], [return (int) gettext ("")],
341                  gt_cv_func_gettext_libintl=yes,
342                  gt_cv_func_gettext_libintl=no)])])
343            fi
344
345            if test "$gt_cv_func_gettext_libc" = "yes" \
346               || test "$gt_cv_func_gettext_libintl" = "yes"; then
347               AC_DEFINE(HAVE_GETTEXT, 1,
348                         [Define as 1 if you have gettext and don't want to use GNU gettext.])
349               AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
350                 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
351               if test "$MSGFMT" != "no"; then
352                 AC_CHECK_FUNCS(dcgettext)
353                 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
354                 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
355                   [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
356                 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
357                                return _nl_msg_cat_cntr],
358                   [CATOBJEXT=.gmo
359                    DATADIRNAME=share],
360                   [CATOBJEXT=.mo
361                    DATADIRNAME=lib])
362                 INSTOBJEXT=.mo
363               fi
364             fi
365         ])
366
367         dnl In the standard gettext, we would now check for catgets.
368         dnl However, we never want to use catgets for our releases.
369
370         if test "$CATOBJEXT" = "NONE"; then
371           dnl Neither gettext nor catgets in included in the C library.
372           dnl Fall back on GNU gettext library.
373           nls_cv_use_gnu_gettext=yes
374         fi
375       fi
376
377       if test "$nls_cv_use_gnu_gettext" = "yes"; then
378         dnl Mark actions used to generate GNU NLS library.
379         INTLOBJS="\$(GETTOBJS)"
380         AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
381           [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
382         AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
383         AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
384           [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
385         AC_SUBST(MSGFMT)
386         USE_INCLUDED_LIBINTL=yes
387         CATOBJEXT=.gmo
388         INSTOBJEXT=.mo
389         DATADIRNAME=share
390         INTLDEPS='$(top_builddir)/../intl/libintl.a'
391         INTLLIBS=$INTLDEPS
392         LIBS=`echo $LIBS | sed -e 's/-lintl//'`
393         nls_cv_header_intl=libintl.h
394         nls_cv_header_libgt=libgettext.h
395       fi
396
397       dnl Test whether we really found GNU xgettext.
398       if test "$XGETTEXT" != ":"; then
399         dnl If it is no GNU xgettext we define it as : so that the
400         dnl Makefiles still can work.
401         if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
402           : ;
403         else
404           AC_MSG_RESULT(
405             [found xgettext programs is not GNU xgettext; ignore it])
406           XGETTEXT=":"
407         fi
408       fi
409
410       # We need to process the po/ directory.
411       POSUB=po
412     else
413       DATADIRNAME=share
414       nls_cv_header_intl=libintl.h
415       nls_cv_header_libgt=libgettext.h
416     fi
417
418     # If this is used in GNU gettext we have to set USE_NLS to `yes'
419     # because some of the sources are only built for this goal.
420     if test "$PACKAGE" = gettext; then
421       USE_NLS=yes
422       USE_INCLUDED_LIBINTL=yes
423     fi
424
425     dnl These rules are solely for the distribution goal.  While doing this
426     dnl we only have to keep exactly one list of the available catalogs
427     dnl in configure.in.
428     for lang in $ALL_LINGUAS; do
429       GMOFILES="$GMOFILES $lang.gmo"
430       POFILES="$POFILES $lang.po"
431     done
432
433     dnl Make all variables we use known to autoconf.
434     AC_SUBST(USE_INCLUDED_LIBINTL)
435     AC_SUBST(CATALOGS)
436     AC_SUBST(CATOBJEXT)
437     AC_SUBST(DATADIRNAME)
438     AC_SUBST(GMOFILES)
439     AC_SUBST(INSTOBJEXT)
440     AC_SUBST(INTLDEPS)
441     AC_SUBST(INTLLIBS)
442     AC_SUBST(INTLOBJS)
443     AC_SUBST(POFILES)
444     AC_SUBST(POSUB)
445   ])
446
447 AC_DEFUN(CY_GNU_GETTEXT,
448   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
449    AC_REQUIRE([AC_PROG_CC])dnl
450    AC_REQUIRE([AC_PROG_RANLIB])dnl
451    AC_REQUIRE([AC_ISC_POSIX])dnl
452    AC_REQUIRE([AC_HEADER_STDC])dnl
453    AC_REQUIRE([AC_C_CONST])dnl
454    AC_REQUIRE([AC_C_INLINE])dnl
455    AC_REQUIRE([AC_TYPE_OFF_T])dnl
456    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
457    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
458    AC_REQUIRE([AC_FUNC_MMAP])dnl
459
460    AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
461 unistd.h values.h sys/param.h])
462    AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
463 __argz_count __argz_stringify __argz_next])
464
465    if test "${ac_cv_func_stpcpy+set}" != "set"; then
466      AC_CHECK_FUNCS(stpcpy)
467    fi
468    if test "${ac_cv_func_stpcpy}" = "yes"; then
469      AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
470    fi
471
472    AM_LC_MESSAGES
473    CY_WITH_NLS
474
475    if test "x$CATOBJEXT" != "x"; then
476      if test "x$ALL_LINGUAS" = "x"; then
477        LINGUAS=
478      else
479        AC_MSG_CHECKING(for catalogs to be installed)
480        NEW_LINGUAS=
481        for lang in ${LINGUAS=$ALL_LINGUAS}; do
482          case "$ALL_LINGUAS" in
483           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
484          esac
485        done
486        LINGUAS=$NEW_LINGUAS
487        AC_MSG_RESULT($LINGUAS)
488      fi
489
490      dnl Construct list of names of catalog files to be constructed.
491      if test -n "$LINGUAS"; then
492        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
493      fi
494    fi
495
496    dnl The reference to <locale.h> in the installed <libintl.h> file
497    dnl must be resolved because we cannot expect the users of this
498    dnl to define HAVE_LOCALE_H.
499    if test $ac_cv_header_locale_h = yes; then
500      INCLUDE_LOCALE_H="#include <locale.h>"
501    else
502      INCLUDE_LOCALE_H="\
503 /* The system does not provide the header <locale.h>.  Take care yourself.  */"
504    fi
505    AC_SUBST(INCLUDE_LOCALE_H)
506
507    dnl Determine which catalog format we have (if any is needed)
508    dnl For now we know about two different formats:
509    dnl   Linux libc-5 and the normal X/Open format
510    if test -f $srcdir/po2tbl.sed.in; then
511       if test "$CATOBJEXT" = ".cat"; then
512          AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
513
514          dnl Transform the SED scripts while copying because some dumb SEDs
515          dnl cannot handle comments.
516          sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
517       fi
518       dnl po2tbl.sed is always needed.
519       sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
520          $srcdir/po2tbl.sed.in > po2tbl.sed
521    fi
522
523    dnl In the intl/Makefile.in we have a special dependency which makes
524    dnl only sense for gettext.  We comment this out for non-gettext
525    dnl packages.
526    if test "$PACKAGE" = "gettext"; then
527      GT_NO="#NO#"
528      GT_YES=
529    else
530      GT_NO=
531      GT_YES="#YES#"
532    fi
533    AC_SUBST(GT_NO)
534    AC_SUBST(GT_YES)
535
536    MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
537    AC_SUBST(MKINSTALLDIRS)
538
539    dnl *** For now the libtool support in intl/Makefile is not for real.
540    l=
541    AC_SUBST(l)
542
543    dnl Generate list of files to be processed by xgettext which will
544    dnl be included in po/Makefile.  But only do this if the po directory
545    dnl exists in srcdir.
546    if test -d $srcdir/po; then
547       test -d po || mkdir po
548       if test "x$srcdir" != "x."; then
549          if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
550             posrcprefix="$srcdir/"
551          else
552             posrcprefix="../$srcdir/"
553          fi
554       else
555          posrcprefix="../"
556       fi
557       rm -f po/POTFILES
558       sed -e "/^#/d" -e "/^\$/d" -e "s,.*,      $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
559          < $srcdir/po/POTFILES.in > po/POTFILES
560    fi
561   ])
562
563 # Search path for a program which passes the given test.
564 # Ulrich Drepper <drepper@cygnus.com>, 1996.
565 #
566 # This file file be copied and used freely without restrictions.  It can
567 # be used in projects which are not available under the GNU Public License
568 # but which still want to provide support for the GNU gettext functionality.
569 # Please note that the actual code is *not* freely available.
570
571 # serial 1
572
573 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
574 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
575 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
576 [# Extract the first word of "$2", so it can be a program name with args.
577 set dummy $2; ac_word=[$]2
578 AC_MSG_CHECKING([for $ac_word])
579 AC_CACHE_VAL(ac_cv_path_$1,
580 [case "[$]$1" in
581   /*)
582   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
583   ;;
584   *)
585   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
586   for ac_dir in ifelse([$5], , $PATH, [$5]); do
587     test -z "$ac_dir" && ac_dir=.
588     if test -f $ac_dir/$ac_word; then
589       if [$3]; then
590         ac_cv_path_$1="$ac_dir/$ac_word"
591         break
592       fi
593     fi
594   done
595   IFS="$ac_save_ifs"
596 dnl If no 4th arg is given, leave the cache variable unset,
597 dnl so AC_PATH_PROGS will keep looking.
598 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
599 ])dnl
600   ;;
601 esac])dnl
602 $1="$ac_cv_path_$1"
603 if test -n "[$]$1"; then
604   AC_MSG_RESULT([$]$1)
605 else
606   AC_MSG_RESULT(no)
607 fi
608 AC_SUBST($1)dnl
609 ])
610
611 # Check whether LC_MESSAGES is available in <locale.h>.
612 # Ulrich Drepper <drepper@cygnus.com>, 1995.
613 #
614 # This file file be copied and used freely without restrictions.  It can
615 # be used in projects which are not available under the GNU Public License
616 # but which still want to provide support for the GNU gettext functionality.
617 # Please note that the actual code is *not* freely available.
618
619 # serial 1
620
621 AC_DEFUN(AM_LC_MESSAGES,
622   [if test $ac_cv_header_locale_h = yes; then
623     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
624       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
625        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
626     if test $am_cv_val_LC_MESSAGES = yes; then
627       AC_DEFINE(HAVE_LC_MESSAGES, 1,
628                 [Define if your locale.h file contains LC_MESSAGES.])
629     fi
630   fi])
631