1 dnl aclocal.m4 generated automatically by aclocal 1.3b
3 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
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.
13 dnl written by Rob Savoye <rob@cygnus.com> for Cygnus Support
14 dnl major rewriting for Tcl 7.5 by Don Libes <libes@nist.gov>
16 dnl gdb/configure.in uses BFD_NEED_DECLARATION, so get its definition.
17 sinclude(../bfd/acinclude.m4)
19 dnl CY_AC_PATH_TCLCONFIG and CY_AC_LOAD_TCLCONFIG should be invoked
20 dnl (in that order) before any other TCL macros. Similarly for TK.
22 dnl CYGNUS LOCAL: This gets the right posix flag for gcc
23 AC_DEFUN(CY_AC_TCL_LYNX_POSIX,
24 [AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP])
25 AC_MSG_CHECKING([if running LynxOS])
26 AC_CACHE_VAL(ac_cv_os_lynx,
29 * The old Lynx "cc" only defines "Lynx", but the newer one uses "__Lynx__"
31 #if defined(__Lynx__) || defined(Lynx)
34 ], ac_cv_os_lynx=yes, ac_cv_os_lynx=no)])
36 if test "$ac_cv_os_lynx" = "yes" ; then
39 AC_MSG_CHECKING([whether -mposix or -X is available])
40 AC_CACHE_VAL(ac_cv_c_posix_flag,
43 * This flag varies depending on how old the compiler is.
44 * -X is for the old "cc" and "gcc" (based on 1.42).
45 * -mposix is for the new gcc (at least 2.5.8).
47 #if defined(__GNUC__) && __GNUC__ >= 2
50 ], ac_cv_c_posix_flag=" -mposix", ac_cv_c_posix_flag=" -X")])
51 CC="$CC $ac_cv_c_posix_flag"
52 AC_MSG_RESULT($ac_cv_c_posix_flag)
59 # Sometimes the native compiler is a bogus stub for gcc or /usr/ucb/cc. This
60 # makes configure think it's cross compiling. If --target wasn't used, then
61 # we can't configure, so something is wrong. We don't use the cache
62 # here cause if somebody fixes their compiler install, we want this to work.
63 AC_DEFUN(CY_AC_C_WORKS,
64 [# If we cannot compile and link a trivial program, we can't expect anything to work
65 AC_MSG_CHECKING(whether the compiler ($CC) actually works)
66 AC_TRY_COMPILE(, [/* don't need anything here */],
67 c_compiles=yes, c_compiles=no)
69 AC_TRY_LINK(, [/* don't need anything here */],
70 c_links=yes, c_links=no)
72 if test x"${c_compiles}" = x"no" ; then
73 AC_MSG_ERROR(the native compiler is broken and won't compile.)
76 if test x"${c_links}" = x"no" ; then
77 AC_MSG_ERROR(the native compiler is broken and won't link.)
82 AC_DEFUN(CY_AC_PATH_TCLH, [
84 # Ok, lets find the tcl source trees so we can use the headers
85 # Warning: transition of version 9 to 10 will break this algorithm
86 # because 10 sorts before 9. We also look for just tcl. We have to
87 # be careful that we don't match stuff like tclX by accident.
88 # the alternative search directory is involked by --with-tclinclude
92 AC_MSG_CHECKING(for Tcl private headers. dir=${configdir})
93 AC_ARG_WITH(tclinclude, [ --with-tclinclude=DIR Directory where tcl private headers are], with_tclinclude=${withval})
94 AC_CACHE_VAL(ac_cv_c_tclh,[
95 # first check to see if --with-tclinclude was specified
96 if test x"${with_tclinclude}" != x ; then
97 if test -f ${with_tclinclude}/tclInt.h ; then
98 ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)`
99 elif test -f ${with_tclinclude}/generic/tclInt.h ; then
100 ac_cv_c_tclh=`(cd ${with_tclinclude}/generic; pwd)`
102 AC_MSG_ERROR([${with_tclinclude} directory doesn't contain private headers])
106 # next check if it came with Tcl configuration file
107 if test x"${ac_cv_c_tclconfig}" = x ; then
108 if test -f $ac_cv_c_tclconfig/../generic/tclInt.h ; then
109 ac_cv_c_tclh=`(cd $ac_cv_c_tclconfig/..; pwd)`
113 # next check in private source directory
115 # since ls returns lowest version numbers first, reverse its output
116 if test x"${ac_cv_c_tclh}" = x ; then
119 `ls -dr ${srcdir}/../tcl[[7-9]]* 2>/dev/null` \
120 ${srcdir}/../../tcl \
121 `ls -dr ${srcdir}/../../tcl[[7-9]]* 2>/dev/null` \
122 ${srcdir}/../../../tcl \
123 `ls -dr ${srcdir}/../../../tcl[[7-9]]* 2>/dev/null ` ; do
124 if test -f $i/generic/tclInt.h ; then
125 ac_cv_c_tclh=`(cd $i/generic; pwd)`
130 # finally check in a few common install locations
132 # since ls returns lowest version numbers first, reverse its output
133 if test x"${ac_cv_c_tclh}" = x ; then
135 `ls -dr /usr/local/src/tcl[[7-9]]* 2>/dev/null` \
136 `ls -dr /usr/local/lib/tcl[[7-9]]* 2>/dev/null` \
139 ${prefix}/include ; do
140 if test -f $i/generic/tclInt.h ; then
141 ac_cv_c_tclh=`(cd $i/generic; pwd)`
146 # see if one is installed
147 if test x"${ac_cv_c_tclh}" = x ; then
148 AC_HEADER_CHECK(tclInt.h, ac_cv_c_tclh=installed, ac_cv_c_tclh="")
151 if test x"${ac_cv_c_tclh}" = x ; then
152 TCLHDIR="# no Tcl private headers found"
153 AC_MSG_ERROR([Can't find Tcl private headers])
155 if test x"${ac_cv_c_tclh}" != x ; then
157 if test x"${ac_cv_c_tclh}" = x"installed" ; then
158 AC_MSG_RESULT([is installed])
161 AC_MSG_RESULT([found in ${ac_cv_c_tclh}])
162 # this hack is cause the TCLHDIR won't print if there is a "-I" in it.
163 TCLHDIR="-I${ac_cv_c_tclh}"
171 AC_DEFUN(CY_AC_PATH_TCLCONFIG, [
173 # Ok, lets find the tcl configuration
174 # First, look for one uninstalled.
175 # the alternative search directory is invoked by --with-tclconfig
178 if test x"${no_tcl}" = x ; then
179 # we reset no_tcl in case something fails here
181 AC_ARG_WITH(tclconfig, [ --with-tclconfig=DIR Directory containing tcl configuration (tclConfig.sh)],
182 with_tclconfig=${withval})
183 AC_MSG_CHECKING([for Tcl configuration])
184 AC_CACHE_VAL(ac_cv_c_tclconfig,[
186 # First check to see if --with-tclconfig was specified.
187 if test x"${with_tclconfig}" != x ; then
188 if test -f "${with_tclconfig}/tclConfig.sh" ; then
189 ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
191 AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
195 # then check for a private Tcl installation
196 if test x"${ac_cv_c_tclconfig}" = x ; then
199 `ls -dr ../tcl[[7-9]]* 2>/dev/null` \
201 `ls -dr ../../tcl[[7-9]]* 2>/dev/null` \
203 `ls -dr ../../../tcl[[7-9]]* 2>/dev/null` ; do
204 if test -f "$i/${configdir}/tclConfig.sh" ; then
205 ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)`
210 # check in a few common install locations
211 if test x"${ac_cv_c_tclconfig}" = x ; then
212 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
213 if test -f "$i/tclConfig.sh" ; then
214 ac_cv_c_tclconfig=`(cd $i; pwd)`
219 # check in a few other private locations
220 if test x"${ac_cv_c_tclconfig}" = x ; then
223 `ls -dr ${srcdir}/../tcl[[7-9]]* 2>/dev/null` ; do
224 if test -f "$i/${configdir}/tclConfig.sh" ; then
225 ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)`
231 if test x"${ac_cv_c_tclconfig}" = x ; then
232 TCLCONFIG="# no Tcl configs found"
233 AC_MSG_WARN(Can't find Tcl configuration definitions)
236 TCLCONFIG=${ac_cv_c_tclconfig}/tclConfig.sh
237 AC_MSG_RESULT(found $TCLCONFIG)
242 # Defined as a separate macro so we don't have to cache the values
243 # from PATH_TCLCONFIG (because this can also be cached).
244 AC_DEFUN(CY_AC_LOAD_TCLCONFIG, [
247 AC_SUBST(TCL_VERSION)
248 AC_SUBST(TCL_MAJOR_VERSION)
249 AC_SUBST(TCL_MINOR_VERSION)
253 dnl not used, don't export to save symbols
254 dnl AC_SUBST(TCL_LIB_FILE)
256 dnl don't export, not used outside of configure
257 dnl AC_SUBST(TCL_LIBS)
258 dnl not used, don't export to save symbols
259 dnl AC_SUBST(TCL_PREFIX)
261 dnl not used, don't export to save symbols
262 dnl AC_SUBST(TCL_EXEC_PREFIX)
264 AC_SUBST(TCL_SHLIB_CFLAGS)
265 AC_SUBST(TCL_SHLIB_LD)
266 dnl don't export, not used outside of configure
267 AC_SUBST(TCL_SHLIB_LD_LIBS)
268 AC_SUBST(TCL_SHLIB_SUFFIX)
269 dnl not used, don't export to save symbols
270 AC_SUBST(TCL_DL_LIBS)
271 AC_SUBST(TCL_LD_FLAGS)
272 dnl don't export, not used outside of configure
273 AC_SUBST(TCL_LD_SEARCH_FLAGS)
274 AC_SUBST(TCL_COMPAT_OBJS)
276 AC_SUBST(TCL_BUILD_LIB_SPEC)
277 AC_SUBST(TCL_LIB_SPEC)
278 AC_SUBST(TCL_LIB_VERSIONS_OK)
280 dnl not used, don't export to save symbols
281 dnl AC_SUBST(TCL_SHARED_LIB_SUFFIX)
283 dnl not used, don't export to save symbols
284 dnl AC_SUBST(TCL_UNSHARED_LIB_SUFFIX)
287 # Warning: Tk definitions are very similar to Tcl definitions but
288 # are not precisely the same. There are a couple of differences,
289 # so don't do changes to Tcl thinking you can cut and paste it do
290 # the Tk differences and later simply substitute "Tk" for "Tcl".
292 # - Acceptable Tcl major version #s is 7-9 while Tk is 4-9
293 # - Searching for Tcl includes looking for tclInt.h, Tk looks for tk.h
294 # - Computing major/minor versions is different because Tk depends on
295 # headers to Tcl, Tk, and X.
296 # - Symbols in tkConfig.sh are different than tclConfig.sh
297 # - Acceptable for Tk to be missing but not Tcl.
299 AC_DEFUN(CY_AC_PATH_TKH, [
301 # Ok, lets find the tk source trees so we can use the headers
302 # If the directory (presumably symlink) named "tk" exists, use that one
303 # in preference to any others. Same logic is used when choosing library
304 # and again with Tcl. The search order is the best place to look first, then in
305 # decreasing significance. The loop breaks if the trigger file is found.
306 # Note the gross little conversion here of srcdir by cd'ing to the found
307 # directory. This converts the path from a relative to an absolute, so
308 # recursive cache variables for the path will work right. We check all
309 # the possible paths in one loop rather than many seperate loops to speed
311 # the alternative search directory is involked by --with-tkinclude
314 AC_MSG_CHECKING(for Tk private headers)
315 AC_ARG_WITH(tkinclude, [ --with-tkinclude=DIR Directory where tk private headers are], with_tkinclude=${withval})
316 AC_CACHE_VAL(ac_cv_c_tkh,[
317 # first check to see if --with-tkinclude was specified
318 if test x"${with_tkinclude}" != x ; then
319 if test -f ${with_tkinclude}/tk.h ; then
320 ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)`
321 elif test -f ${with_tkinclude}/generic/tk.h ; then
322 ac_cv_c_tkh=`(cd ${with_tkinclude}/generic; pwd)`
324 AC_MSG_ERROR([${with_tkinclude} directory doesn't contain private headers])
328 # next check if it came with Tk configuration file
329 if test x"${ac_cv_c_tkconfig}" = x ; then
330 if test -f $ac_cv_c_tkconfig/../generic/tk.h ; then
331 ac_cv_c_tkh=`(cd $ac_cv_c_tkconfig/..; pwd)`
335 # next check in private source directory
337 # since ls returns lowest version numbers first, reverse its output
338 if test x"${ac_cv_c_tkh}" = x ; then
341 `ls -dr ${srcdir}/../tk[[4-9]]* 2>/dev/null` \
343 `ls -dr ${srcdir}/../../tk[[4-9]]* 2>/dev/null` \
344 ${srcdir}/../../../tk \
345 `ls -dr ${srcdir}/../../../tk[[4-9]]* 2>/dev/null ` ; do
346 if test -f $i/generic/tk.h ; then
347 ac_cv_c_tkh=`(cd $i/generic; pwd)`
352 # finally check in a few common install locations
354 # since ls returns lowest version numbers first, reverse its output
355 if test x"${ac_cv_c_tkh}" = x ; then
357 `ls -dr /usr/local/src/tk[[4-9]]* 2>/dev/null` \
358 `ls -dr /usr/local/lib/tk[[4-9]]* 2>/dev/null` \
361 ${prefix}/include ; do
362 if test -f $i/generic/tk.h ; then
363 ac_cv_c_tkh=`(cd $i/generic; pwd)`
368 # see if one is installed
369 if test x"${ac_cv_c_tkh}" = x ; then
370 AC_HEADER_CHECK(tk.h, ac_cv_c_tkh=installed, ac_cv_c_tkh="")
373 if test x"${ac_cv_c_tkh}" != x ; then
375 if test x"${ac_cv_c_tkh}" = x"installed" ; then
376 AC_MSG_RESULT([is installed])
379 AC_MSG_RESULT([found in ${ac_cv_c_tkh}])
380 # this hack is cause the TKHDIR won't print if there is a "-I" in it.
381 TKHDIR="-I${ac_cv_c_tkh}"
384 TKHDIR="# no Tk directory found"
385 AC_MSG_WARN([Can't find Tk private headers])
393 AC_DEFUN(CY_AC_PATH_TKCONFIG, [
395 # Ok, lets find the tk configuration
396 # First, look for one uninstalled.
397 # the alternative search directory is invoked by --with-tkconfig
400 if test x"${no_tk}" = x ; then
401 # we reset no_tk in case something fails here
403 AC_ARG_WITH(tkconfig, [ --with-tkconfig=DIR Directory containing tk configuration (tkConfig.sh)],
404 with_tkconfig=${withval})
405 AC_MSG_CHECKING([for Tk configuration])
406 AC_CACHE_VAL(ac_cv_c_tkconfig,[
408 # First check to see if --with-tkconfig was specified.
409 if test x"${with_tkconfig}" != x ; then
410 if test -f "${with_tkconfig}/tkConfig.sh" ; then
411 ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
413 AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
417 # then check for a private Tk library
418 if test x"${ac_cv_c_tkconfig}" = x ; then
421 `ls -dr ../tk[[4-9]]* 2>/dev/null` \
423 `ls -dr ../../tk[[4-9]]* 2>/dev/null` \
425 `ls -dr ../../../tk[[4-9]]* 2>/dev/null` ; do
426 if test -f "$i/${configdir}/tkConfig.sh" ; then
427 ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)`
432 # check in a few common install locations
433 if test x"${ac_cv_c_tkconfig}" = x ; then
434 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
435 if test -f "$i/tkConfig.sh" ; then
436 ac_cv_c_tkconfig=`(cd $i; pwd)`
441 # check in a few other private locations
442 if test x"${ac_cv_c_tkconfig}" = x ; then
445 `ls -dr ${srcdir}/../tk[[4-9]]* 2>/dev/null` ; do
446 if test -f "$i/${configdir}/tkConfig.sh" ; then
447 ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)`
453 if test x"${ac_cv_c_tkconfig}" = x ; then
454 TKCONFIG="# no Tk configs found"
455 AC_MSG_WARN(Can't find Tk configuration definitions)
458 TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh
459 AC_MSG_RESULT(found $TKCONFIG)
465 # Defined as a separate macro so we don't have to cache the values
466 # from PATH_TKCONFIG (because this can also be cached).
467 AC_DEFUN(CY_AC_LOAD_TKCONFIG, [
468 if test -f "$TKCONFIG" ; then
473 dnl not actually used, don't export to save symbols
474 dnl AC_SUBST(TK_MAJOR_VERSION)
475 dnl AC_SUBST(TK_MINOR_VERSION)
478 dnl not used, don't export to save symbols
479 dnl AC_SUBST(TK_LIB_FILE)
481 dnl not used outside of configure
482 dnl AC_SUBST(TK_LIBS)
483 dnl not used, don't export to save symbols
484 dnl AC_SUBST(TK_PREFIX)
486 dnl not used, don't export to save symbols
487 dnl AC_SUBST(TK_EXEC_PREFIX)
489 AC_SUBST(TK_BUILD_INCLUDES)
490 AC_SUBST(TK_XINCLUDES)
492 AC_SUBST(TK_BUILD_LIB_SPEC)
493 AC_SUBST(TK_LIB_SPEC)
497 # check for Itcl headers.
499 AC_DEFUN(CY_AC_PATH_ITCLH, [
500 AC_MSG_CHECKING(for Itcl private headers. srcdir=${srcdir})
501 if test x"${ac_cv_c_itclh}" = x ; then
502 for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ; do
503 if test -f $i/src/itcl.h ; then
504 ac_cv_c_itclh=`(cd $i/src; pwd)`
509 if test x"${ac_cv_c_itclh}" = x ; then
510 ITCLHDIR="# no Itcl private headers found"
511 AC_MSG_ERROR([Can't find Itcl private headers])
513 if test x"${ac_cv_c_itclh}" != x ; then
514 ITCLHDIR="-I${ac_cv_c_itclh}"
516 # should always be here
517 ITCLLIB="../itcl/src/libitcl.a"
522 # check for Tix headers.
524 AC_DEFUN(CY_AC_PATH_TIX, [
525 AC_MSG_CHECKING(for Tix private headers. srcdir=${srcdir})
526 if test x"${ac_cv_c_tixh}" = x ; then
527 for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do
528 if test -f $i/generic/tix.h ; then
529 ac_cv_c_tixh=`(cd $i/generic; pwd)`
534 if test x"${ac_cv_c_tixh}" = x ; then
535 TIXHDIR="# no Tix private headers found"
536 AC_MSG_ERROR([Can't find Tix private headers])
538 if test x"${ac_cv_c_tixh}" != x ; then
539 TIXHDIR="-I${ac_cv_c_tixh}"
547 # @defmac AC_PROG_CC_STDC
548 # @maindex PROG_CC_STDC
550 # If the C compiler in not in ANSI C mode by default, try to add an option
551 # to output variable @code{CC} to make it so. This macro tries various
552 # options that select ANSI C on some system or another. It considers the
553 # compiler to be in ANSI C mode if it handles function prototypes correctly.
555 # If you use this macro, you should check after calling it whether the C
556 # compiler has been set to accept ANSI C; if not, the shell variable
557 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
558 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
559 # program @code{ansi2knr}, which comes with Ghostscript.
562 AC_DEFUN(AM_PROG_CC_STDC,
563 [AC_REQUIRE([AC_PROG_CC])
564 AC_BEFORE([$0], [AC_C_INLINE])
565 AC_BEFORE([$0], [AC_C_CONST])
566 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
567 dnl a magic option to avoid problems with ANSI preprocessor commands
569 dnl FIXME: can't do this because then AC_AIX won't work due to a
570 dnl circular dependency.
571 dnl AC_BEFORE([$0], [AC_PROG_CPP])
572 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
573 AC_CACHE_VAL(am_cv_prog_cc_stdc,
574 [am_cv_prog_cc_stdc=no
576 # Don't try gcc -ansi; that turns off useful extensions and
577 # breaks some systems' header files.
579 # Ultrix and OSF/1 -std1
580 # HP-UX -Aa -D_HPUX_SOURCE
581 # SVR4 -Xc -D__EXTENSIONS__
582 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
584 CC="$ac_save_CC $ac_arg"
588 #include <sys/types.h>
589 #include <sys/stat.h>
590 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
591 struct buf { int x; };
592 FILE * (*rcsopen) (struct buf *, struct stat *, int);
593 static char *e (p, i)
599 static char *f (char * (*g) (char **, int), char **p, ...)
604 s = g (p, va_arg (v,int));
608 int test (int i, double x);
609 struct s1 {int (*f) (int a);};
610 struct s2 {int (*f) (double a);};
611 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
615 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
617 [am_cv_prog_cc_stdc="$ac_arg"; break])
621 if test -z "$am_cv_prog_cc_stdc"; then
622 AC_MSG_RESULT([none needed])
624 AC_MSG_RESULT($am_cv_prog_cc_stdc)
626 case "x$am_cv_prog_cc_stdc" in
628 *) CC="$CC $am_cv_prog_cc_stdc" ;;
632 # This file is derived from `gettext.m4'. The difference is that the
633 # included macros assume Cygnus-style source and build trees.
635 # Macro to add for using GNU gettext.
636 # Ulrich Drepper <drepper@cygnus.com>, 1995.
638 # This file file be copied and used freely without restrictions. It can
639 # be used in projects which are not available under the GNU Public License
640 # but which still want to provide support for the GNU gettext functionality.
641 # Please note that the actual code is *not* freely available.
645 AC_DEFUN(CY_WITH_NLS,
646 [AC_MSG_CHECKING([whether NLS is requested])
647 dnl Default is enabled NLS
649 [ --disable-nls do not use Native Language Support],
650 USE_NLS=$enableval, USE_NLS=yes)
651 AC_MSG_RESULT($USE_NLS)
654 USE_INCLUDED_LIBINTL=no
656 dnl If we use NLS figure out what method
657 if test "$USE_NLS" = "yes"; then
658 AC_DEFINE(ENABLE_NLS)
659 AC_MSG_CHECKING([whether included gettext is requested])
660 AC_ARG_WITH(included-gettext,
661 [ --with-included-gettext use the GNU gettext library included here],
662 nls_cv_force_use_gnu_gettext=$withval,
663 nls_cv_force_use_gnu_gettext=no)
664 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
666 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
667 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
668 dnl User does not insist on using GNU NLS library. Figure out what
669 dnl to use. If gettext or catgets are available (in this order) we
670 dnl use this. Else we have to fall back to GNU NLS library.
671 dnl catgets is only used if permitted by option --with-catgets.
676 AC_CHECK_HEADER(libintl.h,
677 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
678 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
679 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
681 if test "$gt_cv_func_gettext_libc" != "yes"; then
682 AC_CHECK_LIB(intl, bindtextdomain,
683 [AC_CACHE_CHECK([for gettext in libintl],
684 gt_cv_func_gettext_libintl,
685 [AC_TRY_LINK([], [return (int) gettext ("")],
686 gt_cv_func_gettext_libintl=yes,
687 gt_cv_func_gettext_libintl=no)])])
690 if test "$gt_cv_func_gettext_libc" = "yes" \
691 || test "$gt_cv_func_gettext_libintl" = "yes"; then
692 AC_DEFINE(HAVE_GETTEXT)
693 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
694 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
695 if test "$MSGFMT" != "no"; then
696 AC_CHECK_FUNCS(dcgettext)
697 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
698 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
699 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
700 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
701 return _nl_msg_cat_cntr],
711 dnl In the standard gettext, we would now check for catgets.
712 dnl However, we never want to use catgets for our releases.
714 if test "$CATOBJEXT" = "NONE"; then
715 dnl Neither gettext nor catgets in included in the C library.
716 dnl Fall back on GNU gettext library.
717 nls_cv_use_gnu_gettext=yes
721 if test "$nls_cv_use_gnu_gettext" = "yes"; then
722 dnl Mark actions used to generate GNU NLS library.
723 INTLOBJS="\$(GETTOBJS)"
724 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
725 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
726 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
727 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
728 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
730 USE_INCLUDED_LIBINTL=yes
734 INTLDEPS='$(top_builddir)/../intl/libintl.a'
736 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
737 nls_cv_header_intl=libintl.h
738 nls_cv_header_libgt=libgettext.h
741 dnl Test whether we really found GNU xgettext.
742 if test "$XGETTEXT" != ":"; then
743 dnl If it is no GNU xgettext we define it as : so that the
744 dnl Makefiles still can work.
745 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
749 [found xgettext programs is not GNU xgettext; ignore it])
754 # We need to process the po/ directory.
758 nls_cv_header_intl=libintl.h
759 nls_cv_header_libgt=libgettext.h
762 # If this is used in GNU gettext we have to set USE_NLS to `yes'
763 # because some of the sources are only built for this goal.
764 if test "$PACKAGE" = gettext; then
766 USE_INCLUDED_LIBINTL=yes
769 dnl These rules are solely for the distribution goal. While doing this
770 dnl we only have to keep exactly one list of the available catalogs
772 for lang in $ALL_LINGUAS; do
773 GMOFILES="$GMOFILES $lang.gmo"
774 POFILES="$POFILES $lang.po"
777 dnl Make all variables we use known to autoconf.
778 AC_SUBST(USE_INCLUDED_LIBINTL)
781 AC_SUBST(DATADIRNAME)
791 AC_DEFUN(CY_GNU_GETTEXT,
792 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
793 AC_REQUIRE([AC_PROG_CC])dnl
794 AC_REQUIRE([AC_PROG_RANLIB])dnl
795 AC_REQUIRE([AC_ISC_POSIX])dnl
796 AC_REQUIRE([AC_HEADER_STDC])dnl
797 AC_REQUIRE([AC_C_CONST])dnl
798 AC_REQUIRE([AC_C_INLINE])dnl
799 AC_REQUIRE([AC_TYPE_OFF_T])dnl
800 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
801 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
802 AC_REQUIRE([AC_FUNC_MMAP])dnl
804 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
805 unistd.h values.h sys/param.h])
806 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
807 __argz_count __argz_stringify __argz_next])
809 if test "${ac_cv_func_stpcpy+set}" != "set"; then
810 AC_CHECK_FUNCS(stpcpy)
812 if test "${ac_cv_func_stpcpy}" = "yes"; then
813 AC_DEFINE(HAVE_STPCPY)
819 if test "x$CATOBJEXT" != "x"; then
820 if test "x$ALL_LINGUAS" = "x"; then
823 AC_MSG_CHECKING(for catalogs to be installed)
825 for lang in ${LINGUAS=$ALL_LINGUAS}; do
826 case "$ALL_LINGUAS" in
827 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
831 AC_MSG_RESULT($LINGUAS)
834 dnl Construct list of names of catalog files to be constructed.
835 if test -n "$LINGUAS"; then
836 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
840 dnl The reference to <locale.h> in the installed <libintl.h> file
841 dnl must be resolved because we cannot expect the users of this
842 dnl to define HAVE_LOCALE_H.
843 if test $ac_cv_header_locale_h = yes; then
844 INCLUDE_LOCALE_H="#include <locale.h>"
847 /* The system does not provide the header <locale.h>. Take care yourself. */"
849 AC_SUBST(INCLUDE_LOCALE_H)
851 dnl Determine which catalog format we have (if any is needed)
852 dnl For now we know about two different formats:
853 dnl Linux libc-5 and the normal X/Open format
854 if test -f $srcdir/po2tbl.sed.in; then
855 if test "$CATOBJEXT" = ".cat"; then
856 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
858 dnl Transform the SED scripts while copying because some dumb SEDs
859 dnl cannot handle comments.
860 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
862 dnl po2tbl.sed is always needed.
863 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
864 $srcdir/po2tbl.sed.in > po2tbl.sed
867 dnl In the intl/Makefile.in we have a special dependency which makes
868 dnl only sense for gettext. We comment this out for non-gettext
870 if test "$PACKAGE" = "gettext"; then
880 MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
881 AC_SUBST(MKINSTALLDIRS)
883 dnl *** For now the libtool support in intl/Makefile is not for real.
887 dnl Generate list of files to be processed by xgettext which will
888 dnl be included in po/Makefile. But only do this if the po directory
889 dnl exists in srcdir.
890 if test -d $srcdir/po; then
891 test -d po || mkdir po
892 if test "x$srcdir" != "x."; then
893 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
894 posrcprefix="$srcdir/"
896 posrcprefix="../$srcdir/"
902 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
903 < $srcdir/po/POTFILES.in > po/POTFILES
907 # Search path for a program which passes the given test.
908 # Ulrich Drepper <drepper@cygnus.com>, 1996.
910 # This file file be copied and used freely without restrictions. It can
911 # be used in projects which are not available under the GNU Public License
912 # but which still want to provide support for the GNU gettext functionality.
913 # Please note that the actual code is *not* freely available.
917 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
918 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
919 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
920 [# Extract the first word of "$2", so it can be a program name with args.
921 set dummy $2; ac_word=[$]2
922 AC_MSG_CHECKING([for $ac_word])
923 AC_CACHE_VAL(ac_cv_path_$1,
926 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
929 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
930 for ac_dir in ifelse([$5], , $PATH, [$5]); do
931 test -z "$ac_dir" && ac_dir=.
932 if test -f $ac_dir/$ac_word; then
934 ac_cv_path_$1="$ac_dir/$ac_word"
940 dnl If no 4th arg is given, leave the cache variable unset,
941 dnl so AC_PATH_PROGS will keep looking.
942 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
947 if test -n "[$]$1"; then
955 # Check whether LC_MESSAGES is available in <locale.h>.
956 # Ulrich Drepper <drepper@cygnus.com>, 1995.
958 # This file file be copied and used freely without restrictions. It can
959 # be used in projects which are not available under the GNU Public License
960 # but which still want to provide support for the GNU gettext functionality.
961 # Please note that the actual code is *not* freely available.
965 AC_DEFUN(AM_LC_MESSAGES,
966 [if test $ac_cv_header_locale_h = yes; then
967 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
968 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
969 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
970 if test $am_cv_val_LC_MESSAGES = yes; then
971 AC_DEFINE(HAVE_LC_MESSAGES)
975 # Check to see if we're running under Win32, without using
976 # AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
977 # Otherwise set it to "".
980 dnl This knows we add .exe if we're building in the Cygwin32
981 dnl environment. But if we're not, then it compiles a test program
982 dnl to see if there is a suffix for executables.
984 [AC_REQUIRE([AM_CYGWIN32])
985 AC_REQUIRE([AM_MINGW32])
986 AC_MSG_CHECKING([for executable suffix])
987 AC_CACHE_VAL(am_cv_exeext,
988 [if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
991 cat > am_c_test.c << 'EOF'
993 /* Nothing needed here */
996 ${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
998 for file in am_c_test.*; do
1002 *) am_cv_exeext=`echo $file | sed -e s/am_c_test//` ;;
1006 test x"${am_cv_exeext}" = x && am_cv_exeext=no
1009 test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
1010 AC_MSG_RESULT(${am_cv_exeext})
1013 # Check to see if we're running under Cygwin32, without using
1014 # AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
1015 # Otherwise set it to "no".
1018 AC_DEFUN(AM_CYGWIN32,
1019 [AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
1020 [AC_TRY_COMPILE(,[return __CYGWIN32__;],
1021 am_cv_cygwin32=yes, am_cv_cygwin32=no)
1024 test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
1026 # Check to see if we're running under Mingw, without using
1027 # AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
1028 # Otherwise set it to "no".
1031 AC_DEFUN(AM_MINGW32,
1032 [AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
1033 [AC_TRY_COMPILE(,[return __MINGW32__;],
1034 am_cv_mingw32=yes, am_cv_mingw32=no)
1037 test "$am_cv_mingw32" = yes && MINGW32=yes])