source: trunk/third/gtk-thinice-engine/aclocal.m4 @ 18878

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