* Makefile.in: Regenerate.
[deliverable/binutils-gdb.git] / opcodes / aclocal.m4
CommitLineData
e20c0b3d 1dnl aclocal.m4 generated automatically by aclocal 1.4-p6
252b5132 2
2c73f9d8 3dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
252b5132
RH
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.
12
13sinclude(../bfd/acinclude.m4)
14
ac48eca1
AO
15dnl sinclude(../libtool.m4) already included in bfd/acinclude.m4
16dnl The lines below arrange for aclocal not to bring libtool.m4
17dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
18dnl to add a definition of LIBTOOL to Makefile.in.
19ifelse(yes,no,[
20AC_DEFUN([AM_PROG_LIBTOOL],)
21AC_DEFUN([AM_DISABLE_SHARED],)
22AC_SUBST(LIBTOOL)
23])
24
25dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4
26ifelse(yes,no,[
27AC_DEFUN([CY_WITH_NLS],)
28AC_SUBST(INTLLIBS)
29])
30
81172ff2
AM
31dnl AM_INSTALL_LIBBFD already included in bfd/acinclude.m4
32ifelse(yes,no,[
33AC_DEFUN([AM_INSTALL_LIBBFD],)
34AC_SUBST(bfdlibdir)
35AC_SUBST(bfdincludedir)
36])
37
979273e3
NN
38# lib-prefix.m4 serial 3 (gettext-0.13)
39dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
40dnl This file is free software, distributed under the terms of the GNU
41dnl General Public License. As a special exception to the GNU General
42dnl Public License, this file may be distributed as part of a program
43dnl that contains a configuration script generated by Autoconf, under
44dnl the same distribution terms as the rest of that program.
45
46dnl From Bruno Haible.
47
48dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
49dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
50dnl require excessive bracketing.
51ifdef([AC_HELP_STRING],
52[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
53[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
54
55dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
56dnl to access previously installed libraries. The basic assumption is that
57dnl a user will want packages to use other packages he previously installed
58dnl with the same --prefix option.
59dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
60dnl libraries, but is otherwise very convenient.
61AC_DEFUN([AC_LIB_PREFIX],
62[
63 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
64 AC_REQUIRE([AC_PROG_CC])
65 AC_REQUIRE([AC_CANONICAL_HOST])
66 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
67 dnl By default, look in $includedir and $libdir.
68 use_additional=yes
69 AC_LIB_WITH_FINAL_PREFIX([
70 eval additional_includedir=\"$includedir\"
71 eval additional_libdir=\"$libdir\"
72 ])
73 AC_LIB_ARG_WITH([lib-prefix],
74[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
75 --without-lib-prefix don't search for libraries in includedir and libdir],
76[
77 if test "X$withval" = "Xno"; then
78 use_additional=no
79 else
80 if test "X$withval" = "X"; then
81 AC_LIB_WITH_FINAL_PREFIX([
82 eval additional_includedir=\"$includedir\"
83 eval additional_libdir=\"$libdir\"
84 ])
85 else
86 additional_includedir="$withval/include"
87 additional_libdir="$withval/lib"
88 fi
89 fi
90])
91 if test $use_additional = yes; then
92 dnl Potentially add $additional_includedir to $CPPFLAGS.
93 dnl But don't add it
94 dnl 1. if it's the standard /usr/include,
95 dnl 2. if it's already present in $CPPFLAGS,
96 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
97 dnl 4. if it doesn't exist as a directory.
98 if test "X$additional_includedir" != "X/usr/include"; then
99 haveit=
100 for x in $CPPFLAGS; do
101 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
102 if test "X$x" = "X-I$additional_includedir"; then
103 haveit=yes
104 break
105 fi
106 done
107 if test -z "$haveit"; then
108 if test "X$additional_includedir" = "X/usr/local/include"; then
109 if test -n "$GCC"; then
110 case $host_os in
111 linux*) haveit=yes;;
112 esac
113 fi
114 fi
115 if test -z "$haveit"; then
116 if test -d "$additional_includedir"; then
117 dnl Really add $additional_includedir to $CPPFLAGS.
118 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
119 fi
120 fi
121 fi
122 fi
123 dnl Potentially add $additional_libdir to $LDFLAGS.
124 dnl But don't add it
125 dnl 1. if it's the standard /usr/lib,
126 dnl 2. if it's already present in $LDFLAGS,
127 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
128 dnl 4. if it doesn't exist as a directory.
129 if test "X$additional_libdir" != "X/usr/lib"; then
130 haveit=
131 for x in $LDFLAGS; do
132 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
133 if test "X$x" = "X-L$additional_libdir"; then
134 haveit=yes
135 break
136 fi
137 done
138 if test -z "$haveit"; then
139 if test "X$additional_libdir" = "X/usr/local/lib"; then
140 if test -n "$GCC"; then
141 case $host_os in
142 linux*) haveit=yes;;
143 esac
144 fi
145 fi
146 if test -z "$haveit"; then
147 if test -d "$additional_libdir"; then
148 dnl Really add $additional_libdir to $LDFLAGS.
149 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
150 fi
151 fi
152 fi
153 fi
154 fi
155])
156
157dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
158dnl acl_final_exec_prefix, containing the values to which $prefix and
159dnl $exec_prefix will expand at the end of the configure script.
160AC_DEFUN([AC_LIB_PREPARE_PREFIX],
161[
162 dnl Unfortunately, prefix and exec_prefix get only finally determined
163 dnl at the end of configure.
164 if test "X$prefix" = "XNONE"; then
165 acl_final_prefix="$ac_default_prefix"
166 else
167 acl_final_prefix="$prefix"
168 fi
169 if test "X$exec_prefix" = "XNONE"; then
170 acl_final_exec_prefix='${prefix}'
171 else
172 acl_final_exec_prefix="$exec_prefix"
173 fi
174 acl_save_prefix="$prefix"
175 prefix="$acl_final_prefix"
176 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
177 prefix="$acl_save_prefix"
178])
179
180dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
181dnl variables prefix and exec_prefix bound to the values they will have
182dnl at the end of the configure script.
183AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
184[
185 acl_save_prefix="$prefix"
186 prefix="$acl_final_prefix"
187 acl_save_exec_prefix="$exec_prefix"
188 exec_prefix="$acl_final_exec_prefix"
189 $1
190 exec_prefix="$acl_save_exec_prefix"
191 prefix="$acl_save_prefix"
192])
193
194# lib-link.m4 serial 4 (gettext-0.12)
195dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
196dnl This file is free software, distributed under the terms of the GNU
197dnl General Public License. As a special exception to the GNU General
198dnl Public License, this file may be distributed as part of a program
199dnl that contains a configuration script generated by Autoconf, under
200dnl the same distribution terms as the rest of that program.
201
202dnl From Bruno Haible.
203
204dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
205dnl the libraries corresponding to explicit and implicit dependencies.
206dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
207dnl augments the CPPFLAGS variable.
208AC_DEFUN([AC_LIB_LINKFLAGS],
209[
210 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
211 AC_REQUIRE([AC_LIB_RPATH])
212 define([Name],[translit([$1],[./-], [___])])
213 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
214 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
215 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
216 AC_LIB_LINKFLAGS_BODY([$1], [$2])
217 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
218 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
219 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
220 ])
221 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
222 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
223 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
224 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
225 AC_SUBST([LIB]NAME)
226 AC_SUBST([LTLIB]NAME)
227 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
228 dnl results of this search when this library appears as a dependency.
229 HAVE_LIB[]NAME=yes
230 undefine([Name])
231 undefine([NAME])
232])
233
234dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
235dnl searches for libname and the libraries corresponding to explicit and
236dnl implicit dependencies, together with the specified include files and
237dnl the ability to compile and link the specified testcode. If found, it
238dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
239dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
240dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
241dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
242AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
243[
244 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
245 AC_REQUIRE([AC_LIB_RPATH])
246 define([Name],[translit([$1],[./-], [___])])
247 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
248 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
249
250 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
251 dnl accordingly.
252 AC_LIB_LINKFLAGS_BODY([$1], [$2])
253
254 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
255 dnl because if the user has installed lib[]Name and not disabled its use
256 dnl via --without-lib[]Name-prefix, he wants to use it.
257 ac_save_CPPFLAGS="$CPPFLAGS"
258 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
259
260 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
261 ac_save_LIBS="$LIBS"
262 LIBS="$LIBS $LIB[]NAME"
263 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
264 LIBS="$ac_save_LIBS"
265 ])
266 if test "$ac_cv_lib[]Name" = yes; then
267 HAVE_LIB[]NAME=yes
268 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
269 AC_MSG_CHECKING([how to link with lib[]$1])
270 AC_MSG_RESULT([$LIB[]NAME])
271 else
272 HAVE_LIB[]NAME=no
273 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
274 dnl $INC[]NAME either.
275 CPPFLAGS="$ac_save_CPPFLAGS"
276 LIB[]NAME=
277 LTLIB[]NAME=
278 fi
279 AC_SUBST([HAVE_LIB]NAME)
280 AC_SUBST([LIB]NAME)
281 AC_SUBST([LTLIB]NAME)
282 undefine([Name])
283 undefine([NAME])
284])
285
286dnl Determine the platform dependent parameters needed to use rpath:
287dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
288dnl hardcode_direct, hardcode_minus_L.
289AC_DEFUN([AC_LIB_RPATH],
290[
291 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
292 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
293 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
294 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
295 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
296 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
297 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
298 . ./conftest.sh
299 rm -f ./conftest.sh
300 acl_cv_rpath=done
301 ])
302 wl="$acl_cv_wl"
303 libext="$acl_cv_libext"
304 shlibext="$acl_cv_shlibext"
305 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
306 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
307 hardcode_direct="$acl_cv_hardcode_direct"
308 hardcode_minus_L="$acl_cv_hardcode_minus_L"
309 dnl Determine whether the user wants rpath handling at all.
310 AC_ARG_ENABLE(rpath,
311 [ --disable-rpath do not hardcode runtime library paths],
312 :, enable_rpath=yes)
313])
314
315dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
316dnl the libraries corresponding to explicit and implicit dependencies.
317dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
318AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
319[
320 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
321 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
322 dnl By default, look in $includedir and $libdir.
323 use_additional=yes
324 AC_LIB_WITH_FINAL_PREFIX([
325 eval additional_includedir=\"$includedir\"
326 eval additional_libdir=\"$libdir\"
327 ])
328 AC_LIB_ARG_WITH([lib$1-prefix],
329[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
330 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
331[
332 if test "X$withval" = "Xno"; then
333 use_additional=no
334 else
335 if test "X$withval" = "X"; then
336 AC_LIB_WITH_FINAL_PREFIX([
337 eval additional_includedir=\"$includedir\"
338 eval additional_libdir=\"$libdir\"
339 ])
340 else
341 additional_includedir="$withval/include"
342 additional_libdir="$withval/lib"
343 fi
344 fi
345])
346 dnl Search the library and its dependencies in $additional_libdir and
347 dnl $LDFLAGS. Using breadth-first-seach.
348 LIB[]NAME=
349 LTLIB[]NAME=
350 INC[]NAME=
351 rpathdirs=
352 ltrpathdirs=
353 names_already_handled=
354 names_next_round='$1 $2'
355 while test -n "$names_next_round"; do
356 names_this_round="$names_next_round"
357 names_next_round=
358 for name in $names_this_round; do
359 already_handled=
360 for n in $names_already_handled; do
361 if test "$n" = "$name"; then
362 already_handled=yes
363 break
364 fi
365 done
366 if test -z "$already_handled"; then
367 names_already_handled="$names_already_handled $name"
368 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
369 dnl or AC_LIB_HAVE_LINKFLAGS call.
370 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
371 eval value=\"\$HAVE_LIB$uppername\"
372 if test -n "$value"; then
373 if test "$value" = yes; then
374 eval value=\"\$LIB$uppername\"
375 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
376 eval value=\"\$LTLIB$uppername\"
377 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
378 else
379 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
380 dnl that this library doesn't exist. So just drop it.
381 :
382 fi
383 else
384 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
385 dnl and the already constructed $LIBNAME/$LTLIBNAME.
386 found_dir=
387 found_la=
388 found_so=
389 found_a=
390 if test $use_additional = yes; then
391 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
392 found_dir="$additional_libdir"
393 found_so="$additional_libdir/lib$name.$shlibext"
394 if test -f "$additional_libdir/lib$name.la"; then
395 found_la="$additional_libdir/lib$name.la"
396 fi
397 else
398 if test -f "$additional_libdir/lib$name.$libext"; then
399 found_dir="$additional_libdir"
400 found_a="$additional_libdir/lib$name.$libext"
401 if test -f "$additional_libdir/lib$name.la"; then
402 found_la="$additional_libdir/lib$name.la"
403 fi
404 fi
405 fi
406 fi
407 if test "X$found_dir" = "X"; then
408 for x in $LDFLAGS $LTLIB[]NAME; do
409 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
410 case "$x" in
411 -L*)
412 dir=`echo "X$x" | sed -e 's/^X-L//'`
413 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
414 found_dir="$dir"
415 found_so="$dir/lib$name.$shlibext"
416 if test -f "$dir/lib$name.la"; then
417 found_la="$dir/lib$name.la"
418 fi
419 else
420 if test -f "$dir/lib$name.$libext"; then
421 found_dir="$dir"
422 found_a="$dir/lib$name.$libext"
423 if test -f "$dir/lib$name.la"; then
424 found_la="$dir/lib$name.la"
425 fi
426 fi
427 fi
428 ;;
429 esac
430 if test "X$found_dir" != "X"; then
431 break
432 fi
433 done
434 fi
435 if test "X$found_dir" != "X"; then
436 dnl Found the library.
437 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
438 if test "X$found_so" != "X"; then
439 dnl Linking with a shared library. We attempt to hardcode its
440 dnl directory into the executable's runpath, unless it's the
441 dnl standard /usr/lib.
442 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
443 dnl No hardcoding is needed.
444 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
445 else
446 dnl Use an explicit option to hardcode DIR into the resulting
447 dnl binary.
448 dnl Potentially add DIR to ltrpathdirs.
449 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
450 haveit=
451 for x in $ltrpathdirs; do
452 if test "X$x" = "X$found_dir"; then
453 haveit=yes
454 break
455 fi
456 done
457 if test -z "$haveit"; then
458 ltrpathdirs="$ltrpathdirs $found_dir"
459 fi
460 dnl The hardcoding into $LIBNAME is system dependent.
461 if test "$hardcode_direct" = yes; then
462 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
463 dnl resulting binary.
464 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
465 else
466 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
467 dnl Use an explicit option to hardcode DIR into the resulting
468 dnl binary.
469 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
470 dnl Potentially add DIR to rpathdirs.
471 dnl The rpathdirs will be appended to $LIBNAME at the end.
472 haveit=
473 for x in $rpathdirs; do
474 if test "X$x" = "X$found_dir"; then
475 haveit=yes
476 break
477 fi
478 done
479 if test -z "$haveit"; then
480 rpathdirs="$rpathdirs $found_dir"
481 fi
482 else
483 dnl Rely on "-L$found_dir".
484 dnl But don't add it if it's already contained in the LDFLAGS
485 dnl or the already constructed $LIBNAME
486 haveit=
487 for x in $LDFLAGS $LIB[]NAME; do
488 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
489 if test "X$x" = "X-L$found_dir"; then
490 haveit=yes
491 break
492 fi
493 done
494 if test -z "$haveit"; then
495 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
496 fi
497 if test "$hardcode_minus_L" != no; then
498 dnl FIXME: Not sure whether we should use
499 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
500 dnl here.
501 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
502 else
503 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
504 dnl here, because this doesn't fit in flags passed to the
505 dnl compiler. So give up. No hardcoding. This affects only
506 dnl very old systems.
507 dnl FIXME: Not sure whether we should use
508 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
509 dnl here.
510 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
511 fi
512 fi
513 fi
514 fi
515 else
516 if test "X$found_a" != "X"; then
517 dnl Linking with a static library.
518 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
519 else
520 dnl We shouldn't come here, but anyway it's good to have a
521 dnl fallback.
522 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
523 fi
524 fi
525 dnl Assume the include files are nearby.
526 additional_includedir=
527 case "$found_dir" in
528 */lib | */lib/)
529 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
530 additional_includedir="$basedir/include"
531 ;;
532 esac
533 if test "X$additional_includedir" != "X"; then
534 dnl Potentially add $additional_includedir to $INCNAME.
535 dnl But don't add it
536 dnl 1. if it's the standard /usr/include,
537 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
538 dnl 3. if it's already present in $CPPFLAGS or the already
539 dnl constructed $INCNAME,
540 dnl 4. if it doesn't exist as a directory.
541 if test "X$additional_includedir" != "X/usr/include"; then
542 haveit=
543 if test "X$additional_includedir" = "X/usr/local/include"; then
544 if test -n "$GCC"; then
545 case $host_os in
546 linux*) haveit=yes;;
547 esac
548 fi
549 fi
550 if test -z "$haveit"; then
551 for x in $CPPFLAGS $INC[]NAME; do
552 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
553 if test "X$x" = "X-I$additional_includedir"; then
554 haveit=yes
555 break
556 fi
557 done
558 if test -z "$haveit"; then
559 if test -d "$additional_includedir"; then
560 dnl Really add $additional_includedir to $INCNAME.
561 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
562 fi
563 fi
564 fi
565 fi
566 fi
567 dnl Look for dependencies.
568 if test -n "$found_la"; then
569 dnl Read the .la file. It defines the variables
570 dnl dlname, library_names, old_library, dependency_libs, current,
571 dnl age, revision, installed, dlopen, dlpreopen, libdir.
572 save_libdir="$libdir"
573 case "$found_la" in
574 */* | *\\*) . "$found_la" ;;
575 *) . "./$found_la" ;;
576 esac
577 libdir="$save_libdir"
578 dnl We use only dependency_libs.
579 for dep in $dependency_libs; do
580 case "$dep" in
581 -L*)
582 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
583 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
584 dnl But don't add it
585 dnl 1. if it's the standard /usr/lib,
586 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
587 dnl 3. if it's already present in $LDFLAGS or the already
588 dnl constructed $LIBNAME,
589 dnl 4. if it doesn't exist as a directory.
590 if test "X$additional_libdir" != "X/usr/lib"; then
591 haveit=
592 if test "X$additional_libdir" = "X/usr/local/lib"; then
593 if test -n "$GCC"; then
594 case $host_os in
595 linux*) haveit=yes;;
596 esac
597 fi
598 fi
599 if test -z "$haveit"; then
600 haveit=
601 for x in $LDFLAGS $LIB[]NAME; do
602 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
603 if test "X$x" = "X-L$additional_libdir"; then
604 haveit=yes
605 break
606 fi
607 done
608 if test -z "$haveit"; then
609 if test -d "$additional_libdir"; then
610 dnl Really add $additional_libdir to $LIBNAME.
611 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
612 fi
613 fi
614 haveit=
615 for x in $LDFLAGS $LTLIB[]NAME; do
616 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
617 if test "X$x" = "X-L$additional_libdir"; then
618 haveit=yes
619 break
620 fi
621 done
622 if test -z "$haveit"; then
623 if test -d "$additional_libdir"; then
624 dnl Really add $additional_libdir to $LTLIBNAME.
625 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
626 fi
627 fi
628 fi
629 fi
630 ;;
631 -R*)
632 dir=`echo "X$dep" | sed -e 's/^X-R//'`
633 if test "$enable_rpath" != no; then
634 dnl Potentially add DIR to rpathdirs.
635 dnl The rpathdirs will be appended to $LIBNAME at the end.
636 haveit=
637 for x in $rpathdirs; do
638 if test "X$x" = "X$dir"; then
639 haveit=yes
640 break
641 fi
642 done
643 if test -z "$haveit"; then
644 rpathdirs="$rpathdirs $dir"
645 fi
646 dnl Potentially add DIR to ltrpathdirs.
647 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
648 haveit=
649 for x in $ltrpathdirs; do
650 if test "X$x" = "X$dir"; then
651 haveit=yes
652 break
653 fi
654 done
655 if test -z "$haveit"; then
656 ltrpathdirs="$ltrpathdirs $dir"
657 fi
658 fi
659 ;;
660 -l*)
661 dnl Handle this in the next round.
662 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
663 ;;
664 *.la)
665 dnl Handle this in the next round. Throw away the .la's
666 dnl directory; it is already contained in a preceding -L
667 dnl option.
668 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
669 ;;
670 *)
671 dnl Most likely an immediate library name.
672 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
673 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
674 ;;
675 esac
676 done
677 fi
678 else
679 dnl Didn't find the library; assume it is in the system directories
680 dnl known to the linker and runtime loader. (All the system
681 dnl directories known to the linker should also be known to the
682 dnl runtime loader, otherwise the system is severely misconfigured.)
683 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
684 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
685 fi
686 fi
687 fi
688 done
689 done
690 if test "X$rpathdirs" != "X"; then
691 if test -n "$hardcode_libdir_separator"; then
692 dnl Weird platform: only the last -rpath option counts, the user must
693 dnl pass all path elements in one option. We can arrange that for a
694 dnl single library, but not when more than one $LIBNAMEs are used.
695 alldirs=
696 for found_dir in $rpathdirs; do
697 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
698 done
699 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
700 acl_save_libdir="$libdir"
701 libdir="$alldirs"
702 eval flag=\"$hardcode_libdir_flag_spec\"
703 libdir="$acl_save_libdir"
704 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
705 else
706 dnl The -rpath options are cumulative.
707 for found_dir in $rpathdirs; do
708 acl_save_libdir="$libdir"
709 libdir="$found_dir"
710 eval flag=\"$hardcode_libdir_flag_spec\"
711 libdir="$acl_save_libdir"
712 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
713 done
714 fi
715 fi
716 if test "X$ltrpathdirs" != "X"; then
717 dnl When using libtool, the option that works for both libraries and
718 dnl executables is -R. The -R options are cumulative.
719 for found_dir in $ltrpathdirs; do
720 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
721 done
722 fi
723])
724
725dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
726dnl unless already present in VAR.
727dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
728dnl contains two or three consecutive elements that belong together.
729AC_DEFUN([AC_LIB_APPENDTOVAR],
730[
731 for element in [$2]; do
732 haveit=
733 for x in $[$1]; do
734 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
735 if test "X$x" = "X$element"; then
736 haveit=yes
737 break
738 fi
739 done
740 if test -z "$haveit"; then
741 [$1]="${[$1]}${[$1]:+ }$element"
742 fi
743 done
744])
745
746# lib-ld.m4 serial 3 (gettext-0.13)
747dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
748dnl This file is free software, distributed under the terms of the GNU
749dnl General Public License. As a special exception to the GNU General
750dnl Public License, this file may be distributed as part of a program
751dnl that contains a configuration script generated by Autoconf, under
752dnl the same distribution terms as the rest of that program.
753
754dnl Subroutines of libtool.m4,
755dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
756dnl with libtool.m4.
757
758dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
759AC_DEFUN([AC_LIB_PROG_LD_GNU],
760[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
761[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
762case `$LD -v 2>&1 </dev/null` in
763*GNU* | *'with BFD'*)
764 acl_cv_prog_gnu_ld=yes ;;
765*)
766 acl_cv_prog_gnu_ld=no ;;
767esac])
768with_gnu_ld=$acl_cv_prog_gnu_ld
769])
770
771dnl From libtool-1.4. Sets the variable LD.
772AC_DEFUN([AC_LIB_PROG_LD],
773[AC_ARG_WITH(gnu-ld,
774[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
775test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
776AC_REQUIRE([AC_PROG_CC])dnl
777AC_REQUIRE([AC_CANONICAL_HOST])dnl
778# Prepare PATH_SEPARATOR.
779# The user is always right.
780if test "${PATH_SEPARATOR+set}" != set; then
781 echo "#! /bin/sh" >conf$$.sh
782 echo "exit 0" >>conf$$.sh
783 chmod +x conf$$.sh
784 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
785 PATH_SEPARATOR=';'
786 else
787 PATH_SEPARATOR=:
788 fi
789 rm -f conf$$.sh
790fi
791ac_prog=ld
792if test "$GCC" = yes; then
793 # Check if gcc -print-prog-name=ld gives a path.
794 AC_MSG_CHECKING([for ld used by GCC])
795 case $host in
796 *-*-mingw*)
797 # gcc leaves a trailing carriage return which upsets mingw
798 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
799 *)
800 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
801 esac
802 case $ac_prog in
803 # Accept absolute paths.
804 [[\\/]* | [A-Za-z]:[\\/]*)]
805 [re_direlt='/[^/][^/]*/\.\./']
806 # Canonicalize the path of ld
807 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
808 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
809 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
810 done
811 test -z "$LD" && LD="$ac_prog"
812 ;;
813 "")
814 # If it fails, then pretend we aren't using GCC.
815 ac_prog=ld
816 ;;
817 *)
818 # If it is relative, then search for the first ld in PATH.
819 with_gnu_ld=unknown
820 ;;
821 esac
822elif test "$with_gnu_ld" = yes; then
823 AC_MSG_CHECKING([for GNU ld])
824else
825 AC_MSG_CHECKING([for non-GNU ld])
826fi
827AC_CACHE_VAL(acl_cv_path_LD,
828[if test -z "$LD"; then
829 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
830 for ac_dir in $PATH; do
831 test -z "$ac_dir" && ac_dir=.
832 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
833 acl_cv_path_LD="$ac_dir/$ac_prog"
834 # Check to see if the program is GNU ld. I'd rather use --version,
835 # but apparently some GNU ld's only accept -v.
836 # Break only if it was the GNU/non-GNU ld that we prefer.
837 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
838 *GNU* | *'with BFD'*)
839 test "$with_gnu_ld" != no && break ;;
840 *)
841 test "$with_gnu_ld" != yes && break ;;
842 esac
843 fi
844 done
845 IFS="$ac_save_ifs"
846else
847 acl_cv_path_LD="$LD" # Let the user override the test with a path.
848fi])
849LD="$acl_cv_path_LD"
850if test -n "$LD"; then
851 AC_MSG_RESULT($LD)
852else
853 AC_MSG_RESULT(no)
854fi
855test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
856AC_LIB_PROG_LD_GNU
857])
858
e20c0b3d
AM
859# isc-posix.m4 serial 2 (gettext-0.11.2)
860dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
861dnl This file is free software, distributed under the terms of the GNU
862dnl General Public License. As a special exception to the GNU General
863dnl Public License, this file may be distributed as part of a program
864dnl that contains a configuration script generated by Autoconf, under
865dnl the same distribution terms as the rest of that program.
866
867# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
868
75798298
NC
869# This test replaces the one in autoconf.
870# Currently this macro should have the same name as the autoconf macro
871# because gettext's gettext.m4 (distributed in the automake package)
872# still uses it. Otherwise, the use in gettext.m4 makes autoheader
873# give these diagnostics:
874# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
875# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
876
877undefine([AC_ISC_POSIX])
878
879AC_DEFUN([AC_ISC_POSIX],
880 [
881 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
882 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
883 ]
884)
885
252b5132
RH
886# Do all the work for Automake. This macro actually does too much --
887# some checks are only needed if your package does certain things.
888# But this isn't really a big deal.
889
890# serial 1
891
892dnl Usage:
893dnl AM_INIT_AUTOMAKE(package,version, [no-define])
894
2c73f9d8 895AC_DEFUN([AM_INIT_AUTOMAKE],
e20c0b3d
AM
896[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
897AC_REQUIRE([AC_PROG_INSTALL])
252b5132
RH
898PACKAGE=[$1]
899AC_SUBST(PACKAGE)
900VERSION=[$2]
901AC_SUBST(VERSION)
902dnl test to see if srcdir already configured
903if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
904 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
905fi
906ifelse([$3],,
907AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
908AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
909AC_REQUIRE([AM_SANITY_CHECK])
910AC_REQUIRE([AC_ARG_PROGRAM])
911dnl FIXME This is truly gross.
912missing_dir=`cd $ac_aux_dir && pwd`
e20c0b3d 913AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
252b5132 914AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
e20c0b3d 915AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
252b5132
RH
916AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
917AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
918AC_REQUIRE([AC_PROG_MAKE_SET])])
919
e20c0b3d
AM
920# Copyright 2002 Free Software Foundation, Inc.
921
922# This program is free software; you can redistribute it and/or modify
923# it under the terms of the GNU General Public License as published by
924# the Free Software Foundation; either version 2, or (at your option)
925# any later version.
926
927# This program is distributed in the hope that it will be useful,
928# but WITHOUT ANY WARRANTY; without even the implied warranty of
929# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
930# GNU General Public License for more details.
931
932# You should have received a copy of the GNU General Public License
933# along with this program; if not, write to the Free Software
934# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
935
936# AM_AUTOMAKE_VERSION(VERSION)
937# ----------------------------
938# Automake X.Y traces this macro to ensure aclocal.m4 has been
939# generated from the m4 files accompanying Automake X.Y.
940AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
941
942# AM_SET_CURRENT_AUTOMAKE_VERSION
943# -------------------------------
944# Call AM_AUTOMAKE_VERSION so it can be traced.
945# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
946AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
947 [AM_AUTOMAKE_VERSION([1.4-p6])])
948
252b5132
RH
949#
950# Check to make sure that the build environment is sane.
951#
952
2c73f9d8 953AC_DEFUN([AM_SANITY_CHECK],
252b5132
RH
954[AC_MSG_CHECKING([whether build environment is sane])
955# Just in case
956sleep 1
957echo timestamp > conftestfile
958# Do `set' in a subshell so we don't clobber the current shell's
959# arguments. Must try -L first in case configure is actually a
960# symlink; some systems play weird games with the mod time of symlinks
961# (eg FreeBSD returns the mod time of the symlink's containing
962# directory).
963if (
964 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
965 if test "[$]*" = "X"; then
966 # -L didn't work.
967 set X `ls -t $srcdir/configure conftestfile`
968 fi
969 if test "[$]*" != "X $srcdir/configure conftestfile" \
970 && test "[$]*" != "X conftestfile $srcdir/configure"; then
971
972 # If neither matched, then we have a broken ls. This can happen
973 # if, for instance, CONFIG_SHELL is bash and it inherits a
974 # broken ls alias from the environment. This has actually
975 # happened. Such a system could not be considered "sane".
976 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
977alias in your environment])
978 fi
979
980 test "[$]2" = conftestfile
981 )
982then
983 # Ok.
984 :
985else
986 AC_MSG_ERROR([newly created file is older than distributed files!
987Check your system clock])
988fi
989rm -f conftest*
990AC_MSG_RESULT(yes)])
991
992dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
993dnl The program must properly implement --version.
2c73f9d8 994AC_DEFUN([AM_MISSING_PROG],
252b5132
RH
995[AC_MSG_CHECKING(for working $2)
996# Run test in a subshell; some versions of sh will print an error if
997# an executable is not found, even if stderr is redirected.
998# Redirect stdin to placate older versions of autoconf. Sigh.
999if ($2 --version) < /dev/null > /dev/null 2>&1; then
1000 $1=$2
1001 AC_MSG_RESULT(found)
1002else
1003 $1="$3/missing $2"
1004 AC_MSG_RESULT(missing)
1005fi
1006AC_SUBST($1)])
1007
252b5132
RH
1008# Like AC_CONFIG_HEADER, but automatically create stamp file.
1009
2c73f9d8 1010AC_DEFUN([AM_CONFIG_HEADER],
252b5132
RH
1011[AC_PREREQ([2.12])
1012AC_CONFIG_HEADER([$1])
1013dnl When config.status generates a header, we must update the stamp-h file.
1014dnl This file resides in the same directory as the config header
1015dnl that is generated. We must strip everything past the first ":",
1016dnl and everything past the last "/".
1017AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1018ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1019<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1020<<am_indx=1
1021for am_file in <<$1>>; do
1022 case " <<$>>CONFIG_HEADERS " in
1023 *" <<$>>am_file "*<<)>>
1024 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1025 ;;
1026 esac
1027 am_indx=`expr "<<$>>am_indx" + 1`
1028done<<>>dnl>>)
1029changequote([,]))])
1030
1031# Add --enable-maintainer-mode option to configure.
1032# From Jim Meyering
1033
1034# serial 1
1035
2c73f9d8 1036AC_DEFUN([AM_MAINTAINER_MODE],
252b5132
RH
1037[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1038 dnl maintainer-mode is disabled by default
1039 AC_ARG_ENABLE(maintainer-mode,
1040[ --enable-maintainer-mode enable make rules and dependencies not useful
1041 (and sometimes confusing) to the casual installer],
1042 USE_MAINTAINER_MODE=$enableval,
1043 USE_MAINTAINER_MODE=no)
1044 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1045 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1046 MAINT=$MAINTAINER_MODE_TRUE
1047 AC_SUBST(MAINT)dnl
1048]
1049)
1050
1051# Define a conditional.
1052
2c73f9d8 1053AC_DEFUN([AM_CONDITIONAL],
252b5132
RH
1054[AC_SUBST($1_TRUE)
1055AC_SUBST($1_FALSE)
1056if $2; then
1057 $1_TRUE=
1058 $1_FALSE='#'
1059else
1060 $1_TRUE='#'
1061 $1_FALSE=
1062fi])
1063
This page took 0.267572 seconds and 4 git commands to generate.