Internationalised the opcodes library.
[deliverable/binutils-gdb.git] / opcodes / aclocal.m4
CommitLineData
072aa625 1dnl aclocal.m4 generated automatically by aclocal 1.3
bd4a69c3
ILT
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.
1daed53f 12
2f403ada 13sinclude(../bfd/acinclude.m4)
1daed53f 14
2f403ada
ILT
15# Do all the work for Automake. This macro actually does too much --
16# some checks are only needed if your package does certain things.
17# But this isn't really a big deal.
18
19# serial 1
20
21dnl Usage:
22dnl AM_INIT_AUTOMAKE(package,version, [no-define])
23
24AC_DEFUN(AM_INIT_AUTOMAKE,
25[AC_REQUIRE([AM_PROG_INSTALL])
26PACKAGE=[$1]
27AC_SUBST(PACKAGE)
28VERSION=[$2]
29AC_SUBST(VERSION)
30dnl test to see if srcdir already configured
31if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
32 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
33fi
34ifelse([$3],,
35AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
36AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
bd4a69c3
ILT
37AC_REQUIRE([AM_SANITY_CHECK])
38AC_REQUIRE([AC_ARG_PROGRAM])
2f403ada
ILT
39dnl FIXME This is truly gross.
40missing_dir=`cd $ac_aux_dir && pwd`
41AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
42AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
43AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
44AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
45AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
bd4a69c3 46AC_REQUIRE([AC_PROG_MAKE_SET])])
2f403ada
ILT
47
48
49# serial 1
50
51AC_DEFUN(AM_PROG_INSTALL,
52[AC_REQUIRE([AC_PROG_INSTALL])
53test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
54AC_SUBST(INSTALL_SCRIPT)dnl
55])
56
57#
58# Check to make sure that the build environment is sane.
59#
60
61AC_DEFUN(AM_SANITY_CHECK,
62[AC_MSG_CHECKING([whether build environment is sane])
63# Just in case
64sleep 1
65echo timestamp > conftestfile
66# Do `set' in a subshell so we don't clobber the current shell's
67# arguments. Must try -L first in case configure is actually a
68# symlink; some systems play weird games with the mod time of symlinks
69# (eg FreeBSD returns the mod time of the symlink's containing
70# directory).
71if (
72 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
bd4a69c3 73 if test "[$]*" = "X"; then
2f403ada
ILT
74 # -L didn't work.
75 set X `ls -t $srcdir/configure conftestfile`
76 fi
bd4a69c3
ILT
77 if test "[$]*" != "X $srcdir/configure conftestfile" \
78 && test "[$]*" != "X conftestfile $srcdir/configure"; then
79
80 # If neither matched, then we have a broken ls. This can happen
81 # if, for instance, CONFIG_SHELL is bash and it inherits a
82 # broken ls alias from the environment. This has actually
83 # happened. Such a system could not be considered "sane".
84 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
85alias in your environment])
86 fi
87
2f403ada
ILT
88 test "[$]2" = conftestfile
89 )
90then
91 # Ok.
92 :
93else
94 AC_MSG_ERROR([newly created file is older than distributed files!
95Check your system clock])
96fi
97rm -f conftest*
98AC_MSG_RESULT(yes)])
99
100dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
101dnl The program must properly implement --version.
102AC_DEFUN(AM_MISSING_PROG,
103[AC_MSG_CHECKING(for working $2)
104# Run test in a subshell; some versions of sh will print an error if
105# an executable is not found, even if stderr is redirected.
106# Redirect stdin to placate older versions of autoconf. Sigh.
107if ($2 --version) < /dev/null > /dev/null 2>&1; then
108 $1=$2
109 AC_MSG_RESULT(found)
110else
111 $1="$3/missing $2"
112 AC_MSG_RESULT(missing)
113fi
114AC_SUBST($1)])
115
116
bd4a69c3 117# serial 24 AM_PROG_LIBTOOL
1daed53f 118AC_DEFUN(AM_PROG_LIBTOOL,
bd4a69c3
ILT
119[AC_REQUIRE([AM_ENABLE_SHARED])dnl
120AC_REQUIRE([AM_ENABLE_STATIC])dnl
121AC_REQUIRE([AC_CANONICAL_HOST])dnl
122AC_REQUIRE([AC_PROG_RANLIB])dnl
123AC_REQUIRE([AC_PROG_CC])dnl
124AC_REQUIRE([AM_PROG_LD])dnl
125AC_REQUIRE([AM_PROG_NM])dnl
126AC_REQUIRE([AC_PROG_LN_S])dnl
127dnl
1daed53f 128# Always use our own libtool.
bfc10abe 129LIBTOOL='$(SHELL) $(top_builddir)/libtool'
bd4a69c3 130AC_SUBST(LIBTOOL)dnl
1daed53f 131
bd4a69c3
ILT
132# Check for any special flags to pass to ltconfig.
133libtool_flags=
134test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
135test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
1daed53f
ILT
136test "$silent" = yes && libtool_flags="$libtool_flags --silent"
137test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
138test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
139
140# Some flags need to be propagated to the compiler or linker for good
141# libtool support.
bd4a69c3 142case "$host" in
1daed53f 143*-*-irix6*)
bd4a69c3
ILT
144 # Find out which ABI we are using.
145 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
146 if AC_TRY_EVAL(ac_compile); then
147 case "`/usr/bin/file conftest.o`" in
148 *32-bit*)
149 LD="${LD-ld} -32"
788e3f91 150 ;;
bd4a69c3
ILT
151 *N32*)
152 LD="${LD-ld} -n32"
153 ;;
154 *64-bit*)
155 LD="${LD-ld} -64"
788e3f91
ILT
156 ;;
157 esac
bd4a69c3
ILT
158 fi
159 rm -rf conftest*
1daed53f
ILT
160 ;;
161
162*-*-sco3.2v5*)
163 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
164 CFLAGS="$CFLAGS -belf"
165 ;;
bd4a69c3 166esac
1daed53f
ILT
167
168# Actually configure libtool. ac_aux_dir is where install-sh is found.
169CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
788e3f91 170LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
1daed53f
ILT
171${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
172$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
173|| AC_MSG_ERROR([libtool configure failed])
174])
175
bd4a69c3
ILT
176# AM_ENABLE_SHARED - implement the --enable-shared flag
177# Usage: AM_ENABLE_SHARED[(DEFAULT)]
178# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
179# `yes'.
180AC_DEFUN(AM_ENABLE_SHARED,
181[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
182AC_ARG_ENABLE(shared,
183changequote(<<, >>)dnl
184<< --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
185changequote([, ])dnl
186[ --enable-shared=PKGS only build shared libraries if the current package
187 appears as an element in the PKGS list],
188[p=${PACKAGE-default}
189case "$enableval" in
190yes) enable_shared=yes ;;
191no) enable_shared=no ;;
192*)
193 enable_shared=no
194 # Look at the argument we got. We use all the common list separators.
195 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
196 for pkg in $enableval; do
197 if test "X$pkg" = "X$p"; then
198 enable_shared=yes
199 fi
200 done
201 IFS="$ac_save_ifs"
202 ;;
203esac],
204enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
205])
206
207# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
208AC_DEFUN(AM_DISABLE_SHARED,
209[AM_ENABLE_SHARED(no)])
210
211# AM_DISABLE_STATIC - set the default static flag to --disable-static
212AC_DEFUN(AM_DISABLE_STATIC,
213[AM_ENABLE_STATIC(no)])
214
215# AM_ENABLE_STATIC - implement the --enable-static flag
216# Usage: AM_ENABLE_STATIC[(DEFAULT)]
217# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
218# `yes'.
219AC_DEFUN(AM_ENABLE_STATIC,
220[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
221AC_ARG_ENABLE(static,
222changequote(<<, >>)dnl
223<< --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
224changequote([, ])dnl
225[ --enable-static=PKGS only build shared libraries if the current package
226 appears as an element in the PKGS list],
227[p=${PACKAGE-default}
228case "$enableval" in
229yes) enable_static=yes ;;
230no) enable_static=no ;;
231*)
232 enable_static=no
233 # Look at the argument we got. We use all the common list separators.
234 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
235 for pkg in $enableval; do
236 if test "X$pkg" = "X$p"; then
237 enable_static=yes
238 fi
239 done
240 IFS="$ac_save_ifs"
241 ;;
242esac],
243enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
244])
245
246
1daed53f
ILT
247# AM_PROG_LD - find the path to the GNU or non-GNU linker
248AC_DEFUN(AM_PROG_LD,
249[AC_ARG_WITH(gnu-ld,
250[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
251test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
788e3f91
ILT
252AC_REQUIRE([AC_PROG_CC])
253ac_prog=ld
254if test "$ac_cv_prog_gcc" = yes; then
255 # Check if gcc -print-prog-name=ld gives a path.
256 AC_MSG_CHECKING([for ld used by GCC])
257 ac_prog=`($CC -print-prog-name=ld) 2>&5`
258 case "$ac_prog" in
259 # Accept absolute paths.
bd4a69c3 260 /* | [A-Za-z]:\\*)
788e3f91
ILT
261 test -z "$LD" && LD="$ac_prog"
262 ;;
263 "")
264 # If it fails, then pretend we aren't using GCC.
265 ac_prog=ld
266 ;;
267 *)
268 # If it is relative, then search for the first ld in PATH.
269 with_gnu_ld=unknown
270 ;;
271 esac
272elif test "$with_gnu_ld" = yes; then
1daed53f
ILT
273 AC_MSG_CHECKING([for GNU ld])
274else
275 AC_MSG_CHECKING([for non-GNU ld])
276fi
277AC_CACHE_VAL(ac_cv_path_LD,
788e3f91 278[if test -z "$LD"; then
1daed53f
ILT
279 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
280 for ac_dir in $PATH; do
281 test -z "$ac_dir" && ac_dir=.
788e3f91
ILT
282 if test -f "$ac_dir/$ac_prog"; then
283 ac_cv_path_LD="$ac_dir/$ac_prog"
1daed53f
ILT
284 # Check to see if the program is GNU ld. I'd rather use --version,
285 # but apparently some GNU ld's only accept -v.
286 # Break only if it was the GNU/non-GNU ld that we prefer.
788e3f91
ILT
287 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
288 test "$with_gnu_ld" != no && break
1daed53f
ILT
289 else
290 test "$with_gnu_ld" != yes && break
291 fi
292 fi
293 done
294 IFS="$ac_save_ifs"
788e3f91 295else
3b1e6264 296 ac_cv_path_LD="$LD" # Let the user override the test with a path.
788e3f91 297fi])
1daed53f
ILT
298LD="$ac_cv_path_LD"
299if test -n "$LD"; then
300 AC_MSG_RESULT($LD)
301else
302 AC_MSG_RESULT(no)
303fi
304test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
305AC_SUBST(LD)
306AM_PROG_LD_GNU
307])
308
309AC_DEFUN(AM_PROG_LD_GNU,
788e3f91 310[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
1daed53f 311[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
788e3f91 312if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1daed53f 313 ac_cv_prog_gnu_ld=yes
9b65d522 314else
1daed53f
ILT
315 ac_cv_prog_gnu_ld=no
316fi])
317])
318
788e3f91
ILT
319# AM_PROG_NM - find the path to a BSD-compatible name lister
320AC_DEFUN(AM_PROG_NM,
321[AC_MSG_CHECKING([for BSD-compatible nm])
322AC_CACHE_VAL(ac_cv_path_NM,
323[case "$NM" in
bd4a69c3 324/* | [A-Za-z]:\\*)
788e3f91
ILT
325 ac_cv_path_NM="$NM" # Let the user override the test with a path.
326 ;;
327*)
328 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
329 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
bd4a69c3 330 test -z "$ac_dir" && ac_dir=.
788e3f91
ILT
331 if test -f $ac_dir/nm; then
332 # Check to see if the nm accepts a BSD-compat flag.
bd4a69c3 333 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
788e3f91 334 # nm: unknown option "B" ignored
bd4a69c3 335 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
788e3f91 336 ac_cv_path_NM="$ac_dir/nm -B"
bd4a69c3 337 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
788e3f91
ILT
338 ac_cv_path_NM="$ac_dir/nm -p"
339 else
340 ac_cv_path_NM="$ac_dir/nm"
341 fi
342 break
343 fi
344 done
345 IFS="$ac_save_ifs"
346 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
347 ;;
348esac])
349NM="$ac_cv_path_NM"
350AC_MSG_RESULT([$NM])
351AC_SUBST(NM)
352])
353
1daed53f
ILT
354# Like AC_CONFIG_HEADER, but automatically create stamp file.
355
356AC_DEFUN(AM_CONFIG_HEADER,
357[AC_PREREQ([2.12])
358AC_CONFIG_HEADER([$1])
359dnl When config.status generates a header, we must update the stamp-h file.
360dnl This file resides in the same directory as the config header
361dnl that is generated. We must strip everything past the first ":",
362dnl and everything past the last "/".
363AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
364ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
365<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
366<<am_indx=1
367for am_file in <<$1>>; do
368 case " <<$>>CONFIG_HEADERS " in
369 *" <<$>>am_file "*<<)>>
370 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
371 ;;
372 esac
373 am_indx=`expr "<<$>>am_indx" + 1`
374done<<>>dnl>>)
375changequote([,]))])
376
072aa625
NC
377# This file is derived from `gettext.m4'. The difference is that the
378# included macros assume Cygnus-style source and build trees.
379
380# Macro to add for using GNU gettext.
381# Ulrich Drepper <drepper@cygnus.com>, 1995.
382#
383# This file file be copied and used freely without restrictions. It can
384# be used in projects which are not available under the GNU Public License
385# but which still want to provide support for the GNU gettext functionality.
386# Please note that the actual code is *not* freely available.
387
388# serial 3
389
390AC_DEFUN(CY_WITH_NLS,
391 [AC_MSG_CHECKING([whether NLS is requested])
392 dnl Default is enabled NLS
393 AC_ARG_ENABLE(nls,
394 [ --disable-nls do not use Native Language Support],
395 USE_NLS=$enableval, USE_NLS=yes)
396 AC_MSG_RESULT($USE_NLS)
397 AC_SUBST(USE_NLS)
398
399 USE_INCLUDED_LIBINTL=no
400
401 dnl If we use NLS figure out what method
402 if test "$USE_NLS" = "yes"; then
403 AC_DEFINE(ENABLE_NLS)
404 AC_MSG_CHECKING([whether included gettext is requested])
405 AC_ARG_WITH(included-gettext,
406 [ --with-included-gettext use the GNU gettext library included here],
407 nls_cv_force_use_gnu_gettext=$withval,
408 nls_cv_force_use_gnu_gettext=no)
409 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
410
411 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
412 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
413 dnl User does not insist on using GNU NLS library. Figure out what
414 dnl to use. If gettext or catgets are available (in this order) we
415 dnl use this. Else we have to fall back to GNU NLS library.
416 dnl catgets is only used if permitted by option --with-catgets.
417 nls_cv_header_intl=
418 nls_cv_header_libgt=
419 CATOBJEXT=NONE
420
421 AC_CHECK_HEADER(libintl.h,
422 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
423 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
424 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
425
426 if test "$gt_cv_func_gettext_libc" != "yes"; then
427 AC_CHECK_LIB(intl, bindtextdomain,
428 [AC_CACHE_CHECK([for gettext in libintl],
429 gt_cv_func_gettext_libintl,
430 [AC_TRY_LINK([], [return (int) gettext ("")],
431 gt_cv_func_gettext_libintl=yes,
432 gt_cv_func_gettext_libintl=no)])])
433 fi
434
435 if test "$gt_cv_func_gettext_libc" = "yes" \
436 || test "$gt_cv_func_gettext_libintl" = "yes"; then
437 AC_DEFINE(HAVE_GETTEXT)
438 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
439 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
440 if test "$MSGFMT" != "no"; then
441 AC_CHECK_FUNCS(dcgettext)
442 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
443 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
444 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
445 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
446 return _nl_msg_cat_cntr],
447 [CATOBJEXT=.gmo
448 DATADIRNAME=share],
449 [CATOBJEXT=.mo
450 DATADIRNAME=lib])
451 INSTOBJEXT=.mo
452 fi
453 fi
454 ])
455
456 dnl In the standard gettext, we would now check for catgets.
457 dnl However, we never want to use catgets for our releases.
458
459 if test "$CATOBJEXT" = "NONE"; then
460 dnl Neither gettext nor catgets in included in the C library.
461 dnl Fall back on GNU gettext library.
462 nls_cv_use_gnu_gettext=yes
463 fi
464 fi
465
466 if test "$nls_cv_use_gnu_gettext" = "yes"; then
467 dnl Mark actions used to generate GNU NLS library.
468 INTLOBJS="\$(GETTOBJS)"
469 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
470 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
471 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
472 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
473 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
474 AC_SUBST(MSGFMT)
475 USE_INCLUDED_LIBINTL=yes
476 CATOBJEXT=.gmo
477 INSTOBJEXT=.mo
478 DATADIRNAME=share
479 INTLDEPS='$(top_builddir)/../intl/libintl.a'
480 INTLLIBS=$INTLDEPS
481 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
482 nls_cv_header_intl=libintl.h
483 nls_cv_header_libgt=libgettext.h
484 fi
485
486 dnl Test whether we really found GNU xgettext.
487 if test "$XGETTEXT" != ":"; then
488 dnl If it is no GNU xgettext we define it as : so that the
489 dnl Makefiles still can work.
490 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
491 : ;
492 else
493 AC_MSG_RESULT(
494 [found xgettext programs is not GNU xgettext; ignore it])
495 XGETTEXT=":"
496 fi
497 fi
498
499 # We need to process the po/ directory.
500 POSUB=po
501 else
502 DATADIRNAME=share
503 nls_cv_header_intl=libintl.h
504 nls_cv_header_libgt=libgettext.h
505 fi
506
507 # If this is used in GNU gettext we have to set USE_NLS to `yes'
508 # because some of the sources are only built for this goal.
509 if test "$PACKAGE" = gettext; then
510 USE_NLS=yes
511 USE_INCLUDED_LIBINTL=yes
512 fi
513
514 dnl These rules are solely for the distribution goal. While doing this
515 dnl we only have to keep exactly one list of the available catalogs
516 dnl in configure.in.
517 for lang in $ALL_LINGUAS; do
518 GMOFILES="$GMOFILES $lang.gmo"
519 POFILES="$POFILES $lang.po"
520 done
521
522 dnl Make all variables we use known to autoconf.
523 AC_SUBST(USE_INCLUDED_LIBINTL)
524 AC_SUBST(CATALOGS)
525 AC_SUBST(CATOBJEXT)
526 AC_SUBST(DATADIRNAME)
527 AC_SUBST(GMOFILES)
528 AC_SUBST(INSTOBJEXT)
529 AC_SUBST(INTLDEPS)
530 AC_SUBST(INTLLIBS)
531 AC_SUBST(INTLOBJS)
532 AC_SUBST(POFILES)
533 AC_SUBST(POSUB)
534 ])
535
536AC_DEFUN(CY_GNU_GETTEXT,
537 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
538 AC_REQUIRE([AC_PROG_CC])dnl
539 AC_REQUIRE([AC_PROG_RANLIB])dnl
540 AC_REQUIRE([AC_ISC_POSIX])dnl
541 AC_REQUIRE([AC_HEADER_STDC])dnl
542 AC_REQUIRE([AC_C_CONST])dnl
543 AC_REQUIRE([AC_C_INLINE])dnl
544 AC_REQUIRE([AC_TYPE_OFF_T])dnl
545 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
546 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
547 AC_REQUIRE([AC_FUNC_MMAP])dnl
548
549 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
550unistd.h values.h sys/param.h])
551 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
552__argz_count __argz_stringify __argz_next])
553
554 if test "${ac_cv_func_stpcpy+set}" != "set"; then
555 AC_CHECK_FUNCS(stpcpy)
556 fi
557 if test "${ac_cv_func_stpcpy}" = "yes"; then
558 AC_DEFINE(HAVE_STPCPY)
559 fi
560
561 AM_LC_MESSAGES
562 CY_WITH_NLS
563
564 if test "x$CATOBJEXT" != "x"; then
565 if test "x$ALL_LINGUAS" = "x"; then
566 LINGUAS=
567 else
568 AC_MSG_CHECKING(for catalogs to be installed)
569 NEW_LINGUAS=
570 for lang in ${LINGUAS=$ALL_LINGUAS}; do
571 case "$ALL_LINGUAS" in
572 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
573 esac
574 done
575 LINGUAS=$NEW_LINGUAS
576 AC_MSG_RESULT($LINGUAS)
577 fi
578
579 dnl Construct list of names of catalog files to be constructed.
580 if test -n "$LINGUAS"; then
581 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
582 fi
583 fi
584
585 dnl The reference to <locale.h> in the installed <libintl.h> file
586 dnl must be resolved because we cannot expect the users of this
587 dnl to define HAVE_LOCALE_H.
588 if test $ac_cv_header_locale_h = yes; then
589 INCLUDE_LOCALE_H="#include <locale.h>"
590 else
591 INCLUDE_LOCALE_H="\
592/* The system does not provide the header <locale.h>. Take care yourself. */"
593 fi
594 AC_SUBST(INCLUDE_LOCALE_H)
595
596 dnl Determine which catalog format we have (if any is needed)
597 dnl For now we know about two different formats:
598 dnl Linux libc-5 and the normal X/Open format
599 if test -f $srcdir/po2tbl.sed.in; then
600 if test "$CATOBJEXT" = ".cat"; then
601 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
602
603 dnl Transform the SED scripts while copying because some dumb SEDs
604 dnl cannot handle comments.
605 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
606 fi
607 dnl po2tbl.sed is always needed.
608 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
609 $srcdir/po2tbl.sed.in > po2tbl.sed
610 fi
611
612 dnl In the intl/Makefile.in we have a special dependency which makes
613 dnl only sense for gettext. We comment this out for non-gettext
614 dnl packages.
615 if test "$PACKAGE" = "gettext"; then
616 GT_NO="#NO#"
617 GT_YES=
618 else
619 GT_NO=
620 GT_YES="#YES#"
621 fi
622 AC_SUBST(GT_NO)
623 AC_SUBST(GT_YES)
624
625 MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
626 AC_SUBST(MKINSTALLDIRS)
627
628 dnl *** For now the libtool support in intl/Makefile is not for real.
629 l=
630 AC_SUBST(l)
631
632 dnl Generate list of files to be processed by xgettext which will
633 dnl be included in po/Makefile. But only do this if the po directory
634 dnl exists in srcdir.
635 if test -d $srcdir/po; then
636 test -d po || mkdir po
637 if test "x$srcdir" != "x."; then
638 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
639 posrcprefix="$srcdir/"
640 else
641 posrcprefix="../$srcdir/"
642 fi
643 else
644 posrcprefix="../"
645 fi
646 rm -f po/POTFILES
647 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
648 < $srcdir/po/POTFILES.in > po/POTFILES
649 fi
650 ])
651
652# Search path for a program which passes the given test.
653# Ulrich Drepper <drepper@cygnus.com>, 1996.
654#
655# This file file be copied and used freely without restrictions. It can
656# be used in projects which are not available under the GNU Public License
657# but which still want to provide support for the GNU gettext functionality.
658# Please note that the actual code is *not* freely available.
659
660# serial 1
661
662dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
663dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
664AC_DEFUN(AM_PATH_PROG_WITH_TEST,
665[# Extract the first word of "$2", so it can be a program name with args.
666set dummy $2; ac_word=[$]2
667AC_MSG_CHECKING([for $ac_word])
668AC_CACHE_VAL(ac_cv_path_$1,
669[case "[$]$1" in
670 /*)
671 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
672 ;;
673 *)
674 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
675 for ac_dir in ifelse([$5], , $PATH, [$5]); do
676 test -z "$ac_dir" && ac_dir=.
677 if test -f $ac_dir/$ac_word; then
678 if [$3]; then
679 ac_cv_path_$1="$ac_dir/$ac_word"
680 break
681 fi
682 fi
683 done
684 IFS="$ac_save_ifs"
685dnl If no 4th arg is given, leave the cache variable unset,
686dnl so AC_PATH_PROGS will keep looking.
687ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
688])dnl
689 ;;
690esac])dnl
691$1="$ac_cv_path_$1"
692if test -n "[$]$1"; then
693 AC_MSG_RESULT([$]$1)
694else
695 AC_MSG_RESULT(no)
696fi
697AC_SUBST($1)dnl
698])
699
700# Check whether LC_MESSAGES is available in <locale.h>.
701# Ulrich Drepper <drepper@cygnus.com>, 1995.
702#
703# This file file be copied and used freely without restrictions. It can
704# be used in projects which are not available under the GNU Public License
705# but which still want to provide support for the GNU gettext functionality.
706# Please note that the actual code is *not* freely available.
707
708# serial 1
709
710AC_DEFUN(AM_LC_MESSAGES,
711 [if test $ac_cv_header_locale_h = yes; then
712 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
713 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
714 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
715 if test $am_cv_val_LC_MESSAGES = yes; then
716 AC_DEFINE(HAVE_LC_MESSAGES)
717 fi
718 fi])
719
1daed53f
ILT
720# Add --enable-maintainer-mode option to configure.
721# From Jim Meyering
722
723# serial 1
724
725AC_DEFUN(AM_MAINTAINER_MODE,
726[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
727 dnl maintainer-mode is disabled by default
728 AC_ARG_ENABLE(maintainer-mode,
729[ --enable-maintainer-mode enable make rules and dependencies not useful
730 (and sometimes confusing) to the casual installer],
731 USE_MAINTAINER_MODE=$enableval,
732 USE_MAINTAINER_MODE=no)
733 AC_MSG_RESULT($USE_MAINTAINER_MODE)
734 if test $USE_MAINTAINER_MODE = yes; then
735 MAINT=
736 else
737 MAINT='#M#'
738 fi
739 AC_SUBST(MAINT)dnl
740]
741)
742
743# Check to see if we're running under Cygwin32, without using
744# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
745# Otherwise set it to "no".
746
747dnl AM_CYGWIN32()
1daed53f
ILT
748AC_DEFUN(AM_CYGWIN32,
749[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
3b1e6264 750[AC_TRY_COMPILE(,[return __CYGWIN32__;],
1daed53f
ILT
751am_cv_cygwin32=yes, am_cv_cygwin32=no)
752rm -f conftest*])
753CYGWIN32=
754test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
755
756# Check to see if we're running under Win32, without using
757# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
758# Otherwise set it to "".
759
760dnl AM_EXEEXT()
761dnl This knows we add .exe if we're building in the Cygwin32
762dnl environment. But if we're not, then it compiles a test program
763dnl to see if there is a suffix for executables.
764AC_DEFUN(AM_EXEEXT,
3b1e6264
ILT
765[AC_REQUIRE([AM_CYGWIN32])
766AC_REQUIRE([AM_MINGW32])
1daed53f 767AC_MSG_CHECKING([for executable suffix])
bd4a69c3
ILT
768AC_CACHE_VAL(am_cv_exeext,
769[if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
1daed53f
ILT
770am_cv_exeext=.exe
771else
772cat > am_c_test.c << 'EOF'
773int main() {
774/* Nothing needed here */
775}
776EOF
777${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
072aa625
NC
778am_cv_exeext=
779for file in am_c_test.*; do
780 case $file in
781 *.c) ;;
782 *.o) ;;
783 *) am_cv_exeext=`echo $file | sed -e s/am_c_test//` ;;
784 esac
785done
1daed53f
ILT
786rm -f am_c_test*])
787test x"${am_cv_exeext}" = x && am_cv_exeext=no
788fi
789EXEEXT=""
790test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
791AC_MSG_RESULT(${am_cv_exeext})
792AC_SUBST(EXEEXT)])
793
3b1e6264
ILT
794# Check to see if we're running under Mingw, without using
795# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
796# Otherwise set it to "no".
797
798dnl AM_MINGW32()
799AC_DEFUN(AM_MINGW32,
800[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
801[AC_TRY_COMPILE(,[return __MINGW32__;],
802am_cv_mingw32=yes, am_cv_mingw32=no)
803rm -f conftest*])
804MINGW32=
805test "$am_cv_mingw32" = yes && MINGW32=yes])
806
This page took 0.142622 seconds and 4 git commands to generate.