source: trunk/third/evolution/aclocal.m4 @ 17397

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