source: trunk/third/libgnome/aclocal.m4 @ 18320

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