source: trunk/third/imlib/aclocal.m4 @ 17079

Revision 17079, 132.4 KB checked in by ghudson, 23 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r17078, which included commits to RCS files with non-trunk default branches.
Line 
1# aclocal.m4 generated automatically by aclocal 1.4h
2
3# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
4# Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14# Like AC_CONFIG_HEADER, but automatically create stamp file.
15
16# serial 3
17
18# When config.status generates a header, we must update the stamp-h file.
19# This file resides in the same directory as the config header
20# that is generated.  We must strip everything past the first ":",
21# and everything past the last "/".
22
23AC_PREREQ([2.12])
24
25AC_DEFUN([AM_CONFIG_HEADER],
26[AC_CONFIG_HEADER([$1])
27  AC_OUTPUT_COMMANDS(
28   ifelse(patsubst([$1], [[^ ]], []),
29          [],
30          [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
31           patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),
32  [am_indx=1
33  for am_file in $1; do
34    case " $CONFIG_HEADERS " in
35    *" $am_file "*)
36      echo timestamp > `echo $am_file | sed 's%:.*%%;s%[^/]*$%%'`stamp-h$am_indx
37      ;;
38    esac
39    am_indx=\`expr \$am_indx + 1\`
40  done])
41])
42
43# Do all the work for Automake.  This macro actually does too much --
44# some checks are only needed if your package does certain things.
45# But this isn't really a big deal.
46
47# serial 5
48
49# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
50# written in clear, in which case automake, when reading aclocal.m4,
51# will think it sees a *use*, and therefore will trigger all it's
52# C support machinery.  Also note that it means that autoscan, seeing
53# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
54
55
56# We require 2.13 because we rely on SHELL being computed by configure.
57AC_PREREQ([2.13])
58
59# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
60# -----------------------------------------------------------
61# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
62# The purpose of this macro is to provide the user with a means to
63# check macros which are provided without letting her know how the
64# information is coded.
65# If this macro is not defined by Autoconf, define it here.
66ifdef([AC_PROVIDE_IFELSE],
67      [],
68      [define([AC_PROVIDE_IFELSE],
69              [ifdef([AC_PROVIDE_$1],
70                     [$2], [$3])])])
71
72
73# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
74# ----------------------------------------------
75AC_DEFUN([AM_INIT_AUTOMAKE],
76[AC_REQUIRE([AC_PROG_INSTALL])dnl
77# test to see if srcdir already configured
78if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
79   test -f $srcdir/config.status; then
80  AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
81fi
82
83# Define the identity of the package.
84PACKAGE=$1
85AC_SUBST(PACKAGE)dnl
86VERSION=$2
87AC_SUBST(VERSION)dnl
88ifelse([$3],,
89[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
90AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
91
92# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
93# the ones we care about.
94ifdef([m4_pattern_allow],
95      [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
96
97# Some tools Automake needs.
98AC_REQUIRE([AM_SANITY_CHECK])dnl
99AC_REQUIRE([AC_ARG_PROGRAM])dnl
100AM_MISSING_PROG(ACLOCAL, aclocal)
101AM_MISSING_PROG(AUTOCONF, autoconf)
102AM_MISSING_PROG(AUTOMAKE, automake)
103AM_MISSING_PROG(AUTOHEADER, autoheader)
104AM_MISSING_PROG(MAKEINFO, makeinfo)
105AM_MISSING_PROG(AMTAR, tar)
106AM_MISSING_INSTALL_SH
107AM_PROG_INSTALL_STRIP
108# We need awk for the "check" target.  The system "awk" is bad on
109# some platforms.
110AC_REQUIRE([AC_PROG_AWK])dnl
111AC_REQUIRE([AC_PROG_MAKE_SET])dnl
112AC_REQUIRE([AM_DEP_TRACK])dnl
113AC_REQUIRE([AM_SET_DEPDIR])dnl
114AC_PROVIDE_IFELSE([AC_PROG_][CC],
115                  [AM_DEPENDENCIES(CC)],
116                  [define([AC_PROG_][CC],
117                          defn([AC_PROG_][CC])[AM_DEPENDENCIES(CC)])])dnl
118AC_PROVIDE_IFELSE([AC_PROG_][CXX],
119                  [AM_DEPENDENCIES(CXX)],
120                  [define([AC_PROG_][CXX],
121                          defn([AC_PROG_][CXX])[AM_DEPENDENCIES(CXX)])])dnl
122])
123
124#
125# Check to make sure that the build environment is sane.
126#
127
128# serial 3
129
130# AM_SANITY_CHECK
131# ---------------
132AC_DEFUN([AM_SANITY_CHECK],
133[AC_MSG_CHECKING([whether build environment is sane])
134# Just in case
135sleep 1
136echo timestamp > conftest.file
137# Do `set' in a subshell so we don't clobber the current shell's
138# arguments.  Must try -L first in case configure is actually a
139# symlink; some systems play weird games with the mod time of symlinks
140# (eg FreeBSD returns the mod time of the symlink's containing
141# directory).
142if (
143   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
144   if test "$[*]" = "X"; then
145      # -L didn't work.
146      set X `ls -t $srcdir/configure conftest.file`
147   fi
148   rm -f conftest.file
149   if test "$[*]" != "X $srcdir/configure conftest.file" \
150      && test "$[*]" != "X conftest.file $srcdir/configure"; then
151
152      # If neither matched, then we have a broken ls.  This can happen
153      # if, for instance, CONFIG_SHELL is bash and it inherits a
154      # broken ls alias from the environment.  This has actually
155      # happened.  Such a system could not be considered "sane".
156      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
157alias in your environment])
158   fi
159
160   test "$[2]" = conftest.file
161   )
162then
163   # Ok.
164   :
165else
166   AC_MSG_ERROR([newly created file is older than distributed files!
167Check your system clock])
168fi
169AC_MSG_RESULT(yes)])
170
171
172# serial 2
173
174# AM_MISSING_PROG(NAME, PROGRAM)
175# ------------------------------
176AC_DEFUN([AM_MISSING_PROG],
177[AC_REQUIRE([AM_MISSING_HAS_RUN])
178$1=${$1-"${am_missing_run}$2"}
179AC_SUBST($1)])
180
181
182# AM_MISSING_INSTALL_SH
183# ---------------------
184# Like AM_MISSING_PROG, but only looks for install-sh.
185AC_DEFUN([AM_MISSING_INSTALL_SH],
186[AC_REQUIRE([AM_MISSING_HAS_RUN])
187if test -z "$install_sh"; then
188   for install_sh in "$ac_aux_dir/install-sh" \
189                     "$ac_aux_dir/install.sh" \
190                     "${am_missing_run}${ac_auxdir}/install-sh";
191   do
192     test -f "$install_sh" && break
193   done
194   # FIXME: an evil hack: we remove the SHELL invocation from
195   # install_sh because automake adds it back in.  Sigh.
196   install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'`
197fi
198AC_SUBST(install_sh)])
199
200
201# AM_MISSING_HAS_RUN
202# ------------------
203# Define MISSING if not defined so far and test if it supports --run.
204# If it does, set am_missing_run to use it, otherwise, to nothing.
205AC_DEFUN([AM_MISSING_HAS_RUN],
206[test x"${MISSING+set}" = xset ||
207  MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
208# Use eval to expand $SHELL
209if eval "$MISSING --run true"; then
210  am_missing_run="$MISSING --run "
211else
212  am_missing_run=
213  am_backtick='`'
214  AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
215fi
216])
217
218# AM_AUX_DIR_EXPAND
219
220# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
221# $ac_aux_dir to ${srcdir}/foo.  In other projects, it is set to `.'.
222# Of course, Automake must honor this variable whenever it call a tool
223# from the auxiliary directory.  The problem is that $srcdir (hence
224# $ac_aux_dir) can be either an absolute path or a path relative to
225# $top_srcdir or absolute, this depends on how configure is run.  This
226# is pretty anoying since it makes $ac_aux_dir quite unusable in
227# subdirectories: on the top source directory, any form will work
228# fine, but in subdirectories relative pat needs to be adapted.
229# - calling $top_srcidr/$ac_aux_dir/missing would success if $srcdir is
230#   relative, but fail if $srcdir is absolute
231# - conversly, calling $ax_aux_dir/missing would fail if $srcdir is
232#   absolute, and success on relative paths.
233#
234# Consequently, we define and use $am_aux_dir, the "always absolute"
235# version of $ac_aux_dir.
236
237AC_DEFUN([AM_AUX_DIR_EXPAND], [
238# expand $ac_aux_dir to an absolute path
239am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
240])
241
242# One issue with vendor `install' (even GNU) is that you can't
243# specify the program used to strip binaries.  This is especially
244# annoying in cross-compiling environments, where the build's strip
245# is unlikely to handle the host's binaries.
246# Fortunately install-sh will honor a STRIPPROG variable, so we
247# always use install-sh in `make install-strip', and initialize
248# STRIPPROG with the value of the STRIP variable (set by the user).
249AC_DEFUN([AM_PROG_INSTALL_STRIP],
250[AC_REQUIRE([AM_MISSING_INSTALL_SH])dnl
251_am_dirpart="`echo $install_sh | sed -e 's,//*[[^/]]*$,,'`"
252INSTALL_STRIP_PROGRAM="\${SHELL} \`CDPATH=: && cd $_am_dirpart && pwd\`/install-sh -c -s"
253AC_SUBST([INSTALL_STRIP_PROGRAM])])
254
255# serial 3
256
257# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
258# written in clear, in which case automake, when reading aclocal.m4,
259# will think it sees a *use*, and therefore will trigger all it's
260# C support machinery.  Also note that it means that autoscan, seeing
261# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
262
263# AM_DEPENDENCIES(NAME)
264# ---------------------
265# See how the compiler implements dependency checking.
266# NAME is "CC", "CXX" or "OBJC".
267# We try a few techniques and use that to set a single cache variable.
268AC_DEFUN([AM_DEPENDENCIES],
269[AC_REQUIRE([AM_SET_DEPDIR])dnl
270AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
271am_compiler_list=
272ifelse([$1], CC,
273       [AC_REQUIRE([AC_PROG_][CC])dnl
274AC_REQUIRE([AC_PROG_][CPP])
275depcc="$CC"
276depcpp="$CPP"],
277       [$1], CXX, [AC_REQUIRE([AC_PROG_][CXX])dnl
278AC_REQUIRE([AC_PROG_][CXXCPP])
279depcc="$CXX"
280depcpp="$CXXCPP"],
281       [$1], OBJC, [am_compiler_list='gcc3 gcc'
282depcc="$OBJC"
283depcpp=""],
284       [$1], GCJ,  [am_compiler_list='gcc3 gcc'
285depcc="$GCJ"
286depcpp=""],
287       [AC_REQUIRE([AC_PROG_][$1])dnl
288depcc="$$1"
289depcpp=""])
290
291AC_REQUIRE([AM_MAKE_INCLUDE])
292AC_REQUIRE([AM_DEP_TRACK])
293
294AC_CACHE_CHECK([dependency style of $depcc],
295               [am_cv_$1_dependencies_compiler_type],
296[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
297  # We make a subdir and do the tests there.  Otherwise we can end up
298  # making bogus files that we don't know about and never remove.  For
299  # instance it was reported that on HP-UX the gcc test will end up
300  # making a dummy file named `D' -- because `-MD' means `put the output
301  # in D'.
302  mkdir confdir
303  # Copy depcomp to subdir because otherwise we won't find it if we're
304  # using a relative directory.
305  cp "$am_depcomp" confdir
306  cd confdir
307
308  am_cv_$1_dependencies_compiler_type=none
309  if test "$am_compiler_list" = ""; then
310     am_compiler_list="`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`"
311  fi
312  for depmode in $am_compiler_list; do
313    # We need to recreate these files for each test, as the compiler may
314    # overwrite some of them when testing with obscure command lines.
315    # This happens at least with the AIX C compiler.
316    echo '#include "conftest.h"' > conftest.c
317    echo 'int i;' > conftest.h
318
319    case "$depmode" in
320    nosideeffect)
321      # after this tag, mechanisms are not by side-effect, so they'll
322      # only be used when explicitly requested
323      if test "x$enable_dependency_tracking" = xyes; then
324        continue
325      else
326        break
327      fi
328      ;;
329    none) break ;;
330    esac
331    # We check with `-c' and `-o' for the sake of the "dashmstdout"
332    # mode.  It turns out that the SunPro C++ compiler does not properly
333    # handle `-M -o', and we need to detect this.
334    if depmode="$depmode" \
335       source=conftest.c object=conftest.o \
336       depfile=conftest.Po tmpdepfile=conftest.TPo \
337       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
338       grep conftest.h conftest.Po > /dev/null 2>&1; then
339      am_cv_$1_dependencies_compiler_type="$depmode"
340      break
341    fi
342  done
343
344  cd ..
345  rm -rf confdir
346else
347  am_cv_$1_dependencies_compiler_type=none
348fi
349])
350$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
351AC_SUBST([$1DEPMODE])
352])
353
354
355# AM_SET_DEPDIR
356# -------------
357# Choose a directory name for dependency files.
358# This macro is AC_REQUIREd in AM_DEPENDENCIES
359AC_DEFUN([AM_SET_DEPDIR],
360[if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
361  DEPDIR=.deps
362  # We redirect because .deps might already exist and be populated.
363  # In this situation we don't want to see an error.
364  rmdir .deps > /dev/null 2>&1
365else
366  DEPDIR=_deps
367fi
368AC_SUBST(DEPDIR)
369])
370
371
372# AM_DEP_TRACK
373# ------------
374AC_DEFUN([AM_DEP_TRACK],
375[AC_ARG_ENABLE(dependency-tracking,
376[  --disable-dependency-tracking Speeds up one-time builds
377  --enable-dependency-tracking  Do not reject slow dependency extractors])
378if test "x$enable_dependency_tracking" != xno; then
379  am_depcomp="$ac_aux_dir/depcomp"
380  AMDEPBACKSLASH='\'
381fi
382AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
383pushdef([subst], defn([AC_SUBST]))
384subst(AMDEPBACKSLASH)
385popdef([subst])
386])
387
388# Generate code to set up dependency tracking.
389# This macro should only be invoked once -- use via AC_REQUIRE.
390# Usage:
391# AM_OUTPUT_DEPENDENCY_COMMANDS
392
393#
394# This code is only required when automatic dependency tracking
395# is enabled.  FIXME.  This creates each `.P' file that we will
396# need in order to bootstrap the dependency handling code.
397AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
398AC_OUTPUT_COMMANDS([
399test x"$AMDEP_TRUE" != x"" ||
400for mf in $CONFIG_FILES; do
401  case "$mf" in
402  Makefile) dirpart=.;;
403  */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
404  *) continue;;
405  esac
406  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
407  # Extract the definition of DEP_FILES from the Makefile without
408  # running `make'.
409  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
410  test -z "$DEPDIR" && continue
411  # When using ansi2knr, U may be empty or an underscore; expand it
412  U=`sed -n -e '/^U = / s///p' < "$mf"`
413  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
414  # We invoke sed twice because it is the simplest approach to
415  # changing $(DEPDIR) to its actual value in the expansion.
416  for file in `sed -n -e '
417    /^DEP_FILES = .*\\\\$/ {
418      s/^DEP_FILES = //
419      :loop
420        s/\\\\$//
421        p
422        n
423        /\\\\$/ b loop
424      p
425    }
426    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
427       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
428    # Make sure the directory exists.
429    test -f "$dirpart/$file" && continue
430    fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
431    $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
432    # echo "creating $dirpart/$file"
433    echo '# dummy' > "$dirpart/$file"
434  done
435done
436], [AMDEP_TRUE="$AMDEP_TRUE"
437ac_aux_dir="$ac_aux_dir"])])
438
439# AM_MAKE_INCLUDE()
440# -----------------
441# Check to see how make treats includes.
442AC_DEFUN([AM_MAKE_INCLUDE],
443[am_make=${MAKE-make}
444cat > confinc << 'END'
445doit:
446        @echo done
447END
448# If we don't find an include directive, just comment out the code.
449AC_MSG_CHECKING([for style of include used by $am_make])
450_am_include='#'
451_am_quote=
452_am_result=none
453# First try GNU make style include.
454echo "include confinc" > confmf
455# We grep out `Entering directory' and `Leaving directory'
456# messages which can occur if `w' ends up in MAKEFLAGS.
457# In particular we don't look at `^make:' because GNU make might
458# be invoked under some other name (usually "gmake"), in which
459# case it prints its new name instead of `make'.
460if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
461   _am_include=include
462   _am_quote=
463   _am_result=GNU
464fi
465# Now try BSD make style include.
466if test "$_am_include" = "#"; then
467   echo '.include "confinc"' > confmf
468   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
469      _am_include=.include
470      _am_quote='"'
471      _am_result=BSD
472   fi
473fi
474AC_SUBST(_am_include)
475AC_SUBST(_am_quote)
476AC_MSG_RESULT($_am_result)
477rm -f confinc confmf
478])
479
480# serial 3
481
482# AM_CONDITIONAL(NAME, SHELL-CONDITION)
483# -------------------------------------
484# Define a conditional.
485#
486# FIXME: Once using 2.50, use this:
487# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
488AC_DEFUN([AM_CONDITIONAL],
489[ifelse([$1], [TRUE],
490        [errprint(__file__:__line__: [$0: invalid condition: $1
491])dnl
492m4exit(1)])dnl
493ifelse([$1], [FALSE],
494       [errprint(__file__:__line__: [$0: invalid condition: $1
495])dnl
496m4exit(1)])dnl
497AC_SUBST([$1_TRUE])
498AC_SUBST([$1_FALSE])
499if $2; then
500  $1_TRUE=
501  $1_FALSE='#'
502else
503  $1_TRUE='#'
504  $1_FALSE=
505fi])
506
507# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
508
509# serial 46 AC_PROG_LIBTOOL
510AC_DEFUN([AC_PROG_LIBTOOL],
511[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
512
513# This can be used to rebuild libtool when needed
514LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
515
516# Always use our own libtool.
517LIBTOOL='$(SHELL) $(top_builddir)/libtool'
518AC_SUBST(LIBTOOL)dnl
519
520# Prevent multiple expansion
521define([AC_PROG_LIBTOOL], [])
522])
523
524AC_DEFUN([AC_LIBTOOL_SETUP],
525[AC_PREREQ(2.13)dnl
526AC_REQUIRE([AC_ENABLE_SHARED])dnl
527AC_REQUIRE([AC_ENABLE_STATIC])dnl
528AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
529AC_REQUIRE([AC_CANONICAL_HOST])dnl
530AC_REQUIRE([AC_CANONICAL_BUILD])dnl
531AC_REQUIRE([AC_PROG_CC])dnl
532AC_REQUIRE([AC_PROG_LD])dnl
533AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
534AC_REQUIRE([AC_PROG_NM])dnl
535AC_REQUIRE([AC_PROG_LN_S])dnl
536AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
537AC_REQUIRE([AC_OBJEXT])dnl
538AC_REQUIRE([AC_EXEEXT])dnl
539dnl
540
541_LT_AC_PROG_ECHO_BACKSLASH
542# Only perform the check for file, if the check method requires it
543case $deplibs_check_method in
544file_magic*)
545  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
546    AC_PATH_MAGIC
547  fi
548  ;;
549esac
550
551AC_CHECK_TOOL(RANLIB, ranlib, :)
552AC_CHECK_TOOL(STRIP, strip, :)
553
554ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
555ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
556enable_win32_dll=yes, enable_win32_dll=no)
557
558AC_ARG_ENABLE(libtool-lock,
559  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
560test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
561
562# Some flags need to be propagated to the compiler or linker for good
563# libtool support.
564case $host in
565*-*-irix6*)
566  # Find out which ABI we are using.
567  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
568  if AC_TRY_EVAL(ac_compile); then
569    case `/usr/bin/file conftest.$ac_objext` in
570    *32-bit*)
571      LD="${LD-ld} -32"
572      ;;
573    *N32*)
574      LD="${LD-ld} -n32"
575      ;;
576    *64-bit*)
577      LD="${LD-ld} -64"
578      ;;
579    esac
580  fi
581  rm -rf conftest*
582  ;;
583
584*-*-sco3.2v5*)
585  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
586  SAVE_CFLAGS="$CFLAGS"
587  CFLAGS="$CFLAGS -belf"
588  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
589    [AC_LANG_SAVE
590     AC_LANG_C
591     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
592     AC_LANG_RESTORE])
593  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
594    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
595    CFLAGS="$SAVE_CFLAGS"
596  fi
597  ;;
598
599ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
600[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
601  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
602  AC_CHECK_TOOL(AS, as, false)
603  AC_CHECK_TOOL(OBJDUMP, objdump, false)
604
605  # recent cygwin and mingw systems supply a stub DllMain which the user
606  # can override, but on older systems we have to supply one
607  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
608    [AC_TRY_LINK([],
609      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
610      DllMain (0, 0, 0);],
611      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
612
613  case $host/$CC in
614  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
615    # old mingw systems require "-dll" to link a DLL, while more recent ones
616    # require "-mdll"
617    SAVE_CFLAGS="$CFLAGS"
618    CFLAGS="$CFLAGS -mdll"
619    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
620      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
621    CFLAGS="$SAVE_CFLAGS" ;;
622  *-*-cygwin* | *-*-pw32*)
623    # cygwin systems need to pass --dll to the linker, and not link
624    # crt.o which will require a WinMain@16 definition.
625    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
626  esac
627  ;;
628  ])
629esac
630
631_LT_AC_LTCONFIG_HACK
632
633])
634
635# _LT_AC_CHECK_DLFCN
636# --------------------
637AC_DEFUN(_LT_AC_CHECK_DLFCN,
638[AC_CHECK_HEADERS(dlfcn.h)
639])# _LT_AC_CHECK_DLFCN
640
641# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
642# ---------------------------------
643AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
644[AC_REQUIRE([AC_CANONICAL_HOST])
645AC_REQUIRE([AC_PROG_NM])
646AC_REQUIRE([AC_OBJEXT])
647# Check for command to grab the raw symbol name followed by C symbol from nm.
648AC_MSG_CHECKING([command to parse $NM output])
649AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
650
651# These are sane defaults that work on at least a few old systems.
652# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
653
654# Character class describing NM global symbol codes.
655[symcode='[BCDEGRST]']
656
657# Regexp to match symbols that can be accessed directly from C.
658[sympat='\([_A-Za-z][_A-Za-z0-9]*\)']
659
660# Transform the above into a raw symbol and a C symbol.
661symxfrm='\1 \2\3 \3'
662
663# Transform an extracted symbol line into a proper C declaration
664lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
665
666# Define system-specific variables.
667case $host_os in
668aix*)
669  [symcode='[BCDT]']
670  ;;
671cygwin* | mingw* | pw32*)
672  [symcode='[ABCDGISTW]']
673  ;;
674hpux*) # Its linker distinguishes data from code symbols
675  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
676  ;;
677irix*)
678  [symcode='[BCDEGRST]']
679  ;;
680solaris* | sysv5*)
681  [symcode='[BDT]']
682  ;;
683sysv4)
684  [symcode='[DFNSTU]']
685  ;;
686esac
687
688# Handle CRLF in mingw tool chain
689opt_cr=
690case $host_os in
691mingw*)
692  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
693  ;;
694esac
695
696# If we're using GNU nm, then use its standard symbol codes.
697if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
698  [symcode='[ABCDGISTW]']
699fi
700
701# Try without a prefix undercore, then with it.
702for ac_symprfx in "" "_"; do
703
704  # Write the raw and C identifiers.
705[lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[        ]\($symcode$symcode*\)[         ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"]
706
707  # Check to see that the pipe works correctly.
708  pipe_works=no
709  rm -f conftest*
710  cat > conftest.$ac_ext <<EOF
711#ifdef __cplusplus
712extern "C" {
713#endif
714char nm_test_var;
715void nm_test_func(){}
716#ifdef __cplusplus
717}
718#endif
719int main(){nm_test_var='a';nm_test_func();return(0);}
720EOF
721
722  if AC_TRY_EVAL(ac_compile); then
723    # Now try to grab the symbols.
724    nlist=conftest.nm
725    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
726      # Try sorting and uniquifying the output.
727      if sort "$nlist" | uniq > "$nlist"T; then
728        mv -f "$nlist"T "$nlist"
729      else
730        rm -f "$nlist"T
731      fi
732
733      # Make sure that we snagged all the symbols we need.
734      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
735        if egrep ' nm_test_func$' "$nlist" >/dev/null; then
736          cat <<EOF > conftest.$ac_ext
737#ifdef __cplusplus
738extern "C" {
739#endif
740
741EOF
742          # Now generate the symbol file.
743          eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
744
745          cat <<EOF >> conftest.$ac_ext
746#if defined (__STDC__) && __STDC__
747# define lt_ptr_t void *
748#else
749# define lt_ptr_t char *
750# define const
751#endif
752
753/* The mapping between symbol names and symbols. */
754const struct {
755  const char *name;
756  lt_ptr_t address;
757}
758[lt_preloaded_symbols[] =]
759{
760EOF
761          sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext
762          cat <<\EOF >> conftest.$ac_ext
763  {0, (lt_ptr_t) 0}
764};
765
766#ifdef __cplusplus
767}
768#endif
769EOF
770          # Now try linking the two files.
771          mv conftest.$ac_objext conftstm.$ac_objext
772          save_LIBS="$LIBS"
773          save_CFLAGS="$CFLAGS"
774          LIBS="conftstm.$ac_objext"
775          CFLAGS="$CFLAGS$no_builtin_flag"
776          if AC_TRY_EVAL(ac_link) && test -s conftest; then
777            pipe_works=yes
778          fi
779          LIBS="$save_LIBS"
780          CFLAGS="$save_CFLAGS"
781        else
782          echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
783        fi
784      else
785        echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
786      fi
787    else
788      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
789    fi
790  else
791    echo "$progname: failed program was:" >&AC_FD_CC
792    cat conftest.$ac_ext >&5
793  fi
794  rm -f conftest* conftst*
795
796  # Do not use the global_symbol_pipe unless it works.
797  if test "$pipe_works" = yes; then
798    break
799  else
800    lt_cv_sys_global_symbol_pipe=
801  fi
802done
803])
804global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
805if test -z "$lt_cv_sys_global_symbol_pipe"; then
806  global_symbol_to_cdecl=
807else
808  global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
809fi
810if test -z "$global_symbol_pipe$global_symbol_to_cdecl"; then
811  AC_MSG_RESULT(failed)
812else
813  AC_MSG_RESULT(ok)
814fi
815]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
816
817# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
818# ---------------------------------
819AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
820[# Find the correct PATH separator.  Usually this is `:', but
821# DJGPP uses `;' like DOS.
822if test "X${PATH_SEPARATOR+set}" != Xset; then
823  UNAME=${UNAME-`uname 2>/dev/null`}
824  case X$UNAME in
825    *-DOS) lt_cv_sys_path_separator=';' ;;
826    *)     lt_cv_sys_path_separator=':' ;;
827  esac
828fi
829])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
830
831# _LT_AC_PROG_ECHO_BACKSLASH
832# --------------------------
833# Add some code to the start of the generated configure script which
834# will find an echo command which doesn;t interpret backslashes.
835AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
836[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
837                              [AC_DIVERT_PUSH(NOTICE)])
838_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
839
840# Check that we are running under the correct shell.
841SHELL=${CONFIG_SHELL-/bin/sh}
842
843case X$ECHO in
844X*--fallback-echo)
845  # Remove one level of quotation (which was required for Make).
846  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
847  ;;
848esac
849
850echo=${ECHO-echo}
851if test "X[$]1" = X--no-reexec; then
852  # Discard the --no-reexec flag, and continue.
853  shift
854elif test "X[$]1" = X--fallback-echo; then
855  # Avoid inline document here, it may be left over
856  :
857elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
858  # Yippee, $echo works!
859  :
860else
861  # Restart under the correct shell.
862  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
863fi
864
865if test "X[$]1" = X--fallback-echo; then
866  # used as fallback echo
867  shift
868  cat <<EOF
869$*
870EOF
871  exit 0
872fi
873
874# The HP-UX ksh and POSIX shell print the target directory to stdout
875# if CDPATH is set.
876if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
877
878if test -z "$ECHO"; then
879if test "X${echo_test_string+set}" != Xset; then
880# find a string as large as possible, as long as the shell can cope with it
881  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
882    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
883    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
884       echo_test_string="`eval $cmd`" &&
885       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
886    then
887      break
888    fi
889  done
890fi
891
892if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
893   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
894   test "X$echo_testing_string" = "X$echo_test_string"; then
895  :
896else
897  # The Solaris, AIX, and Digital Unix default echo programs unquote
898  # backslashes.  This makes it impossible to quote backslashes using
899  #   echo "$something" | sed 's/\\/\\\\/g'
900  #
901  # So, first we look for a working echo in the user's PATH.
902
903  IFS="${IFS=   }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
904  for dir in $PATH /usr/ucb; do
905    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
906       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
907       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
908       test "X$echo_testing_string" = "X$echo_test_string"; then
909      echo="$dir/echo"
910      break
911    fi
912  done
913  IFS="$save_ifs"
914
915  if test "X$echo" = Xecho; then
916    # We didn't find a better echo, so look for alternatives.
917    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
918       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
919       test "X$echo_testing_string" = "X$echo_test_string"; then
920      # This shell has a builtin print -r that does the trick.
921      echo='print -r'
922    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
923         test "X$CONFIG_SHELL" != X/bin/ksh; then
924      # If we have ksh, try running configure again with it.
925      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
926      export ORIGINAL_CONFIG_SHELL
927      CONFIG_SHELL=/bin/ksh
928      export CONFIG_SHELL
929      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
930    else
931      # Try using printf.
932      echo='printf %s\n'
933      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
934         echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
935         test "X$echo_testing_string" = "X$echo_test_string"; then
936        # Cool, printf works
937        :
938      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
939           test "X$echo_testing_string" = 'X\t' &&
940           echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
941           test "X$echo_testing_string" = "X$echo_test_string"; then
942        CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
943        export CONFIG_SHELL
944        SHELL="$CONFIG_SHELL"
945        export SHELL
946        echo="$CONFIG_SHELL [$]0 --fallback-echo"
947      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
948           test "X$echo_testing_string" = 'X\t' &&
949           echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
950           test "X$echo_testing_string" = "X$echo_test_string"; then
951        echo="$CONFIG_SHELL [$]0 --fallback-echo"
952      else
953        # maybe with a smaller string...
954        prev=:
955
956        for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
957          if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
958          then
959            break
960          fi
961          prev="$cmd"
962        done
963
964        if test "$prev" != 'sed 50q "[$]0"'; then
965          echo_test_string=`eval $prev`
966          export echo_test_string
967          exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
968        else
969          # Oops.  We lost completely, so just stick with echo.
970          echo=echo
971        fi
972      fi
973    fi
974  fi
975fi
976fi
977
978# Copy echo and quote the copy suitably for passing to libtool from
979# the Makefile, instead of quoting the original, which is used later.
980ECHO=$echo
981if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
982   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
983fi
984
985AC_SUBST(ECHO)
986AC_DIVERT_POP
987])# _LT_AC_PROG_ECHO_BACKSLASH
988
989# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
990#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
991# ------------------------------------------------------------------
992AC_DEFUN(_LT_AC_TRY_DLOPEN_SELF,
993[if test "$cross_compiling" = yes; then :
994  [$4]
995else
996  AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
997  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
998  lt_status=$lt_dlunknown
999  cat > conftest.$ac_ext <<EOF
1000[#line __oline__ "configure"
1001#include "confdefs.h"
1002
1003#if HAVE_DLFCN_H
1004#include <dlfcn.h>
1005#endif
1006
1007#include <stdio.h>
1008
1009#ifdef RTLD_GLOBAL
1010#  define LT_DLGLOBAL           RTLD_GLOBAL
1011#else
1012#  ifdef DL_GLOBAL
1013#    define LT_DLGLOBAL         DL_GLOBAL
1014#  else
1015#    define LT_DLGLOBAL         0
1016#  endif
1017#endif
1018
1019/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1020   find out it does not work in some platform. */
1021#ifndef LT_DLLAZY_OR_NOW
1022#  ifdef RTLD_LAZY
1023#    define LT_DLLAZY_OR_NOW            RTLD_LAZY
1024#  else
1025#    ifdef DL_LAZY
1026#      define LT_DLLAZY_OR_NOW          DL_LAZY
1027#    else
1028#      ifdef RTLD_NOW
1029#        define LT_DLLAZY_OR_NOW        RTLD_NOW
1030#      else
1031#        ifdef DL_NOW
1032#          define LT_DLLAZY_OR_NOW      DL_NOW
1033#        else
1034#          define LT_DLLAZY_OR_NOW      0
1035#        endif
1036#      endif
1037#    endif
1038#  endif
1039#endif
1040
1041#ifdef __cplusplus
1042extern "C" void exit (int);
1043#endif
1044
1045void fnord() { int i=42;}
1046int main ()
1047{
1048  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1049  int status = $lt_dlunknown;
1050
1051  if (self)
1052    {
1053      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1054      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1055      /* dlclose (self); */
1056    }
1057
1058    exit (status);
1059}]
1060EOF
1061  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1062    (./conftest; exit; ) 2>/dev/null
1063    lt_status=$?
1064    case x$lt_status in
1065      x$lt_dlno_uscore) $1 ;;
1066      x$lt_dlneed_uscore) $2 ;;
1067      x$lt_unknown|x*) $3 ;;
1068    esac
1069  else :
1070    # compilation failed
1071    $3
1072  fi
1073fi
1074rm -fr conftest*
1075])# _LT_AC_TRY_DLOPEN_SELF
1076
1077# AC_LIBTOOL_DLOPEN_SELF
1078# -------------------
1079AC_DEFUN(AC_LIBTOOL_DLOPEN_SELF,
1080[if test "x$enable_dlopen" != xyes; then
1081  enable_dlopen=unknown
1082  enable_dlopen_self=unknown
1083  enable_dlopen_self_static=unknown
1084else
1085  lt_cv_dlopen=no
1086  lt_cv_dlopen_libs=
1087
1088  case $host_os in
1089  beos*)
1090    lt_cv_dlopen="load_add_on"
1091    lt_cv_dlopen_libs=
1092    lt_cv_dlopen_self=yes
1093    ;;
1094
1095  cygwin* | mingw* | pw32*)
1096    lt_cv_dlopen="LoadLibrary"
1097    lt_cv_dlopen_libs=
1098   ;;
1099
1100  *)
1101    AC_CHECK_LIB(dl, dlopen,  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1102      [AC_CHECK_FUNC(dlopen, lt_cv_dlopen="dlopen",
1103        [AC_CHECK_FUNC(shl_load, lt_cv_dlopen="shl_load",
1104          [AC_CHECK_LIB(svld, dlopen,
1105            [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1106            [AC_CHECK_LIB(dld, shl_load,
1107              [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
1108            ])
1109          ])
1110        ])
1111      ])
1112    ;;
1113  esac
1114
1115  if test "x$lt_cv_dlopen" != xno; then
1116    enable_dlopen=yes
1117  else
1118    enable_dlopen=no
1119  fi
1120
1121  case $lt_cv_dlopen in
1122  dlopen)
1123    save_CPPFLAGS="$CPPFLAGS"
1124    AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
1125    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1126
1127    save_LDFLAGS="$LDFLAGS"
1128    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1129
1130    save_LIBS="$LIBS"
1131    LIBS="$lt_cv_dlopen_libs $LIBS"
1132
1133    AC_CACHE_CHECK([whether a program can dlopen itself],
1134          lt_cv_dlopen_self, [dnl
1135          _LT_AC_TRY_DLOPEN_SELF(
1136            lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1137            lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1138    ])
1139
1140    if test "x$lt_cv_dlopen_self" = xyes; then
1141      LDFLAGS="$LDFLAGS $link_static_flag"
1142      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1143          lt_cv_dlopen_self_static, [dnl
1144          _LT_AC_TRY_DLOPEN_SELF(
1145            lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1146            lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1147      ])
1148    fi
1149
1150    CPPFLAGS="$save_CPPFLAGS"
1151    LDFLAGS="$save_LDFLAGS"
1152    LIBS="$save_LIBS"
1153    ;;
1154  esac
1155
1156  case $lt_cv_dlopen_self in
1157  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1158  *) enable_dlopen_self=unknown ;;
1159  esac
1160
1161  case $lt_cv_dlopen_self_static in
1162  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1163  *) enable_dlopen_self_static=unknown ;;
1164  esac
1165fi
1166])# AC_LIBTOOL_DLOPEN_SELF
1167
1168AC_DEFUN([_LT_AC_LTCONFIG_HACK],
1169[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
1170# Sed substitution that helps us do robust quoting.  It backslashifies
1171# metacharacters that are still active within double-quoted strings.
1172Xsed='sed -e s/^X//'
1173[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
1174
1175# Same as above, but do not quote variable references.
1176[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
1177
1178# Sed substitution to delay expansion of an escaped shell variable in a
1179# double_quote_subst'ed string.
1180delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1181
1182# Constants:
1183rm="rm -f"
1184
1185# Global variables:
1186default_ofile=libtool
1187can_build_shared=yes
1188
1189# All known linkers require a `.a' archive for static linking (except M$VC,
1190# which needs '.lib').
1191libext=a
1192ltmain="$ac_aux_dir/ltmain.sh"
1193ofile="$default_ofile"
1194with_gnu_ld="$lt_cv_prog_gnu_ld"
1195need_locks="$enable_libtool_lock"
1196
1197old_CC="$CC"
1198old_CFLAGS="$CFLAGS"
1199
1200# Set sane defaults for various variables
1201test -z "$AR" && AR=ar
1202test -z "$AR_FLAGS" && AR_FLAGS=cru
1203test -z "$AS" && AS=as
1204test -z "$CC" && CC=cc
1205test -z "$DLLTOOL" && DLLTOOL=dlltool
1206test -z "$LD" && LD=ld
1207test -z "$LN_S" && LN_S="ln -s"
1208test -z "$MAGIC_CMD" && MAGIC_CMD=file
1209test -z "$NM" && NM=nm
1210test -z "$OBJDUMP" && OBJDUMP=objdump
1211test -z "$RANLIB" && RANLIB=:
1212test -z "$STRIP" && STRIP=:
1213test -z "$ac_objext" && ac_objext=o
1214
1215if test x"$host" != x"$build"; then
1216  ac_tool_prefix=${host_alias}-
1217else
1218  ac_tool_prefix=
1219fi
1220
1221# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
1222case $host_os in
1223linux-gnu*) ;;
1224linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
1225esac
1226
1227case $host_os in
1228aix3*)
1229  # AIX sometimes has problems with the GCC collect2 program.  For some
1230  # reason, if we set the COLLECT_NAMES environment variable, the problems
1231  # vanish in a puff of smoke.
1232  if test "X${COLLECT_NAMES+set}" != Xset; then
1233    COLLECT_NAMES=
1234    export COLLECT_NAMES
1235  fi
1236  ;;
1237esac
1238
1239# Determine commands to create old-style static archives.
1240old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
1241old_postinstall_cmds='chmod 644 $oldlib'
1242old_postuninstall_cmds=
1243
1244if test -n "$RANLIB"; then
1245  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1246  old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
1247fi
1248
1249# Allow CC to be a program name with arguments.
1250set dummy $CC
1251compiler="[$]2"
1252
1253AC_MSG_CHECKING([for objdir])
1254rm -f .libs 2>/dev/null
1255mkdir .libs 2>/dev/null
1256if test -d .libs; then
1257  objdir=.libs
1258else
1259  # MS-DOS does not allow filenames that begin with a dot.
1260  objdir=_libs
1261fi
1262rmdir .libs 2>/dev/null
1263AC_MSG_RESULT($objdir)
1264
1265
1266AC_ARG_WITH(pic,
1267[  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
1268pic_mode="$withval", pic_mode=default)
1269test -z "$pic_mode" && pic_mode=default
1270
1271# We assume here that the value for lt_cv_prog_cc_pic will not be cached
1272# in isolation, and that seeing it set (from the cache) indicates that
1273# the associated values are set (in the cache) correctly too.
1274AC_MSG_CHECKING([for $compiler option to produce PIC])
1275AC_CACHE_VAL(lt_cv_prog_cc_pic,
1276[ lt_cv_prog_cc_pic=
1277  lt_cv_prog_cc_shlib=
1278  lt_cv_prog_cc_wl=
1279  lt_cv_prog_cc_static=
1280  lt_cv_prog_cc_no_builtin=
1281  lt_cv_prog_cc_can_build_shared=$can_build_shared
1282
1283  if test "$GCC" = yes; then
1284    lt_cv_prog_cc_wl='-Wl,'
1285    lt_cv_prog_cc_static='-static'
1286
1287    case $host_os in
1288    aix*)
1289      # Below there is a dirty hack to force normal static linking with -ldl
1290      # The problem is because libdl dynamically linked with both libc and
1291      # libC (AIX C++ library), which obviously doesn't included in libraries
1292      # list by gcc. This cause undefined symbols with -static flags.
1293      # This hack allows C programs to be linked with "-static -ldl", but
1294      # we not sure about C++ programs.
1295      lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
1296      ;;
1297    amigaos*)
1298      # FIXME: we need at least 68020 code to build shared libraries, but
1299      # adding the `-m68020' flag to GCC prevents building anything better,
1300      # like `-m68040'.
1301      lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
1302      ;;
1303    beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
1304      # PIC is the default for these OSes.
1305      ;;
1306    darwin* | rhapsody*)
1307      # PIC is the default on this platform
1308      # Common symbols not allowed in MH_DYLIB files
1309      lt_cv_prog_cc_pic='-fno-common'
1310      ;;
1311    cygwin* | mingw* | pw32* | os2*)
1312      # This hack is so that the source file can tell whether it is being
1313      # built for inclusion in a dll (and should export symbols for example).
1314      lt_cv_prog_cc_pic='-DDLL_EXPORT'
1315      ;;
1316    sysv4*MP*)
1317      if test -d /usr/nec; then
1318         lt_cv_prog_cc_pic=-Kconform_pic
1319      fi
1320      ;;
1321    *)
1322      lt_cv_prog_cc_pic='-fPIC'
1323      ;;
1324    esac
1325  else
1326    # PORTME Check for PIC flags for the system compiler.
1327    case $host_os in
1328    aix3* | aix4* | aix5*)
1329      # All AIX code is PIC.
1330      if test "$host_cpu" = ia64; then
1331        # AIX 5 now supports IA64 processor
1332        lt_cv_prog_cc_static='-Bstatic'
1333        lt_cv_prog_cc_wl='-Wl,'
1334      else
1335        lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
1336      fi
1337      ;;
1338
1339    hpux9* | hpux10* | hpux11*)
1340      # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
1341      lt_cv_prog_cc_wl='-Wl,'
1342      lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
1343      lt_cv_prog_cc_pic='+Z'
1344      ;;
1345
1346    irix5* | irix6*)
1347      lt_cv_prog_cc_wl='-Wl,'
1348      lt_cv_prog_cc_static='-non_shared'
1349      # PIC (with -KPIC) is the default.
1350      ;;
1351
1352    cygwin* | mingw* | pw32* | os2*)
1353      # This hack is so that the source file can tell whether it is being
1354      # built for inclusion in a dll (and should export symbols for example).
1355      lt_cv_prog_cc_pic='-DDLL_EXPORT'
1356      ;;
1357
1358    newsos6)
1359      lt_cv_prog_cc_pic='-KPIC'
1360      lt_cv_prog_cc_static='-Bstatic'
1361      ;;
1362
1363    osf3* | osf4* | osf5*)
1364      # All OSF/1 code is PIC.
1365      lt_cv_prog_cc_wl='-Wl,'
1366      lt_cv_prog_cc_static='-non_shared'
1367      ;;
1368
1369    sco3.2v5*)
1370      lt_cv_prog_cc_pic='-Kpic'
1371      lt_cv_prog_cc_static='-dn'
1372      lt_cv_prog_cc_shlib='-belf'
1373      ;;
1374
1375    solaris*)
1376      lt_cv_prog_cc_pic='-KPIC'
1377      lt_cv_prog_cc_static='-Bstatic'
1378      lt_cv_prog_cc_wl='-Wl,'
1379      ;;
1380
1381    sunos4*)
1382      lt_cv_prog_cc_pic='-PIC'
1383      lt_cv_prog_cc_static='-Bstatic'
1384      lt_cv_prog_cc_wl='-Qoption ld '
1385      ;;
1386
1387    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1388      lt_cv_prog_cc_pic='-KPIC'
1389      lt_cv_prog_cc_static='-Bstatic'
1390      if test "x$host_vendor" = xsni; then
1391        lt_cv_prog_cc_wl='-LD'
1392      else
1393        lt_cv_prog_cc_wl='-Wl,'
1394      fi
1395      ;;
1396
1397    uts4*)
1398      lt_cv_prog_cc_pic='-pic'
1399      lt_cv_prog_cc_static='-Bstatic'
1400      ;;
1401
1402    sysv4*MP*)
1403      if test -d /usr/nec ;then
1404        lt_cv_prog_cc_pic='-Kconform_pic'
1405        lt_cv_prog_cc_static='-Bstatic'
1406      fi
1407      ;;
1408
1409    *)
1410      lt_cv_prog_cc_can_build_shared=no
1411      ;;
1412    esac
1413  fi
1414])
1415if test -z "$lt_cv_prog_cc_pic"; then
1416  AC_MSG_RESULT([none])
1417else
1418  AC_MSG_RESULT([$lt_cv_prog_cc_pic])
1419
1420  # Check to make sure the pic_flag actually works.
1421  AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
1422  AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
1423    save_CFLAGS="$CFLAGS"
1424    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
1425    AC_TRY_COMPILE([], [], [dnl
1426      case $host_os in
1427      hpux9* | hpux10* | hpux11*)
1428        # On HP-UX, both CC and GCC only warn that PIC is supported... then
1429        # they create non-PIC objects.  So, if there were any warnings, we
1430        # assume that PIC is not supported.
1431        if test -s conftest.err; then
1432          lt_cv_prog_cc_pic_works=no
1433        else
1434          lt_cv_prog_cc_pic_works=yes
1435        fi
1436        ;;
1437      *)
1438        lt_cv_prog_cc_pic_works=yes
1439        ;;
1440      esac
1441    ], [dnl
1442      lt_cv_prog_cc_pic_works=no
1443    ])
1444    CFLAGS="$save_CFLAGS"
1445  ])
1446
1447  if test "X$lt_cv_prog_cc_pic_works" = Xno; then
1448    lt_cv_prog_cc_pic=
1449    lt_cv_prog_cc_can_build_shared=no
1450  else
1451    lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
1452  fi
1453
1454  AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
1455fi
1456
1457# Check for any special shared library compilation flags.
1458if test -n "$lt_cv_prog_cc_shlib"; then
1459  AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
1460  if echo "$old_CC $old_CFLAGS " | [egrep -e "[         ]$lt_cv_prog_cc_shlib[  ]"] >/dev/null; then :
1461  else
1462   AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
1463    lt_cv_prog_cc_can_build_shared=no
1464  fi
1465fi
1466
1467AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
1468AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
1469  lt_cv_prog_cc_static_works=no
1470  save_LDFLAGS="$LDFLAGS"
1471  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
1472  AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
1473  LDFLAGS="$save_LDFLAGS"
1474])
1475
1476# Belt *and* braces to stop my trousers falling down:
1477test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
1478AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
1479
1480pic_flag="$lt_cv_prog_cc_pic"
1481special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
1482wl="$lt_cv_prog_cc_wl"
1483link_static_flag="$lt_cv_prog_cc_static"
1484no_builtin_flag="$lt_cv_prog_cc_no_builtin"
1485can_build_shared="$lt_cv_prog_cc_can_build_shared"
1486
1487
1488# Check to see if options -o and -c are simultaneously supported by compiler
1489AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
1490AC_CACHE_VAL([lt_cv_compiler_c_o], [
1491$rm -r conftest 2>/dev/null
1492mkdir conftest
1493cd conftest
1494echo "int some_variable = 0;" > conftest.$ac_ext
1495mkdir out
1496# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
1497# that will create temporary files in the current directory regardless of
1498# the output directory.  Thus, making CWD read-only will cause this test
1499# to fail, enabling locking or at least warning the user not to do parallel
1500# builds.
1501chmod -w .
1502save_CFLAGS="$CFLAGS"
1503CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
1504compiler_c_o=no
1505if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
1506  # The compiler can only warn and ignore the option if not recognized
1507  # So say no if there are warnings
1508  if test -s out/conftest.err; then
1509    lt_cv_compiler_c_o=no
1510  else
1511    lt_cv_compiler_c_o=yes
1512  fi
1513else
1514  # Append any errors to the config.log.
1515  cat out/conftest.err 1>&AC_FD_CC
1516  lt_cv_compiler_c_o=no
1517fi
1518CFLAGS="$save_CFLAGS"
1519chmod u+w .
1520$rm conftest* out/*
1521rmdir out
1522cd ..
1523rmdir conftest
1524$rm -r conftest 2>/dev/null
1525])
1526compiler_c_o=$lt_cv_compiler_c_o
1527AC_MSG_RESULT([$compiler_c_o])
1528
1529if test x"$compiler_c_o" = x"yes"; then
1530  # Check to see if we can write to a .lo
1531  AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
1532  AC_CACHE_VAL([lt_cv_compiler_o_lo], [
1533  lt_cv_compiler_o_lo=no
1534  save_CFLAGS="$CFLAGS"
1535  CFLAGS="$CFLAGS -c -o conftest.lo"
1536  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
1537    # The compiler can only warn and ignore the option if not recognized
1538    # So say no if there are warnings
1539    if test -s conftest.err; then
1540      lt_cv_compiler_o_lo=no
1541    else
1542      lt_cv_compiler_o_lo=yes
1543    fi
1544  ])
1545  CFLAGS="$save_CFLAGS"
1546  ])
1547  compiler_o_lo=$lt_cv_compiler_o_lo
1548  AC_MSG_RESULT([$compiler_c_lo])
1549else
1550  compiler_o_lo=no
1551fi
1552
1553# Check to see if we can do hard links to lock some files if needed
1554hard_links="nottested"
1555if test "$compiler_c_o" = no && test "$need_locks" != no; then
1556  # do not overwrite the value of need_locks provided by the user
1557  AC_MSG_CHECKING([if we can lock with hard links])
1558  hard_links=yes
1559  $rm conftest*
1560  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1561  touch conftest.a
1562  ln conftest.a conftest.b 2>&5 || hard_links=no
1563  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1564  AC_MSG_RESULT([$hard_links])
1565  if test "$hard_links" = no; then
1566    AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
1567    need_locks=warn
1568  fi
1569else
1570  need_locks=no
1571fi
1572
1573if test "$GCC" = yes; then
1574  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
1575  AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
1576  echo "int some_variable = 0;" > conftest.$ac_ext
1577  save_CFLAGS="$CFLAGS"
1578  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
1579  compiler_rtti_exceptions=no
1580  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
1581    # The compiler can only warn and ignore the option if not recognized
1582    # So say no if there are warnings
1583    if test -s conftest.err; then
1584      compiler_rtti_exceptions=no
1585    else
1586      compiler_rtti_exceptions=yes
1587    fi
1588  ])
1589  CFLAGS="$save_CFLAGS"
1590  AC_MSG_RESULT([$compiler_rtti_exceptions])
1591
1592  if test "$compiler_rtti_exceptions" = "yes"; then
1593    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
1594  else
1595    no_builtin_flag=' -fno-builtin'
1596  fi
1597fi
1598
1599# See if the linker supports building shared libraries.
1600AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
1601
1602allow_undefined_flag=
1603no_undefined_flag=
1604need_lib_prefix=unknown
1605need_version=unknown
1606# when you set need_version to no, make sure it does not cause -set_version
1607# flags to be left without arguments
1608archive_cmds=
1609archive_expsym_cmds=
1610old_archive_from_new_cmds=
1611old_archive_from_expsyms_cmds=
1612export_dynamic_flag_spec=
1613whole_archive_flag_spec=
1614thread_safe_flag_spec=
1615hardcode_into_libs=no
1616hardcode_libdir_flag_spec=
1617hardcode_libdir_separator=
1618hardcode_direct=no
1619hardcode_minus_L=no
1620hardcode_shlibpath_var=unsupported
1621runpath_var=
1622link_all_deplibs=unknown
1623always_export_symbols=no
1624export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
1625# include_expsyms should be a list of space-separated symbols to be *always*
1626# included in the symbol list
1627include_expsyms=
1628# exclude_expsyms can be an egrep regular expression of symbols to exclude
1629# it will be wrapped by ` (' and `)$', so one must not match beginning or
1630# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
1631# as well as any symbol that contains `d'.
1632exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
1633# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
1634# platforms (ab)use it in PIC code, but their linkers get confused if
1635# the symbol is explicitly referenced.  Since portable code cannot
1636# rely on this symbol name, it's probably fine to never include it in
1637# preloaded symbol tables.
1638extract_expsyms_cmds=
1639
1640case $host_os in
1641cygwin* | mingw* | pw32* )
1642  # FIXME: the MSVC++ port hasn't been tested in a loooong time
1643  # When not using gcc, we currently assume that we are using
1644  # Microsoft Visual C++.
1645  if test "$GCC" != yes; then
1646    with_gnu_ld=no
1647  fi
1648  ;;
1649
1650esac
1651
1652ld_shlibs=yes
1653if test "$with_gnu_ld" = yes; then
1654  # If archive_cmds runs LD, not CC, wlarc should be empty
1655  wlarc='${wl}'
1656
1657  # See if GNU ld supports shared libraries.
1658  case $host_os in
1659  aix3* | aix4* | aix5*)
1660    # On AIX, the GNU linker is very broken
1661    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
1662    ld_shlibs=no
1663    cat <<EOF 1>&2
1664
1665*** Warning: the GNU linker, at least up to release 2.9.1, is reported
1666*** to be unable to reliably create shared libraries on AIX.
1667*** Therefore, libtool is disabling shared libraries support.  If you
1668*** really care for shared libraries, you may want to modify your PATH
1669*** so that a non-GNU linker is found, and then restart.
1670
1671EOF
1672    ;;
1673
1674  amigaos*)
1675    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)'
1676    hardcode_libdir_flag_spec='-L$libdir'
1677    hardcode_minus_L=yes
1678
1679    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
1680    # that the semantics of dynamic libraries on AmigaOS, at least up
1681    # to version 4, is to share data among multiple programs linked
1682    # with the same dynamic library.  Since this doesn't match the
1683    # behavior of shared libraries on other platforms, we can use
1684    # them.
1685    ld_shlibs=no
1686    ;;
1687
1688  beos*)
1689    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1690      allow_undefined_flag=unsupported
1691      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
1692      # support --undefined.  This deserves some investigation.  FIXME
1693      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1694    else
1695      ld_shlibs=no
1696    fi
1697    ;;
1698
1699  cygwin* | mingw* | pw32*)
1700    # hardcode_libdir_flag_spec is actually meaningless, as there is
1701    # no search path for DLLs.
1702    hardcode_libdir_flag_spec='-L$libdir'
1703    allow_undefined_flag=unsupported
1704    always_export_symbols=yes
1705
1706    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
1707      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
1708      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
1709      if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
1710      else $CC -o impgen impgen.c ; fi)~
1711      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
1712
1713    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
1714
1715    # cygwin and mingw dlls have different entry points and sets of symbols
1716    # to exclude.
1717    # FIXME: what about values for MSVC?
1718    dll_entry=__cygwin_dll_entry@12
1719    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
1720    case $host_os in
1721    mingw*)
1722      # mingw values
1723      dll_entry=_DllMainCRTStartup@12
1724      dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
1725      ;;
1726    esac
1727
1728    # mingw and cygwin differ, and it's simplest to just exclude the union
1729    # of the two symbol sets.
1730    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
1731
1732    # recent cygwin and mingw systems supply a stub DllMain which the user
1733    # can override, but on older systems we have to supply one (in ltdll.c)
1734    if test "x$lt_cv_need_dllmain" = "xyes"; then
1735      ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
1736      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~
1737        test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
1738    else
1739      ltdll_obj=
1740      ltdll_cmds=
1741    fi
1742
1743    # Extract the symbol export list from an `--export-all' def file,
1744    # then regenerate the def file from the symbol export list, so that
1745    # the compiled dll only exports the symbol export list.
1746    # Be careful not to strip the DATA tag left be newer dlltools.
1747    export_symbols_cmds="$ltdll_cmds"'
1748      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
1749      [sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//"] < $output_objdir/$soname-def > $export_symbols'
1750
1751    # If the export-symbols file already is a .def file (1st line
1752    # is EXPORTS), use it as is.
1753    # If DATA tags from a recent dlltool are present, honour them!
1754    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
1755        cp $export_symbols $output_objdir/$soname-def;
1756      else
1757        echo EXPORTS > $output_objdir/$soname-def;
1758        _lt_hint=1;
1759        cat $export_symbols | while read symbol; do
1760         set dummy \$symbol;
1761         case \[$]# in
1762           2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
1763           *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
1764         esac;
1765         _lt_hint=`expr 1 + \$_lt_hint`;
1766        done;
1767      fi~
1768      '"$ltdll_cmds"'
1769      $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~
1770      $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~
1771      $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~
1772      $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~
1773      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
1774    ;;
1775
1776  netbsd*)
1777    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1778      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
1779      wlarc=
1780    else
1781      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1782      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1783    fi
1784    ;;
1785
1786  solaris* | sysv5*)
1787    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
1788      ld_shlibs=no
1789      cat <<EOF 1>&2
1790
1791*** Warning: The releases 2.8.* of the GNU linker cannot reliably
1792*** create shared libraries on Solaris systems.  Therefore, libtool
1793*** is disabling shared libraries support.  We urge you to upgrade GNU
1794*** binutils to release 2.9.1 or newer.  Another option is to modify
1795*** your PATH or compiler configuration so that the native linker is
1796*** used, and then restart.
1797
1798EOF
1799    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1800      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1801      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1802    else
1803      ld_shlibs=no
1804    fi
1805    ;;
1806
1807  sunos4*)
1808    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1809    wlarc=
1810    hardcode_direct=yes
1811    hardcode_shlibpath_var=no
1812    ;;
1813
1814  *)
1815    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1816      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1817      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1818    else
1819      ld_shlibs=no
1820    fi
1821    ;;
1822  esac
1823
1824  if test "$ld_shlibs" = yes; then
1825    runpath_var=LD_RUN_PATH
1826    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
1827    export_dynamic_flag_spec='${wl}--export-dynamic'
1828    case $host_os in
1829    cygwin* | mingw* | pw32*)
1830      # dlltool doesn't understand --whole-archive et. al.
1831      whole_archive_flag_spec=
1832      ;;
1833    *)
1834      # ancient GNU ld didn't support --whole-archive et. al.
1835      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
1836        whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
1837      else
1838        whole_archive_flag_spec=
1839      fi
1840      ;;
1841    esac
1842  fi
1843else
1844  # PORTME fill in a description of your system's linker (not GNU ld)
1845  case $host_os in
1846  aix3*)
1847    allow_undefined_flag=unsupported
1848    always_export_symbols=yes
1849    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'
1850    # Note: this linker hardcodes the directories in LIBPATH if there
1851    # are no directories specified by -L.
1852    hardcode_minus_L=yes
1853    if test "$GCC" = yes && test -z "$link_static_flag"; then
1854      # Neither direct hardcoding nor static linking is supported with a
1855      # broken collect2.
1856      hardcode_direct=unsupported
1857    fi
1858    ;;
1859
1860  aix4* | aix5*)
1861    # When large executables or shared objects are built, AIX ld can
1862    # have problems creating the table of contents.  If linking a library
1863    # or program results in "error TOC overflow" add -mminimal-toc to
1864    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
1865    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
1866
1867    archive_cmds=''
1868    hardcode_libdir_separator=':'
1869    if test "$GCC" = yes; then
1870      collect2name=`${CC} -print-prog-name=collect2`
1871      if test -f "$collect2name" && \
1872         strings "$collect2name" | grep resolve_lib_name >/dev/null
1873      then
1874        # We have reworked collect2
1875        hardcode_direct=yes
1876      else
1877        # We have old collect2
1878        hardcode_direct=unsupported
1879        # It fails to find uninstalled libraries when the uninstalled
1880        # path is not listed in the libpath.  Setting hardcode_minus_L
1881        # to unsupported forces relinking
1882        hardcode_minus_L=yes
1883        hardcode_libdir_flag_spec='-L$libdir'
1884        hardcode_libdir_separator=
1885      fi
1886      shared_flag='-shared'
1887    else
1888      if test "$host_cpu" = ia64; then
1889        shared_flag='-G'
1890      else
1891        shared_flag='${wl}-bM:SRE'
1892      fi
1893      hardcode_direct=yes
1894    fi
1895
1896    if test "$host_cpu" = ia64; then
1897      # On IA64, the linker does run time linking by default, so we don't
1898      # have to do anything special.
1899      aix_use_runtimelinking=no
1900      exp_sym_flag='-Bexport'
1901      no_entry_flag=""
1902    else
1903      # Test if we are trying to use run time linking, or normal AIX style linking.
1904      # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
1905      aix_use_runtimelinking=no
1906      for ld_flag in $LDFLAGS; do
1907        if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
1908          aix_use_runtimelinking=yes
1909          break
1910        fi
1911      done
1912      exp_sym_flag='-bexport'
1913      no_entry_flag='-bnoentry'
1914    fi
1915    # It seems that -bexpall can do strange things, so it is better to
1916    # generate a list of symbols to export.
1917    always_export_symbols=yes
1918    if test "$aix_use_runtimelinking" = yes; then
1919      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
1920      allow_undefined_flag=' -Wl,-G'
1921      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"
1922    else
1923      if test "$host_cpu" = ia64; then
1924        hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
1925       allow_undefined_flag="-znodefs"
1926        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"
1927      else
1928        hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
1929        # Warning - without using the other run time loading flags, -berok will
1930        #           link without error, but may produce a broken library.
1931        allow_undefined_flag='${wl}-berok"
1932        # This is a bit strange, but is similar to how AIX traditionally builds
1933        # it's shared libraries.
1934        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'
1935      fi
1936    fi
1937    ;;
1938
1939  amigaos*)
1940    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)'
1941    hardcode_libdir_flag_spec='-L$libdir'
1942    hardcode_minus_L=yes
1943    # see comment about different semantics on the GNU ld section
1944    ld_shlibs=no
1945    ;;
1946
1947  cygwin* | mingw* | pw32*)
1948    # When not using gcc, we currently assume that we are using
1949    # Microsoft Visual C++.
1950    # hardcode_libdir_flag_spec is actually meaningless, as there is
1951    # no search path for DLLs.
1952    hardcode_libdir_flag_spec=' '
1953    allow_undefined_flag=unsupported
1954    # Tell ltmain to make .lib files, not .a files.
1955    libext=lib
1956    # FIXME: Setting linknames here is a bad hack.
1957    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
1958    # The linker will automatically build a .lib file if we build a DLL.
1959    old_archive_from_new_cmds='true'
1960    # FIXME: Should let the user specify the lib program.
1961    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
1962    fix_srcfile_path='`cygpath -w "$srcfile"`'
1963    ;;
1964
1965  darwin* | rhapsody*)
1966    allow_undefined_flag='-undefined suppress'
1967    # FIXME: Relying on posixy $() will cause problems for
1968    #        cross-compilation, but unfortunately the echo tests do not
1969    #        yet detect zsh echo's removal of \ escapes.
1970    archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)'
1971    # We need to add '_' to the symbols in $export_symbols first
1972    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
1973    hardcode_direct=yes
1974    hardcode_shlibpath_var=no
1975    whole_archive_flag_spec='-all_load $convenience'
1976    ;;
1977
1978  freebsd1*)
1979    ld_shlibs=no
1980    ;;
1981
1982  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
1983  # support.  Future versions do this automatically, but an explicit c++rt0.o
1984  # does not break anything, and helps significantly (at the cost of a little
1985  # extra space).
1986  freebsd2.2*)
1987    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
1988    hardcode_libdir_flag_spec='-R$libdir'
1989    hardcode_direct=yes
1990    hardcode_shlibpath_var=no
1991    ;;
1992
1993  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
1994  freebsd2*)
1995    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1996    hardcode_direct=yes
1997    hardcode_minus_L=yes
1998    hardcode_shlibpath_var=no
1999    ;;
2000
2001  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
2002  freebsd*)
2003    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
2004    hardcode_libdir_flag_spec='-R$libdir'
2005    hardcode_direct=yes
2006    hardcode_shlibpath_var=no
2007    ;;
2008
2009  hpux9* | hpux10* | hpux11*)
2010    case $host_os in
2011    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' ;;
2012    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
2013    esac
2014    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
2015    hardcode_libdir_separator=:
2016    hardcode_direct=yes
2017    hardcode_minus_L=yes # Not in the search PATH, but as the default
2018                         # location of the library.
2019    export_dynamic_flag_spec='${wl}-E'
2020    ;;
2021
2022  irix5* | irix6*)
2023    if test "$GCC" = yes; then
2024      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'
2025    else
2026      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'
2027    fi
2028    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2029    hardcode_libdir_separator=:
2030    link_all_deplibs=yes
2031    ;;
2032
2033  netbsd*)
2034    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2035      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
2036    else
2037      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
2038    fi
2039    hardcode_libdir_flag_spec='-R$libdir'
2040    hardcode_direct=yes
2041    hardcode_shlibpath_var=no
2042    ;;
2043
2044  newsos6)
2045    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
2046    hardcode_direct=yes
2047    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2048    hardcode_libdir_separator=:
2049    hardcode_shlibpath_var=no
2050    ;;
2051
2052  openbsd*)
2053    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2054    hardcode_libdir_flag_spec='-R$libdir'
2055    hardcode_direct=yes
2056    hardcode_shlibpath_var=no
2057    ;;
2058
2059  os2*)
2060    hardcode_libdir_flag_spec='-L$libdir'
2061    hardcode_minus_L=yes
2062    allow_undefined_flag=unsupported
2063    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'
2064    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
2065    ;;
2066
2067  osf3*)
2068    if test "$GCC" = yes; then
2069      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
2070      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'
2071    else
2072      allow_undefined_flag=' -expect_unresolved \*'
2073      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'
2074    fi
2075    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2076    hardcode_libdir_separator=:
2077    ;;
2078
2079  osf4* | osf5*)        # as osf3* with the addition of -msym flag
2080    if test "$GCC" = yes; then
2081      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
2082      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'
2083      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2084    else
2085      allow_undefined_flag=' -expect_unresolved \*'
2086      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'
2087      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
2088      $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'
2089
2090      #Both c and cxx compiler support -rpath directly
2091      hardcode_libdir_flag_spec='-rpath $libdir'
2092    fi
2093    hardcode_libdir_separator=:
2094    ;;
2095
2096  sco3.2v5*)
2097    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2098    hardcode_shlibpath_var=no
2099    runpath_var=LD_RUN_PATH
2100    hardcode_runpath_var=yes
2101    ;;
2102
2103  solaris*)
2104    no_undefined_flag=' -z defs'
2105    # $CC -shared without GNU ld will not create a library from C++
2106    # object files and a static libstdc++, better avoid it by now
2107    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2108    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2109                $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2110    hardcode_libdir_flag_spec='-R$libdir'
2111    hardcode_shlibpath_var=no
2112    case $host_os in
2113    [solaris2.[0-5] | solaris2.[0-5].*]) ;;
2114    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
2115      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
2116    esac
2117    link_all_deplibs=yes
2118    ;;
2119
2120  sunos4*)
2121    if test "x$host_vendor" = xsequent; then
2122      # Use $CC to link under sequent, because it throws in some extra .o
2123      # files that make .init and .fini sections work.
2124      archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
2125    else
2126      archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
2127    fi
2128    hardcode_libdir_flag_spec='-L$libdir'
2129    hardcode_direct=yes
2130    hardcode_minus_L=yes
2131    hardcode_shlibpath_var=no
2132    ;;
2133
2134  sysv4)
2135    if test "x$host_vendor" = xsno; then
2136      archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linkopts'
2137      hardcode_direct=yes # is this really true???
2138    else
2139      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2140      hardcode_direct=no #Motorola manual says yes, but my tests say they lie
2141    fi
2142    runpath_var='LD_RUN_PATH'
2143    hardcode_shlibpath_var=no
2144    ;;
2145
2146  sysv4.3*)
2147    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2148    hardcode_shlibpath_var=no
2149    export_dynamic_flag_spec='-Bexport'
2150    ;;
2151
2152  sysv5*)
2153    no_undefined_flag=' -z text'
2154    # $CC -shared without GNU ld will not create a library from C++
2155    # object files and a static libstdc++, better avoid it by now
2156    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2157    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2158                $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2159    hardcode_libdir_flag_spec=
2160    hardcode_shlibpath_var=no
2161    runpath_var='LD_RUN_PATH'
2162    ;;
2163
2164  uts4*)
2165    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2166    hardcode_libdir_flag_spec='-L$libdir'
2167    hardcode_shlibpath_var=no
2168    ;;
2169
2170  dgux*)
2171    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2172    hardcode_libdir_flag_spec='-L$libdir'
2173    hardcode_shlibpath_var=no
2174    ;;
2175
2176  sysv4*MP*)
2177    if test -d /usr/nec; then
2178      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2179      hardcode_shlibpath_var=no
2180      runpath_var=LD_RUN_PATH
2181      hardcode_runpath_var=yes
2182      ld_shlibs=yes
2183    fi
2184    ;;
2185
2186  sysv4.2uw2*)
2187    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
2188    hardcode_direct=yes
2189    hardcode_minus_L=no
2190    hardcode_shlibpath_var=no
2191    hardcode_runpath_var=yes
2192    runpath_var=LD_RUN_PATH
2193    ;;
2194
2195  sysv5uw7* | unixware7*)
2196    no_undefined_flag='${wl}-z ${wl}text'
2197    if test "$GCC" = yes; then
2198      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2199    else
2200      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2201    fi
2202    runpath_var='LD_RUN_PATH'
2203    hardcode_shlibpath_var=no
2204    ;;
2205
2206  *)
2207    ld_shlibs=no
2208    ;;
2209  esac
2210fi
2211AC_MSG_RESULT([$ld_shlibs])
2212test "$ld_shlibs" = no && can_build_shared=no
2213
2214# Check hardcoding attributes.
2215AC_MSG_CHECKING([how to hardcode library paths into programs])
2216hardcode_action=
2217if test -n "$hardcode_libdir_flag_spec" || \
2218   test -n "$runpath_var"; then
2219
2220  # We can hardcode non-existant directories.
2221  if test "$hardcode_direct" != no &&
2222     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2223     # have to relink, otherwise we might link with an installed library
2224     # when we should be linking with a yet-to-be-installed one
2225     ## test "$hardcode_shlibpath_var" != no &&
2226     test "$hardcode_minus_L" != no; then
2227    # Linking always hardcodes the temporary library directory.
2228    hardcode_action=relink
2229  else
2230    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2231    hardcode_action=immediate
2232  fi
2233else
2234  # We cannot hardcode anything, or else we can only hardcode existing
2235  # directories.
2236  hardcode_action=unsupported
2237fi
2238AC_MSG_RESULT([$hardcode_action])
2239
2240striplib=
2241old_striplib=
2242AC_MSG_CHECKING([whether stripping libraries is possible])
2243if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
2244  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2245  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2246  AC_MSG_RESULT([yes])
2247else
2248  AC_MSG_RESULT([no])
2249fi
2250
2251reload_cmds='$LD$reload_flag -o $output$reload_objs'
2252test -z "$deplibs_check_method" && deplibs_check_method=unknown
2253
2254# PORTME Fill in your ld.so characteristics
2255AC_MSG_CHECKING([dynamic linker characteristics])
2256library_names_spec=
2257libname_spec='lib$name'
2258soname_spec=
2259postinstall_cmds=
2260postuninstall_cmds=
2261finish_cmds=
2262finish_eval=
2263shlibpath_var=
2264shlibpath_overrides_runpath=unknown
2265version_type=none
2266dynamic_linker="$host_os ld.so"
2267sys_lib_dlsearch_path_spec="/lib /usr/lib"
2268sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2269
2270case $host_os in
2271aix3*)
2272  version_type=linux
2273  library_names_spec='${libname}${release}.so$versuffix $libname.a'
2274  shlibpath_var=LIBPATH
2275
2276  # AIX has no versioning support, so we append a major version to the name.
2277  soname_spec='${libname}${release}.so$major'
2278  ;;
2279
2280aix4* | aix5*)
2281  version_type=linux
2282  if test "$host_cpu" = ia64; then
2283    # AIX 5 supports IA64
2284    library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
2285    shlibpath_var=LD_LIBRARY_PATH
2286  else
2287    # With GCC up to 2.95.x, collect2 would create an import file
2288    # for dependence libraries.  The import file would start with
2289    # the line `#! .'.  This would cause the generated library to
2290    # depend on `.', always an invalid library.  This was fixed in
2291    # development snapshots of GCC prior to 3.0.
2292    case $host_os in
2293      [ aix4 | aix4.[01] | aix4.[01].*)]
2294      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2295           echo ' yes '
2296           echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
2297        :
2298      else
2299        can_build_shared=no
2300      fi
2301      ;;
2302    esac
2303    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2304    # soname into executable. Probably we can add versioning support to
2305    # collect2, so additional links can be useful in future.
2306    if test "$aix_use_runtimelinking" = yes; then
2307      # If using run time linking (on AIX 4.2 or later) use lib<name>.so instead of
2308      # lib<name>.a to let people know that these are not typical AIX shared libraries.
2309      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2310    else
2311      # We preserve .a as extension for shared libraries through AIX4.2
2312      # and later when we are not doing run time linking.
2313      library_names_spec='${libname}${release}.a $libname.a'
2314      soname_spec='${libname}${release}.so$major'
2315    fi
2316    shlibpath_var=LIBPATH
2317    deplibs_check_method=pass_all
2318  fi
2319  ;;
2320
2321amigaos*)
2322  library_names_spec='$libname.ixlibrary $libname.a'
2323  # Create ${libname}_ixlibrary.a entries in /sys/libs.
2324  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'
2325  ;;
2326
2327beos*)
2328  library_names_spec='${libname}.so'
2329  dynamic_linker="$host_os ld.so"
2330  shlibpath_var=LIBRARY_PATH
2331  ;;
2332
2333bsdi4*)
2334  version_type=linux
2335  need_version=no
2336  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2337  soname_spec='${libname}${release}.so$major'
2338  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2339  shlibpath_var=LD_LIBRARY_PATH
2340  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2341  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2342  export_dynamic_flag_spec=-rdynamic
2343  # the default ld.so.conf also contains /usr/contrib/lib and
2344  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2345  # libtool to hard-code these into programs
2346  ;;
2347
2348cygwin* | mingw* | pw32*)
2349  version_type=windows
2350  need_version=no
2351  need_lib_prefix=no
2352  case $GCC,$host_os in
2353  yes,cygwin*)
2354    library_names_spec='$libname.dll.a'
2355    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll'
2356    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
2357      dldir=$destdir/`dirname \$dlpath`~
2358      test -d \$dldir || mkdir -p \$dldir~
2359      $install_prog .libs/$dlname \$dldir/$dlname'
2360    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
2361      dlpath=$dir/\$dldll~
2362       $rm \$dlpath'
2363    ;;
2364  yes,mingw*)
2365    library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll'
2366    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
2367    ;;
2368  yes,pw32*)
2369    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
2370    ;;
2371  *)
2372    library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll $libname.lib'
2373    ;;
2374  esac
2375  dynamic_linker='Win32 ld.exe'
2376  # FIXME: first we should search . and the directory the executable is in
2377  shlibpath_var=PATH
2378  ;;
2379
2380darwin* | rhapsody*)
2381  dynamic_linker="$host_os dyld"
2382  version_type=darwin
2383  need_lib_prefix=no
2384  need_version=no
2385  # FIXME: Relying on posixy $() will cause problems for
2386  #        cross-compilation, but unfortunately the echo tests do not
2387  #        yet detect zsh echo's removal of \ escapes.
2388  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)'
2389  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
2390  shlibpath_overrides_runpath=yes
2391  shlibpath_var=DYLD_LIBRARY_PATH
2392  ;;
2393
2394freebsd1*)
2395  dynamic_linker=no
2396  ;;
2397
2398freebsd*)
2399  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
2400  version_type=freebsd-$objformat
2401  case $version_type in
2402    freebsd-elf*)
2403      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
2404      need_version=no
2405      need_lib_prefix=no
2406      ;;
2407    freebsd-*)
2408      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
2409      need_version=yes
2410      ;;
2411  esac
2412  shlibpath_var=LD_LIBRARY_PATH
2413  case $host_os in
2414  freebsd2*)
2415    shlibpath_overrides_runpath=yes
2416    ;;
2417  *)
2418    shlibpath_overrides_runpath=no
2419    hardcode_into_libs=yes
2420    ;;
2421  esac
2422  ;;
2423
2424gnu*)
2425  version_type=linux
2426  need_lib_prefix=no
2427  need_version=no
2428  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
2429  soname_spec='${libname}${release}.so$major'
2430  shlibpath_var=LD_LIBRARY_PATH
2431  hardcode_into_libs=yes
2432  ;;
2433
2434hpux9* | hpux10* | hpux11*)
2435  # Give a soname corresponding to the major version so that dld.sl refuses to
2436  # link against other versions.
2437  dynamic_linker="$host_os dld.sl"
2438  version_type=sunos
2439  need_lib_prefix=no
2440  need_version=no
2441  shlibpath_var=SHLIB_PATH
2442  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2443  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
2444  soname_spec='${libname}${release}.sl$major'
2445  # HP-UX runs *really* slowly unless shared libraries are mode 555.
2446  postinstall_cmds='chmod 555 $lib'
2447  ;;
2448
2449irix5* | irix6*)
2450  version_type=irix
2451  need_lib_prefix=no
2452  need_version=no
2453  soname_spec='${libname}${release}.so$major'
2454  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
2455  case $host_os in
2456  irix5*)
2457    libsuff= shlibsuff=
2458    ;;
2459  *)
2460    case $LD in # libtool.m4 will add one of these switches to LD
2461    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
2462    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
2463    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
2464    *) libsuff= shlibsuff= libmagic=never-match;;
2465    esac
2466    ;;
2467  esac
2468  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2469  shlibpath_overrides_runpath=no
2470  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2471  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2472  ;;
2473
2474# No shared lib support for Linux oldld, aout, or coff.
2475linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
2476  dynamic_linker=no
2477  ;;
2478
2479# This must be Linux ELF.
2480linux-gnu*)
2481  version_type=linux
2482  need_lib_prefix=no
2483  need_version=no
2484  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2485  soname_spec='${libname}${release}.so$major'
2486  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2487  shlibpath_var=LD_LIBRARY_PATH
2488  shlibpath_overrides_runpath=no
2489  # This implies no fast_install, which is unacceptable.
2490  # Some rework will be needed to allow for fast_install
2491  # before this can be enabled.
2492  hardcode_into_libs=yes
2493
2494  # We used to test for /lib/ld.so.1 and disable shared libraries on
2495  # powerpc, because MkLinux only supported shared libraries with the
2496  # GNU dynamic linker.  Since this was broken with cross compilers,
2497  # most powerpc-linux boxes support dynamic linking these days and
2498  # people can always --disable-shared, the test was removed, and we
2499  # assume the GNU/Linux dynamic linker is in use.
2500  dynamic_linker='GNU/Linux ld.so'
2501  ;;
2502
2503netbsd*)
2504  version_type=sunos
2505  need_lib_prefix=no
2506  need_version=no
2507  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2508    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2509    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2510    dynamic_linker='NetBSD (a.out) ld.so'
2511  else
2512    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
2513    soname_spec='${libname}${release}.so$major'
2514    dynamic_linker='NetBSD ld.elf_so'
2515  fi
2516  shlibpath_var=LD_LIBRARY_PATH
2517  shlibpath_overrides_runpath=yes
2518  hardcode_into_libs=yes
2519  ;;
2520
2521newsos6)
2522  version_type=linux
2523  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2524  shlibpath_var=LD_LIBRARY_PATH
2525  shlibpath_overrides_runpath=yes
2526  ;;
2527
2528openbsd*)
2529  version_type=sunos
2530  if test "$with_gnu_ld" = yes; then
2531    need_lib_prefix=no
2532    need_version=no
2533  fi
2534  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2535  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2536  shlibpath_var=LD_LIBRARY_PATH
2537  ;;
2538
2539os2*)
2540  libname_spec='$name'
2541  need_lib_prefix=no
2542  library_names_spec='$libname.dll $libname.a'
2543  dynamic_linker='OS/2 ld.exe'
2544  shlibpath_var=LIBPATH
2545  ;;
2546
2547osf3* | osf4* | osf5*)
2548  version_type=osf
2549  need_version=no
2550  soname_spec='${libname}${release}.so'
2551  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
2552  shlibpath_var=LD_LIBRARY_PATH
2553  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2554  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2555  ;;
2556
2557sco3.2v5*)
2558  version_type=osf
2559  soname_spec='${libname}${release}.so$major'
2560  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2561  shlibpath_var=LD_LIBRARY_PATH
2562  ;;
2563
2564solaris*)
2565  version_type=linux
2566  need_lib_prefix=no
2567  need_version=no
2568  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2569  soname_spec='${libname}${release}.so$major'
2570  shlibpath_var=LD_LIBRARY_PATH
2571  shlibpath_overrides_runpath=yes
2572  hardcode_into_libs=yes
2573  # ldd complains unless libraries are executable
2574  postinstall_cmds='chmod +x $lib'
2575  ;;
2576
2577sunos4*)
2578  version_type=sunos
2579  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2580  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2581  shlibpath_var=LD_LIBRARY_PATH
2582  shlibpath_overrides_runpath=yes
2583  if test "$with_gnu_ld" = yes; then
2584    need_lib_prefix=no
2585  fi
2586  need_version=yes
2587  ;;
2588
2589sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
2590  version_type=linux
2591  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2592  soname_spec='${libname}${release}.so$major'
2593  shlibpath_var=LD_LIBRARY_PATH
2594  case $host_vendor in
2595    sni)
2596      shlibpath_overrides_runpath=no
2597      ;;
2598    motorola)
2599      need_lib_prefix=no
2600      need_version=no
2601      shlibpath_overrides_runpath=no
2602      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2603      ;;
2604  esac
2605  ;;
2606
2607uts4*)
2608  version_type=linux
2609  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2610  soname_spec='${libname}${release}.so$major'
2611  shlibpath_var=LD_LIBRARY_PATH
2612  ;;
2613
2614dgux*)
2615  version_type=linux
2616  need_lib_prefix=no
2617  need_version=no
2618  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2619  soname_spec='${libname}${release}.so$major'
2620  shlibpath_var=LD_LIBRARY_PATH
2621  ;;
2622
2623sysv4*MP*)
2624  if test -d /usr/nec ;then
2625    version_type=linux
2626    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
2627    soname_spec='$libname.so.$major'
2628    shlibpath_var=LD_LIBRARY_PATH
2629  fi
2630  ;;
2631
2632*)
2633  dynamic_linker=no
2634  ;;
2635esac
2636AC_MSG_RESULT([$dynamic_linker])
2637test "$dynamic_linker" = no && can_build_shared=no
2638
2639# Report the final consequences.
2640AC_MSG_CHECKING([if libtool supports shared libraries])
2641AC_MSG_RESULT([$can_build_shared])
2642
2643if test "$hardcode_action" = relink; then
2644  # Fast installation is not supported
2645  enable_fast_install=no
2646elif test "$shlibpath_overrides_runpath" = yes ||
2647     test "$enable_shared" = no; then
2648  # Fast installation is not necessary
2649  enable_fast_install=needless
2650fi
2651
2652variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2653if test "$GCC" = yes; then
2654  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2655fi
2656
2657AC_LIBTOOL_DLOPEN_SELF
2658
2659if test "$enable_shared" = yes && test "$GCC" = yes; then
2660  case $archive_cmds in
2661  *'~'*)
2662    # FIXME: we may have to deal with multi-command sequences.
2663    ;;
2664  '$CC '*)
2665    # Test whether the compiler implicitly links with -lc since on some
2666    # systems, -lgcc has to come before -lc. If gcc already passes -lc
2667    # to ld, don't add -lc before -lgcc.
2668    AC_MSG_CHECKING([whether -lc should be explicitly linked in])
2669    AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
2670    [$rm conftest*
2671    echo 'static int dummy;' > conftest.$ac_ext
2672
2673    if AC_TRY_EVAL(ac_compile); then
2674      soname=conftest
2675      lib=conftest
2676      libobjs=conftest.$ac_objext
2677      deplibs=
2678      wl=$lt_cv_prog_cc_wl
2679      compiler_flags=-v
2680      linker_flags=-v
2681      verstring=
2682      output_objdir=.
2683      libname=conftest
2684      save_allow_undefined_flag=$allow_undefined_flag
2685      allow_undefined_flag=
2686      if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
2687      then
2688        lt_cv_archive_cmds_need_lc=no
2689      else
2690        lt_cv_archive_cmds_need_lc=yes
2691      fi
2692      allow_undefined_flag=$save_allow_undefined_flag
2693    else
2694      cat conftest.err 1>&5
2695    fi])
2696    AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
2697    ;;
2698  esac
2699fi
2700need_lc=${lt_cv_archive_cmds_need_lc-yes}
2701
2702# The second clause should only fire when bootstrapping the
2703# libtool distribution, otherwise you forgot to ship ltmain.sh
2704# with your package, and you will get complaints that there are
2705# no rules to generate ltmain.sh.
2706if test -f "$ltmain"; then
2707  :
2708else
2709  # If there is no Makefile yet, we rely on a make rule to execute
2710  # `config.status --recheck' to rerun these tests and create the
2711  # libtool script then.
2712  test -f Makefile && make "$ltmain"
2713fi
2714
2715if test -f "$ltmain"; then
2716  trap "$rm \"${ofile}T\"; exit 1" 1 2 15
2717  $rm -f "${ofile}T"
2718
2719  echo creating $ofile
2720
2721  # Now quote all the things that may contain metacharacters while being
2722  # careful not to overquote the AC_SUBSTed values.  We take copies of the
2723  # variables and quote the copies for generation of the libtool script.
2724  for var in echo old_CC old_CFLAGS \
2725    AR AR_FLAGS CC LD LN_S NM SHELL \
2726    reload_flag reload_cmds wl \
2727    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
2728    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
2729    library_names_spec soname_spec \
2730    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
2731    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
2732    postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
2733    old_striplib striplib file_magic_cmd export_symbols_cmds \
2734    deplibs_check_method allow_undefined_flag no_undefined_flag \
2735    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
2736    hardcode_libdir_flag_spec hardcode_libdir_separator  \
2737    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
2738    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
2739
2740    case $var in
2741    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
2742    old_postinstall_cmds | old_postuninstall_cmds | \
2743    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
2744    extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
2745    postinstall_cmds | postuninstall_cmds | \
2746    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
2747      # Double-quote double-evaled strings.
2748      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
2749      ;;
2750    *)
2751      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
2752      ;;
2753    esac
2754  done
2755
2756  cat <<__EOF__ > "${ofile}T"
2757#! $SHELL
2758
2759# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
2760# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2761# NOTE: Changes made to this file will be lost: look at ltmain.sh.
2762#
2763# Copyright (C) 1996-2000 Free Software Foundation, Inc.
2764# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2765#
2766# This program is free software; you can redistribute it and/or modify
2767# it under the terms of the GNU General Public License as published by
2768# the Free Software Foundation; either version 2 of the License, or
2769# (at your option) any later version.
2770#
2771# This program is distributed in the hope that it will be useful, but
2772# WITHOUT ANY WARRANTY; without even the implied warranty of
2773# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2774# General Public License for more details.
2775#
2776# You should have received a copy of the GNU General Public License
2777# along with this program; if not, write to the Free Software
2778# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2779#
2780# As a special exception to the GNU General Public License, if you
2781# distribute this file as part of a program that contains a
2782# configuration script generated by Autoconf, you may include it under
2783# the same distribution terms that you use for the rest of that program.
2784
2785# Sed that helps us avoid accidentally triggering echo(1) options like -n.
2786Xsed="sed -e s/^X//"
2787
2788# The HP-UX ksh and POSIX shell print the target directory to stdout
2789# if CDPATH is set.
2790if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
2791
2792# ### BEGIN LIBTOOL CONFIG
2793
2794# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2795
2796# Shell to use when invoking shell scripts.
2797SHELL=$lt_SHELL
2798
2799# Whether or not to build shared libraries.
2800build_libtool_libs=$enable_shared
2801
2802# Whether or not to add -lc for building shared libraries.
2803build_libtool_need_lc=$need_lc
2804
2805# Whether or not to build static libraries.
2806build_old_libs=$enable_static
2807
2808# Whether or not to optimize for fast installation.
2809fast_install=$enable_fast_install
2810
2811# The host system.
2812host_alias=$host_alias
2813host=$host
2814
2815# An echo program that does not interpret backslashes.
2816echo=$lt_echo
2817
2818# The archiver.
2819AR=$lt_AR
2820AR_FLAGS=$lt_AR_FLAGS
2821
2822# The default C compiler.
2823CC=$lt_CC
2824
2825# Is the compiler the GNU C compiler?
2826with_gcc=$GCC
2827
2828# The linker used to build libraries.
2829LD=$lt_LD
2830
2831# Whether we need hard or soft links.
2832LN_S=$lt_LN_S
2833
2834# A BSD-compatible nm program.
2835NM=$lt_NM
2836
2837# A symbol stripping program
2838STRIP=$STRIP
2839
2840# Used to examine libraries when file_magic_cmd begins "file"
2841MAGIC_CMD=$MAGIC_CMD
2842
2843# Used on cygwin: DLL creation program.
2844DLLTOOL="$DLLTOOL"
2845
2846# Used on cygwin: object dumper.
2847OBJDUMP="$OBJDUMP"
2848
2849# Used on cygwin: assembler.
2850AS="$AS"
2851
2852# The name of the directory that contains temporary libtool files.
2853objdir=$objdir
2854
2855# How to create reloadable object files.
2856reload_flag=$lt_reload_flag
2857reload_cmds=$lt_reload_cmds
2858
2859# How to pass a linker flag through the compiler.
2860wl=$lt_wl
2861
2862# Object file suffix (normally "o").
2863objext="$ac_objext"
2864
2865# Old archive suffix (normally "a").
2866libext="$libext"
2867
2868# Executable file suffix (normally "").
2869exeext="$exeext"
2870
2871# Additional compiler flags for building library objects.
2872pic_flag=$lt_pic_flag
2873pic_mode=$pic_mode
2874
2875# Does compiler simultaneously support -c and -o options?
2876compiler_c_o=$lt_compiler_c_o
2877
2878# Can we write directly to a .lo ?
2879compiler_o_lo=$lt_compiler_o_lo
2880
2881# Must we lock files when doing compilation ?
2882need_locks=$lt_need_locks
2883
2884# Do we need the lib prefix for modules?
2885need_lib_prefix=$need_lib_prefix
2886
2887# Do we need a version for libraries?
2888need_version=$need_version
2889
2890# Whether dlopen is supported.
2891dlopen_support=$enable_dlopen
2892
2893# Whether dlopen of programs is supported.
2894dlopen_self=$enable_dlopen_self
2895
2896# Whether dlopen of statically linked programs is supported.
2897dlopen_self_static=$enable_dlopen_self_static
2898
2899# Compiler flag to prevent dynamic linking.
2900link_static_flag=$lt_link_static_flag
2901
2902# Compiler flag to turn off builtin functions.
2903no_builtin_flag=$lt_no_builtin_flag
2904
2905# Compiler flag to allow reflexive dlopens.
2906export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
2907
2908# Compiler flag to generate shared objects directly from archives.
2909whole_archive_flag_spec=$lt_whole_archive_flag_spec
2910
2911# Compiler flag to generate thread-safe objects.
2912thread_safe_flag_spec=$lt_thread_safe_flag_spec
2913
2914# Library versioning type.
2915version_type=$version_type
2916
2917# Format of library name prefix.
2918libname_spec=$lt_libname_spec
2919
2920# List of archive names.  First name is the real one, the rest are links.
2921# The last name is the one that the linker finds with -lNAME.
2922library_names_spec=$lt_library_names_spec
2923
2924# The coded name of the library, if different from the real name.
2925soname_spec=$lt_soname_spec
2926
2927# Commands used to build and install an old-style archive.
2928RANLIB=$lt_RANLIB
2929old_archive_cmds=$lt_old_archive_cmds
2930old_postinstall_cmds=$lt_old_postinstall_cmds
2931old_postuninstall_cmds=$lt_old_postuninstall_cmds
2932
2933# Create an old-style archive from a shared archive.
2934old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
2935
2936# Create a temporary old-style archive to link instead of a shared archive.
2937old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
2938
2939# Commands used to build and install a shared archive.
2940archive_cmds=$lt_archive_cmds
2941archive_expsym_cmds=$lt_archive_expsym_cmds
2942postinstall_cmds=$lt_postinstall_cmds
2943postuninstall_cmds=$lt_postuninstall_cmds
2944
2945# Commands to strip libraries.
2946old_striplib=$lt_old_striplib
2947striplib=$lt_striplib
2948
2949# Method to check whether dependent libraries are shared objects.
2950deplibs_check_method=$lt_deplibs_check_method
2951
2952# Command to use when deplibs_check_method == file_magic.
2953file_magic_cmd=$lt_file_magic_cmd
2954
2955# Flag that allows shared libraries with undefined symbols to be built.
2956allow_undefined_flag=$lt_allow_undefined_flag
2957
2958# Flag that forces no undefined symbols.
2959no_undefined_flag=$lt_no_undefined_flag
2960
2961# Commands used to finish a libtool library installation in a directory.
2962finish_cmds=$lt_finish_cmds
2963
2964# Same as above, but a single script fragment to be evaled but not shown.
2965finish_eval=$lt_finish_eval
2966
2967# Take the output of nm and produce a listing of raw symbols and C names.
2968global_symbol_pipe=$lt_global_symbol_pipe
2969
2970# Transform the output of nm in a proper C declaration
2971global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
2972
2973# This is the shared library runtime path variable.
2974runpath_var=$runpath_var
2975
2976# This is the shared library path variable.
2977shlibpath_var=$shlibpath_var
2978
2979# Is shlibpath searched before the hard-coded library search path?
2980shlibpath_overrides_runpath=$shlibpath_overrides_runpath
2981
2982# How to hardcode a shared library path into an executable.
2983hardcode_action=$hardcode_action
2984
2985# Whether we should hardcode library paths into libraries.
2986hardcode_into_libs=$hardcode_into_libs
2987
2988# Flag to hardcode \$libdir into a binary during linking.
2989# This must work even if \$libdir does not exist.
2990hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
2991
2992# Whether we need a single -rpath flag with a separated argument.
2993hardcode_libdir_separator=$lt_hardcode_libdir_separator
2994
2995# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
2996# resulting binary.
2997hardcode_direct=$hardcode_direct
2998
2999# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
3000# resulting binary.
3001hardcode_minus_L=$hardcode_minus_L
3002
3003# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
3004# the resulting binary.
3005hardcode_shlibpath_var=$hardcode_shlibpath_var
3006
3007# Variables whose values should be saved in libtool wrapper scripts and
3008# restored at relink time.
3009variables_saved_for_relink="$variables_saved_for_relink"
3010
3011# Whether libtool must link a program against all its dependency libraries.
3012link_all_deplibs=$link_all_deplibs
3013
3014# Compile-time system search path for libraries
3015sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
3016
3017# Run-time system search path for libraries
3018sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
3019
3020# Fix the shell variable \$srcfile for the compiler.
3021fix_srcfile_path="$fix_srcfile_path"
3022
3023# Set to yes if exported symbols are required.
3024always_export_symbols=$always_export_symbols
3025
3026# The commands to list exported symbols.
3027export_symbols_cmds=$lt_export_symbols_cmds
3028
3029# The commands to extract the exported symbol list from a shared archive.
3030extract_expsyms_cmds=$lt_extract_expsyms_cmds
3031
3032# Symbols that should not be listed in the preloaded symbols.
3033exclude_expsyms=$lt_exclude_expsyms
3034
3035# Symbols that must always be exported.
3036include_expsyms=$lt_include_expsyms
3037
3038# ### END LIBTOOL CONFIG
3039
3040__EOF__
3041
3042  case $host_os in
3043  aix3*)
3044    cat <<\EOF >> "${ofile}T"
3045
3046# AIX sometimes has problems with the GCC collect2 program.  For some
3047# reason, if we set the COLLECT_NAMES environment variable, the problems
3048# vanish in a puff of smoke.
3049if test "X${COLLECT_NAMES+set}" != Xset; then
3050  COLLECT_NAMES=
3051  export COLLECT_NAMES
3052fi
3053EOF
3054    ;;
3055  esac
3056
3057  case $host_os in
3058  cygwin* | mingw* | pw32* | os2*)
3059    cat <<'EOF' >> "${ofile}T"
3060      # This is a source program that is used to create dlls on Windows
3061      # Don't remove nor modify the starting and closing comments
3062# /* ltdll.c starts here */
3063# #define WIN32_LEAN_AND_MEAN
3064# #include <windows.h>
3065# #undef WIN32_LEAN_AND_MEAN
3066# #include <stdio.h>
3067#
3068# #ifndef __CYGWIN__
3069# #  ifdef __CYGWIN32__
3070# #    define __CYGWIN__ __CYGWIN32__
3071# #  endif
3072# #endif
3073#
3074# #ifdef __cplusplus
3075# extern "C" {
3076# #endif
3077# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
3078# #ifdef __cplusplus
3079# }
3080# #endif
3081#
3082# #ifdef __CYGWIN__
3083# #include <cygwin/cygwin_dll.h>
3084# DECLARE_CYGWIN_DLL( DllMain );
3085# #endif
3086# HINSTANCE __hDllInstance_base;
3087#
3088# BOOL APIENTRY
3089# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
3090# {
3091#   __hDllInstance_base = hInst;
3092#   return TRUE;
3093# }
3094# /* ltdll.c ends here */
3095        # This is a source program that is used to create import libraries
3096        # on Windows for dlls which lack them. Don't remove nor modify the
3097        # starting and closing comments
3098# /* impgen.c starts here */
3099# /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
3100#
3101#  This file is part of GNU libtool.
3102#
3103#  This program is free software; you can redistribute it and/or modify
3104#  it under the terms of the GNU General Public License as published by
3105#  the Free Software Foundation; either version 2 of the License, or
3106#  (at your option) any later version.
3107#
3108#  This program is distributed in the hope that it will be useful,
3109#  but WITHOUT ANY WARRANTY; without even the implied warranty of
3110#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3111#  GNU General Public License for more details.
3112#
3113#  You should have received a copy of the GNU General Public License
3114#  along with this program; if not, write to the Free Software
3115#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3116#  */
3117#
3118# #include <stdio.h>            /* for printf() */
3119# #include <unistd.h>           /* for open(), lseek(), read() */
3120# #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
3121# #include <string.h>           /* for strdup() */
3122#
3123# /* O_BINARY isn't required (or even defined sometimes) under Unix */
3124# #ifndef O_BINARY
3125# #define O_BINARY 0
3126# #endif
3127#
3128# static unsigned int
3129# pe_get16 (fd, offset)
3130#      int fd;
3131#      int offset;
3132# {
3133#   unsigned char b[2];
3134#   lseek (fd, offset, SEEK_SET);
3135#   read (fd, b, 2);
3136#   return b[0] + (b[1]<<8);
3137# }
3138#
3139# static unsigned int
3140# pe_get32 (fd, offset)
3141#     int fd;
3142#     int offset;
3143# {
3144#   unsigned char b[4];
3145#   lseek (fd, offset, SEEK_SET);
3146#   read (fd, b, 4);
3147#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3148# }
3149#
3150# static unsigned int
3151# pe_as32 (ptr)
3152#      void *ptr;
3153# {
3154#   unsigned char *b = ptr;
3155#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3156# }
3157#
3158# int
3159# main (argc, argv)
3160#     int argc;
3161#     char *argv[];
3162# {
3163#     int dll;
3164#     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
3165#     unsigned long export_rva, export_size, nsections, secptr, expptr;
3166#     unsigned long name_rvas, nexp;
3167#     unsigned char *expdata, *erva;
3168#     char *filename, *dll_name;
3169#
3170#     filename = argv[1];
3171#
3172#     dll = open(filename, O_RDONLY|O_BINARY);
3173#     if (dll < 1)
3174#       return 1;
3175#
3176#     dll_name = filename;
3177#
3178#     for (i=0; filename[i]; i++)
3179#       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
3180#           dll_name = filename + i +1;
3181#
3182#     pe_header_offset = pe_get32 (dll, 0x3c);
3183#     opthdr_ofs = pe_header_offset + 4 + 20;
3184#     num_entries = pe_get32 (dll, opthdr_ofs + 92);
3185#
3186#     if (num_entries < 1) /* no exports */
3187#       return 1;
3188#
3189#     export_rva = pe_get32 (dll, opthdr_ofs + 96);
3190#     export_size = pe_get32 (dll, opthdr_ofs + 100);
3191#     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
3192#     secptr = (pe_header_offset + 4 + 20 +
3193#             pe_get16 (dll, pe_header_offset + 4 + 16));
3194#
3195#     expptr = 0;
3196#     for (i = 0; i < nsections; i++)
3197#     {
3198#       char sname[8];
3199#       unsigned long secptr1 = secptr + 40 * i;
3200#       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
3201#       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
3202#       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
3203#       lseek(dll, secptr1, SEEK_SET);
3204#       read(dll, sname, 8);
3205#       if (vaddr <= export_rva && vaddr+vsize > export_rva)
3206#       {
3207#           expptr = fptr + (export_rva - vaddr);
3208#           if (export_rva + export_size > vaddr + vsize)
3209#               export_size = vsize - (export_rva - vaddr);
3210#           break;
3211#       }
3212#     }
3213#
3214#     expdata = (unsigned char*)malloc(export_size);
3215#     lseek (dll, expptr, SEEK_SET);
3216#     read (dll, expdata, export_size);
3217#     erva = expdata - export_rva;
3218#
3219#     nexp = pe_as32 (expdata+24);
3220#     name_rvas = pe_as32 (expdata+32);
3221#
3222#     printf ("EXPORTS\n");
3223#     for (i = 0; i<nexp; i++)
3224#     {
3225#       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
3226#       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
3227#     }
3228#
3229#     return 0;
3230# }
3231# /* impgen.c ends here */
3232
3233EOF
3234    ;;
3235  esac
3236
3237  # We use sed instead of cat because bash on DJGPP gets confused if
3238  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
3239  # text mode, it properly converts lines to CR/LF.  This bash problem
3240  # is reportedly fixed, but why not run on old versions too?
3241  sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
3242
3243  mv -f "${ofile}T" "$ofile" || \
3244    (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
3245  chmod +x "$ofile"
3246fi
3247
3248])# _LT_AC_LTCONFIG_HACK
3249
3250# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
3251AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
3252
3253# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
3254AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
3255
3256# AC_ENABLE_SHARED - implement the --enable-shared flag
3257# Usage: AC_ENABLE_SHARED[(DEFAULT)]
3258#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3259#   `yes'.
3260AC_DEFUN([AC_ENABLE_SHARED],
3261[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
3262AC_ARG_ENABLE(shared,
3263changequote(<<, >>)dnl
3264<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
3265changequote([, ])dnl
3266[p=${PACKAGE-default}
3267case $enableval in
3268yes) enable_shared=yes ;;
3269no) enable_shared=no ;;
3270*)
3271  enable_shared=no
3272  # Look at the argument we got.  We use all the common list separators.
3273  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3274  for pkg in $enableval; do
3275    if test "X$pkg" = "X$p"; then
3276      enable_shared=yes
3277    fi
3278  done
3279  IFS="$ac_save_ifs"
3280  ;;
3281esac],
3282enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
3283])
3284
3285# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
3286AC_DEFUN([AC_DISABLE_SHARED],
3287[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3288AC_ENABLE_SHARED(no)])
3289
3290# AC_ENABLE_STATIC - implement the --enable-static flag
3291# Usage: AC_ENABLE_STATIC[(DEFAULT)]
3292#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3293#   `yes'.
3294AC_DEFUN([AC_ENABLE_STATIC],
3295[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
3296AC_ARG_ENABLE(static,
3297changequote(<<, >>)dnl
3298<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
3299changequote([, ])dnl
3300[p=${PACKAGE-default}
3301case $enableval in
3302yes) enable_static=yes ;;
3303no) enable_static=no ;;
3304*)
3305  enable_static=no
3306  # Look at the argument we got.  We use all the common list separators.
3307  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3308  for pkg in $enableval; do
3309    if test "X$pkg" = "X$p"; then
3310      enable_static=yes
3311    fi
3312  done
3313  IFS="$ac_save_ifs"
3314  ;;
3315esac],
3316enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
3317])
3318
3319# AC_DISABLE_STATIC - set the default static flag to --disable-static
3320AC_DEFUN([AC_DISABLE_STATIC],
3321[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3322AC_ENABLE_STATIC(no)])
3323
3324
3325# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
3326# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
3327#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3328#   `yes'.
3329AC_DEFUN([AC_ENABLE_FAST_INSTALL],
3330[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
3331AC_ARG_ENABLE(fast-install,
3332changequote(<<, >>)dnl
3333<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
3334changequote([, ])dnl
3335[p=${PACKAGE-default}
3336case $enableval in
3337yes) enable_fast_install=yes ;;
3338no) enable_fast_install=no ;;
3339*)
3340  enable_fast_install=no
3341  # Look at the argument we got.  We use all the common list separators.
3342  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3343  for pkg in $enableval; do
3344    if test "X$pkg" = "X$p"; then
3345      enable_fast_install=yes
3346    fi
3347  done
3348  IFS="$ac_save_ifs"
3349  ;;
3350esac],
3351enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
3352])
3353
3354# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
3355AC_DEFUN([AC_DISABLE_FAST_INSTALL],
3356[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3357AC_ENABLE_FAST_INSTALL(no)])
3358
3359# AC_LIBTOOL_PICMODE - implement the --with-pic flag
3360# Usage: AC_LIBTOOL_PICMODE[(MODE)]
3361#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
3362#   `both'.
3363AC_DEFUN([AC_LIBTOOL_PICMODE],
3364[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3365pic_mode=ifelse($#,1,$1,default)])
3366
3367
3368# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
3369AC_DEFUN([AC_PATH_TOOL_PREFIX],
3370[AC_MSG_CHECKING([for $1])
3371AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3372[case $MAGIC_CMD in
3373  /*)
3374  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3375  ;;
3376  ?:/*)
3377  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
3378  ;;
3379  *)
3380  ac_save_MAGIC_CMD="$MAGIC_CMD"
3381  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3382dnl $ac_dummy forces splitting on constant user-supplied paths.
3383dnl POSIX.2 word splitting is done only on the output of word expansions,
3384dnl not every word.  This closes a longstanding sh security hole.
3385  ac_dummy="ifelse([$2], , $PATH, [$2])"
3386  for ac_dir in $ac_dummy; do
3387    test -z "$ac_dir" && ac_dir=.
3388    if test -f $ac_dir/$1; then
3389      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3390      if test -n "$file_magic_test_file"; then
3391        case $deplibs_check_method in
3392        "file_magic "*)
3393          file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3394          MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3395          if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3396            egrep "$file_magic_regex" > /dev/null; then
3397            :
3398          else
3399            cat <<EOF 1>&2
3400
3401*** Warning: the command libtool uses to detect shared libraries,
3402*** $file_magic_cmd, produces output that libtool cannot recognize.
3403*** The result is that libtool may fail to recognize shared libraries
3404*** as such.  This will affect the creation of libtool libraries that
3405*** depend on shared libraries, but programs linked with such libtool
3406*** libraries will work regardless of this problem.  Nevertheless, you
3407*** may want to report the problem to your system manager and/or to
3408*** bug-libtool@gnu.org
3409
3410EOF
3411          fi ;;
3412        esac
3413      fi
3414      break
3415    fi
3416  done
3417  IFS="$ac_save_ifs"
3418  MAGIC_CMD="$ac_save_MAGIC_CMD"
3419  ;;
3420esac])
3421MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3422if test -n "$MAGIC_CMD"; then
3423  AC_MSG_RESULT($MAGIC_CMD)
3424else
3425  AC_MSG_RESULT(no)
3426fi
3427])
3428
3429
3430# AC_PATH_MAGIC - find a file program which can recognise a shared library
3431AC_DEFUN([AC_PATH_MAGIC],
3432[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
3433AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
3434if test -z "$lt_cv_path_MAGIC_CMD"; then
3435  if test -n "$ac_tool_prefix"; then
3436    AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
3437  else
3438    MAGIC_CMD=:
3439  fi
3440fi
3441])
3442
3443
3444# AC_PROG_LD - find the path to the GNU or non-GNU linker
3445AC_DEFUN([AC_PROG_LD],
3446[AC_ARG_WITH(gnu-ld,
3447[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
3448test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
3449AC_REQUIRE([AC_PROG_CC])dnl
3450AC_REQUIRE([AC_CANONICAL_HOST])dnl
3451AC_REQUIRE([AC_CANONICAL_BUILD])dnl
3452ac_prog=ld
3453if test "$GCC" = yes; then
3454  # Check if gcc -print-prog-name=ld gives a path.
3455  AC_MSG_CHECKING([for ld used by GCC])
3456  case $host in
3457  *-*-mingw*)
3458    # gcc leaves a trailing carriage return which upsets mingw
3459    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3460  *)
3461    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3462  esac
3463  case $ac_prog in
3464    # Accept absolute paths.
3465    [[\\/]* | [A-Za-z]:[\\/]*)]
3466      [re_direlt='/[^/][^/]*/\.\./']
3467      # Canonicalize the path of ld
3468      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3469      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3470        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3471      done
3472      test -z "$LD" && LD="$ac_prog"
3473      ;;
3474  "")
3475    # If it fails, then pretend we aren't using GCC.
3476    ac_prog=ld
3477    ;;
3478  *)
3479    # If it is relative, then search for the first ld in PATH.
3480    with_gnu_ld=unknown
3481    ;;
3482  esac
3483elif test "$with_gnu_ld" = yes; then
3484  AC_MSG_CHECKING([for GNU ld])
3485else
3486  AC_MSG_CHECKING([for non-GNU ld])
3487fi
3488AC_CACHE_VAL(lt_cv_path_LD,
3489[if test -z "$LD"; then
3490  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3491  for ac_dir in $PATH; do
3492    test -z "$ac_dir" && ac_dir=.
3493    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3494      lt_cv_path_LD="$ac_dir/$ac_prog"
3495      # Check to see if the program is GNU ld.  I'd rather use --version,
3496      # but apparently some GNU ld's only accept -v.
3497      # Break only if it was the GNU/non-GNU ld that we prefer.
3498      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3499        test "$with_gnu_ld" != no && break
3500      else
3501        test "$with_gnu_ld" != yes && break
3502      fi
3503    fi
3504  done
3505  IFS="$ac_save_ifs"
3506else
3507  lt_cv_path_LD="$LD" # Let the user override the test with a path.
3508fi])
3509LD="$lt_cv_path_LD"
3510if test -n "$LD"; then
3511  AC_MSG_RESULT($LD)
3512else
3513  AC_MSG_RESULT(no)
3514fi
3515test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3516AC_PROG_LD_GNU
3517])
3518
3519# AC_PROG_LD_GNU -
3520AC_DEFUN([AC_PROG_LD_GNU],
3521[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3522[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
3523if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3524  lt_cv_prog_gnu_ld=yes
3525else
3526  lt_cv_prog_gnu_ld=no
3527fi])
3528with_gnu_ld=$lt_cv_prog_gnu_ld
3529])
3530
3531# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
3532#   -- PORTME Some linkers may need a different reload flag.
3533AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
3534[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
3535[lt_cv_ld_reload_flag='-r'])
3536reload_flag=$lt_cv_ld_reload_flag
3537test -n "$reload_flag" && reload_flag=" $reload_flag"
3538])
3539
3540# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
3541#  -- PORTME fill in with the dynamic library characteristics
3542AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
3543[AC_CACHE_CHECK([how to recognise dependant libraries],
3544lt_cv_deplibs_check_method,
3545[lt_cv_file_magic_cmd='$MAGIC_CMD'
3546lt_cv_file_magic_test_file=
3547lt_cv_deplibs_check_method='unknown'
3548# Need to set the preceding variable on all platforms that support
3549# interlibrary dependencies.
3550# 'none' -- dependencies not supported.
3551# `unknown' -- same as none, but documents that we really don't know.
3552# 'pass_all' -- all dependencies passed with no checks.
3553# 'test_compile' -- check by making test program.
3554# ['file_magic [regex]'] -- check by looking for files in library path
3555# which responds to the $file_magic_cmd with a given egrep regex.
3556# If you have `file' or equivalent on your system and you're not sure
3557# whether `pass_all' will *always* work, you probably want this one.
3558
3559case $host_os in
3560aix4* | aix5*)
3561  lt_cv_deplibs_check_method=pass_all
3562  ;;
3563
3564beos*)
3565  lt_cv_deplibs_check_method=pass_all
3566  ;;
3567
3568bsdi4*)
3569  [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)']
3570  lt_cv_file_magic_cmd='/usr/bin/file -L'
3571  lt_cv_file_magic_test_file=/shlib/libc.so
3572  ;;
3573
3574cygwin* | mingw* | pw32*)
3575  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3576  lt_cv_file_magic_cmd='$OBJDUMP -f'
3577  ;;
3578
3579darwin* | rhapsody*)
3580  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
3581  lt_cv_file_magic_cmd='/usr/bin/file -L'
3582  case "$host_os" in
3583  rhapsody* | darwin1.[012])
3584    lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
3585    ;;
3586  *) # Darwin 1.3 on
3587    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
3588    ;;
3589  esac
3590  ;;
3591
3592freebsd*)
3593  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3594    case $host_cpu in
3595    i*86 )
3596      # Not sure whether the presence of OpenBSD here was a mistake.
3597      # Let's accept both of them until this is cleared up.
3598      [lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library']
3599      lt_cv_file_magic_cmd=/usr/bin/file
3600      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3601      ;;
3602    esac
3603  else
3604    lt_cv_deplibs_check_method=pass_all
3605  fi
3606  ;;
3607
3608gnu*)
3609  lt_cv_deplibs_check_method=pass_all
3610  ;;
3611
3612hpux10.20*|hpux11*)
3613  [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library']
3614  lt_cv_file_magic_cmd=/usr/bin/file
3615  lt_cv_file_magic_test_file=/usr/lib/libc.sl
3616  ;;
3617
3618irix5* | irix6*)
3619  case $host_os in
3620  irix5*)
3621    # this will be overridden with pass_all, but let us keep it just in case
3622    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3623    ;;
3624  *)
3625    case $LD in
3626    *-32|*"-32 ") libmagic=32-bit;;
3627    *-n32|*"-n32 ") libmagic=N32;;
3628    *-64|*"-64 ") libmagic=64-bit;;
3629    *) libmagic=never-match;;
3630    esac
3631    # this will be overridden with pass_all, but let us keep it just in case
3632    [lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"]
3633    ;;
3634  esac
3635  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3636  lt_cv_deplibs_check_method=pass_all
3637  ;;
3638
3639# This must be Linux ELF.
3640linux-gnu*)
3641  case $host_cpu in
3642  alpha* | i*86 | powerpc* | sparc* | ia64* )
3643    lt_cv_deplibs_check_method=pass_all ;;
3644  *)
3645    # glibc up to 2.1.1 does not perform some relocations on ARM
3646    [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;]
3647  esac
3648  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3649  ;;
3650
3651netbsd*)
3652  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3653    [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
3654  else
3655    [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$']
3656  fi
3657  ;;
3658
3659newos6*)
3660  [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
3661  lt_cv_file_magic_cmd=/usr/bin/file
3662  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3663  ;;
3664
3665osf3* | osf4* | osf5*)
3666  # this will be overridden with pass_all, but let us keep it just in case
3667  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3668  lt_cv_file_magic_test_file=/shlib/libc.so
3669  lt_cv_deplibs_check_method=pass_all
3670  ;;
3671
3672sco3.2v5*)
3673  lt_cv_deplibs_check_method=pass_all
3674  ;;
3675
3676solaris*)
3677  lt_cv_deplibs_check_method=pass_all
3678  lt_cv_file_magic_test_file=/lib/libc.so
3679  ;;
3680
3681[sysv5uw[78]* | sysv4*uw2*)]
3682  lt_cv_deplibs_check_method=pass_all
3683  ;;
3684
3685sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3686  case $host_vendor in
3687  motorola)
3688    [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]']
3689    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3690    ;;
3691  ncr)
3692    lt_cv_deplibs_check_method=pass_all
3693    ;;
3694  sequent)
3695    lt_cv_file_magic_cmd='/bin/file'
3696    [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )']
3697    ;;
3698  sni)
3699    lt_cv_file_magic_cmd='/bin/file'
3700    [lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"]
3701    lt_cv_file_magic_test_file=/lib/libc.so
3702    ;;
3703  esac
3704  ;;
3705esac
3706])
3707file_magic_cmd=$lt_cv_file_magic_cmd
3708deplibs_check_method=$lt_cv_deplibs_check_method
3709])
3710
3711
3712# AC_PROG_NM - find the path to a BSD-compatible name lister
3713AC_DEFUN([AC_PROG_NM],
3714[AC_MSG_CHECKING([for BSD-compatible nm])
3715AC_CACHE_VAL(lt_cv_path_NM,
3716[if test -n "$NM"; then
3717  # Let the user override the test.
3718  lt_cv_path_NM="$NM"
3719else
3720  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3721  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3722    test -z "$ac_dir" && ac_dir=.
3723    tmp_nm=$ac_dir/${ac_tool_prefix}nm
3724    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
3725      # Check to see if the nm accepts a BSD-compat flag.
3726      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3727      #   nm: unknown option "B" ignored
3728      # Tru64's nm complains that /dev/null is an invalid object file
3729      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
3730        lt_cv_path_NM="$tmp_nm -B"
3731        break
3732      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3733        lt_cv_path_NM="$tmp_nm -p"
3734        break
3735      else
3736        lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3737        continue # so that we can try to find one that supports BSD flags
3738      fi
3739    fi
3740  done
3741  IFS="$ac_save_ifs"
3742  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3743fi])
3744NM="$lt_cv_path_NM"
3745AC_MSG_RESULT([$NM])
3746])
3747
3748# AC_CHECK_LIBM - check for math library
3749AC_DEFUN([AC_CHECK_LIBM],
3750[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3751LIBM=
3752case $host in
3753*-*-beos* | *-*-cygwin* | *-*-pw32*)
3754  # These system don't have libm
3755  ;;
3756*-ncr-sysv4.3*)
3757  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3758  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
3759  ;;
3760*)
3761  AC_CHECK_LIB(m, main, LIBM="-lm")
3762  ;;
3763esac
3764])
3765
3766# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
3767# the libltdl convenience library and INCLTDL to the include flags for
3768# the libltdl header and adds --enable-ltdl-convenience to the
3769# configure arguments.  Note that LIBLTDL and INCLTDL are not
3770# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
3771# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
3772# with '${top_builddir}/' and INCLTDL will be prefixed with
3773# '${top_srcdir}/' (note the single quotes!).  If your package is not
3774# flat and you're not using automake, define top_builddir and
3775# top_srcdir appropriately in the Makefiles.
3776AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
3777[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3778  case $enable_ltdl_convenience in
3779  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
3780  "") enable_ltdl_convenience=yes
3781      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
3782  esac
3783  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
3784  INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3785])
3786
3787# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
3788# the libltdl installable library and INCLTDL to the include flags for
3789# the libltdl header and adds --enable-ltdl-install to the configure
3790# arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
3791# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
3792# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
3793# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
3794# with '${top_srcdir}/' (note the single quotes!).  If your package is
3795# not flat and you're not using automake, define top_builddir and
3796# top_srcdir appropriately in the Makefiles.
3797# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
3798AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
3799[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3800  AC_CHECK_LIB(ltdl, main,
3801  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
3802  [if test x"$enable_ltdl_install" = xno; then
3803     AC_MSG_WARN([libltdl not installed, but installation disabled])
3804   else
3805     enable_ltdl_install=yes
3806   fi
3807  ])
3808  if test x"$enable_ltdl_install" = x"yes"; then
3809    ac_configure_args="$ac_configure_args --enable-ltdl-install"
3810    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
3811    INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3812  else
3813    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
3814    LIBLTDL="-lltdl"
3815    INCLTDL=
3816  fi
3817])
3818
3819# old names
3820AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
3821AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
3822AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
3823AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
3824AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
3825AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
3826AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
3827
3828# This is just to silence aclocal about the macro not being used
3829ifelse([AC_DISABLE_FAST_INSTALL])
3830
3831# Add --enable-maintainer-mode option to configure.
3832# From Jim Meyering
3833
3834# serial 1
3835
3836AC_DEFUN([AM_MAINTAINER_MODE],
3837[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
3838  dnl maintainer-mode is disabled by default
3839  AC_ARG_ENABLE(maintainer-mode,
3840[  --enable-maintainer-mode enable make rules and dependencies not useful
3841                          (and sometimes confusing) to the casual installer],
3842      USE_MAINTAINER_MODE=$enableval,
3843      USE_MAINTAINER_MODE=no)
3844  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
3845  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
3846  MAINT=$MAINTAINER_MODE_TRUE
3847  AC_SUBST(MAINT)dnl
3848]
3849)
3850
3851# Configure paths for GTK+
3852# Owen Taylor     97-11-3
3853
3854dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
3855dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
3856dnl
3857AC_DEFUN(AM_PATH_GTK,
3858[dnl
3859dnl Get the cflags and libraries from the gtk-config script
3860dnl
3861AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
3862            gtk_config_prefix="$withval", gtk_config_prefix="")
3863AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
3864            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
3865AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
3866                    , enable_gtktest=yes)
3867
3868  for module in . $4
3869  do
3870      case "$module" in
3871         gthread)
3872             gtk_config_args="$gtk_config_args gthread"
3873         ;;
3874      esac
3875  done
3876
3877  if test x$gtk_config_exec_prefix != x ; then
3878     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
3879     if test x${GTK_CONFIG+set} != xset ; then
3880        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
3881     fi
3882  fi
3883  if test x$gtk_config_prefix != x ; then
3884     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
3885     if test x${GTK_CONFIG+set} != xset ; then
3886        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
3887     fi
3888  fi
3889
3890  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
3891  min_gtk_version=ifelse([$1], ,0.99.7,$1)
3892  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
3893  no_gtk=""
3894  if test "$GTK_CONFIG" = "no" ; then
3895    no_gtk=yes
3896  else
3897    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
3898    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
3899    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
3900           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
3901    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
3902           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
3903    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
3904           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
3905    if test "x$enable_gtktest" = "xyes" ; then
3906      ac_save_CFLAGS="$CFLAGS"
3907      ac_save_LIBS="$LIBS"
3908      CFLAGS="$CFLAGS $GTK_CFLAGS"
3909      LIBS="$GTK_LIBS $LIBS"
3910dnl
3911dnl Now check if the installed GTK is sufficiently new. (Also sanity
3912dnl checks the results of gtk-config to some extent
3913dnl
3914      rm -f conf.gtktest
3915      AC_TRY_RUN([
3916#include <gtk/gtk.h>
3917#include <stdio.h>
3918#include <stdlib.h>
3919
3920int
3921main ()
3922{
3923  int major, minor, micro;
3924  char *tmp_version;
3925
3926  system ("touch conf.gtktest");
3927
3928  /* HP/UX 9 (%@#!) writes to sscanf strings */
3929  tmp_version = g_strdup("$min_gtk_version");
3930  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
3931     printf("%s, bad version string\n", "$min_gtk_version");
3932     exit(1);
3933   }
3934
3935  if ((gtk_major_version != $gtk_config_major_version) ||
3936      (gtk_minor_version != $gtk_config_minor_version) ||
3937      (gtk_micro_version != $gtk_config_micro_version))
3938    {
3939      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
3940             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
3941             gtk_major_version, gtk_minor_version, gtk_micro_version);
3942      printf ("*** was found! If gtk-config was correct, then it is best\n");
3943      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
3944      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
3945      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
3946      printf("*** required on your system.\n");
3947      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
3948      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
3949      printf("*** before re-running configure\n");
3950    }
3951#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
3952  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
3953           (gtk_minor_version != GTK_MINOR_VERSION) ||
3954           (gtk_micro_version != GTK_MICRO_VERSION))
3955    {
3956      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
3957             GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
3958      printf("*** library (version %d.%d.%d)\n",
3959             gtk_major_version, gtk_minor_version, gtk_micro_version);
3960    }
3961#endif /* defined (GTK_MAJOR_VERSION) ... */
3962  else
3963    {
3964      if ((gtk_major_version > major) ||
3965        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
3966        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
3967      {
3968        return 0;
3969       }
3970     else
3971      {
3972        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
3973               gtk_major_version, gtk_minor_version, gtk_micro_version);
3974        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
3975               major, minor, micro);
3976        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
3977        printf("***\n");
3978        printf("*** If you have already installed a sufficiently new version, this error\n");
3979        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
3980        printf("*** being found. The easiest way to fix this is to remove the old version\n");
3981        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
3982        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
3983        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
3984        printf("*** so that the correct libraries are found at run-time))\n");
3985      }
3986    }
3987  return 1;
3988}
3989],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
3990       CFLAGS="$ac_save_CFLAGS"
3991       LIBS="$ac_save_LIBS"
3992     fi
3993  fi
3994  if test "x$no_gtk" = x ; then
3995     AC_MSG_RESULT(yes)
3996     ifelse([$2], , :, [$2])     
3997  else
3998     AC_MSG_RESULT(no)
3999     if test "$GTK_CONFIG" = "no" ; then
4000       echo "*** The gtk-config script installed by GTK could not be found"
4001       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
4002       echo "*** your path, or set the GTK_CONFIG environment variable to the"
4003       echo "*** full path to gtk-config."
4004     else
4005       if test -f conf.gtktest ; then
4006        :
4007       else
4008          echo "*** Could not run GTK test program, checking why..."
4009          CFLAGS="$CFLAGS $GTK_CFLAGS"
4010          LIBS="$LIBS $GTK_LIBS"
4011          AC_TRY_LINK([
4012#include <gtk/gtk.h>
4013#include <stdio.h>
4014],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
4015        [ echo "*** The test program compiled, but did not run. This usually means"
4016          echo "*** that the run-time linker is not finding GTK or finding the wrong"
4017          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
4018          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
4019          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
4020          echo "*** is required on your system"
4021          echo "***"
4022          echo "*** If you have an old version installed, it is best to remove it, although"
4023          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
4024          echo "***"
4025          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
4026          echo "*** came with the system with the command"
4027          echo "***"
4028          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
4029        [ echo "*** The test program failed to compile or link. See the file config.log for the"
4030          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
4031          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
4032          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
4033          CFLAGS="$ac_save_CFLAGS"
4034          LIBS="$ac_save_LIBS"
4035       fi
4036     fi
4037     GTK_CFLAGS=""
4038     GTK_LIBS=""
4039     ifelse([$3], , :, [$3])
4040  fi
4041  AC_SUBST(GTK_CFLAGS)
4042  AC_SUBST(GTK_LIBS)
4043  rm -f conf.gtktest
4044])
4045
Note: See TracBrowser for help on using the repository browser.