* New config.sub and config.guess
[make.git] / acinclude.m4
blob2ce31b7519d2a1e82b02bc1206dc8aedaa7c73a4
1 dnl acinclude.m4 -- Extra macros needed for GNU make.
2 dnl
3 dnl Automake will incorporate this into its generated aclocal.m4.
5 dnl ---------------------------------------------------------------------------
6 dnl Got this from the lynx 2.8 distribution.
7 dnl by T.E.Dickey <dickey@clark.net>
8 dnl and Jim Spath <jspath@mail.bcpl.lib.md.us>
9 dnl and Philippe De Muyter <phdm@macqel.be>
10 dnl
11 dnl Created: 1997/1/28
12 dnl Updated: 1997/12/23
13 dnl ---------------------------------------------------------------------------
14 dnl After checking for functions in the default $LIBS, make a further check
15 dnl for the functions that are netlib-related (these aren't always in the
16 dnl libc, etc., and have to be handled specially because there are conflicting
17 dnl and broken implementations.
18 dnl Common library requirements (in order):
19 dnl     -lresolv -lsocket -lnsl
20 dnl     -lnsl -lsocket
21 dnl     -lsocket
22 dnl     -lbsd
23 AC_DEFUN([CF_NETLIBS],[
24 cf_test_netlibs=no
25 AC_MSG_CHECKING(for network libraries)
26 AC_CACHE_VAL(cf_cv_netlibs,[
27 AC_MSG_RESULT(working...)
28 cf_cv_netlibs=""
29 cf_test_netlibs=yes
30 AC_CHECK_FUNCS(gethostname,,[
31         CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[
32                 CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])])
34 # FIXME:  sequent needs this library (i.e., -lsocket -linet -lnsl), but
35 # I don't know the entrypoints - 97/7/22 TD
36 AC_CHECK_LIB(inet,main,cf_cv_netlibs="-linet $cf_cv_netlibs")
38 if test "$ac_cv_func_lsocket" != no ; then
39 AC_CHECK_FUNCS(socket,,[
40         CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[
41                 CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])])
44 AC_CHECK_FUNCS(gethostbyname,,[
45         CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
47 AC_CHECK_FUNCS(strcasecmp,,[
48         CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)])
50 LIBS="$LIBS $cf_cv_netlibs"
51 test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG
52 ])dnl
53 dnl ---------------------------------------------------------------------------
54 dnl Re-check on a function to see if we can pick it up by adding a library.
55 dnl     $1 = function to check
56 dnl     $2 = library to check in
57 dnl     $3 = environment to update (e.g., $LIBS)
58 dnl     $4 = what to do if this fails
59 dnl
60 dnl This uses 'unset' if the shell happens to support it, but leaves the
61 dnl configuration variable set to 'unknown' if not.  This is a little better
62 dnl than the normal autoconf test, which gives misleading results if a test
63 dnl for the function is made (e.g., with AC_CHECK_FUNC) after this macro is
64 dnl used (autoconf does not distinguish between a null token and one that is
65 dnl set to 'no').
66 AC_DEFUN([CF_RECHECK_FUNC],[
67 AC_CHECK_LIB($2,$1,[
68         CF_UPPER(cf_tr_func,$1)
69         AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func)
70         ac_cv_func_$1=yes
71         $3="-l$2 [$]$3"],[
72         ac_cv_func_$1=unknown
73         unset ac_cv_func_$1 2>/dev/null
74         $4],
75         [[$]$3])
76 ])dnl
77 dnl ---------------------------------------------------------------------------
78 dnl Make an uppercase version of a variable
79 dnl $1=uppercase($2)
80 AC_DEFUN([CF_UPPER],
82 changequote(,)dnl
83 $1=`echo $2 | tr '[a-z]' '[A-Z]'`
84 changequote([,])dnl
85 ])dnl
87 dnl ---------------------------------------------------------------------------
88 dnl Got this from the GNU tar 1.13.11 distribution
89 dnl by Paul Eggert <eggert@twinsun.com>
90 dnl ---------------------------------------------------------------------------
92 dnl By default, many hosts won't let programs access large files;
93 dnl one must use special compiler options to get large-file access to work.
94 dnl For more details about this brain damage please see:
95 dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
97 dnl Written by Paul Eggert <eggert@twinsun.com>.
99 dnl Internal subroutine of AC_SYS_LARGEFILE.
100 dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
101 AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
102   [AC_CACHE_CHECK([for $1 value to request large file support],
103      ac_cv_sys_largefile_$1,
104      [if ($GETCONF LFS_$1) >conftest.1 2>conftest.2 && test ! -s conftest.2
105       then
106         ac_cv_sys_largefile_$1=`cat conftest.1`
107       else
108         ac_cv_sys_largefile_$1=no
109         ifelse($1, CFLAGS,
110           [case "$host_os" in
111            # HP-UX 10.20 requires -D__STDC_EXT__ with gcc 2.95.1.
112 changequote(, )dnl
113            hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
114 changequote([, ])dnl
115              if test "$GCC" = yes; then
116                ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__
117              fi
118              ;;
119            # IRIX 6.2 and later require cc -n32.
120 changequote(, )dnl
121            irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
122 changequote([, ])dnl
123              if test "$GCC" != yes; then
124                ac_cv_sys_largefile_CFLAGS=-n32
125              fi
126            esac
127            if test "$ac_cv_sys_largefile_CFLAGS" != no; then
128              ac_save_CC="$CC"
129              CC="$CC $ac_cv_sys_largefile_CFLAGS"
130              AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no)
131              CC="$ac_save_CC"
132            fi])
133       fi
134       rm -f conftest*])])
136 dnl Internal subroutine of AC_SYS_LARGEFILE.
137 dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
138 AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND,
139   [case $2 in
140    no) ;;
141    ?*)
142      case "[$]$1" in
143      '') $1=$2 ;;
144      *) $1=[$]$1' '$2 ;;
145      esac ;;
146    esac])
148 dnl Internal subroutine of AC_SYS_LARGEFILE.
149 dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
150 AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
151   [AC_CACHE_CHECK([for $1], $2,
152      [$2=no
153 changequote(, )dnl
154       $4
155       for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
156         case "$ac_flag" in
157         -D$1)
158           $2=1 ;;
159         -D$1=*)
160           $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
161         esac
162       done
163 changequote([, ])dnl
164       ])
165    if test "[$]$2" != no; then
166      AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
167    fi])
169 AC_DEFUN(AC_SYS_LARGEFILE,
170   [AC_REQUIRE([AC_CANONICAL_HOST])
171    AC_ARG_ENABLE(largefile,
172      [  --disable-largefile     omit support for large files])
173    if test "$enable_largefile" != no; then
174      AC_CHECK_TOOL(GETCONF, getconf)
175      AC_SYS_LARGEFILE_FLAGS(CFLAGS)
176      AC_SYS_LARGEFILE_FLAGS(LDFLAGS)
177      AC_SYS_LARGEFILE_FLAGS(LIBS)
179      for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
180        case "$ac_flag" in
181        no) ;;
182        -D_FILE_OFFSET_BITS=*) ;;
183        -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
184        -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
185        -D?* | -I?*)
186          AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;;
187        *)
188          AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;;
189        esac
190      done
191      AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS")
192      AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS")
193      AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS,
194        ac_cv_sys_file_offset_bits,
195        [Number of bits in a file offset, on hosts where this is settable.],
196        [case "$host_os" in
197         # HP-UX 10.20 and later
198         hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
199           ac_cv_sys_file_offset_bits=64 ;;
200         esac])
201      AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
202        ac_cv_sys_largefile_source,
203        [Define to make fseeko etc. visible, on some hosts.],
204        [case "$host_os" in
205         # HP-UX 10.20 and later
206         hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
207           ac_cv_sys_largefile_source=1 ;;
208         esac])
209      AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
210        ac_cv_sys_large_files,
211        [Define for large files, on AIX-style hosts.],
212        [case "$host_os" in
213         # AIX 4.2 and later
214         aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
215           ac_cv_sys_large_files=1 ;;
216         esac])
217    fi
218   ])
221 dnl ---------------------------------------------------------------------------
222 dnl From Paul Eggert <eggert@twinsun.com>
224 dnl Define HAVE_INTTYPES_H if <inttypes.h> exists,
225 dnl doesn't clash with <sys/types.h>, and declares uintmax_t.
227 AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
229   if test x = y; then
230     dnl This code is deliberately never run via ./configure.
231     dnl FIXME: this is a gross hack to make autoheader put an entry
232     dnl for `HAVE_INTTYPES_H' in config.h.in.
233     AC_CHECK_FUNCS(INTTYPES_H)
234   fi
235   AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
236   [AC_TRY_COMPILE(
237     [#include <sys/types.h>
238 #include <inttypes.h>],
239     [uintmax_t i = (uintmax_t) -1;],
240     jm_ac_cv_header_inttypes_h=yes,
241     jm_ac_cv_header_inttypes_h=no)])
242   if test $jm_ac_cv_header_inttypes_h = yes; then
243     ac_kludge=HAVE_INTTYPES_H
244     AC_DEFINE_UNQUOTED($ac_kludge)
245   fi
249 dnl ---------------------------------------------------------------------------
250 dnl From Paul Eggert <eggert@twinsun.com>
252 AC_DEFUN(AC_STRUCT_ST_MTIM_NSEC,
253  [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
254    ac_cv_struct_st_mtim_nsec,
255    [ac_save_CPPFLAGS="$CPPFLAGS"
256     ac_cv_struct_st_mtim_nsec=no
257     # tv_nsec -- the usual case
258     # _tv_nsec -- Solaris 2.6, if
259     #   (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
260     #    && !defined __EXTENSIONS__)
261     # st__tim.tv_nsec -- UnixWare 2.1.2
262     for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
263       CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
264       AC_TRY_COMPILE([#include <sys/types.h>
265 #include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
266         [ac_cv_struct_st_mtim_nsec=$ac_val; break])
267     done
268     CPPFLAGS="$ac_save_CPPFLAGS"])
270   if test $ac_cv_struct_st_mtim_nsec != no; then
271     AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec)
272   fi
276 dnl ---------------------------------------------------------------------------
277 dnl From Paul Eggert <eggert@twinsun.com>
279 dnl Define uintmax_t to `unsigned long' or `unsigned long long'
280 dnl if <inttypes.h> does not exist.
282 AC_DEFUN(jm_AC_TYPE_UINTMAX_T,
284   AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
285   if test $jm_ac_cv_header_inttypes_h = no; then
286     AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
287     [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
288       [unsigned long long ullmax = (unsigned long long) -1;
289        return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
290       ac_cv_type_unsigned_long_long=yes,
291       ac_cv_type_unsigned_long_long=no)])
292     if test $ac_cv_type_unsigned_long_long = yes; then
293       AC_DEFINE(uintmax_t, unsigned long long)
294     else
295       AC_DEFINE(uintmax_t, unsigned long)
296     fi
297   fi
301 dnl ---------------------------------------------------------------------------
302 dnl From Steve Robbins <steve@nyongwa.montreal.qc.ca>
304 dnl From a proposed change made on the autoconf list on 2 Feb 1999
305 dnl http://sourceware.cygnus.com/ml/autoconf/1999-02/msg00001.html
306 dnl Patch for AIX 3.2 by Lars Hecking <lhecking@nmrc.ucc.ie> on 17 May 1999
308 AC_DEFUN(AC_FUNC_SELECT,
309 [AC_CHECK_FUNCS(select)
310 if test "$ac_cv_func_select" = yes; then
311   AC_CHECK_HEADERS(unistd.h sys/types.h sys/time.h sys/select.h sys/socket.h)
312   AC_MSG_CHECKING([argument types of select()])
313   AC_CACHE_VAL(ac_cv_type_fd_set_size_t,dnl
314     [AC_CACHE_VAL(ac_cv_type_fd_set,dnl
315       [for ac_cv_type_fd_set in 'fd_set' 'int' 'void'; do
316         for ac_cv_type_fd_set_size_t in 'int' 'size_t' 'unsigned long' 'unsigned'; do
317           for ac_type_timeval in 'struct timeval' 'const struct timeval'; do
318             AC_TRY_COMPILE(dnl
319 [#ifdef HAVE_SYS_TIME_H
320 #include <sys/time.h>
321 #endif
322 #ifdef HAVE_SYS_TYPES_H
323 #include <sys/types.h>
324 #endif
325 #ifdef HAVE_UNISTD_H
326 #include <unistd.h>
327 #endif
328 #ifdef HAVE_SYS_SELECT_H
329 #include <sys/select.h>
330 #endif
331 #ifdef HAVE_SYS_SOCKET_H
332 #include <sys/socket.h>
333 #endif],
334 [#ifdef __STDC__
335 extern select ($ac_cv_type_fd_set_size_t,
336  $ac_cv_type_fd_set *,  $ac_cv_type_fd_set *, $ac_cv_type_fd_set *,
337  $ac_type_timeval *);
338 #else
339 extern select ();
340   $ac_cv_type_fd_set_size_t s;
341   $ac_cv_type_fd_set *p;
342   $ac_type_timeval *t;
343 #endif],
344 [ac_found=yes ; break 3],ac_found=no)
345           done
346         done
347       done
348     ])dnl AC_CACHE_VAL
349   ])dnl AC_CACHE_VAL
350   if test "$ac_found" = no; then
351     AC_MSG_ERROR([can't determine argument types])
352   fi
354   AC_MSG_RESULT([select($ac_cv_type_fd_set_size_t,$ac_cv_type_fd_set *,...)])
355   AC_DEFINE_UNQUOTED(fd_set_size_t, $ac_cv_type_fd_set_size_t)
356   ac_cast=
357   if test "$ac_cv_type_fd_set" != fd_set; then
358     # Arguments 2-4 are not fd_set.  Some weirdo systems use fd_set type for
359     # FD_SET macros, but insist that you cast the argument to select.  I don't
360     # understand why that might be, but it means we cannot define fd_set.
361     AC_EGREP_CPP(dnl
362 changequote(<<,>>)dnl
363 <<(^|[^a-zA-Z_0-9])fd_set[^a-zA-Z_0-9]>>dnl
364 changequote([,]),dnl
365 [#ifdef HAVE_SYS_TIME_H
366 #include <sys/time.h>
367 #endif
368 #ifdef HAVE_SYS_TYPES_H
369 #include <sys/types.h>
370 #endif
371 #ifdef HAVE_UNISTD_H
372 #include <unistd.h>
373 #endif
374 #ifdef HAVE_SYS_SELECT_H
375 #include <sys/select.h>
376 #endif
377 #ifdef HAVE_SYS_SOCKET_H
378 #include <sys/socket.h>
379 #endif],dnl
380     # We found fd_set type in a header, need special cast
381     ac_cast="($ac_cv_type_fd_set *)",dnl
382     # No fd_set type; it is safe to define it
383     AC_DEFINE_UNQUOTED(fd_set,$ac_cv_type_fd_set))
384   fi
385   AC_DEFINE_UNQUOTED(SELECT_FD_SET_CAST,$ac_cast)
390 # The following is taken from automake 1.4,
391 # except that it prefers the compiler option -Ae to "-Aa -D_HPUX_SOURCE"
392 # because only the former supports 64-bit integral types on HP-UX 10.20.
394 ## ----------------------------------------- ##
395 ## ANSIfy the C compiler whenever possible.  ##
396 ## From Franc,ois Pinard                     ##
397 ## ----------------------------------------- ##
399 # serial 2
401 # @defmac AC_PROG_CC_STDC
402 # @maindex PROG_CC_STDC
403 # @ovindex CC
404 # If the C compiler in not in ANSI C mode by default, try to add an option
405 # to output variable @code{CC} to make it so.  This macro tries various
406 # options that select ANSI C on some system or another.  It considers the
407 # compiler to be in ANSI C mode if it handles function prototypes correctly.
409 # If you use this macro, you should check after calling it whether the C
410 # compiler has been set to accept ANSI C; if not, the shell variable
411 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
412 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
413 # program @code{ansi2knr}, which comes with Ghostscript.
414 # @end defmac
416 AC_DEFUN(AM_PROG_CC_STDC,
417 [AC_REQUIRE([AC_PROG_CC])
418 AC_BEFORE([$0], [AC_C_INLINE])
419 AC_BEFORE([$0], [AC_C_CONST])
420 dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
421 dnl a magic option to avoid problems with ANSI preprocessor commands
422 dnl like #elif.
423 dnl FIXME: can't do this because then AC_AIX won't work due to a
424 dnl circular dependency.
425 dnl AC_BEFORE([$0], [AC_PROG_CPP])
426 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
427 AC_CACHE_VAL(am_cv_prog_cc_stdc,
428 [am_cv_prog_cc_stdc=no
429 ac_save_CC="$CC"
430 # Don't try gcc -ansi; that turns off useful extensions and
431 # breaks some systems' header files.
432 # AIX                   -qlanglvl=ansi
433 # Ultrix and OSF/1      -std1
434 # HP-UX                 -Aa -D_HPUX_SOURCE
435 # SVR4                  -Xc -D__EXTENSIONS__
436 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
438   CC="$ac_save_CC $ac_arg"
439   AC_TRY_COMPILE(
440 [#include <stdarg.h>
441 #include <stdio.h>
442 #include <sys/types.h>
443 #include <sys/stat.h>
444 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
445 struct buf { int x; };
446 FILE * (*rcsopen) (struct buf *, struct stat *, int);
447 static char *e (p, i)
448      char **p;
449      int i;
451   return p[i];
453 static char *f (char * (*g) (char **, int), char **p, ...)
455   char *s;
456   va_list v;
457   va_start (v,p);
458   s = g (p, va_arg (v,int));
459   va_end (v);
460   return s;
462 int test (int i, double x);
463 struct s1 {int (*f) (int a);};
464 struct s2 {int (*f) (double a);};
465 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
466 int argc;
467 char **argv;
468 ], [
469 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
471 [am_cv_prog_cc_stdc="$ac_arg"; break])
472 done
473 CC="$ac_save_CC"
475 if test -z "$am_cv_prog_cc_stdc"; then
476   AC_MSG_RESULT([none needed])
477 else
478   AC_MSG_RESULT($am_cv_prog_cc_stdc)
480 case "x$am_cv_prog_cc_stdc" in
481   x|xno) ;;
482   *) CC="$CC $am_cv_prog_cc_stdc" ;;
483 esac
486 dnl ---------------------------------------------------------------------------
487 dnl Enable internationalization support for GNU make.
488 dnl Obtained from the libit 0.7 distribution
490 AC_DEFUN(fp_WITH_GETTEXT, [
492   AC_MSG_CHECKING(whether NLS is wanted)
493   AC_ARG_ENABLE(nls,
494     [  --disable-nls           disallow Native Language Support],
495     enable_nls=$enableval, enable_nls=yes)
496   AC_MSG_RESULT($enable_nls)
497   use_nls=$enable_nls
498   AM_CONDITIONAL(USE_NLS, test $use_nls = yes)
500   if test $enable_nls = yes; then
501     AC_DEFINE(ENABLE_NLS)
503     AC_ARG_WITH(catgets,
504       [  --with-catgets          say that catgets is not supported],
505       [AC_MSG_WARN([catgets not supported, --with-catgets ignored])])
507     AC_CHECK_FUNCS(gettext)
508     AC_CHECK_LIB(intl, gettext, :)
509     if test $ac_cv_lib_intl_gettext$ac_cv_func_gettext != nono; then
510       AC_MSG_CHECKING(whether the included gettext is preferred)
511       AC_ARG_WITH(included-gettext,
512         [  --without-included-gettext avoid our provided version of gettext],
513         with_included_gettext=$withval, with_included_gettext=yes)
514       AC_MSG_RESULT($with_included_gettext)
515       if test $with_included_gettext$ac_cv_func_gettext = nono; then
516         LIBS="$LIBS -lintl"
517       fi
518     else
519       with_included_gettext=yes
520     fi
521     if test $with_included_gettext = yes; then
522       LIBOBJS="$LIBOBJS gettext.o"
523       AC_DEFINE(HAVE_GETTEXT)
524       AC_DEFINE(HAVE_DCGETTEXT)
525     else
526       AC_CHECK_HEADERS(libintl.h)
527       AC_CHECK_FUNCS(dcgettext gettext)
528     fi
530     AC_CHECK_HEADERS(locale.h)
531     AC_CHECK_FUNCS(getcwd setlocale stpcpy)
532     AM_LC_MESSAGES
534     if test -z "$ALL_LINGUAS"; then
535       AC_MSG_WARN(This package does not install translations yet.)
536     else
537       ac_items="$ALL_LINGUAS"
538       for ac_item in $ac_items; do
539         ALL_POFILES="$ALL_POFILES $ac_item.po"
540         ALL_MOFILES="$ALL_MOFILES $ac_item.mo"
541       done
542     fi
543     AC_SUBST(ALL_LINGUAS)
544     AC_SUBST(ALL_POFILES)
545     AC_SUBST(ALL_MOFILES)
547     AC_MSG_CHECKING(which translations to install)
548     if test -z "$LINGUAS"; then
549       ac_print="$ALL_LINGUAS"
550       MOFILES="$ALL_MOFILES"
551     else
552       ac_items="$LINGUAS"
553       for ac_item in $ac_items; do
554         case "$ALL_LINGUAS" in
555           *$ac_item*)
556             ac_print="$ac_print $ac_item"
557             MOFILES="$MOFILES $ac_item.mo"
558             ;;
559         esac
560       done
561     fi
562     AC_SUBST(MOFILES)
563     if test -z "$ac_print"; then
564       AC_MSG_RESULT(none)
565     else
566       AC_MSG_RESULT($ac_print)
567     fi
569     if test "x$prefix" = xNONE; then
570       AC_DEFINE_UNQUOTED(LOCALEDIR, "$ac_default_prefix/share/locale")
571     else
572       AC_DEFINE_UNQUOTED(LOCALEDIR, "$prefix/share/locale")
573     fi
574   fi])