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