3 dnl Copyright 1996 by the Massachusetts Institute of Technology.
5 dnl Permission to use, copy, modify, and distribute this
6 dnl software and its documentation for any purpose and without
7 dnl fee is hereby granted, provided that the above copyright
8 dnl notice appear in all copies and that both that copyright
9 dnl notice and this permission notice appear in supporting
10 dnl documentation, and that the name of M.I.T. not be used in
11 dnl advertising or publicity pertaining to distribution of the
12 dnl software without specific, written prior permission.
13 dnl M.I.T. makes no representations about the suitability of
14 dnl this software for any purpose. It is provided "as is"
15 dnl without express or implied warranty.
17 dnl This file provides local macros for packages which use specific
18 dnl external libraries. The public macros are:
20 dnl ATHENA_UTIL_COM_ERR
21 dnl Generates error if com_err not found.
23 dnl Generates error if ss not found.
25 dnl Sets REGEX_LIBS if rx library used; ensures POSIX
28 dnl Sets MOTIF_LIBS and defines HAVE_MOTIF if Motif used.
29 dnl ATHENA_MOTIF_REQUIRED
30 dnl Generates error if Motif not found.
32 dnl Sets AFS_LIBS and defines HAVE_AFS if AFS used. Pass
33 dnl in an argument giving the desired AFS libraries;
34 dnl AFS_LIBS will be set to that value if AFS is found.
35 dnl AFS_DIR will be set to the prefix given.
36 dnl ATHENA_AFS_REQUIRED
37 dnl Generates error if AFS libraries not found. AFS_DIR
38 dnl will be set to the prefix given.
40 dnl Sets KRB4_LIBS and defines HAVE_KRB4 if krb4 used.
41 dnl ATHENA_KRB4_REQUIRED
42 dnl Generates error if krb4 not found. Sets KRB4_LIBS
43 dnl otherwise. (Special behavior because krb4 libraries
44 dnl may be different if using krb4 compatibility libraries
47 dnl Sets KRB5_LIBS and defines HAVE_KRB5 if krb5 used.
48 dnl ATHENA_KRB5_REQUIRED
49 dnl Generates error if krb5 not found.
51 dnl Sets HESIOD_LIBS and defines HAVE_HESIOD if Hesiod
53 dnl ATHENA_HESIOD_REQUIRED
54 dnl Generates error if Hesiod not found.
56 dnl Sets ARES_LIBS and defines HAVE_ARES if libares
58 dnl ATHENA_ARES_REQUIRED
59 dnl Generates error if libares not found.
61 dnl Sets ZEPHYR_LIBS and defines HAVE_ZEPHYR if zephyr
63 dnl ATHENA_ZEPHYR_REQUIRED
64 dnl Generates error if zephyr not found.
66 dnl All of the macros may extend CPPFLAGS and LDFLAGS to let the
67 dnl compiler find the requested libraries. Put ATHENA_UTIL_COM_ERR
68 dnl and ATHENA_UTIL_SS before ATHENA_AFS or ATHENA_AFS_REQUIRED; there
69 dnl is a com_err library in the AFS libraries which requires -lutil.
71 dnl ----- com_err -----
73 AC_DEFUN(ATHENA_UTIL_COM_ERR,
75 [ --with-com_err=PREFIX Specify location of com_err],
76 [com_err="$withval"], [com_err=yes])
77 if test "$com_err" != no; then
78 if test "$com_err" != yes; then
79 CPPFLAGS="$CPPFLAGS -I$com_err/include"
80 LDFLAGS="$LDFLAGS -L$com_err/lib"
82 AC_CHECK_LIB(com_err, com_err, :,
83 [AC_MSG_ERROR(com_err library not found)])
85 AC_MSG_ERROR(This package requires com_err.)
90 AC_DEFUN(ATHENA_UTIL_SS,
92 [ --with-ss=PREFIX Specify location of ss (requires com_err)],
93 [ss="$withval"], [ss=yes])
94 if test "$ss" != no; then
95 if test "$ss" != yes; then
96 CPPFLAGS="$CPPFLAGS -I$ss/include"
97 LDFLAGS="$LDFLAGS -L$ss/lib"
99 AC_CHECK_LIB(ss, ss_perror, :,
100 [AC_MSG_ERROR(ss library not found)], -lcom_err)
102 AC_MSG_ERROR(This package requires ss.)
105 dnl ----- Regular expressions -----
107 AC_DEFUN(ATHENA_REGEXP,
109 [ --with-regex=PREFIX Use installed regex library],
110 [regex="$withval"], [regex=no])
111 if test "$regex" != no; then
112 if test "$regex" != yes; then
113 CPPFLAGS="$CPPFLAGS -I$regex/include"
114 LDFLAGS="$LDFLAGS -L$regex/lib"
116 AC_CHECK_LIB(regex, regcomp, REGEX_LIBS=-lregex,
117 [AC_MSG_ERROR(regex library not found)])
119 AC_CHECK_FUNC(regcomp, :,
120 [AC_MSG_ERROR(can't find POSIX regexp support)])
122 AC_SUBST(REGEX_LIBS)])
124 dnl ----- Motif -----
126 AC_DEFUN(ATHENA_MOTIF_CHECK,
127 [if test "$motif" != yes; then
128 CPPFLAGS="$CPPFLAGS -I$motif/include"
129 LDFLAGS="$LDFLAGS -L$motif/lib"
131 AC_CHECK_LIB(Xm, XmStringFree, :, [AC_MSG_ERROR(Motif library not found)])])
133 AC_DEFUN(ATHENA_MOTIF,
135 [ --with-motif=PREFIX Use Motif],
136 [motif="$withval"], [motif=no])
137 if test "$motif" != no; then
140 AC_DEFINE(HAVE_MOTIF)
142 AC_SUBST(MOTIF_LIBS)])
144 AC_DEFUN(ATHENA_MOTIF_REQUIRED,
146 [ --with-motif=PREFIX Specify location of Motif],
147 [motif="$withval"], [motif=yes])
148 if test "$motif" != no; then
151 AC_MSG_ERROR(This package requires Motif.)
156 AC_DEFUN(ATHENA_AFS_CHECK,
157 [AC_CHECK_FUNC(insque, :, AC_CHECK_LIB(compat, insque))
158 AC_CHECK_FUNC(gethostbyname, :, AC_CHECK_LIB(nsl, gethostbyname))
159 AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket))
160 if test "$afs" != yes; then
161 CPPFLAGS="$CPPFLAGS -I$afs/include"
162 LDFLAGS="$LDFLAGS -L$afs/lib -L$afs/lib/afs"
164 AC_CHECK_LIB(sys, pioctl, :, [AC_MSG_ERROR(AFS libraries not found)],
169 dnl Specify desired AFS libraries as a parameter.
172 [ --with-afs=PREFIX Use AFS libraries],
173 [afs="$withval"], [afs=no])
174 if test "$afs" != no; then
181 AC_DEFUN(ATHENA_AFS_REQUIRED,
183 [ --with-afs=PREFIX Specify location of AFS libraries],
184 [afs="$withval"], [afs=/usr/afsws])
185 if test "$afs" != no; then
188 AC_MSG_ERROR(This package requires AFS libraries.)
191 dnl ----- Kerberos 4 -----
193 AC_DEFUN(ATHENA_KRB4_CHECK,
194 [AC_CHECK_FUNC(gethostbyname, :, AC_CHECK_LIB(nsl, gethostbyname))
195 AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket))
196 AC_CHECK_LIB(gen, compile)
197 if test "$krb4" != yes; then
198 CPPFLAGS="$CPPFLAGS -I$krb4/include"
199 if test -d "$krb4/include/kerberosIV"; then
200 CPPFLAGS="$CPPFLAGS -I$krb4/include/kerberosIV"
202 LDFLAGS="$LDFLAGS -L$krb4/lib"
204 AC_CHECK_LIB(krb4, krb_rd_req,
205 [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"],
206 [AC_CHECK_LIB(krb, krb_rd_req,
207 [KRB4_LIBS="-lkrb -ldes"],
208 [AC_MSG_ERROR(Kerberos 4 libraries not found)],
210 -ldes425 -lkrb5 -lk5crypto -lcom_err)])
212 AC_DEFUN(ATHENA_KRB4,
214 [ --with-krb4=PREFIX Use Kerberos 4],
215 [krb4="$withval"], [krb4=no])
216 if test "$krb4" != no; then
220 AC_SUBST(KRB4_LIBS)])
222 AC_DEFUN(ATHENA_KRB4_REQUIRED,
224 [ --with-krb4=PREFIX Specify location of Kerberos 4],
225 [krb4="$withval"], [krb4=yes])
226 if test "$krb4" != no; then
230 AC_MSG_ERROR(This package requires Kerberos 4.)
233 dnl ----- Kerberos 5 -----
235 AC_DEFUN(ATHENA_KRB5_CHECK,
236 [AC_SEARCH_LIBS(gethostbyname, nsl)
237 AC_SEARCH_LIBS(socket, socket)
238 AC_CHECK_LIB(gen, compile)
239 if test "$krb5" != yes; then
240 CPPFLAGS="$CPPFLAGS -I$krb5/include"
241 LDFLAGS="$LDFLAGS -L$krb5/lib"
243 AC_CHECK_LIB(krb5, krb5_init_context, :,
244 [AC_MSG_ERROR(Kerberos 5 libraries not found)],
245 -lk5crypto -lcom_err)])
247 AC_DEFUN(ATHENA_KRB5,
249 [ --with-krb5=PREFIX Use Kerberos 5],
250 [krb5="$withval"], [krb5=no])
251 if test "$krb5" != no; then
253 KRB5_LIBS="-lkrb5 -lk5crypto -lcom_err"
256 AC_SUBST(KRB5_LIBS)])
258 AC_DEFUN(ATHENA_KRB5_REQUIRED,
260 [ --with-krb5=PREFIX Specify location of Kerberos 5],
261 [krb5="$withval"], [krb5=yes])
262 if test "$krb5" != no; then
265 AC_MSG_ERROR(This package requires Kerberos 5.)
268 dnl ----- Hesiod -----
270 AC_DEFUN(ATHENA_HESIOD_CHECK,
271 [AC_CHECK_FUNC(res_send, :, AC_CHECK_LIB(resolv, res_send))
272 if test "$hesiod" != yes; then
273 CPPFLAGS="$CPPFLAGS -I$hesiod/include"
274 LDFLAGS="$LDFLAGS -L$hesiod/lib"
276 AC_CHECK_LIB(hesiod, hes_resolve, :,
277 [AC_MSG_ERROR(Hesiod library not found)])])
279 AC_DEFUN(ATHENA_HESIOD,
281 [ --with-hesiod=PREFIX Use Hesiod],
282 [hesiod="$withval"], [hesiod=no])
283 if test "$hesiod" != no; then
285 HESIOD_LIBS="-lhesiod"
286 AC_DEFINE(HAVE_HESIOD)
288 AC_SUBST(HESIOD_LIBS)])
290 AC_DEFUN(ATHENA_HESIOD_REQUIRED,
292 [ --with-hesiod=PREFIX Specify location of Hesiod],
293 [hesiod="$withval"], [hesiod=yes])
294 if test "$hesiod" != no; then
297 AC_MSG_ERROR(This package requires Hesiod.)
300 dnl ----- libares -----
302 AC_DEFUN(ATHENA_ARES_CHECK,
303 [AC_CHECK_FUNC(res_send, :, AC_CHECK_LIB(resolv, res_send))
304 if test "$ares" != yes; then
305 CPPFLAGS="$CPPFLAGS -I$ares/include"
306 LDFLAGS="$LDFLAGS -L$ares/lib"
308 AC_CHECK_LIB(ares, ares_init, :, [AC_MSG_ERROR(libares not found)])])
310 AC_DEFUN(ATHENA_ARES,
312 [ --with-ares=PREFIX Use libares],
313 [ares="$withval"], [ares=no])
314 if test "$ares" != no; then
319 AC_SUBST(ARES_LIBS)])
321 AC_DEFUN(ATHENA_ARES_REQUIRED,
323 [ --with-ares=PREFIX Specify location of libares],
324 [ares="$withval"], [ares=yes])
325 if test "$ares" != no; then
328 AC_MSG_ERROR(This package requires libares.)
330 dnl ----- zephyr -----
332 AC_DEFUN(ATHENA_ZEPHYR_CHECK,
333 [if test "$zephyr" != yes; then
334 CPPFLAGS="$CPPFLAGS -I$zephyr/include"
335 LDFLAGS="$LDFLAGS -L$zephyr/lib"
337 AC_CHECK_LIB(zephyr, ZFreeNotice, :, [AC_MSG_ERROR(zephyr not found)])])
339 AC_DEFUN(ATHENA_ZEPHYR,
341 [ --with-zephyr=PREFIX Use zephyr],
342 [zephyr="$withval"], [zephyr=no])
343 if test "$zephyr" != no; then
345 ZEPHYR_LIBS="-lzephyr"
346 AC_DEFINE(HAVE_ZEPHYR)
348 AC_SUBST(ZEPHYR_LIBS)])
350 AC_DEFUN(ATHENA_ZEPHYR_REQUIRED,
352 [ --with-zephyr=PREFIX Specify location of zephyr],
353 [zephyr="$withval"], [zephyr=yes])
354 if test "$zephyr" != no; then
357 AC_MSG_ERROR(This package requires zephyr.)
359 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
360 ## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
361 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
363 ## This program is free software; you can redistribute it and/or modify
364 ## it under the terms of the GNU General Public License as published by
365 ## the Free Software Foundation; either version 2 of the License, or
366 ## (at your option) any later version.
368 ## This program is distributed in the hope that it will be useful, but
369 ## WITHOUT ANY WARRANTY; without even the implied warranty of
370 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
371 ## General Public License for more details.
373 ## You should have received a copy of the GNU General Public License
374 ## along with this program; if not, write to the Free Software
375 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
377 ## As a special exception to the GNU General Public License, if you
378 ## distribute this file as part of a program that contains a
379 ## configuration script generated by Autoconf, you may include it under
380 ## the same distribution terms that you use for the rest of that program.
382 # serial 40 AC_PROG_LIBTOOL
383 AC_DEFUN(AC_PROG_LIBTOOL,
384 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
386 # Save cache, so that ltconfig can load it
389 # Actually configure libtool. ac_aux_dir is where install-sh is found.
390 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
391 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
392 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
393 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
394 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
395 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
396 || AC_MSG_ERROR([libtool configure failed])
398 # Reload cache, that may have been modified by ltconfig
401 # This can be used to rebuild libtool when needed
402 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
404 # Always use our own libtool.
405 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
408 # Redirect the config.log output again, so that the ltconfig log is not
409 # clobbered by the next message.
413 AC_DEFUN(AC_LIBTOOL_SETUP,
415 AC_REQUIRE([AC_ENABLE_SHARED])dnl
416 AC_REQUIRE([AC_ENABLE_STATIC])dnl
417 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
418 AC_REQUIRE([AC_CANONICAL_HOST])dnl
419 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
420 AC_REQUIRE([AC_PROG_RANLIB])dnl
421 AC_REQUIRE([AC_PROG_CC])dnl
422 AC_REQUIRE([AC_PROG_LD])dnl
423 AC_REQUIRE([AC_PROG_NM])dnl
424 AC_REQUIRE([AC_PROG_LN_S])dnl
428 NONE) lt_target="$host" ;;
429 *) lt_target="$target" ;;
432 # Check for any special flags to pass to ltconfig.
433 libtool_flags="--cache-file=$cache_file"
434 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
435 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
436 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
437 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
438 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
439 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
440 [libtool_flags="$libtool_flags --enable-dlopen"])
441 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
442 [libtool_flags="$libtool_flags --enable-win32-dll"])
443 AC_ARG_ENABLE(libtool-lock,
444 [ --disable-libtool-lock avoid locking (might break parallel builds)])
445 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
446 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
448 # Some flags need to be propagated to the compiler or linker for good
452 # Find out which ABI we are using.
453 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
454 if AC_TRY_EVAL(ac_compile); then
455 case "`/usr/bin/file conftest.o`" in
471 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
472 SAVE_CFLAGS="$CFLAGS"
473 CFLAGS="$CFLAGS -belf"
474 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
475 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
476 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
477 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
478 CFLAGS="$SAVE_CFLAGS"
482 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
483 [*-*-cygwin* | *-*-mingw*)
484 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
485 AC_CHECK_TOOL(AS, as, false)
486 AC_CHECK_TOOL(OBJDUMP, objdump, false)
492 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
493 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
495 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
496 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
498 # AC_ENABLE_SHARED - implement the --enable-shared flag
499 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
500 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
502 AC_DEFUN(AC_ENABLE_SHARED, [dnl
503 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
504 AC_ARG_ENABLE(shared,
505 changequote(<<, >>)dnl
506 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
508 [p=${PACKAGE-default}
510 yes) enable_shared=yes ;;
511 no) enable_shared=no ;;
514 # Look at the argument we got. We use all the common list separators.
515 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
516 for pkg in $enableval; do
517 if test "X$pkg" = "X$p"; then
524 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
527 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
528 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
529 AC_ENABLE_SHARED(no)])
531 # AC_ENABLE_STATIC - implement the --enable-static flag
532 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
533 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
535 AC_DEFUN(AC_ENABLE_STATIC, [dnl
536 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
537 AC_ARG_ENABLE(static,
538 changequote(<<, >>)dnl
539 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
541 [p=${PACKAGE-default}
543 yes) enable_static=yes ;;
544 no) enable_static=no ;;
547 # Look at the argument we got. We use all the common list separators.
548 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
549 for pkg in $enableval; do
550 if test "X$pkg" = "X$p"; then
557 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
560 # AC_DISABLE_STATIC - set the default static flag to --disable-static
561 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
562 AC_ENABLE_STATIC(no)])
565 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
566 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
567 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
569 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
570 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
571 AC_ARG_ENABLE(fast-install,
572 changequote(<<, >>)dnl
573 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
575 [p=${PACKAGE-default}
577 yes) enable_fast_install=yes ;;
578 no) enable_fast_install=no ;;
580 enable_fast_install=no
581 # Look at the argument we got. We use all the common list separators.
582 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
583 for pkg in $enableval; do
584 if test "X$pkg" = "X$p"; then
585 enable_fast_install=yes
591 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
594 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
595 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
596 AC_ENABLE_FAST_INSTALL(no)])
598 # AC_PROG_LD - find the path to the GNU or non-GNU linker
601 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
602 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
603 AC_REQUIRE([AC_PROG_CC])dnl
604 AC_REQUIRE([AC_CANONICAL_HOST])dnl
605 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
607 if test "$ac_cv_prog_gcc" = yes; then
608 # Check if gcc -print-prog-name=ld gives a path.
609 AC_MSG_CHECKING([for ld used by GCC])
610 ac_prog=`($CC -print-prog-name=ld) 2>&5`
612 # Accept absolute paths.
614 [\\/]* | [A-Za-z]:[\\/]*)
615 re_direlt='/[^/][^/]*/\.\./'
617 # Canonicalize the path of ld
618 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
619 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
620 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
622 test -z "$LD" && LD="$ac_prog"
625 # If it fails, then pretend we aren't using GCC.
629 # If it is relative, then search for the first ld in PATH.
633 elif test "$with_gnu_ld" = yes; then
634 AC_MSG_CHECKING([for GNU ld])
636 AC_MSG_CHECKING([for non-GNU ld])
638 AC_CACHE_VAL(ac_cv_path_LD,
639 [if test -z "$LD"; then
640 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
641 for ac_dir in $PATH; do
642 test -z "$ac_dir" && ac_dir=.
643 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
644 ac_cv_path_LD="$ac_dir/$ac_prog"
645 # Check to see if the program is GNU ld. I'd rather use --version,
646 # but apparently some GNU ld's only accept -v.
647 # Break only if it was the GNU/non-GNU ld that we prefer.
648 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
649 test "$with_gnu_ld" != no && break
651 test "$with_gnu_ld" != yes && break
657 ac_cv_path_LD="$LD" # Let the user override the test with a path.
660 if test -n "$LD"; then
665 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
669 AC_DEFUN(AC_PROG_LD_GNU,
670 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
671 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
672 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
673 ac_cv_prog_gnu_ld=yes
679 # AC_PROG_NM - find the path to a BSD-compatible name lister
681 [AC_MSG_CHECKING([for BSD-compatible nm])
682 AC_CACHE_VAL(ac_cv_path_NM,
683 [if test -n "$NM"; then
684 # Let the user override the test.
687 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
688 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
689 test -z "$ac_dir" && ac_dir=.
690 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
691 # Check to see if the nm accepts a BSD-compat flag.
692 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
693 # nm: unknown option "B" ignored
694 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
695 ac_cv_path_NM="$ac_dir/nm -B"
697 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
698 ac_cv_path_NM="$ac_dir/nm -p"
701 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
702 continue # so that we can try to find one that supports BSD flags
707 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
713 # AC_CHECK_LIBM - check for math library
714 AC_DEFUN(AC_CHECK_LIBM,
715 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
718 *-*-beos* | *-*-cygwin*)
719 # These system don't have libm
722 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
723 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
726 AC_CHECK_LIB(m, main, LIBM="-lm")
731 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
732 # the libltdl convenience library and INCLTDL to the include flags for
733 # the libltdl header and adds --enable-ltdl-convenience to the
734 # configure arguments. Note that LIBLTDL and INCLTDL are not
735 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
736 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
737 # with '${top_builddir}/' and INCLTDL will be prefixed with
738 # '${top_srcdir}/' (note the single quotes!). If your package is not
739 # flat and you're not using automake, define top_builddir and
740 # top_srcdir appropriately in the Makefiles.
741 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
742 case "$enable_ltdl_convenience" in
743 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
744 "") enable_ltdl_convenience=yes
745 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
747 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
748 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
751 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
752 # the libltdl installable library and INCLTDL to the include flags for
753 # the libltdl header and adds --enable-ltdl-install to the configure
754 # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
755 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
756 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
757 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
758 # with '${top_srcdir}/' (note the single quotes!). If your package is
759 # not flat and you're not using automake, define top_builddir and
760 # top_srcdir appropriately in the Makefiles.
761 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
762 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
763 AC_CHECK_LIB(ltdl, main,
764 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
765 [if test x"$enable_ltdl_install" = xno; then
766 AC_MSG_WARN([libltdl not installed, but installation disabled])
768 enable_ltdl_install=yes
771 if test x"$enable_ltdl_install" = x"yes"; then
772 ac_configure_args="$ac_configure_args --enable-ltdl-install"
773 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
774 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
776 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
783 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
784 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
785 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
786 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
787 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
788 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
789 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
791 dnl This is just to silence aclocal about the macro not being used
792 ifelse([AC_DISABLE_FAST_INSTALL])dnl