source: trunk/third/GConf2/aclocal.m4 @ 18568

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