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