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