source: trunk/third/gnome-desktop/aclocal.m4 @ 18622

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