]> gcc.gnu.org Git - gcc.git/blame - ltconfig
Oops, committed with wrong date
[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
89820b43 184TIMESTAMP=" (1.641.2.77 2000/08/01 04:25:15)"
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
AO
275old_LIBS="$LIBS"
276old_MAGIC="$MAGIC"
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
90fb0c24
TT
486if test -n "$cache_file" && test -r "$cache_file"; then
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
4f4caf92
AO
623# Source the script associated with the $tagname tag configuration.
624if test -n "$tagname"; then
625 . $ltmain
626else
627 # FIXME: We should use a variable here
628 # Configure for a C compiler
629 . $srcdir/ltcf-c.sh
6599da04
JM
630fi
631
4f4caf92
AO
632# Set sane defaults for various variables
633test -z "$AR" && AR=ar
634test -z "$AR_FLAGS" && AR_FLAGS=cru
635test -z "$AS" && AS=as
636test -z "$CC" && CC=cc
cf4ccd63 637test -z "$DLLTOOL" && DLLTOOL=dlltool
4f4caf92
AO
638test -z "$MAGIC" && MAGIC=file
639test -z "$LD" && LD=ld
640test -z "$LN_S" && LN_S="ln -s"
641test -z "$NM" && NM=nm
d207ebef 642test -z "$OBJDUMP" && OBJDUMP=objdump
4f4caf92
AO
643test -z "$RANLIB" && RANLIB=:
644test -z "$STRIP" && STRIP=:
645test -z "$objext" && objext=o
6599da04 646
4f4caf92
AO
647echo $ac_n "checking for objdir... $ac_c" 1>&6
648rm -f .libs 2>/dev/null
649mkdir .libs 2>/dev/null
650if test -d .libs; then
651 objdir=.libs
652else
653 # MS-DOS does not allow filenames that begin with a dot.
654 objdir=_libs
6599da04 655fi
4f4caf92
AO
656rmdir .libs 2>/dev/null
657echo "$ac_t$objdir" 1>&6
658
659# If no C compiler was specified, use CC.
660LTCC=${LTCC-"$CC"}
6599da04
JM
661
662# Allow CC to be a program name with arguments.
663set dummy $CC
664compiler="$2"
665
4f4caf92
AO
666# We assume here that the value for ac_cv_prog_cc_pic will not be cached
667# in isolation, and that seeing it set (from the cache) indicates that
668# the associated values are set (in the cache) correctly too.
669echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
670echo "$progname:670:checking for $compiler option to produce PIC" 1>&5
fbd836fc 671
4f4caf92
AO
672if test -z "$ac_cv_prog_cc_pic"; then
673 echo "$ac_t"none 1>&6
d207ebef 674else
4f4caf92
AO
675 echo "$ac_t""$ac_cv_prog_cc_pic" 1>&6
676
677 # Check to make sure the pic_flag actually works.
678 echo $ac_n "checking if $compiler PIC flag $ac_cv_prog_cc_pic works... $ac_c" 1>&6
679 echo "$progname:679:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5
680 if test "X${ac_cv_prog_cc_pic_works+set}" = Xset && \
681 test "X${ac_cv_prog_cc_pic_works}" != X; then
682 echo $ac_n "(cached) $ac_c" 1>&6
683 else
684 ac_cv_prog_cc_pic_works=yes
d207ebef 685 $rm conftest*
4f4caf92
AO
686 echo $lt_simple_compile_test_code > conftest.$ac_ext
687 save_CFLAGS="$CFLAGS"
688 CFLAGS="$CFLAGS $ac_cv_prog_cc_pic -DPIC"
689 if { (eval echo $progname:689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
d207ebef
JM
690 # Append any warnings to the config.log.
691 cat conftest.err 1>&5
692
4f4caf92
AO
693 case "$host_os" in
694 hpux9* | hpux10* | hpux11*)
695 # On HP-UX, both CC and GCC only warn that PIC is supported... then
696 # they create non-PIC objects. So, if there were any warnings, we
697 # assume that PIC is not supported.
698 if test -s conftest.err; then
699 ac_cv_prog_cc_pic_works=no
700 ac_cv_prog_cc_can_build_shared=no
701 ac_cv_prog_cc_pic=
702 else
703 ac_cv_prog_cc_pic_works=yes
704 ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic"
705 fi
706 ;;
707 *)
708 ac_cv_prog_cc_pic_works=yes
709 ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic"
710 ;;
711 esac
d207ebef 712 else
4f4caf92 713 # Append any errors to the config.log.
d207ebef 714 cat conftest.err 1>&5
4f4caf92
AO
715 ac_cv_prog_cc_pic_works=no
716 ac_cv_prog_cc_can_build_shared=no
717 ac_cv_prog_cc_pic=
d207ebef 718 fi
4f4caf92 719 CFLAGS="$save_CFLAGS"
d207ebef 720 $rm conftest*
4f4caf92
AO
721 fi
722 # Belt *and* braces to stop my trousers falling down:
723 if test "X$ac_cv_prog_cc_pic_works" = Xno; then
724 ac_cv_prog_cc_pic=
725 ac_cv_prog_cc_can_build_shared=no
726 fi
727 echo "$ac_t""$ac_cv_prog_cc_pic_works" 1>&6
d207ebef 728fi
cf4ccd63 729
4f4caf92
AO
730# Check for any special shared library compilation flags.
731if test -n "$ac_cv_prog_cc_shlib"; then
732 echo "$progname: warning: \`$CC' requires \`$ac_cv_prog_cc_shlib' to build shared libraries" 1>&2
733 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$ac_cv_prog_cc_shlib[ ]" >/dev/null; then :
734 else
735 echo "$progname: add \`$ac_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
736 ac_cv_prog_cc_can_build_shared=no
737 fi
6599da04
JM
738fi
739
4f4caf92
AO
740echo $ac_n "checking if $compiler static flag $ac_cv_prog_cc_static works... $ac_c" 1>&6
741echo "$progname:741: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5
742if test "X${ac_cv_prog_cc_static_works+set}" = Xset && \
743 test "X${ac_cv_prog_cc_static_works}" != X; then
744 echo $ac_n "(cached) $ac_c" 1>&6
745else
cf4ccd63 746 $rm conftest*
4f4caf92
AO
747 echo $lt_simple_link_test_code > conftest.$ac_ext
748 save_LDFLAGS="$LDFLAGS"
749 LDFLAGS="$LDFLAGS $ac_cv_prog_cc_static"
750 if { (eval echo $progname:750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
751 ac_cv_prog_cc_static_works=yes
90fb0c24 752 else
4f4caf92
AO
753 ac_cv_prog_cc_static_works=no
754 ac_cv_prog_cc_static=
90fb0c24 755 fi
4f4caf92 756 LDFLAGS="$save_LDFLAGS"
90fb0c24 757 $rm conftest*
90fb0c24 758fi
4f4caf92
AO
759# Belt *and* braces to stop my trousers falling down:
760if test "X$ac_cv_prog_cc_static_works" = Xno; then
761 ac_cv_prog_cc_static=
762fi
763echo "$ac_t""$ac_cv_prog_cc_static_works" 1>&6
764pic_flag="$ac_cv_prog_cc_pic"
765special_shlib_compile_flags="$ac_cv_prog_cc_shlib"
766wl="$ac_cv_prog_cc_wl"
767link_static_flag="$ac_cv_prog_cc_static"
768no_builtin_flag="$ac_cv_prog_cc_no_builtin"
769can_build_shared="$ac_cv_prog_cc_can_build_shared"
cf4ccd63 770
90fb0c24 771# Check to see if options -o and -c are simultaneously supported by compiler
4f4caf92 772echo $ac_n "checking if $compiler supports -c -o file.$objext... $ac_c" 1>&6
d207ebef
JM
773$rm -r conftest 2>/dev/null
774mkdir conftest
775cd conftest
90fb0c24 776$rm conftest*
4f4caf92 777echo $lt_simple_compile_test_code > conftest.$ac_ext
d207ebef
JM
778mkdir out
779# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
780# that will create temporary files in the current directory regardless of
781# the output directory. Thus, making CWD read-only will cause this test
782# to fail, enabling locking or at least warning the user not to do parallel
783# builds.
784chmod -w .
90fb0c24 785save_CFLAGS="$CFLAGS"
4f4caf92
AO
786CFLAGS="$CFLAGS -o out/conftest2.$objext"
787echo "$progname:787: checking if $compiler supports -c -o file.$objext" >&5
788if { (eval echo $progname:788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$objext; then
90fb0c24
TT
789
790 # The compiler can only warn and ignore the option if not recognized
791 # So say no if there are warnings
d207ebef 792 if test -s out/conftest.err; then
cf4ccd63 793 echo "$ac_t"no 1>&6
90fb0c24 794 compiler_c_o=no
cf4ccd63
JL
795 else
796 echo "$ac_t"yes 1>&6
90fb0c24 797 compiler_c_o=yes
cf4ccd63 798 fi
90fb0c24
TT
799else
800 # Append any errors to the config.log.
d207ebef 801 cat out/conftest.err 1>&5
90fb0c24
TT
802 compiler_c_o=no
803 echo "$ac_t"no 1>&6
804fi
805CFLAGS="$save_CFLAGS"
d207ebef
JM
806chmod u+w .
807$rm conftest* out/*
808rmdir out
809cd ..
810rmdir conftest
811$rm -r conftest 2>/dev/null
90fb0c24 812
90fb0c24
TT
813# Check to see if we can do hard links to lock some files if needed
814hard_links="nottested"
815if test "$compiler_c_o" = no && test "$need_locks" != no; then
816 # do not overwrite the value of need_locks provided by the user
817 echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
818 hard_links=yes
819 $rm conftest*
820 ln conftest.a conftest.b 2>/dev/null && hard_links=no
821 touch conftest.a
822 ln conftest.a conftest.b 2>&5 || hard_links=no
823 ln conftest.a conftest.b 2>/dev/null && hard_links=no
824 echo "$ac_t$hard_links" 1>&6
825 $rm conftest*
826 if test "$hard_links" = no; then
827 echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
828 need_locks=warn
829 fi
830else
831 need_locks=no
832fi
833
834if test "$with_gcc" = yes; then
835 # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
836 echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
837 $rm conftest*
4f4caf92 838 echo $lt_simple_compile_test_code > conftest.$ac_ext
90fb0c24 839 save_CFLAGS="$CFLAGS"
4f4caf92
AO
840 CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
841 echo "$progname:841: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
842 if { (eval echo $progname:842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
90fb0c24
TT
843
844 # The compiler can only warn and ignore the option if not recognized
845 # So say no if there are warnings
846 if test -s conftest.err; then
847 echo "$ac_t"no 1>&6
848 compiler_rtti_exceptions=no
849 else
850 echo "$ac_t"yes 1>&6
851 compiler_rtti_exceptions=yes
852 fi
853 else
854 # Append any errors to the config.log.
855 cat conftest.err 1>&5
856 compiler_rtti_exceptions=no
857 echo "$ac_t"no 1>&6
858 fi
859 CFLAGS="$save_CFLAGS"
860 $rm conftest*
861
862 if test "$compiler_rtti_exceptions" = "yes"; then
863 no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
864 else
865 no_builtin_flag=' -fno-builtin'
866 fi
867
6599da04
JM
868fi
869
4f4caf92
AO
870# See if the linker supports building shared libraries.
871echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
6599da04 872
4f4caf92
AO
873echo "$ac_t$ld_shlibs" 1>&6
874test "$ld_shlibs" = no && can_build_shared=no
6599da04
JM
875
876# Check hardcoding attributes.
877echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
878hardcode_action=
879if test -n "$hardcode_libdir_flag_spec" || \
cf4ccd63 880 test -n "$runpath_var"; then
6599da04
JM
881
882 # We can hardcode non-existant directories.
d207ebef
JM
883 if test "$hardcode_direct" != no &&
884 # If the only mechanism to avoid hardcoding is shlibpath_var, we
885 # have to relink, otherwise we might link with an installed library
886 # when we should be linking with a yet-to-be-installed one
887 ## test "$hardcode_shlibpath_var" != no &&
888 test "$hardcode_minus_L" != no; then
6599da04
JM
889 # Linking always hardcodes the temporary library directory.
890 hardcode_action=relink
891 else
892 # We can link without hardcoding, and we can hardcode nonexisting dirs.
893 hardcode_action=immediate
894 fi
6599da04 895else
cf4ccd63
JL
896 # We cannot hardcode anything, or else we can only hardcode existing
897 # directories.
898 hardcode_action=unsupported
6599da04 899fi
cf4ccd63 900echo "$ac_t$hardcode_action" 1>&6
6599da04 901
4f4caf92
AO
902echo $ac_n "checking whether stripping libraries is possible... $ac_c" 1>&6
903if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
904 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
905 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
906 echo "${ac_t}yes" 1>&6
907else
908 echo "${ac_t}no" 1>&6
909fi
6599da04 910
6599da04 911reload_cmds='$LD$reload_flag -o $output$reload_objs'
4f4caf92 912test -z "$deplibs_check_method" && deplibs_check_method=unknown
6599da04
JM
913
914# PORTME Fill in your ld.so characteristics
915library_names_spec=
cf4ccd63 916libname_spec='lib$name'
6599da04
JM
917soname_spec=
918postinstall_cmds=
cf4ccd63 919postuninstall_cmds=
6599da04 920finish_cmds=
cf4ccd63 921finish_eval=
6599da04 922shlibpath_var=
90fb0c24 923shlibpath_overrides_runpath=unknown
6599da04
JM
924version_type=none
925dynamic_linker="$host_os ld.so"
90fb0c24
TT
926sys_lib_dlsearch_path_spec="/lib /usr/lib"
927sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
4f4caf92 928
6599da04
JM
929echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
930case "$host_os" in
90fb0c24 931aix3*)
6599da04 932 version_type=linux
cf4ccd63 933 library_names_spec='${libname}${release}.so$versuffix $libname.a'
6599da04
JM
934 shlibpath_var=LIBPATH
935
936 # AIX has no versioning support, so we append a major version to the name.
cf4ccd63
JL
937 soname_spec='${libname}${release}.so$major'
938 ;;
939
90fb0c24
TT
940aix4*)
941 version_type=linux
942 # AIX has no versioning support, so currently we can not hardcode correct
943 # soname into executable. Probably we can add versioning support to
944 # collect2, so additional links can be useful in future.
945 # We preserve .a as extension for shared libraries though AIX4.2
946 # and later linker supports .so
947 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a'
948 shlibpath_var=LIBPATH
90fb0c24
TT
949 ;;
950
cf4ccd63
JL
951amigaos*)
952 library_names_spec='$libname.ixlibrary $libname.a'
953 # Create ${libname}_ixlibrary.a entries in /sys/libs.
954 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'
955 ;;
956
90fb0c24
TT
957beos*)
958 library_names_spec='${libname}.so'
959 dynamic_linker="$host_os ld.so"
960 shlibpath_var=LIBRARY_PATH
d207ebef
JM
961 lt_cv_dlopen="load_add_on"
962 lt_cv_dlopen_libs=
963 lt_cv_dlopen_self=yes
90fb0c24
TT
964 ;;
965
966bsdi4*)
967 version_type=linux
d207ebef
JM
968 need_version=no
969 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
970 soname_spec='${libname}${release}.so$major'
971 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
90fb0c24 972 shlibpath_var=LD_LIBRARY_PATH
90fb0c24
TT
973 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
974 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
d207ebef 975 export_dynamic_flag_spec=-rdynamic
90fb0c24
TT
976 # the default ld.so.conf also contains /usr/contrib/lib and
977 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
978 # libtool to hard-code these into programs
979 ;;
980
981cygwin* | mingw*)
cf4ccd63 982 version_type=windows
d207ebef
JM
983 need_version=no
984 need_lib_prefix=no
fbd836fc 985 if test "$with_gcc" = yes; then
4f4caf92 986 library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
fbd836fc
ILT
987 else
988 library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
989 fi
cf4ccd63 990 dynamic_linker='Win32 ld.exe'
90fb0c24 991 # FIXME: first we should search . and the directory the executable is in
cf4ccd63 992 shlibpath_var=PATH
d207ebef
JM
993 lt_cv_dlopen="LoadLibrary"
994 lt_cv_dlopen_libs=
6599da04
JM
995 ;;
996
90fb0c24
TT
997freebsd1*)
998 dynamic_linker=no
999 ;;
4f4caf92 1000
90fb0c24
TT
1001freebsd*)
1002 objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
1003 version_type=freebsd-$objformat
1004 case "$version_type" in
1005 freebsd-elf*)
90fb0c24
TT
1006 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1007 need_version=no
1008 need_lib_prefix=no
1009 ;;
1010 freebsd-*)
90fb0c24
TT
1011 library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
1012 need_version=yes
1013 ;;
1014 esac
6599da04 1015 shlibpath_var=LD_LIBRARY_PATH
d207ebef 1016 case "$host_os" in
4f4caf92
AO
1017 freebsd2*)
1018 shlibpath_overrides_runpath=yes
1019 ;;
1020 freebsd3.[01]* | freebsdelf3.[01]*)
d207ebef 1021 shlibpath_overrides_runpath=yes
4f4caf92 1022 hardcode_into_libs=yes
d207ebef
JM
1023 ;;
1024 *) # from 3.2 on
1025 shlibpath_overrides_runpath=no
4f4caf92 1026 hardcode_into_libs=yes
d207ebef
JM
1027 ;;
1028 esac
6599da04
JM
1029 ;;
1030
1031gnu*)
fbd836fc 1032 version_type=linux
d207ebef
JM
1033 need_lib_prefix=no
1034 need_version=no
1035 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
1036 soname_spec='${libname}${release}.so$major'
6599da04 1037 shlibpath_var=LD_LIBRARY_PATH
4f4caf92 1038 hardcode_into_libs=yes
6599da04
JM
1039 ;;
1040
cf4ccd63 1041hpux9* | hpux10* | hpux11*)
6599da04
JM
1042 # Give a soname corresponding to the major version so that dld.sl refuses to
1043 # link against other versions.
1044 dynamic_linker="$host_os dld.sl"
1045 version_type=sunos
90fb0c24
TT
1046 need_lib_prefix=no
1047 need_version=no
6599da04 1048 shlibpath_var=SHLIB_PATH
d207ebef 1049 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
cf4ccd63
JL
1050 library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
1051 soname_spec='${libname}${release}.sl$major'
6599da04
JM
1052 # HP-UX runs *really* slowly unless shared libraries are mode 555.
1053 postinstall_cmds='chmod 555 $lib'
1054 ;;
1055
d207ebef 1056irix5* | irix6*)
90fb0c24
TT
1057 version_type=irix
1058 need_lib_prefix=no
1059 need_version=no
4f4caf92
AO
1060 soname_spec='${libname}${release}.so$major'
1061 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
d207ebef
JM
1062 case "$host_os" in
1063 irix5*)
1064 libsuff= shlibsuff=
d207ebef
JM
1065 ;;
1066 *)
1067 case "$LD" in # libtool.m4 will add one of these switches to LD
1068 *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
1069 *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
1070 *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
1071 *) libsuff= shlibsuff= libmagic=never-match;;
1072 esac
1073 ;;
90fb0c24
TT
1074 esac
1075 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
1076 shlibpath_overrides_runpath=no
d207ebef
JM
1077 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1078 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
6599da04
JM
1079 ;;
1080
1081# No shared lib support for Linux oldld, aout, or coff.
1082linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
1083 dynamic_linker=no
1084 ;;
1085
1086# This must be Linux ELF.
1087linux-gnu*)
1088 version_type=linux
90fb0c24
TT
1089 need_lib_prefix=no
1090 need_version=no
cf4ccd63
JL
1091 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1092 soname_spec='${libname}${release}.so$major'
d207ebef 1093 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6599da04 1094 shlibpath_var=LD_LIBRARY_PATH
90fb0c24 1095 shlibpath_overrides_runpath=no
4f4caf92
AO
1096 # This implies no fast_install, which is unacceptable.
1097 # Some rework will be needed to allow for fast_install
1098 # before this can be enabled.
1099 hardcode_into_libs=yes
1100
1101 # We used to test for /lib/ld.so.1 and disable shared libraries on
1102 # powerpc, because MkLinux only supported shared libraries with the
1103 # GNU dynamic linker. Since this was broken with cross compilers,
1104 # most powerpc-linux boxes support dynamic linking these days and
1105 # people can always --disable-shared, the test was removed, and we
1106 # assume the GNU/Linux dynamic linker is in use.
1107 dynamic_linker='GNU/Linux ld.so'
6599da04
JM
1108 ;;
1109
90fb0c24 1110netbsd*)
6599da04 1111 version_type=sunos
90fb0c24
TT
1112 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1113 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
d207ebef 1114 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
90fb0c24
TT
1115 dynamic_linker='NetBSD (a.out) ld.so'
1116 else
4f4caf92
AO
1117 deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
1118 file_magic_cmd=/usr/bin/file
1119 file_magic_test_file=`echo /usr/lib/libc.so*`
90fb0c24
TT
1120 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
1121 soname_spec='${libname}${release}.so$major'
1122 dynamic_linker='NetBSD ld.elf_so'
1123 fi
1124 shlibpath_var=LD_LIBRARY_PATH
1125 ;;
1126
1127openbsd*)
1128 version_type=sunos
1129 if test "$with_gnu_ld" = yes; then
1130 need_lib_prefix=no
1131 need_version=no
1132 fi
1133 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6599da04
JM
1134 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1135 shlibpath_var=LD_LIBRARY_PATH
1136 ;;
1137
cf4ccd63
JL
1138os2*)
1139 libname_spec='$name'
90fb0c24 1140 need_lib_prefix=no
cf4ccd63
JL
1141 library_names_spec='$libname.dll $libname.a'
1142 dynamic_linker='OS/2 ld.exe'
1143 shlibpath_var=LIBPATH
1144 ;;
1145
d207ebef 1146osf3* | osf4* | osf5*)
6599da04 1147 version_type=osf
d207ebef 1148 need_version=no
cf4ccd63 1149 soname_spec='${libname}${release}.so'
90fb0c24 1150 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6599da04 1151 shlibpath_var=LD_LIBRARY_PATH
90fb0c24
TT
1152 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
1153 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
6599da04
JM
1154 ;;
1155
1156sco3.2v5*)
1157 version_type=osf
cf4ccd63
JL
1158 soname_spec='${libname}${release}.so$major'
1159 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6599da04
JM
1160 shlibpath_var=LD_LIBRARY_PATH
1161 ;;
1162
90fb0c24 1163solaris*)
6599da04 1164 version_type=linux
90fb0c24
TT
1165 need_lib_prefix=no
1166 need_version=no
cf4ccd63
JL
1167 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1168 soname_spec='${libname}${release}.so$major'
6599da04 1169 shlibpath_var=LD_LIBRARY_PATH
90fb0c24 1170 shlibpath_overrides_runpath=yes
4f4caf92 1171 hardcode_into_libs=yes
fbd836fc
ILT
1172 # ldd complains unless libraries are executable
1173 postinstall_cmds='chmod +x $lib'
6599da04
JM
1174 ;;
1175
1176sunos4*)
1177 version_type=sunos
fbd836fc 1178 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6599da04
JM
1179 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1180 shlibpath_var=LD_LIBRARY_PATH
90fb0c24
TT
1181 shlibpath_overrides_runpath=yes
1182 if test "$with_gnu_ld" = yes; then
1183 need_lib_prefix=no
1184 fi
1185 need_version=yes
6599da04
JM
1186 ;;
1187
d207ebef 1188sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
cf4ccd63
JL
1189 version_type=linux
1190 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1191 soname_spec='${libname}${release}.so$major'
1192 shlibpath_var=LD_LIBRARY_PATH
90fb0c24 1193 case "$host_vendor" in
d207ebef
JM
1194 motorola)
1195 need_lib_prefix=no
1196 need_version=no
1197 shlibpath_overrides_runpath=no
1198 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
d207ebef 1199 ;;
90fb0c24 1200 esac
cf4ccd63
JL
1201 ;;
1202
1203uts4*)
1204 version_type=linux
1205 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1206 soname_spec='${libname}${release}.so$major'
1207 shlibpath_var=LD_LIBRARY_PATH
1208 ;;
1209
90fb0c24
TT
1210dgux*)
1211 version_type=linux
1212 need_lib_prefix=no
1213 need_version=no
1214 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1215 soname_spec='${libname}${release}.so$major'
1216 shlibpath_var=LD_LIBRARY_PATH
1217 ;;
1218
d207ebef
JM
1219sysv4*MP*)
1220 if test -d /usr/nec ;then
1221 version_type=linux
1222 library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
1223 soname_spec='$libname.so.$major'
1224 shlibpath_var=LD_LIBRARY_PATH
d207ebef
JM
1225 fi
1226 ;;
1227
6599da04
JM
1228*)
1229 dynamic_linker=no
1230 ;;
1231esac
90fb0c24 1232echo "$ac_t$dynamic_linker" 1>&6
6599da04
JM
1233test "$dynamic_linker" = no && can_build_shared=no
1234
4f4caf92
AO
1235# Check for command to grab the raw symbol name followed by C symbol from nm.
1236echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
1237
1238# These are sane defaults that work on at least a few old systems.
1239# [They come from Ultrix. What could be older than Ultrix?!! ;)]
1240
1241# Character class describing NM global symbol codes.
1242symcode='[BCDEGRST]'
1243
1244# Regexp to match symbols that can be accessed directly from C.
1245sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
1246
1247# Transform the above into a raw symbol and a C symbol.
1248symxfrm='\1 \2\3 \3'
1249
1250# Transform an extracted symbol line into a proper C declaration
1251global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
1252
1253# Define system-specific variables.
1254case "$host_os" in
1255aix*)
1256 symcode='[BCDT]'
1257 ;;
1258cygwin* | mingw*)
1259 symcode='[ABCDGISTW]'
1260 ;;
1261hpux*) # Its linker distinguishes data from code symbols
1262 global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
1263 ;;
1264irix*)
1265 symcode='[BCDEGRST]'
1266 ;;
1267solaris* | sysv5*)
1268 symcode='[BDT]'
1269 ;;
1270sysv4)
1271 symcode='[DFNSTU]'
1272 ;;
1273esac
1274
1275# Handle CRLF in mingw too chain
1276opt_cr=
1277case "$host_os" in
1278mingw*)
1279 opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
1280 ;;
1281esac
1282
1283# If we're using GNU nm, then use its standard symbol codes.
1284if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1285 symcode='[ABCDGISTW]'
1286fi
1287
1288# Try without a prefix undercore, then with it.
1289for ac_symprfx in "" "_"; do
1290
1291 # Write the raw and C identifiers.
1292global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
1293
1294 # Check to see that the pipe works correctly.
1295 pipe_works=no
1296 $rm conftest*
1297 cat > conftest.$ac_ext <<EOF
1298#ifdef __cplusplus
1299extern "C" {
1300#endif
1301char nm_test_var;
1302void nm_test_func(){}
1303#ifdef __cplusplus
1304}
1305#endif
1306main(){nm_test_var='a';nm_test_func();return(0);}
1307EOF
1308
1309 echo "$progname:1309: checking if global_symbol_pipe works" >&5
1310 if { (eval echo $progname:1310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
1311 # Now try to grab the symbols.
1312 nlist=conftest.nm
1313 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
1314
1315 # Try sorting and uniquifying the output.
1316 if sort "$nlist" | uniq > "$nlist"T; then
1317 mv -f "$nlist"T "$nlist"
1318 else
1319 rm -f "$nlist"T
1320 fi
1321
1322 # Make sure that we snagged all the symbols we need.
1323 if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1324 if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1325 cat <<EOF > conftest.$ac_ext
1326#ifdef __cplusplus
1327extern "C" {
1328#endif
1329
1330EOF
1331 # Now generate the symbol file.
1332 eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
1333
1334 cat <<EOF >> conftest.$ac_ext
1335#if defined (__STDC__) && __STDC__
1336# define lt_ptr_t void *
1337#else
1338# define lt_ptr_t char *
1339# define const
1340#endif
1341
1342/* The mapping between symbol names and symbols. */
1343const struct {
1344 const char *name;
1345 lt_ptr_t address;
1346}
1347lt_preloaded_symbols[] =
1348{
1349EOF
1350 sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.$ac_ext
1351 cat <<\EOF >> conftest.$ac_ext
1352 {0, (lt_ptr_t) 0}
1353};
1354
1355#ifdef __cplusplus
1356}
1357#endif
1358EOF
1359 # Now try linking the two files.
1360 mv conftest.$objext conftstm.$objext
1361 save_LIBS="$LIBS"
1362 save_CFLAGS="$CFLAGS"
1363 LIBS="conftstm.$objext"
1364 CFLAGS="$CFLAGS$no_builtin_flag"
1365 if { (eval echo $progname:1365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1366 pipe_works=yes
1367 else
1368 echo "$progname: failed program was:" >&5
1369 cat conftest.$ac_ext >&5
1370 fi
1371 LIBS="$save_LIBS"
1372 else
1373 echo "cannot find nm_test_func in $nlist" >&5
1374 fi
1375 else
1376 echo "cannot find nm_test_var in $nlist" >&5
1377 fi
1378 else
1379 echo "cannot run $global_symbol_pipe" >&5
1380 fi
1381 else
1382 echo "$progname: failed program was:" >&5
1383 cat conftest.$ac_ext >&5
1384 fi
1385 $rm conftest* conftst*
1386
1387 # Do not use the global_symbol_pipe unless it works.
1388 if test "$pipe_works" = yes; then
1389 break
1390 else
1391 global_symbol_pipe=
1392 fi
1393done
1394if test "$pipe_works" = yes; then
1395 echo "${ac_t}ok" 1>&6
1396else
1397 echo "${ac_t}failed" 1>&6
1398fi
1399
1400if test -z "$global_symbol_pipe"; then
1401 global_symbol_to_cdecl=
1402fi
1403
cf4ccd63 1404# Report the final consequences.
6599da04
JM
1405echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1406
d207ebef
JM
1407# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in
1408# configure.in, otherwise build static only libraries.
1409case "$host_os" in
1410cygwin* | mingw* | os2*)
1411 if test x$can_build_shared = xyes; then
1412 test x$enable_win32_dll = xno && can_build_shared=no
1413 echo "checking if package supports dlls... $can_build_shared" 1>&6
1414 fi
1415;;
1416esac
1417
6599da04
JM
1418echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
1419test "$can_build_shared" = "no" && enable_shared=no
1420
cf4ccd63
JL
1421# On AIX, shared libraries and static libraries use the same namespace, and
1422# are all built from PIC.
6599da04 1423case "$host_os" in
90fb0c24 1424aix3*)
6599da04
JM
1425 test "$enable_shared" = yes && enable_static=no
1426 if test -n "$RANLIB"; then
90fb0c24 1427 archive_cmds="$archive_cmds~\$RANLIB \$lib"
6599da04
JM
1428 postinstall_cmds='$RANLIB $lib'
1429 fi
1430 ;;
90fb0c24
TT
1431
1432aix4*)
1433 test "$enable_shared" = yes && enable_static=no
1434 ;;
6599da04
JM
1435esac
1436
cf4ccd63 1437echo "$ac_t$enable_shared" 1>&6
6599da04
JM
1438
1439# Make sure either enable_shared or enable_static is yes.
1440test "$enable_shared" = yes || enable_static=yes
1441
1442echo "checking whether to build static libraries... $enable_static" 1>&6
1443
4f4caf92 1444if test "$hardcode_action" = relink || test "$hardcode_into_libs" = all; then
90fb0c24
TT
1445 # Fast installation is not supported
1446 enable_fast_install=no
1447elif test "$shlibpath_overrides_runpath" = yes ||
1448 test "$enable_shared" = no; then
1449 # Fast installation is not necessary
1450 enable_fast_install=needless
1451fi
1452
4f4caf92
AO
1453variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
1454if test "$with_gcc" = yes; then
1455 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
cf4ccd63 1456fi
4f4caf92
AO
1457
1458# Check whether we must set pic_mode to default
1459test -z "$pic_flag" && pic_mode=default
cf4ccd63 1460
90fb0c24
TT
1461if test "x$enable_dlopen" != xyes; then
1462 enable_dlopen=unknown
1463 enable_dlopen_self=unknown
1464 enable_dlopen_self_static=unknown
1465else
4f4caf92 1466if test "X${lt_cv_dlopen+set}" != Xset; then
90fb0c24 1467 lt_cv_dlopen=no lt_cv_dlopen_libs=
d207ebef 1468echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
4f4caf92
AO
1469echo "$progname:1469: checking for dlopen in -ldl" >&5
1470if test "X${ac_cv_lib_dl_dlopen+set}" = Xset; then
90fb0c24
TT
1471 echo $ac_n "(cached) $ac_c" 1>&6
1472else
d207ebef
JM
1473 ac_save_LIBS="$LIBS"
1474LIBS="-ldl $LIBS"
1475cat > conftest.$ac_ext <<EOF
4f4caf92 1476#line 1476 "ltconfig"
90fb0c24
TT
1477/* Override any gcc2 internal prototype to avoid an error. */
1478/* We use char because int might match the return type of a gcc2
1479 builtin and then its argument prototype would still apply. */
d207ebef
JM
1480#ifdef __cplusplus
1481extern "C"
1482#endif
90fb0c24
TT
1483char dlopen();
1484
1485int main() {
d207ebef 1486dlopen()
90fb0c24
TT
1487; return 0; }
1488EOF
4f4caf92 1489if { (eval echo $progname:1489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
90fb0c24 1490 rm -rf conftest*
4f4caf92 1491 ac_cv_lib_dl_dlopen=yes
90fb0c24
TT
1492else
1493 echo "$progname: failed program was:" >&5
1494 cat conftest.$ac_ext >&5
1495 rm -rf conftest*
4f4caf92 1496 ac_cv_lib_dl_dlopen=no
90fb0c24
TT
1497fi
1498rm -f conftest*
d207ebef 1499LIBS="$ac_save_LIBS"
90fb0c24 1500
d207ebef 1501fi
4f4caf92 1502if test "X$ac_cv_lib_dl_dlopen" = Xyes; then
90fb0c24 1503 echo "$ac_t""yes" 1>&6
d207ebef 1504 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
90fb0c24
TT
1505else
1506 echo "$ac_t""no" 1>&6
d207ebef 1507echo $ac_n "checking for dlopen""... $ac_c" 1>&6
4f4caf92
AO
1508echo "$progname:1508: checking for dlopen" >&5
1509if test "X${ac_cv_func_dlopen+set}" = Xset; then
90fb0c24
TT
1510 echo $ac_n "(cached) $ac_c" 1>&6
1511else
d207ebef 1512 cat > conftest.$ac_ext <<EOF
4f4caf92 1513#line 1513 "ltconfig"
d207ebef
JM
1514/* System header to define __stub macros and hopefully few prototypes,
1515 which can conflict with char dlopen(); below. */
1516#include <assert.h>
90fb0c24
TT
1517/* Override any gcc2 internal prototype to avoid an error. */
1518/* We use char because int might match the return type of a gcc2
1519 builtin and then its argument prototype would still apply. */
d207ebef
JM
1520#ifdef __cplusplus
1521extern "C"
1522#endif
90fb0c24
TT
1523char dlopen();
1524
1525int main() {
d207ebef
JM
1526
1527/* The GNU C library defines this for functions which it implements
1528 to always fail with ENOSYS. Some functions are actually named
1529 something starting with __ and the normal name is an alias. */
1530#if defined (__stub_dlopen) || defined (__stub___dlopen)
1531choke me
1532#else
1533dlopen();
1534#endif
1535
90fb0c24
TT
1536; return 0; }
1537EOF
4f4caf92 1538if { (eval echo $progname:1538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
90fb0c24 1539 rm -rf conftest*
4f4caf92 1540 ac_cv_func_dlopen=yes
90fb0c24
TT
1541else
1542 echo "$progname: failed program was:" >&5
1543 cat conftest.$ac_ext >&5
1544 rm -rf conftest*
4f4caf92 1545 ac_cv_func_dlopen=no
90fb0c24
TT
1546fi
1547rm -f conftest*
90fb0c24 1548fi
4f4caf92 1549if test "X$ac_cv_func_dlopen" = Xyes; then
90fb0c24 1550 echo "$ac_t""yes" 1>&6
d207ebef 1551 lt_cv_dlopen="dlopen"
90fb0c24
TT
1552else
1553 echo "$ac_t""no" 1>&6
1554echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
4f4caf92
AO
1555echo "$progname:1555: checking for dld_link in -ldld" >&5
1556if test "X${ac_cv_lib_dld_dld_link+set}" = Xset; then
90fb0c24
TT
1557 echo $ac_n "(cached) $ac_c" 1>&6
1558else
1559 ac_save_LIBS="$LIBS"
1560LIBS="-ldld $LIBS"
1561cat > conftest.$ac_ext <<EOF
4f4caf92 1562#line 1562 "ltconfig"
90fb0c24
TT
1563/* Override any gcc2 internal prototype to avoid an error. */
1564/* We use char because int might match the return type of a gcc2
1565 builtin and then its argument prototype would still apply. */
d207ebef
JM
1566#ifdef __cplusplus
1567extern "C"
1568#endif
90fb0c24
TT
1569char dld_link();
1570
1571int main() {
1572dld_link()
1573; return 0; }
1574EOF
4f4caf92 1575if { (eval echo $progname:1575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
90fb0c24 1576 rm -rf conftest*
4f4caf92 1577 ac_cv_lib_dld_dld_link=yes
90fb0c24
TT
1578else
1579 echo "$progname: failed program was:" >&5
1580 cat conftest.$ac_ext >&5
1581 rm -rf conftest*
4f4caf92 1582 ac_cv_lib_dld_dld_link=no
90fb0c24
TT
1583fi
1584rm -f conftest*
1585LIBS="$ac_save_LIBS"
1586
1587fi
4f4caf92 1588if test "X$ac_cv_lib_dld_dld_link" = Xyes; then
90fb0c24
TT
1589 echo "$ac_t""yes" 1>&6
1590 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
1591else
1592 echo "$ac_t""no" 1>&6
1593echo $ac_n "checking for shl_load""... $ac_c" 1>&6
4f4caf92
AO
1594echo "$progname:1594: checking for shl_load" >&5
1595if test "X${ac_cv_func_shl_load+set}" = Xset; then
90fb0c24
TT
1596 echo $ac_n "(cached) $ac_c" 1>&6
1597else
1598 cat > conftest.$ac_ext <<EOF
4f4caf92 1599#line 1599 "ltconfig"
90fb0c24
TT
1600/* System header to define __stub macros and hopefully few prototypes,
1601 which can conflict with char shl_load(); below. */
1602#include <assert.h>
1603/* Override any gcc2 internal prototype to avoid an error. */
1604/* We use char because int might match the return type of a gcc2
1605 builtin and then its argument prototype would still apply. */
d207ebef
JM
1606#ifdef __cplusplus
1607extern "C"
1608#endif
90fb0c24
TT
1609char shl_load();
1610
1611int main() {
1612
1613/* The GNU C library defines this for functions which it implements
1614 to always fail with ENOSYS. Some functions are actually named
1615 something starting with __ and the normal name is an alias. */
1616#if defined (__stub_shl_load) || defined (__stub___shl_load)
1617choke me
1618#else
1619shl_load();
1620#endif
1621
1622; return 0; }
1623EOF
4f4caf92 1624if { (eval echo $progname:1624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
90fb0c24 1625 rm -rf conftest*
4f4caf92 1626 ac_cv_func_shl_load=yes
90fb0c24
TT
1627else
1628 echo "$progname: failed program was:" >&5
1629 cat conftest.$ac_ext >&5
1630 rm -rf conftest*
4f4caf92 1631 ac_cv_func_shl_load=no
90fb0c24
TT
1632fi
1633rm -f conftest*
1634fi
1635
4f4caf92 1636if test "X$ac_cv_func_shl_load" = Xyes; then
90fb0c24
TT
1637 echo "$ac_t""yes" 1>&6
1638 lt_cv_dlopen="shl_load"
1639else
1640 echo "$ac_t""no" 1>&6
d207ebef 1641echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
4f4caf92
AO
1642echo "$progname:1642: checking for shl_load in -ldld" >&5
1643if test "X${ac_cv_lib_dld_shl_load+set}" = Xset; then
90fb0c24
TT
1644 echo $ac_n "(cached) $ac_c" 1>&6
1645else
d207ebef
JM
1646 ac_save_LIBS="$LIBS"
1647LIBS="-ldld $LIBS"
1648cat > conftest.$ac_ext <<EOF
4f4caf92 1649#line 1649 "ltconfig"
d207ebef 1650#include "confdefs.h"
90fb0c24
TT
1651/* Override any gcc2 internal prototype to avoid an error. */
1652/* We use char because int might match the return type of a gcc2
1653 builtin and then its argument prototype would still apply. */
d207ebef
JM
1654#ifdef __cplusplus
1655extern "C"
90fb0c24 1656#endif
d207ebef 1657char shl_load();
90fb0c24 1658
d207ebef
JM
1659int main() {
1660shl_load()
90fb0c24
TT
1661; return 0; }
1662EOF
4f4caf92 1663if { (eval echo $progname:1663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
90fb0c24 1664 rm -rf conftest*
4f4caf92 1665 ac_cv_lib_dld_shl_load=yes
90fb0c24
TT
1666else
1667 echo "$progname: failed program was:" >&5
1668 cat conftest.$ac_ext >&5
1669 rm -rf conftest*
4f4caf92 1670 ac_cv_lib_dld_shl_load=no
90fb0c24
TT
1671fi
1672rm -f conftest*
d207ebef 1673LIBS="$ac_save_LIBS"
90fb0c24 1674
d207ebef 1675fi
4f4caf92 1676if test "X$ac_cv_lib_dld_shl_load" = Xyes; then
90fb0c24 1677 echo "$ac_t""yes" 1>&6
d207ebef 1678 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
90fb0c24
TT
1679else
1680 echo "$ac_t""no" 1>&6
1681fi
1682
d207ebef 1683
90fb0c24
TT
1684fi
1685
4f4caf92 1686
90fb0c24
TT
1687fi
1688
4f4caf92 1689
90fb0c24
TT
1690fi
1691
1692
1693fi
1694
1695fi
1696
1697 if test "x$lt_cv_dlopen" != xno; then
1698 enable_dlopen=yes
1699 fi
1700
1701 case "$lt_cv_dlopen" in
1702 dlopen)
1703for ac_hdr in dlfcn.h; do
1704ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1705echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4f4caf92
AO
1706echo "$progname:1706: checking for $ac_hdr" >&5
1707if eval "test \"`echo 'X$''{'ac_cv_header_$ac_safe'+set}'`\" = Xset"; then
90fb0c24
TT
1708 echo $ac_n "(cached) $ac_c" 1>&6
1709else
1710 cat > conftest.$ac_ext <<EOF
4f4caf92 1711#line 1711 "ltconfig"
90fb0c24
TT
1712#include <$ac_hdr>
1713int fnord = 0;
4f4caf92 1714int main () { return(0); }
90fb0c24 1715EOF
d207ebef 1716ac_try="$ac_compile >/dev/null 2>conftest.out"
4f4caf92 1717{ (eval echo $progname:1717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
90fb0c24
TT
1718ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1719if test -z "$ac_err"; then
1720 rm -rf conftest*
1721 eval "ac_cv_header_$ac_safe=yes"
1722else
1723 echo "$ac_err" >&5
1724 echo "$progname: failed program was:" >&5
1725 cat conftest.$ac_ext >&5
1726 rm -rf conftest*
1727 eval "ac_cv_header_$ac_safe=no"
1728fi
1729rm -f conftest*
1730fi
1731if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1732 echo "$ac_t""yes" 1>&6
1733else
1734 echo "$ac_t""no" 1>&6
1735fi
1736done
1737
1738 if test "x$ac_cv_header_dlfcn_h" = xyes; then
1739 CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1740 fi
1741 eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1742 LIBS="$lt_cv_dlopen_libs $LIBS"
1743
1744 echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
4f4caf92
AO
1745echo "$progname:1745: checking whether a program can dlopen itself" >&5
1746if test "X${lt_cv_dlopen_self+set}" = Xset; then
90fb0c24
TT
1747 echo $ac_n "(cached) $ac_c" 1>&6
1748else
1749 if test "$cross_compiling" = yes; then
1750 lt_cv_dlopen_self=cross
1751 else
1752 cat > conftest.c <<EOF
4f4caf92 1753#line 1753 "ltconfig"
90fb0c24
TT
1754
1755#if HAVE_DLFCN_H
1756#include <dlfcn.h>
1757#endif
1758
1759#include <stdio.h>
1760
1761#ifdef RTLD_GLOBAL
1762# define LTDL_GLOBAL RTLD_GLOBAL
1763#else
1764# ifdef DL_GLOBAL
1765# define LTDL_GLOBAL DL_GLOBAL
1766# else
1767# define LTDL_GLOBAL 0
1768# endif
1769#endif
1770
1771/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
1772 find out it does not work in some platform. */
1773#ifndef LTDL_LAZY_OR_NOW
1774# ifdef RTLD_LAZY
1775# define LTDL_LAZY_OR_NOW RTLD_LAZY
1776# else
1777# ifdef DL_LAZY
1778# define LTDL_LAZY_OR_NOW DL_LAZY
1779# else
1780# ifdef RTLD_NOW
1781# define LTDL_LAZY_OR_NOW RTLD_NOW
1782# else
1783# ifdef DL_NOW
1784# define LTDL_LAZY_OR_NOW DL_NOW
1785# else
1786# define LTDL_LAZY_OR_NOW 0
1787# endif
1788# endif
1789# endif
1790# endif
1791#endif
1792
1793fnord() { int i=42;}
1794main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
1795 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
4f4caf92 1796 if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
90fb0c24
TT
1797
1798EOF
4f4caf92 1799if { (eval echo $progname:1799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
90fb0c24
TT
1800then
1801 lt_cv_dlopen_self=yes
1802else
1803 echo "$progname: failed program was:" >&5
1804 cat conftest.$ac_ext >&5
1805 rm -fr conftest*
1806 lt_cv_dlopen_self=no
1807fi
1808rm -fr conftest*
1809fi
1810
1811fi
1812
1813echo "$ac_t""$lt_cv_dlopen_self" 1>&6
1814
1815 if test "$lt_cv_dlopen_self" = yes; then
1816 LDFLAGS="$LDFLAGS $link_static_flag"
1817 echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
4f4caf92
AO
1818echo "$progname:1818: checking whether a statically linked program can dlopen itself" >&5
1819if test "X${lt_cv_dlopen_self_static+set}" = Xset; then
90fb0c24
TT
1820 echo $ac_n "(cached) $ac_c" 1>&6
1821else
1822 if test "$cross_compiling" = yes; then
1823 lt_cv_dlopen_self_static=cross
1824 else
1825 cat > conftest.c <<EOF
4f4caf92 1826#line 1826 "ltconfig"
90fb0c24
TT
1827
1828#if HAVE_DLFCN_H
1829#include <dlfcn.h>
1830#endif
1831
1832#include <stdio.h>
1833
1834#ifdef RTLD_GLOBAL
1835# define LTDL_GLOBAL RTLD_GLOBAL
1836#else
1837# ifdef DL_GLOBAL
1838# define LTDL_GLOBAL DL_GLOBAL
1839# else
1840# define LTDL_GLOBAL 0
1841# endif
1842#endif
1843
1844/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
1845 find out it does not work in some platform. */
1846#ifndef LTDL_LAZY_OR_NOW
1847# ifdef RTLD_LAZY
1848# define LTDL_LAZY_OR_NOW RTLD_LAZY
1849# else
1850# ifdef DL_LAZY
1851# define LTDL_LAZY_OR_NOW DL_LAZY
1852# else
1853# ifdef RTLD_NOW
1854# define LTDL_LAZY_OR_NOW RTLD_NOW
1855# else
1856# ifdef DL_NOW
1857# define LTDL_LAZY_OR_NOW DL_NOW
1858# else
1859# define LTDL_LAZY_OR_NOW 0
1860# endif
1861# endif
1862# endif
1863# endif
1864#endif
1865
1866fnord() { int i=42;}
1867main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
1868 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
4f4caf92 1869 if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
90fb0c24
TT
1870
1871EOF
4f4caf92 1872if { (eval echo $progname:1872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
90fb0c24
TT
1873then
1874 lt_cv_dlopen_self_static=yes
1875else
1876 echo "$progname: failed program was:" >&5
1877 cat conftest.$ac_ext >&5
1878 rm -fr conftest*
1879 lt_cv_dlopen_self_static=no
1880fi
1881rm -fr conftest*
1882fi
1883
1884fi
1885
1886echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
1887fi
1888 ;;
1889 esac
1890
1891 case "$lt_cv_dlopen_self" in
1892 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1893 *) enable_dlopen_self=unknown ;;
1894 esac
1895
1896 case "$lt_cv_dlopen_self_static" in
1897 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1898 *) enable_dlopen_self_static=unknown ;;
1899 esac
1900fi
1901
cf4ccd63
JL
1902# Copy echo and quote the copy, instead of the original, because it is
1903# used later.
1904ltecho="$echo"
90fb0c24
TT
1905if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then
1906 ltecho="$CONFIG_SHELL \$0 --fallback-echo"
1907fi
1908LTSHELL="$SHELL"
cf4ccd63 1909
90fb0c24
TT
1910LTCONFIG_VERSION="$VERSION"
1911
1912# Only quote variables if we're using ltmain.sh.
1913case "$ltmain" in
1914*.sh)
1915 # Now quote all the things that may contain metacharacters.
4f4caf92
AO
1916 for var in ltecho old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \
1917 old_MAGIC old_LD old_LDFLAGS old_LIBS \
1918 old_LN_S old_NM old_RANLIB old_STRIP \
1919 old_AS old_DLLTOOL old_OBJDUMP \
1920 old_OBJEXT old_EXEEXT old_reload_flag \
1921 old_deplibs_check_method old_file_magic_cmd \
1922 AR AR_FLAGS CC LTCC LD LN_S NM LTSHELL LTCONFIG_VERSION \
90fb0c24
TT
1923 reload_flag reload_cmds wl \
1924 pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
1925 thread_safe_flag_spec whole_archive_flag_spec libname_spec \
1926 library_names_spec soname_spec \
1927 RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
4f4caf92
AO
1928 old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
1929 postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
1930 predep_objects postdep_objects predeps postdeps compiler_lib_search_path \
1931 old_striplib striplib file_magic_cmd export_symbols_cmds \
1932 deplibs_check_method allow_undefined_flag no_undefined_flag \
90fb0c24
TT
1933 finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
1934 hardcode_libdir_flag_spec hardcode_libdir_separator \
1935 sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
4f4caf92 1936 compiler_c_o need_locks exclude_expsyms include_expsyms; do
90fb0c24
TT
1937
1938 case "$var" in
1939 reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
1940 old_postinstall_cmds | old_postuninstall_cmds | \
1941 export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
4f4caf92 1942 extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
90fb0c24
TT
1943 postinstall_cmds | postuninstall_cmds | \
1944 finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
1945 # Double-quote double-evaled strings.
4f4caf92 1946 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
1947 ;;
1948 *)
4f4caf92 1949 eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ### testsuite: skip nested quoting test
90fb0c24
TT
1950 ;;
1951 esac
1952 done
1953
1954 case "$ltecho" in
1955 *'\$0 --fallback-echo"')
1956 ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
cf4ccd63
JL
1957 ;;
1958 esac
6599da04 1959
4f4caf92
AO
1960 if test -z "$tagname"; then
1961 trap "$rm \"$ofile\"; exit 1" 1 2 15
1962 echo "creating $ofile"
1963 $rm "$ofile"
1964 cat <<EOF > "$ofile"
cf4ccd63
JL
1965#! $SHELL
1966
1967# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
90fb0c24 1968# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
cf4ccd63
JL
1969# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
1970#
4f4caf92 1971# Copyright (C) 1996-2000 Free Software Foundation, Inc.
d207ebef 1972# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
cf4ccd63
JL
1973#
1974# This program is free software; you can redistribute it and/or modify
1975# it under the terms of the GNU General Public License as published by
1976# the Free Software Foundation; either version 2 of the License, or
1977# (at your option) any later version.
1978#
1979# This program is distributed in the hope that it will be useful, but
1980# WITHOUT ANY WARRANTY; without even the implied warranty of
1981# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1982# General Public License for more details.
1983#
1984# You should have received a copy of the GNU General Public License
1985# along with this program; if not, write to the Free Software
1986# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1987#
1988# As a special exception to the GNU General Public License, if you
1989# distribute this file as part of a program that contains a
1990# configuration script generated by Autoconf, you may include it under
1991# the same distribution terms that you use for the rest of that program.
1992
1993# Sed that helps us avoid accidentally triggering echo(1) options like -n.
1994Xsed="sed -e s/^X//"
1995
1996# The HP-UX ksh and POSIX shell print the target directory to stdout
1997# if CDPATH is set.
d207ebef 1998if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
cf4ccd63 1999
4f4caf92
AO
2000# The names of the tagged configurations supported by this script.
2001available_tags=
2002
cf4ccd63 2003### BEGIN LIBTOOL CONFIG
90fb0c24 2004EOF
4f4caf92
AO
2005 else
2006 echo "appending configuration tag \"$tagname\" to $ofile"
2007 echo "### BEGIN LIBTOOL TAG CONFIG: $tagname" >> "$ofile"
2008 fi
90fb0c24
TT
2009 cfgfile="$ofile"
2010 ;;
2011
2012*)
2013 # Double-quote the variables that need it (for aesthetics).
4f4caf92
AO
2014 for var in old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \
2015 old_MAGIC old_LD old_LDFLAGS old_LIBS \
2016 old_LN_S old_NM old_RANLIB old_STRIP \
2017 old_AS old_DLLTOOL old_OBJDUMP \
2018 old_OBJEXT old_EXEEXT old_reload_flag \
2019 old_deplibs_check_method old_file_magic_cmd; do
90fb0c24
TT
2020 eval "$var=\\\"\$var\\\""
2021 done
2022
2023 # Just create a config file.
2024 cfgfile="$ofile.cfg"
4f4caf92
AO
2025 if test -z "$tagname"; then
2026 trap "$rm \"$cfgfile\"; exit 1" 1 2 15
2027 echo "creating $cfgfile"
2028 $rm "$cfgfile"
2029 cat <<EOF > "$cfgfile"
90fb0c24
TT
2030# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
2031# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
4f4caf92
AO
2032
2033### BEGIN LIBTOOL CONFIG
90fb0c24 2034EOF
4f4caf92
AO
2035 else
2036 echo "appending to $cfgfile"
2037 echo "### BEGIN LIBTOOL TAG CONFIG: $tagname" >> "$ofile"
2038 fi
90fb0c24
TT
2039 ;;
2040esac
2041
2042cat <<EOF >> "$cfgfile"
cf4ccd63 2043# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
6599da04 2044#
4f4caf92
AO
2045# AR=$old_AR AR_FLAGS=$old_AR_FLAGS LTCC=$old_LTCC CC=$old_CC \\
2046# CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
2047# MAGIC=$old_MAGIC LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\
2048# LN_S=$old_LN_S NM=$old_NM RANLIB=$old_RANLIB STRIP=$old_STRIP \\
2049# AS=$old_AS DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP \\
2050# objext=$old_OBJEXT exeext=$old_EXEEXT reload_flag=$old_reload_flag \\
2051# deplibs_check_method=$old_deplibs_check_method \\
2052# file_magic_cmd=$old_file_magic_cmd \\
6599da04
JM
2053# $0$ltconfig_args
2054#
2055# Compiler and other test output produced by $progname, useful for
2056# debugging $progname, is in ./config.log if it exists.
2057
2058# The version of $progname that generated this script.
90fb0c24 2059LTCONFIG_VERSION=$LTCONFIG_VERSION
6599da04 2060
cf4ccd63 2061# Shell to use when invoking shell scripts.
90fb0c24 2062SHELL=$LTSHELL
cf4ccd63
JL
2063
2064# Whether or not to build shared libraries.
6599da04
JM
2065build_libtool_libs=$enable_shared
2066
4f4caf92
AO
2067# Whether or not to add -lc for building shared libraries.
2068build_libtool_need_lc=$need_lc
2069
cf4ccd63 2070# Whether or not to build static libraries.
6599da04
JM
2071build_old_libs=$enable_static
2072
90fb0c24
TT
2073# Whether or not to optimize for fast installation.
2074fast_install=$enable_fast_install
2075
6599da04 2076# The host system.
90fb0c24
TT
2077host_alias=$host_alias
2078host=$host
6599da04 2079
cf4ccd63 2080# An echo program that does not interpret backslashes.
90fb0c24 2081echo=$ltecho
cf4ccd63 2082
6599da04 2083# The archiver.
90fb0c24 2084AR=$AR
4f4caf92 2085AR_FLAGS=$AR_FLAGS
cf4ccd63 2086
4f4caf92
AO
2087# A C compiler.
2088LTCC=$LTCC
2089
2090# A language-specific compiler.
90fb0c24 2091CC=$CC
6599da04
JM
2092
2093# The linker used to build libraries.
90fb0c24 2094LD=$LD
6599da04
JM
2095
2096# Whether we need hard or soft links.
90fb0c24 2097LN_S=$LN_S
cf4ccd63
JL
2098
2099# A BSD-compatible nm program.
90fb0c24 2100NM=$NM
cf4ccd63 2101
4f4caf92
AO
2102# A symbol stripping program
2103STRIP=$STRIP
2104
2105# Used to examine libraries when file_magic_cmd begins "file"
2106MAGIC=$MAGIC
2107
90fb0c24 2108# Used on cygwin: DLL creation program.
cf4ccd63
JL
2109DLLTOOL="$DLLTOOL"
2110
d207ebef
JM
2111# Used on cygwin: object dumper.
2112OBJDUMP="$OBJDUMP"
2113
90fb0c24 2114# Used on cygwin: assembler.
cf4ccd63
JL
2115AS="$AS"
2116
2117# The name of the directory that contains temporary libtool files.
90fb0c24 2118objdir=$objdir
6599da04
JM
2119
2120# How to create reloadable object files.
90fb0c24
TT
2121reload_flag=$reload_flag
2122reload_cmds=$reload_cmds
6599da04
JM
2123
2124# How to pass a linker flag through the compiler.
90fb0c24 2125wl=$wl
6599da04 2126
fbd836fc
ILT
2127# Object file suffix (normally "o").
2128objext="$objext"
2129
2130# Old archive suffix (normally "a").
2131libext="$libext"
2132
d207ebef
JM
2133# Executable file suffix (normally "").
2134exeext="$exeext"
2135
6599da04 2136# Additional compiler flags for building library objects.
90fb0c24 2137pic_flag=$pic_flag
4f4caf92 2138pic_mode=$pic_mode
90fb0c24 2139
d207ebef 2140# Does compiler simultaneously support -c and -o options?
90fb0c24
TT
2141compiler_c_o=$compiler_c_o
2142
90fb0c24
TT
2143# Must we lock files when doing compilation ?
2144need_locks=$need_locks
2145
2146# Do we need the lib prefix for modules?
2147need_lib_prefix=$need_lib_prefix
2148
2149# Do we need a version for libraries?
2150need_version=$need_version
2151
2152# Whether dlopen is supported.
4f4caf92 2153dlopen_support=$enable_dlopen
90fb0c24
TT
2154
2155# Whether dlopen of programs is supported.
2156dlopen_self=$enable_dlopen_self
2157
2158# Whether dlopen of statically linked programs is supported.
2159dlopen_self_static=$enable_dlopen_self_static
6599da04
JM
2160
2161# Compiler flag to prevent dynamic linking.
90fb0c24 2162link_static_flag=$link_static_flag
6599da04 2163
cf4ccd63 2164# Compiler flag to turn off builtin functions.
90fb0c24 2165no_builtin_flag=$no_builtin_flag
6599da04 2166
cf4ccd63 2167# Compiler flag to allow reflexive dlopens.
90fb0c24 2168export_dynamic_flag_spec=$export_dynamic_flag_spec
6599da04 2169
fbd836fc 2170# Compiler flag to generate shared objects directly from archives.
90fb0c24
TT
2171whole_archive_flag_spec=$whole_archive_flag_spec
2172
2173# Compiler flag to generate thread-safe objects.
2174thread_safe_flag_spec=$thread_safe_flag_spec
fbd836fc 2175
6599da04
JM
2176# Library versioning type.
2177version_type=$version_type
2178
cf4ccd63 2179# Format of library name prefix.
90fb0c24 2180libname_spec=$libname_spec
cf4ccd63 2181
6599da04
JM
2182# List of archive names. First name is the real one, the rest are links.
2183# The last name is the one that the linker finds with -lNAME.
90fb0c24 2184library_names_spec=$library_names_spec
6599da04
JM
2185
2186# The coded name of the library, if different from the real name.
90fb0c24 2187soname_spec=$soname_spec
6599da04
JM
2188
2189# Commands used to build and install an old-style archive.
90fb0c24
TT
2190RANLIB=$RANLIB
2191old_archive_cmds=$old_archive_cmds
2192old_postinstall_cmds=$old_postinstall_cmds
2193old_postuninstall_cmds=$old_postuninstall_cmds
cf4ccd63
JL
2194
2195# Create an old-style archive from a shared archive.
90fb0c24 2196old_archive_from_new_cmds=$old_archive_from_new_cmds
6599da04 2197
4f4caf92
AO
2198# Create a temporary old-style archive to link instead of a shared archive.
2199old_archive_from_expsyms_cmds=$old_archive_from_expsyms_cmds
2200
6599da04 2201# Commands used to build and install a shared archive.
90fb0c24
TT
2202archive_cmds=$archive_cmds
2203archive_expsym_cmds=$archive_expsym_cmds
2204postinstall_cmds=$postinstall_cmds
2205postuninstall_cmds=$postuninstall_cmds
2206
4f4caf92
AO
2207# Commands to strip libraries.
2208old_striplib=$old_striplib
2209striplib=$striplib
2210
2211# Dependencies to place before the objects being linked to create a
2212# shared library.
2213predep_objects=$predep_objects
2214
2215# Dependencies to place after the objects being linked to create a
2216# shared library.
2217postdep_objects=$postdep_objects
2218
2219# Dependencies to place before the objects being linked to create a
2220# shared library.
2221predeps=$predeps
2222
2223# Dependencies to place after the objects being linked to create a
2224# shared library.
2225postdeps=$postdeps
2226
2227# The library search path used internally by the compiler when linking
2228# a shared library.
2229compiler_lib_search_path=$compiler_lib_search_path
2230
90fb0c24
TT
2231# Method to check whether dependent libraries are shared objects.
2232deplibs_check_method=$deplibs_check_method
2233
d207ebef 2234# Command to use when deplibs_check_method == file_magic.
90fb0c24 2235file_magic_cmd=$file_magic_cmd
6599da04
JM
2236
2237# Flag that allows shared libraries with undefined symbols to be built.
90fb0c24 2238allow_undefined_flag=$allow_undefined_flag
cf4ccd63
JL
2239
2240# Flag that forces no undefined symbols.
90fb0c24 2241no_undefined_flag=$no_undefined_flag
6599da04
JM
2242
2243# Commands used to finish a libtool library installation in a directory.
90fb0c24 2244finish_cmds=$finish_cmds
cf4ccd63
JL
2245
2246# Same as above, but a single script fragment to be evaled but not shown.
90fb0c24 2247finish_eval=$finish_eval
6599da04 2248
cf4ccd63 2249# Take the output of nm and produce a listing of raw symbols and C names.
90fb0c24
TT
2250global_symbol_pipe=$global_symbol_pipe
2251
2252# Transform the output of nm in a proper C declaration
2253global_symbol_to_cdecl=$global_symbol_to_cdecl
6599da04
JM
2254
2255# This is the shared library runtime path variable.
2256runpath_var=$runpath_var
2257
2258# This is the shared library path variable.
2259shlibpath_var=$shlibpath_var
2260
90fb0c24
TT
2261# Is shlibpath searched before the hard-coded library search path?
2262shlibpath_overrides_runpath=$shlibpath_overrides_runpath
2263
6599da04
JM
2264# How to hardcode a shared library path into an executable.
2265hardcode_action=$hardcode_action
2266
4f4caf92
AO
2267# Whether we should hardcode library paths into libraries.
2268hardcode_into_libs=$hardcode_into_libs
2269
6599da04
JM
2270# Flag to hardcode \$libdir into a binary during linking.
2271# This must work even if \$libdir does not exist.
90fb0c24 2272hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
6599da04
JM
2273
2274# Whether we need a single -rpath flag with a separated argument.
90fb0c24 2275hardcode_libdir_separator=$hardcode_libdir_separator
6599da04
JM
2276
2277# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
2278# resulting binary.
2279hardcode_direct=$hardcode_direct
2280
2281# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
2282# resulting binary.
2283hardcode_minus_L=$hardcode_minus_L
2284
6599da04
JM
2285# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
2286# the resulting binary.
2287hardcode_shlibpath_var=$hardcode_shlibpath_var
fbd836fc 2288
4f4caf92
AO
2289# Variables whose values should be saved in libtool wrapper scripts and
2290# restored at relink time.
2291variables_saved_for_relink="$variables_saved_for_relink"
2292
2293# Whether libtool must link a program against all its dependency libraries.
2294link_all_deplibs=$link_all_deplibs
2295
90fb0c24
TT
2296# Compile-time system search path for libraries
2297sys_lib_search_path_spec=$sys_lib_search_path_spec
2298
2299# Run-time system search path for libraries
2300sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
2301
fbd836fc
ILT
2302# Fix the shell variable \$srcfile for the compiler.
2303fix_srcfile_path="$fix_srcfile_path"
90fb0c24 2304
d207ebef 2305# Set to yes if exported symbols are required.
90fb0c24
TT
2306always_export_symbols=$always_export_symbols
2307
d207ebef 2308# The commands to list exported symbols.
90fb0c24
TT
2309export_symbols_cmds=$export_symbols_cmds
2310
4f4caf92
AO
2311# The commands to extract the exported symbol list from a shared archive.
2312extract_expsyms_cmds=$extract_expsyms_cmds
2313
d207ebef 2314# Symbols that should not be listed in the preloaded symbols.
90fb0c24
TT
2315exclude_expsyms=$exclude_expsyms
2316
d207ebef 2317# Symbols that must always be exported.
90fb0c24
TT
2318include_expsyms=$include_expsyms
2319
6599da04
JM
2320EOF
2321
4f4caf92
AO
2322if test -z "$tagname"; then
2323 echo '### END LIBTOOL CONFIG' >> "$ofile"
2324else
2325 echo "### END LIBTOOL TAG CONFIG: $tagname" >> "$ofile"
2326fi
2327
90fb0c24
TT
2328case "$ltmain" in
2329*.sh)
90fb0c24 2330 echo >> "$ofile"
4f4caf92
AO
2331 if test -z "$tagname"; then
2332 case "$host_os" in
2333 aix3*)
2334 cat <<\EOF >> "$ofile"
cf4ccd63
JL
2335
2336# AIX sometimes has problems with the GCC collect2 program. For some
2337# reason, if we set the COLLECT_NAMES environment variable, the problems
2338# vanish in a puff of smoke.
d207ebef 2339if test "X${COLLECT_NAMES+set}" != Xset; then
cf4ccd63
JL
2340 COLLECT_NAMES=
2341 export COLLECT_NAMES
2342fi
4f4caf92
AO
2343EOF
2344 ;;
2345 esac
2346 case "$host" in
2347 *-*-cygwin* | *-*-mingw* | *-*-os2*)
2348 cat <<'EOF' >> "$ofile"
2349 # This is a source program that is used to create dlls on Windows
2350 # Don't remove nor modify the starting and closing comments
2351# /* ltdll.c starts here */
2352# #define WIN32_LEAN_AND_MEAN
2353# #include <windows.h>
2354# #undef WIN32_LEAN_AND_MEAN
2355# #include <stdio.h>
2356#
2357# #ifndef __CYGWIN__
2358# # ifdef __CYGWIN32__
2359# # define __CYGWIN__ __CYGWIN32__
2360# # endif
2361# #endif
2362#
2363# #ifdef __cplusplus
2364# extern "C" {
2365# #endif
2366# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
2367# #ifdef __cplusplus
2368# }
2369# #endif
2370#
2371# #ifdef __CYGWIN__
2372# #include <cygwin/cygwin_dll.h>
2373# DECLARE_CYGWIN_DLL( DllMain );
2374# #endif
2375# HINSTANCE __hDllInstance_base;
2376#
2377# BOOL APIENTRY
2378# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
2379# {
2380# __hDllInstance_base = hInst;
2381# return TRUE;
2382# }
2383# /* ltdll.c ends here */
2384 # This is a source program that is used to create import libraries
2385 # on Windows for dlls which lack them. Don't remove nor modify the
2386 # starting and closing comments
2387# /* impgen.c starts here */
2388# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
2389#
2390# This file is part of GNU libtool.
2391#
2392# This program is free software; you can redistribute it and/or modify
2393# it under the terms of the GNU General Public License as published by
2394# the Free Software Foundation; either version 2 of the License, or
2395# (at your option) any later version.
2396#
2397# This program is distributed in the hope that it will be useful,
2398# but WITHOUT ANY WARRANTY; without even the implied warranty of
2399# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2400# GNU General Public License for more details.
2401#
2402# You should have received a copy of the GNU General Public License
2403# along with this program; if not, write to the Free Software
2404# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2405# */
2406#
2407# #include <stdio.h> /* for printf() */
2408# #include <unistd.h> /* for open(), lseek(), read() */
2409# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
2410# #include <string.h> /* for strdup() */
2411#
2412# /* O_BINARY isn't required (or even defined sometimes) under Unix */
2413# #ifndef O_BINARY
2414# #define O_BINARY 0
2415# #endif
2416#
2417# static unsigned int
2418# pe_get16 (fd, offset)
2419# int fd;
2420# int offset;
2421# {
2422# unsigned char b[2];
2423# lseek (fd, offset, SEEK_SET);
2424# read (fd, b, 2);
2425# return b[0] + (b[1]<<8);
2426# }
2427#
2428# static unsigned int
2429# pe_get32 (fd, offset)
2430# int fd;
2431# int offset;
2432# {
2433# unsigned char b[4];
2434# lseek (fd, offset, SEEK_SET);
2435# read (fd, b, 4);
2436# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
2437# }
2438#
2439# static unsigned int
2440# pe_as32 (ptr)
2441# void *ptr;
2442# {
2443# unsigned char *b = ptr;
2444# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
2445# }
2446#
2447# int
2448# main (argc, argv)
2449# int argc;
2450# char *argv[];
2451# {
2452# int dll;
2453# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
2454# unsigned long export_rva, export_size, nsections, secptr, expptr;
2455# unsigned long name_rvas, nexp;
2456# unsigned char *expdata, *erva;
2457# char *filename, *dll_name;
2458#
2459# filename = argv[1];
2460#
2461# dll = open(filename, O_RDONLY|O_BINARY);
2462# if (!dll)
2463# return 1;
2464#
2465# dll_name = filename;
2466#
2467# for (i=0; filename[i]; i++)
2468# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
2469# dll_name = filename + i +1;
2470#
2471# pe_header_offset = pe_get32 (dll, 0x3c);
2472# opthdr_ofs = pe_header_offset + 4 + 20;
2473# num_entries = pe_get32 (dll, opthdr_ofs + 92);
2474#
2475# if (num_entries < 1) /* no exports */
2476# return 1;
2477#
2478# export_rva = pe_get32 (dll, opthdr_ofs + 96);
2479# export_size = pe_get32 (dll, opthdr_ofs + 100);
2480# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
2481# secptr = (pe_header_offset + 4 + 20 +
2482# pe_get16 (dll, pe_header_offset + 4 + 16));
2483#
2484# expptr = 0;
2485# for (i = 0; i < nsections; i++)
2486# {
2487# char sname[8];
2488# unsigned long secptr1 = secptr + 40 * i;
2489# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
2490# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
2491# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
2492# lseek(dll, secptr1, SEEK_SET);
2493# read(dll, sname, 8);
2494# if (vaddr <= export_rva && vaddr+vsize > export_rva)
2495# {
2496# expptr = fptr + (export_rva - vaddr);
2497# if (export_rva + export_size > vaddr + vsize)
2498# export_size = vsize - (export_rva - vaddr);
2499# break;
2500# }
2501# }
2502#
2503# expdata = (unsigned char*)malloc(export_size);
2504# lseek (dll, expptr, SEEK_SET);
2505# read (dll, expdata, export_size);
2506# erva = expdata - export_rva;
2507#
2508# nexp = pe_as32 (expdata+24);
2509# name_rvas = pe_as32 (expdata+32);
2510#
2511# printf ("EXPORTS\n");
2512# for (i = 0; i<nexp; i++)
2513# {
2514# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
2515# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
2516# }
2517#
2518# return 0;
2519# }
2520# /* impgen.c ends here */
2521
cf4ccd63 2522EOF
90fb0c24
TT
2523 ;;
2524 esac
2525
90fb0c24 2526
4f4caf92
AO
2527 # Append the ltmain.sh script.
2528 sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
2529 # We use sed instead of cat because bash on DJGPP gets confused if
2530 # if finds mixed CR/LF and LF-only lines. Since sed operates in
2531 # text mode, it properly converts lines to CR/LF. This bash problem
2532 # is reportedly fixed, but why not run on old versions too?
2533
2534 chmod +x "$ofile"
2535 fi
90fb0c24
TT
2536 ;;
2537
2538*)
2539 # Compile the libtool program.
2540 echo "FIXME: would compile $ltmain"
6599da04
JM
2541 ;;
2542esac
2543
4f4caf92
AO
2544# Update the list of available tags.
2545if test -n "$tagname"; then
2546
2547 # Extract list of available tagged configurations in $ofile.
2548 # Note that this assumes the entire list is on one line.
2549 available_tags=`grep "^available_tags=" $ofile | sed -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
2550
2551 # Append the new tag name to the list of available tags.
2552 available_tags="$available_tags $tagname"
2553
2554 # Now substitute the updated of available tags.
2555 if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' ${ofile} > ${ofile}.new"; then
2556 mv ${ofile}.new ${ofile}
2557 chmod +x "$ofile"
2558 else
2559 rm -f ${ofile}.new
2560 echo "$progname: unable to update list of available tagged configurations."
2561 exit 1
2562 fi
2563fi
2564
2565# Don't cache tagged configuration!
2566test -n "$cache_file" && test -z "$tagname" || exit 0
cf4ccd63 2567
90fb0c24
TT
2568# AC_CACHE_SAVE
2569trap '' 1 2 15
2570cat > confcache <<\EOF
2571# This file is a shell script that caches the results of configure
2572# tests run on this system so they can be shared between configure
2573# scripts and configure runs. It is not useful on other systems.
2574# If it contains results you don't want to keep, you may remove or edit it.
2575#
2576# By default, configure uses ./config.cache as the cache file,
2577# creating it if it does not exist already. You can give configure
2578# the --cache-file=FILE option to use a different cache file; that is
2579# what configure does when it calls configure scripts in
2580# subdirectories, so they share the cache.
2581# Giving --cache-file=/dev/null disables caching, for debugging configure.
2582# config.status only pays attention to the cache file if you give it the
2583# --recheck option to rerun configure.
2584#
2585EOF
2586# The following way of writing the cache mishandles newlines in values,
2587# but we know of no workaround that is simple, portable, and efficient.
2588# So, don't put newlines in cache variables' values.
2589# Ultrix sh set writes to stderr and can't be redirected directly,
2590# and sets the high bit in the cache file unless we assign to the vars.
2591(set) 2>&1 |
2592 case `(ac_space=' '; set | grep ac_space) 2>&1` in
2593 *ac_space=\ *)
2594 # `set' does not quote correctly, so add quotes (double-quote substitution
2595 # turns \\\\ into \\, and sed turns \\ into \).
2596 sed -n \
2597 -e "s/'/'\\\\''/g" \
2598 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2599 ;;
2600 *)
2601 # `set' quotes correctly as required by POSIX, so do not add quotes.
2602 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2603 ;;
2604 esac >> confcache
2605if cmp -s $cache_file confcache; then
2606 :
2607else
2608 if test -w $cache_file; then
2609 echo "updating cache $cache_file"
2610 cat confcache > $cache_file
2611 else
2612 echo "not updating unwritable cache $cache_file"
2613 fi
2614fi
2615rm -f confcache
6599da04 2616
6599da04
JM
2617exit 0
2618
2619# Local Variables:
2620# mode:shell-script
2621# sh-indentation:2
2622# End:
This page took 0.460445 seconds and 5 git commands to generate.