source: trunk/third/pango/aclocal.m4 @ 18248

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