]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gprof/aclocal.m4
Increase minor version number (to 2.10.91) to help tools detect the new
[thirdparty/binutils-gdb.git] / gprof / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 sinclude(../libtool.m4)
14 dnl The lines below arrange for aclocal not to bring libtool.m4
15 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
16 dnl to add a definition of LIBTOOL to Makefile.in.
17 ifelse(yes,no,[
18 AC_DEFUN([AM_PROG_LIBTOOL],)
19 AC_SUBST(LIBTOOL)
20 ])
21
22 sinclude(../gettext.m4)
23 ifelse(yes,no,[
24 AC_DEFUN([CY_WITH_NLS],)
25 AC_SUBST(INTLLIBS)
26 ])
27
28 # Do all the work for Automake. This macro actually does too much --
29 # some checks are only needed if your package does certain things.
30 # But this isn't really a big deal.
31
32 # serial 1
33
34 dnl Usage:
35 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
36
37 AC_DEFUN(AM_INIT_AUTOMAKE,
38 [AC_REQUIRE([AC_PROG_INSTALL])
39 PACKAGE=[$1]
40 AC_SUBST(PACKAGE)
41 VERSION=[$2]
42 AC_SUBST(VERSION)
43 dnl test to see if srcdir already configured
44 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
45 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
46 fi
47 ifelse([$3],,
48 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
49 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
50 AC_REQUIRE([AM_SANITY_CHECK])
51 AC_REQUIRE([AC_ARG_PROGRAM])
52 dnl FIXME This is truly gross.
53 missing_dir=`cd $ac_aux_dir && pwd`
54 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
55 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
56 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
57 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
58 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
59 AC_REQUIRE([AC_PROG_MAKE_SET])])
60
61 #
62 # Check to make sure that the build environment is sane.
63 #
64
65 AC_DEFUN(AM_SANITY_CHECK,
66 [AC_MSG_CHECKING([whether build environment is sane])
67 # Just in case
68 sleep 1
69 echo timestamp > conftestfile
70 # Do `set' in a subshell so we don't clobber the current shell's
71 # arguments. Must try -L first in case configure is actually a
72 # symlink; some systems play weird games with the mod time of symlinks
73 # (eg FreeBSD returns the mod time of the symlink's containing
74 # directory).
75 if (
76 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
77 if test "[$]*" = "X"; then
78 # -L didn't work.
79 set X `ls -t $srcdir/configure conftestfile`
80 fi
81 if test "[$]*" != "X $srcdir/configure conftestfile" \
82 && test "[$]*" != "X conftestfile $srcdir/configure"; then
83
84 # If neither matched, then we have a broken ls. This can happen
85 # if, for instance, CONFIG_SHELL is bash and it inherits a
86 # broken ls alias from the environment. This has actually
87 # happened. Such a system could not be considered "sane".
88 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
89 alias in your environment])
90 fi
91
92 test "[$]2" = conftestfile
93 )
94 then
95 # Ok.
96 :
97 else
98 AC_MSG_ERROR([newly created file is older than distributed files!
99 Check your system clock])
100 fi
101 rm -f conftest*
102 AC_MSG_RESULT(yes)])
103
104 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
105 dnl The program must properly implement --version.
106 AC_DEFUN(AM_MISSING_PROG,
107 [AC_MSG_CHECKING(for working $2)
108 # Run test in a subshell; some versions of sh will print an error if
109 # an executable is not found, even if stderr is redirected.
110 # Redirect stdin to placate older versions of autoconf. Sigh.
111 if ($2 --version) < /dev/null > /dev/null 2>&1; then
112 $1=$2
113 AC_MSG_RESULT(found)
114 else
115 $1="$3/missing $2"
116 AC_MSG_RESULT(missing)
117 fi
118 AC_SUBST($1)])
119
120 # Like AC_CONFIG_HEADER, but automatically create stamp file.
121
122 AC_DEFUN(AM_CONFIG_HEADER,
123 [AC_PREREQ([2.12])
124 AC_CONFIG_HEADER([$1])
125 dnl When config.status generates a header, we must update the stamp-h file.
126 dnl This file resides in the same directory as the config header
127 dnl that is generated. We must strip everything past the first ":",
128 dnl and everything past the last "/".
129 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
130 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
131 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
132 <<am_indx=1
133 for am_file in <<$1>>; do
134 case " <<$>>CONFIG_HEADERS " in
135 *" <<$>>am_file "*<<)>>
136 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
137 ;;
138 esac
139 am_indx=`expr "<<$>>am_indx" + 1`
140 done<<>>dnl>>)
141 changequote([,]))])
142
143 # This file is derived from `gettext.m4'. The difference is that the
144 # included macros assume Cygnus-style source and build trees.
145
146 # Macro to add for using GNU gettext.
147 # Ulrich Drepper <drepper@cygnus.com>, 1995.
148 #
149 # This file file be copied and used freely without restrictions. It can
150 # be used in projects which are not available under the GNU Public License
151 # but which still want to provide support for the GNU gettext functionality.
152 # Please note that the actual code is *not* freely available.
153
154 # serial 3
155
156 AC_DEFUN(CY_WITH_NLS,
157 [AC_MSG_CHECKING([whether NLS is requested])
158 dnl Default is enabled NLS
159 AC_ARG_ENABLE(nls,
160 [ --disable-nls do not use Native Language Support],
161 USE_NLS=$enableval, USE_NLS=yes)
162 AC_MSG_RESULT($USE_NLS)
163 AC_SUBST(USE_NLS)
164
165 USE_INCLUDED_LIBINTL=no
166
167 dnl If we use NLS figure out what method
168 if test "$USE_NLS" = "yes"; then
169 AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
170 AC_MSG_CHECKING([whether included gettext is requested])
171 AC_ARG_WITH(included-gettext,
172 [ --with-included-gettext use the GNU gettext library included here],
173 nls_cv_force_use_gnu_gettext=$withval,
174 nls_cv_force_use_gnu_gettext=no)
175 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
176
177 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
178 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
179 dnl User does not insist on using GNU NLS library. Figure out what
180 dnl to use. If gettext or catgets are available (in this order) we
181 dnl use this. Else we have to fall back to GNU NLS library.
182 dnl catgets is only used if permitted by option --with-catgets.
183 nls_cv_header_intl=
184 nls_cv_header_libgt=
185 CATOBJEXT=NONE
186
187 AC_CHECK_HEADER(libintl.h,
188 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
189 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
190 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
191
192 if test "$gt_cv_func_gettext_libc" != "yes"; then
193 AC_CHECK_LIB(intl, bindtextdomain,
194 [AC_CACHE_CHECK([for gettext in libintl],
195 gt_cv_func_gettext_libintl,
196 [AC_TRY_LINK([], [return (int) gettext ("")],
197 gt_cv_func_gettext_libintl=yes,
198 gt_cv_func_gettext_libintl=no)])])
199 fi
200
201 if test "$gt_cv_func_gettext_libc" = "yes" \
202 || test "$gt_cv_func_gettext_libintl" = "yes"; then
203 AC_DEFINE(HAVE_GETTEXT, 1,
204 [Define as 1 if you have gettext and don't want to use GNU gettext.])
205 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
206 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
207 if test "$MSGFMT" != "no"; then
208 AC_CHECK_FUNCS(dcgettext)
209 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
210 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
211 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
212 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
213 return _nl_msg_cat_cntr],
214 [CATOBJEXT=.gmo
215 DATADIRNAME=share],
216 [CATOBJEXT=.mo
217 DATADIRNAME=lib])
218 INSTOBJEXT=.mo
219 fi
220 fi
221 ])
222
223 dnl In the standard gettext, we would now check for catgets.
224 dnl However, we never want to use catgets for our releases.
225
226 if test "$CATOBJEXT" = "NONE"; then
227 dnl Neither gettext nor catgets in included in the C library.
228 dnl Fall back on GNU gettext library.
229 nls_cv_use_gnu_gettext=yes
230 fi
231 fi
232
233 if test "$nls_cv_use_gnu_gettext" = "yes"; then
234 dnl Mark actions used to generate GNU NLS library.
235 INTLOBJS="\$(GETTOBJS)"
236 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
237 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
238 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
239 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
240 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
241 AC_SUBST(MSGFMT)
242 USE_INCLUDED_LIBINTL=yes
243 CATOBJEXT=.gmo
244 INSTOBJEXT=.mo
245 DATADIRNAME=share
246 INTLDEPS='$(top_builddir)/../intl/libintl.a'
247 INTLLIBS=$INTLDEPS
248 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
249 nls_cv_header_intl=libintl.h
250 nls_cv_header_libgt=libgettext.h
251 fi
252
253 dnl Test whether we really found GNU xgettext.
254 if test "$XGETTEXT" != ":"; then
255 dnl If it is no GNU xgettext we define it as : so that the
256 dnl Makefiles still can work.
257 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
258 : ;
259 else
260 AC_MSG_RESULT(
261 [found xgettext programs is not GNU xgettext; ignore it])
262 XGETTEXT=":"
263 fi
264 fi
265
266 # We need to process the po/ directory.
267 POSUB=po
268 else
269 DATADIRNAME=share
270 nls_cv_header_intl=libintl.h
271 nls_cv_header_libgt=libgettext.h
272 fi
273
274 # If this is used in GNU gettext we have to set USE_NLS to `yes'
275 # because some of the sources are only built for this goal.
276 if test "$PACKAGE" = gettext; then
277 USE_NLS=yes
278 USE_INCLUDED_LIBINTL=yes
279 fi
280
281 dnl These rules are solely for the distribution goal. While doing this
282 dnl we only have to keep exactly one list of the available catalogs
283 dnl in configure.in.
284 for lang in $ALL_LINGUAS; do
285 GMOFILES="$GMOFILES $lang.gmo"
286 POFILES="$POFILES $lang.po"
287 done
288
289 dnl Make all variables we use known to autoconf.
290 AC_SUBST(USE_INCLUDED_LIBINTL)
291 AC_SUBST(CATALOGS)
292 AC_SUBST(CATOBJEXT)
293 AC_SUBST(DATADIRNAME)
294 AC_SUBST(GMOFILES)
295 AC_SUBST(INSTOBJEXT)
296 AC_SUBST(INTLDEPS)
297 AC_SUBST(INTLLIBS)
298 AC_SUBST(INTLOBJS)
299 AC_SUBST(POFILES)
300 AC_SUBST(POSUB)
301 ])
302
303 AC_DEFUN(CY_GNU_GETTEXT,
304 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
305 AC_REQUIRE([AC_PROG_CC])dnl
306 AC_REQUIRE([AC_PROG_RANLIB])dnl
307 AC_REQUIRE([AC_ISC_POSIX])dnl
308 AC_REQUIRE([AC_HEADER_STDC])dnl
309 AC_REQUIRE([AC_C_CONST])dnl
310 AC_REQUIRE([AC_C_INLINE])dnl
311 AC_REQUIRE([AC_TYPE_OFF_T])dnl
312 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
313 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
314 AC_REQUIRE([AC_FUNC_MMAP])dnl
315
316 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
317 unistd.h values.h sys/param.h])
318 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
319 __argz_count __argz_stringify __argz_next])
320
321 if test "${ac_cv_func_stpcpy+set}" != "set"; then
322 AC_CHECK_FUNCS(stpcpy)
323 fi
324 if test "${ac_cv_func_stpcpy}" = "yes"; then
325 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
326 fi
327
328 AM_LC_MESSAGES
329 CY_WITH_NLS
330
331 if test "x$CATOBJEXT" != "x"; then
332 if test "x$ALL_LINGUAS" = "x"; then
333 LINGUAS=
334 else
335 AC_MSG_CHECKING(for catalogs to be installed)
336 NEW_LINGUAS=
337 for lang in ${LINGUAS=$ALL_LINGUAS}; do
338 case "$ALL_LINGUAS" in
339 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
340 esac
341 done
342 LINGUAS=$NEW_LINGUAS
343 AC_MSG_RESULT($LINGUAS)
344 fi
345
346 dnl Construct list of names of catalog files to be constructed.
347 if test -n "$LINGUAS"; then
348 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
349 fi
350 fi
351
352 dnl The reference to <locale.h> in the installed <libintl.h> file
353 dnl must be resolved because we cannot expect the users of this
354 dnl to define HAVE_LOCALE_H.
355 if test $ac_cv_header_locale_h = yes; then
356 INCLUDE_LOCALE_H="#include <locale.h>"
357 else
358 INCLUDE_LOCALE_H="\
359 /* The system does not provide the header <locale.h>. Take care yourself. */"
360 fi
361 AC_SUBST(INCLUDE_LOCALE_H)
362
363 dnl Determine which catalog format we have (if any is needed)
364 dnl For now we know about two different formats:
365 dnl Linux libc-5 and the normal X/Open format
366 if test -f $srcdir/po2tbl.sed.in; then
367 if test "$CATOBJEXT" = ".cat"; then
368 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
369
370 dnl Transform the SED scripts while copying because some dumb SEDs
371 dnl cannot handle comments.
372 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
373 fi
374 dnl po2tbl.sed is always needed.
375 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
376 $srcdir/po2tbl.sed.in > po2tbl.sed
377 fi
378
379 dnl In the intl/Makefile.in we have a special dependency which makes
380 dnl only sense for gettext. We comment this out for non-gettext
381 dnl packages.
382 if test "$PACKAGE" = "gettext"; then
383 GT_NO="#NO#"
384 GT_YES=
385 else
386 GT_NO=
387 GT_YES="#YES#"
388 fi
389 AC_SUBST(GT_NO)
390 AC_SUBST(GT_YES)
391
392 MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
393 AC_SUBST(MKINSTALLDIRS)
394
395 dnl *** For now the libtool support in intl/Makefile is not for real.
396 l=
397 AC_SUBST(l)
398
399 dnl Generate list of files to be processed by xgettext which will
400 dnl be included in po/Makefile. But only do this if the po directory
401 dnl exists in srcdir.
402 if test -d $srcdir/po; then
403 test -d po || mkdir po
404 if test "x$srcdir" != "x."; then
405 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
406 posrcprefix="$srcdir/"
407 else
408 posrcprefix="../$srcdir/"
409 fi
410 else
411 posrcprefix="../"
412 fi
413 rm -f po/POTFILES
414 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
415 < $srcdir/po/POTFILES.in > po/POTFILES
416 fi
417 ])
418
419 # Search path for a program which passes the given test.
420 # Ulrich Drepper <drepper@cygnus.com>, 1996.
421 #
422 # This file file be copied and used freely without restrictions. It can
423 # be used in projects which are not available under the GNU Public License
424 # but which still want to provide support for the GNU gettext functionality.
425 # Please note that the actual code is *not* freely available.
426
427 # serial 1
428
429 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
430 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
431 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
432 [# Extract the first word of "$2", so it can be a program name with args.
433 set dummy $2; ac_word=[$]2
434 AC_MSG_CHECKING([for $ac_word])
435 AC_CACHE_VAL(ac_cv_path_$1,
436 [case "[$]$1" in
437 /*)
438 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
439 ;;
440 *)
441 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
442 for ac_dir in ifelse([$5], , $PATH, [$5]); do
443 test -z "$ac_dir" && ac_dir=.
444 if test -f $ac_dir/$ac_word; then
445 if [$3]; then
446 ac_cv_path_$1="$ac_dir/$ac_word"
447 break
448 fi
449 fi
450 done
451 IFS="$ac_save_ifs"
452 dnl If no 4th arg is given, leave the cache variable unset,
453 dnl so AC_PATH_PROGS will keep looking.
454 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
455 ])dnl
456 ;;
457 esac])dnl
458 $1="$ac_cv_path_$1"
459 if test -n "[$]$1"; then
460 AC_MSG_RESULT([$]$1)
461 else
462 AC_MSG_RESULT(no)
463 fi
464 AC_SUBST($1)dnl
465 ])
466
467 # Check whether LC_MESSAGES is available in <locale.h>.
468 # Ulrich Drepper <drepper@cygnus.com>, 1995.
469 #
470 # This file file be copied and used freely without restrictions. It can
471 # be used in projects which are not available under the GNU Public License
472 # but which still want to provide support for the GNU gettext functionality.
473 # Please note that the actual code is *not* freely available.
474
475 # serial 1
476
477 AC_DEFUN(AM_LC_MESSAGES,
478 [if test $ac_cv_header_locale_h = yes; then
479 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
480 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
481 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
482 if test $am_cv_val_LC_MESSAGES = yes; then
483 AC_DEFINE(HAVE_LC_MESSAGES, 1,
484 [Define if your locale.h file contains LC_MESSAGES.])
485 fi
486 fi])
487
488 # Add --enable-maintainer-mode option to configure.
489 # From Jim Meyering
490
491 # serial 1
492
493 AC_DEFUN(AM_MAINTAINER_MODE,
494 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
495 dnl maintainer-mode is disabled by default
496 AC_ARG_ENABLE(maintainer-mode,
497 [ --enable-maintainer-mode enable make rules and dependencies not useful
498 (and sometimes confusing) to the casual installer],
499 USE_MAINTAINER_MODE=$enableval,
500 USE_MAINTAINER_MODE=no)
501 AC_MSG_RESULT($USE_MAINTAINER_MODE)
502 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
503 MAINT=$MAINTAINER_MODE_TRUE
504 AC_SUBST(MAINT)dnl
505 ]
506 )
507
508 # Define a conditional.
509
510 AC_DEFUN(AM_CONDITIONAL,
511 [AC_SUBST($1_TRUE)
512 AC_SUBST($1_FALSE)
513 if $2; then
514 $1_TRUE=
515 $1_FALSE='#'
516 else
517 $1_TRUE='#'
518 $1_FALSE=
519 fi])
520