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