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