source: trunk/third/gnome-core/aclocal.m4 @ 17152

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