1#! /bin/sh
2
3# ltconfig - Create a system-specific libtool.
4# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
5# Free Software Foundation, Inc.
6# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7#
8# This file is free software; you can redistribute it and/or modify it
9# under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16# General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program; if not, write to the Free Software
20# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21#
22# As a special exception to the GNU General Public License, if you
23# distribute this file as part of a program that contains a
24# configuration script generated by Autoconf, you may include it under
25# the same distribution terms that you use for the rest of that program.
26
27# A lot of this script is taken from autoconf-2.10.
28
29# Check that we are running under the correct shell.
30SHELL=${CONFIG_SHELL-/bin/sh}
31echo=echo
32if test "X$1" = X--no-reexec; then
33  # Discard the --no-reexec flag, and continue.
34  shift
35elif test "X$1" = X--fallback-echo; then
36  # Avoid inline document here, it may be left over
37  :
38elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
39  # Yippee, $echo works!
40  :
41else
42  # Restart under the correct shell.
43  exec "$SHELL" "$0" --no-reexec ${1+"$@"}
44fi
45
46if test "X$1" = X--fallback-echo; then
47  # used as fallback echo
48  shift
49  cat <<EOF
50$*
51EOF
52  exit 0
53fi
54
55# Find the correct PATH separator.  Usually this is `:', but
56# DJGPP uses `;' like DOS.
57if test "X${PATH_SEPARATOR+set}" != Xset; then
58  UNAME=${UNAME-`uname 2>/dev/null`}
59  case X$UNAME in
60    *-DOS) PATH_SEPARATOR=';' ;;
61    *)     PATH_SEPARATOR=':' ;;
62  esac
63fi
64
65# The HP-UX ksh and POSIX shell print the target directory to stdout
66# if CDPATH is set.
67if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
68
69if test "X${echo_test_string+set}" != Xset; then
70  # find a string as large as possible, as long as the shell can cope with it
71  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
72    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
73    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
74       echo_test_string="`eval $cmd`" &&
75       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then
76      break
77    fi
78  done
79fi
80
81if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
82   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
83   test "X$echo_testing_string" = "X$echo_test_string"; then
84  :
85else
86  # The Solaris, AIX, and Digital Unix default echo programs unquote
87  # backslashes.  This makes it impossible to quote backslashes using
88  #   echo "$something" | sed 's/\\/\\\\/g'
89  #
90  # So, first we look for a working echo in the user's PATH.
91
92  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
93  for dir in $PATH /usr/ucb; do
94    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
95       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
96       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
97       test "X$echo_testing_string" = "X$echo_test_string"; then
98      echo="$dir/echo"
99      break
100    fi
101  done
102  IFS="$save_ifs"
103
104  if test "X$echo" = Xecho; then
105    # We didn't find a better echo, so look for alternatives.
106    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
107       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
108       test "X$echo_testing_string" = "X$echo_test_string"; then
109      # This shell has a builtin print -r that does the trick.
110      echo='print -r'
111    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
112	 test "X$CONFIG_SHELL" != X/bin/ksh; then
113      # If we have ksh, try running ltconfig again with it.
114      ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
115      export ORIGINAL_CONFIG_SHELL
116      CONFIG_SHELL=/bin/ksh
117      export CONFIG_SHELL
118      exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
119    else
120      # Try using printf.
121      echo='printf %s\n'
122      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
123	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
124	 test "X$echo_testing_string" = "X$echo_test_string"; then
125	# Cool, printf works
126	:
127      elif echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` &&
128	   test "X$echo_testing_string" = 'X\t' &&
129	   echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
130	   test "X$echo_testing_string" = "X$echo_test_string"; then
131	CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL"
132	export CONFIG_SHELL
133	SHELL="$CONFIG_SHELL"
134	export SHELL
135	echo="$CONFIG_SHELL $0 --fallback-echo"
136      elif echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` &&
137	   test "X$echo_testing_string" = 'X\t' &&
138	   echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
139	   test "X$echo_testing_string" = "X$echo_test_string"; then
140	echo="$CONFIG_SHELL $0 --fallback-echo"
141      else
142	# maybe with a smaller string...
143	prev=:
144
145	for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
146	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then
147	    break
148	  fi
149	  prev="$cmd"
150	done
151
152	if test "$prev" != 'sed 50q "$0"'; then
153	  echo_test_string=`eval $prev`
154	  
155	  export echo_test_string
156	  exec "${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}}" "$0" ${1+"$@"}
157	else
158	  # Oops.  We lost completely, so just stick with echo.
159	  echo=echo
160	fi
161      fi
162    fi
163  fi
164fi
165
166# Sed substitution that helps us do robust quoting.  It backslashifies
167# metacharacters that are still active within double-quoted strings.
168Xsed='sed -e s/^X//'
169sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
170
171# Same as above, but do not quote variable references.
172double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
173
174# Sed substitution to delay expansion of an escaped shell variable in a
175# double_quote_subst'ed string.
176delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
177
178# The name of this program.
179progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
180
181# Constants:
182PROGRAM=ltconfig
183PACKAGE=libtool
184VERSION=1.4a-GCC3.0
185TIMESTAMP=" (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes)"
186ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
187ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
188rm="rm -f"
189
190help="Try \`$progname --help' for more information."
191
192# Global variables:
193default_ofile=libtool
194can_build_shared=yes
195enable_shared=yes
196# All known linkers require a `.a' archive for static linking (except M$VC,
197# which needs '.lib').
198enable_static=yes
199enable_fast_install=yes
200enable_dlopen=unknown
201enable_win32_dll=no
202pic_mode=default
203ltmain=
204silent=
205srcdir=
206ac_config_guess=
207ac_config_sub=
208host=
209build=NONE
210nonopt=NONE
211ofile="$default_ofile"
212verify_host=yes
213tagname=
214with_gcc=no
215with_gnu_ld=no
216need_locks=yes
217ac_ext=c
218libext=a
219cache_file=
220max_cmd_len=
221
222## Dependencies to place before and after the object being linked:
223predep_objects=
224postdep_objects=
225predeps=
226postdeps=
227compiler_lib_search_path=
228
229## Link characteristics:
230allow_undefined_flag=
231no_undefined_flag=
232need_lib_prefix=unknown
233need_version=unknown
234# when you set need_version to no, make sure it does not cause -set_version
235# flags to be left without arguments
236archive_cmds=
237archive_expsym_cmds=
238old_archive_from_new_cmds=
239old_archive_from_expsyms_cmds=
240striplib=
241old_striplib=
242export_dynamic_flag_spec=
243whole_archive_flag_spec=
244thread_safe_flag_spec=
245hardcode_into_libs=no
246hardcode_libdir_flag_spec=
247hardcode_libdir_separator=
248hardcode_direct=no
249hardcode_minus_L=no
250hardcode_shlibpath_var=unsupported
251runpath_var=
252link_all_deplibs=unknown
253always_export_symbols=no
254export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
255# include_expsyms should be a list of space-separated symbols to be *always*
256# included in the symbol list
257include_expsyms=
258# exclude_expsyms can be an egrep regular expression of symbols to exclude
259# it will be wrapped by ` (' and `)$', so one must not match beginning or
260# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
261# as well as any symbol that contains `d'.
262exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
263# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
264# platforms (ab)use it in PIC code, but their linkers get confused if
265# the symbol is explicitly referenced.  Since portable code cannot
266# rely on this symbol name, it's probably fine to never include it in
267# preloaded symbol tables.
268extract_expsyms_cmds=
269
270## Tools:
271old_AR="$AR"
272old_AR_FLAGS="$AR_FLAGS"
273old_CC="$CC"
274old_CFLAGS="$CFLAGS"
275old_CPPFLAGS="$CPPFLAGS"
276old_LDFLAGS="$LDFLAGS"
277old_LIBS="$LIBS"
278old_MAGIC_CMD="$MAGIC_CMD"
279old_LD="$LD"
280old_LN_S="$LN_S"
281old_LTCC="$LTCC"
282old_NM="$NM"
283old_RANLIB="$RANLIB"
284old_STRIP="$STRIP"
285old_AS="$AS"
286old_DLLTOOL="$DLLTOOL"
287old_OBJDUMP="$OBJDUMP"
288old_OBJEXT="$OBJEXT"
289old_EXEEXT="$EXEEXT"
290old_reload_flag="$reload_flag"
291old_deplibs_check_method="$deplibs_check_method"
292old_file_magic_cmd="$file_magic_cmd"
293
294# Parse the command line options.
295args=
296prev=
297for option
298do
299  case $option in
300  -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
301  *) optarg= ;;
302  esac
303
304  # If the previous option needs an argument, assign it.
305  if test -n "$prev"; then
306    eval "$prev=\$option"
307    prev=
308    continue
309  fi
310
311  case $option in
312  --help) cat <<EOM
313Usage: $progname [OPTION]... LTMAIN [HOST]
314
315Generate a system-specific libtool script.
316
317    --build                configure for building on BUILD [BUILD=HOST]
318    --debug                enable verbose shell tracing
319    --disable-shared       do not build shared libraries
320    --disable-static       do not build static libraries
321    --disable-fast-install do not optimize for fast installation
322    --enable-dlopen        enable dlopen support
323    --enable-win32-dll     enable building dlls on win32 hosts
324    --help                 display this help and exit
325    --no-verify            do not verify that HOST is a valid host type
326-o, --output=FILE          specify the output file [default=$default_ofile]
327    --quiet                same as \`--silent'
328    --silent               do not print informational messages
329    --srcdir=DIR           find \`config.guess' in DIR
330    --version              output version information and exit
331    --add-tag=TAG          append an alternate configuration
332    --with-gcc             assume that the GNU C compiler will be used
333    --with-gnu-ld          assume that the C compiler uses the GNU linker
334    --prefer-pic           try to use only PIC objects
335    --prefer-non-pic       try to use only non-PIC objects
336    --disable-lock         disable file locking
337    --cache-file=FILE      configure cache file
338
339LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
340that provides basic libtool functionality.
341
342HOST is the canonical host system name [default=guessed].
343EOM
344  exit 0
345  ;;
346
347  --build) prev=build ;;
348  --build=*) build="$optarg" ;;
349
350  --debug)
351    echo "$progname: enabling shell trace mode"
352    set -x
353    ;;
354
355  --disable-shared) enable_shared=no ;;
356
357  --disable-static) enable_static=no ;;
358
359  --disable-fast-install) enable_fast_install=no ;;
360
361  --enable-dlopen) enable_dlopen=yes ;;
362
363  --enable-win32-dll) enable_win32_dll=yes ;;
364
365  --quiet | --silent) silent=yes ;;
366
367  --srcdir) prev=srcdir ;;
368  --srcdir=*) srcdir="$optarg" ;;
369
370  --no-verify) verify_host=no ;;
371
372  --output | -o) prev=ofile ;;
373  --output=*) ofile="$optarg" ;;
374
375  --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
376
377  --add-tag) prev=tagname ;;
378  --add-tag=*) tagname="$optarg" ;;
379
380  --with-gcc) with_gcc=yes ;;
381  --with-gnu-ld) with_gnu_ld=yes ;;
382
383  --prefer-pic) pic_mode=yes ;;
384  --prefer-non-pic) pic_mode=no ;;
385
386  --disable-lock) need_locks=no ;;
387
388  --cache-file=*) cache_file="$optarg" ;;
389
390  -*)
391    echo "$progname: unrecognized option \`$option'" 1>&2
392    echo "$help" 1>&2
393    exit 1
394    ;;
395
396  *)
397    if test -z "$ltmain"; then
398      ltmain="$option"
399    elif test -z "$host"; then
400# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
401#      if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
402#        echo "$progname: warning \`$option' is not a valid host type" 1>&2
403#      fi
404      host="$option"
405    else
406      echo "$progname: too many arguments" 1>&2
407      echo "$help" 1>&2
408      exit 1
409    fi ;;
410  esac
411done
412
413if test -z "$ltmain"; then
414  echo "$progname: you must specify a LTMAIN file" 1>&2
415  echo "$help" 1>&2
416  exit 1
417fi
418
419if test ! -f "$ltmain"; then
420  echo "$progname: \`$ltmain' does not exist" 1>&2
421  echo "$help" 1>&2
422  exit 1
423fi
424
425if test -n "$tagname"; then
426  # Check whether tagname contains only valid characters
427  case `$echo "X$tagname" | $Xsed -e 's/[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]//g'` in
428  "") ;;
429  *)
430    echo "$progname: invalid tag name: $tagname" 1>&2
431    exit 1
432    ;;
433  esac
434
435  if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$ofile" > /dev/null; then
436    echo "$progname: tag name $tagname already exists" 1>&2
437    exit 1
438  fi
439
440  if test ! -f "$ofile"; then
441    echo "$progname: warning: output file \`$ofile' does not exist" 1>&2
442  fi
443
444  if test -z "$LTCC"; then
445    eval "`$SHELL $ofile --config | grep '^LTCC='`"
446    if test -z "$LTCC"; then
447      echo "$progname: warning: output file \`$ofile' does not look like a libtool script" 1>&2
448    else
449      echo "$progname: warning: using \`LTCC=$LTCC', extracted from \`$ofile'" 1>&2
450    fi
451  fi
452fi
453
454# Quote any args containing shell metacharacters.
455ltconfig_args=
456for arg
457do
458  case $arg in
459  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
460  ltconfig_args="$ltconfig_args '$arg'" ;;
461  *) ltconfig_args="$ltconfig_args $arg" ;;
462  esac
463done
464
465# A relevant subset of AC_INIT.
466
467# File descriptor usage:
468# 0 standard input
469# 1 file creation
470# 2 errors and warnings
471# 3 some systems may open it to /dev/tty
472# 4 used on the Kubota Titan
473# 5 compiler messages saved in config.log
474# 6 checking for... messages and results
475if test "$silent" = yes; then
476  exec 6>/dev/null
477else
478  exec 6>&1
479fi
480exec 5>>./config.log
481
482# NLS nuisances.
483# Only set LANG and LC_ALL to C if already set.
484# These must not be set unconditionally because not all systems understand
485# e.g. LANG=C (notably SCO).
486if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi
487if test "X${LANG+set}"   = Xset; then LANG=C;   export LANG;   fi
488
489if test -n "$cache_file" && test -r "$cache_file" && test -f "$cache_file"; then
490  echo "loading cache $cache_file within ltconfig"
491  . $cache_file
492fi
493
494if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
495  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
496  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
497    ac_n= ac_c='
498' ac_t='	'
499  else
500    ac_n=-n ac_c= ac_t=
501  fi
502else
503  ac_n= ac_c='\c' ac_t=
504fi
505
506if test -z "$srcdir"; then
507  # Assume the source directory is the same one as the path to LTMAIN.
508  srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
509  test "$srcdir" = "$ltmain" && srcdir=.
510fi
511
512trap "$rm conftest*; exit 1" 1 2 15
513if test "$verify_host" = yes; then
514  # Check for config.guess and config.sub.
515  ac_aux_dir=
516  for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
517    if test -f $ac_dir/config.guess; then
518      ac_aux_dir=$ac_dir
519      break
520    fi
521  done
522  if test -z "$ac_aux_dir"; then
523    echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
524    echo "$help" 1>&2
525    exit 1
526  fi
527  ac_config_guess=$ac_aux_dir/config.guess
528  ac_config_sub=$ac_aux_dir/config.sub
529
530  # Make sure we can run config.sub.
531  if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
532  else
533    echo "$progname: cannot run $ac_config_sub" 1>&2
534    echo "$help" 1>&2
535    exit 1
536  fi
537
538  echo $ac_n "checking host system type""... $ac_c" 1>&6
539
540  host_alias=$host
541  case $host_alias in
542  "")
543    # Force config.guess to use the C compiler.
544    # CC_FOR_BUILD overrides the CC variable in config.guess but I had
545    # problems with it so do it this way for now.
546    CC="$LTCC"
547
548    if host_alias=`$SHELL $ac_config_guess`; then :
549    else
550      echo "$progname: cannot guess host type; you must specify one" 1>&2
551      echo "$help" 1>&2
552      exit 1
553    fi
554
555    # Restore the C compiler.
556    CC="$old_CC"
557    ;;
558  esac
559  host=`$SHELL $ac_config_sub $host_alias`
560  echo "$ac_t$host" 1>&6
561
562  # Make sure the host verified.
563  test -z "$host" && exit 1
564
565  # Check for the build system type
566  echo $ac_n "checking build system type... $ac_c" 1>&6
567
568  build_alias=$build
569  case $build_alias in
570  NONE)
571    case $nonopt in
572    NONE) build_alias=$host_alias ;;
573    *) build_alias=$nonopt ;;
574    esac ;;
575  esac
576
577  build=`$SHELL $ac_config_sub $build_alias`
578  build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
579  build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
580  build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
581  echo "$ac_t""$build" 1>&6
582
583elif test -z "$host"; then
584  echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
585  echo "$help" 1>&2
586  exit 1
587else
588  host_alias=$host
589  build_alias=$host_alias
590  build=$host
591fi
592
593if test x"$host" != x"$build"; then
594  ac_tool_prefix=${host_alias}-
595else
596  ac_tool_prefix=
597fi
598
599host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
600host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
601host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
602
603# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
604case $host_os in
605linux-gnu*) ;;
606linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
607esac
608
609case $host_os in
610aix3*)
611  # AIX sometimes has problems with the GCC collect2 program.  For some
612  # reason, if we set the COLLECT_NAMES environment variable, the problems
613  # vanish in a puff of smoke.
614  if test "X${COLLECT_NAMES+set}" != Xset; then
615    COLLECT_NAMES=
616    export COLLECT_NAMES
617  fi
618  ;;
619esac
620
621# Determine commands to create old-style static archives.
622old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
623old_postinstall_cmds='chmod 644 $oldlib'
624old_postuninstall_cmds=
625
626if test -n "$RANLIB"; then
627  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
628  case $host_os in
629  openbsd*)
630      old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds";;
631  *)
632      old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds";;
633  esac
634fi
635
636# Source the script associated with the $tagname tag configuration.
637if test -n "$tagname"; then
638  . $ltmain
639else
640  # FIXME:  We should use a variable here
641  # Configure for a C compiler
642  . $srcdir/ltcf-c.sh
643fi
644
645# Set sane defaults for various variables
646test -z "$AR" && AR=ar
647test -z "$AR_FLAGS" && AR_FLAGS=cru
648test -z "$AS" && AS=as
649test -z "$CC" && CC=cc
650test -z "$DLLTOOL" && DLLTOOL=dlltool
651test -z "$MAGIC_CMD" && MAGIC_CMD=file
652test -z "$LD" && LD=ld
653test -z "$LN_S" && LN_S="ln -s"
654test -z "$NM" && NM=nm
655test -z "$OBJDUMP" && OBJDUMP=objdump
656test -z "$RANLIB" && RANLIB=:
657test -z "$STRIP" && STRIP=:
658test -z "$objext" && objext=o
659
660echo $ac_n "checking for objdir... $ac_c" 1>&6
661rm -f .libs 2>/dev/null
662mkdir .libs 2>/dev/null
663if test -d .libs; then
664  objdir=.libs
665else
666  # MS-DOS does not allow filenames that begin with a dot.
667  objdir=_libs
668fi
669rmdir .libs 2>/dev/null
670echo "$ac_t$objdir" 1>&6
671
672# If no C compiler was specified, use CC.
673LTCC=${LTCC-"$CC"}
674
675# Allow CC to be a program name with arguments.
676set dummy $CC
677compiler="$2"
678
679# We assume here that the value for ac_cv_prog_cc_pic will not be cached
680# in isolation, and that seeing it set (from the cache) indicates that
681# the associated values are set (in the cache) correctly too.
682echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
683echo "$progname:678:checking for $compiler option to produce PIC" 1>&5
684
685if test -z "$ac_cv_prog_cc_pic"; then
686  echo "$ac_t"none 1>&6
687else
688  echo "$ac_t""$ac_cv_prog_cc_pic" 1>&6
689
690  # Check to make sure the pic_flag actually works.
691  echo $ac_n "checking if $compiler PIC flag $ac_cv_prog_cc_pic works... $ac_c" 1>&6
692  echo "$progname:687:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5
693  if test "X${ac_cv_prog_cc_pic_works+set}" = Xset && \
694     test "X${ac_cv_prog_cc_pic_works}" != X; then
695    echo $ac_n "(cached) $ac_c" 1>&6
696  else
697    ac_cv_prog_cc_pic_works=yes
698    $rm conftest*
699    echo $lt_simple_compile_test_code > conftest.$ac_ext
700    save_CFLAGS="$CFLAGS"
701    CFLAGS="$CFLAGS $ac_cv_prog_cc_pic -DPIC"
702    if { (eval echo $progname:697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
703      # Append any warnings to the config.log.
704      cat conftest.err 1>&5
705
706      case $host_os in
707      hpux9* | hpux10* | hpux11*)
708	# On HP-UX, both CC and GCC only warn that PIC is supported... then
709	# they create non-PIC objects.  So, if there were any warnings, we
710	# assume that PIC is not supported.
711	if test -s conftest.err; then
712	  ac_cv_prog_cc_pic_works=no
713	  ac_cv_prog_cc_can_build_shared=no
714	  ac_cv_prog_cc_pic=
715	else
716	  ac_cv_prog_cc_pic_works=yes
717	  ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic"
718	fi
719	;;
720      *)
721	ac_cv_prog_cc_pic_works=yes
722	ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic"
723	;;
724      esac
725    else
726      # Append any errors to the config.log.
727      cat conftest.err 1>&5
728      ac_cv_prog_cc_pic_works=no
729      ac_cv_prog_cc_can_build_shared=no
730      ac_cv_prog_cc_pic=
731    fi
732    CFLAGS="$save_CFLAGS"
733    $rm conftest*
734  fi
735  # Belt *and* braces to stop my trousers falling down:
736  if test "X$ac_cv_prog_cc_pic_works" = Xno; then
737    ac_cv_prog_cc_pic=
738    ac_cv_prog_cc_can_build_shared=no
739  fi
740  echo "$ac_t""$ac_cv_prog_cc_pic_works" 1>&6
741fi
742
743# Check for any special shared library compilation flags.
744if test -n "$ac_cv_prog_cc_shlib"; then
745  echo "$progname: warning: \`$CC' requires \`$ac_cv_prog_cc_shlib' to build shared libraries" 1>&2
746  if echo "$old_CC $old_CFLAGS " | egrep -e "[ 	]$ac_cv_prog_cc_shlib[ 	]" >/dev/null; then :
747  else
748    echo "$progname: add \`$ac_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
749    ac_cv_prog_cc_can_build_shared=no
750  fi
751fi
752
753echo $ac_n "checking if $compiler static flag $ac_cv_prog_cc_static works... $ac_c" 1>&6
754echo "$progname:749: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5
755if test "X${ac_cv_prog_cc_static_works+set}" = Xset && \
756   test "X${ac_cv_prog_cc_static_works}" != X; then
757  echo $ac_n "(cached) $ac_c" 1>&6
758else
759  $rm conftest*
760  echo $lt_simple_link_test_code > conftest.$ac_ext
761  save_LDFLAGS="$LDFLAGS"
762  LDFLAGS="$LDFLAGS $ac_cv_prog_cc_static"
763  if { (eval echo $progname:758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
764    ac_cv_prog_cc_static_works=yes
765  else
766    ac_cv_prog_cc_static_works=no
767    ac_cv_prog_cc_static=
768  fi
769  LDFLAGS="$save_LDFLAGS"
770  $rm conftest*
771fi
772# Belt *and* braces to stop my trousers falling down:
773if test "X$ac_cv_prog_cc_static_works" = Xno; then
774  ac_cv_prog_cc_static=
775fi
776echo "$ac_t""$ac_cv_prog_cc_static_works" 1>&6
777pic_flag="$ac_cv_prog_cc_pic"
778special_shlib_compile_flags="$ac_cv_prog_cc_shlib"
779wl="$ac_cv_prog_cc_wl"
780link_static_flag="$ac_cv_prog_cc_static"
781no_builtin_flag="$ac_cv_prog_cc_no_builtin"
782can_build_shared="$ac_cv_prog_cc_can_build_shared"
783
784# find the maximum length of command line arguments
785echo "$progname:780: finding the maximum length of command line arguments" 1>&5
786echo $ac_n "finding the maximum length of command line arguments... $ac_c" 1>&6
787if test "${lt_cv_sys_max_cmd_len+set}" = set; then
788  echo $ac_n "(cached) $ac_c" 1>&6
789else
790  i=0
791  testring="ABCD"
792  # If test is not a shell built-in, we'll probably end up computing a
793  # maximum length that is only half of the actual maximum length, but
794  # we can't tell.
795  while test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
796             = "XX$testring" &&
797          new_result=`expr "X$testring" : ".*" 2>&1` &&
798          lt_cv_sys_max_cmd_len=$new_result &&
799          test $i != 17 # 1/2 MB should be enough
800  do
801    i=`expr $i + 1`
802    testring=$testring$testring
803  done
804  testring=
805  # add a significant safety factor because C++ compilers can tack on massive amounts
806  # of additional arguments before passing them to the linker.  1/4 should be good.
807  len=`expr $lt_cv_sys_max_cmd_len \/ 4`
808  lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len - $len`
809fi
810echo "$progname:@lineno@: result: $lt_cv_sys_max_cmd_len" 1>&5
811echo "${ac_t}$lt_cv_sys_max_cmd_len" 1>&6
812
813if test -n $lt_cv_sys_max_cmd_len ; then
814  max_cmd_len=$lt_cv_sys_max_cmd_len
815else
816  max_cmd_len=none
817fi
818
819# Check to see if options -o and -c are simultaneously supported by compiler
820echo $ac_n "checking if $compiler supports -c -o file.$objext... $ac_c" 1>&6
821if test "${lt_cv_compiler_c_o+set}" = set; then
822  echo $ac_n "(cached) $ac_c" 1>&6
823else
824  $rm -r conftest 2>/dev/null
825  mkdir conftest
826  cd conftest
827  $rm conftest*
828  echo $lt_simple_compile_test_code > conftest.$ac_ext
829  mkdir out
830  # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
831  # that will create temporary files in the current directory regardless of
832  # the output directory.  Thus, making CWD read-only will cause this test
833  # to fail, enabling locking or at least warning the user not to do parallel
834  # builds.
835  chmod -w .
836  save_CFLAGS="$CFLAGS"
837  CFLAGS="$CFLAGS -o out/conftest2.$objext"
838  echo "$progname:833: checking if $compiler supports -c -o file.$objext" >&5
839  if { (eval echo $progname:834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$objext; then
840
841    # The compiler can only warn and ignore the option if not recognized
842    # So say no if there are warnings
843      if test -s out/conftest.err; then
844        lt_cv_compiler_c_o=no
845      else
846        lt_cv_compiler_c_o=yes
847      fi
848  else
849    # Append any errors to the config.log.
850    cat out/conftest.err 1>&5
851    lt_cv_compiler_c_o=no
852  fi
853  CFLAGS="$save_CFLAGS"
854  chmod u+w .
855  $rm conftest* out/*
856  rmdir out
857  cd ..
858  rmdir conftest
859  $rm -r conftest 2>/dev/null
860fi
861compiler_c_o=$lt_cv_compiler_c_o
862echo "${ac_t}$compiler_c_o" 1>&6
863
864# Check to see if we can do hard links to lock some files if needed
865hard_links="nottested"
866if test "$compiler_c_o" = no && test "$need_locks" != no; then
867  # do not overwrite the value of need_locks provided by the user
868  echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
869  hard_links=yes
870  $rm conftest*
871  ln conftest.a conftest.b 2>/dev/null && hard_links=no
872  touch conftest.a
873  ln conftest.a conftest.b 2>&5 || hard_links=no
874  ln conftest.a conftest.b 2>/dev/null && hard_links=no
875  echo "$ac_t$hard_links" 1>&6
876  $rm conftest*
877  if test "$hard_links" = no; then
878    echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
879    need_locks=warn
880  fi
881else
882  need_locks=no
883fi
884
885if test "$with_gcc" = yes; then
886  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
887  echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
888  $rm conftest*
889  echo $lt_simple_compile_test_code > conftest.$ac_ext
890  save_CFLAGS="$CFLAGS"
891  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
892  echo "$progname:887: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
893  if { (eval echo $progname:888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
894
895    # The compiler can only warn and ignore the option if not recognized
896    # So say no if there are warnings
897      if test -s conftest.err; then
898	echo "$ac_t"no 1>&6
899	compiler_rtti_exceptions=no
900      else
901	echo "$ac_t"yes 1>&6
902	compiler_rtti_exceptions=yes
903      fi
904  else
905    # Append any errors to the config.log.
906    cat conftest.err 1>&5
907    compiler_rtti_exceptions=no
908    echo "$ac_t"no 1>&6
909  fi
910  CFLAGS="$save_CFLAGS"
911  $rm conftest*
912
913  if test "$compiler_rtti_exceptions" = "yes"; then
914    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
915  else
916    no_builtin_flag=' -fno-builtin'
917  fi
918  
919fi
920
921# See if the linker supports building shared libraries.
922echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
923
924echo "$ac_t$ld_shlibs" 1>&6
925test "$ld_shlibs" = no && can_build_shared=no
926
927# Check hardcoding attributes.
928echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
929hardcode_action=
930if test -n "$hardcode_libdir_flag_spec" || \
931   test -n "$runpath_var"; then
932
933  # We can hardcode non-existant directories.
934  if test "$hardcode_direct" != no &&
935     # If the only mechanism to avoid hardcoding is shlibpath_var, we
936     # have to relink, otherwise we might link with an installed library
937     # when we should be linking with a yet-to-be-installed one
938     ## test "$hardcode_shlibpath_var" != no &&
939     test "$hardcode_minus_L" != no; then
940    # Linking always hardcodes the temporary library directory.
941    hardcode_action=relink
942  else
943    # We can link without hardcoding, and we can hardcode nonexisting dirs.
944    hardcode_action=immediate
945  fi
946else
947  # We cannot hardcode anything, or else we can only hardcode existing
948  # directories.
949  hardcode_action=unsupported
950fi
951echo "$ac_t$hardcode_action" 1>&6
952
953echo $ac_n "checking whether stripping libraries is possible... $ac_c" 1>&6
954if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
955  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
956  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
957  echo "${ac_t}yes" 1>&6
958else
959  echo "${ac_t}no" 1>&6
960fi
961
962case $reload_flag in
963"" | " "*) ;;
964*) reload_flag=" $reload_flag" ;;
965esac
966reload_cmds='$LD$reload_flag -o $output$reload_objs'
967test -z "$deplibs_check_method" && deplibs_check_method=unknown
968
969# PORTME Fill in your ld.so characteristics
970library_names_spec=
971libname_spec='lib$name'
972soname_spec=
973postinstall_cmds=
974postuninstall_cmds=
975finish_cmds=
976finish_eval=
977shlibpath_var=
978shlibpath_overrides_runpath=unknown
979version_type=none
980dynamic_linker="$host_os ld.so"
981sys_lib_dlsearch_path_spec="/lib /usr/lib"
982sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
983
984echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
985case $host_os in
986aix3*)
987  version_type=linux
988  library_names_spec='${libname}${release}.so$versuffix $libname.a'
989  shlibpath_var=LIBPATH
990
991  # AIX 3 has no versioning support, so we append a major version to the name.
992  soname_spec='${libname}${release}.so$major'
993  ;;
994
995aix4* | aix5*)
996  version_type=linux
997  if test "$host_cpu" = ia64; then
998    # AIX 5 supports IA64
999    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1000    shlibpath_var=LD_LIBRARY_PATH
1001  else
1002    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
1003    # soname into executable. Probably we can add versioning support to
1004    # collect2, so additional links can be useful in future.
1005    # We preserve .a as extension for shared libraries though AIX4.2
1006    # and later linker supports .so
1007    if test "$aix_use_runtimelinking" = yes; then
1008      # If using run time linking (on AIX 4.2 or later) use lib<name>.so instead of
1009      # lib<name>.a to let people know that these are not typical AIX shared libraries.
1010      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1011    else
1012      # We preserve .a as extension for shared libraries though AIX4.2
1013      # and later when we are not doing run time linking.
1014      library_names_spec='${libname}${release}.a $libname.a'
1015      soname_spec='${libname}${release}.so$major'
1016    fi
1017    # If we're using GNU nm, then we don't want the "-C" option.
1018    # -C means demangle to AIX nm, but means don't demangle with GNU nm
1019    if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then
1020      export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
1021    else
1022      export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
1023    fi
1024    shlibpath_var=LIBPATH
1025    deplibs_check_method=pass_all
1026    case $host_os in
1027    aix4 | aix4.[01] | aix4.[01].*)
1028      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
1029	   echo ' yes '
1030	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
1031	:
1032      else
1033	# With GCC up to 2.95.x, collect2 would create an import file
1034	# for dependence libraries.  The import file would start with
1035	# the line `#! .'.  This would cause the generated library to
1036	# depend on `.', always an invalid library.  This was fixed in
1037	# development snapshots of GCC prior to 3.0.
1038        can_build_shared=no
1039      fi
1040      ;;
1041    esac
1042  fi
1043  ;;
1044
1045amigaos*)
1046  library_names_spec='$libname.ixlibrary $libname.a'
1047  # Create ${libname}_ixlibrary.a entries in /sys/libs.
1048  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'
1049  ;;
1050
1051beos*)
1052  library_names_spec='${libname}.so'
1053  dynamic_linker="$host_os ld.so"
1054  shlibpath_var=LIBRARY_PATH
1055  lt_cv_dlopen="load_add_on"
1056  lt_cv_dlopen_libs=
1057  lt_cv_dlopen_self=yes
1058  ;;
1059
1060bsdi4*)
1061  version_type=linux
1062  need_version=no
1063  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1064  soname_spec='${libname}${release}.so$major'
1065  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
1066  shlibpath_var=LD_LIBRARY_PATH
1067  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
1068  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
1069  export_dynamic_flag_spec=-rdynamic
1070  # the default ld.so.conf also contains /usr/contrib/lib and
1071  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
1072  # libtool to hard-code these into programs
1073  ;;
1074
1075cygwin* | mingw* | pw32*)
1076  version_type=windows
1077  need_version=no
1078  need_lib_prefix=no
1079  case $with_gcc,$host_os in
1080  yes,cygwin*)
1081    library_names_spec='$libname.dll.a'
1082    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll'
1083    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i; echo \$dlname'\''`~
1084      dldir=$destdir/`dirname \$dlpath`~
1085      test -d \$dldir || mkdir -p \$dldir~
1086      $install_prog .libs/$dlname \$dldir/$dlname'
1087    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
1088      dlpath=$dir/\$dldll; $rm \$dlpath'
1089    ;;
1090  yes,mingw*)
1091    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
1092    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
1093    ;;
1094  yes,pw32*)
1095    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
1096;;
1097  *)
1098    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
1099    ;;
1100  esac
1101  dynamic_linker='Win32 ld.exe'
1102  # FIXME: first we should search . and the directory the executable is in
1103  shlibpath_var=PATH
1104  lt_cv_dlopen="LoadLibrary"
1105  lt_cv_dlopen_libs=
1106  ;;
1107
1108darwin* | rhapsody*)
1109  dynamic_linker="$host_os dyld"
1110  version_type=darwin
1111  need_lib_prefix=no
1112  need_version=no
1113  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`'
1114  soname_spec='${libname}${release}${major}.`test .$module = .yes && echo so || echo dylib`'
1115  shlibpath_overrides_runpath=yes
1116  shlibpath_var=DYLD_LIBRARY_PATH
1117  ;;
1118
1119freebsd1*)
1120  dynamic_linker=no
1121  ;;
1122
1123freebsd*)
1124  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
1125  version_type=freebsd-$objformat
1126  case $version_type in
1127    freebsd-elf*)
1128      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1129      need_version=no
1130      need_lc=no
1131      need_lib_prefix=no
1132      ;;
1133    freebsd-*)
1134      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
1135      need_version=yes
1136      ;;
1137  esac
1138  shlibpath_var=LD_LIBRARY_PATH
1139  case $host_os in
1140  freebsd2*)
1141    shlibpath_overrides_runpath=yes
1142    ;;
1143  *)
1144    shlibpath_overrides_runpath=no
1145    hardcode_into_libs=yes
1146    ;;
1147  esac
1148  ;;
1149
1150gnu*)
1151  version_type=linux
1152  need_lib_prefix=no
1153  need_version=no
1154  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
1155  soname_spec='${libname}${release}.so$major'
1156  shlibpath_var=LD_LIBRARY_PATH
1157  hardcode_into_libs=yes
1158  ;;
1159
1160hpux9* | hpux10* | hpux11*)
1161  # Give a soname corresponding to the major version so that dld.sl refuses to
1162  # link against other versions.
1163  version_type=sunos
1164  need_lib_prefix=no
1165  need_version=no
1166  case "$host_cpu" in
1167  ia64*)
1168    dynamic_linker="$host_os dld.so"
1169    shlibpath_var=LD_LIBRARY_PATH
1170    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1171    soname_spec='${libname}${release}.so$major'
1172    shlibpath_var=LD_LIBRARY_PATH
1173    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
1174    if test "X$HPUX_IA64_MODE" = X32; then
1175      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32/usr/local/lib"
1176    else
1177      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
1178    fi
1179    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1180    ;;
1181  *)
1182    dynamic_linker="$host_os dld.sl"
1183    shlibpath_var=SHLIB_PATH
1184    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
1185    library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
1186    soname_spec='${libname}${release}.sl$major'
1187    ;;
1188  esac
1189  # HP-UX runs *really* slowly unless shared libraries are mode 555.
1190  postinstall_cmds='chmod 555 $lib'
1191  ;;
1192
1193irix5* | irix6*)
1194  if test "$with_gnu_ld" = yes; then
1195    version_type=linux
1196  else
1197    version_type=irix
1198  fi
1199  version_type=irix
1200  need_lib_prefix=no
1201  need_version=no
1202  soname_spec='${libname}${release}.so$major'
1203  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
1204  case $host_os in
1205  irix5*)
1206    libsuff= shlibsuff=
1207    ;;
1208  *)
1209    case $LD in # libtool.m4 will add one of these switches to LD
1210    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
1211      libsuff= shlibsuff= libmagic=32-bit;;
1212    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
1213      libsuff=32 shlibsuff=N32 libmagic=N32;;
1214    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
1215      libsuff=64 shlibsuff=64 libmagic=64-bit;;
1216    *) libsuff= shlibsuff= libmagic=never-match;;
1217    esac
1218    ;;
1219  esac
1220  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
1221  shlibpath_overrides_runpath=no
1222  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1223  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
1224  ;;
1225
1226# No shared lib support for Linux oldld, aout, or coff.
1227linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
1228  dynamic_linker=no
1229  ;;
1230
1231# This must be Linux ELF.
1232linux-gnu*)
1233  version_type=linux
1234  need_lib_prefix=no
1235  need_version=no
1236  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1237  soname_spec='${libname}${release}.so$major'
1238  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1239  shlibpath_var=LD_LIBRARY_PATH
1240  shlibpath_overrides_runpath=no
1241  # This implies no fast_install, which is unacceptable.
1242  # Some rework will be needed to allow for fast_install
1243  # before this can be enabled.
1244  hardcode_into_libs=yes
1245
1246  # We used to test for /lib/ld.so.1 and disable shared libraries on
1247  # powerpc, because MkLinux only supported shared libraries with the
1248  # GNU dynamic linker.  Since this was broken with cross compilers,
1249  # most powerpc-linux boxes support dynamic linking these days and
1250  # people can always --disable-shared, the test was removed, and we
1251  # assume the GNU/Linux dynamic linker is in use.
1252  dynamic_linker='GNU/Linux ld.so'
1253  ;;
1254
1255netbsd*)
1256  need_lib_prefix=no
1257  need_version=no
1258  version_type=sunos
1259  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1260    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1261    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1262    dynamic_linker='NetBSD (a.out) ld.so'
1263  else
1264    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
1265    soname_spec='${libname}${release}.so$major'
1266    dynamic_linker='NetBSD ld.elf_so'
1267  fi
1268  shlibpath_var=LD_LIBRARY_PATH
1269  shlibpath_overrides_runpath=yes
1270  hardcode_into_libs=yes
1271  ;;
1272
1273newsos6)
1274  version_type=linux
1275  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1276  shlibpath_var=LD_LIBRARY_PATH
1277  shlibpath_overrides_runpath=yes
1278  ;;
1279
1280openbsd*)
1281  version_type=sunos
1282  if test "$with_gnu_ld" = yes; then
1283    need_lib_prefix=no
1284    need_version=no
1285  fi
1286  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1287  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1288  shlibpath_var=LD_LIBRARY_PATH
1289  shlibpath_overrides_runpath=yes
1290  deplib_check_method=pass_all
1291  sys_lib_dlsearch_path_spec='/usr/lib /usr/local/lib /usr/X11R6/lib'
1292  ;;
1293
1294os2*)
1295  libname_spec='$name'
1296  need_lib_prefix=no
1297  library_names_spec='$libname.dll $libname.a'
1298  dynamic_linker='OS/2 ld.exe'
1299  shlibpath_var=LIBPATH
1300  ;;
1301
1302osf3* | osf4* | osf5*)
1303  version_type=osf
1304  need_version=no
1305  soname_spec='${libname}${release}.so$major'
1306  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1307  shlibpath_var=LD_LIBRARY_PATH
1308  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
1309  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
1310  ;;
1311
1312sco3.2v5*)
1313  version_type=osf
1314  soname_spec='${libname}${release}.so$major'
1315  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1316  shlibpath_var=LD_LIBRARY_PATH
1317  ;;
1318
1319solaris*)
1320  version_type=linux
1321  need_lib_prefix=no
1322  need_version=no
1323  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1324  soname_spec='${libname}${release}.so$major'
1325  shlibpath_var=LD_LIBRARY_PATH
1326  shlibpath_overrides_runpath=yes
1327  hardcode_into_libs=yes
1328  # ldd complains unless libraries are executable
1329  postinstall_cmds='chmod +x $lib'
1330  ;;
1331
1332sunos4*)
1333  version_type=sunos
1334  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1335  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1336  shlibpath_var=LD_LIBRARY_PATH
1337  shlibpath_overrides_runpath=yes
1338  if test "$with_gnu_ld" = yes; then
1339    need_lib_prefix=no
1340  fi
1341  need_version=yes
1342  ;;
1343
1344sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1345  version_type=linux
1346  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1347  soname_spec='${libname}${release}.so$major'
1348  shlibpath_var=LD_LIBRARY_PATH
1349  case $host_vendor in
1350    motorola)
1351      need_lib_prefix=no
1352      need_version=no
1353      shlibpath_overrides_runpath=no
1354      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
1355      ;;
1356  esac
1357  ;;
1358
1359uts4*)
1360  version_type=linux
1361  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1362  soname_spec='${libname}${release}.so$major'
1363  shlibpath_var=LD_LIBRARY_PATH
1364  ;;
1365
1366dgux*)
1367  version_type=linux
1368  need_lib_prefix=no
1369  need_version=no
1370  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1371  soname_spec='${libname}${release}.so$major'
1372  shlibpath_var=LD_LIBRARY_PATH
1373  ;;
1374
1375sysv4*MP*)
1376  if test -d /usr/nec ;then
1377    version_type=linux
1378    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
1379    soname_spec='$libname.so.$major'
1380    shlibpath_var=LD_LIBRARY_PATH
1381  fi
1382  ;;
1383
1384*)
1385  dynamic_linker=no
1386  ;;
1387esac
1388echo "$ac_t$dynamic_linker" 1>&6
1389test "$dynamic_linker" = no && can_build_shared=no
1390
1391# Check for command to grab the raw symbol name followed by C symbol from nm.
1392echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
1393
1394# These are sane defaults that work on at least a few old systems.
1395# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
1396
1397# Character class describing NM global symbol codes.
1398symcode='[BCDEGRST]'
1399
1400# Regexp to match symbols that can be accessed directly from C.
1401sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
1402
1403# Transform the above into a raw symbol and a C symbol.
1404symxfrm='\1 \2\3 \3'
1405
1406# Transform an extracted symbol line into a proper C declaration
1407global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
1408
1409# Define system-specific variables.
1410case $host_os in
1411aix*)
1412  symcode='[BCDT]'
1413  ;;
1414cygwin* | mingw* | pw32*)
1415  symcode='[ABCDGISTW]'
1416  ;;
1417hpux*) # Its linker distinguishes data from code symbols
1418  global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
1419  ;;
1420irix*)
1421  symcode='[BCDEGRST]'
1422  ;;
1423solaris* | sysv5*)
1424  symcode='[BDT]'
1425  ;;
1426sysv4)
1427  symcode='[DFNSTU]'
1428  ;;
1429esac
1430
1431# Handle CRLF in mingw tool chain
1432opt_cr=
1433case $host_os in
1434mingw*)
1435  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
1436  ;;
1437esac
1438
1439# If we're using GNU nm, then use its standard symbol codes.
1440if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1441  symcode='[ABCDGISTW]'
1442fi
1443
1444# Try without a prefix undercore, then with it.
1445for ac_symprfx in "" "_"; do
1446
1447  # Write the raw and C identifiers.
1448  global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
1449
1450  # Check to see that the pipe works correctly.
1451  pipe_works=no
1452  $rm conftest*
1453  cat > conftest.$ac_ext <<EOF
1454#ifdef __cplusplus
1455extern "C" {
1456#endif
1457char nm_test_var;
1458void nm_test_func(){}
1459#ifdef __cplusplus
1460}
1461#endif
1462int main(){nm_test_var='a';nm_test_func();return(0);}
1463EOF
1464
1465  echo "$progname:1431: checking if global_symbol_pipe works" >&5
1466  if { (eval echo $progname:1432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
1467    # Now try to grab the symbols.
1468    nlist=conftest.nm
1469    if { echo "$progname:1435: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
1470
1471      # Try sorting and uniquifying the output.
1472      if sort "$nlist" | uniq > "$nlist"T; then
1473	mv -f "$nlist"T "$nlist"
1474      else
1475	rm -f "$nlist"T
1476      fi
1477
1478      # Make sure that we snagged all the symbols we need.
1479      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1480	if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1481	  cat <<EOF > conftest.$ac_ext
1482#ifdef __cplusplus
1483extern "C" {
1484#endif
1485
1486EOF
1487	  # Now generate the symbol file.
1488	  eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
1489
1490	  cat <<EOF >> conftest.$ac_ext
1491#if defined (__STDC__) && __STDC__
1492# define lt_ptr_t void *
1493#else
1494# define lt_ptr_t char *
1495# define const
1496#endif
1497
1498/* The mapping between symbol names and symbols. */
1499const struct {
1500  const char *name;
1501  lt_ptr_t address;
1502}
1503lt_preloaded_symbols[] =
1504{
1505EOF
1506 	  sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext
1507	  cat <<\EOF >> conftest.$ac_ext
1508  {0, (lt_ptr_t) 0}
1509};
1510
1511#ifdef __cplusplus
1512}
1513#endif
1514EOF
1515	  # Now try linking the two files.
1516	  mv conftest.$objext conftstm.$objext
1517	  save_LIBS="$LIBS"
1518	  save_CFLAGS="$CFLAGS"
1519	  LIBS="conftstm.$objext"
1520	  CFLAGS="$CFLAGS$no_builtin_flag"
1521	  if { (eval echo $progname:1487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1522	    pipe_works=yes
1523	  else
1524	    echo "$progname: failed program was:" >&5
1525	    cat conftest.$ac_ext >&5
1526	  fi
1527	  LIBS="$save_LIBS"
1528	else
1529	  echo "cannot find nm_test_func in $nlist" >&5
1530	fi
1531      else
1532	echo "cannot find nm_test_var in $nlist" >&5
1533      fi
1534    else
1535      echo "cannot run $global_symbol_pipe" >&5
1536    fi
1537  else
1538    echo "$progname: failed program was:" >&5
1539    cat conftest.$ac_ext >&5
1540  fi
1541  $rm conftest* conftst*
1542
1543  # Do not use the global_symbol_pipe unless it works.
1544  if test "$pipe_works" = yes; then
1545    break
1546  else
1547    global_symbol_pipe=
1548  fi
1549done
1550if test "$pipe_works" = yes; then
1551  echo "${ac_t}ok" 1>&6
1552else
1553  echo "${ac_t}failed" 1>&6
1554fi
1555
1556if test -z "$global_symbol_pipe"; then
1557  global_symbol_to_cdecl=
1558fi
1559
1560# Report the final consequences.
1561echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1562
1563# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in
1564# configure.in, otherwise build static only libraries.
1565case $host_os in
1566cygwin* | mingw* | pw32* | os2*)
1567  if test x$can_build_shared = xyes; then
1568    test x$enable_win32_dll = xno && can_build_shared=no
1569    echo "checking if package supports dlls... $can_build_shared" 1>&6
1570  fi
1571;;
1572esac
1573
1574echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
1575test "$can_build_shared" = "no" && enable_shared=no
1576
1577# On AIX, shared libraries and static libraries use the same namespace, and
1578# are all built from PIC.
1579case $host_os in
1580aix3*)
1581  test "$enable_shared" = yes && enable_static=no
1582  if test -n "$RANLIB"; then
1583    archive_cmds="$archive_cmds~\$RANLIB \$lib"
1584    postinstall_cmds='$RANLIB $lib'
1585  fi
1586  ;;
1587
1588aix4*)
1589  test "$enable_shared" = yes && enable_static=no
1590  ;;
1591esac
1592
1593echo "$ac_t$enable_shared" 1>&6
1594
1595# Make sure either enable_shared or enable_static is yes.
1596test "$enable_shared" = yes || enable_static=yes
1597
1598echo "checking whether to build static libraries... $enable_static" 1>&6
1599
1600if test "$hardcode_action" = relink; then
1601  # Fast installation is not supported
1602  enable_fast_install=no
1603elif test "$shlibpath_overrides_runpath" = yes ||
1604     test "$enable_shared" = no; then
1605  # Fast installation is not necessary
1606  enable_fast_install=needless
1607fi
1608
1609variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
1610if test "$with_gcc" = yes; then
1611  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
1612fi
1613
1614# Check whether we must set pic_mode to default
1615test -z "$pic_flag" && pic_mode=default
1616
1617if test "x$enable_dlopen" != xyes; then
1618  enable_dlopen=unknown
1619  enable_dlopen_self=unknown
1620  enable_dlopen_self_static=unknown
1621else
1622if test "X${lt_cv_dlopen+set}" != Xset; then
1623  lt_cv_dlopen=no lt_cv_dlopen_libs=
1624echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
1625echo "$progname:1591: checking for dlopen in -ldl" >&5
1626if test "X${ac_cv_lib_dl_dlopen+set}" = Xset; then
1627  echo $ac_n "(cached) $ac_c" 1>&6
1628else
1629  ac_save_LIBS="$LIBS"
1630LIBS="-ldl  $LIBS"
1631cat > conftest.$ac_ext <<EOF
1632#line 1598 "ltconfig"
1633/* Override any gcc2 internal prototype to avoid an error.  */
1634/* We use char because int might match the return type of a gcc2
1635    builtin and then its argument prototype would still apply.  */
1636#ifdef __cplusplus
1637extern "C"
1638#endif
1639char dlopen();
1640
1641int main() {
1642dlopen()
1643; return 0; }
1644EOF
1645if { (eval echo $progname:1611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1646  rm -rf conftest*
1647  ac_cv_lib_dl_dlopen=yes
1648else
1649  echo "$progname: failed program was:" >&5
1650  cat conftest.$ac_ext >&5
1651  rm -rf conftest*
1652  ac_cv_lib_dl_dlopen=no
1653fi
1654rm -f conftest*
1655LIBS="$ac_save_LIBS"
1656
1657fi
1658if test "X$ac_cv_lib_dl_dlopen" = Xyes; then
1659  echo "$ac_t""yes" 1>&6
1660  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
1661else
1662  echo "$ac_t""no" 1>&6
1663echo $ac_n "checking for dlopen""... $ac_c" 1>&6
1664echo "$progname:1630: checking for dlopen" >&5
1665if test "X${ac_cv_func_dlopen+set}" = Xset; then
1666  echo $ac_n "(cached) $ac_c" 1>&6
1667else
1668  cat > conftest.$ac_ext <<EOF
1669#line 1635 "ltconfig"
1670/* System header to define __stub macros and hopefully few prototypes,
1671    which can conflict with char dlopen(); below.  */
1672#include <assert.h>
1673/* Override any gcc2 internal prototype to avoid an error.  */
1674/* We use char because int might match the return type of a gcc2
1675    builtin and then its argument prototype would still apply.  */
1676#ifdef __cplusplus
1677extern "C"
1678#endif
1679char dlopen();
1680
1681int main() {
1682
1683/* The GNU C library defines this for functions which it implements
1684    to always fail with ENOSYS.  Some functions are actually named
1685    something starting with __ and the normal name is an alias.  */
1686#if defined (__stub_dlopen) || defined (__stub___dlopen)
1687choke me
1688#else
1689dlopen();
1690#endif
1691
1692; return 0; }
1693EOF
1694if { (eval echo $progname:1660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1695  rm -rf conftest*
1696  ac_cv_func_dlopen=yes
1697else
1698  echo "$progname: failed program was:" >&5
1699  cat conftest.$ac_ext >&5
1700  rm -rf conftest*
1701  ac_cv_func_dlopen=no
1702fi
1703rm -f conftest*
1704fi
1705if test "X$ac_cv_func_dlopen" = Xyes; then
1706  echo "$ac_t""yes" 1>&6
1707  lt_cv_dlopen="dlopen"
1708else
1709  echo "$ac_t""no" 1>&6
1710echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
1711echo "$progname:1677: checking for dlopen in -lsvld" >&5
1712if test "X${ac_cv_lib_svld_dlopen+set}" = Xset; then
1713  echo $ac_n "(cached) $ac_c" 1>&6
1714else
1715  ac_save_LIBS="$LIBS"
1716LIBS="-lsvld  $LIBS"
1717cat > conftest.$ac_ext <<EOF
1718#line 1684 "ltconfig"
1719/* Override any gcc2 internal prototype to avoid an error.  */
1720/* We use char because int might match the return type of a gcc2
1721    builtin and then its argument prototype would still apply.  */
1722#ifdef __cplusplus
1723extern "C"
1724#endif
1725char dlopen();
1726
1727int main() {
1728dlopen()
1729; return 0; }
1730EOF
1731if { (eval echo $progname:1697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1732  rm -rf conftest*
1733  ac_cv_lib_svld_dlopen=yes
1734else
1735  echo "$progname: failed program was:" >&5
1736  cat conftest.$ac_ext >&5
1737  rm -rf conftest*
1738  ac_cv_lib_svld_dlopen=no
1739fi
1740rm -f conftest*
1741LIBS="$ac_save_LIBS"
1742
1743fi
1744if test "X$ac_cv_lib_svld_dlopen" = Xyes; then
1745  echo "$ac_t""yes" 1>&6
1746  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
1747else
1748  echo "$ac_t""no" 1>&6
1749echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
1750echo "$progname:1716: checking for dld_link in -ldld" >&5
1751if test "X${ac_cv_lib_dld_dld_link+set}" = Xset; then
1752  echo $ac_n "(cached) $ac_c" 1>&6
1753else
1754  ac_save_LIBS="$LIBS"
1755LIBS="-ldld  $LIBS"
1756cat > conftest.$ac_ext <<EOF
1757#line 1723 "ltconfig"
1758/* Override any gcc2 internal prototype to avoid an error.  */
1759/* We use char because int might match the return type of a gcc2
1760    builtin and then its argument prototype would still apply.  */
1761#ifdef __cplusplus
1762extern "C"
1763#endif
1764char dld_link();
1765
1766int main() {
1767dld_link()
1768; return 0; }
1769EOF
1770if { (eval echo $progname:1736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1771  rm -rf conftest*
1772  ac_cv_lib_dld_dld_link=yes
1773else
1774  echo "$progname: failed program was:" >&5
1775  cat conftest.$ac_ext >&5
1776  rm -rf conftest*
1777  ac_cv_lib_dld_dld_link=no
1778fi
1779rm -f conftest*
1780LIBS="$ac_save_LIBS"
1781
1782fi
1783if test "X$ac_cv_lib_dld_dld_link" = Xyes; then
1784  echo "$ac_t""yes" 1>&6
1785  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
1786else
1787  echo "$ac_t""no" 1>&6
1788echo $ac_n "checking for shl_load""... $ac_c" 1>&6
1789echo "$progname:1755: checking for shl_load" >&5
1790if test "X${ac_cv_func_shl_load+set}" = Xset; then
1791  echo $ac_n "(cached) $ac_c" 1>&6
1792else
1793  cat > conftest.$ac_ext <<EOF
1794#line 1760 "ltconfig"
1795/* System header to define __stub macros and hopefully few prototypes,
1796    which can conflict with char shl_load(); below.  */
1797#include <assert.h>
1798/* Override any gcc2 internal prototype to avoid an error.  */
1799/* We use char because int might match the return type of a gcc2
1800    builtin and then its argument prototype would still apply.  */
1801#ifdef __cplusplus
1802extern "C"
1803#endif
1804char shl_load();
1805
1806int main() {
1807
1808/* The GNU C library defines this for functions which it implements
1809    to always fail with ENOSYS.  Some functions are actually named
1810    something starting with __ and the normal name is an alias.  */
1811#if defined (__stub_shl_load) || defined (__stub___shl_load)
1812choke me
1813#else
1814shl_load();
1815#endif
1816
1817; return 0; }
1818EOF
1819if { (eval echo $progname:1785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1820  rm -rf conftest*
1821  ac_cv_func_shl_load=yes
1822else
1823  echo "$progname: failed program was:" >&5
1824  cat conftest.$ac_ext >&5
1825  rm -rf conftest*
1826  ac_cv_func_shl_load=no
1827fi
1828rm -f conftest*
1829fi
1830
1831if test "X$ac_cv_func_shl_load" = Xyes; then
1832  echo "$ac_t""yes" 1>&6
1833  lt_cv_dlopen="shl_load"
1834else
1835  echo "$ac_t""no" 1>&6
1836echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
1837echo "$progname:1803: checking for shl_load in -ldld" >&5
1838if test "X${ac_cv_lib_dld_shl_load+set}" = Xset; then
1839  echo $ac_n "(cached) $ac_c" 1>&6
1840else
1841  ac_save_LIBS="$LIBS"
1842LIBS="-ldld  $LIBS"
1843cat > conftest.$ac_ext <<EOF
1844#line 1810 "ltconfig"
1845#include "confdefs.h"
1846/* Override any gcc2 internal prototype to avoid an error.  */
1847/* We use char because int might match the return type of a gcc2
1848    builtin and then its argument prototype would still apply.  */
1849#ifdef __cplusplus
1850extern "C"
1851#endif
1852char shl_load();
1853
1854int main() {
1855shl_load()
1856; return 0; }
1857EOF
1858if { (eval echo $progname:1824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1859  rm -rf conftest*
1860  ac_cv_lib_dld_shl_load=yes
1861else
1862  echo "$progname: failed program was:" >&5
1863  cat conftest.$ac_ext >&5
1864  rm -rf conftest*
1865  ac_cv_lib_dld_shl_load=no
1866fi
1867rm -f conftest*
1868LIBS="$ac_save_LIBS"
1869
1870fi
1871if test "X$ac_cv_lib_dld_shl_load" = Xyes; then
1872  echo "$ac_t""yes" 1>&6
1873  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
1874else
1875  echo "$ac_t""no" 1>&6
1876fi
1877
1878
1879fi
1880
1881
1882fi
1883
1884
1885fi
1886
1887
1888fi
1889
1890fi
1891
1892fi
1893
1894  if test "x$lt_cv_dlopen" != xno; then
1895    enable_dlopen=yes
1896  else
1897    enable_dlopen=no
1898  fi
1899
1900  case $lt_cv_dlopen in
1901  dlopen)
1902for ac_hdr in dlfcn.h; do
1903ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1904echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1905echo "$progname:1871: checking for $ac_hdr" >&5
1906if eval "test \"`echo 'X$''{'ac_cv_header_$ac_safe'+set}'`\" = Xset"; then
1907  echo $ac_n "(cached) $ac_c" 1>&6
1908else
1909  cat > conftest.$ac_ext <<EOF
1910#line 1876 "ltconfig"
1911#include <$ac_hdr>
1912int fnord = 0;
1913int main () { return(0); }
1914EOF
1915ac_try="$ac_compile >/dev/null 2>conftest.out"
1916{ (eval echo $progname:1882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1917ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1918if test -z "$ac_err"; then
1919  rm -rf conftest*
1920  eval "ac_cv_header_$ac_safe=yes"
1921else
1922  echo "$ac_err" >&5
1923  echo "$progname: failed program was:" >&5
1924  cat conftest.$ac_ext >&5
1925  rm -rf conftest*
1926  eval "ac_cv_header_$ac_safe=no"
1927fi
1928rm -f conftest*
1929fi
1930if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1931  echo "$ac_t""yes" 1>&6
1932else
1933  echo "$ac_t""no" 1>&6
1934fi
1935done
1936
1937    if test "x$ac_cv_header_dlfcn_h" = xyes; then
1938      CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1939    fi
1940    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1941    LIBS="$lt_cv_dlopen_libs $LIBS"
1942
1943  echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
1944echo "$progname:1910: checking whether a program can dlopen itself" >&5
1945if test "X${lt_cv_dlopen_self+set}" = Xset; then
1946  echo $ac_n "(cached) $ac_c" 1>&6
1947else
1948  if test "$cross_compiling" = yes; then
1949    lt_cv_dlopen_self=cross
1950  else
1951    cat > conftest.$ac_ext <<EOF
1952#line 1918 "ltconfig"
1953
1954#if HAVE_DLFCN_H
1955#include <dlfcn.h>
1956#endif
1957
1958#include <stdio.h>
1959
1960#ifdef RTLD_GLOBAL
1961# define LTDL_GLOBAL	RTLD_GLOBAL
1962#else
1963# ifdef DL_GLOBAL
1964#  define LTDL_GLOBAL	DL_GLOBAL
1965# else
1966#  define LTDL_GLOBAL	0
1967# endif
1968#endif
1969
1970/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
1971   find out it does not work in some platform. */
1972#ifndef LTDL_LAZY_OR_NOW
1973# ifdef RTLD_LAZY
1974#  define LTDL_LAZY_OR_NOW	RTLD_LAZY
1975# else
1976#  ifdef DL_LAZY
1977#   define LTDL_LAZY_OR_NOW	DL_LAZY
1978#  else
1979#   ifdef RTLD_NOW
1980#    define LTDL_LAZY_OR_NOW	RTLD_NOW
1981#   else
1982#    ifdef DL_NOW
1983#     define LTDL_LAZY_OR_NOW	DL_NOW
1984#    else
1985#     define LTDL_LAZY_OR_NOW	0
1986#    endif
1987#   endif
1988#  endif
1989# endif
1990#endif
1991
1992void fnord() { int i=42; }
1993int main() {
1994    void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
1995    if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
1996               if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
1997
1998EOF
1999if { (eval echo $progname:1965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2000then
2001  lt_cv_dlopen_self=yes
2002else
2003  echo "$progname: failed program was:" >&5
2004  cat conftest.$ac_ext >&5
2005  rm -fr conftest*
2006  lt_cv_dlopen_self=no
2007fi
2008rm -fr conftest*
2009fi
2010
2011fi
2012
2013echo "$ac_t""$lt_cv_dlopen_self" 1>&6
2014
2015  if test "$lt_cv_dlopen_self" = yes; then
2016    LDFLAGS="$LDFLAGS $link_static_flag"
2017  echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
2018echo "$progname:1984: checking whether a statically linked program can dlopen itself" >&5
2019if test "X${lt_cv_dlopen_self_static+set}" = Xset; then
2020  echo $ac_n "(cached) $ac_c" 1>&6
2021else
2022  if test "$cross_compiling" = yes; then
2023    lt_cv_dlopen_self_static=cross
2024  else
2025    cat > conftest.$ac_ext <<EOF
2026#line 1992 "ltconfig"
2027
2028#if HAVE_DLFCN_H
2029#include <dlfcn.h>
2030#endif
2031
2032#include <stdio.h>
2033
2034#ifdef RTLD_GLOBAL
2035# define LTDL_GLOBAL	RTLD_GLOBAL
2036#else
2037# ifdef DL_GLOBAL
2038#  define LTDL_GLOBAL	DL_GLOBAL
2039# else
2040#  define LTDL_GLOBAL	0
2041# endif
2042#endif
2043
2044/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
2045   find out it does not work in some platform. */
2046#ifndef LTDL_LAZY_OR_NOW
2047# ifdef RTLD_LAZY
2048#  define LTDL_LAZY_OR_NOW	RTLD_LAZY
2049# else
2050#  ifdef DL_LAZY
2051#   define LTDL_LAZY_OR_NOW	DL_LAZY
2052#  else
2053#   ifdef RTLD_NOW
2054#    define LTDL_LAZY_OR_NOW	RTLD_NOW
2055#   else
2056#    ifdef DL_NOW
2057#     define LTDL_LAZY_OR_NOW	DL_NOW
2058#    else
2059#     define LTDL_LAZY_OR_NOW	0
2060#    endif
2061#   endif
2062#  endif
2063# endif
2064#endif
2065
2066void fnord() { int i=42; }
2067int main() {
2068    void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
2069    if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
2070    if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
2071
2072EOF
2073if { (eval echo $progname:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2074then
2075  lt_cv_dlopen_self_static=yes
2076else
2077  echo "$progname: failed program was:" >&5
2078  cat conftest.$ac_ext >&5
2079  rm -fr conftest*
2080  lt_cv_dlopen_self_static=no
2081fi
2082rm -fr conftest*
2083fi
2084
2085fi
2086
2087echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
2088fi
2089    ;;
2090  esac
2091
2092  case $lt_cv_dlopen_self in
2093  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2094  *) enable_dlopen_self=unknown ;;
2095  esac
2096
2097  case $lt_cv_dlopen_self_static in
2098  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2099  *) enable_dlopen_self_static=unknown ;;
2100  esac
2101fi
2102
2103# Copy echo and quote the copy, instead of the original, because it is
2104# used later.
2105ltecho="$echo"
2106if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then
2107   ltecho="$CONFIG_SHELL \$0 --fallback-echo"
2108fi
2109LTSHELL="$SHELL"
2110
2111LTCONFIG_VERSION="$VERSION"
2112
2113# Only quote variables if we're using ltmain.sh.
2114case $ltmain in
2115*.sh)
2116  # Now quote all the things that may contain metacharacters.
2117  for var in ltecho old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \
2118    old_MAGIC_CMD old_LD old_LDFLAGS old_LIBS \
2119    old_LN_S old_NM old_RANLIB old_STRIP \
2120    old_AS old_DLLTOOL old_OBJDUMP \
2121    old_OBJEXT old_EXEEXT old_reload_flag \
2122    old_deplibs_check_method old_file_magic_cmd \
2123    AR AR_FLAGS CC LTCC LD LN_S NM LTSHELL LTCONFIG_VERSION \
2124    reload_flag reload_cmds wl \
2125    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
2126    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
2127    library_names_spec soname_spec \
2128    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
2129    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
2130    postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
2131    predep_objects postdep_objects predeps postdeps compiler_lib_search_path \
2132    old_striplib striplib file_magic_cmd export_symbols_cmds \
2133    deplibs_check_method allow_undefined_flag no_undefined_flag \
2134    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
2135    hardcode_libdir_flag_spec hardcode_libdir_separator  \
2136    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
2137    compiler_c_o need_locks exclude_expsyms include_expsyms; do
2138
2139    case $var in
2140    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
2141    old_postinstall_cmds | old_postuninstall_cmds | \
2142    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
2143    extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
2144    postinstall_cmds | postuninstall_cmds | \
2145    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
2146      # Double-quote double-evaled strings.
2147      eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ### testsuite: skip nested quoting test
2148      ;;
2149    *)
2150      eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ### testsuite: skip nested quoting test
2151      ;;
2152    esac
2153  done
2154
2155  case $ltecho in
2156  *'\$0 --fallback-echo"')
2157    ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
2158    ;;
2159  esac
2160
2161  if test -z "$tagname"; then
2162    trap "$rm \"$ofile\"; exit 1" 1 2 15
2163    echo "creating $ofile"
2164    $rm "$ofile"
2165    cat <<EOF > "$ofile"
2166#! $SHELL
2167
2168# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
2169# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2170# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
2171#
2172# Copyright (C) 1996-2000 Free Software Foundation, Inc.
2173# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2174#
2175# This program is free software; you can redistribute it and/or modify
2176# it under the terms of the GNU General Public License as published by
2177# the Free Software Foundation; either version 2 of the License, or
2178# (at your option) any later version.
2179#
2180# This program is distributed in the hope that it will be useful, but
2181# WITHOUT ANY WARRANTY; without even the implied warranty of
2182# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2183# General Public License for more details.
2184#
2185# You should have received a copy of the GNU General Public License
2186# along with this program; if not, write to the Free Software
2187# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2188#
2189# As a special exception to the GNU General Public License, if you
2190# distribute this file as part of a program that contains a
2191# configuration script generated by Autoconf, you may include it under
2192# the same distribution terms that you use for the rest of that program.
2193
2194# Sed that helps us avoid accidentally triggering echo(1) options like -n.
2195Xsed="sed -e s/^X//"
2196
2197# The HP-UX ksh and POSIX shell print the target directory to stdout
2198# if CDPATH is set.
2199if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
2200
2201# The names of the tagged configurations supported by this script.
2202available_tags=
2203
2204### BEGIN LIBTOOL CONFIG
2205EOF
2206  else
2207    echo "appending configuration tag \"$tagname\" to $ofile"
2208    echo "### BEGIN LIBTOOL TAG CONFIG: $tagname" >> "$ofile"
2209  fi
2210  cfgfile="$ofile"
2211  ;;
2212
2213*)
2214  # Double-quote the variables that need it (for aesthetics).
2215  for var in old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \
2216    old_MAGIC_CMD old_LD old_LDFLAGS old_LIBS \
2217    old_LN_S old_NM old_RANLIB old_STRIP \
2218    old_AS old_DLLTOOL old_OBJDUMP \
2219    old_OBJEXT old_EXEEXT old_reload_flag \
2220    old_deplibs_check_method old_file_magic_cmd; do
2221    eval "$var=\\\"\$var\\\""
2222  done
2223
2224  # Just create a config file.
2225  cfgfile="$ofile.cfg"
2226  if test -z "$tagname"; then
2227    trap "$rm \"$cfgfile\"; exit 1" 1 2 15
2228    echo "creating $cfgfile"
2229    $rm "$cfgfile"
2230    cat <<EOF > "$cfgfile"
2231# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
2232# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2233
2234### BEGIN LIBTOOL CONFIG
2235EOF
2236  else
2237    echo "appending to $cfgfile"
2238    echo "### BEGIN LIBTOOL TAG CONFIG: $tagname" >> "$ofile"
2239  fi
2240  ;;
2241esac
2242
2243cat <<EOF >> "$cfgfile"
2244# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2245#
2246# AR=$old_AR AR_FLAGS=$old_AR_FLAGS LTCC=$old_LTCC CC=$old_CC \\
2247# CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
2248# MAGIC_CMD=$old_MAGIC_CMD LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\
2249# LN_S=$old_LN_S NM=$old_NM RANLIB=$old_RANLIB STRIP=$old_STRIP \\
2250# AS=$old_AS DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP \\
2251# objext=$old_OBJEXT exeext=$old_EXEEXT reload_flag=$old_reload_flag \\
2252# deplibs_check_method=$old_deplibs_check_method \\
2253# file_magic_cmd=$old_file_magic_cmd \\
2254#   $0$ltconfig_args
2255#
2256# Compiler and other test output produced by $progname, useful for
2257# debugging $progname, is in ./config.log if it exists.
2258
2259# The version of $progname that generated this script.
2260LTCONFIG_VERSION=$LTCONFIG_VERSION
2261
2262# Shell to use when invoking shell scripts.
2263SHELL=$LTSHELL
2264
2265# Whether or not to build shared libraries.
2266build_libtool_libs=$enable_shared
2267
2268# Whether or not to add -lc for building shared libraries.
2269build_libtool_need_lc=$need_lc
2270
2271# Whether or not to build static libraries.
2272build_old_libs=$enable_static
2273
2274# Whether or not to optimize for fast installation.
2275fast_install=$enable_fast_install
2276
2277# The host system.
2278host_alias=$host_alias
2279host=$host
2280
2281# An echo program that does not interpret backslashes.
2282echo=$ltecho
2283
2284# The archiver.
2285AR=$AR
2286AR_FLAGS=$AR_FLAGS
2287
2288# A C compiler.
2289LTCC=$LTCC
2290
2291# A language-specific compiler.
2292CC=$CC
2293
2294# Is the compiler the GNU C compiler?
2295with_gcc=$with_gcc
2296
2297# The linker used to build libraries.
2298LD=$LD
2299
2300# Whether we need hard or soft links.
2301LN_S=$LN_S
2302
2303# A BSD-compatible nm program.
2304NM=$NM
2305
2306# A symbol stripping program
2307STRIP=$STRIP
2308
2309# Used to examine libraries when file_magic_cmd begins "file"
2310MAGIC_CMD=$MAGIC_CMD
2311
2312# Used on cygwin: DLL creation program.
2313DLLTOOL="$DLLTOOL"
2314
2315# Used on cygwin: object dumper.
2316OBJDUMP="$OBJDUMP"
2317
2318# Used on cygwin: assembler.
2319AS="$AS"
2320
2321# The name of the directory that contains temporary libtool files.
2322objdir=$objdir
2323
2324# How to create reloadable object files.
2325reload_flag=$reload_flag
2326reload_cmds=$reload_cmds
2327
2328# How to pass a linker flag through the compiler.
2329wl=$wl
2330
2331# Object file suffix (normally "o").
2332objext="$objext"
2333
2334# Old archive suffix (normally "a").
2335libext="$libext"
2336
2337# Executable file suffix (normally "").
2338exeext="$exeext"
2339
2340# Additional compiler flags for building library objects.
2341pic_flag=$pic_flag
2342pic_mode=$pic_mode
2343
2344# What is the maximum length of a command?
2345max_cmd_len=$max_cmd_len
2346
2347# Does compiler simultaneously support -c and -o options?
2348compiler_c_o=$compiler_c_o
2349
2350# Must we lock files when doing compilation ?
2351need_locks=$need_locks
2352
2353# Do we need the lib prefix for modules?
2354need_lib_prefix=$need_lib_prefix
2355
2356# Do we need a version for libraries?
2357need_version=$need_version
2358
2359# Whether dlopen is supported.
2360dlopen_support=$enable_dlopen
2361
2362# Whether dlopen of programs is supported.
2363dlopen_self=$enable_dlopen_self
2364
2365# Whether dlopen of statically linked programs is supported.
2366dlopen_self_static=$enable_dlopen_self_static
2367
2368# Compiler flag to prevent dynamic linking.
2369link_static_flag=$link_static_flag
2370
2371# Compiler flag to turn off builtin functions.
2372no_builtin_flag=$no_builtin_flag
2373
2374# Compiler flag to allow reflexive dlopens.
2375export_dynamic_flag_spec=$export_dynamic_flag_spec
2376
2377# Compiler flag to generate shared objects directly from archives.
2378whole_archive_flag_spec=$whole_archive_flag_spec
2379
2380# Compiler flag to generate thread-safe objects.
2381thread_safe_flag_spec=$thread_safe_flag_spec
2382
2383# Library versioning type.
2384version_type=$version_type
2385
2386# Format of library name prefix.
2387libname_spec=$libname_spec
2388
2389# List of archive names.  First name is the real one, the rest are links.
2390# The last name is the one that the linker finds with -lNAME.
2391library_names_spec=$library_names_spec
2392
2393# The coded name of the library, if different from the real name.
2394soname_spec=$soname_spec
2395
2396# Commands used to build and install an old-style archive.
2397RANLIB=$RANLIB
2398old_archive_cmds=$old_archive_cmds
2399old_postinstall_cmds=$old_postinstall_cmds
2400old_postuninstall_cmds=$old_postuninstall_cmds
2401
2402# Create an old-style archive from a shared archive.
2403old_archive_from_new_cmds=$old_archive_from_new_cmds
2404
2405# Create a temporary old-style archive to link instead of a shared archive.
2406old_archive_from_expsyms_cmds=$old_archive_from_expsyms_cmds
2407
2408# Commands used to build and install a shared archive.
2409archive_cmds=$archive_cmds
2410archive_expsym_cmds=$archive_expsym_cmds
2411postinstall_cmds=$postinstall_cmds
2412postuninstall_cmds=$postuninstall_cmds
2413
2414# Commands to strip libraries.
2415old_striplib=$old_striplib
2416striplib=$striplib
2417
2418# Dependencies to place before the objects being linked to create a
2419# shared library.
2420predep_objects=$predep_objects
2421
2422# Dependencies to place after the objects being linked to create a
2423# shared library.
2424postdep_objects=$postdep_objects
2425
2426# Dependencies to place before the objects being linked to create a
2427# shared library.
2428predeps=$predeps
2429
2430# Dependencies to place after the objects being linked to create a
2431# shared library.
2432postdeps=$postdeps
2433
2434# The library search path used internally by the compiler when linking
2435# a shared library.
2436compiler_lib_search_path=$compiler_lib_search_path
2437
2438# Method to check whether dependent libraries are shared objects.
2439deplibs_check_method=$deplibs_check_method
2440
2441# Command to use when deplibs_check_method == file_magic.
2442file_magic_cmd=$file_magic_cmd
2443
2444# Flag that allows shared libraries with undefined symbols to be built.
2445allow_undefined_flag=$allow_undefined_flag
2446
2447# Flag that forces no undefined symbols.
2448no_undefined_flag=$no_undefined_flag
2449
2450# Commands used to finish a libtool library installation in a directory.
2451finish_cmds=$finish_cmds
2452
2453# Same as above, but a single script fragment to be evaled but not shown.
2454finish_eval=$finish_eval
2455
2456# Take the output of nm and produce a listing of raw symbols and C names.
2457global_symbol_pipe=$global_symbol_pipe
2458
2459# Transform the output of nm in a proper C declaration
2460global_symbol_to_cdecl=$global_symbol_to_cdecl
2461
2462# This is the shared library runtime path variable.
2463runpath_var=$runpath_var
2464
2465# This is the shared library path variable.
2466shlibpath_var=$shlibpath_var
2467
2468# Is shlibpath searched before the hard-coded library search path?
2469shlibpath_overrides_runpath=$shlibpath_overrides_runpath
2470
2471# How to hardcode a shared library path into an executable.
2472hardcode_action=$hardcode_action
2473
2474# Whether we should hardcode library paths into libraries.
2475hardcode_into_libs=$hardcode_into_libs
2476
2477# Flag to hardcode \$libdir into a binary during linking.
2478# This must work even if \$libdir does not exist.
2479hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
2480
2481# Whether we need a single -rpath flag with a separated argument.
2482hardcode_libdir_separator=$hardcode_libdir_separator
2483
2484# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
2485# resulting binary.
2486hardcode_direct=$hardcode_direct
2487
2488# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
2489# resulting binary.
2490hardcode_minus_L=$hardcode_minus_L
2491
2492# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
2493# the resulting binary.
2494hardcode_shlibpath_var=$hardcode_shlibpath_var
2495
2496# Variables whose values should be saved in libtool wrapper scripts and
2497# restored at relink time.
2498variables_saved_for_relink="$variables_saved_for_relink"
2499
2500# Whether libtool must link a program against all its dependency libraries.
2501link_all_deplibs=$link_all_deplibs
2502
2503# Compile-time system search path for libraries
2504sys_lib_search_path_spec=$sys_lib_search_path_spec
2505
2506# Run-time system search path for libraries
2507sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
2508
2509# Fix the shell variable \$srcfile for the compiler.
2510fix_srcfile_path="$fix_srcfile_path"
2511
2512# Set to yes if exported symbols are required.
2513always_export_symbols=$always_export_symbols
2514
2515# The commands to list exported symbols.
2516export_symbols_cmds=$export_symbols_cmds
2517
2518# The commands to extract the exported symbol list from a shared archive.
2519extract_expsyms_cmds=$extract_expsyms_cmds
2520
2521# Symbols that should not be listed in the preloaded symbols.
2522exclude_expsyms=$exclude_expsyms
2523
2524# Symbols that must always be exported.
2525include_expsyms=$include_expsyms
2526
2527EOF
2528
2529if test -z "$tagname"; then
2530  echo '### END LIBTOOL CONFIG' >> "$ofile"
2531else
2532  echo "### END LIBTOOL TAG CONFIG: $tagname" >> "$ofile"
2533fi
2534
2535case $ltmain in
2536*.sh)
2537  echo >> "$ofile"
2538  if test -z "$tagname"; then
2539    case $host_os in
2540    aix3*)
2541      cat <<\EOF >> "$ofile"
2542
2543# AIX sometimes has problems with the GCC collect2 program.  For some
2544# reason, if we set the COLLECT_NAMES environment variable, the problems
2545# vanish in a puff of smoke.
2546if test "X${COLLECT_NAMES+set}" != Xset; then
2547  COLLECT_NAMES=
2548  export COLLECT_NAMES
2549fi
2550EOF
2551      ;;
2552    esac
2553    case $host in
2554    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
2555      cat <<'EOF' >> "$ofile"
2556      # This is a source program that is used to create dlls on Windows
2557      # Don't remove nor modify the starting and closing comments
2558# /* ltdll.c starts here */
2559# #define WIN32_LEAN_AND_MEAN
2560# #include <windows.h>
2561# #undef WIN32_LEAN_AND_MEAN
2562# #include <stdio.h>
2563#
2564# #ifndef __CYGWIN__
2565# #  ifdef __CYGWIN32__
2566# #    define __CYGWIN__ __CYGWIN32__
2567# #  endif
2568# #endif
2569#
2570# #ifdef __cplusplus
2571# extern "C" {
2572# #endif
2573# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
2574# #ifdef __cplusplus
2575# }
2576# #endif
2577#
2578# #ifdef __CYGWIN__
2579# #include <cygwin/cygwin_dll.h>
2580# DECLARE_CYGWIN_DLL( DllMain );
2581# #endif
2582# HINSTANCE __hDllInstance_base;
2583#
2584# BOOL APIENTRY
2585# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
2586# {
2587#   __hDllInstance_base = hInst;
2588#   return TRUE;
2589# }
2590# /* ltdll.c ends here */
2591      # This is a source program that is used to create import libraries
2592      # on Windows for dlls which lack them. Don't remove nor modify the
2593      # starting and closing comments
2594# /* impgen.c starts here */
2595# /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
2596#
2597#  This file is part of GNU libtool.
2598#
2599#  This program is free software; you can redistribute it and/or modify
2600#  it under the terms of the GNU General Public License as published by
2601#  the Free Software Foundation; either version 2 of the License, or
2602#  (at your option) any later version.
2603#
2604#  This program is distributed in the hope that it will be useful,
2605#  but WITHOUT ANY WARRANTY; without even the implied warranty of
2606#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2607#  GNU General Public License for more details.
2608#
2609#  You should have received a copy of the GNU General Public License
2610#  along with this program; if not, write to the Free Software
2611#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2612#  */
2613#
2614#  #include <stdio.h>		/* for printf() */
2615#  #include <unistd.h>		/* for open(), lseek(), read() */
2616#  #include <fcntl.h>		/* for O_RDONLY, O_BINARY */
2617#  #include <string.h>		/* for strdup() */
2618#
2619#  /* O_BINARY isn't required (or even defined sometimes) under Unix */
2620#  #ifndef O_BINARY
2621#  #define O_BINARY 0
2622#  #endif
2623#
2624#  static unsigned int
2625#  pe_get16 (fd, offset)
2626#       int fd;
2627#       int offset;
2628#  {
2629#    unsigned char b[2];
2630#    lseek (fd, offset, SEEK_SET);
2631#    read (fd, b, 2);
2632#    return b[0] + (b[1]<<8);
2633#  }
2634#
2635#  static unsigned int
2636#  pe_get32 (fd, offset)
2637#      int fd;
2638#      int offset;
2639#  {
2640#    unsigned char b[4];
2641#    lseek (fd, offset, SEEK_SET);
2642#    read (fd, b, 4);
2643#    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
2644#  }
2645#
2646#  static unsigned int
2647#  pe_as32 (ptr)
2648#       void *ptr;
2649#  {
2650#    unsigned char *b = ptr;
2651#    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
2652#  }
2653#
2654#  int
2655#  main (argc, argv)
2656#      int argc;
2657#      char *argv[];
2658#  {
2659#      int dll;
2660#      unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
2661#      unsigned long export_rva, export_size, nsections, secptr, expptr;
2662#      unsigned long name_rvas, nexp;
2663#      unsigned char *expdata, *erva;
2664#      char *filename, *dll_name;
2665#
2666#      filename = argv[1];
2667#
2668#      dll = open(filename, O_RDONLY|O_BINARY);
2669#      if (dll < 1)
2670#  	return 1;
2671#
2672#      dll_name = filename;
2673#
2674#      for (i=0; filename[i]; i++)
2675#  	if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
2676#  	    dll_name = filename + i +1;
2677#
2678#      pe_header_offset = pe_get32 (dll, 0x3c);
2679#      opthdr_ofs = pe_header_offset + 4 + 20;
2680#      num_entries = pe_get32 (dll, opthdr_ofs + 92);
2681#
2682#      if (num_entries < 1) /* no exports */
2683#  	return 1;
2684#
2685#      export_rva = pe_get32 (dll, opthdr_ofs + 96);
2686#      export_size = pe_get32 (dll, opthdr_ofs + 100);
2687#      nsections = pe_get16 (dll, pe_header_offset + 4 +2);
2688#      secptr = (pe_header_offset + 4 + 20 +
2689#  	      pe_get16 (dll, pe_header_offset + 4 + 16));
2690#
2691#      expptr = 0;
2692#      for (i = 0; i < nsections; i++)
2693#      {
2694#  	char sname[8];
2695#  	unsigned long secptr1 = secptr + 40 * i;
2696#  	unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
2697#  	unsigned long vsize = pe_get32 (dll, secptr1 + 16);
2698#  	unsigned long fptr = pe_get32 (dll, secptr1 + 20);
2699#  	lseek(dll, secptr1, SEEK_SET);
2700#  	read(dll, sname, 8);
2701#  	if (vaddr <= export_rva && vaddr+vsize > export_rva)
2702#  	{
2703#  	    expptr = fptr + (export_rva - vaddr);
2704#  	    if (export_rva + export_size > vaddr + vsize)
2705#  		export_size = vsize - (export_rva - vaddr);
2706#  	    break;
2707#  	}
2708#      }
2709#
2710#      expdata = (unsigned char*)malloc(export_size);
2711#      lseek (dll, expptr, SEEK_SET);
2712#      read (dll, expdata, export_size);
2713#      erva = expdata - export_rva;
2714#
2715#      nexp = pe_as32 (expdata+24);
2716#      name_rvas = pe_as32 (expdata+32);
2717#
2718#      printf ("EXPORTS\n");
2719#      for (i = 0; i<nexp; i++)
2720#      {
2721#  	unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
2722#  	printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
2723#      }
2724#
2725#      return 0;
2726#  }
2727# /* impgen.c ends here */
2728
2729EOF
2730    ;;
2731  esac
2732
2733
2734    # Append the ltmain.sh script.
2735    sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
2736    # We use sed instead of cat because bash on DJGPP gets confused if
2737    # if finds mixed CR/LF and LF-only lines.  Since sed operates in
2738    # text mode, it properly converts lines to CR/LF.  This bash problem
2739    # is reportedly fixed, but why not run on old versions too?
2740
2741    chmod +x "$ofile"
2742  fi
2743  ;;
2744
2745*)
2746  # Compile the libtool program.
2747  echo "FIXME: would compile $ltmain"
2748  ;;
2749esac
2750
2751# Update the list of available tags.
2752if test -n "$tagname"; then
2753
2754  # Extract list of available tagged configurations in $ofile.
2755  # Note that this assumes the entire list is on one line.
2756  available_tags=`grep "^available_tags=" $ofile | sed -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
2757
2758  # Append the new tag name to the list of available tags.
2759  available_tags="$available_tags $tagname"
2760
2761  # Now substitute the updated of available tags.
2762  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' ${ofile} > ${ofile}.new"; then
2763    mv ${ofile}.new ${ofile}
2764    chmod +x "$ofile"
2765  else
2766    rm -f ${ofile}.new
2767    echo "$progname: unable to update list of available tagged configurations."
2768    exit 1
2769  fi
2770fi
2771
2772# Don't cache tagged configuration!
2773test -n "$cache_file" && test -z "$tagname" || exit 0
2774
2775# AC_CACHE_SAVE
2776trap '' 1 2 15
2777cat > confcache <<\EOF
2778# This file is a shell script that caches the results of configure
2779# tests run on this system so they can be shared between configure
2780# scripts and configure runs.  It is not useful on other systems.
2781# If it contains results you don't want to keep, you may remove or edit it.
2782#
2783# By default, configure uses ./config.cache as the cache file,
2784# creating it if it does not exist already.  You can give configure
2785# the --cache-file=FILE option to use a different cache file; that is
2786# what configure does when it calls configure scripts in
2787# subdirectories, so they share the cache.
2788# Giving --cache-file=/dev/null disables caching, for debugging configure.
2789# config.status only pays attention to the cache file if you give it the
2790# --recheck option to rerun configure.
2791#
2792EOF
2793# The following way of writing the cache mishandles newlines in values,
2794# but we know of no workaround that is simple, portable, and efficient.
2795# So, don't put newlines in cache variables' values.
2796# Ultrix sh set writes to stderr and can't be redirected directly,
2797# and sets the high bit in the cache file unless we assign to the vars.
2798(set) 2>&1 |
2799  case `(ac_space=' '; set | grep ac_space) 2>&1` in
2800  *ac_space=\ *)
2801    # `set' does not quote correctly, so add quotes (double-quote substitution
2802    # turns \\\\ into \\, and sed turns \\ into \).
2803    sed -n \
2804      -e "s/'/'\\\\''/g" \
2805      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2806    ;;
2807  *)
2808    # `set' quotes correctly as required by POSIX, so do not add quotes.
2809    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2810    ;;
2811  esac >> confcache
2812if cmp -s $cache_file confcache; then
2813  :
2814else
2815  if test -w $cache_file; then
2816    echo "updating cache $cache_file"
2817    cat confcache > $cache_file
2818  else
2819    echo "not updating unwritable cache $cache_file"
2820  fi
2821fi
2822rm -f confcache
2823
2824exit 0
2825
2826# Local Variables:
2827# mode:shell-script
2828# sh-indentation:2
2829# End:
2830