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