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