source: trunk/third/bonobo-activation/aclocal.m4 @ 18563

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