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