* Add this nice filesystem testing tool that I've recently
[dragonfly.git] / crypto / heimdal / aclocal.m4
1 # aclocal.m4t generated automatically by aclocal 1.6.1 -*- Autoconf -*-
2
3 # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 dnl $Id: acinclude.m4,v 1.15 1998/05/23 14:54:53 joda Exp $
15 dnl
16 dnl Only put things that for some reason can't live in the `cf'
17 dnl directory in this file.
18 dnl
19
20 dnl $xId: misc.m4,v 1.1 1997/12/14 15:59:04 joda Exp $
21 dnl
22 define(upcase,`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`)dnl
23
24
25 dnl $Id: misc.m4,v 1.5 2002/05/24 15:35:32 joda Exp $
26 dnl
27 AC_DEFUN([upcase],[`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`])dnl
28 AC_DEFUN([rk_LIBOBJ],[AC_LIBOBJ([$1])])dnl
29 AC_DEFUN([rk_CONFIG_HEADER],[AH_TOP([#ifndef RCSID
30 #define RCSID(msg) \
31 static /**/const char *const rcsid[] = { (const char *)rcsid, "@(#)" msg }
32 #endif
33
34 /* Maximum values on all known systems */
35 #define MaxHostNameLen (64+4)
36 #define MaxPathLen (1024+4)
37
38 ])])
39 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
40
41 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
42
43 # This program is free software; you can redistribute it and/or modify
44 # it under the terms of the GNU General Public License as published by
45 # the Free Software Foundation; either version 2, or (at your option)
46 # any later version.
47
48 # This program is distributed in the hope that it will be useful,
49 # but WITHOUT ANY WARRANTY; without even the implied warranty of
50 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
51 # GNU General Public License for more details.
52
53 # You should have received a copy of the GNU General Public License
54 # along with this program; if not, write to the Free Software
55 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
56 # 02111-1307, USA.
57
58 AC_PREREQ([2.52])
59
60 # serial 6
61
62 # When config.status generates a header, we must update the stamp-h file.
63 # This file resides in the same directory as the config header
64 # that is generated.  We must strip everything past the first ":",
65 # and everything past the last "/".
66
67 # _AM_DIRNAME(PATH)
68 # -----------------
69 # Like AS_DIRNAME, only do it during macro expansion
70 AC_DEFUN([_AM_DIRNAME],
71        [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
72               m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
73                     m4_if(regexp([$1], [^/.*]), -1,
74                           [.],
75                           patsubst([$1], [^\(/\).*], [\1])),
76                     patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
77               patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
78 ])# _AM_DIRNAME
79
80
81 # The stamp files are numbered to have different names.
82 # We could number them on a directory basis, but that's additional
83 # complications, let's have a unique counter.
84 m4_define([_AM_STAMP_Count], [0])
85
86
87 # _AM_STAMP(HEADER)
88 # -----------------
89 # The name of the stamp file for HEADER.
90 AC_DEFUN([_AM_STAMP],
91 [m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
92 AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
93                                [:.*])))/stamp-h[]_AM_STAMP_Count])
94
95
96 # _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
97 # ------------------------------------------------------------
98 # We used to try to get a real timestamp in stamp-h.  But the fear is that
99 # that will cause unnecessary cvs conflicts.
100 AC_DEFUN([_AM_CONFIG_HEADER],
101 [# Add the stamp file to the list of files AC keeps track of,
102 # along with our hook.
103 AC_CONFIG_HEADERS([$1],
104                   [# update the timestamp
105 echo 'timestamp for $1' >"_AM_STAMP([$1])"
106 $2],
107                   [$3])
108 ])# _AM_CONFIG_HEADER
109
110
111 # AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
112 # --------------------------------------------------------------
113 AC_DEFUN([AM_CONFIG_HEADER],
114 [AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
115 ])# AM_CONFIG_HEADER
116
117 # Do all the work for Automake.                            -*- Autoconf -*-
118
119 # This macro actually does too much some checks are only needed if
120 # your package does certain things.  But this isn't really a big deal.
121
122 # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
123 # Free Software Foundation, Inc.
124
125 # This program is free software; you can redistribute it and/or modify
126 # it under the terms of the GNU General Public License as published by
127 # the Free Software Foundation; either version 2, or (at your option)
128 # any later version.
129
130 # This program is distributed in the hope that it will be useful,
131 # but WITHOUT ANY WARRANTY; without even the implied warranty of
132 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
133 # GNU General Public License for more details.
134
135 # You should have received a copy of the GNU General Public License
136 # along with this program; if not, write to the Free Software
137 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
138 # 02111-1307, USA.
139
140 # serial 8
141
142 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
143 # written in clear, in which case automake, when reading aclocal.m4,
144 # will think it sees a *use*, and therefore will trigger all it's
145 # C support machinery.  Also note that it means that autoscan, seeing
146 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
147
148
149 AC_PREREQ([2.52])
150
151 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
152 # the ones we care about.
153 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
154
155 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
156 # AM_INIT_AUTOMAKE([OPTIONS])
157 # -----------------------------------------------
158 # The call with PACKAGE and VERSION arguments is the old style
159 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
160 # and VERSION should now be passed to AC_INIT and removed from
161 # the call to AM_INIT_AUTOMAKE.
162 # We support both call styles for the transition.  After
163 # the next Automake release, Autoconf can make the AC_INIT
164 # arguments mandatory, and then we can depend on a new Autoconf
165 # release and drop the old call support.
166 AC_DEFUN([AM_INIT_AUTOMAKE],
167 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
168  AC_REQUIRE([AC_PROG_INSTALL])dnl
169 # test to see if srcdir already configured
170 if test "`cd $srcdir && pwd`" != "`pwd`" &&
171    test -f $srcdir/config.status; then
172   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
173 fi
174
175 # Define the identity of the package.
176 dnl Distinguish between old-style and new-style calls.
177 m4_ifval([$2],
178 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
179  AC_SUBST([PACKAGE], [$1])dnl
180  AC_SUBST([VERSION], [$2])],
181 [_AM_SET_OPTIONS([$1])dnl
182  AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
183  AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
184
185 _AM_IF_OPTION([no-define],,
186 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
187  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
188
189 # Some tools Automake needs.
190 AC_REQUIRE([AM_SANITY_CHECK])dnl
191 AC_REQUIRE([AC_ARG_PROGRAM])dnl
192 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
193 AM_MISSING_PROG(AUTOCONF, autoconf)
194 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
195 AM_MISSING_PROG(AUTOHEADER, autoheader)
196 AM_MISSING_PROG(MAKEINFO, makeinfo)
197 AM_MISSING_PROG(AMTAR, tar)
198 AM_PROG_INSTALL_SH
199 AM_PROG_INSTALL_STRIP
200 # We need awk for the "check" target.  The system "awk" is bad on
201 # some platforms.
202 AC_REQUIRE([AC_PROG_AWK])dnl
203 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
204
205 _AM_IF_OPTION([no-dependencies],,
206 [AC_PROVIDE_IFELSE([AC_PROG_][CC],
207                   [_AM_DEPENDENCIES(CC)],
208                   [define([AC_PROG_][CC],
209                           defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
210 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
211                   [_AM_DEPENDENCIES(CXX)],
212                   [define([AC_PROG_][CXX],
213                           defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
214 ])
215 ])
216
217 # Copyright 2002  Free Software Foundation, Inc.
218
219 # This program is free software; you can redistribute it and/or modify
220 # it under the terms of the GNU General Public License as published by
221 # the Free Software Foundation; either version 2, or (at your option)
222 # any later version.
223
224 # This program is distributed in the hope that it will be useful,
225 # but WITHOUT ANY WARRANTY; without even the implied warranty of
226 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
227 # GNU General Public License for more details.
228
229 # You should have received a copy of the GNU General Public License
230 # along with this program; if not, write to the Free Software
231 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
232
233 # AM_AUTOMAKE_VERSION(VERSION)
234 # ----------------------------
235 # Automake X.Y traces this macro to ensure aclocal.m4 has been
236 # generated from the m4 files accompanying Automake X.Y.
237 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"])
238
239 # AM_SET_CURRENT_AUTOMAKE_VERSION
240 # -------------------------------
241 # Call AM_AUTOMAKE_VERSION so it can be traced.
242 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
243 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
244          [AM_AUTOMAKE_VERSION([1.6.1])])
245
246 # Helper functions for option handling.                    -*- Autoconf -*-
247
248 # Copyright 2001, 2002  Free Software Foundation, Inc.
249
250 # This program is free software; you can redistribute it and/or modify
251 # it under the terms of the GNU General Public License as published by
252 # the Free Software Foundation; either version 2, or (at your option)
253 # any later version.
254
255 # This program is distributed in the hope that it will be useful,
256 # but WITHOUT ANY WARRANTY; without even the implied warranty of
257 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
258 # GNU General Public License for more details.
259
260 # You should have received a copy of the GNU General Public License
261 # along with this program; if not, write to the Free Software
262 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
263 # 02111-1307, USA.
264
265 # serial 2
266
267 # _AM_MANGLE_OPTION(NAME)
268 # -----------------------
269 AC_DEFUN([_AM_MANGLE_OPTION],
270 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
271
272 # _AM_SET_OPTION(NAME)
273 # ------------------------------
274 # Set option NAME.  Presently that only means defining a flag for this option.
275 AC_DEFUN([_AM_SET_OPTION],
276 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
277
278 # _AM_SET_OPTIONS(OPTIONS)
279 # ----------------------------------
280 # OPTIONS is a space-separated list of Automake options.
281 AC_DEFUN([_AM_SET_OPTIONS],
282 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
283
284 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
285 # -------------------------------------------
286 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
287 AC_DEFUN([_AM_IF_OPTION],
288 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
289
290 #
291 # Check to make sure that the build environment is sane.
292 #
293
294 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
295
296 # This program is free software; you can redistribute it and/or modify
297 # it under the terms of the GNU General Public License as published by
298 # the Free Software Foundation; either version 2, or (at your option)
299 # any later version.
300
301 # This program is distributed in the hope that it will be useful,
302 # but WITHOUT ANY WARRANTY; without even the implied warranty of
303 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
304 # GNU General Public License for more details.
305
306 # You should have received a copy of the GNU General Public License
307 # along with this program; if not, write to the Free Software
308 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
309 # 02111-1307, USA.
310
311 # serial 3
312
313 # AM_SANITY_CHECK
314 # ---------------
315 AC_DEFUN([AM_SANITY_CHECK],
316 [AC_MSG_CHECKING([whether build environment is sane])
317 # Just in case
318 sleep 1
319 echo timestamp > conftest.file
320 # Do `set' in a subshell so we don't clobber the current shell's
321 # arguments.  Must try -L first in case configure is actually a
322 # symlink; some systems play weird games with the mod time of symlinks
323 # (eg FreeBSD returns the mod time of the symlink's containing
324 # directory).
325 if (
326    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
327    if test "$[*]" = "X"; then
328       # -L didn't work.
329       set X `ls -t $srcdir/configure conftest.file`
330    fi
331    rm -f conftest.file
332    if test "$[*]" != "X $srcdir/configure conftest.file" \
333       && test "$[*]" != "X conftest.file $srcdir/configure"; then
334
335       # If neither matched, then we have a broken ls.  This can happen
336       # if, for instance, CONFIG_SHELL is bash and it inherits a
337       # broken ls alias from the environment.  This has actually
338       # happened.  Such a system could not be considered "sane".
339       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
340 alias in your environment])
341    fi
342
343    test "$[2]" = conftest.file
344    )
345 then
346    # Ok.
347    :
348 else
349    AC_MSG_ERROR([newly created file is older than distributed files!
350 Check your system clock])
351 fi
352 AC_MSG_RESULT(yes)])
353
354 #  -*- Autoconf -*-
355
356
357 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
358
359 # This program is free software; you can redistribute it and/or modify
360 # it under the terms of the GNU General Public License as published by
361 # the Free Software Foundation; either version 2, or (at your option)
362 # any later version.
363
364 # This program is distributed in the hope that it will be useful,
365 # but WITHOUT ANY WARRANTY; without even the implied warranty of
366 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
367 # GNU General Public License for more details.
368
369 # You should have received a copy of the GNU General Public License
370 # along with this program; if not, write to the Free Software
371 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
372 # 02111-1307, USA.
373
374 # serial 3
375
376 # AM_MISSING_PROG(NAME, PROGRAM)
377 # ------------------------------
378 AC_DEFUN([AM_MISSING_PROG],
379 [AC_REQUIRE([AM_MISSING_HAS_RUN])
380 $1=${$1-"${am_missing_run}$2"}
381 AC_SUBST($1)])
382
383
384 # AM_MISSING_HAS_RUN
385 # ------------------
386 # Define MISSING if not defined so far and test if it supports --run.
387 # If it does, set am_missing_run to use it, otherwise, to nothing.
388 AC_DEFUN([AM_MISSING_HAS_RUN],
389 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
390 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
391 # Use eval to expand $SHELL
392 if eval "$MISSING --run true"; then
393   am_missing_run="$MISSING --run "
394 else
395   am_missing_run=
396   AC_MSG_WARN([`missing' script is too old or missing])
397 fi
398 ])
399
400 # AM_AUX_DIR_EXPAND
401
402 # Copyright 2001 Free Software Foundation, Inc.
403
404 # This program is free software; you can redistribute it and/or modify
405 # it under the terms of the GNU General Public License as published by
406 # the Free Software Foundation; either version 2, or (at your option)
407 # any later version.
408
409 # This program is distributed in the hope that it will be useful,
410 # but WITHOUT ANY WARRANTY; without even the implied warranty of
411 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
412 # GNU General Public License for more details.
413
414 # You should have received a copy of the GNU General Public License
415 # along with this program; if not, write to the Free Software
416 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
417 # 02111-1307, USA.
418
419 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
420 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
421 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
422 #
423 # Of course, Automake must honor this variable whenever it calls a
424 # tool from the auxiliary directory.  The problem is that $srcdir (and
425 # therefore $ac_aux_dir as well) can be either absolute or relative,
426 # depending on how configure is run.  This is pretty annoying, since
427 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
428 # source directory, any form will work fine, but in subdirectories a
429 # relative path needs to be adjusted first.
430 #
431 # $ac_aux_dir/missing
432 #    fails when called from a subdirectory if $ac_aux_dir is relative
433 # $top_srcdir/$ac_aux_dir/missing
434 #    fails if $ac_aux_dir is absolute,
435 #    fails when called from a subdirectory in a VPATH build with
436 #          a relative $ac_aux_dir
437 #
438 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
439 # are both prefixed by $srcdir.  In an in-source build this is usually
440 # harmless because $srcdir is `.', but things will broke when you
441 # start a VPATH build or use an absolute $srcdir.
442 #
443 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
444 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
445 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
446 # and then we would define $MISSING as
447 #   MISSING="\${SHELL} $am_aux_dir/missing"
448 # This will work as long as MISSING is not called from configure, because
449 # unfortunately $(top_srcdir) has no meaning in configure.
450 # However there are other variables, like CC, which are often used in
451 # configure, and could therefore not use this "fixed" $ac_aux_dir.
452 #
453 # Another solution, used here, is to always expand $ac_aux_dir to an
454 # absolute PATH.  The drawback is that using absolute paths prevent a
455 # configured tree to be moved without reconfiguration.
456
457 # Rely on autoconf to set up CDPATH properly.
458 AC_PREREQ([2.50])
459
460 AC_DEFUN([AM_AUX_DIR_EXPAND], [
461 # expand $ac_aux_dir to an absolute path
462 am_aux_dir=`cd $ac_aux_dir && pwd`
463 ])
464
465 # AM_PROG_INSTALL_SH
466 # ------------------
467 # Define $install_sh.
468
469 # Copyright 2001 Free Software Foundation, Inc.
470
471 # This program is free software; you can redistribute it and/or modify
472 # it under the terms of the GNU General Public License as published by
473 # the Free Software Foundation; either version 2, or (at your option)
474 # any later version.
475
476 # This program is distributed in the hope that it will be useful,
477 # but WITHOUT ANY WARRANTY; without even the implied warranty of
478 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
479 # GNU General Public License for more details.
480
481 # You should have received a copy of the GNU General Public License
482 # along with this program; if not, write to the Free Software
483 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
484 # 02111-1307, USA.
485
486 AC_DEFUN([AM_PROG_INSTALL_SH],
487 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
488 install_sh=${install_sh-"$am_aux_dir/install-sh"}
489 AC_SUBST(install_sh)])
490
491 # AM_PROG_INSTALL_STRIP
492
493 # Copyright 2001 Free Software Foundation, Inc.
494
495 # This program is free software; you can redistribute it and/or modify
496 # it under the terms of the GNU General Public License as published by
497 # the Free Software Foundation; either version 2, or (at your option)
498 # any later version.
499
500 # This program is distributed in the hope that it will be useful,
501 # but WITHOUT ANY WARRANTY; without even the implied warranty of
502 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
503 # GNU General Public License for more details.
504
505 # You should have received a copy of the GNU General Public License
506 # along with this program; if not, write to the Free Software
507 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
508 # 02111-1307, USA.
509
510 # One issue with vendor `install' (even GNU) is that you can't
511 # specify the program used to strip binaries.  This is especially
512 # annoying in cross-compiling environments, where the build's strip
513 # is unlikely to handle the host's binaries.
514 # Fortunately install-sh will honor a STRIPPROG variable, so we
515 # always use install-sh in `make install-strip', and initialize
516 # STRIPPROG with the value of the STRIP variable (set by the user).
517 AC_DEFUN([AM_PROG_INSTALL_STRIP],
518 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
519 # Installed binaries are usually stripped using `strip' when the user
520 # run `make install-strip'.  However `strip' might not be the right
521 # tool to use in cross-compilation environments, therefore Automake
522 # will honor the `STRIP' environment variable to overrule this program.
523 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
524 if test "$cross_compiling" != no; then
525   AC_CHECK_TOOL([STRIP], [strip], :)
526 fi
527 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
528 AC_SUBST([INSTALL_STRIP_PROGRAM])])
529
530 # serial 4                                              -*- Autoconf -*-
531
532 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
533
534 # This program is free software; you can redistribute it and/or modify
535 # it under the terms of the GNU General Public License as published by
536 # the Free Software Foundation; either version 2, or (at your option)
537 # any later version.
538
539 # This program is distributed in the hope that it will be useful,
540 # but WITHOUT ANY WARRANTY; without even the implied warranty of
541 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
542 # GNU General Public License for more details.
543
544 # You should have received a copy of the GNU General Public License
545 # along with this program; if not, write to the Free Software
546 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
547 # 02111-1307, USA.
548
549
550 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
551 # written in clear, in which case automake, when reading aclocal.m4,
552 # will think it sees a *use*, and therefore will trigger all it's
553 # C support machinery.  Also note that it means that autoscan, seeing
554 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
555
556
557
558 # _AM_DEPENDENCIES(NAME)
559 # ----------------------
560 # See how the compiler implements dependency checking.
561 # NAME is "CC", "CXX", "GCJ", or "OBJC".
562 # We try a few techniques and use that to set a single cache variable.
563 #
564 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
565 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
566 # dependency, and given that the user is not expected to run this macro,
567 # just rely on AC_PROG_CC.
568 AC_DEFUN([_AM_DEPENDENCIES],
569 [AC_REQUIRE([AM_SET_DEPDIR])dnl
570 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
571 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
572 AC_REQUIRE([AM_DEP_TRACK])dnl
573
574 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
575        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
576        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
577        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
578                    [depcc="$$1"   am_compiler_list=])
579
580 AC_CACHE_CHECK([dependency style of $depcc],
581                [am_cv_$1_dependencies_compiler_type],
582 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
583   # We make a subdir and do the tests there.  Otherwise we can end up
584   # making bogus files that we don't know about and never remove.  For
585   # instance it was reported that on HP-UX the gcc test will end up
586   # making a dummy file named `D' -- because `-MD' means `put the output
587   # in D'.
588   mkdir conftest.dir
589   # Copy depcomp to subdir because otherwise we won't find it if we're
590   # using a relative directory.
591   cp "$am_depcomp" conftest.dir
592   cd conftest.dir
593
594   am_cv_$1_dependencies_compiler_type=none
595   if test "$am_compiler_list" = ""; then
596      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
597   fi
598   for depmode in $am_compiler_list; do
599     # We need to recreate these files for each test, as the compiler may
600     # overwrite some of them when testing with obscure command lines.
601     # This happens at least with the AIX C compiler.
602     echo '#include "conftest.h"' > conftest.c
603     echo 'int i;' > conftest.h
604     echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
605
606     case $depmode in
607     nosideeffect)
608       # after this tag, mechanisms are not by side-effect, so they'll
609       # only be used when explicitly requested
610       if test "x$enable_dependency_tracking" = xyes; then
611         continue
612       else
613         break
614       fi
615       ;;
616     none) break ;;
617     esac
618     # We check with `-c' and `-o' for the sake of the "dashmstdout"
619     # mode.  It turns out that the SunPro C++ compiler does not properly
620     # handle `-M -o', and we need to detect this.
621     if depmode=$depmode \
622        source=conftest.c object=conftest.o \
623        depfile=conftest.Po tmpdepfile=conftest.TPo \
624        $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
625        grep conftest.h conftest.Po > /dev/null 2>&1 &&
626        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
627       am_cv_$1_dependencies_compiler_type=$depmode
628       break
629     fi
630   done
631
632   cd ..
633   rm -rf conftest.dir
634 else
635   am_cv_$1_dependencies_compiler_type=none
636 fi
637 ])
638 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
639 ])
640
641
642 # AM_SET_DEPDIR
643 # -------------
644 # Choose a directory name for dependency files.
645 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
646 AC_DEFUN([AM_SET_DEPDIR],
647 [rm -f .deps 2>/dev/null
648 mkdir .deps 2>/dev/null
649 if test -d .deps; then
650   DEPDIR=.deps
651 else
652   # MS-DOS does not allow filenames that begin with a dot.
653   DEPDIR=_deps
654 fi
655 rmdir .deps 2>/dev/null
656 AC_SUBST([DEPDIR])
657 ])
658
659
660 # AM_DEP_TRACK
661 # ------------
662 AC_DEFUN([AM_DEP_TRACK],
663 [AC_ARG_ENABLE(dependency-tracking,
664 [  --disable-dependency-tracking Speeds up one-time builds
665   --enable-dependency-tracking  Do not reject slow dependency extractors])
666 if test "x$enable_dependency_tracking" != xno; then
667   am_depcomp="$ac_aux_dir/depcomp"
668   AMDEPBACKSLASH='\'
669 fi
670 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
671 AC_SUBST([AMDEPBACKSLASH])
672 ])
673
674 # Generate code to set up dependency tracking.   -*- Autoconf -*-
675
676 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
677
678 # This program is free software; you can redistribute it and/or modify
679 # it under the terms of the GNU General Public License as published by
680 # the Free Software Foundation; either version 2, or (at your option)
681 # any later version.
682
683 # This program is distributed in the hope that it will be useful,
684 # but WITHOUT ANY WARRANTY; without even the implied warranty of
685 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
686 # GNU General Public License for more details.
687
688 # You should have received a copy of the GNU General Public License
689 # along with this program; if not, write to the Free Software
690 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
691 # 02111-1307, USA.
692
693 #serial 2
694
695 # _AM_OUTPUT_DEPENDENCY_COMMANDS
696 # ------------------------------
697 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
698 [for mf in $CONFIG_FILES; do
699   # Strip MF so we end up with the name of the file.
700   mf=`echo "$mf" | sed -e 's/:.*$//'`
701   if (sed 1q $mf | fgrep 'generated by automake') > /dev/null 2>&1; then
702     dirpart=`AS_DIRNAME("$mf")`
703   else
704     continue
705   fi
706   grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
707   # Extract the definition of DEP_FILES from the Makefile without
708   # running `make'.
709   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
710   test -z "$DEPDIR" && continue
711   # When using ansi2knr, U may be empty or an underscore; expand it
712   U=`sed -n -e '/^U = / s///p' < "$mf"`
713   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
714   # We invoke sed twice because it is the simplest approach to
715   # changing $(DEPDIR) to its actual value in the expansion.
716   for file in `sed -n -e '
717     /^DEP_FILES = .*\\\\$/ {
718       s/^DEP_FILES = //
719       :loop
720         s/\\\\$//
721         p
722         n
723         /\\\\$/ b loop
724       p
725     }
726     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
727        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
728     # Make sure the directory exists.
729     test -f "$dirpart/$file" && continue
730     fdir=`AS_DIRNAME(["$file"])`
731     AS_MKDIR_P([$dirpart/$fdir])
732     # echo "creating $dirpart/$file"
733     echo '# dummy' > "$dirpart/$file"
734   done
735 done
736 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
737
738
739 # AM_OUTPUT_DEPENDENCY_COMMANDS
740 # -----------------------------
741 # This macro should only be invoked once -- use via AC_REQUIRE.
742 #
743 # This code is only required when automatic dependency tracking
744 # is enabled.  FIXME.  This creates each `.P' file that we will
745 # need in order to bootstrap the dependency handling code.
746 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
747 [AC_CONFIG_COMMANDS([depfiles],
748      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
749      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
750 ])
751
752 # Copyright 2001 Free Software Foundation, Inc.             -*- Autoconf -*-
753
754 # This program is free software; you can redistribute it and/or modify
755 # it under the terms of the GNU General Public License as published by
756 # the Free Software Foundation; either version 2, or (at your option)
757 # any later version.
758
759 # This program is distributed in the hope that it will be useful,
760 # but WITHOUT ANY WARRANTY; without even the implied warranty of
761 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
762 # GNU General Public License for more details.
763
764 # You should have received a copy of the GNU General Public License
765 # along with this program; if not, write to the Free Software
766 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
767 # 02111-1307, USA.
768
769 # serial 2
770
771 # AM_MAKE_INCLUDE()
772 # -----------------
773 # Check to see how make treats includes.
774 AC_DEFUN([AM_MAKE_INCLUDE],
775 [am_make=${MAKE-make}
776 cat > confinc << 'END'
777 doit:
778         @echo done
779 END
780 # If we don't find an include directive, just comment out the code.
781 AC_MSG_CHECKING([for style of include used by $am_make])
782 am__include="#"
783 am__quote=
784 _am_result=none
785 # First try GNU make style include.
786 echo "include confinc" > confmf
787 # We grep out `Entering directory' and `Leaving directory'
788 # messages which can occur if `w' ends up in MAKEFLAGS.
789 # In particular we don't look at `^make:' because GNU make might
790 # be invoked under some other name (usually "gmake"), in which
791 # case it prints its new name instead of `make'.
792 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
793    am__include=include
794    am__quote=
795    _am_result=GNU
796 fi
797 # Now try BSD make style include.
798 if test "$am__include" = "#"; then
799    echo '.include "confinc"' > confmf
800    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
801       am__include=.include
802       am__quote="\""
803       _am_result=BSD
804    fi
805 fi
806 AC_SUBST(am__include)
807 AC_SUBST(am__quote)
808 AC_MSG_RESULT($_am_result)
809 rm -f confinc confmf
810 ])
811
812 # AM_CONDITIONAL                                              -*- Autoconf -*-
813
814 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
815
816 # This program is free software; you can redistribute it and/or modify
817 # it under the terms of the GNU General Public License as published by
818 # the Free Software Foundation; either version 2, or (at your option)
819 # any later version.
820
821 # This program is distributed in the hope that it will be useful,
822 # but WITHOUT ANY WARRANTY; without even the implied warranty of
823 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
824 # GNU General Public License for more details.
825
826 # You should have received a copy of the GNU General Public License
827 # along with this program; if not, write to the Free Software
828 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
829 # 02111-1307, USA.
830
831 # serial 5
832
833 AC_PREREQ(2.52)
834
835 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
836 # -------------------------------------
837 # Define a conditional.
838 AC_DEFUN([AM_CONDITIONAL],
839 [ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
840         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
841 AC_SUBST([$1_TRUE])
842 AC_SUBST([$1_FALSE])
843 if $2; then
844   $1_TRUE=
845   $1_FALSE='#'
846 else
847   $1_TRUE='#'
848   $1_FALSE=
849 fi
850 AC_CONFIG_COMMANDS_PRE(
851 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
852   AC_MSG_ERROR([conditional \"$1\" was never defined.
853 Usually this means the macro was only invoked conditionally.])
854 fi])])
855
856
857 # Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
858
859 # This program is free software; you can redistribute it and/or modify
860 # it under the terms of the GNU General Public License as published by
861 # the Free Software Foundation; either version 2, or (at your option)
862 # any later version.
863
864 # This program is distributed in the hope that it will be useful,
865 # but WITHOUT ANY WARRANTY; without even the implied warranty of
866 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
867 # GNU General Public License for more details.
868
869 # You should have received a copy of the GNU General Public License
870 # along with this program; if not, write to the Free Software
871 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
872 # 02111-1307, USA.
873
874 # serial 3
875
876 AC_PREREQ(2.50)
877
878 # AM_PROG_LEX
879 # -----------
880 # Autoconf leaves LEX=: if lex or flex can't be found.  Change that to a
881 # "missing" invocation, for better error output.
882 AC_DEFUN([AM_PROG_LEX],
883 [AC_REQUIRE([AM_MISSING_HAS_RUN])dnl
884 AC_REQUIRE([AC_PROG_LEX])dnl
885 if test "$LEX" = :; then
886   LEX=${am_missing_run}flex
887 fi])
888
889 dnl $Id: krb-prog-ln-s.m4,v 1.1 1997/12/14 15:59:01 joda Exp $
890 dnl
891 dnl
892 dnl Better test for ln -s, ln or cp
893 dnl
894
895 AC_DEFUN(AC_KRB_PROG_LN_S,
896 [AC_MSG_CHECKING(for ln -s or something else)
897 AC_CACHE_VAL(ac_cv_prog_LN_S,
898 [rm -f conftestdata
899 if ln -s X conftestdata 2>/dev/null
900 then
901   rm -f conftestdata
902   ac_cv_prog_LN_S="ln -s"
903 else
904   touch conftestdata1
905   if ln conftestdata1 conftestdata2; then
906     rm -f conftestdata*
907     ac_cv_prog_LN_S=ln
908   else
909     ac_cv_prog_LN_S=cp
910   fi
911 fi])dnl
912 LN_S="$ac_cv_prog_LN_S"
913 AC_MSG_RESULT($ac_cv_prog_LN_S)
914 AC_SUBST(LN_S)dnl
915 ])
916
917
918 dnl $Id: mips-abi.m4,v 1.6 2002/04/30 16:46:05 joda Exp $
919 dnl
920 dnl
921 dnl Check for MIPS/IRIX ABI flags. Sets $abi and $abilibdirext to some
922 dnl value.
923
924 AC_DEFUN(AC_MIPS_ABI, [
925 AC_ARG_WITH(mips_abi,
926         AC_HELP_STRING([--with-mips-abi=abi],[ABI to use for IRIX (32, n32, or 64)]))
927
928 case "$host_os" in
929 irix*)
930 with_mips_abi="${with_mips_abi:-yes}"
931 if test -n "$GCC"; then
932
933 # GCC < 2.8 only supports the O32 ABI. GCC >= 2.8 has a flag to select
934 # which ABI to use, but only supports (as of 2.8.1) the N32 and 64 ABIs.
935 #
936 # Default to N32, but if GCC doesn't grok -mabi=n32, we assume an old
937 # GCC and revert back to O32. The same goes if O32 is asked for - old
938 # GCCs doesn't like the -mabi option, and new GCCs can't output O32.
939 #
940 # Don't you just love *all* the different SGI ABIs?
941
942 case "${with_mips_abi}" in 
943         32|o32) abi='-mabi=32';  abilibdirext=''     ;;
944        n32|yes) abi='-mabi=n32'; abilibdirext='32'  ;;
945         64) abi='-mabi=64';  abilibdirext='64'   ;;
946         no) abi=''; abilibdirext='';;
947          *) AC_MSG_ERROR("Invalid ABI specified") ;;
948 esac
949 if test -n "$abi" ; then
950 ac_foo=krb_cv_gcc_`echo $abi | tr =- __`
951 dnl
952 dnl can't use AC_CACHE_CHECK here, since it doesn't quote CACHE-ID to
953 dnl AC_MSG_RESULT
954 dnl
955 AC_MSG_CHECKING([if $CC supports the $abi option])
956 AC_CACHE_VAL($ac_foo, [
957 save_CFLAGS="$CFLAGS"
958 CFLAGS="$CFLAGS $abi"
959 AC_TRY_COMPILE(,int x;, eval $ac_foo=yes, eval $ac_foo=no)
960 CFLAGS="$save_CFLAGS"
961 ])
962 ac_res=`eval echo \\\$$ac_foo`
963 AC_MSG_RESULT($ac_res)
964 if test $ac_res = no; then
965 # Try to figure out why that failed...
966 case $abi in
967         -mabi=32) 
968         save_CFLAGS="$CFLAGS"
969         CFLAGS="$CFLAGS -mabi=n32"
970         AC_TRY_COMPILE(,int x;, ac_res=yes, ac_res=no)
971         CLAGS="$save_CFLAGS"
972         if test $ac_res = yes; then
973                 # New GCC
974                 AC_MSG_ERROR([$CC does not support the $with_mips_abi ABI])
975         fi
976         # Old GCC
977         abi=''
978         abilibdirext=''
979         ;;
980         -mabi=n32|-mabi=64)
981                 if test $with_mips_abi = yes; then
982                         # Old GCC, default to O32
983                         abi=''
984                         abilibdirext=''
985                 else
986                         # Some broken GCC
987                         AC_MSG_ERROR([$CC does not support the $with_mips_abi ABI])
988                 fi
989         ;;
990 esac
991 fi #if test $ac_res = no; then
992 fi #if test -n "$abi" ; then
993 else
994 case "${with_mips_abi}" in
995         32|o32) abi='-32'; abilibdirext=''     ;;
996        n32|yes) abi='-n32'; abilibdirext='32'  ;;
997         64) abi='-64'; abilibdirext='64'   ;;
998         no) abi=''; abilibdirext='';;
999          *) AC_MSG_ERROR("Invalid ABI specified") ;;
1000 esac
1001 fi #if test -n "$GCC"; then
1002 ;;
1003 esac
1004 ])
1005
1006 dnl
1007 dnl $Id: c-attribute.m4,v 1.2 1999/03/01 09:52:23 joda Exp $
1008 dnl
1009
1010 dnl
1011 dnl Test for __attribute__
1012 dnl
1013
1014 AC_DEFUN(AC_C___ATTRIBUTE__, [
1015 AC_MSG_CHECKING(for __attribute__)
1016 AC_CACHE_VAL(ac_cv___attribute__, [
1017 AC_TRY_COMPILE([
1018 #include <stdlib.h>
1019 ],
1020 [
1021 static void foo(void) __attribute__ ((noreturn));
1022
1023 static void
1024 foo(void)
1025 {
1026   exit(1);
1027 }
1028 ],
1029 ac_cv___attribute__=yes,
1030 ac_cv___attribute__=no)])
1031 if test "$ac_cv___attribute__" = "yes"; then
1032   AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
1033 fi
1034 AC_MSG_RESULT($ac_cv___attribute__)
1035 ])
1036
1037
1038 # libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
1039
1040 # serial 46 AC_PROG_LIBTOOL
1041
1042 AC_DEFUN([AC_PROG_LIBTOOL],
1043 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
1044
1045 # This can be used to rebuild libtool when needed
1046 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
1047
1048 # Always use our own libtool.
1049 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1050 AC_SUBST(LIBTOOL)dnl
1051
1052 # Prevent multiple expansion
1053 define([AC_PROG_LIBTOOL], [])
1054 ])
1055
1056 AC_DEFUN([AC_LIBTOOL_SETUP],
1057 [AC_PREREQ(2.13)dnl
1058 AC_REQUIRE([AC_ENABLE_SHARED])dnl
1059 AC_REQUIRE([AC_ENABLE_STATIC])dnl
1060 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1061 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1062 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1063 AC_REQUIRE([AC_PROG_CC])dnl
1064 AC_REQUIRE([AC_PROG_LD])dnl
1065 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
1066 AC_REQUIRE([AC_PROG_NM])dnl
1067 AC_REQUIRE([AC_PROG_LN_S])dnl
1068 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
1069 AC_REQUIRE([AC_OBJEXT])dnl
1070 AC_REQUIRE([AC_EXEEXT])dnl
1071 dnl
1072
1073 _LT_AC_PROG_ECHO_BACKSLASH
1074 # Only perform the check for file, if the check method requires it
1075 case $deplibs_check_method in
1076 file_magic*)
1077   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1078     AC_PATH_MAGIC
1079   fi
1080   ;;
1081 esac
1082
1083 AC_CHECK_TOOL(RANLIB, ranlib, :)
1084 AC_CHECK_TOOL(STRIP, strip, :)
1085
1086 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
1087 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1088 enable_win32_dll=yes, enable_win32_dll=no)
1089
1090 AC_ARG_ENABLE(libtool-lock,
1091   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
1092 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1093
1094 # Some flags need to be propagated to the compiler or linker for good
1095 # libtool support.
1096 case $host in
1097 *-*-irix6*)
1098   # Find out which ABI we are using.
1099   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1100   if AC_TRY_EVAL(ac_compile); then
1101     case `/usr/bin/file conftest.$ac_objext` in
1102     *32-bit*)
1103       LD="${LD-ld} -32"
1104       ;;
1105     *N32*)
1106       LD="${LD-ld} -n32"
1107       ;;
1108     *64-bit*)
1109       LD="${LD-ld} -64"
1110       ;;
1111     esac
1112   fi
1113   rm -rf conftest*
1114   ;;
1115
1116 *-*-sco3.2v5*)
1117   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1118   SAVE_CFLAGS="$CFLAGS"
1119   CFLAGS="$CFLAGS -belf"
1120   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1121     [AC_LANG_SAVE
1122      AC_LANG_C
1123      AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1124      AC_LANG_RESTORE])
1125   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1126     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1127     CFLAGS="$SAVE_CFLAGS"
1128   fi
1129   ;;
1130
1131 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1132 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
1133   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1134   AC_CHECK_TOOL(AS, as, false)
1135   AC_CHECK_TOOL(OBJDUMP, objdump, false)
1136
1137   # recent cygwin and mingw systems supply a stub DllMain which the user
1138   # can override, but on older systems we have to supply one
1139   AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
1140     [AC_TRY_LINK([],
1141       [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
1142       DllMain (0, 0, 0);],
1143       [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
1144
1145   case $host/$CC in
1146   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
1147     # old mingw systems require "-dll" to link a DLL, while more recent ones
1148     # require "-mdll"
1149     SAVE_CFLAGS="$CFLAGS"
1150     CFLAGS="$CFLAGS -mdll"
1151     AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
1152       [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
1153     CFLAGS="$SAVE_CFLAGS" ;;
1154   *-*-cygwin* | *-*-pw32*)
1155     # cygwin systems need to pass --dll to the linker, and not link
1156     # crt.o which will require a WinMain@16 definition.
1157     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
1158   esac
1159   ;;
1160   ])
1161 esac
1162
1163 _LT_AC_LTCONFIG_HACK
1164
1165 ])
1166
1167 # AC_LIBTOOL_HEADER_ASSERT
1168 # ------------------------
1169 AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
1170 [AC_CACHE_CHECK([whether $CC supports assert without backlinking],
1171     [lt_cv_func_assert_works],
1172     [case $host in
1173     *-*-solaris*)
1174       if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
1175         case `$CC --version 2>/dev/null` in
1176         [[12]].*) lt_cv_func_assert_works=no ;;
1177         *)        lt_cv_func_assert_works=yes ;;
1178         esac
1179       fi
1180       ;;
1181     esac])
1182
1183 if test "x$lt_cv_func_assert_works" = xyes; then
1184   AC_CHECK_HEADERS(assert.h)
1185 fi
1186 ])# AC_LIBTOOL_HEADER_ASSERT
1187
1188 # _LT_AC_CHECK_DLFCN
1189 # --------------------
1190 AC_DEFUN([_LT_AC_CHECK_DLFCN],
1191 [AC_CHECK_HEADERS(dlfcn.h)
1192 ])# _LT_AC_CHECK_DLFCN
1193
1194 # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
1195 # ---------------------------------
1196 AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
1197 [AC_REQUIRE([AC_CANONICAL_HOST])
1198 AC_REQUIRE([AC_PROG_NM])
1199 AC_REQUIRE([AC_OBJEXT])
1200 # Check for command to grab the raw symbol name followed by C symbol from nm.
1201 AC_MSG_CHECKING([command to parse $NM output])
1202 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
1203
1204 # These are sane defaults that work on at least a few old systems.
1205 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
1206
1207 # Character class describing NM global symbol codes.
1208 symcode='[[BCDEGRST]]'
1209
1210 # Regexp to match symbols that can be accessed directly from C.
1211 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
1212
1213 # Transform the above into a raw symbol and a C symbol.
1214 symxfrm='\1 \2\3 \3'
1215
1216 # Transform an extracted symbol line into a proper C declaration
1217 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
1218
1219 # Transform an extracted symbol line into symbol name and symbol address
1220 lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
1221
1222 # Define system-specific variables.
1223 case $host_os in
1224 aix*)
1225   symcode='[[BCDT]]'
1226   ;;
1227 cygwin* | mingw* | pw32*)
1228   symcode='[[ABCDGISTW]]'
1229   ;;
1230 hpux*) # Its linker distinguishes data from code symbols
1231   lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
1232   lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
1233   ;;
1234 irix*)
1235   symcode='[[BCDEGRST]]'
1236   ;;
1237 solaris* | sysv5*)
1238   symcode='[[BDT]]'
1239   ;;
1240 sysv4)
1241   symcode='[[DFNSTU]]'
1242   ;;
1243 esac
1244
1245 # Handle CRLF in mingw tool chain
1246 opt_cr=
1247 case $host_os in
1248 mingw*)
1249   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
1250   ;;
1251 esac
1252
1253 # If we're using GNU nm, then use its standard symbol codes.
1254 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1255   symcode='[[ABCDGISTW]]'
1256 fi
1257
1258 # Try without a prefix undercore, then with it.
1259 for ac_symprfx in "" "_"; do
1260
1261   # Write the raw and C identifiers.
1262 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[        ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
1263
1264   # Check to see that the pipe works correctly.
1265   pipe_works=no
1266   rm -f conftest*
1267   cat > conftest.$ac_ext <<EOF
1268 #ifdef __cplusplus
1269 extern "C" {
1270 #endif
1271 char nm_test_var;
1272 void nm_test_func(){}
1273 #ifdef __cplusplus
1274 }
1275 #endif
1276 int main(){nm_test_var='a';nm_test_func();return(0);}
1277 EOF
1278
1279   if AC_TRY_EVAL(ac_compile); then
1280     # Now try to grab the symbols.
1281     nlist=conftest.nm
1282     if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
1283       # Try sorting and uniquifying the output.
1284       if sort "$nlist" | uniq > "$nlist"T; then
1285         mv -f "$nlist"T "$nlist"
1286       else
1287         rm -f "$nlist"T
1288       fi
1289
1290       # Make sure that we snagged all the symbols we need.
1291       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1292         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1293           cat <<EOF > conftest.$ac_ext
1294 #ifdef __cplusplus
1295 extern "C" {
1296 #endif
1297
1298 EOF
1299           # Now generate the symbol file.
1300           eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
1301
1302           cat <<EOF >> conftest.$ac_ext
1303 #if defined (__STDC__) && __STDC__
1304 # define lt_ptr void *
1305 #else
1306 # define lt_ptr char *
1307 # define const
1308 #endif
1309
1310 /* The mapping between symbol names and symbols. */
1311 const struct {
1312   const char *name;
1313   lt_ptr address;
1314 }
1315 lt_preloaded_symbols[[]] =
1316 {
1317 EOF
1318           sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
1319           cat <<\EOF >> conftest.$ac_ext
1320   {0, (lt_ptr) 0}
1321 };
1322
1323 #ifdef __cplusplus
1324 }
1325 #endif
1326 EOF
1327           # Now try linking the two files.
1328           mv conftest.$ac_objext conftstm.$ac_objext
1329           save_LIBS="$LIBS"
1330           save_CFLAGS="$CFLAGS"
1331           LIBS="conftstm.$ac_objext"
1332           CFLAGS="$CFLAGS$no_builtin_flag"
1333           if AC_TRY_EVAL(ac_link) && test -s conftest; then
1334             pipe_works=yes
1335           fi
1336           LIBS="$save_LIBS"
1337           CFLAGS="$save_CFLAGS"
1338         else
1339           echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
1340         fi
1341       else
1342         echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
1343       fi
1344     else
1345       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
1346     fi
1347   else
1348     echo "$progname: failed program was:" >&AC_FD_CC
1349     cat conftest.$ac_ext >&5
1350   fi
1351   rm -f conftest* conftst*
1352
1353   # Do not use the global_symbol_pipe unless it works.
1354   if test "$pipe_works" = yes; then
1355     break
1356   else
1357     lt_cv_sys_global_symbol_pipe=
1358   fi
1359 done
1360 ])
1361 global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
1362 if test -z "$lt_cv_sys_global_symbol_pipe"; then
1363   global_symbol_to_cdecl=
1364   global_symbol_to_c_name_address=
1365 else
1366   global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
1367   global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
1368 fi
1369 if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
1370 then
1371   AC_MSG_RESULT(failed)
1372 else
1373   AC_MSG_RESULT(ok)
1374 fi
1375 ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
1376
1377 # _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
1378 # ---------------------------------
1379 AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
1380 [# Find the correct PATH separator.  Usually this is `:', but
1381 # DJGPP uses `;' like DOS.
1382 if test "X${PATH_SEPARATOR+set}" != Xset; then
1383   UNAME=${UNAME-`uname 2>/dev/null`}
1384   case X$UNAME in
1385     *-DOS) lt_cv_sys_path_separator=';' ;;
1386     *)     lt_cv_sys_path_separator=':' ;;
1387   esac
1388   PATH_SEPARATOR=$lt_cv_sys_path_separator
1389 fi
1390 ])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
1391
1392 # _LT_AC_PROG_ECHO_BACKSLASH
1393 # --------------------------
1394 # Add some code to the start of the generated configure script which
1395 # will find an echo command which doesn't interpret backslashes.
1396 AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
1397 [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1398                               [AC_DIVERT_PUSH(NOTICE)])
1399 _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
1400
1401 # Check that we are running under the correct shell.
1402 SHELL=${CONFIG_SHELL-/bin/sh}
1403
1404 case X$ECHO in
1405 X*--fallback-echo)
1406   # Remove one level of quotation (which was required for Make).
1407   ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1408   ;;
1409 esac
1410
1411 echo=${ECHO-echo}
1412 if test "X[$]1" = X--no-reexec; then
1413   # Discard the --no-reexec flag, and continue.
1414   shift
1415 elif test "X[$]1" = X--fallback-echo; then
1416   # Avoid inline document here, it may be left over
1417   :
1418 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
1419   # Yippee, $echo works!
1420   :
1421 else
1422   # Restart under the correct shell.
1423   exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1424 fi
1425
1426 if test "X[$]1" = X--fallback-echo; then
1427   # used as fallback echo
1428   shift
1429   cat <<EOF
1430 $*
1431 EOF
1432   exit 0
1433 fi
1434
1435 # The HP-UX ksh and POSIX shell print the target directory to stdout
1436 # if CDPATH is set.
1437 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
1438
1439 if test -z "$ECHO"; then
1440 if test "X${echo_test_string+set}" != Xset; then
1441 # find a string as large as possible, as long as the shell can cope with it
1442   for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1443     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1444     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
1445        echo_test_string="`eval $cmd`" &&
1446        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
1447     then
1448       break
1449     fi
1450   done
1451 fi
1452
1453 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
1454    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
1455    test "X$echo_testing_string" = "X$echo_test_string"; then
1456   :
1457 else
1458   # The Solaris, AIX, and Digital Unix default echo programs unquote
1459   # backslashes.  This makes it impossible to quote backslashes using
1460   #   echo "$something" | sed 's/\\/\\\\/g'
1461   #
1462   # So, first we look for a working echo in the user's PATH.
1463
1464   IFS="${IFS=   }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1465   for dir in $PATH /usr/ucb; do
1466     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1467        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1468        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1469        test "X$echo_testing_string" = "X$echo_test_string"; then
1470       echo="$dir/echo"
1471       break
1472     fi
1473   done
1474   IFS="$save_ifs"
1475
1476   if test "X$echo" = Xecho; then
1477     # We didn't find a better echo, so look for alternatives.
1478     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
1479        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
1480        test "X$echo_testing_string" = "X$echo_test_string"; then
1481       # This shell has a builtin print -r that does the trick.
1482       echo='print -r'
1483     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
1484          test "X$CONFIG_SHELL" != X/bin/ksh; then
1485       # If we have ksh, try running configure again with it.
1486       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1487       export ORIGINAL_CONFIG_SHELL
1488       CONFIG_SHELL=/bin/ksh
1489       export CONFIG_SHELL
1490       exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1491     else
1492       # Try using printf.
1493       echo='printf %s\n'
1494       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
1495          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
1496          test "X$echo_testing_string" = "X$echo_test_string"; then
1497         # Cool, printf works
1498         :
1499       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1500            test "X$echo_testing_string" = 'X\t' &&
1501            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1502            test "X$echo_testing_string" = "X$echo_test_string"; then
1503         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1504         export CONFIG_SHELL
1505         SHELL="$CONFIG_SHELL"
1506         export SHELL
1507         echo="$CONFIG_SHELL [$]0 --fallback-echo"
1508       elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1509            test "X$echo_testing_string" = 'X\t' &&
1510            echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1511            test "X$echo_testing_string" = "X$echo_test_string"; then
1512         echo="$CONFIG_SHELL [$]0 --fallback-echo"
1513       else
1514         # maybe with a smaller string...
1515         prev=:
1516
1517         for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1518           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
1519           then
1520             break
1521           fi
1522           prev="$cmd"
1523         done
1524
1525         if test "$prev" != 'sed 50q "[$]0"'; then
1526           echo_test_string=`eval $prev`
1527           export echo_test_string
1528           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1529         else
1530           # Oops.  We lost completely, so just stick with echo.
1531           echo=echo
1532         fi
1533       fi
1534     fi
1535   fi
1536 fi
1537 fi
1538
1539 # Copy echo and quote the copy suitably for passing to libtool from
1540 # the Makefile, instead of quoting the original, which is used later.
1541 ECHO=$echo
1542 if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1543    ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1544 fi
1545
1546 AC_SUBST(ECHO)
1547 AC_DIVERT_POP
1548 ])# _LT_AC_PROG_ECHO_BACKSLASH
1549
1550 # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1551 #                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1552 # ------------------------------------------------------------------
1553 AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
1554 [if test "$cross_compiling" = yes; then :
1555   [$4]
1556 else
1557   AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
1558   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1559   lt_status=$lt_dlunknown
1560   cat > conftest.$ac_ext <<EOF
1561 [#line __oline__ "configure"
1562 #include "confdefs.h"
1563
1564 #if HAVE_DLFCN_H
1565 #include <dlfcn.h>
1566 #endif
1567
1568 #include <stdio.h>
1569
1570 #ifdef RTLD_GLOBAL
1571 #  define LT_DLGLOBAL           RTLD_GLOBAL
1572 #else
1573 #  ifdef DL_GLOBAL
1574 #    define LT_DLGLOBAL         DL_GLOBAL
1575 #  else
1576 #    define LT_DLGLOBAL         0
1577 #  endif
1578 #endif
1579
1580 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1581    find out it does not work in some platform. */
1582 #ifndef LT_DLLAZY_OR_NOW
1583 #  ifdef RTLD_LAZY
1584 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
1585 #  else
1586 #    ifdef DL_LAZY
1587 #      define LT_DLLAZY_OR_NOW          DL_LAZY
1588 #    else
1589 #      ifdef RTLD_NOW
1590 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
1591 #      else
1592 #        ifdef DL_NOW
1593 #          define LT_DLLAZY_OR_NOW      DL_NOW
1594 #        else
1595 #          define LT_DLLAZY_OR_NOW      0
1596 #        endif
1597 #      endif
1598 #    endif
1599 #  endif
1600 #endif
1601
1602 #ifdef __cplusplus
1603 extern "C" void exit (int);
1604 #endif
1605
1606 void fnord() { int i=42;}
1607 int main ()
1608 {
1609   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1610   int status = $lt_dlunknown;
1611
1612   if (self)
1613     {
1614       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1615       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1616       /* dlclose (self); */
1617     }
1618
1619     exit (status);
1620 }]
1621 EOF
1622   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1623     (./conftest; exit; ) 2>/dev/null
1624     lt_status=$?
1625     case x$lt_status in
1626       x$lt_dlno_uscore) $1 ;;
1627       x$lt_dlneed_uscore) $2 ;;
1628       x$lt_unknown|x*) $3 ;;
1629     esac
1630   else :
1631     # compilation failed
1632     $3
1633   fi
1634 fi
1635 rm -fr conftest*
1636 ])# _LT_AC_TRY_DLOPEN_SELF
1637
1638 # AC_LIBTOOL_DLOPEN_SELF
1639 # -------------------
1640 AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
1641 [if test "x$enable_dlopen" != xyes; then
1642   enable_dlopen=unknown
1643   enable_dlopen_self=unknown
1644   enable_dlopen_self_static=unknown
1645 else
1646   lt_cv_dlopen=no
1647   lt_cv_dlopen_libs=
1648
1649   case $host_os in
1650   beos*)
1651     lt_cv_dlopen="load_add_on"
1652     lt_cv_dlopen_libs=
1653     lt_cv_dlopen_self=yes
1654     ;;
1655
1656   cygwin* | mingw* | pw32*)
1657     lt_cv_dlopen="LoadLibrary"
1658     lt_cv_dlopen_libs=
1659    ;;
1660
1661   *)
1662     AC_CHECK_FUNC([shl_load],
1663           [lt_cv_dlopen="shl_load"],
1664       [AC_CHECK_LIB([dld], [shl_load],
1665             [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
1666         [AC_CHECK_FUNC([dlopen],
1667               [lt_cv_dlopen="dlopen"],
1668           [AC_CHECK_LIB([dl], [dlopen],
1669                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1670             [AC_CHECK_LIB([svld], [dlopen],
1671                   [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1672               [AC_CHECK_LIB([dld], [dld_link],
1673                     [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
1674               ])
1675             ])
1676           ])
1677         ])
1678       ])
1679     ;;
1680   esac
1681
1682   if test "x$lt_cv_dlopen" != xno; then
1683     enable_dlopen=yes
1684   else
1685     enable_dlopen=no
1686   fi
1687
1688   case $lt_cv_dlopen in
1689   dlopen)
1690     save_CPPFLAGS="$CPPFLAGS"
1691     AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
1692     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1693
1694     save_LDFLAGS="$LDFLAGS"
1695     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1696
1697     save_LIBS="$LIBS"
1698     LIBS="$lt_cv_dlopen_libs $LIBS"
1699
1700     AC_CACHE_CHECK([whether a program can dlopen itself],
1701           lt_cv_dlopen_self, [dnl
1702           _LT_AC_TRY_DLOPEN_SELF(
1703             lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1704             lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1705     ])
1706
1707     if test "x$lt_cv_dlopen_self" = xyes; then
1708       LDFLAGS="$LDFLAGS $link_static_flag"
1709       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1710           lt_cv_dlopen_self_static, [dnl
1711           _LT_AC_TRY_DLOPEN_SELF(
1712             lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1713             lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1714       ])
1715     fi
1716
1717     CPPFLAGS="$save_CPPFLAGS"
1718     LDFLAGS="$save_LDFLAGS"
1719     LIBS="$save_LIBS"
1720     ;;
1721   esac
1722
1723   case $lt_cv_dlopen_self in
1724   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1725   *) enable_dlopen_self=unknown ;;
1726   esac
1727
1728   case $lt_cv_dlopen_self_static in
1729   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1730   *) enable_dlopen_self_static=unknown ;;
1731   esac
1732 fi
1733 ])# AC_LIBTOOL_DLOPEN_SELF
1734
1735 AC_DEFUN([_LT_AC_LTCONFIG_HACK],
1736 [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
1737 # Sed substitution that helps us do robust quoting.  It backslashifies
1738 # metacharacters that are still active within double-quoted strings.
1739 Xsed='sed -e s/^X//'
1740 sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
1741
1742 # Same as above, but do not quote variable references.
1743 double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
1744
1745 # Sed substitution to delay expansion of an escaped shell variable in a
1746 # double_quote_subst'ed string.
1747 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1748
1749 # Constants:
1750 rm="rm -f"
1751
1752 # Global variables:
1753 default_ofile=libtool
1754 can_build_shared=yes
1755
1756 # All known linkers require a `.a' archive for static linking (except M$VC,
1757 # which needs '.lib').
1758 libext=a
1759 ltmain="$ac_aux_dir/ltmain.sh"
1760 ofile="$default_ofile"
1761 with_gnu_ld="$lt_cv_prog_gnu_ld"
1762 need_locks="$enable_libtool_lock"
1763
1764 old_CC="$CC"
1765 old_CFLAGS="$CFLAGS"
1766
1767 # Set sane defaults for various variables
1768 test -z "$AR" && AR=ar
1769 test -z "$AR_FLAGS" && AR_FLAGS=cru
1770 test -z "$AS" && AS=as
1771 test -z "$CC" && CC=cc
1772 test -z "$DLLTOOL" && DLLTOOL=dlltool
1773 test -z "$LD" && LD=ld
1774 test -z "$LN_S" && LN_S="ln -s"
1775 test -z "$MAGIC_CMD" && MAGIC_CMD=file
1776 test -z "$NM" && NM=nm
1777 test -z "$OBJDUMP" && OBJDUMP=objdump
1778 test -z "$RANLIB" && RANLIB=:
1779 test -z "$STRIP" && STRIP=:
1780 test -z "$ac_objext" && ac_objext=o
1781
1782 if test x"$host" != x"$build"; then
1783   ac_tool_prefix=${host_alias}-
1784 else
1785   ac_tool_prefix=
1786 fi
1787
1788 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
1789 case $host_os in
1790 linux-gnu*) ;;
1791 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
1792 esac
1793
1794 case $host_os in
1795 aix3*)
1796   # AIX sometimes has problems with the GCC collect2 program.  For some
1797   # reason, if we set the COLLECT_NAMES environment variable, the problems
1798   # vanish in a puff of smoke.
1799   if test "X${COLLECT_NAMES+set}" != Xset; then
1800     COLLECT_NAMES=
1801     export COLLECT_NAMES
1802   fi
1803   ;;
1804 esac
1805
1806 # Determine commands to create old-style static archives.
1807 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
1808 old_postinstall_cmds='chmod 644 $oldlib'
1809 old_postuninstall_cmds=
1810
1811 if test -n "$RANLIB"; then
1812   case $host_os in
1813   openbsd*)
1814     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
1815     ;;
1816   *)
1817     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
1818     ;;
1819   esac
1820   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1821 fi
1822
1823 # Allow CC to be a program name with arguments.
1824 set dummy $CC
1825 compiler="[$]2"
1826
1827 AC_MSG_CHECKING([for objdir])
1828 rm -f .libs 2>/dev/null
1829 mkdir .libs 2>/dev/null
1830 if test -d .libs; then
1831   objdir=.libs
1832 else
1833   # MS-DOS does not allow filenames that begin with a dot.
1834   objdir=_libs
1835 fi
1836 rmdir .libs 2>/dev/null
1837 AC_MSG_RESULT($objdir)
1838
1839
1840 AC_ARG_WITH(pic,
1841 [  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
1842 pic_mode="$withval", pic_mode=default)
1843 test -z "$pic_mode" && pic_mode=default
1844
1845 # We assume here that the value for lt_cv_prog_cc_pic will not be cached
1846 # in isolation, and that seeing it set (from the cache) indicates that
1847 # the associated values are set (in the cache) correctly too.
1848 AC_MSG_CHECKING([for $compiler option to produce PIC])
1849 AC_CACHE_VAL(lt_cv_prog_cc_pic,
1850 [ lt_cv_prog_cc_pic=
1851   lt_cv_prog_cc_shlib=
1852   lt_cv_prog_cc_wl=
1853   lt_cv_prog_cc_static=
1854   lt_cv_prog_cc_no_builtin=
1855   lt_cv_prog_cc_can_build_shared=$can_build_shared
1856
1857   if test "$GCC" = yes; then
1858     lt_cv_prog_cc_wl='-Wl,'
1859     lt_cv_prog_cc_static='-static'
1860
1861     case $host_os in
1862     aix*)
1863       # Below there is a dirty hack to force normal static linking with -ldl
1864       # The problem is because libdl dynamically linked with both libc and
1865       # libC (AIX C++ library), which obviously doesn't included in libraries
1866       # list by gcc. This cause undefined symbols with -static flags.
1867       # This hack allows C programs to be linked with "-static -ldl", but
1868       # not sure about C++ programs.
1869       lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
1870       ;;
1871     amigaos*)
1872       # FIXME: we need at least 68020 code to build shared libraries, but
1873       # adding the `-m68020' flag to GCC prevents building anything better,
1874       # like `-m68040'.
1875       lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
1876       ;;
1877     beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
1878       # PIC is the default for these OSes.
1879       ;;
1880     darwin* | rhapsody*)
1881       # PIC is the default on this platform
1882       # Common symbols not allowed in MH_DYLIB files
1883       lt_cv_prog_cc_pic='-fno-common'
1884       ;;
1885     cygwin* | mingw* | pw32* | os2*)
1886       # This hack is so that the source file can tell whether it is being
1887       # built for inclusion in a dll (and should export symbols for example).
1888       lt_cv_prog_cc_pic='-DDLL_EXPORT'
1889       ;;
1890     sysv4*MP*)
1891       if test -d /usr/nec; then
1892          lt_cv_prog_cc_pic=-Kconform_pic
1893       fi
1894       ;;
1895     *)
1896       lt_cv_prog_cc_pic='-fPIC'
1897       ;;
1898     esac
1899   else
1900     # PORTME Check for PIC flags for the system compiler.
1901     case $host_os in
1902     aix3* | aix4* | aix5*)
1903       lt_cv_prog_cc_wl='-Wl,'
1904       # All AIX code is PIC.
1905       if test "$host_cpu" = ia64; then
1906         # AIX 5 now supports IA64 processor
1907         lt_cv_prog_cc_static='-Bstatic'
1908       else
1909         lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
1910       fi
1911       ;;
1912
1913     hpux9* | hpux10* | hpux11*)
1914       # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
1915       lt_cv_prog_cc_wl='-Wl,'
1916       lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
1917       lt_cv_prog_cc_pic='+Z'
1918       ;;
1919
1920     irix5* | irix6*)
1921       lt_cv_prog_cc_wl='-Wl,'
1922       lt_cv_prog_cc_static='-non_shared'
1923       # PIC (with -KPIC) is the default.
1924       ;;
1925
1926     cygwin* | mingw* | pw32* | os2*)
1927       # This hack is so that the source file can tell whether it is being
1928       # built for inclusion in a dll (and should export symbols for example).
1929       lt_cv_prog_cc_pic='-DDLL_EXPORT'
1930       ;;
1931
1932     newsos6)
1933       lt_cv_prog_cc_pic='-KPIC'
1934       lt_cv_prog_cc_static='-Bstatic'
1935       ;;
1936
1937     osf3* | osf4* | osf5*)
1938       # All OSF/1 code is PIC.
1939       lt_cv_prog_cc_wl='-Wl,'
1940       lt_cv_prog_cc_static='-non_shared'
1941       ;;
1942
1943     sco3.2v5*)
1944       lt_cv_prog_cc_pic='-Kpic'
1945       lt_cv_prog_cc_static='-dn'
1946       lt_cv_prog_cc_shlib='-belf'
1947       ;;
1948
1949     solaris*)
1950       lt_cv_prog_cc_pic='-KPIC'
1951       lt_cv_prog_cc_static='-Bstatic'
1952       lt_cv_prog_cc_wl='-Wl,'
1953       ;;
1954
1955     sunos4*)
1956       lt_cv_prog_cc_pic='-PIC'
1957       lt_cv_prog_cc_static='-Bstatic'
1958       lt_cv_prog_cc_wl='-Qoption ld '
1959       ;;
1960
1961     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1962       lt_cv_prog_cc_pic='-KPIC'
1963       lt_cv_prog_cc_static='-Bstatic'
1964       if test "x$host_vendor" = xsni; then
1965         lt_cv_prog_cc_wl='-LD'
1966       else
1967         lt_cv_prog_cc_wl='-Wl,'
1968       fi
1969       ;;
1970
1971     uts4*)
1972       lt_cv_prog_cc_pic='-pic'
1973       lt_cv_prog_cc_static='-Bstatic'
1974       ;;
1975
1976     sysv4*MP*)
1977       if test -d /usr/nec ;then
1978         lt_cv_prog_cc_pic='-Kconform_pic'
1979         lt_cv_prog_cc_static='-Bstatic'
1980       fi
1981       ;;
1982
1983     *)
1984       lt_cv_prog_cc_can_build_shared=no
1985       ;;
1986     esac
1987   fi
1988 ])
1989 if test -z "$lt_cv_prog_cc_pic"; then
1990   AC_MSG_RESULT([none])
1991 else
1992   AC_MSG_RESULT([$lt_cv_prog_cc_pic])
1993
1994   # Check to make sure the pic_flag actually works.
1995   AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
1996   AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
1997     save_CFLAGS="$CFLAGS"
1998     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
1999     AC_TRY_COMPILE([], [], [dnl
2000       case $host_os in
2001       hpux9* | hpux10* | hpux11*)
2002         # On HP-UX, both CC and GCC only warn that PIC is supported... then
2003         # they create non-PIC objects.  So, if there were any warnings, we
2004         # assume that PIC is not supported.
2005         if test -s conftest.err; then
2006           lt_cv_prog_cc_pic_works=no
2007         else
2008           lt_cv_prog_cc_pic_works=yes
2009         fi
2010         ;;
2011       *)
2012         lt_cv_prog_cc_pic_works=yes
2013         ;;
2014       esac
2015     ], [dnl
2016       lt_cv_prog_cc_pic_works=no
2017     ])
2018     CFLAGS="$save_CFLAGS"
2019   ])
2020
2021   if test "X$lt_cv_prog_cc_pic_works" = Xno; then
2022     lt_cv_prog_cc_pic=
2023     lt_cv_prog_cc_can_build_shared=no
2024   else
2025     lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
2026   fi
2027
2028   AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
2029 fi
2030
2031 # Check for any special shared library compilation flags.
2032 if test -n "$lt_cv_prog_cc_shlib"; then
2033   AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
2034   if echo "$old_CC $old_CFLAGS " | egrep -e "[[         ]]$lt_cv_prog_cc_shlib[[        ]]" >/dev/null; then :
2035   else
2036    AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
2037     lt_cv_prog_cc_can_build_shared=no
2038   fi
2039 fi
2040
2041 AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
2042 AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
2043   lt_cv_prog_cc_static_works=no
2044   save_LDFLAGS="$LDFLAGS"
2045   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
2046   AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
2047   LDFLAGS="$save_LDFLAGS"
2048 ])
2049
2050 # Belt *and* braces to stop my trousers falling down:
2051 test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
2052 AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
2053
2054 pic_flag="$lt_cv_prog_cc_pic"
2055 special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
2056 wl="$lt_cv_prog_cc_wl"
2057 link_static_flag="$lt_cv_prog_cc_static"
2058 no_builtin_flag="$lt_cv_prog_cc_no_builtin"
2059 can_build_shared="$lt_cv_prog_cc_can_build_shared"
2060
2061
2062 # Check to see if options -o and -c are simultaneously supported by compiler
2063 AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
2064 AC_CACHE_VAL([lt_cv_compiler_c_o], [
2065 $rm -r conftest 2>/dev/null
2066 mkdir conftest
2067 cd conftest
2068 echo "int some_variable = 0;" > conftest.$ac_ext
2069 mkdir out
2070 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
2071 # that will create temporary files in the current directory regardless of
2072 # the output directory.  Thus, making CWD read-only will cause this test
2073 # to fail, enabling locking or at least warning the user not to do parallel
2074 # builds.
2075 chmod -w .
2076 save_CFLAGS="$CFLAGS"
2077 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
2078 compiler_c_o=no
2079 if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
2080   # The compiler can only warn and ignore the option if not recognized
2081   # So say no if there are warnings
2082   if test -s out/conftest.err; then
2083     lt_cv_compiler_c_o=no
2084   else
2085     lt_cv_compiler_c_o=yes
2086   fi
2087 else
2088   # Append any errors to the config.log.
2089   cat out/conftest.err 1>&AC_FD_CC
2090   lt_cv_compiler_c_o=no
2091 fi
2092 CFLAGS="$save_CFLAGS"
2093 chmod u+w .
2094 $rm conftest* out/*
2095 rmdir out
2096 cd ..
2097 rmdir conftest
2098 $rm -r conftest 2>/dev/null
2099 ])
2100 compiler_c_o=$lt_cv_compiler_c_o
2101 AC_MSG_RESULT([$compiler_c_o])
2102
2103 if test x"$compiler_c_o" = x"yes"; then
2104   # Check to see if we can write to a .lo
2105   AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
2106   AC_CACHE_VAL([lt_cv_compiler_o_lo], [
2107   lt_cv_compiler_o_lo=no
2108   save_CFLAGS="$CFLAGS"
2109   CFLAGS="$CFLAGS -c -o conftest.lo"
2110   save_objext="$ac_objext"
2111   ac_objext=lo
2112   AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
2113     # The compiler can only warn and ignore the option if not recognized
2114     # So say no if there are warnings
2115     if test -s conftest.err; then
2116       lt_cv_compiler_o_lo=no
2117     else
2118       lt_cv_compiler_o_lo=yes
2119     fi
2120   ])
2121   ac_objext="$save_objext"
2122   CFLAGS="$save_CFLAGS"
2123   ])
2124   compiler_o_lo=$lt_cv_compiler_o_lo
2125   AC_MSG_RESULT([$compiler_o_lo])
2126 else
2127   compiler_o_lo=no
2128 fi
2129
2130 # Check to see if we can do hard links to lock some files if needed
2131 hard_links="nottested"
2132 if test "$compiler_c_o" = no && test "$need_locks" != no; then
2133   # do not overwrite the value of need_locks provided by the user
2134   AC_MSG_CHECKING([if we can lock with hard links])
2135   hard_links=yes
2136   $rm conftest*
2137   ln conftest.a conftest.b 2>/dev/null && hard_links=no
2138   touch conftest.a
2139   ln conftest.a conftest.b 2>&5 || hard_links=no
2140   ln conftest.a conftest.b 2>/dev/null && hard_links=no
2141   AC_MSG_RESULT([$hard_links])
2142   if test "$hard_links" = no; then
2143     AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
2144     need_locks=warn
2145   fi
2146 else
2147   need_locks=no
2148 fi
2149
2150 if test "$GCC" = yes; then
2151   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
2152   AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
2153   echo "int some_variable = 0;" > conftest.$ac_ext
2154   save_CFLAGS="$CFLAGS"
2155   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
2156   compiler_rtti_exceptions=no
2157   AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
2158     # The compiler can only warn and ignore the option if not recognized
2159     # So say no if there are warnings
2160     if test -s conftest.err; then
2161       compiler_rtti_exceptions=no
2162     else
2163       compiler_rtti_exceptions=yes
2164     fi
2165   ])
2166   CFLAGS="$save_CFLAGS"
2167   AC_MSG_RESULT([$compiler_rtti_exceptions])
2168
2169   if test "$compiler_rtti_exceptions" = "yes"; then
2170     no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
2171   else
2172     no_builtin_flag=' -fno-builtin'
2173   fi
2174 fi
2175
2176 # See if the linker supports building shared libraries.
2177 AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
2178
2179 allow_undefined_flag=
2180 no_undefined_flag=
2181 need_lib_prefix=unknown
2182 need_version=unknown
2183 # when you set need_version to no, make sure it does not cause -set_version
2184 # flags to be left without arguments
2185 archive_cmds=
2186 archive_expsym_cmds=
2187 old_archive_from_new_cmds=
2188 old_archive_from_expsyms_cmds=
2189 export_dynamic_flag_spec=
2190 whole_archive_flag_spec=
2191 thread_safe_flag_spec=
2192 hardcode_into_libs=no
2193 hardcode_libdir_flag_spec=
2194 hardcode_libdir_separator=
2195 hardcode_direct=no
2196 hardcode_minus_L=no
2197 hardcode_shlibpath_var=unsupported
2198 runpath_var=
2199 link_all_deplibs=unknown
2200 always_export_symbols=no
2201 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
2202 # include_expsyms should be a list of space-separated symbols to be *always*
2203 # included in the symbol list
2204 include_expsyms=
2205 # exclude_expsyms can be an egrep regular expression of symbols to exclude
2206 # it will be wrapped by ` (' and `)$', so one must not match beginning or
2207 # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
2208 # as well as any symbol that contains `d'.
2209 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
2210 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
2211 # platforms (ab)use it in PIC code, but their linkers get confused if
2212 # the symbol is explicitly referenced.  Since portable code cannot
2213 # rely on this symbol name, it's probably fine to never include it in
2214 # preloaded symbol tables.
2215 extract_expsyms_cmds=
2216
2217 case $host_os in
2218 cygwin* | mingw* | pw32*)
2219   # FIXME: the MSVC++ port hasn't been tested in a loooong time
2220   # When not using gcc, we currently assume that we are using
2221   # Microsoft Visual C++.
2222   if test "$GCC" != yes; then
2223     with_gnu_ld=no
2224   fi
2225   ;;
2226 openbsd*)
2227   with_gnu_ld=no
2228   ;;
2229 esac
2230
2231 ld_shlibs=yes
2232 if test "$with_gnu_ld" = yes; then
2233   # If archive_cmds runs LD, not CC, wlarc should be empty
2234   wlarc='${wl}'
2235
2236   # See if GNU ld supports shared libraries.
2237   case $host_os in
2238   aix3* | aix4* | aix5*)
2239     # On AIX, the GNU linker is very broken
2240     # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
2241     ld_shlibs=no
2242     cat <<EOF 1>&2
2243
2244 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
2245 *** to be unable to reliably create shared libraries on AIX.
2246 *** Therefore, libtool is disabling shared libraries support.  If you
2247 *** really care for shared libraries, you may want to modify your PATH
2248 *** so that a non-GNU linker is found, and then restart.
2249
2250 EOF
2251     ;;
2252
2253   amigaos*)
2254     archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
2255     hardcode_libdir_flag_spec='-L$libdir'
2256     hardcode_minus_L=yes
2257
2258     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
2259     # that the semantics of dynamic libraries on AmigaOS, at least up
2260     # to version 4, is to share data among multiple programs linked
2261     # with the same dynamic library.  Since this doesn't match the
2262     # behavior of shared libraries on other platforms, we can use
2263     # them.
2264     ld_shlibs=no
2265     ;;
2266
2267   beos*)
2268     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
2269       allow_undefined_flag=unsupported
2270       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
2271       # support --undefined.  This deserves some investigation.  FIXME
2272       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2273     else
2274       ld_shlibs=no
2275     fi
2276     ;;
2277
2278   cygwin* | mingw* | pw32*)
2279     # hardcode_libdir_flag_spec is actually meaningless, as there is
2280     # no search path for DLLs.
2281     hardcode_libdir_flag_spec='-L$libdir'
2282     allow_undefined_flag=unsupported
2283     always_export_symbols=yes
2284
2285     extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
2286       sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
2287       test -f $output_objdir/impgen.exe || (cd $output_objdir && \
2288       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
2289       else $CC -o impgen impgen.c ; fi)~
2290       $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
2291
2292     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
2293
2294     # cygwin and mingw dlls have different entry points and sets of symbols
2295     # to exclude.
2296     # FIXME: what about values for MSVC?
2297     dll_entry=__cygwin_dll_entry@12
2298     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
2299     case $host_os in
2300     mingw*)
2301       # mingw values
2302       dll_entry=_DllMainCRTStartup@12
2303       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
2304       ;;
2305     esac
2306
2307     # mingw and cygwin differ, and it's simplest to just exclude the union
2308     # of the two symbol sets.
2309     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
2310
2311     # recent cygwin and mingw systems supply a stub DllMain which the user
2312     # can override, but on older systems we have to supply one (in ltdll.c)
2313     if test "x$lt_cv_need_dllmain" = "xyes"; then
2314       ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
2315       ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
2316         test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
2317     else
2318       ltdll_obj=
2319       ltdll_cmds=
2320     fi
2321
2322     # Extract the symbol export list from an `--export-all' def file,
2323     # then regenerate the def file from the symbol export list, so that
2324     # the compiled dll only exports the symbol export list.
2325     # Be careful not to strip the DATA tag left be newer dlltools.
2326     export_symbols_cmds="$ltdll_cmds"'
2327       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
2328       sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
2329
2330     # If the export-symbols file already is a .def file (1st line
2331     # is EXPORTS), use it as is.
2332     # If DATA tags from a recent dlltool are present, honour them!
2333     archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
2334         cp $export_symbols $output_objdir/$soname-def;
2335       else
2336         echo EXPORTS > $output_objdir/$soname-def;
2337         _lt_hint=1;
2338         cat $export_symbols | while read symbol; do
2339          set dummy \$symbol;
2340          case \[$]# in
2341            2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
2342            *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
2343          esac;
2344          _lt_hint=`expr 1 + \$_lt_hint`;
2345         done;
2346       fi~
2347       '"$ltdll_cmds"'
2348       $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
2349       $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
2350       $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
2351       $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
2352       $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
2353     ;;
2354
2355   netbsd*)
2356     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2357       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
2358       wlarc=
2359     else
2360       archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2361       archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
2362     fi
2363     ;;
2364
2365   solaris* | sysv5*)
2366     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
2367       ld_shlibs=no
2368       cat <<EOF 1>&2
2369
2370 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
2371 *** create shared libraries on Solaris systems.  Therefore, libtool
2372 *** is disabling shared libraries support.  We urge you to upgrade GNU
2373 *** binutils to release 2.9.1 or newer.  Another option is to modify
2374 *** your PATH or compiler configuration so that the native linker is
2375 *** used, and then restart.
2376
2377 EOF
2378     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
2379       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2380       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
2381     else
2382       ld_shlibs=no
2383     fi
2384     ;;
2385
2386   sunos4*)
2387     archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2388     wlarc=
2389     hardcode_direct=yes
2390     hardcode_shlibpath_var=no
2391     ;;
2392
2393   *)
2394     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
2395       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2396       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
2397     else
2398       ld_shlibs=no
2399     fi
2400     ;;
2401   esac
2402
2403   if test "$ld_shlibs" = yes; then
2404     runpath_var=LD_RUN_PATH
2405     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
2406     export_dynamic_flag_spec='${wl}--export-dynamic'
2407     case $host_os in
2408     cygwin* | mingw* | pw32*)
2409       # dlltool doesn't understand --whole-archive et. al.
2410       whole_archive_flag_spec=
2411       ;;
2412     *)
2413       # ancient GNU ld didn't support --whole-archive et. al.
2414       if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
2415         whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
2416       else
2417         whole_archive_flag_spec=
2418       fi
2419       ;;
2420     esac
2421   fi
2422 else
2423   # PORTME fill in a description of your system's linker (not GNU ld)
2424   case $host_os in
2425   aix3*)
2426     allow_undefined_flag=unsupported
2427     always_export_symbols=yes
2428     archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
2429     # Note: this linker hardcodes the directories in LIBPATH if there
2430     # are no directories specified by -L.
2431     hardcode_minus_L=yes
2432     if test "$GCC" = yes && test -z "$link_static_flag"; then
2433       # Neither direct hardcoding nor static linking is supported with a
2434       # broken collect2.
2435       hardcode_direct=unsupported
2436     fi
2437     ;;
2438
2439   aix4* | aix5*)
2440     if test "$host_cpu" = ia64; then
2441       # On IA64, the linker does run time linking by default, so we don't
2442       # have to do anything special.
2443       aix_use_runtimelinking=no
2444       exp_sym_flag='-Bexport'
2445       no_entry_flag=""
2446     else
2447       aix_use_runtimelinking=no
2448
2449       # Test if we are trying to use run time linking or normal
2450       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
2451       # need to do runtime linking.
2452       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
2453         for ld_flag in $LDFLAGS; do
2454           if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
2455             aix_use_runtimelinking=yes
2456             break
2457           fi
2458         done
2459       esac
2460
2461       exp_sym_flag='-bexport'
2462       no_entry_flag='-bnoentry'
2463     fi
2464
2465     # When large executables or shared objects are built, AIX ld can
2466     # have problems creating the table of contents.  If linking a library
2467     # or program results in "error TOC overflow" add -mminimal-toc to
2468     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
2469     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
2470
2471     hardcode_direct=yes
2472     archive_cmds=''
2473     hardcode_libdir_separator=':'
2474     if test "$GCC" = yes; then
2475       case $host_os in aix4.[[012]]|aix4.[[012]].*)
2476         collect2name=`${CC} -print-prog-name=collect2`
2477         if test -f "$collect2name" && \
2478           strings "$collect2name" | grep resolve_lib_name >/dev/null
2479         then
2480           # We have reworked collect2
2481           hardcode_direct=yes
2482         else
2483           # We have old collect2
2484           hardcode_direct=unsupported
2485           # It fails to find uninstalled libraries when the uninstalled
2486           # path is not listed in the libpath.  Setting hardcode_minus_L
2487           # to unsupported forces relinking
2488           hardcode_minus_L=yes
2489           hardcode_libdir_flag_spec='-L$libdir'
2490           hardcode_libdir_separator=
2491         fi
2492       esac
2493
2494       shared_flag='-shared'
2495     else
2496       # not using gcc
2497       if test "$host_cpu" = ia64; then
2498         shared_flag='${wl}-G'
2499       else
2500         if test "$aix_use_runtimelinking" = yes; then
2501           shared_flag='${wl}-G'
2502         else
2503           shared_flag='${wl}-bM:SRE'
2504         fi
2505       fi
2506     fi
2507
2508     # It seems that -bexpall can do strange things, so it is better to
2509     # generate a list of symbols to export.
2510     always_export_symbols=yes
2511     if test "$aix_use_runtimelinking" = yes; then
2512       # Warning - without using the other runtime loading flags (-brtl),
2513       # -berok will link without error, but may produce a broken library.
2514       allow_undefined_flag='-berok'
2515       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
2516       archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
2517     else
2518       if test "$host_cpu" = ia64; then
2519         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
2520         allow_undefined_flag="-z nodefs"
2521         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
2522       else
2523         hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
2524         # Warning - without using the other run time loading flags,
2525         # -berok will link without error, but may produce a broken library.
2526         allow_undefined_flag='${wl}-berok'
2527         # This is a bit strange, but is similar to how AIX traditionally builds
2528         # it's shared libraries.
2529         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
2530       fi
2531     fi
2532     ;;
2533
2534   amigaos*)
2535     archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
2536     hardcode_libdir_flag_spec='-L$libdir'
2537     hardcode_minus_L=yes
2538     # see comment about different semantics on the GNU ld section
2539     ld_shlibs=no
2540     ;;
2541
2542   cygwin* | mingw* | pw32*)
2543     # When not using gcc, we currently assume that we are using
2544     # Microsoft Visual C++.
2545     # hardcode_libdir_flag_spec is actually meaningless, as there is
2546     # no search path for DLLs.
2547     hardcode_libdir_flag_spec=' '
2548     allow_undefined_flag=unsupported
2549     # Tell ltmain to make .lib files, not .a files.
2550     libext=lib
2551     # FIXME: Setting linknames here is a bad hack.
2552     archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
2553     # The linker will automatically build a .lib file if we build a DLL.
2554     old_archive_from_new_cmds='true'
2555     # FIXME: Should let the user specify the lib program.
2556     old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
2557     fix_srcfile_path='`cygpath -w "$srcfile"`'
2558     ;;
2559
2560   darwin* | rhapsody*)
2561     case "$host_os" in
2562     rhapsody* | darwin1.[[012]])
2563       allow_undefined_flag='-undefined suppress'
2564       ;;
2565     *) # Darwin 1.3 on
2566       allow_undefined_flag='-flat_namespace -undefined suppress'
2567       ;;
2568     esac
2569     # FIXME: Relying on posixy $() will cause problems for
2570     #        cross-compilation, but unfortunately the echo tests do not
2571     #        yet detect zsh echo's removal of \ escapes.
2572     archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
2573     # We need to add '_' to the symbols in $export_symbols first
2574     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
2575     hardcode_direct=yes
2576     hardcode_shlibpath_var=no
2577     whole_archive_flag_spec='-all_load $convenience'
2578     ;;
2579
2580   freebsd1*)
2581     ld_shlibs=no
2582     ;;
2583
2584   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
2585   # support.  Future versions do this automatically, but an explicit c++rt0.o
2586   # does not break anything, and helps significantly (at the cost of a little
2587   # extra space).
2588   freebsd2.2*)
2589     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
2590     hardcode_libdir_flag_spec='-R$libdir'
2591     hardcode_direct=yes
2592     hardcode_shlibpath_var=no
2593     ;;
2594
2595   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
2596   freebsd2*)
2597     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2598     hardcode_direct=yes
2599     hardcode_minus_L=yes
2600     hardcode_shlibpath_var=no
2601     ;;
2602
2603   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
2604   freebsd*)
2605     archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
2606     hardcode_libdir_flag_spec='-R$libdir'
2607     hardcode_direct=yes
2608     hardcode_shlibpath_var=no
2609     ;;
2610
2611   hpux9* | hpux10* | hpux11*)
2612     case $host_os in
2613     hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
2614     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
2615     esac
2616     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
2617     hardcode_libdir_separator=:
2618     hardcode_direct=yes
2619     hardcode_minus_L=yes # Not in the search PATH, but as the default
2620                          # location of the library.
2621     export_dynamic_flag_spec='${wl}-E'
2622     ;;
2623
2624   irix5* | irix6*)
2625     if test "$GCC" = yes; then
2626       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
2627     else
2628       archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
2629     fi
2630     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2631     hardcode_libdir_separator=:
2632     link_all_deplibs=yes
2633     ;;
2634
2635   netbsd*)
2636     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2637       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
2638     else
2639       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
2640     fi
2641     hardcode_libdir_flag_spec='-R$libdir'
2642     hardcode_direct=yes
2643     hardcode_shlibpath_var=no
2644     ;;
2645
2646   newsos6)
2647     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2648     hardcode_direct=yes
2649     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2650     hardcode_libdir_separator=:
2651     hardcode_shlibpath_var=no
2652     ;;
2653
2654   openbsd*)
2655     hardcode_direct=yes
2656     hardcode_shlibpath_var=no
2657     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2658       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
2659       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
2660       export_dynamic_flag_spec='${wl}-E'
2661     else
2662       case "$host_os" in
2663       openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
2664         archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2665         hardcode_libdir_flag_spec='-R$libdir'
2666         ;;
2667       *)
2668         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
2669         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
2670         ;;
2671       esac
2672     fi
2673     ;;
2674
2675   os2*)
2676     hardcode_libdir_flag_spec='-L$libdir'
2677     hardcode_minus_L=yes
2678     allow_undefined_flag=unsupported
2679     archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
2680     old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
2681     ;;
2682
2683   osf3*)
2684     if test "$GCC" = yes; then
2685       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
2686       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
2687     else
2688       allow_undefined_flag=' -expect_unresolved \*'
2689       archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
2690     fi
2691     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2692     hardcode_libdir_separator=:
2693     ;;
2694
2695   osf4* | osf5*)        # as osf3* with the addition of -msym flag
2696     if test "$GCC" = yes; then
2697       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
2698       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
2699       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2700     else
2701       allow_undefined_flag=' -expect_unresolved \*'
2702       archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
2703       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
2704       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
2705
2706       #Both c and cxx compiler support -rpath directly
2707       hardcode_libdir_flag_spec='-rpath $libdir'
2708     fi
2709     hardcode_libdir_separator=:
2710     ;;
2711
2712   sco3.2v5*)
2713     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2714     hardcode_shlibpath_var=no
2715     runpath_var=LD_RUN_PATH
2716     hardcode_runpath_var=yes
2717     export_dynamic_flag_spec='${wl}-Bexport'
2718     ;;
2719
2720   solaris*)
2721     # gcc --version < 3.0 without binutils cannot create self contained
2722     # shared libraries reliably, requiring libgcc.a to resolve some of
2723     # the object symbols generated in some cases.  Libraries that use
2724     # assert need libgcc.a to resolve __eprintf, for example.  Linking
2725     # a copy of libgcc.a into every shared library to guarantee resolving
2726     # such symbols causes other problems:  According to Tim Van Holder
2727     # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
2728     # (to the application) exception stack for one thing.
2729     no_undefined_flag=' -z defs'
2730     if test "$GCC" = yes; then
2731       case `$CC --version 2>/dev/null` in
2732       [[12]].*)
2733         cat <<EOF 1>&2
2734
2735 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably
2736 *** create self contained shared libraries on Solaris systems, without
2737 *** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
2738 *** -no-undefined support, which will at least allow you to build shared
2739 *** libraries.  However, you may find that when you link such libraries
2740 *** into an application without using GCC, you have to manually add
2741 *** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
2742 *** upgrade to a newer version of GCC.  Another option is to rebuild your
2743 *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
2744
2745 EOF
2746         no_undefined_flag=
2747         ;;
2748       esac
2749     fi
2750     # $CC -shared without GNU ld will not create a library from C++
2751     # object files and a static libstdc++, better avoid it by now
2752     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2753     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2754                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2755     hardcode_libdir_flag_spec='-R$libdir'
2756     hardcode_shlibpath_var=no
2757     case $host_os in
2758     solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
2759     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
2760       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
2761     esac
2762     link_all_deplibs=yes
2763     ;;
2764
2765   sunos4*)
2766     if test "x$host_vendor" = xsequent; then
2767       # Use $CC to link under sequent, because it throws in some extra .o
2768       # files that make .init and .fini sections work.
2769       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
2770     else
2771       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
2772     fi
2773     hardcode_libdir_flag_spec='-L$libdir'
2774     hardcode_direct=yes
2775     hardcode_minus_L=yes
2776     hardcode_shlibpath_var=no
2777     ;;
2778
2779   sysv4)
2780     if test "x$host_vendor" = xsno; then
2781       archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
2782       hardcode_direct=yes # is this really true???
2783     else
2784       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2785       hardcode_direct=no #Motorola manual says yes, but my tests say they lie
2786     fi
2787     runpath_var='LD_RUN_PATH'
2788     hardcode_shlibpath_var=no
2789     ;;
2790
2791   sysv4.3*)
2792     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2793     hardcode_shlibpath_var=no
2794     export_dynamic_flag_spec='-Bexport'
2795     ;;
2796
2797   sysv5*)
2798     no_undefined_flag=' -z text'
2799     # $CC -shared without GNU ld will not create a library from C++
2800     # object files and a static libstdc++, better avoid it by now
2801     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2802     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2803                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2804     hardcode_libdir_flag_spec=
2805     hardcode_shlibpath_var=no
2806     runpath_var='LD_RUN_PATH'
2807     ;;
2808
2809   uts4*)
2810     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2811     hardcode_libdir_flag_spec='-L$libdir'
2812     hardcode_shlibpath_var=no
2813     ;;
2814
2815   dgux*)
2816     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2817     hardcode_libdir_flag_spec='-L$libdir'
2818     hardcode_shlibpath_var=no
2819     ;;
2820
2821   sysv4*MP*)
2822     if test -d /usr/nec; then
2823       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2824       hardcode_shlibpath_var=no
2825       runpath_var=LD_RUN_PATH
2826       hardcode_runpath_var=yes
2827       ld_shlibs=yes
2828     fi
2829     ;;
2830
2831   sysv4.2uw2*)
2832     archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
2833     hardcode_direct=yes
2834     hardcode_minus_L=no
2835     hardcode_shlibpath_var=no
2836     hardcode_runpath_var=yes
2837     runpath_var=LD_RUN_PATH
2838     ;;
2839
2840   sysv5uw7* | unixware7*)
2841     no_undefined_flag='${wl}-z ${wl}text'
2842     if test "$GCC" = yes; then
2843       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2844     else
2845       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2846     fi
2847     runpath_var='LD_RUN_PATH'
2848     hardcode_shlibpath_var=no
2849     ;;
2850
2851   *)
2852     ld_shlibs=no
2853     ;;
2854   esac
2855 fi
2856 AC_MSG_RESULT([$ld_shlibs])
2857 test "$ld_shlibs" = no && can_build_shared=no
2858
2859 # Check hardcoding attributes.
2860 AC_MSG_CHECKING([how to hardcode library paths into programs])
2861 hardcode_action=
2862 if test -n "$hardcode_libdir_flag_spec" || \
2863    test -n "$runpath_var"; then
2864
2865   # We can hardcode non-existant directories.
2866   if test "$hardcode_direct" != no &&
2867      # If the only mechanism to avoid hardcoding is shlibpath_var, we
2868      # have to relink, otherwise we might link with an installed library
2869      # when we should be linking with a yet-to-be-installed one
2870      ## test "$hardcode_shlibpath_var" != no &&
2871      test "$hardcode_minus_L" != no; then
2872     # Linking always hardcodes the temporary library directory.
2873     hardcode_action=relink
2874   else
2875     # We can link without hardcoding, and we can hardcode nonexisting dirs.
2876     hardcode_action=immediate
2877   fi
2878 else
2879   # We cannot hardcode anything, or else we can only hardcode existing
2880   # directories.
2881   hardcode_action=unsupported
2882 fi
2883 AC_MSG_RESULT([$hardcode_action])
2884
2885 striplib=
2886 old_striplib=
2887 AC_MSG_CHECKING([whether stripping libraries is possible])
2888 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
2889   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2890   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2891   AC_MSG_RESULT([yes])
2892 else
2893   AC_MSG_RESULT([no])
2894 fi
2895
2896 reload_cmds='$LD$reload_flag -o $output$reload_objs'
2897 test -z "$deplibs_check_method" && deplibs_check_method=unknown
2898
2899 # PORTME Fill in your ld.so characteristics
2900 AC_MSG_CHECKING([dynamic linker characteristics])
2901 library_names_spec=
2902 libname_spec='lib$name'
2903 soname_spec=
2904 postinstall_cmds=
2905 postuninstall_cmds=
2906 finish_cmds=
2907 finish_eval=
2908 shlibpath_var=
2909 shlibpath_overrides_runpath=unknown
2910 version_type=none
2911 dynamic_linker="$host_os ld.so"
2912 sys_lib_dlsearch_path_spec="/lib /usr/lib"
2913 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2914
2915 case $host_os in
2916 aix3*)
2917   version_type=linux
2918   library_names_spec='${libname}${release}.so$versuffix $libname.a'
2919   shlibpath_var=LIBPATH
2920
2921   # AIX has no versioning support, so we append a major version to the name.
2922   soname_spec='${libname}${release}.so$major'
2923   ;;
2924
2925 aix4* | aix5*)
2926   version_type=linux
2927   if test "$host_cpu" = ia64; then
2928     # AIX 5 supports IA64
2929     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
2930     shlibpath_var=LD_LIBRARY_PATH
2931   else
2932     # With GCC up to 2.95.x, collect2 would create an import file
2933     # for dependence libraries.  The import file would start with
2934     # the line `#! .'.  This would cause the generated library to
2935     # depend on `.', always an invalid library.  This was fixed in
2936     # development snapshots of GCC prior to 3.0.
2937     case $host_os in
2938       aix4 | aix4.[[01]] | aix4.[[01]].*)
2939         if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2940              echo ' yes '
2941              echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
2942           :
2943         else
2944           can_build_shared=no
2945         fi
2946         ;;
2947     esac
2948     # AIX (on Power*) has no versioning support, so currently we can
2949     # not hardcode correct soname into executable. Probably we can
2950     # add versioning support to collect2, so additional links can
2951     # be useful in future.
2952     if test "$aix_use_runtimelinking" = yes; then
2953       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2954       # instead of lib<name>.a to let people know that these are not
2955       # typical AIX shared libraries.
2956       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2957     else
2958       # We preserve .a as extension for shared libraries through AIX4.2
2959       # and later when we are not doing run time linking.
2960       library_names_spec='${libname}${release}.a $libname.a'
2961       soname_spec='${libname}${release}.so$major'
2962     fi
2963     shlibpath_var=LIBPATH
2964   fi
2965   ;;
2966
2967 amigaos*)
2968   library_names_spec='$libname.ixlibrary $libname.a'
2969   # Create ${libname}_ixlibrary.a entries in /sys/libs.
2970   finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
2971   ;;
2972
2973 beos*)
2974   library_names_spec='${libname}.so'
2975   dynamic_linker="$host_os ld.so"
2976   shlibpath_var=LIBRARY_PATH
2977   ;;
2978
2979 bsdi4*)
2980   version_type=linux
2981   need_version=no
2982   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2983   soname_spec='${libname}${release}.so$major'
2984   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2985   shlibpath_var=LD_LIBRARY_PATH
2986   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2987   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2988   export_dynamic_flag_spec=-rdynamic
2989   # the default ld.so.conf also contains /usr/contrib/lib and
2990   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2991   # libtool to hard-code these into programs
2992   ;;
2993
2994 cygwin* | mingw* | pw32*)
2995   version_type=windows
2996   need_version=no
2997   need_lib_prefix=no
2998   case $GCC,$host_os in
2999   yes,cygwin*)
3000     library_names_spec='$libname.dll.a'
3001     soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
3002     postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
3003       dldir=$destdir/`dirname \$dlpath`~
3004       test -d \$dldir || mkdir -p \$dldir~
3005       $install_prog .libs/$dlname \$dldir/$dlname'
3006     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
3007       dlpath=$dir/\$dldll~
3008        $rm \$dlpath'
3009     ;;
3010   yes,mingw*)
3011     library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
3012     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
3013     ;;
3014   yes,pw32*)
3015     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
3016     ;;
3017   *)
3018     library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
3019     ;;
3020   esac
3021   dynamic_linker='Win32 ld.exe'
3022   # FIXME: first we should search . and the directory the executable is in
3023   shlibpath_var=PATH
3024   ;;
3025
3026 darwin* | rhapsody*)
3027   dynamic_linker="$host_os dyld"
3028   version_type=darwin
3029   need_lib_prefix=no
3030   need_version=no
3031   # FIXME: Relying on posixy $() will cause problems for
3032   #        cross-compilation, but unfortunately the echo tests do not
3033   #        yet detect zsh echo's removal of \ escapes.
3034   library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
3035   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
3036   shlibpath_overrides_runpath=yes
3037   shlibpath_var=DYLD_LIBRARY_PATH
3038   ;;
3039
3040 freebsd1*)
3041   dynamic_linker=no
3042   ;;
3043
3044 freebsd*)
3045   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
3046   version_type=freebsd-$objformat
3047   case $version_type in
3048     freebsd-elf*)
3049       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
3050       need_version=no
3051       need_lib_prefix=no
3052       ;;
3053     freebsd-*)
3054       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
3055       need_version=yes
3056       ;;
3057   esac
3058   shlibpath_var=LD_LIBRARY_PATH
3059   case $host_os in
3060   freebsd2*)
3061     shlibpath_overrides_runpath=yes
3062     ;;
3063   *)
3064     shlibpath_overrides_runpath=no
3065     hardcode_into_libs=yes
3066     ;;
3067   esac
3068   ;;
3069
3070 gnu*)
3071   version_type=linux
3072   need_lib_prefix=no
3073   need_version=no
3074   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
3075   soname_spec='${libname}${release}.so$major'
3076   shlibpath_var=LD_LIBRARY_PATH
3077   hardcode_into_libs=yes
3078   ;;
3079
3080 hpux9* | hpux10* | hpux11*)
3081   # Give a soname corresponding to the major version so that dld.sl refuses to
3082   # link against other versions.
3083   dynamic_linker="$host_os dld.sl"
3084   version_type=sunos
3085   need_lib_prefix=no
3086   need_version=no
3087   shlibpath_var=SHLIB_PATH
3088   shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3089   library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
3090   soname_spec='${libname}${release}.sl$major'
3091   # HP-UX runs *really* slowly unless shared libraries are mode 555.
3092   postinstall_cmds='chmod 555 $lib'
3093   ;;
3094
3095 irix5* | irix6*)
3096   version_type=irix
3097   need_lib_prefix=no
3098   need_version=no
3099   soname_spec='${libname}${release}.so$major'
3100   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
3101   case $host_os in
3102   irix5*)
3103     libsuff= shlibsuff=
3104     ;;
3105   *)
3106     case $LD in # libtool.m4 will add one of these switches to LD
3107     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
3108     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
3109     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
3110     *) libsuff= shlibsuff= libmagic=never-match;;
3111     esac
3112     ;;
3113   esac
3114   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3115   shlibpath_overrides_runpath=no
3116   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3117   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3118   ;;
3119
3120 # No shared lib support for Linux oldld, aout, or coff.
3121 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
3122   dynamic_linker=no
3123   ;;
3124
3125 # This must be Linux ELF.
3126 linux-gnu*)
3127   version_type=linux
3128   need_lib_prefix=no
3129   need_version=no
3130   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3131   soname_spec='${libname}${release}.so$major'
3132   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3133   shlibpath_var=LD_LIBRARY_PATH
3134   shlibpath_overrides_runpath=no
3135   # This implies no fast_install, which is unacceptable.
3136   # Some rework will be needed to allow for fast_install
3137   # before this can be enabled.
3138   hardcode_into_libs=yes
3139
3140   # We used to test for /lib/ld.so.1 and disable shared libraries on
3141   # powerpc, because MkLinux only supported shared libraries with the
3142   # GNU dynamic linker.  Since this was broken with cross compilers,
3143   # most powerpc-linux boxes support dynamic linking these days and
3144   # people can always --disable-shared, the test was removed, and we
3145   # assume the GNU/Linux dynamic linker is in use.
3146   dynamic_linker='GNU/Linux ld.so'
3147   ;;
3148
3149 netbsd*)
3150   version_type=sunos
3151   need_lib_prefix=no
3152   need_version=no
3153   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3154     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3155     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3156     dynamic_linker='NetBSD (a.out) ld.so'
3157   else
3158     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
3159     soname_spec='${libname}${release}.so$major'
3160     dynamic_linker='NetBSD ld.elf_so'
3161   fi
3162   shlibpath_var=LD_LIBRARY_PATH
3163   shlibpath_overrides_runpath=yes
3164   hardcode_into_libs=yes
3165   ;;
3166
3167 newsos6)
3168   version_type=linux
3169   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3170   shlibpath_var=LD_LIBRARY_PATH
3171   shlibpath_overrides_runpath=yes
3172   ;;
3173
3174 openbsd*)
3175   version_type=sunos
3176   need_lib_prefix=no
3177   need_version=no
3178   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3179     case "$host_os" in
3180     openbsd2.[[89]] | openbsd2.[[89]].*)
3181       shlibpath_overrides_runpath=no
3182       ;;
3183     *)
3184       shlibpath_overrides_runpath=yes
3185       ;;
3186     esac
3187   else
3188     shlibpath_overrides_runpath=yes
3189   fi
3190   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3191   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3192   shlibpath_var=LD_LIBRARY_PATH
3193   ;;
3194
3195 os2*)
3196   libname_spec='$name'
3197   need_lib_prefix=no
3198   library_names_spec='$libname.dll $libname.a'
3199   dynamic_linker='OS/2 ld.exe'
3200   shlibpath_var=LIBPATH
3201   ;;
3202
3203 osf3* | osf4* | osf5*)
3204   version_type=osf
3205   need_version=no
3206   soname_spec='${libname}${release}.so'
3207   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
3208   shlibpath_var=LD_LIBRARY_PATH
3209   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3210   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3211   ;;
3212
3213 sco3.2v5*)
3214   version_type=osf
3215   soname_spec='${libname}${release}.so$major'
3216   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3217   shlibpath_var=LD_LIBRARY_PATH
3218   ;;
3219
3220 solaris*)
3221   version_type=linux
3222   need_lib_prefix=no
3223   need_version=no
3224   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3225   soname_spec='${libname}${release}.so$major'
3226   shlibpath_var=LD_LIBRARY_PATH
3227   shlibpath_overrides_runpath=yes
3228   hardcode_into_libs=yes
3229   # ldd complains unless libraries are executable
3230   postinstall_cmds='chmod +x $lib'
3231   ;;
3232
3233 sunos4*)
3234   version_type=sunos
3235   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3236   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3237   shlibpath_var=LD_LIBRARY_PATH
3238   shlibpath_overrides_runpath=yes
3239   if test "$with_gnu_ld" = yes; then
3240     need_lib_prefix=no
3241   fi
3242   need_version=yes
3243   ;;
3244
3245 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3246   version_type=linux
3247   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3248   soname_spec='${libname}${release}.so$major'
3249   shlibpath_var=LD_LIBRARY_PATH
3250   case $host_vendor in
3251     sni)
3252       shlibpath_overrides_runpath=no
3253       ;;
3254     motorola)
3255       need_lib_prefix=no
3256       need_version=no
3257       shlibpath_overrides_runpath=no
3258       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3259       ;;
3260   esac
3261   ;;
3262
3263 uts4*)
3264   version_type=linux
3265   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3266   soname_spec='${libname}${release}.so$major'
3267   shlibpath_var=LD_LIBRARY_PATH
3268   ;;
3269
3270 dgux*)
3271   version_type=linux
3272   need_lib_prefix=no
3273   need_version=no
3274   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3275   soname_spec='${libname}${release}.so$major'
3276   shlibpath_var=LD_LIBRARY_PATH
3277   ;;
3278
3279 sysv4*MP*)
3280   if test -d /usr/nec ;then
3281     version_type=linux
3282     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
3283     soname_spec='$libname.so.$major'
3284     shlibpath_var=LD_LIBRARY_PATH
3285   fi
3286   ;;
3287
3288 *)
3289   dynamic_linker=no
3290   ;;
3291 esac
3292 AC_MSG_RESULT([$dynamic_linker])
3293 test "$dynamic_linker" = no && can_build_shared=no
3294
3295 # Report the final consequences.
3296 AC_MSG_CHECKING([if libtool supports shared libraries])
3297 AC_MSG_RESULT([$can_build_shared])
3298
3299 AC_MSG_CHECKING([whether to build shared libraries])
3300 test "$can_build_shared" = "no" && enable_shared=no
3301
3302 # On AIX, shared libraries and static libraries use the same namespace, and
3303 # are all built from PIC.
3304 case "$host_os" in
3305 aix3*)
3306   test "$enable_shared" = yes && enable_static=no
3307   if test -n "$RANLIB"; then
3308     archive_cmds="$archive_cmds~\$RANLIB \$lib"
3309     postinstall_cmds='$RANLIB $lib'
3310   fi
3311   ;;
3312
3313 aix4*)
3314   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
3315     test "$enable_shared" = yes && enable_static=no
3316   fi
3317   ;;
3318 esac
3319 AC_MSG_RESULT([$enable_shared])
3320
3321 AC_MSG_CHECKING([whether to build static libraries])
3322 # Make sure either enable_shared or enable_static is yes.
3323 test "$enable_shared" = yes || enable_static=yes
3324 AC_MSG_RESULT([$enable_static])
3325
3326 if test "$hardcode_action" = relink; then
3327   # Fast installation is not supported
3328   enable_fast_install=no
3329 elif test "$shlibpath_overrides_runpath" = yes ||
3330      test "$enable_shared" = no; then
3331   # Fast installation is not necessary
3332   enable_fast_install=needless
3333 fi
3334
3335 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3336 if test "$GCC" = yes; then
3337   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3338 fi
3339
3340 AC_LIBTOOL_DLOPEN_SELF
3341
3342 if test "$enable_shared" = yes && test "$GCC" = yes; then
3343   case $archive_cmds in
3344   *'~'*)
3345     # FIXME: we may have to deal with multi-command sequences.
3346     ;;
3347   '$CC '*)
3348     # Test whether the compiler implicitly links with -lc since on some
3349     # systems, -lgcc has to come before -lc. If gcc already passes -lc
3350     # to ld, don't add -lc before -lgcc.
3351     AC_MSG_CHECKING([whether -lc should be explicitly linked in])
3352     AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
3353     [$rm conftest*
3354     echo 'static int dummy;' > conftest.$ac_ext
3355
3356     if AC_TRY_EVAL(ac_compile); then
3357       soname=conftest
3358       lib=conftest
3359       libobjs=conftest.$ac_objext
3360       deplibs=
3361       wl=$lt_cv_prog_cc_wl
3362       compiler_flags=-v
3363       linker_flags=-v
3364       verstring=
3365       output_objdir=.
3366       libname=conftest
3367       save_allow_undefined_flag=$allow_undefined_flag
3368       allow_undefined_flag=
3369       if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
3370       then
3371         lt_cv_archive_cmds_need_lc=no
3372       else
3373         lt_cv_archive_cmds_need_lc=yes
3374       fi
3375       allow_undefined_flag=$save_allow_undefined_flag
3376     else
3377       cat conftest.err 1>&5
3378     fi])
3379     AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
3380     ;;
3381   esac
3382 fi
3383 need_lc=${lt_cv_archive_cmds_need_lc-yes}
3384
3385 # The second clause should only fire when bootstrapping the
3386 # libtool distribution, otherwise you forgot to ship ltmain.sh
3387 # with your package, and you will get complaints that there are
3388 # no rules to generate ltmain.sh.
3389 if test -f "$ltmain"; then
3390   :
3391 else
3392   # If there is no Makefile yet, we rely on a make rule to execute
3393   # `config.status --recheck' to rerun these tests and create the
3394   # libtool script then.
3395   test -f Makefile && make "$ltmain"
3396 fi
3397
3398 if test -f "$ltmain"; then
3399   trap "$rm \"${ofile}T\"; exit 1" 1 2 15
3400   $rm -f "${ofile}T"
3401
3402   echo creating $ofile
3403
3404   # Now quote all the things that may contain metacharacters while being
3405   # careful not to overquote the AC_SUBSTed values.  We take copies of the
3406   # variables and quote the copies for generation of the libtool script.
3407   for var in echo old_CC old_CFLAGS \
3408     AR AR_FLAGS CC LD LN_S NM SHELL \
3409     reload_flag reload_cmds wl \
3410     pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
3411     thread_safe_flag_spec whole_archive_flag_spec libname_spec \
3412     library_names_spec soname_spec \
3413     RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
3414     old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
3415     postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
3416     old_striplib striplib file_magic_cmd export_symbols_cmds \
3417     deplibs_check_method allow_undefined_flag no_undefined_flag \
3418     finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
3419     global_symbol_to_c_name_address \
3420     hardcode_libdir_flag_spec hardcode_libdir_separator  \
3421     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
3422     compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
3423
3424     case $var in
3425     reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
3426     old_postinstall_cmds | old_postuninstall_cmds | \
3427     export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
3428     extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
3429     postinstall_cmds | postuninstall_cmds | \
3430     finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
3431       # Double-quote double-evaled strings.
3432       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
3433       ;;
3434     *)
3435       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
3436       ;;
3437     esac
3438   done
3439
3440   cat <<__EOF__ > "${ofile}T"
3441 #! $SHELL
3442
3443 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
3444 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
3445 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
3446 #
3447 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
3448 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
3449 #
3450 # This program is free software; you can redistribute it and/or modify
3451 # it under the terms of the GNU General Public License as published by
3452 # the Free Software Foundation; either version 2 of the License, or
3453 # (at your option) any later version.
3454 #
3455 # This program is distributed in the hope that it will be useful, but
3456 # WITHOUT ANY WARRANTY; without even the implied warranty of
3457 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3458 # General Public License for more details.
3459 #
3460 # You should have received a copy of the GNU General Public License
3461 # along with this program; if not, write to the Free Software
3462 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3463 #
3464 # As a special exception to the GNU General Public License, if you
3465 # distribute this file as part of a program that contains a
3466 # configuration script generated by Autoconf, you may include it under
3467 # the same distribution terms that you use for the rest of that program.
3468
3469 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
3470 Xsed="sed -e s/^X//"
3471
3472 # The HP-UX ksh and POSIX shell print the target directory to stdout
3473 # if CDPATH is set.
3474 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
3475
3476 # ### BEGIN LIBTOOL CONFIG
3477
3478 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3479
3480 # Shell to use when invoking shell scripts.
3481 SHELL=$lt_SHELL
3482
3483 # Whether or not to build shared libraries.
3484 build_libtool_libs=$enable_shared
3485
3486 # Whether or not to build static libraries.
3487 build_old_libs=$enable_static
3488
3489 # Whether or not to add -lc for building shared libraries.
3490 build_libtool_need_lc=$need_lc
3491
3492 # Whether or not to optimize for fast installation.
3493 fast_install=$enable_fast_install
3494
3495 # The host system.
3496 host_alias=$host_alias
3497 host=$host
3498
3499 # An echo program that does not interpret backslashes.
3500 echo=$lt_echo
3501
3502 # The archiver.
3503 AR=$lt_AR
3504 AR_FLAGS=$lt_AR_FLAGS
3505
3506 # The default C compiler.
3507 CC=$lt_CC
3508
3509 # Is the compiler the GNU C compiler?
3510 with_gcc=$GCC
3511
3512 # The linker used to build libraries.
3513 LD=$lt_LD
3514
3515 # Whether we need hard or soft links.
3516 LN_S=$lt_LN_S
3517
3518 # A BSD-compatible nm program.
3519 NM=$lt_NM
3520
3521 # A symbol stripping program
3522 STRIP=$STRIP
3523
3524 # Used to examine libraries when file_magic_cmd begins "file"
3525 MAGIC_CMD=$MAGIC_CMD
3526
3527 # Used on cygwin: DLL creation program.
3528 DLLTOOL="$DLLTOOL"
3529
3530 # Used on cygwin: object dumper.
3531 OBJDUMP="$OBJDUMP"
3532
3533 # Used on cygwin: assembler.
3534 AS="$AS"
3535
3536 # The name of the directory that contains temporary libtool files.
3537 objdir=$objdir
3538
3539 # How to create reloadable object files.
3540 reload_flag=$lt_reload_flag
3541 reload_cmds=$lt_reload_cmds
3542
3543 # How to pass a linker flag through the compiler.
3544 wl=$lt_wl
3545
3546 # Object file suffix (normally "o").
3547 objext="$ac_objext"
3548
3549 # Old archive suffix (normally "a").
3550 libext="$libext"
3551
3552 # Executable file suffix (normally "").
3553 exeext="$exeext"
3554
3555 # Additional compiler flags for building library objects.
3556 pic_flag=$lt_pic_flag
3557 pic_mode=$pic_mode
3558
3559 # Does compiler simultaneously support -c and -o options?
3560 compiler_c_o=$lt_compiler_c_o
3561
3562 # Can we write directly to a .lo ?
3563 compiler_o_lo=$lt_compiler_o_lo
3564
3565 # Must we lock files when doing compilation ?
3566 need_locks=$lt_need_locks
3567
3568 # Do we need the lib prefix for modules?
3569 need_lib_prefix=$need_lib_prefix
3570
3571 # Do we need a version for libraries?
3572 need_version=$need_version
3573
3574 # Whether dlopen is supported.
3575 dlopen_support=$enable_dlopen
3576
3577 # Whether dlopen of programs is supported.
3578 dlopen_self=$enable_dlopen_self
3579
3580 # Whether dlopen of statically linked programs is supported.
3581 dlopen_self_static=$enable_dlopen_self_static
3582
3583 # Compiler flag to prevent dynamic linking.
3584 link_static_flag=$lt_link_static_flag
3585
3586 # Compiler flag to turn off builtin functions.
3587 no_builtin_flag=$lt_no_builtin_flag
3588
3589 # Compiler flag to allow reflexive dlopens.
3590 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
3591
3592 # Compiler flag to generate shared objects directly from archives.
3593 whole_archive_flag_spec=$lt_whole_archive_flag_spec
3594
3595 # Compiler flag to generate thread-safe objects.
3596 thread_safe_flag_spec=$lt_thread_safe_flag_spec
3597
3598 # Library versioning type.
3599 version_type=$version_type
3600
3601 # Format of library name prefix.
3602 libname_spec=$lt_libname_spec
3603
3604 # List of archive names.  First name is the real one, the rest are links.
3605 # The last name is the one that the linker finds with -lNAME.
3606 library_names_spec=$lt_library_names_spec
3607
3608 # The coded name of the library, if different from the real name.
3609 soname_spec=$lt_soname_spec
3610
3611 # Commands used to build and install an old-style archive.
3612 RANLIB=$lt_RANLIB
3613 old_archive_cmds=$lt_old_archive_cmds
3614 old_postinstall_cmds=$lt_old_postinstall_cmds
3615 old_postuninstall_cmds=$lt_old_postuninstall_cmds
3616
3617 # Create an old-style archive from a shared archive.
3618 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
3619
3620 # Create a temporary old-style archive to link instead of a shared archive.
3621 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
3622
3623 # Commands used to build and install a shared archive.
3624 archive_cmds=$lt_archive_cmds
3625 archive_expsym_cmds=$lt_archive_expsym_cmds
3626 postinstall_cmds=$lt_postinstall_cmds
3627 postuninstall_cmds=$lt_postuninstall_cmds
3628
3629 # Commands to strip libraries.
3630 old_striplib=$lt_old_striplib
3631 striplib=$lt_striplib
3632
3633 # Method to check whether dependent libraries are shared objects.
3634 deplibs_check_method=$lt_deplibs_check_method
3635
3636 # Command to use when deplibs_check_method == file_magic.
3637 file_magic_cmd=$lt_file_magic_cmd
3638
3639 # Flag that allows shared libraries with undefined symbols to be built.
3640 allow_undefined_flag=$lt_allow_undefined_flag
3641
3642 # Flag that forces no undefined symbols.
3643 no_undefined_flag=$lt_no_undefined_flag
3644
3645 # Commands used to finish a libtool library installation in a directory.
3646 finish_cmds=$lt_finish_cmds
3647
3648 # Same as above, but a single script fragment to be evaled but not shown.
3649 finish_eval=$lt_finish_eval
3650
3651 # Take the output of nm and produce a listing of raw symbols and C names.
3652 global_symbol_pipe=$lt_global_symbol_pipe
3653
3654 # Transform the output of nm in a proper C declaration
3655 global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
3656
3657 # Transform the output of nm in a C name address pair
3658 global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
3659
3660 # This is the shared library runtime path variable.
3661 runpath_var=$runpath_var
3662
3663 # This is the shared library path variable.
3664 shlibpath_var=$shlibpath_var
3665
3666 # Is shlibpath searched before the hard-coded library search path?
3667 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
3668
3669 # How to hardcode a shared library path into an executable.
3670 hardcode_action=$hardcode_action
3671
3672 # Whether we should hardcode library paths into libraries.
3673 hardcode_into_libs=$hardcode_into_libs
3674
3675 # Flag to hardcode \$libdir into a binary during linking.
3676 # This must work even if \$libdir does not exist.
3677 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
3678
3679 # Whether we need a single -rpath flag with a separated argument.
3680 hardcode_libdir_separator=$lt_hardcode_libdir_separator
3681
3682 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
3683 # resulting binary.
3684 hardcode_direct=$hardcode_direct
3685
3686 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
3687 # resulting binary.
3688 hardcode_minus_L=$hardcode_minus_L
3689
3690 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
3691 # the resulting binary.
3692 hardcode_shlibpath_var=$hardcode_shlibpath_var
3693
3694 # Variables whose values should be saved in libtool wrapper scripts and
3695 # restored at relink time.
3696 variables_saved_for_relink="$variables_saved_for_relink"
3697
3698 # Whether libtool must link a program against all its dependency libraries.
3699 link_all_deplibs=$link_all_deplibs
3700
3701 # Compile-time system search path for libraries
3702 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
3703
3704 # Run-time system search path for libraries
3705 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
3706
3707 # Fix the shell variable \$srcfile for the compiler.
3708 fix_srcfile_path="$fix_srcfile_path"
3709
3710 # Set to yes if exported symbols are required.
3711 always_export_symbols=$always_export_symbols
3712
3713 # The commands to list exported symbols.
3714 export_symbols_cmds=$lt_export_symbols_cmds
3715
3716 # The commands to extract the exported symbol list from a shared archive.
3717 extract_expsyms_cmds=$lt_extract_expsyms_cmds
3718
3719 # Symbols that should not be listed in the preloaded symbols.
3720 exclude_expsyms=$lt_exclude_expsyms
3721
3722 # Symbols that must always be exported.
3723 include_expsyms=$lt_include_expsyms
3724
3725 # ### END LIBTOOL CONFIG
3726
3727 __EOF__
3728
3729   case $host_os in
3730   aix3*)
3731     cat <<\EOF >> "${ofile}T"
3732
3733 # AIX sometimes has problems with the GCC collect2 program.  For some
3734 # reason, if we set the COLLECT_NAMES environment variable, the problems
3735 # vanish in a puff of smoke.
3736 if test "X${COLLECT_NAMES+set}" != Xset; then
3737   COLLECT_NAMES=
3738   export COLLECT_NAMES
3739 fi
3740 EOF
3741     ;;
3742   esac
3743
3744   case $host_os in
3745   cygwin* | mingw* | pw32* | os2*)
3746     cat <<'EOF' >> "${ofile}T"
3747       # This is a source program that is used to create dlls on Windows
3748       # Don't remove nor modify the starting and closing comments
3749 # /* ltdll.c starts here */
3750 # #define WIN32_LEAN_AND_MEAN
3751 # #include <windows.h>
3752 # #undef WIN32_LEAN_AND_MEAN
3753 # #include <stdio.h>
3754 #
3755 # #ifndef __CYGWIN__
3756 # #  ifdef __CYGWIN32__
3757 # #    define __CYGWIN__ __CYGWIN32__
3758 # #  endif
3759 # #endif
3760 #
3761 # #ifdef __cplusplus
3762 # extern "C" {
3763 # #endif
3764 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
3765 # #ifdef __cplusplus
3766 # }
3767 # #endif
3768 #
3769 # #ifdef __CYGWIN__
3770 # #include <cygwin/cygwin_dll.h>
3771 # DECLARE_CYGWIN_DLL( DllMain );
3772 # #endif
3773 # HINSTANCE __hDllInstance_base;
3774 #
3775 # BOOL APIENTRY
3776 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
3777 # {
3778 #   __hDllInstance_base = hInst;
3779 #   return TRUE;
3780 # }
3781 # /* ltdll.c ends here */
3782         # This is a source program that is used to create import libraries
3783         # on Windows for dlls which lack them. Don't remove nor modify the
3784         # starting and closing comments
3785 # /* impgen.c starts here */
3786 # /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
3787 #
3788 #  This file is part of GNU libtool.
3789 #
3790 #  This program is free software; you can redistribute it and/or modify
3791 #  it under the terms of the GNU General Public License as published by
3792 #  the Free Software Foundation; either version 2 of the License, or
3793 #  (at your option) any later version.
3794 #
3795 #  This program is distributed in the hope that it will be useful,
3796 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
3797 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3798 #  GNU General Public License for more details.
3799 #
3800 #  You should have received a copy of the GNU General Public License
3801 #  along with this program; if not, write to the Free Software
3802 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3803 #  */
3804 #
3805 # #include <stdio.h>            /* for printf() */
3806 # #include <unistd.h>           /* for open(), lseek(), read() */
3807 # #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
3808 # #include <string.h>           /* for strdup() */
3809 #
3810 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
3811 # #ifndef O_BINARY
3812 # #define O_BINARY 0
3813 # #endif
3814 #
3815 # static unsigned int
3816 # pe_get16 (fd, offset)
3817 #      int fd;
3818 #      int offset;
3819 # {
3820 #   unsigned char b[2];
3821 #   lseek (fd, offset, SEEK_SET);
3822 #   read (fd, b, 2);
3823 #   return b[0] + (b[1]<<8);
3824 # }
3825 #
3826 # static unsigned int
3827 # pe_get32 (fd, offset)
3828 #     int fd;
3829 #     int offset;
3830 # {
3831 #   unsigned char b[4];
3832 #   lseek (fd, offset, SEEK_SET);
3833 #   read (fd, b, 4);
3834 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3835 # }
3836 #
3837 # static unsigned int
3838 # pe_as32 (ptr)
3839 #      void *ptr;
3840 # {
3841 #   unsigned char *b = ptr;
3842 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3843 # }
3844 #
3845 # int
3846 # main (argc, argv)
3847 #     int argc;
3848 #     char *argv[];
3849 # {
3850 #     int dll;
3851 #     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
3852 #     unsigned long export_rva, export_size, nsections, secptr, expptr;
3853 #     unsigned long name_rvas, nexp;
3854 #     unsigned char *expdata, *erva;
3855 #     char *filename, *dll_name;
3856 #
3857 #     filename = argv[1];
3858 #
3859 #     dll = open(filename, O_RDONLY|O_BINARY);
3860 #     if (dll < 1)
3861 #       return 1;
3862 #
3863 #     dll_name = filename;
3864 #
3865 #     for (i=0; filename[i]; i++)
3866 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
3867 #           dll_name = filename + i +1;
3868 #
3869 #     pe_header_offset = pe_get32 (dll, 0x3c);
3870 #     opthdr_ofs = pe_header_offset + 4 + 20;
3871 #     num_entries = pe_get32 (dll, opthdr_ofs + 92);
3872 #
3873 #     if (num_entries < 1) /* no exports */
3874 #       return 1;
3875 #
3876 #     export_rva = pe_get32 (dll, opthdr_ofs + 96);
3877 #     export_size = pe_get32 (dll, opthdr_ofs + 100);
3878 #     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
3879 #     secptr = (pe_header_offset + 4 + 20 +
3880 #             pe_get16 (dll, pe_header_offset + 4 + 16));
3881 #
3882 #     expptr = 0;
3883 #     for (i = 0; i < nsections; i++)
3884 #     {
3885 #       char sname[8];
3886 #       unsigned long secptr1 = secptr + 40 * i;
3887 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
3888 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
3889 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
3890 #       lseek(dll, secptr1, SEEK_SET);
3891 #       read(dll, sname, 8);
3892 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
3893 #       {
3894 #           expptr = fptr + (export_rva - vaddr);
3895 #           if (export_rva + export_size > vaddr + vsize)
3896 #               export_size = vsize - (export_rva - vaddr);
3897 #           break;
3898 #       }
3899 #     }
3900 #
3901 #     expdata = (unsigned char*)malloc(export_size);
3902 #     lseek (dll, expptr, SEEK_SET);
3903 #     read (dll, expdata, export_size);
3904 #     erva = expdata - export_rva;
3905 #
3906 #     nexp = pe_as32 (expdata+24);
3907 #     name_rvas = pe_as32 (expdata+32);
3908 #
3909 #     printf ("EXPORTS\n");
3910 #     for (i = 0; i<nexp; i++)
3911 #     {
3912 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
3913 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
3914 #     }
3915 #
3916 #     return 0;
3917 # }
3918 # /* impgen.c ends here */
3919
3920 EOF
3921     ;;
3922   esac
3923
3924   # We use sed instead of cat because bash on DJGPP gets confused if
3925   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
3926   # text mode, it properly converts lines to CR/LF.  This bash problem
3927   # is reportedly fixed, but why not run on old versions too?
3928   sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
3929
3930   mv -f "${ofile}T" "$ofile" || \
3931     (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
3932   chmod +x "$ofile"
3933 fi
3934
3935 ])# _LT_AC_LTCONFIG_HACK
3936
3937 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
3938 AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
3939
3940 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
3941 AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
3942
3943 # AC_ENABLE_SHARED - implement the --enable-shared flag
3944 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
3945 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3946 #   `yes'.
3947 AC_DEFUN([AC_ENABLE_SHARED],
3948 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
3949 AC_ARG_ENABLE(shared,
3950 changequote(<<, >>)dnl
3951 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
3952 changequote([, ])dnl
3953 [p=${PACKAGE-default}
3954 case $enableval in
3955 yes) enable_shared=yes ;;
3956 no) enable_shared=no ;;
3957 *)
3958   enable_shared=no
3959   # Look at the argument we got.  We use all the common list separators.
3960   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3961   for pkg in $enableval; do
3962     if test "X$pkg" = "X$p"; then
3963       enable_shared=yes
3964     fi
3965   done
3966   IFS="$ac_save_ifs"
3967   ;;
3968 esac],
3969 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
3970 ])
3971
3972 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
3973 AC_DEFUN([AC_DISABLE_SHARED],
3974 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3975 AC_ENABLE_SHARED(no)])
3976
3977 # AC_ENABLE_STATIC - implement the --enable-static flag
3978 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
3979 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3980 #   `yes'.
3981 AC_DEFUN([AC_ENABLE_STATIC],
3982 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
3983 AC_ARG_ENABLE(static,
3984 changequote(<<, >>)dnl
3985 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
3986 changequote([, ])dnl
3987 [p=${PACKAGE-default}
3988 case $enableval in
3989 yes) enable_static=yes ;;
3990 no) enable_static=no ;;
3991 *)
3992   enable_static=no
3993   # Look at the argument we got.  We use all the common list separators.
3994   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3995   for pkg in $enableval; do
3996     if test "X$pkg" = "X$p"; then
3997       enable_static=yes
3998     fi
3999   done
4000   IFS="$ac_save_ifs"
4001   ;;
4002 esac],
4003 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
4004 ])
4005
4006 # AC_DISABLE_STATIC - set the default static flag to --disable-static
4007 AC_DEFUN([AC_DISABLE_STATIC],
4008 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4009 AC_ENABLE_STATIC(no)])
4010
4011
4012 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
4013 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
4014 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
4015 #   `yes'.
4016 AC_DEFUN([AC_ENABLE_FAST_INSTALL],
4017 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
4018 AC_ARG_ENABLE(fast-install,
4019 changequote(<<, >>)dnl
4020 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
4021 changequote([, ])dnl
4022 [p=${PACKAGE-default}
4023 case $enableval in
4024 yes) enable_fast_install=yes ;;
4025 no) enable_fast_install=no ;;
4026 *)
4027   enable_fast_install=no
4028   # Look at the argument we got.  We use all the common list separators.
4029   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
4030   for pkg in $enableval; do
4031     if test "X$pkg" = "X$p"; then
4032       enable_fast_install=yes
4033     fi
4034   done
4035   IFS="$ac_save_ifs"
4036   ;;
4037 esac],
4038 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
4039 ])
4040
4041 # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
4042 AC_DEFUN([AC_DISABLE_FAST_INSTALL],
4043 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4044 AC_ENABLE_FAST_INSTALL(no)])
4045
4046 # AC_LIBTOOL_PICMODE - implement the --with-pic flag
4047 # Usage: AC_LIBTOOL_PICMODE[(MODE)]
4048 #   Where MODE is either `yes' or `no'.  If omitted, it defaults to
4049 #   `both'.
4050 AC_DEFUN([AC_LIBTOOL_PICMODE],
4051 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4052 pic_mode=ifelse($#,1,$1,default)])
4053
4054
4055 # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
4056 AC_DEFUN([AC_PATH_TOOL_PREFIX],
4057 [AC_MSG_CHECKING([for $1])
4058 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
4059 [case $MAGIC_CMD in
4060   /*)
4061   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4062   ;;
4063   ?:/*)
4064   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4065   ;;
4066   *)
4067   ac_save_MAGIC_CMD="$MAGIC_CMD"
4068   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4069 dnl $ac_dummy forces splitting on constant user-supplied paths.
4070 dnl POSIX.2 word splitting is done only on the output of word expansions,
4071 dnl not every word.  This closes a longstanding sh security hole.
4072   ac_dummy="ifelse([$2], , $PATH, [$2])"
4073   for ac_dir in $ac_dummy; do
4074     test -z "$ac_dir" && ac_dir=.
4075     if test -f $ac_dir/$1; then
4076       lt_cv_path_MAGIC_CMD="$ac_dir/$1"
4077       if test -n "$file_magic_test_file"; then
4078         case $deplibs_check_method in
4079         "file_magic "*)
4080           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4081           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4082           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4083             egrep "$file_magic_regex" > /dev/null; then
4084             :
4085           else
4086             cat <<EOF 1>&2
4087
4088 *** Warning: the command libtool uses to detect shared libraries,
4089 *** $file_magic_cmd, produces output that libtool cannot recognize.
4090 *** The result is that libtool may fail to recognize shared libraries
4091 *** as such.  This will affect the creation of libtool libraries that
4092 *** depend on shared libraries, but programs linked with such libtool
4093 *** libraries will work regardless of this problem.  Nevertheless, you
4094 *** may want to report the problem to your system manager and/or to
4095 *** bug-libtool@gnu.org
4096
4097 EOF
4098           fi ;;
4099         esac
4100       fi
4101       break
4102     fi
4103   done
4104   IFS="$ac_save_ifs"
4105   MAGIC_CMD="$ac_save_MAGIC_CMD"
4106   ;;
4107 esac])
4108 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4109 if test -n "$MAGIC_CMD"; then
4110   AC_MSG_RESULT($MAGIC_CMD)
4111 else
4112   AC_MSG_RESULT(no)
4113 fi
4114 ])
4115
4116
4117 # AC_PATH_MAGIC - find a file program which can recognise a shared library
4118 AC_DEFUN([AC_PATH_MAGIC],
4119 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
4120 AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
4121 if test -z "$lt_cv_path_MAGIC_CMD"; then
4122   if test -n "$ac_tool_prefix"; then
4123     AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
4124   else
4125     MAGIC_CMD=:
4126   fi
4127 fi
4128 ])
4129
4130
4131 # AC_PROG_LD - find the path to the GNU or non-GNU linker
4132 AC_DEFUN([AC_PROG_LD],
4133 [AC_ARG_WITH(gnu-ld,
4134 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
4135 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
4136 AC_REQUIRE([AC_PROG_CC])dnl
4137 AC_REQUIRE([AC_CANONICAL_HOST])dnl
4138 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4139 AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
4140 ac_prog=ld
4141 if test "$GCC" = yes; then
4142   # Check if gcc -print-prog-name=ld gives a path.
4143   AC_MSG_CHECKING([for ld used by GCC])
4144   case $host in
4145   *-*-mingw*)
4146     # gcc leaves a trailing carriage return which upsets mingw
4147     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4148   *)
4149     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4150   esac
4151   case $ac_prog in
4152     # Accept absolute paths.
4153     [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
4154       re_direlt='/[[^/]][[^/]]*/\.\./'
4155       # Canonicalize the path of ld
4156       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4157       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4158         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4159       done
4160       test -z "$LD" && LD="$ac_prog"
4161       ;;
4162   "")
4163     # If it fails, then pretend we aren't using GCC.
4164     ac_prog=ld
4165     ;;
4166   *)
4167     # If it is relative, then search for the first ld in PATH.
4168     with_gnu_ld=unknown
4169     ;;
4170   esac
4171 elif test "$with_gnu_ld" = yes; then
4172   AC_MSG_CHECKING([for GNU ld])
4173 else
4174   AC_MSG_CHECKING([for non-GNU ld])
4175 fi
4176 AC_CACHE_VAL(lt_cv_path_LD,
4177 [if test -z "$LD"; then
4178   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4179   for ac_dir in $PATH; do
4180     test -z "$ac_dir" && ac_dir=.
4181     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4182       lt_cv_path_LD="$ac_dir/$ac_prog"
4183       # Check to see if the program is GNU ld.  I'd rather use --version,
4184       # but apparently some GNU ld's only accept -v.
4185       # Break only if it was the GNU/non-GNU ld that we prefer.
4186       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
4187         test "$with_gnu_ld" != no && break
4188       else
4189         test "$with_gnu_ld" != yes && break
4190       fi
4191     fi
4192   done
4193   IFS="$ac_save_ifs"
4194 else
4195   lt_cv_path_LD="$LD" # Let the user override the test with a path.
4196 fi])
4197 LD="$lt_cv_path_LD"
4198 if test -n "$LD"; then
4199   AC_MSG_RESULT($LD)
4200 else
4201   AC_MSG_RESULT(no)
4202 fi
4203 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4204 AC_PROG_LD_GNU
4205 ])
4206
4207 # AC_PROG_LD_GNU -
4208 AC_DEFUN([AC_PROG_LD_GNU],
4209 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4210 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
4211 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
4212   lt_cv_prog_gnu_ld=yes
4213 else
4214   lt_cv_prog_gnu_ld=no
4215 fi])
4216 with_gnu_ld=$lt_cv_prog_gnu_ld
4217 ])
4218
4219 # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
4220 #   -- PORTME Some linkers may need a different reload flag.
4221 AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
4222 [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
4223 [lt_cv_ld_reload_flag='-r'])
4224 reload_flag=$lt_cv_ld_reload_flag
4225 test -n "$reload_flag" && reload_flag=" $reload_flag"
4226 ])
4227
4228 # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
4229 #  -- PORTME fill in with the dynamic library characteristics
4230 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
4231 [AC_CACHE_CHECK([how to recognise dependant libraries],
4232 lt_cv_deplibs_check_method,
4233 [lt_cv_file_magic_cmd='$MAGIC_CMD'
4234 lt_cv_file_magic_test_file=
4235 lt_cv_deplibs_check_method='unknown'
4236 # Need to set the preceding variable on all platforms that support
4237 # interlibrary dependencies.
4238 # 'none' -- dependencies not supported.
4239 # `unknown' -- same as none, but documents that we really don't know.
4240 # 'pass_all' -- all dependencies passed with no checks.
4241 # 'test_compile' -- check by making test program.
4242 # 'file_magic [[regex]]' -- check by looking for files in library path
4243 # which responds to the $file_magic_cmd with a given egrep regex.
4244 # If you have `file' or equivalent on your system and you're not sure
4245 # whether `pass_all' will *always* work, you probably want this one.
4246
4247 case $host_os in
4248 aix4* | aix5*)
4249   lt_cv_deplibs_check_method=pass_all
4250   ;;
4251
4252 beos*)
4253   lt_cv_deplibs_check_method=pass_all
4254   ;;
4255
4256 bsdi4*)
4257   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4258   lt_cv_file_magic_cmd='/usr/bin/file -L'
4259   lt_cv_file_magic_test_file=/shlib/libc.so
4260   ;;
4261
4262 cygwin* | mingw* | pw32*)
4263   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
4264   lt_cv_file_magic_cmd='$OBJDUMP -f'
4265   ;;
4266
4267 darwin* | rhapsody*)
4268   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
4269   lt_cv_file_magic_cmd='/usr/bin/file -L'
4270   case "$host_os" in
4271   rhapsody* | darwin1.[[012]])
4272     lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
4273     ;;
4274   *) # Darwin 1.3 on
4275     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
4276     ;;
4277   esac
4278   ;;
4279
4280 freebsd*)
4281   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
4282     case $host_cpu in
4283     i*86 )
4284       # Not sure whether the presence of OpenBSD here was a mistake.
4285       # Let's accept both of them until this is cleared up.
4286       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
4287       lt_cv_file_magic_cmd=/usr/bin/file
4288       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4289       ;;
4290     esac
4291   else
4292     lt_cv_deplibs_check_method=pass_all
4293   fi
4294   ;;
4295
4296 gnu*)
4297   lt_cv_deplibs_check_method=pass_all
4298   ;;
4299
4300 hpux10.20*|hpux11*)
4301   lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
4302   lt_cv_file_magic_cmd=/usr/bin/file
4303   lt_cv_file_magic_test_file=/usr/lib/libc.sl
4304   ;;
4305
4306 irix5* | irix6*)
4307   case $host_os in
4308   irix5*)
4309     # this will be overridden with pass_all, but let us keep it just in case
4310     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
4311     ;;
4312   *)
4313     case $LD in
4314     *-32|*"-32 ") libmagic=32-bit;;
4315     *-n32|*"-n32 ") libmagic=N32;;
4316     *-64|*"-64 ") libmagic=64-bit;;
4317     *) libmagic=never-match;;
4318     esac
4319     # this will be overridden with pass_all, but let us keep it just in case
4320     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
4321     ;;
4322   esac
4323   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
4324   lt_cv_deplibs_check_method=pass_all
4325   ;;
4326
4327 # This must be Linux ELF.
4328 linux-gnu*)
4329   case $host_cpu in
4330   alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
4331     lt_cv_deplibs_check_method=pass_all ;;
4332   *)
4333     # glibc up to 2.1.1 does not perform some relocations on ARM
4334     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
4335   esac
4336   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
4337   ;;
4338
4339 netbsd*)
4340   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
4341     lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
4342   else
4343     lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
4344   fi
4345   ;;
4346
4347 newos6*)
4348   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4349   lt_cv_file_magic_cmd=/usr/bin/file
4350   lt_cv_file_magic_test_file=/usr/lib/libnls.so
4351   ;;
4352
4353 openbsd*)
4354   lt_cv_file_magic_cmd=/usr/bin/file
4355   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4356   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4357     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
4358   else
4359     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
4360   fi
4361   ;;
4362
4363 osf3* | osf4* | osf5*)
4364   # this will be overridden with pass_all, but let us keep it just in case
4365   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
4366   lt_cv_file_magic_test_file=/shlib/libc.so
4367   lt_cv_deplibs_check_method=pass_all
4368   ;;
4369
4370 sco3.2v5*)
4371   lt_cv_deplibs_check_method=pass_all
4372   ;;
4373
4374 solaris*)
4375   lt_cv_deplibs_check_method=pass_all
4376   lt_cv_file_magic_test_file=/lib/libc.so
4377   ;;
4378
4379 sysv5uw[[78]]* | sysv4*uw2*)
4380   lt_cv_deplibs_check_method=pass_all
4381   ;;
4382
4383 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
4384   case $host_vendor in
4385   motorola)
4386     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
4387     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4388     ;;
4389   ncr)
4390     lt_cv_deplibs_check_method=pass_all
4391     ;;
4392   sequent)
4393     lt_cv_file_magic_cmd='/bin/file'
4394     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4395     ;;
4396   sni)
4397     lt_cv_file_magic_cmd='/bin/file'
4398     lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4399     lt_cv_file_magic_test_file=/lib/libc.so
4400     ;;
4401   esac
4402   ;;
4403 esac
4404 ])
4405 file_magic_cmd=$lt_cv_file_magic_cmd
4406 deplibs_check_method=$lt_cv_deplibs_check_method
4407 ])
4408
4409
4410 # AC_PROG_NM - find the path to a BSD-compatible name lister
4411 AC_DEFUN([AC_PROG_NM],
4412 [AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
4413 AC_MSG_CHECKING([for BSD-compatible nm])
4414 AC_CACHE_VAL(lt_cv_path_NM,
4415 [if test -n "$NM"; then
4416   # Let the user override the test.
4417   lt_cv_path_NM="$NM"
4418 else
4419   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4420   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
4421     test -z "$ac_dir" && ac_dir=.
4422     tmp_nm=$ac_dir/${ac_tool_prefix}nm
4423     if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
4424       # Check to see if the nm accepts a BSD-compat flag.
4425       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
4426       #   nm: unknown option "B" ignored
4427       # Tru64's nm complains that /dev/null is an invalid object file
4428       if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
4429         lt_cv_path_NM="$tmp_nm -B"
4430         break
4431       elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
4432         lt_cv_path_NM="$tmp_nm -p"
4433         break
4434       else
4435         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4436         continue # so that we can try to find one that supports BSD flags
4437       fi
4438     fi
4439   done
4440   IFS="$ac_save_ifs"
4441   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
4442 fi])
4443 NM="$lt_cv_path_NM"
4444 AC_MSG_RESULT([$NM])
4445 ])
4446
4447 # AC_CHECK_LIBM - check for math library
4448 AC_DEFUN([AC_CHECK_LIBM],
4449 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
4450 LIBM=
4451 case $host in
4452 *-*-beos* | *-*-cygwin* | *-*-pw32*)
4453   # These system don't have libm
4454   ;;
4455 *-ncr-sysv4.3*)
4456   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4457   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
4458   ;;
4459 *)
4460   AC_CHECK_LIB(m, main, LIBM="-lm")
4461   ;;
4462 esac
4463 ])
4464
4465 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
4466 # the libltdl convenience library and INCLTDL to the include flags for
4467 # the libltdl header and adds --enable-ltdl-convenience to the
4468 # configure arguments.  Note that LIBLTDL and INCLTDL are not
4469 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
4470 # provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
4471 # with '${top_builddir}/' and INCLTDL will be prefixed with
4472 # '${top_srcdir}/' (note the single quotes!).  If your package is not
4473 # flat and you're not using automake, define top_builddir and
4474 # top_srcdir appropriately in the Makefiles.
4475 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
4476 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4477   case $enable_ltdl_convenience in
4478   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
4479   "") enable_ltdl_convenience=yes
4480       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
4481   esac
4482   LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
4483   INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
4484 ])
4485
4486 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
4487 # the libltdl installable library and INCLTDL to the include flags for
4488 # the libltdl header and adds --enable-ltdl-install to the configure
4489 # arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
4490 # AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
4491 # libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
4492 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
4493 # with '${top_srcdir}/' (note the single quotes!).  If your package is
4494 # not flat and you're not using automake, define top_builddir and
4495 # top_srcdir appropriately in the Makefiles.
4496 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
4497 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
4498 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4499   AC_CHECK_LIB(ltdl, main,
4500   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
4501   [if test x"$enable_ltdl_install" = xno; then
4502      AC_MSG_WARN([libltdl not installed, but installation disabled])
4503    else
4504      enable_ltdl_install=yes
4505    fi
4506   ])
4507   if test x"$enable_ltdl_install" = x"yes"; then
4508     ac_configure_args="$ac_configure_args --enable-ltdl-install"
4509     LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
4510     INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
4511   else
4512     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
4513     LIBLTDL="-lltdl"
4514     INCLTDL=
4515   fi
4516 ])
4517
4518 # old names
4519 AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
4520 AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
4521 AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
4522 AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
4523 AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
4524 AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
4525 AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
4526
4527 # This is just to silence aclocal about the macro not being used
4528 ifelse([AC_DISABLE_FAST_INSTALL])
4529
4530 dnl $Id: wflags.m4,v 1.3 1999/03/11 12:11:41 joda Exp $
4531 dnl
4532 dnl set WFLAGS
4533
4534 AC_DEFUN(AC_WFLAGS,[
4535 WFLAGS_NOUNUSED=""
4536 WFLAGS_NOIMPLICITINT=""
4537 if test -z "$WFLAGS" -a "$GCC" = "yes"; then
4538   # -Wno-implicit-int for broken X11 headers
4539   # leave these out for now:
4540   #   -Wcast-align doesn't work well on alpha osf/1
4541   #   -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast
4542   #   -Wmissing-declarations -Wnested-externs
4543   WFLAGS="ifelse($#, 0,-Wall, $1)"
4544   WFLAGS_NOUNUSED="-Wno-unused"
4545   WFLAGS_NOIMPLICITINT="-Wno-implicit-int"
4546 fi
4547 AC_SUBST(WFLAGS)dnl
4548 AC_SUBST(WFLAGS_NOUNUSED)dnl
4549 AC_SUBST(WFLAGS_NOIMPLICITINT)dnl
4550 ])
4551
4552 dnl $Id: test-package.m4,v 1.12 2002/09/10 15:23:38 joda Exp $
4553 dnl
4554 dnl rk_TEST_PACKAGE(package,headers,libraries,extra libs,
4555 dnl                     default locations, conditional, config-program)
4556
4557 AC_DEFUN(rk_TEST_PACKAGE,[
4558 AC_ARG_WITH($1,
4559         AC_HELP_STRING([--with-$1=dir],[use $1 in dir]))
4560 AC_ARG_WITH($1-lib,
4561         AC_HELP_STRING([--with-$1-lib=dir],[use $1 libraries in dir]),
4562 [if test "$withval" = "yes" -o "$withval" = "no"; then
4563   AC_MSG_ERROR([No argument for --with-$1-lib])
4564 elif test "X$with_$1" = "X"; then
4565   with_$1=yes
4566 fi])
4567 AC_ARG_WITH($1-include,
4568         AC_HELP_STRING([--with-$1-include=dir],[use $1 headers in dir]),
4569 [if test "$withval" = "yes" -o "$withval" = "no"; then
4570   AC_MSG_ERROR([No argument for --with-$1-include])
4571 elif test "X$with_$1" = "X"; then
4572   with_$1=yes
4573 fi])
4574 AC_ARG_WITH($1-config,
4575         AC_HELP_STRING([--with-$1-config=path],[config program for $1]))
4576
4577 m4_ifval([$6],
4578         m4_define([rk_pkgname], $6),
4579         m4_define([rk_pkgname], AS_TR_CPP($1)))
4580
4581 AC_MSG_CHECKING(for $1)
4582
4583 case "$with_$1" in
4584 yes|"") d='$5' ;;
4585 no)     d= ;;
4586 *)      d="$with_$1" ;;
4587 esac
4588
4589 header_dirs=
4590 lib_dirs=
4591 for i in $d; do
4592         if test "$with_$1_include" = ""; then
4593                 if test -d "$i/include/$1"; then
4594                         header_dirs="$header_dirs $i/include/$1"
4595                 fi
4596                 if test -d "$i/include"; then
4597                         header_dirs="$header_dirs $i/include"
4598                 fi
4599         fi
4600         if test "$with_$1_lib" = ""; then
4601                 if test -d "$i/lib$abilibdirext"; then
4602                         lib_dirs="$lib_dirs $i/lib$abilibdirext"
4603                 fi
4604         fi
4605 done
4606
4607 if test "$with_$1_include"; then
4608         header_dirs="$with_$1_include $header_dirs"
4609 fi
4610 if test "$with_$1_lib"; then
4611         lib_dirs="$with_$1_lib $lib_dirs"
4612 fi
4613
4614 if test "$with_$1_config" = ""; then
4615         with_$1_config='$7'
4616 fi
4617
4618 $1_cflags=
4619 $1_libs=
4620
4621 case "$with_$1_config" in
4622 yes|no|"")
4623         ;;
4624 *)
4625         $1_cflags="`$with_$1_config --cflags 2>&1`"
4626         $1_libs="`$with_$1_config --libs 2>&1`"
4627         ;;
4628 esac
4629
4630 found=no
4631 if test "$with_$1" != no; then
4632         save_CFLAGS="$CFLAGS"
4633         save_LIBS="$LIBS"
4634         if test "$[]$1_cflags" -a "$[]$1_libs"; then
4635                 CFLAGS="$[]$1_cflags $save_CFLAGS"
4636                 LIBS="$[]$1_libs $save_LIBS"
4637                 AC_TRY_LINK([$2],,[
4638                         INCLUDE_$1="$[]$1_cflags"
4639                         LIB_$1="$[]$1_libs"
4640                         AC_MSG_RESULT([from $with_$1_config])
4641                         found=yes])
4642         fi
4643         if test "$found" = no; then
4644                 ires= lres=
4645                 for i in $header_dirs; do
4646                         CFLAGS="-I$i $save_CFLAGS"
4647                         AC_TRY_COMPILE([$2],,ires=$i;break)
4648                 done
4649                 for i in $lib_dirs; do
4650                         LIBS="-L$i $3 $4 $save_LIBS"
4651                         AC_TRY_LINK([$2],,lres=$i;break)
4652                 done
4653                 if test "$ires" -a "$lres" -a "$with_$1" != "no"; then
4654                         INCLUDE_$1="-I$ires"
4655                         LIB_$1="-L$lres $3 $4"
4656                         found=yes
4657                         AC_MSG_RESULT([headers $ires, libraries $lres])
4658                 fi
4659         fi
4660         CFLAGS="$save_CFLAGS"
4661         LIBS="$save_LIBS"
4662 fi
4663
4664 if test "$found" = yes; then
4665         AC_DEFINE_UNQUOTED(rk_pkgname, 1, [Define if you have the $1 package.])
4666         with_$1=yes
4667 else
4668         with_$1=no
4669         INCLUDE_$1=
4670         LIB_$1=
4671         AC_MSG_RESULT(no)
4672 fi
4673
4674 AC_SUBST(INCLUDE_$1)
4675 AC_SUBST(LIB_$1)
4676 ])
4677
4678 dnl $Id: find-func.m4,v 1.1 1997/12/14 15:58:58 joda Exp $
4679 dnl
4680 dnl AC_FIND_FUNC(func, libraries, includes, arguments)
4681 AC_DEFUN(AC_FIND_FUNC, [
4682 AC_FIND_FUNC_NO_LIBS([$1], [$2], [$3], [$4])
4683 if test -n "$LIB_$1"; then
4684         LIBS="$LIB_$1 $LIBS"
4685 fi
4686 ])
4687
4688 dnl $Id: find-func-no-libs.m4,v 1.5 1999/10/30 21:08:18 assar Exp $
4689 dnl
4690 dnl
4691 dnl Look for function in any of the specified libraries
4692 dnl
4693
4694 dnl AC_FIND_FUNC_NO_LIBS(func, libraries, includes, arguments, extra libs, extra args)
4695 AC_DEFUN(AC_FIND_FUNC_NO_LIBS, [
4696 AC_FIND_FUNC_NO_LIBS2([$1], ["" $2], [$3], [$4], [$5], [$6])])
4697
4698 dnl $Id: find-func-no-libs2.m4,v 1.6 2001/09/01 10:57:32 assar Exp $
4699 dnl
4700 dnl
4701 dnl Look for function in any of the specified libraries
4702 dnl
4703
4704 dnl AC_FIND_FUNC_NO_LIBS2(func, libraries, includes, arguments, extra libs, extra args)
4705 AC_DEFUN(AC_FIND_FUNC_NO_LIBS2, [
4706
4707 AC_MSG_CHECKING([for $1])
4708 AC_CACHE_VAL(ac_cv_funclib_$1,
4709 [
4710 if eval "test \"\$ac_cv_func_$1\" != yes" ; then
4711         ac_save_LIBS="$LIBS"
4712         for ac_lib in $2; do
4713                 case "$ac_lib" in
4714                 "") ;;
4715                 yes) ac_lib="" ;;
4716                 no) continue ;;
4717                 -l*) ;;
4718                 *) ac_lib="-l$ac_lib" ;;
4719                 esac
4720                 LIBS="$6 $ac_lib $5 $ac_save_LIBS"
4721                 AC_TRY_LINK([$3],[$1($4)],eval "if test -n \"$ac_lib\";then ac_cv_funclib_$1=$ac_lib; else ac_cv_funclib_$1=yes; fi";break)
4722         done
4723         eval "ac_cv_funclib_$1=\${ac_cv_funclib_$1-no}"
4724         LIBS="$ac_save_LIBS"
4725 fi
4726 ])
4727
4728 eval "ac_res=\$ac_cv_funclib_$1"
4729
4730 if false; then
4731         AC_CHECK_FUNCS($1)
4732 dnl     AC_CHECK_LIBS($2, foo)
4733 fi
4734 # $1
4735 eval "ac_tr_func=HAVE_[]upcase($1)"
4736 eval "ac_tr_lib=HAVE_LIB[]upcase($ac_res | sed -e 's/-l//')"
4737 eval "LIB_$1=$ac_res"
4738
4739 case "$ac_res" in
4740         yes)
4741         eval "ac_cv_func_$1=yes"
4742         eval "LIB_$1="
4743         AC_DEFINE_UNQUOTED($ac_tr_func)
4744         AC_MSG_RESULT([yes])
4745         ;;
4746         no)
4747         eval "ac_cv_func_$1=no"
4748         eval "LIB_$1="
4749         AC_MSG_RESULT([no])
4750         ;;
4751         *)
4752         eval "ac_cv_func_$1=yes"
4753         eval "ac_cv_lib_`echo "$ac_res" | sed 's/-l//'`=yes"
4754         AC_DEFINE_UNQUOTED($ac_tr_func)
4755         AC_DEFINE_UNQUOTED($ac_tr_lib)
4756         AC_MSG_RESULT([yes, in $ac_res])
4757         ;;
4758 esac
4759 AC_SUBST(LIB_$1)
4760 ])
4761
4762 dnl $Id: crypto.m4,v 1.13 2002/09/10 19:55:48 joda Exp $
4763 dnl
4764 dnl test for crypto libraries:
4765 dnl - libcrypto (from openssl)
4766 dnl - libdes (from krb4)
4767 dnl - own-built libdes
4768
4769 m4_define([test_headers], [
4770                 #undef KRB5 /* makes md4.h et al unhappy */
4771                 #ifdef HAVE_OPENSSL
4772                 #include <openssl/md4.h>
4773                 #include <openssl/md5.h>
4774                 #include <openssl/sha.h>
4775                 #include <openssl/des.h>
4776                 #include <openssl/rc4.h>
4777                 #else
4778                 #include <md4.h>
4779                 #include <md5.h>
4780                 #include <sha.h>
4781                 #include <des.h>
4782                 #include <rc4.h>
4783                 #endif
4784                 #ifdef OLD_HASH_NAMES
4785                 typedef struct md4 MD4_CTX;
4786                 #define MD4_Init(C) md4_init((C))
4787                 #define MD4_Update(C, D, L) md4_update((C), (D), (L))
4788                 #define MD4_Final(D, C) md4_finito((C), (D))
4789                 typedef struct md5 MD5_CTX;
4790                 #define MD5_Init(C) md5_init((C))
4791                 #define MD5_Update(C, D, L) md5_update((C), (D), (L))
4792                 #define MD5_Final(D, C) md5_finito((C), (D))
4793                 typedef struct sha SHA_CTX;
4794                 #define SHA1_Init(C) sha_init((C))
4795                 #define SHA1_Update(C, D, L) sha_update((C), (D), (L))
4796                 #define SHA1_Final(D, C) sha_finito((C), (D))
4797                 #endif
4798                 ])
4799 m4_define([test_body], [
4800                 void *schedule = 0;
4801                 MD4_CTX md4;
4802                 MD5_CTX md5;
4803                 SHA_CTX sha1;
4804
4805                 MD4_Init(&md4);
4806                 MD5_Init(&md5);
4807                 SHA1_Init(&sha1);
4808
4809                 des_cbc_encrypt(0, 0, 0, schedule, 0, 0);
4810                 RC4(0, 0, 0, 0);])
4811
4812
4813 AC_DEFUN([KRB_CRYPTO],[
4814 crypto_lib=unknown
4815 AC_WITH_ALL([openssl])
4816
4817 DIR_des=
4818
4819 AC_MSG_CHECKING([for crypto library])
4820
4821 openssl=no
4822 old_hash=no
4823
4824 if test "$crypto_lib" = "unknown" -a "$with_krb4" != "no"; then
4825         save_CPPFLAGS="$CPPFLAGS"
4826         save_LIBS="$LIBS"
4827
4828         cdirs= clibs=
4829         for i in $LIB_krb4; do
4830                 case "$i" in
4831                 -L*) cdirs="$cdirs $i";;
4832                 -l*) clibs="$clibs $i";;
4833                 esac
4834         done
4835
4836         ires=
4837         for i in $INCLUDE_krb4; do
4838                 CFLAGS="-DHAVE_OPENSSL $i $save_CFLAGS"
4839                 AC_TRY_COMPILE(test_headers, test_body,
4840                         openssl=yes ires="$i"; break)
4841                 CFLAGS="$i $save_CFLAGS"
4842                 AC_TRY_COMPILE(test_headers, test_body,
4843                         openssl=no ires="$i"; break)
4844                 CFLAGS="-DOLD_HASH_NAMES $i $save_CFLAGS"
4845                 AC_TRY_COMPILE(test_headers, test_body,
4846                         openssl=no ires="$i" old_hash=yes; break)
4847         done
4848         lres=
4849         for i in $cdirs; do
4850                 for j in $clibs; do
4851                         LIBS="$i $j $save_LIBS"
4852                         AC_TRY_LINK(test_headers, test_body,
4853                                 lres="$i $j"; break 2)
4854                 done
4855         done
4856         CFLAGS="$save_CFLAGS"
4857         LIBS="$save_LIBS"
4858         if test "$ires" -a "$lres"; then
4859                 INCLUDE_des="$ires"
4860                 LIB_des="$lres"
4861                 crypto_lib=krb4
4862                 AC_MSG_RESULT([same as krb4])
4863                 LIB_des_a='$(LIB_des)'
4864                 LIB_des_so='$(LIB_des)'
4865                 LIB_des_appl='$(LIB_des)'
4866         fi
4867 fi
4868
4869 if test "$crypto_lib" = "unknown" -a "$with_openssl" != "no"; then
4870         save_CFLAGS="$CFLAGS"
4871         save_LIBS="$LIBS"
4872         INCLUDE_des=
4873         LIB_des=
4874         if test "$with_openssl_include" != ""; then
4875                 INCLUDE_des="-I${with_openssl}/include"
4876         fi
4877         if test "$with_openssl_lib" != ""; then
4878                 LIB_des="-L${with_openssl}/lib"
4879         fi
4880         CFLAGS="-DHAVE_OPENSSL ${INCLUDE_des} ${CFLAGS}"
4881         LIB_des="${LIB_des} -lcrypto"
4882         LIB_des_a="$LIB_des"
4883         LIB_des_so="$LIB_des"
4884         LIB_des_appl="$LIB_des"
4885         LIBS="${LIBS} ${LIB_des}"
4886         AC_TRY_LINK(test_headers, test_body, [
4887                 crypto_lib=libcrypto openssl=yes
4888                 AC_MSG_RESULT([libcrypto])
4889         ])
4890         CFLAGS="$save_CFLAGS"
4891         LIBS="$save_LIBS"
4892 fi
4893
4894 if test "$crypto_lib" = "unknown"; then
4895
4896   DIR_des='des'
4897   LIB_des='$(top_builddir)/lib/des/libdes.la'
4898   LIB_des_a='$(top_builddir)/lib/des/.libs/libdes.a'
4899   LIB_des_so='$(top_builddir)/lib/des/.libs/libdes.so'
4900   LIB_des_appl="-ldes"
4901
4902   AC_MSG_RESULT([included libdes])
4903
4904 fi
4905
4906 if test "$with_krb4" != no -a "$crypto_lib" != krb4; then
4907         AC_MSG_ERROR([the crypto library used by krb4 lacks features
4908 required by Kerberos 5; to continue, you need to install a newer 
4909 Kerberos 4 or configure --without-krb4])
4910 fi
4911
4912 if test "$openssl" = "yes"; then
4913   AC_DEFINE([HAVE_OPENSSL], 1, [define to use openssl's libcrypto])
4914 fi
4915 if test "$old_hash" = yes; then
4916   AC_DEFINE([HAVE_OLD_HASH_NAMES], 1,
4917                 [define if you have hash functions like md4_finito()])
4918 fi
4919 AM_CONDITIONAL(HAVE_OPENSSL, test "$openssl" = yes)dnl
4920
4921 AC_SUBST(DIR_des)
4922 AC_SUBST(INCLUDE_des)
4923 AC_SUBST(LIB_des)
4924 AC_SUBST(LIB_des_a)
4925 AC_SUBST(LIB_des_so)
4926 AC_SUBST(LIB_des_appl)
4927 ])
4928
4929 dnl
4930 dnl $Id: with-all.m4,v 1.1 2001/08/29 17:01:23 assar Exp $
4931 dnl
4932
4933 dnl AC_WITH_ALL(name)
4934
4935 AC_DEFUN([AC_WITH_ALL], [
4936 AC_ARG_WITH($1,
4937         AC_HELP_STRING([--with-$1=dir],
4938                 [use $1 in dir]))
4939
4940 AC_ARG_WITH($1-lib,
4941         AC_HELP_STRING([--with-$1-lib=dir],
4942                 [use $1 libraries in dir]),
4943 [if test "$withval" = "yes" -o "$withval" = "no"; then
4944   AC_MSG_ERROR([No argument for --with-$1-lib])
4945 elif test "X$with_$1" = "X"; then
4946   with_$1=yes
4947 fi])
4948
4949 AC_ARG_WITH($1-include,
4950         AC_HELP_STRING([--with-$1-include=dir],
4951                 [use $1 headers in dir]),
4952 [if test "$withval" = "yes" -o "$withval" = "no"; then
4953   AC_MSG_ERROR([No argument for --with-$1-include])
4954 elif test "X$with_$1" = "X"; then
4955   with_$1=yes
4956 fi])
4957
4958 case "$with_$1" in
4959 yes)    ;;
4960 no)     ;;
4961 "")     ;;
4962 *)      if test "$with_$1_include" = ""; then
4963                 with_$1_include="$with_$1/include"
4964         fi
4965         if test "$with_$1_lib" = ""; then
4966                 with_$1_lib="$with_$1/lib$abilibdirext"
4967         fi
4968         ;;
4969 esac
4970 ])
4971 dnl $Id: db.m4,v 1.9 2002/09/10 14:29:47 joda Exp $
4972 dnl
4973 dnl tests for various db libraries
4974 dnl
4975 AC_DEFUN([rk_DB],[
4976 AC_ARG_ENABLE(berkeley-db,
4977                        AC_HELP_STRING([--disable-berkeley-db],
4978                                       [if you don't want berkeley db]),[
4979 ])
4980
4981 have_ndbm=no
4982 db_type=unknown
4983
4984 if test "$enable_berkeley_db" != no; then
4985
4986   AC_CHECK_HEADERS([                            \
4987         db4/db.h                                \
4988         db3/db.h                                \
4989         db.h                                    \
4990         db_185.h                                \
4991   ])
4992
4993 dnl db_create is used by db3 and db4
4994
4995   AC_FIND_FUNC_NO_LIBS(db_create, db4 db3 db, [
4996   #include <stdio.h>
4997   #ifdef HAVE_DB4_DB_H
4998   #include <db4/db.h>
4999   #elif defined(HAVE_DB3_DB_H)
5000   #include <db3/db.h>
5001   #else
5002   #include <db.h>
5003   #endif
5004   ],[NULL, NULL, 0])
5005
5006   if test "$ac_cv_func_db_create" = "yes"; then
5007     db_type=db3
5008     if test "$ac_cv_funclib_db_create" != "yes"; then
5009       DBLIB="$ac_cv_funclib_db_create"
5010     else
5011       DBLIB=""
5012     fi
5013     AC_DEFINE(HAVE_DB3, 1, [define if you have a berkeley db3/4 library])
5014   else
5015
5016 dnl dbopen is used by db1/db2
5017
5018     AC_FIND_FUNC_NO_LIBS(dbopen, db2 db, [
5019     #include <stdio.h>
5020     #if defined(HAVE_DB2_DB_H)
5021     #include <db2/db.h>
5022     #elif defined(HAVE_DB_185_H)
5023     #include <db_185.h>
5024     #elif defined(HAVE_DB_H)
5025     #include <db.h>
5026     #else
5027     #error no db.h
5028     #endif
5029     ],[NULL, 0, 0, 0, NULL])
5030
5031     if test "$ac_cv_func_dbopen" = "yes"; then
5032       db_type=db1
5033       if test "$ac_cv_funclib_dbopen" != "yes"; then
5034         DBLIB="$ac_cv_funclib_dbopen"
5035       else
5036         DBLIB=""
5037       fi
5038       AC_DEFINE(HAVE_DB1, 1, [define if you have a berkeley db1/2 library])
5039     fi
5040   fi
5041
5042 dnl test for ndbm compatability
5043
5044   if test "$ac_cv_func_dbm_firstkey" != yes; then
5045     AC_FIND_FUNC_NO_LIBS2(dbm_firstkey, $ac_cv_funclib_dbopen $ac_cv_funclib_db_create, [
5046     #include <stdio.h>
5047     #define DB_DBM_HSEARCH 1
5048     #include <db.h>
5049     DBM *dbm;
5050     ],[NULL])
5051   
5052     if test "$ac_cv_func_dbm_firstkey" = "yes"; then
5053       if test "$ac_cv_funclib_dbm_firstkey" != "yes"; then
5054         LIB_NDBM="$ac_cv_funclib_dbm_firstkey"
5055       else
5056         LIB_NDBM=""
5057       fi
5058       AC_DEFINE(HAVE_DB_NDBM, 1, [define if you have ndbm compat in db])
5059       AC_DEFINE(HAVE_NEW_DB, 1, [Define if NDBM really is DB (creates files *.db)])
5060     else
5061       $as_unset ac_cv_func_dbm_firstkey
5062       $as_unset ac_cv_funclib_dbm_firstkey
5063     fi
5064   fi
5065
5066 fi # berkeley db
5067
5068 if test "$db_type" = "unknown" -o "$ac_cv_func_dbm_firstkey" = ""; then
5069
5070   AC_CHECK_HEADERS([                            \
5071         dbm.h                                   \
5072         ndbm.h                                  \
5073   ])
5074
5075   AC_FIND_FUNC_NO_LIBS(dbm_firstkey, ndbm, [
5076   #include <stdio.h>
5077   #if defined(HAVE_NDBM_H)
5078   #include <ndbm.h>
5079   #elif defined(HAVE_DBM_H)
5080   #include <dbm.h>
5081   #endif
5082   DBM *dbm;
5083   ],[NULL])
5084
5085   if test "$ac_cv_func_dbm_firstkey" = "yes"; then
5086     if test "$ac_cv_funclib_dbm_firstkey" != "yes"; then
5087       LIB_NDBM="$ac_cv_funclib_dbm_firstkey"
5088     else
5089       LIB_NDBM=""
5090     fi
5091     AC_DEFINE(HAVE_NDBM, 1, [define if you have a ndbm library])dnl
5092     have_ndbm=yes
5093     if test "$db_type" = "unknown"; then
5094       db_type=ndbm
5095       DBLIB="$LIB_NDBM"
5096     fi
5097   else
5098
5099     $as_unset ac_cv_func_dbm_firstkey
5100     $as_unset ac_cv_funclib_dbm_firstkey
5101
5102     AC_CHECK_HEADERS([                          \
5103           gdbm/ndbm.h                           \
5104     ])
5105
5106     AC_FIND_FUNC_NO_LIBS(dbm_firstkey, gdbm, [
5107     #include <stdio.h>
5108     #include <gdbm/ndbm.h>
5109     DBM *dbm;
5110     ],[NULL])
5111
5112     if test "$ac_cv_func_dbm_firstkey" = "yes"; then
5113       if test "$ac_cv_funclib_dbm_firstkey" != "yes"; then
5114         LIB_NDBM="$ac_cv_funclib_dbm_firstkey"
5115       else
5116         LIB_NDBM=""
5117       fi
5118       AC_DEFINE(HAVE_NDBM, 1, [define if you have a ndbm library])dnl
5119       have_ndbm=yes
5120       if test "$db_type" = "unknown"; then
5121         db_type=ndbm
5122         DBLIB="$LIB_NDBM"
5123       fi
5124     fi
5125   fi
5126
5127 fi # unknown
5128
5129 if test "$have_ndbm" = "yes"; then
5130   AC_MSG_CHECKING([if ndbm is implemented with db])
5131   AC_TRY_RUN([
5132 #include <unistd.h>
5133 #include <fcntl.h>
5134 #if defined(HAVE_GDBM_NDBM_H)
5135 #include <gdbm/ndbm.h>
5136 #elif defined(HAVE_NDBM_H)
5137 #include <ndbm.h>
5138 #elif defined(HAVE_DBM_H)
5139 #include <dbm.h>
5140 #endif
5141 int main()
5142 {
5143   DBM *d;
5144
5145   d = dbm_open("conftest", O_RDWR | O_CREAT, 0666);
5146   if (d == NULL)
5147     return 1;
5148   dbm_close(d);
5149   return 0;
5150 }],[
5151     if test -f conftest.db; then
5152       AC_MSG_RESULT([yes])
5153       AC_DEFINE(HAVE_NEW_DB, 1, [Define if NDBM really is DB (creates files *.db)])
5154     else
5155       AC_MSG_RESULT([no])
5156     fi],[AC_MSG_RESULT([no])])
5157 fi
5158
5159 AM_CONDITIONAL(HAVE_DB1, test "$db_type" = db1)dnl
5160 AM_CONDITIONAL(HAVE_DB3, test "$db_type" = db3)dnl
5161 AM_CONDITIONAL(HAVE_NDBM, test "$db_type" = ndbm)dnl
5162
5163 z=""
5164 for i in $LDFLAGS; do
5165         case "$i" in
5166         -L*) z="$z $i";;
5167         esac
5168 done
5169 DBLIB="$z $DBLIB"
5170 AC_SUBST(DBLIB)dnl
5171 AC_SUBST(LIB_NDBM)dnl
5172 ])
5173
5174 dnl $Id: roken-frag.m4,v 1.44 2002/09/04 20:57:30 joda Exp $
5175 dnl
5176 dnl some code to get roken working
5177 dnl
5178 dnl rk_ROKEN(subdir)
5179 dnl
5180 AC_DEFUN(rk_ROKEN, [
5181
5182 AC_REQUIRE([rk_CONFIG_HEADER])
5183
5184 DIR_roken=roken
5185 LIB_roken='$(top_builddir)/$1/libroken.la'
5186 INCLUDES_roken='-I$(top_builddir)/$1 -I$(top_srcdir)/$1'
5187
5188 dnl Checks for programs
5189 AC_REQUIRE([AC_PROG_CC])
5190 AC_REQUIRE([AC_PROG_AWK])
5191 AC_REQUIRE([AC_OBJEXT])
5192 AC_REQUIRE([AC_EXEEXT])
5193 AC_REQUIRE([AC_PROG_LIBTOOL])
5194
5195 AC_REQUIRE([AC_MIPS_ABI])
5196
5197 dnl C characteristics
5198
5199 AC_REQUIRE([AC_C___ATTRIBUTE__])
5200 AC_REQUIRE([AC_C_INLINE])
5201 AC_REQUIRE([AC_C_CONST])
5202 AC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
5203
5204 AC_REQUIRE([rk_DB])
5205
5206 dnl C types
5207
5208 AC_REQUIRE([AC_TYPE_SIZE_T])
5209 AC_HAVE_TYPE([ssize_t],[#include <unistd.h>])
5210 AC_REQUIRE([AC_TYPE_PID_T])
5211 AC_REQUIRE([AC_TYPE_UID_T])
5212 AC_HAVE_TYPE([long long])
5213
5214 AC_REQUIRE([rk_RETSIGTYPE])
5215
5216 dnl Checks for header files.
5217 AC_REQUIRE([AC_HEADER_STDC])
5218 AC_REQUIRE([AC_HEADER_TIME])
5219
5220 AC_CHECK_HEADERS([\
5221         arpa/inet.h                             \
5222         arpa/nameser.h                          \
5223         config.h                                \
5224         crypt.h                                 \
5225         dirent.h                                \
5226         errno.h                                 \
5227         err.h                                   \
5228         fcntl.h                                 \
5229         grp.h                                   \
5230         ifaddrs.h                               \
5231         net/if.h                                \
5232         netdb.h                                 \
5233         netinet/in.h                            \
5234         netinet/in6.h                           \
5235         netinet/in_systm.h                      \
5236         netinet6/in6.h                          \
5237         netinet6/in6_var.h                      \
5238         paths.h                                 \
5239         pwd.h                                   \
5240         resolv.h                                \
5241         rpcsvc/ypclnt.h                         \
5242         shadow.h                                \
5243         sys/bswap.h                             \
5244         sys/ioctl.h                             \
5245         sys/mman.h                              \
5246         sys/param.h                             \
5247         sys/proc.h                              \
5248         sys/resource.h                          \
5249         sys/socket.h                            \
5250         sys/sockio.h                            \
5251         sys/stat.h                              \
5252         sys/sysctl.h                            \
5253         sys/time.h                              \
5254         sys/tty.h                               \
5255         sys/types.h                             \
5256         sys/uio.h                               \
5257         sys/utsname.h                           \
5258         sys/wait.h                              \
5259         syslog.h                                \
5260         termios.h                               \
5261         unistd.h                                \
5262         userconf.h                              \
5263         usersec.h                               \
5264         util.h                                  \
5265         vis.h                                   \
5266 ])
5267         
5268 AC_REQUIRE([CHECK_NETINET_IP_AND_TCP])
5269
5270 AM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes)
5271 AM_CONDITIONAL(have_fnmatch_h, test "$ac_cv_header_fnmatch_h" = yes)
5272 AM_CONDITIONAL(have_ifaddrs_h, test "$ac_cv_header_ifaddrs_h" = yes)
5273 AM_CONDITIONAL(have_vis_h, test "$ac_cv_header_vis_h" = yes)
5274
5275 dnl Check for functions and libraries
5276
5277 AC_FIND_FUNC(socket, socket)
5278 AC_FIND_FUNC(gethostbyname, nsl)
5279 AC_FIND_FUNC(syslog, syslog)
5280
5281 AC_KRB_IPV6
5282
5283 AC_FIND_FUNC(gethostbyname2, inet6 ip6)
5284
5285 AC_FIND_FUNC(res_search, resolv,
5286 [
5287 #include <stdio.h>
5288 #ifdef HAVE_SYS_TYPES_H
5289 #include <sys/types.h>
5290 #endif
5291 #ifdef HAVE_NETINET_IN_H
5292 #include <netinet/in.h>
5293 #endif
5294 #ifdef HAVE_ARPA_NAMESER_H
5295 #include <arpa/nameser.h>
5296 #endif
5297 #ifdef HAVE_RESOLV_H
5298 #include <resolv.h>
5299 #endif
5300 ],
5301 [0,0,0,0,0])
5302
5303 AC_FIND_FUNC(res_nsearch, resolv,
5304 [
5305 #include <stdio.h>
5306 #ifdef HAVE_SYS_TYPES_H
5307 #include <sys/types.h>
5308 #endif
5309 #ifdef HAVE_NETINET_IN_H
5310 #include <netinet/in.h>
5311 #endif
5312 #ifdef HAVE_ARPA_NAMESER_H
5313 #include <arpa/nameser.h>
5314 #endif
5315 #ifdef HAVE_RESOLV_H
5316 #include <resolv.h>
5317 #endif
5318 ],
5319 [0,0,0,0,0])
5320
5321 AC_FIND_FUNC(dn_expand, resolv,
5322 [
5323 #include <stdio.h>
5324 #ifdef HAVE_SYS_TYPES_H
5325 #include <sys/types.h>
5326 #endif
5327 #ifdef HAVE_NETINET_IN_H
5328 #include <netinet/in.h>
5329 #endif
5330 #ifdef HAVE_ARPA_NAMESER_H
5331 #include <arpa/nameser.h>
5332 #endif
5333 #ifdef HAVE_RESOLV_H
5334 #include <resolv.h>
5335 #endif
5336 ],
5337 [0,0,0,0,0])
5338
5339 rk_CHECK_VAR(_res, 
5340 [#include <stdio.h>
5341 #ifdef HAVE_SYS_TYPES_H
5342 #include <sys/types.h>
5343 #endif
5344 #ifdef HAVE_NETINET_IN_H
5345 #include <netinet/in.h>
5346 #endif
5347 #ifdef HAVE_ARPA_NAMESER_H
5348 #include <arpa/nameser.h>
5349 #endif
5350 #ifdef HAVE_RESOLV_H
5351 #include <resolv.h>
5352 #endif])
5353
5354
5355 AC_BROKEN_SNPRINTF
5356 AC_BROKEN_VSNPRINTF
5357
5358 AC_BROKEN_GLOB
5359 if test "$ac_cv_func_glob_working" != yes; then
5360         AC_LIBOBJ(glob)
5361 fi
5362 AM_CONDITIONAL(have_glob_h, test "$ac_cv_func_glob_working" = yes)
5363
5364
5365 AC_CHECK_FUNCS([                                \
5366         asnprintf                               \
5367         asprintf                                \
5368         atexit                                  \
5369         cgetent                                 \
5370         getconfattr                             \
5371         getprogname                             \
5372         getrlimit                               \
5373         getspnam                                \
5374         initstate                               \
5375         issetugid                               \
5376         on_exit                                 \
5377         random                                  \
5378         setprogname                             \
5379         setstate                                \
5380         strsvis                                 \
5381         strunvis                                \
5382         strvis                                  \
5383         strvisx                                 \
5384         svis                                    \
5385         sysconf                                 \
5386         sysctl                                  \
5387         uname                                   \
5388         unvis                                   \
5389         vasnprintf                              \
5390         vasprintf                               \
5391         vis                                     \
5392 ])
5393
5394 if test "$ac_cv_func_cgetent" = no; then
5395         AC_LIBOBJ(getcap)
5396 fi
5397
5398 AC_REQUIRE([AC_FUNC_GETLOGIN])
5399
5400 AC_REQUIRE([AC_FUNC_MMAP])
5401
5402 AC_FIND_FUNC_NO_LIBS(getsockopt,,
5403 [#ifdef HAVE_SYS_TYPES_H
5404 #include <sys/types.h>
5405 #endif
5406 #ifdef HAVE_SYS_SOCKET_H
5407 #include <sys/socket.h>
5408 #endif],
5409 [0,0,0,0,0])
5410 AC_FIND_FUNC_NO_LIBS(setsockopt,,
5411 [#ifdef HAVE_SYS_TYPES_H
5412 #include <sys/types.h>
5413 #endif
5414 #ifdef HAVE_SYS_SOCKET_H
5415 #include <sys/socket.h>
5416 #endif],
5417 [0,0,0,0,0])
5418
5419 AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
5420 [#ifdef HAVE_NETDB_H
5421 #include <netdb.h>
5422 #endif],
5423 17)
5424 AC_NEED_PROTO([
5425 #ifdef HAVE_NETDB_H
5426 #include <netdb.h>
5427 #endif],
5428 hstrerror)
5429
5430 AC_FOREACH([rk_func], [asprintf vasprintf asnprintf vasnprintf],
5431         [AC_NEED_PROTO([
5432         #include <stdio.h>
5433         #include <string.h>],
5434         rk_func)])
5435
5436 AC_FIND_FUNC_NO_LIBS(bswap16,,
5437 [#ifdef HAVE_SYS_BSWAP_H
5438 #include <sys/bswap.h>
5439 #endif],0)
5440
5441 AC_FIND_FUNC_NO_LIBS(bswap32,,
5442 [#ifdef HAVE_SYS_BSWAP_H
5443 #include <sys/bswap.h>
5444 #endif],0)
5445
5446 AC_FIND_FUNC_NO_LIBS(pidfile,util,
5447 [#ifdef HAVE_UTIL_H
5448 #include <util.h>
5449 #endif],0)
5450
5451 AC_FIND_IF_NOT_BROKEN(getaddrinfo,,
5452 [#ifdef HAVE_NETDB_H
5453 #include <netdb.h>
5454 #endif],[0,0,0,0])
5455
5456 AC_FIND_IF_NOT_BROKEN(getnameinfo,,
5457 [#ifdef HAVE_NETDB_H
5458 #include <netdb.h>
5459 #endif],[0,0,0,0,0,0,0])
5460
5461 AC_FIND_IF_NOT_BROKEN(freeaddrinfo,,
5462 [#ifdef HAVE_NETDB_H
5463 #include <netdb.h>
5464 #endif],[0])
5465
5466 AC_FIND_IF_NOT_BROKEN(gai_strerror,,
5467 [#ifdef HAVE_NETDB_H
5468 #include <netdb.h>
5469 #endif],[0])
5470
5471 AC_BROKEN([                                     \
5472         chown                                   \
5473         copyhostent                             \
5474         daemon                                  \
5475         ecalloc                                 \
5476         emalloc                                 \
5477         erealloc                                \
5478         estrdup                                 \
5479         err                                     \
5480         errx                                    \
5481         fchown                                  \
5482         flock                                   \
5483         fnmatch                                 \
5484         freehostent                             \
5485         getcwd                                  \
5486         getdtablesize                           \
5487         getegid                                 \
5488         geteuid                                 \
5489         getgid                                  \
5490         gethostname                             \
5491         getifaddrs                              \
5492         getipnodebyaddr                         \
5493         getipnodebyname                         \
5494         getopt                                  \
5495         gettimeofday                            \
5496         getuid                                  \
5497         getusershell                            \
5498         initgroups                              \
5499         innetgr                                 \
5500         iruserok                                \
5501         localtime_r                             \
5502         lstat                                   \
5503         memmove                                 \
5504         mkstemp                                 \
5505         putenv                                  \
5506         rcmd                                    \
5507         readv                                   \
5508         recvmsg                                 \
5509         sendmsg                                 \
5510         setegid                                 \
5511         setenv                                  \
5512         seteuid                                 \
5513         strcasecmp                              \
5514         strdup                                  \
5515         strerror                                \
5516         strftime                                \
5517         strlcat                                 \
5518         strlcpy                                 \
5519         strlwr                                  \
5520         strncasecmp                             \
5521         strndup                                 \
5522         strnlen                                 \
5523         strptime                                \
5524         strsep                                  \
5525         strsep_copy                             \
5526         strtok_r                                \
5527         strupr                                  \
5528         swab                                    \
5529         unsetenv                                \
5530         verr                                    \
5531         verrx                                   \
5532         vsyslog                                 \
5533         vwarn                                   \
5534         vwarnx                                  \
5535         warn                                    \
5536         warnx                                   \
5537         writev                                  \
5538 ])
5539
5540 AC_FOREACH([rk_func], [strndup strsep strtok_r],
5541         [AC_NEED_PROTO([#include <string.h>], rk_func)])
5542
5543 AC_FOREACH([rk_func], [strsvis strunvis strvis strvisx svis unvis vis],
5544 [AC_NEED_PROTO([#ifdef HAVE_VIS_H
5545 #include <vis.h>
5546 #endif], rk_func)])
5547
5548 AC_BROKEN2(inet_aton,
5549 [#ifdef HAVE_SYS_TYPES_H
5550 #include <sys/types.h>
5551 #endif
5552 #ifdef HAVE_SYS_SOCKET_H
5553 #include <sys/socket.h>
5554 #endif
5555 #ifdef HAVE_NETINET_IN_H
5556 #include <netinet/in.h>
5557 #endif
5558 #ifdef HAVE_ARPA_INET_H
5559 #include <arpa/inet.h>
5560 #endif],
5561 [0,0])
5562
5563 AC_BROKEN2(inet_ntop,
5564 [#ifdef HAVE_SYS_TYPES_H
5565 #include <sys/types.h>
5566 #endif
5567 #ifdef HAVE_SYS_SOCKET_H
5568 #include <sys/socket.h>
5569 #endif
5570 #ifdef HAVE_NETINET_IN_H
5571 #include <netinet/in.h>
5572 #endif
5573 #ifdef HAVE_ARPA_INET_H
5574 #include <arpa/inet.h>
5575 #endif],
5576 [0, 0, 0, 0])
5577
5578 AC_BROKEN2(inet_pton,
5579 [#ifdef HAVE_SYS_TYPES_H
5580 #include <sys/types.h>
5581 #endif
5582 #ifdef HAVE_SYS_SOCKET_H
5583 #include <sys/socket.h>
5584 #endif
5585 #ifdef HAVE_NETINET_IN_H
5586 #include <netinet/in.h>
5587 #endif
5588 #ifdef HAVE_ARPA_INET_H
5589 #include <arpa/inet.h>
5590 #endif],
5591 [0,0,0])
5592
5593 dnl
5594 dnl Check for sa_len in struct sockaddr, 
5595 dnl needs to come before the getnameinfo test
5596 dnl
5597 AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
5598 #include <sys/socket.h>])
5599
5600 if test "$ac_cv_func_getnameinfo" = "yes"; then
5601   rk_BROKEN_GETNAMEINFO
5602   if test "$ac_cv_func_getnameinfo_broken" = yes; then
5603         AC_LIBOBJ(getnameinfo)
5604   fi
5605 fi
5606
5607 if test "$ac_cv_func_getaddrinfo" = "yes"; then
5608   rk_BROKEN_GETADDRINFO
5609   if test "$ac_cv_func_getaddrinfo_numserv" = no; then
5610         AC_LIBOBJ(getaddrinfo)
5611         AC_LIBOBJ(freeaddrinfo)
5612   fi
5613 fi
5614
5615 AC_NEED_PROTO([#include <stdlib.h>], setenv)
5616 AC_NEED_PROTO([#include <stdlib.h>], unsetenv)
5617 AC_NEED_PROTO([#include <unistd.h>], gethostname)
5618 AC_NEED_PROTO([#include <unistd.h>], mkstemp)
5619 AC_NEED_PROTO([#include <unistd.h>], getusershell)
5620
5621 AC_NEED_PROTO([
5622 #ifdef HAVE_SYS_TYPES_H
5623 #include <sys/types.h>
5624 #endif
5625 #ifdef HAVE_SYS_SOCKET_H
5626 #include <sys/socket.h>
5627 #endif
5628 #ifdef HAVE_NETINET_IN_H
5629 #include <netinet/in.h>
5630 #endif
5631 #ifdef HAVE_ARPA_INET_H
5632 #include <arpa/inet.h>
5633 #endif],
5634 inet_aton)
5635
5636 AC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl
5637
5638 AC_REQUIRE([rk_BROKEN_REALLOC])dnl
5639
5640 dnl AC_KRB_FUNC_GETCWD_BROKEN
5641
5642 dnl
5643 dnl Checks for prototypes and declarations
5644 dnl
5645
5646 AC_PROTO_COMPAT([
5647 #ifdef HAVE_SYS_TYPES_H
5648 #include <sys/types.h>
5649 #endif
5650 #ifdef HAVE_SYS_SOCKET_H
5651 #include <sys/socket.h>
5652 #endif
5653 #ifdef HAVE_NETINET_IN_H
5654 #include <netinet/in.h>
5655 #endif
5656 #ifdef HAVE_ARPA_INET_H
5657 #include <arpa/inet.h>
5658 #endif
5659 #ifdef HAVE_NETDB_H
5660 #include <netdb.h>
5661 #endif
5662 ],
5663 gethostbyname, struct hostent *gethostbyname(const char *))
5664
5665 AC_PROTO_COMPAT([
5666 #ifdef HAVE_SYS_TYPES_H
5667 #include <sys/types.h>
5668 #endif
5669 #ifdef HAVE_SYS_SOCKET_H
5670 #include <sys/socket.h>
5671 #endif
5672 #ifdef HAVE_NETINET_IN_H
5673 #include <netinet/in.h>
5674 #endif
5675 #ifdef HAVE_ARPA_INET_H
5676 #include <arpa/inet.h>
5677 #endif
5678 #ifdef HAVE_NETDB_H
5679 #include <netdb.h>
5680 #endif
5681 ],
5682 gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
5683
5684 AC_PROTO_COMPAT([
5685 #ifdef HAVE_SYS_TYPES_H
5686 #include <sys/types.h>
5687 #endif
5688 #ifdef HAVE_SYS_SOCKET_H
5689 #include <sys/socket.h>
5690 #endif
5691 #ifdef HAVE_NETINET_IN_H
5692 #include <netinet/in.h>
5693 #endif
5694 #ifdef HAVE_ARPA_INET_H
5695 #include <arpa/inet.h>
5696 #endif
5697 #ifdef HAVE_NETDB_H
5698 #include <netdb.h>
5699 #endif
5700 ],
5701 getservbyname, struct servent *getservbyname(const char *, const char *))
5702
5703 AC_PROTO_COMPAT([
5704 #ifdef HAVE_SYS_TYPES_H
5705 #include <sys/types.h>
5706 #endif
5707 #ifdef HAVE_SYS_SOCKET_H
5708 #include <sys/socket.h>
5709 #endif
5710 ],
5711 getsockname, int getsockname(int, struct sockaddr*, socklen_t*))
5712
5713 AC_PROTO_COMPAT([
5714 #ifdef HAVE_SYSLOG_H
5715 #include <syslog.h>
5716 #endif
5717 ],
5718 openlog, void openlog(const char *, int, int))
5719
5720 AC_NEED_PROTO([
5721 #ifdef HAVE_CRYPT_H
5722 #include <crypt.h>
5723 #endif
5724 #ifdef HAVE_UNISTD_H
5725 #include <unistd.h>
5726 #endif
5727 ],
5728 crypt)
5729
5730 dnl variables
5731
5732 rk_CHECK_VAR(h_errno, 
5733 [#ifdef HAVE_SYS_TYPES_H
5734 #include <sys/types.h>
5735 #endif
5736 #ifdef HAVE_NETDB_H
5737 #include <netdb.h>
5738 #endif])
5739
5740 rk_CHECK_VAR(h_errlist, 
5741 [#ifdef HAVE_NETDB_H
5742 #include <netdb.h>
5743 #endif])
5744
5745 rk_CHECK_VAR(h_nerr, 
5746 [#ifdef HAVE_NETDB_H
5747 #include <netdb.h>
5748 #endif])
5749
5750 rk_CHECK_VAR([__progname], 
5751 [#ifdef HAVE_ERR_H
5752 #include <err.h>
5753 #endif])
5754
5755 AC_CHECK_DECLARATION([#include <stdlib.h>
5756 #ifdef HAVE_UNISTD_H
5757 #include <unistd.h>
5758 #endif], optarg)
5759 AC_CHECK_DECLARATION([#include <stdlib.h>
5760 #ifdef HAVE_UNISTD_H
5761 #include <unistd.h>
5762 #endif], optind)
5763 AC_CHECK_DECLARATION([#include <stdlib.h>
5764 #ifdef HAVE_UNISTD_H
5765 #include <unistd.h>
5766 #endif], opterr)
5767 AC_CHECK_DECLARATION([#include <stdlib.h>
5768 #ifdef HAVE_UNISTD_H
5769 #include <unistd.h>
5770 #endif], optopt)
5771
5772 AC_CHECK_DECLARATION([#include <stdlib.h>], environ)
5773
5774 dnl
5775 dnl Check for fields in struct tm
5776 dnl
5777
5778 AC_HAVE_STRUCT_FIELD(struct tm, tm_gmtoff, [#include <time.h>])
5779 AC_HAVE_STRUCT_FIELD(struct tm, tm_zone, [#include <time.h>])
5780
5781 dnl
5782 dnl or do we have a variable `timezone' ?
5783 dnl
5784
5785 rk_CHECK_VAR(timezone,[#include <time.h>])
5786 rk_CHECK_VAR(altzone,[#include <time.h>])
5787
5788 AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
5789 AC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
5790 AC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
5791 AC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/socket.h>])
5792 AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
5793 AC_HAVE_TYPE([struct ifaddrs], [#include <ifaddrs.h>])
5794 AC_HAVE_TYPE([struct iovec],[
5795 #include <sys/types.h>
5796 #include <sys/uio.h>
5797 ])
5798 AC_HAVE_TYPE([struct msghdr],[
5799 #include <sys/types.h>
5800 #include <sys/socket.h>
5801 ])
5802
5803 dnl
5804 dnl Check for struct winsize
5805 dnl
5806
5807 AC_KRB_STRUCT_WINSIZE
5808
5809 dnl
5810 dnl Check for struct spwd
5811 dnl
5812
5813 AC_KRB_STRUCT_SPWD
5814
5815 dnl won't work with automake
5816 dnl moved to AC_OUTPUT in configure.in
5817 dnl AC_CONFIG_FILES($1/Makefile)
5818
5819 LIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
5820
5821 AC_SUBST(DIR_roken)dnl
5822 AC_SUBST(LIB_roken)dnl
5823 AC_SUBST(INCLUDES_roken)dnl
5824 ])
5825
5826 dnl $Id: have-type.m4,v 1.6 2000/07/15 18:10:00 joda Exp $
5827 dnl
5828 dnl check for existance of a type
5829
5830 dnl AC_HAVE_TYPE(TYPE,INCLUDES)
5831 AC_DEFUN(AC_HAVE_TYPE, [
5832 AC_REQUIRE([AC_HEADER_STDC])
5833 cv=`echo "$1" | sed 'y%./+- %__p__%'`
5834 AC_MSG_CHECKING(for $1)
5835 AC_CACHE_VAL([ac_cv_type_$cv],
5836 AC_TRY_COMPILE(
5837 [#include <sys/types.h>
5838 #if STDC_HEADERS
5839 #include <stdlib.h>
5840 #include <stddef.h>
5841 #endif
5842 $2],
5843 [$1 foo;],
5844 eval "ac_cv_type_$cv=yes",
5845 eval "ac_cv_type_$cv=no"))dnl
5846 ac_foo=`eval echo \\$ac_cv_type_$cv`
5847 AC_MSG_RESULT($ac_foo)
5848 if test "$ac_foo" = yes; then
5849   ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'`
5850 if false; then
5851         AC_CHECK_TYPES($1)
5852 fi
5853   AC_DEFINE_UNQUOTED($ac_tr_hdr, 1, [Define if you have type `$1'])
5854 fi
5855 ])
5856
5857 dnl
5858 dnl $Id: retsigtype.m4,v 1.1 2000/07/15 18:05:56 joda Exp $
5859 dnl
5860 dnl Figure out return type of signal handlers, and define SIGRETURN macro
5861 dnl that can be used to return from one
5862 dnl
5863 AC_DEFUN(rk_RETSIGTYPE,[
5864 AC_TYPE_SIGNAL
5865 if test "$ac_cv_type_signal" = "void" ; then
5866         AC_DEFINE(VOID_RETSIGTYPE, 1, [Define if signal handlers return void.])
5867 fi
5868 AC_SUBST(VOID_RETSIGTYPE)
5869 AH_BOTTOM([#ifdef VOID_RETSIGTYPE
5870 #define SIGRETURN(x) return
5871 #else
5872 #define SIGRETURN(x) return (RETSIGTYPE)(x)
5873 #endif])
5874 ])
5875 dnl
5876 dnl $Id: check-netinet-ip-and-tcp.m4,v 1.3 2000/07/18 10:33:02 joda Exp $
5877 dnl
5878
5879 dnl extra magic check for netinet/{ip.h,tcp.h} because on irix 6.5.3
5880 dnl you have to include standards.h before including these files
5881
5882 AC_DEFUN(CHECK_NETINET_IP_AND_TCP,
5883 [
5884 AC_CHECK_HEADERS(standards.h)
5885 for i in netinet/ip.h netinet/tcp.h; do
5886
5887 cv=`echo "$i" | sed 'y%./+-%__p_%'`
5888
5889 AC_CACHE_CHECK([for $i],ac_cv_header_$cv,
5890 [AC_TRY_CPP([\
5891 #ifdef HAVE_STANDARDS_H
5892 #include <standards.h>
5893 #endif
5894 #include <$i>
5895 ],
5896 eval "ac_cv_header_$cv=yes",
5897 eval "ac_cv_header_$cv=no")])
5898 ac_res=`eval echo \\$ac_cv_header_$cv`
5899 if test "$ac_res" = yes; then
5900         ac_tr_hdr=HAVE_`echo $i | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5901         AC_DEFINE_UNQUOTED($ac_tr_hdr, 1)
5902 fi
5903 done
5904 if false;then
5905         AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h)
5906 fi
5907 ])
5908
5909 dnl $Id: krb-ipv6.m4,v 1.13 2002/04/30 16:48:13 joda Exp $
5910 dnl
5911 dnl test for IPv6
5912 dnl
5913 AC_DEFUN(AC_KRB_IPV6, [
5914 AC_ARG_WITH(ipv6,
5915         AC_HELP_STRING([--without-ipv6],[do not enable IPv6 support]),[
5916 if test "$withval" = "no"; then
5917         ac_cv_lib_ipv6=no
5918 fi])
5919 save_CFLAGS="${CFLAGS}"
5920 AC_CACHE_CHECK([for IPv6 stack type], v6type,
5921 [dnl check for different v6 implementations (by itojun)
5922 v6type=unknown
5923 v6lib=none
5924
5925 for i in v6d toshiba kame inria zeta linux; do
5926         case $i in
5927         v6d)
5928                 AC_EGREP_CPP(yes, [
5929 #include </usr/local/v6/include/sys/types.h>
5930 #ifdef __V6D__
5931 yes
5932 #endif],
5933                         [v6type=$i; v6lib=v6;
5934                         v6libdir=/usr/local/v6/lib;
5935                         CFLAGS="-I/usr/local/v6/include $CFLAGS"])
5936                 ;;
5937         toshiba)
5938                 AC_EGREP_CPP(yes, [
5939 #include <sys/param.h>
5940 #ifdef _TOSHIBA_INET6
5941 yes
5942 #endif],
5943                         [v6type=$i; v6lib=inet6;
5944                         v6libdir=/usr/local/v6/lib;
5945                         CFLAGS="-DINET6 $CFLAGS"])
5946                 ;;
5947         kame)
5948                 AC_EGREP_CPP(yes, [
5949 #include <netinet/in.h>
5950 #ifdef __KAME__
5951 yes
5952 #endif],
5953                         [v6type=$i; v6lib=inet6;
5954                         v6libdir=/usr/local/v6/lib;
5955                         CFLAGS="-DINET6 $CFLAGS"])
5956                 ;;
5957         inria)
5958                 AC_EGREP_CPP(yes, [
5959 #include <netinet/in.h>
5960 #ifdef IPV6_INRIA_VERSION
5961 yes
5962 #endif],
5963                         [v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
5964                 ;;
5965         zeta)
5966                 AC_EGREP_CPP(yes, [
5967 #include <sys/param.h>
5968 #ifdef _ZETA_MINAMI_INET6
5969 yes
5970 #endif],
5971                         [v6type=$i; v6lib=inet6;
5972                         v6libdir=/usr/local/v6/lib;
5973                         CFLAGS="-DINET6 $CFLAGS"])
5974                 ;;
5975         linux)
5976                 if test -d /usr/inet6; then
5977                         v6type=$i
5978                         v6lib=inet6
5979                         v6libdir=/usr/inet6
5980                         CFLAGS="-DINET6 $CFLAGS"
5981                 fi
5982                 ;;
5983         esac
5984         if test "$v6type" != "unknown"; then
5985                 break
5986         fi
5987 done
5988
5989 if test "$v6lib" != "none"; then
5990         for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
5991                 if test -d $dir -a -f $dir/lib$v6lib.a; then
5992                         LIBS="-L$dir -l$v6lib $LIBS"
5993                         break
5994                 fi
5995         done
5996 fi
5997 ])
5998
5999 AC_CACHE_CHECK([for IPv6], ac_cv_lib_ipv6, [
6000 AC_TRY_LINK([
6001 #ifdef HAVE_SYS_TYPES_H
6002 #include <sys/types.h>
6003 #endif
6004 #ifdef HAVE_SYS_SOCKET_H
6005 #include <sys/socket.h>
6006 #endif
6007 #ifdef HAVE_NETINET_IN_H
6008 #include <netinet/in.h>
6009 #endif
6010 #ifdef HAVE_NETINET_IN6_H
6011 #include <netinet/in6.h>
6012 #endif
6013 ],
6014 [
6015  struct sockaddr_in6 sin6;
6016  int s;
6017
6018  s = socket(AF_INET6, SOCK_DGRAM, 0);
6019
6020  sin6.sin6_family = AF_INET6;
6021  sin6.sin6_port = htons(17);
6022  sin6.sin6_addr = in6addr_any;
6023  bind(s, (struct sockaddr *)&sin6, sizeof(sin6));
6024 ],
6025 ac_cv_lib_ipv6=yes,
6026 ac_cv_lib_ipv6=no)])
6027 if test "$ac_cv_lib_ipv6" = yes; then
6028   AC_DEFINE(HAVE_IPV6, 1, [Define if you have IPv6.])
6029 else
6030   CFLAGS="${save_CFLAGS}"
6031 fi
6032
6033 if test "$ac_cv_lib_ipv6" = yes; then
6034         AC_CACHE_CHECK([for in6addr_loopback],[ac_cv_var_in6addr_loopback],[
6035         AC_TRY_LINK([
6036 #ifdef HAVE_SYS_TYPES_H
6037 #include <sys/types.h>
6038 #endif
6039 #ifdef HAVE_SYS_SOCKET_H
6040 #include <sys/socket.h>
6041 #endif
6042 #ifdef HAVE_NETINET_IN_H
6043 #include <netinet/in.h>
6044 #endif
6045 #ifdef HAVE_NETINET_IN6_H
6046 #include <netinet/in6.h>
6047 #endif],[
6048 struct sockaddr_in6 sin6;
6049 sin6.sin6_addr = in6addr_loopback;
6050 ],ac_cv_var_in6addr_loopback=yes,ac_cv_var_in6addr_loopback=no)])
6051         if test "$ac_cv_var_in6addr_loopback" = yes; then
6052                 AC_DEFINE(HAVE_IN6ADDR_LOOPBACK, 1, 
6053                         [Define if you have the in6addr_loopback variable])
6054         fi
6055 fi
6056 ])
6057 dnl $Id: check-var.m4,v 1.6 2001/08/21 12:00:16 joda Exp $
6058 dnl
6059 dnl rk_CHECK_VAR(variable, includes)
6060 AC_DEFUN([rk_CHECK_VAR], [
6061 AC_MSG_CHECKING(for $1)
6062 AC_CACHE_VAL(ac_cv_var_$1, [
6063 AC_TRY_LINK([extern int $1;
6064 int foo() { return $1; }],
6065             [foo()],
6066             ac_cv_var_$1=yes, ac_cv_var_$1=no)
6067 ])
6068 ac_foo=`eval echo \\$ac_cv_var_$1`
6069 AC_MSG_RESULT($ac_foo)
6070 if test "$ac_foo" = yes; then
6071         AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]$1), 1, 
6072                 [Define if you have the `]$1[' variable.])
6073         m4_ifval([$2], AC_CHECK_DECLARATION([$2],[$1]))
6074 fi
6075 ])
6076
6077 AC_WARNING_ENABLE([obsolete])
6078 AU_DEFUN([AC_CHECK_VAR], [rk_CHECK_VAR([$2], [$1])], [foo])
6079 dnl $Id: check-declaration.m4,v 1.3 1999/03/01 13:03:08 joda Exp $
6080 dnl
6081 dnl
6082 dnl Check if we need the declaration of a variable
6083 dnl
6084
6085 dnl AC_HAVE_DECLARATION(includes, variable)
6086 AC_DEFUN(AC_CHECK_DECLARATION, [
6087 AC_MSG_CHECKING([if $2 is properly declared])
6088 AC_CACHE_VAL(ac_cv_var_$2_declaration, [
6089 AC_TRY_COMPILE([$1
6090 extern struct { int foo; } $2;],
6091 [$2.foo = 1;],
6092 eval "ac_cv_var_$2_declaration=no",
6093 eval "ac_cv_var_$2_declaration=yes")
6094 ])
6095
6096 define(foo, [HAVE_]translit($2, [a-z], [A-Z])[_DECLARATION])
6097
6098 AC_MSG_RESULT($ac_cv_var_$2_declaration)
6099 if eval "test \"\$ac_cv_var_$2_declaration\" = yes"; then
6100         AC_DEFINE(foo, 1, [define if your system declares $2])
6101 fi
6102 undefine([foo])
6103 ])
6104
6105 dnl $Id: broken-snprintf.m4,v 1.4 2001/09/01 11:56:05 assar Exp $
6106 dnl
6107 AC_DEFUN(AC_BROKEN_SNPRINTF, [
6108 AC_CACHE_CHECK(for working snprintf,ac_cv_func_snprintf_working,
6109 ac_cv_func_snprintf_working=yes
6110 AC_TRY_RUN([
6111 #include <stdio.h>
6112 #include <string.h>
6113 int main()
6114 {
6115         char foo[[3]];
6116         snprintf(foo, 2, "12");
6117         return strcmp(foo, "1");
6118 }],:,ac_cv_func_snprintf_working=no,:))
6119
6120 if test "$ac_cv_func_snprintf_working" = yes; then
6121         AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [define if you have a working snprintf])
6122 fi
6123 if test "$ac_cv_func_snprintf_working" = yes; then
6124 AC_NEED_PROTO([#include <stdio.h>],snprintf)
6125 fi
6126 ])
6127
6128 AC_DEFUN(AC_BROKEN_VSNPRINTF,[
6129 AC_CACHE_CHECK(for working vsnprintf,ac_cv_func_vsnprintf_working,
6130 ac_cv_func_vsnprintf_working=yes
6131 AC_TRY_RUN([
6132 #include <stdio.h>
6133 #include <string.h>
6134 #include <stdarg.h>
6135
6136 int foo(int num, ...)
6137 {
6138         char bar[[3]];
6139         va_list arg;
6140         va_start(arg, num);
6141         vsnprintf(bar, 2, "%s", arg);
6142         va_end(arg);
6143         return strcmp(bar, "1");
6144 }
6145
6146
6147 int main()
6148 {
6149         return foo(0, "12");
6150 }],:,ac_cv_func_vsnprintf_working=no,:))
6151
6152 if test "$ac_cv_func_vsnprintf_working" = yes; then
6153         AC_DEFINE_UNQUOTED(HAVE_VSNPRINTF, 1, [define if you have a working vsnprintf])
6154 fi
6155 if test "$ac_cv_func_vsnprintf_working" = yes; then
6156 AC_NEED_PROTO([#include <stdio.h>],vsnprintf)
6157 fi
6158 ])
6159
6160 dnl $Id: need-proto.m4,v 1.4 2002/08/23 15:07:41 joda Exp $
6161 dnl
6162 dnl
6163 dnl Check if we need the prototype for a function
6164 dnl
6165
6166 dnl AC_NEED_PROTO(includes, function)
6167
6168 AC_DEFUN(AC_NEED_PROTO, [
6169 if test "$ac_cv_func_$2+set" != set -o "$ac_cv_func_$2" = yes; then
6170 AC_CACHE_CHECK([if $2 needs a prototype], ac_cv_func_$2_noproto,
6171 AC_TRY_COMPILE([$1],
6172 [struct foo { int foo; } xx;
6173 extern int $2 (struct foo*);
6174 $2(&xx);
6175 ],
6176 eval "ac_cv_func_$2_noproto=yes",
6177 eval "ac_cv_func_$2_noproto=no"))
6178 if test "$ac_cv_func_$2_noproto" = yes; then
6179         AC_DEFINE(AS_TR_CPP(NEED_[]$2[]_PROTO), 1,
6180                 [define if the system is missing a prototype for $2()])
6181 fi
6182 fi
6183 ])
6184
6185 dnl $Id: broken-glob.m4,v 1.4 2001/06/19 09:59:46 assar Exp $
6186 dnl
6187 dnl check for glob(3)
6188 dnl
6189 AC_DEFUN(AC_BROKEN_GLOB,[
6190 AC_CACHE_CHECK(for working glob, ac_cv_func_glob_working,
6191 ac_cv_func_glob_working=yes
6192 AC_TRY_LINK([
6193 #include <stdio.h>
6194 #include <glob.h>],[
6195 glob(NULL, GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE|
6196 #ifdef GLOB_MAXPATH
6197 GLOB_MAXPATH
6198 #else
6199 GLOB_LIMIT
6200 #endif
6201 ,
6202 NULL, NULL);
6203 ],:,ac_cv_func_glob_working=no,:))
6204
6205 if test "$ac_cv_func_glob_working" = yes; then
6206         AC_DEFINE(HAVE_GLOB, 1, [define if you have a glob() that groks 
6207         GLOB_BRACE, GLOB_NOCHECK, GLOB_QUOTE, GLOB_TILDE, and GLOB_LIMIT])
6208 fi
6209 if test "$ac_cv_func_glob_working" = yes; then
6210 AC_NEED_PROTO([#include <stdio.h>
6211 #include <glob.h>],glob)
6212 fi
6213 ])
6214
6215 dnl
6216 dnl $Id: krb-func-getlogin.m4,v 1.1 1999/07/13 17:45:30 assar Exp $
6217 dnl
6218 dnl test for POSIX (broken) getlogin
6219 dnl
6220
6221
6222 AC_DEFUN(AC_FUNC_GETLOGIN, [
6223 AC_CHECK_FUNCS(getlogin setlogin)
6224 if test "$ac_cv_func_getlogin" = yes; then
6225 AC_CACHE_CHECK(if getlogin is posix, ac_cv_func_getlogin_posix, [
6226 if test "$ac_cv_func_getlogin" = yes -a "$ac_cv_func_setlogin" = yes; then
6227         ac_cv_func_getlogin_posix=no
6228 else
6229         ac_cv_func_getlogin_posix=yes
6230 fi
6231 ])
6232 if test "$ac_cv_func_getlogin_posix" = yes; then
6233         AC_DEFINE(POSIX_GETLOGIN, 1, [Define if getlogin has POSIX flavour (and not BSD).])
6234 fi
6235 fi
6236 ])
6237
6238 dnl $Id: find-if-not-broken.m4,v 1.4 2002/05/19 19:37:08 joda Exp $
6239 dnl
6240 dnl
6241 dnl Mix between AC_FIND_FUNC and AC_BROKEN
6242 dnl
6243
6244 AC_DEFUN(AC_FIND_IF_NOT_BROKEN,
6245 [AC_FIND_FUNC([$1], [$2], [$3], [$4])
6246 if eval "test \"$ac_cv_func_$1\" != yes"; then 
6247         rk_LIBOBJ([$1])
6248 fi
6249 ])
6250
6251 dnl $Id: broken.m4,v 1.6 2002/05/19 19:36:52 joda Exp $
6252 dnl
6253 dnl
6254 dnl Same as AC _REPLACE_FUNCS, just define HAVE_func if found in normal
6255 dnl libraries 
6256
6257 AC_DEFUN([AC_BROKEN],
6258 [AC_FOREACH([rk_func], [$1],
6259         [AC_CHECK_FUNC(rk_func,
6260                 [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]rk_func), 1, 
6261                         [Define if you have the function `]rk_func['.])],
6262                 [rk_LIBOBJ(rk_func)])])])
6263
6264 dnl $Id: broken2.m4,v 1.4 2002/05/19 22:16:46 joda Exp $
6265 dnl
6266 dnl AC_BROKEN but with more arguments
6267
6268 dnl AC_BROKEN2(func, includes, arguments)
6269 AC_DEFUN([AC_BROKEN2],
6270 [AC_MSG_CHECKING([for $1])
6271 AC_CACHE_VAL(ac_cv_func_[]$1,
6272 [AC_TRY_LINK([$2],
6273 [
6274 /* The GNU C library defines this for functions which it implements
6275     to always fail with ENOSYS.  Some functions are actually named
6276     something starting with __ and the normal name is an alias.  */
6277 #if defined (__stub_$1) || defined (__stub___$1)
6278 choke me
6279 #else
6280 $1($3)
6281 #endif
6282 ], [eval "ac_cv_func_[]$1=yes"], [eval "ac_cv_func_[]$1=no"])])
6283 if eval "test \"\${ac_cv_func_[]$1}\" = yes"; then
6284   AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]$1), 1, define)
6285   AC_MSG_RESULT(yes)
6286 else
6287   AC_MSG_RESULT(no)
6288   rk_LIBOBJ($1)
6289 fi])
6290
6291 dnl $Id: have-struct-field.m4,v 1.6 1999/07/29 01:44:32 assar Exp $
6292 dnl
6293 dnl check for fields in a structure
6294 dnl
6295 dnl AC_HAVE_STRUCT_FIELD(struct, field, headers)
6296
6297 AC_DEFUN(AC_HAVE_STRUCT_FIELD, [
6298 define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_]))
6299 AC_CACHE_CHECK([for $2 in $1], cache_val,[
6300 AC_TRY_COMPILE([$3],[$1 x; x.$2;],
6301 cache_val=yes,
6302 cache_val=no)])
6303 if test "$cache_val" = yes; then
6304         define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_]))
6305         AC_DEFINE(foo, 1, [Define if $1 has field $2.])
6306         undefine([foo])
6307 fi
6308 undefine([cache_val])
6309 ])
6310
6311 dnl $Id: broken-getnameinfo.m4,v 1.2 2000/12/05 09:09:00 joda Exp $
6312 dnl
6313 dnl test for broken AIX getnameinfo
6314
6315 AC_DEFUN(rk_BROKEN_GETNAMEINFO,[
6316 AC_CACHE_CHECK([if getnameinfo is broken], ac_cv_func_getnameinfo_broken,
6317 AC_TRY_RUN([[#include <stdio.h>
6318 #include <sys/types.h>
6319 #include <sys/socket.h>
6320 #include <netinet/in.h>
6321 #include <netdb.h>
6322
6323 int
6324 main(int argc, char **argv)
6325 {
6326   struct sockaddr_in sin;
6327   char host[256];
6328   memset(&sin, 0, sizeof(sin));
6329 #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
6330   sin.sin_len = sizeof(sin);
6331 #endif
6332   sin.sin_family = AF_INET;
6333   sin.sin_addr.s_addr = 0xffffffff;
6334   sin.sin_port = 0;
6335   return getnameinfo((struct sockaddr*)&sin, sizeof(sin), host, sizeof(host),
6336               NULL, 0, 0);
6337 }
6338 ]], ac_cv_func_getnameinfo_broken=no, ac_cv_func_getnameinfo_broken=yes))])
6339
6340 dnl $Id: broken-getaddrinfo.m4,v 1.3 2002/08/20 14:09:40 joda Exp $
6341 dnl
6342 dnl test if getaddrinfo can handle numeric services
6343
6344 AC_DEFUN(rk_BROKEN_GETADDRINFO,[
6345 AC_CACHE_CHECK([if getaddrinfo handles numeric services], ac_cv_func_getaddrinfo_numserv,
6346 AC_TRY_RUN([[#include <stdio.h>
6347 #include <sys/types.h>
6348 #include <sys/socket.h>
6349 #include <netdb.h>
6350
6351 int
6352 main(int argc, char **argv)
6353 {
6354         struct addrinfo hints, *ai;
6355         memset(&hints, 0, sizeof(hints));
6356         hints.ai_flags = AI_PASSIVE;
6357         hints.ai_socktype = SOCK_STREAM;
6358         hints.ai_family = PF_UNSPEC;
6359         if(getaddrinfo(NULL, "17", &hints, &ai) != 0)
6360                 return 1;
6361         return 0;
6362 }
6363 ]], ac_cv_func_getaddrinfo_numserv=yes, ac_cv_func_getaddrinfo_numserv=no))])
6364
6365 dnl
6366 dnl $Id: broken-realloc.m4,v 1.1 2000/07/15 18:05:36 joda Exp $
6367 dnl
6368 dnl Test for realloc that doesn't handle NULL as first parameter
6369 dnl
6370 AC_DEFUN(rk_BROKEN_REALLOC, [
6371 AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
6372 ac_cv_func_realloc_broken=no
6373 AC_TRY_RUN([
6374 #include <stddef.h>
6375 #include <stdlib.h>
6376
6377 int main()
6378 {
6379         return realloc(NULL, 17) == NULL;
6380 }
6381 ],:, ac_cv_func_realloc_broken=yes, :)
6382 ])
6383 if test "$ac_cv_func_realloc_broken" = yes ; then
6384         AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.])
6385 fi
6386 AH_BOTTOM([#ifdef BROKEN_REALLOC
6387 #define realloc(X, Y) isoc_realloc((X), (Y))
6388 #define isoc_realloc(X, Y) ((X) ? realloc((X), (Y)) : malloc(Y))
6389 #endif])
6390 ])
6391
6392 dnl $Id: proto-compat.m4,v 1.3 1999/03/01 13:03:48 joda Exp $
6393 dnl
6394 dnl
6395 dnl Check if the prototype of a function is compatible with another one
6396 dnl
6397
6398 dnl AC_PROTO_COMPAT(includes, function, prototype)
6399
6400 AC_DEFUN(AC_PROTO_COMPAT, [
6401 AC_CACHE_CHECK([if $2 is compatible with system prototype],
6402 ac_cv_func_$2_proto_compat,
6403 AC_TRY_COMPILE([$1],
6404 [$3;],
6405 eval "ac_cv_func_$2_proto_compat=yes",
6406 eval "ac_cv_func_$2_proto_compat=no"))
6407 define([foo], translit($2, [a-z], [A-Z])[_PROTO_COMPATIBLE])
6408 if test "$ac_cv_func_$2_proto_compat" = yes; then
6409         AC_DEFINE(foo, 1, [define if prototype of $2 is compatible with
6410         $3])
6411 fi
6412 undefine([foo])
6413 ])
6414 dnl $Id: krb-struct-winsize.m4,v 1.3 2001/09/01 11:56:05 assar Exp $
6415 dnl
6416 dnl
6417 dnl Search for struct winsize
6418 dnl
6419
6420 AC_DEFUN(AC_KRB_STRUCT_WINSIZE, [
6421 AC_MSG_CHECKING(for struct winsize)
6422 AC_CACHE_VAL(ac_cv_struct_winsize, [
6423 ac_cv_struct_winsize=no
6424 for i in sys/termios.h sys/ioctl.h; do
6425 AC_EGREP_HEADER(
6426 struct[[        ]]*winsize,dnl
6427 $i, ac_cv_struct_winsize=yes; break)dnl
6428 done
6429 ])
6430 if test "$ac_cv_struct_winsize" = "yes"; then
6431   AC_DEFINE(HAVE_STRUCT_WINSIZE, 1, [define if struct winsize is declared in sys/termios.h])
6432 fi
6433 AC_MSG_RESULT($ac_cv_struct_winsize)
6434 AC_EGREP_HEADER(ws_xpixel, termios.h, 
6435         AC_DEFINE(HAVE_WS_XPIXEL, 1, [define if struct winsize has ws_xpixel]))
6436 AC_EGREP_HEADER(ws_ypixel, termios.h, 
6437         AC_DEFINE(HAVE_WS_YPIXEL, 1, [define if struct winsize has ws_ypixel]))
6438 ])
6439
6440 dnl $Id: krb-struct-spwd.m4,v 1.3 1999/07/13 21:04:11 assar Exp $
6441 dnl
6442 dnl Test for `struct spwd'
6443
6444 AC_DEFUN(AC_KRB_STRUCT_SPWD, [
6445 AC_MSG_CHECKING(for struct spwd)
6446 AC_CACHE_VAL(ac_cv_struct_spwd, [
6447 AC_TRY_COMPILE(
6448 [#include <pwd.h>
6449 #ifdef HAVE_SHADOW_H
6450 #include <shadow.h>
6451 #endif],
6452 [struct spwd foo;],
6453 ac_cv_struct_spwd=yes,
6454 ac_cv_struct_spwd=no)
6455 ])
6456 AC_MSG_RESULT($ac_cv_struct_spwd)
6457
6458 if test "$ac_cv_struct_spwd" = "yes"; then
6459   AC_DEFINE(HAVE_STRUCT_SPWD, 1, [define if you have struct spwd])
6460 fi
6461 ])
6462
6463 dnl $Id: otp.m4,v 1.2 2002/05/19 20:51:08 joda Exp $
6464 dnl
6465 dnl check requirements for OTP library
6466 dnl
6467 AC_DEFUN([rk_OTP],[
6468 AC_REQUIRE([rk_DB])dnl
6469 AC_ARG_ENABLE(otp,
6470         AC_HELP_STRING([--disable-otp],[if you don't want OTP support]))
6471 if test "$enable_otp" = yes -a "$db_type" = unknown; then
6472         AC_MSG_ERROR([OTP requires a NDBM/DB compatible library])
6473 fi
6474 if test "$enable_otp" != no; then
6475         if test "$db_type" != unknown; then
6476                 enable_otp=yes
6477         else
6478                 enable_otp=no
6479         fi
6480 fi
6481 if test "$enable_otp" = yes; then
6482         AC_DEFINE(OTP, 1, [Define if you want OTP support in applications.])
6483         LIB_otp='$(top_builddir)/lib/otp/libotp.la'
6484         AC_SUBST(LIB_otp)
6485 fi
6486 AC_MSG_CHECKING([whether to enable OTP library])
6487 AC_MSG_RESULT($enable_otp)
6488 AM_CONDITIONAL(OTP, test "$enable_otp" = yes)dnl
6489 ])
6490
6491 dnl $Id: osfc2.m4,v 1.3 2002/04/30 16:46:18 joda Exp $
6492 dnl
6493 dnl enable OSF C2 stuff
6494
6495 AC_DEFUN(AC_CHECK_OSFC2,[
6496 AC_ARG_ENABLE(osfc2,
6497         AC_HELP_STRING([--enable-osfc2],[enable some OSF C2 support]))
6498 LIB_security=
6499 if test "$enable_osfc2" = yes; then
6500         AC_DEFINE(HAVE_OSFC2, 1, [Define to enable basic OSF C2 support.])
6501         LIB_security=-lsecurity
6502 fi
6503 AC_SUBST(LIB_security)
6504 ])
6505
6506 dnl $Id: check-man.m4,v 1.3 2000/11/30 01:47:17 joda Exp $
6507 dnl check how to format manual pages
6508 dnl
6509
6510 AC_DEFUN(rk_CHECK_MAN,
6511 [AC_PATH_PROG(NROFF, nroff)
6512 AC_PATH_PROG(GROFF, groff)
6513 AC_CACHE_CHECK(how to format man pages,ac_cv_sys_man_format,
6514 [cat > conftest.1 << END
6515 .Dd January 1, 1970
6516 .Dt CONFTEST 1
6517 .Sh NAME
6518 .Nm conftest
6519 .Nd
6520 foobar
6521 END
6522
6523 if test "$NROFF" ; then
6524         for i in "-mdoc" "-mandoc"; do
6525                 if "$NROFF" $i conftest.1 2> /dev/null | \
6526                         grep Jan > /dev/null 2>&1 ; then
6527                         ac_cv_sys_man_format="$NROFF $i"
6528                         break
6529                 fi
6530         done
6531 fi
6532 if test "$ac_cv_sys_man_format" = "" -a "$GROFF" ; then
6533         for i in "-mdoc" "-mandoc"; do
6534                 if "$GROFF" -Tascii $i conftest.1 2> /dev/null | \
6535                         grep Jan > /dev/null 2>&1 ; then
6536                         ac_cv_sys_man_format="$GROFF -Tascii $i"
6537                         break
6538                 fi
6539         done
6540 fi
6541 if test "$ac_cv_sys_man_format"; then
6542         ac_cv_sys_man_format="$ac_cv_sys_man_format \[$]< > \[$]@"
6543 fi
6544 ])
6545 if test "$ac_cv_sys_man_format"; then
6546         CATMAN="$ac_cv_sys_man_format"
6547         AC_SUBST(CATMAN)
6548 fi
6549 AM_CONDITIONAL(CATMAN, test "$CATMAN")
6550 AC_CACHE_CHECK(extension of pre-formatted manual pages,ac_cv_sys_catman_ext,
6551 [if grep _suffix /etc/man.conf > /dev/null 2>&1; then
6552         ac_cv_sys_catman_ext=0
6553 else
6554         ac_cv_sys_catman_ext=number
6555 fi
6556 ])
6557 if test "$ac_cv_sys_catman_ext" = number; then
6558         CATMANEXT='$$section'
6559 else
6560         CATMANEXT=0
6561 fi
6562 AC_SUBST(CATMANEXT)
6563 ])
6564 dnl
6565 dnl $Id: krb-bigendian.m4,v 1.8 2002/08/28 19:20:19 joda Exp $
6566 dnl
6567
6568 dnl check if this computer is little or big-endian
6569 dnl if we can figure it out at compile-time then don't define the cpp symbol
6570 dnl otherwise test for it and define it.  also allow options for overriding
6571 dnl it when cross-compiling
6572
6573 AC_DEFUN(KRB_C_BIGENDIAN, [
6574 AC_ARG_ENABLE(bigendian,
6575         AC_HELP_STRING([--enable-bigendian],[the target is big endian]),
6576 krb_cv_c_bigendian=yes)
6577 AC_ARG_ENABLE(littleendian,
6578         AC_HELP_STRING([--enable-littleendian],[the target is little endian]),
6579 krb_cv_c_bigendian=no)
6580 AC_CACHE_CHECK(whether byte order is known at compile time,
6581 krb_cv_c_bigendian_compile,
6582 [AC_TRY_COMPILE([
6583 #include <sys/types.h>
6584 #include <sys/param.h>],[
6585 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
6586  bogus endian macros
6587 #endif], krb_cv_c_bigendian_compile=yes, krb_cv_c_bigendian_compile=no)])
6588 AC_CACHE_CHECK(whether byte ordering is bigendian, krb_cv_c_bigendian,[
6589   if test "$krb_cv_c_bigendian_compile" = "yes"; then
6590     AC_TRY_COMPILE([
6591 #include <sys/types.h>
6592 #include <sys/param.h>],[
6593 #if BYTE_ORDER != BIG_ENDIAN
6594   not big endian
6595 #endif], krb_cv_c_bigendian=yes, krb_cv_c_bigendian=no)
6596   else
6597     AC_TRY_RUN([main () {
6598       /* Are we little or big endian?  From Harbison&Steele.  */
6599       union
6600       {
6601         long l;
6602         char c[sizeof (long)];
6603     } u;
6604     u.l = 1;
6605     exit (u.c[sizeof (long) - 1] == 1);
6606   }], krb_cv_c_bigendian=no, krb_cv_c_bigendian=yes,
6607   AC_MSG_ERROR([specify either --enable-bigendian or --enable-littleendian]))
6608   fi
6609 ])
6610 if test "$krb_cv_c_bigendian" = "yes"; then
6611   AC_DEFINE(WORDS_BIGENDIAN, 1, [define if target is big endian])dnl
6612 fi
6613 if test "$krb_cv_c_bigendian_compile" = "yes"; then
6614   AC_DEFINE(ENDIANESS_IN_SYS_PARAM_H, 1, [define if sys/param.h defines the endiness])dnl
6615 fi
6616 AH_BOTTOM([
6617 #if ENDIANESS_IN_SYS_PARAM_H
6618 #  include <sys/types.h>
6619 #  include <sys/param.h>
6620 #  if BYTE_ORDER == BIG_ENDIAN
6621 #  define WORDS_BIGENDIAN 1
6622 #  endif
6623 #endif
6624 ])
6625 ])
6626
6627 dnl
6628 dnl $Id: aix.m4,v 1.9 2002/08/28 19:19:43 joda Exp $
6629 dnl
6630
6631 AC_DEFUN(rk_AIX,[
6632
6633 aix=no
6634 case "$host" in 
6635 *-*-aix3*)
6636         aix=3
6637         ;;
6638 *-*-aix4*|*-*-aix5*)
6639         aix=4
6640         ;;
6641 esac
6642
6643 AM_CONDITIONAL(AIX, test "$aix" != no)dnl
6644 AM_CONDITIONAL(AIX4, test "$aix" = 4)
6645
6646
6647 AC_ARG_ENABLE(dynamic-afs,
6648         AC_HELP_STRING([--disable-dynamic-afs],
6649                 [do not use loaded AFS library with AIX]))
6650
6651 if test "$aix" != no; then
6652         if test "$enable_dynamic_afs" != no; then
6653                 AC_REQUIRE([rk_DLOPEN])
6654                 if test "$ac_cv_func_dlopen" = no; then
6655                         AC_FIND_FUNC_NO_LIBS(loadquery, ld)
6656                 fi
6657                 if test "$ac_cv_func_dlopen" != no; then
6658                         AIX_EXTRA_KAFS='$(LIB_dlopen)'
6659                 elif test "$ac_cv_func_loadquery" != no; then
6660                         AIX_EXTRA_KAFS='$(LIB_loadquery)'
6661                 else
6662                         AC_MSG_NOTICE([not using dynloaded AFS library])
6663                         AIX_EXTRA_KAFS=
6664                         enable_dynamic_afs=no
6665                 fi
6666         else
6667                 AIX_EXTRA_KAFS=
6668         fi
6669 fi
6670
6671 AM_CONDITIONAL(AIX_DYNAMIC_AFS, test "$enable_dynamic_afs" != no)dnl
6672 AC_SUBST(AIX_EXTRA_KAFS)dnl
6673
6674 AH_BOTTOM([#if _AIX
6675 #define _ALL_SOURCE
6676 /* XXX this is gross, but kills about a gazillion warnings */
6677 struct ether_addr;
6678 struct sockaddr;
6679 struct sockaddr_dl;
6680 struct sockaddr_in;
6681 #endif])
6682
6683 ])
6684
6685 dnl
6686 dnl $Id: dlopen.m4,v 1.1 2002/08/28 16:32:16 joda Exp $
6687 dnl
6688
6689 AC_DEFUN([rk_DLOPEN], [
6690         AC_FIND_FUNC_NO_LIBS(dlopen, dl)
6691         AM_CONDITIONAL(HAVE_DLOPEN, test "$ac_cv_funclib_dlopen" != no)
6692 ])
6693
6694 dnl
6695 dnl $Id: irix.m4,v 1.1 2002/08/28 19:11:44 joda Exp $
6696 dnl
6697
6698 AC_DEFUN([rk_IRIX],
6699 [
6700 irix=no
6701 case "$host" in
6702 *-*-irix4*) 
6703         AC_DEFINE([IRIX4], 1,
6704                 [Define if you are running IRIX 4.])
6705         irix=yes
6706         ;;
6707 *-*-irix*) 
6708         irix=yes
6709         ;;
6710 esac
6711 AM_CONDITIONAL(IRIX, test "$irix" != no)dnl
6712
6713 AH_BOTTOM([
6714 /* IRIX 4 braindamage */
6715 #if IRIX == 4 && !defined(__STDC__)
6716 #define __STDC__ 0
6717 #endif
6718 ])
6719 ])
6720
6721 dnl
6722 dnl $Id: sunos.m4,v 1.1.4.1 2002/10/21 14:29:36 joda Exp $
6723 dnl
6724
6725 AC_DEFUN([rk_SUNOS],[
6726 sunos=no
6727 case "$host" in 
6728 *-*-sunos4*)
6729         sunos=40
6730         ;;
6731 *-*-solaris2.7)
6732         sunos=57
6733         ;;
6734 *-*-solaris2.[[89]])
6735         sunos=58
6736         ;;
6737 *-*-solaris2*)
6738         sunos=50
6739         ;;
6740 esac
6741 if test "$sunos" != no; then
6742         AC_DEFINE_UNQUOTED(SunOS, $sunos, 
6743                 [Define to what version of SunOS you are running.])
6744 fi
6745 ])
6746 dnl 
6747 dnl See if there is any X11 present
6748 dnl
6749 dnl $Id: check-x.m4,v 1.2 1999/11/05 04:25:23 assar Exp $
6750
6751 AC_DEFUN(KRB_CHECK_X,[
6752 AC_PATH_XTRA
6753
6754 # try to figure out if we need any additional ld flags, like -R
6755 # and yes, the autoconf X test is utterly broken
6756 if test "$no_x" != yes; then
6757         AC_CACHE_CHECK(for special X linker flags,krb_cv_sys_x_libs_rpath,[
6758         ac_save_libs="$LIBS"
6759         ac_save_cflags="$CFLAGS"
6760         CFLAGS="$CFLAGS $X_CFLAGS"
6761         krb_cv_sys_x_libs_rpath=""
6762         krb_cv_sys_x_libs=""
6763         for rflag in "" "-R" "-R " "-rpath "; do
6764                 if test "$rflag" = ""; then
6765                         foo="$X_LIBS"
6766                 else
6767                         foo=""
6768                         for flag in $X_LIBS; do
6769                         case $flag in
6770                         -L*)
6771                                 foo="$foo $flag `echo $flag | sed \"s/-L/$rflag/\"`"
6772                                 ;;
6773                         *)
6774                                 foo="$foo $flag"
6775                                 ;;
6776                         esac
6777                         done
6778                 fi
6779                 LIBS="$ac_save_libs $foo $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
6780                 AC_TRY_RUN([
6781                 #include <X11/Xlib.h>
6782                 foo()
6783                 {
6784                 XOpenDisplay(NULL);
6785                 }
6786                 main()
6787                 {
6788                 return 0;
6789                 }
6790                 ], krb_cv_sys_x_libs_rpath="$rflag"; krb_cv_sys_x_libs="$foo"; break,:)
6791         done
6792         LIBS="$ac_save_libs"
6793         CFLAGS="$ac_save_cflags"
6794         ])
6795         X_LIBS="$krb_cv_sys_x_libs"
6796 fi
6797 ])
6798
6799 dnl $Id: check-xau.m4,v 1.3 1999/05/14 01:17:06 assar Exp $
6800 dnl
6801 dnl check for Xau{Read,Write}Auth and XauFileName
6802 dnl
6803 AC_DEFUN(AC_CHECK_XAU,[
6804 save_CFLAGS="$CFLAGS"
6805 CFLAGS="$X_CFLAGS $CFLAGS"
6806 save_LIBS="$LIBS"
6807 dnl LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
6808 LIBS="$X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
6809 save_LDFLAGS="$LDFLAGS"
6810 LDFLAGS="$LDFLAGS $X_LIBS"
6811
6812
6813 AC_FIND_FUNC_NO_LIBS(XauWriteAuth, X11 Xau)
6814 ac_xxx="$LIBS"
6815 LIBS="$LIB_XauWriteAuth $LIBS"
6816 AC_FIND_FUNC_NO_LIBS(XauReadAuth, X11 Xau)
6817 LIBS="$LIB_XauReadAauth $LIBS"
6818 AC_FIND_FUNC_NO_LIBS(XauFileName, X11 Xau)
6819 LIBS="$ac_xxx"
6820
6821 case "$ac_cv_funclib_XauWriteAuth" in
6822 yes)    ;;
6823 no)     ;;
6824 *)      if test "$ac_cv_funclib_XauReadAuth" = yes; then
6825                 if test "$ac_cv_funclib_XauFileName" = yes; then
6826                         LIB_XauReadAuth="$LIB_XauWriteAuth"
6827                 else
6828                         LIB_XauReadAuth="$LIB_XauWriteAuth $LIB_XauFileName"
6829                 fi
6830         else
6831                 if test "$ac_cv_funclib_XauFileName" = yes; then
6832                         LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth"
6833                 else
6834                         LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth $LIB_XauFileName"
6835                 fi
6836         fi
6837         ;;
6838 esac
6839
6840 if test "$AUTOMAKE" != ""; then
6841         AM_CONDITIONAL(NEED_WRITEAUTH, test "$ac_cv_func_XauWriteAuth" != "yes")
6842 else
6843         AC_SUBST(NEED_WRITEAUTH_TRUE)
6844         AC_SUBST(NEED_WRITEAUTH_FALSE)
6845         if test "$ac_cv_func_XauWriteAuth" != "yes"; then
6846                 NEED_WRITEAUTH_TRUE=
6847                 NEED_WRITEAUTH_FALSE='#'
6848         else
6849                 NEED_WRITEAUTH_TRUE='#'
6850                 NEED_WRITEAUTH_FALSE=
6851         fi
6852 fi
6853 CFLAGS=$save_CFLAGS
6854 LIBS=$save_LIBS
6855 LDFLAGS=$save_LDFLAGS
6856 ])
6857
6858 dnl $Id: check-type-extra.m4,v 1.2 1999/03/01 09:52:23 joda Exp $
6859 dnl
6860 dnl ac_check_type + extra headers
6861
6862 dnl AC_CHECK_TYPE_EXTRA(TYPE, DEFAULT, HEADERS)
6863 AC_DEFUN(AC_CHECK_TYPE_EXTRA,
6864 [AC_REQUIRE([AC_HEADER_STDC])dnl
6865 AC_MSG_CHECKING(for $1)
6866 AC_CACHE_VAL(ac_cv_type_$1,
6867 [AC_EGREP_CPP(dnl
6868 changequote(<<,>>)dnl
6869 <<$1[^a-zA-Z_0-9]>>dnl
6870 changequote([,]), [#include <sys/types.h>
6871 #if STDC_HEADERS
6872 #include <stdlib.h>
6873 #include <stddef.h>
6874 #endif
6875 $3], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
6876 AC_MSG_RESULT($ac_cv_type_$1)
6877 if test $ac_cv_type_$1 = no; then
6878   AC_DEFINE($1, $2, [Define this to what the type $1 should be.])
6879 fi
6880 ])
6881
6882 dnl
6883 dnl $Id: capabilities.m4,v 1.2 1999/09/01 11:02:26 joda Exp $
6884 dnl
6885
6886 dnl
6887 dnl Test SGI capabilities
6888 dnl
6889
6890 AC_DEFUN(KRB_CAPABILITIES,[
6891
6892 AC_CHECK_HEADERS(capability.h sys/capability.h)
6893
6894 AC_CHECK_FUNCS(sgi_getcapabilitybyname cap_set_proc)
6895 ])
6896
6897 dnl $Id: check-getpwnam_r-posix.m4,v 1.2 1999/03/23 16:47:31 joda Exp $
6898 dnl
6899 dnl check for getpwnam_r, and if it's posix or not
6900
6901 AC_DEFUN(AC_CHECK_GETPWNAM_R_POSIX,[
6902 AC_FIND_FUNC_NO_LIBS(getpwnam_r,c_r)
6903 if test "$ac_cv_func_getpwnam_r" = yes; then
6904         AC_CACHE_CHECK(if getpwnam_r is posix,ac_cv_func_getpwnam_r_posix,
6905         ac_libs="$LIBS"
6906         LIBS="$LIBS $LIB_getpwnam_r"
6907         AC_TRY_RUN([
6908 #include <pwd.h>
6909 int main()
6910 {
6911         struct passwd pw, *pwd;
6912         return getpwnam_r("", &pw, NULL, 0, &pwd) < 0;
6913 }
6914 ],ac_cv_func_getpwnam_r_posix=yes,ac_cv_func_getpwnam_r_posix=no,:)
6915 LIBS="$ac_libs")
6916 if test "$ac_cv_func_getpwnam_r_posix" = yes; then
6917         AC_DEFINE(POSIX_GETPWNAM_R, 1, [Define if getpwnam_r has POSIX flavour.])
6918 fi
6919 fi
6920 ])
6921 dnl $Id: krb-readline.m4,v 1.5 2002/08/29 02:22:32 assar Exp $
6922 dnl
6923 dnl Tests for readline functions
6924 dnl
6925
6926 dnl el_init
6927
6928 AC_DEFUN(KRB_READLINE,[
6929 AC_FIND_FUNC_NO_LIBS(el_init, edit, [], [], [$LIB_tgetent])
6930 if test "$ac_cv_func_el_init" = yes ; then
6931         AC_CACHE_CHECK(for four argument el_init, ac_cv_func_el_init_four,[
6932                 AC_TRY_COMPILE([#include <stdio.h>
6933                         #include <histedit.h>],
6934                         [el_init("", NULL, NULL, NULL);],
6935                         ac_cv_func_el_init_four=yes,
6936                         ac_cv_func_el_init_four=no)])
6937         if test "$ac_cv_func_el_init_four" = yes; then
6938                 AC_DEFINE(HAVE_FOUR_VALUED_EL_INIT, 1, [Define if el_init takes four arguments.])
6939         fi
6940 fi
6941
6942 dnl readline
6943
6944 ac_foo=no
6945 if test "$with_readline" = yes; then
6946         :
6947 elif test "$ac_cv_func_readline" = yes; then
6948         :
6949 elif test "$ac_cv_func_el_init" = yes; then
6950         ac_foo=yes
6951         LIB_readline="\$(top_builddir)/lib/editline/libel_compat.la \$(LIB_el_init) \$(LIB_tgetent)"
6952 else
6953         LIB_readline="\$(top_builddir)/lib/editline/libeditline.la \$(LIB_tgetent)"
6954 fi
6955 AM_CONDITIONAL(el_compat, test "$ac_foo" = yes)
6956 AC_DEFINE(HAVE_READLINE, 1, 
6957         [Define if you have a readline compatible library.])dnl
6958
6959 ])
6960
6961 dnl
6962 dnl $Id: telnet.m4,v 1.1 2002/08/28 19:19:01 joda Exp $
6963 dnl
6964 dnl stuff used by telnet
6965
6966 AC_DEFUN([rk_TELNET],[
6967 AC_DEFINE(AUTHENTICATION, 1, 
6968         [Define if you want authentication support in telnet.])dnl
6969 AC_DEFINE(ENCRYPTION, 1,
6970         [Define if you want encryption support in telnet.])dnl
6971 AC_DEFINE(DES_ENCRYPTION, 1,
6972         [Define if you want to use DES encryption in telnet.])dnl
6973 AC_DEFINE(DIAGNOSTICS, 1,
6974         [Define this to enable diagnostics in telnet.])dnl
6975 AC_DEFINE(OLD_ENVIRON, 1,
6976         [Define this to enable old environment option in telnet.])dnl
6977 if false; then
6978         AC_DEFINE(ENV_HACK, 1,
6979                 [Define this if you want support for broken ENV_{VAR,VAL} telnets.])
6980 fi
6981
6982 # Simple test for streamspty, based on the existance of getmsg(), alas
6983 # this breaks on SunOS4 which have streams but BSD-like ptys
6984 #
6985 # And also something wierd has happend with dec-osf1, fallback to bsd-ptys
6986
6987 case "$host" in
6988 *-*-aix3*|*-*-sunos4*|*-*-osf*|*-*-hpux1[[01]]*)
6989         ;;
6990 *)
6991         AC_CHECK_FUNC(getmsg)
6992         if test "$ac_cv_func_getmsg" = "yes"; then
6993                 AC_CACHE_CHECK([if getmsg works], ac_cv_func_getmsg_works,
6994                 AC_TRY_RUN([
6995                         #include <stdio.h>
6996                         #include <errno.h>
6997
6998                         int main()
6999                         {
7000                           int ret;
7001                           ret = getmsg(open("/dev/null", 0), NULL, NULL, NULL);
7002                           if(ret < 0 && errno == ENOSYS)
7003                             return 1;
7004                           return 0;
7005                         }
7006                         ], ac_cv_func_getmsg_works=yes, 
7007                         ac_cv_func_getmsg_works=no,
7008                         ac_cv_func_getmsg_works=no))
7009                 if test "$ac_cv_func_getmsg_works" = "yes"; then
7010                         AC_DEFINE(HAVE_GETMSG, 1,
7011                                 [Define if you have a working getmsg.])
7012                         AC_DEFINE(STREAMSPTY, 1,
7013                                 [Define if you have streams ptys.])
7014                 fi
7015         fi
7016         ;;
7017 esac
7018
7019 AH_BOTTOM([
7020 #if defined(ENCRYPTION) && !defined(AUTHENTICATION)
7021 #define AUTHENTICATION 1
7022 #endif
7023
7024 /* Set this to the default system lead string for telnetd 
7025  * can contain %-escapes: %s=sysname, %m=machine, %r=os-release
7026  * %v=os-version, %t=tty, %h=hostname, %d=date and time
7027  */
7028 #undef USE_IM
7029
7030 /* Used with login -p */
7031 #undef LOGIN_ARGS
7032
7033 /* set this to a sensible login */
7034 #ifndef LOGIN_PATH
7035 #define LOGIN_PATH BINDIR "/login"
7036 #endif
7037 ])
7038 ])
7039
7040 dnl $Id: check-compile-et.m4,v 1.6 2001/09/02 17:08:48 assar Exp $
7041 dnl
7042 dnl CHECK_COMPILE_ET
7043 AC_DEFUN([CHECK_COMPILE_ET], [
7044
7045 AC_CHECK_PROG(COMPILE_ET, compile_et, [compile_et])
7046
7047 krb_cv_compile_et="no"
7048 if test "${COMPILE_ET}" = "compile_et"; then
7049
7050 dnl We have compile_et.  Now let's see if it supports `prefix' and `index'.
7051 AC_MSG_CHECKING(whether compile_et has the features we need)
7052 cat > conftest_et.et <<'EOF'
7053 error_table conf
7054 prefix CONFTEST
7055 index 1
7056 error_code CODE1, "CODE1"
7057 index 128
7058 error_code CODE2, "CODE2"
7059 end
7060 EOF
7061 if ${COMPILE_ET} conftest_et.et >/dev/null 2>&1; then
7062   dnl XXX Some systems have <et/com_err.h>.
7063   save_CPPFLAGS="${save_CPPFLAGS}"
7064   if test -d "/usr/include/et"; then
7065     CPPFLAGS="-I/usr/include/et ${CPPFLAGS}"
7066   fi
7067   dnl Check that the `prefix' and `index' directives were honored.
7068   AC_TRY_RUN([
7069 #include <com_err.h>
7070 #include <string.h>
7071 #include "conftest_et.h"
7072 int main(){return (CONFTEST_CODE2 - CONFTEST_CODE1) != 127;}
7073   ], [krb_cv_compile_et="yes"],[CPPFLAGS="${save_CPPFLAGS}"])
7074 fi
7075 AC_MSG_RESULT(${krb_cv_compile_et})
7076 rm -fr conftest*
7077 fi
7078
7079 if test "${krb_cv_compile_et}" = "yes"; then
7080   dnl Since compile_et seems to work, let's check libcom_err
7081   krb_cv_save_LIBS="${LIBS}"
7082   LIBS="${LIBS} -lcom_err"
7083   AC_MSG_CHECKING(for com_err)
7084   AC_TRY_LINK([#include <com_err.h>],[
7085     const char *p;
7086     p = error_message(0);
7087   ],[krb_cv_com_err="yes"],[krb_cv_com_err="no"; CPPFLAGS="${save_CPPFLAGS}"])
7088   AC_MSG_RESULT(${krb_cv_com_err})
7089   LIBS="${krb_cv_save_LIBS}"
7090 else
7091   dnl Since compile_et doesn't work, forget about libcom_err
7092   krb_cv_com_err="no"
7093 fi
7094
7095 dnl Only use the system's com_err if we found compile_et, libcom_err, and
7096 dnl com_err.h.
7097 if test "${krb_cv_com_err}" = "yes"; then
7098     DIR_com_err=""
7099     LIB_com_err="-lcom_err"
7100     LIB_com_err_a=""
7101     LIB_com_err_so=""
7102     AC_MSG_NOTICE(Using the already-installed com_err)
7103 else
7104     COMPILE_ET="\$(top_builddir)/lib/com_err/compile_et"
7105     DIR_com_err="com_err"
7106     LIB_com_err="\$(top_builddir)/lib/com_err/libcom_err.la"
7107     LIB_com_err_a="\$(top_builddir)/lib/com_err/.libs/libcom_err.a"
7108     LIB_com_err_so="\$(top_builddir)/lib/com_err/.libs/libcom_err.so"
7109     AC_MSG_NOTICE(Using our own com_err)
7110 fi
7111 AC_SUBST(DIR_com_err)
7112 AC_SUBST(LIB_com_err)
7113 AC_SUBST(LIB_com_err_a)
7114 AC_SUBST(LIB_com_err_so)
7115
7116 ])
7117
7118 dnl $Id: auth-modules.m4,v 1.5 2002/09/09 13:31:45 joda Exp $
7119 dnl
7120 dnl Figure what authentication modules should be built
7121 dnl
7122 dnl rk_AUTH_MODULES(module-list)
7123
7124 AC_DEFUN(rk_AUTH_MODULES,[
7125 AC_MSG_CHECKING([which authentication modules should be built])
7126
7127 z='m4_ifval([$1], $1, [sia pam afskauthlib])'
7128 LIB_AUTH_SUBDIRS=
7129 for i in $z; do
7130 case $i in
7131 sia)
7132 if test "$ac_cv_header_siad_h" = yes; then
7133         LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS sia"
7134 fi
7135 ;;
7136 pam)
7137 case "${host}" in
7138 *-*-freebsd*)   ac_cv_want_pam_krb4=no ;;
7139 *)              ac_cv_want_pam_krb4=yes ;;
7140 esac
7141
7142 if test "$ac_cv_want_pam_krb4" = yes -a \
7143     "$ac_cv_header_security_pam_modules_h" = yes -a \
7144     "$enable_shared" = yes; then
7145         LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS pam"
7146 fi
7147 ;;
7148 afskauthlib)
7149 case "${host}" in
7150 *-*-irix[[56]]*) LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS afskauthlib" ;;
7151 esac
7152 ;;
7153 esac
7154 done
7155 if test "$LIB_AUTH_SUBDIRS"; then
7156         AC_MSG_RESULT($LIB_AUTH_SUBDIRS)
7157 else
7158         AC_MSG_RESULT(none)
7159 fi
7160
7161 AC_SUBST(LIB_AUTH_SUBDIRS)dnl
7162 ])
7163
7164 dnl
7165 dnl $Id: destdirs.m4,v 1.2 2002/08/12 15:12:50 joda Exp $
7166 dnl
7167
7168 AC_DEFUN([rk_DESTDIRS], [
7169 # This is done by AC_OUTPUT but we need the result here.
7170 test "x$prefix" = xNONE && prefix=$ac_default_prefix
7171 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
7172
7173 AC_FOREACH([rk_dir], [bin lib libexec localstate sbin sysconf], [
7174         x="${rk_dir[]dir}"
7175         eval y="$x"
7176         while test "x$y" != "x$x"; do
7177                 x="$y"
7178                 eval y="$x"
7179         done
7180         AC_DEFINE_UNQUOTED(AS_TR_CPP(rk_dir[]dir), "$x", [path to ]rk_dir[])])
7181 ])
7182