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