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