]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - ltconfig
* config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
[thirdparty/binutils-gdb.git] / ltconfig
CommitLineData
fd3f7b52
ILT
1#! /bin/sh
2
3# ltconfig - Create a system-specific libtool.
4# Copyright (C) 1996-1998 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
c0dea852
ILT
28# Check that we are running under the correct shell.
29SHELL=${CONFIG_SHELL-/bin/sh}
99e9c6f7
ILT
30echo=echo
31if test "X$1" = X--no-reexec; then
c0dea852
ILT
32 # Discard the --no-reexec flag, and continue.
33 shift
99e9c6f7
ILT
34elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
36 :
37else
c0dea852
ILT
38 # Restart under the correct shell.
39 exec "$SHELL" "$0" --no-reexec ${1+"$@"}
40fi
41
fd3f7b52
ILT
42# The HP-UX ksh and POSIX shell print the target directory to stdout
43# if CDPATH is set.
44if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
45
99e9c6f7 46if test "X`($echo '\t') 2>/dev/null`" != 'X\t'; then
c0dea852
ILT
47 # The Solaris, AIX, and Digital Unix default echo programs unquote
48 # backslashes. This makes it impossible to quote backslashes using
fd3f7b52 49 # echo "$something" | sed 's/\\/\\\\/g'
c0dea852
ILT
50 #
51 # So, first we look for a working echo in the user's PATH.
52 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
53 for dir in $PATH /usr/ucb; do
54 if test -f $dir/echo && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t'; then
55 echo="$dir/echo"
56 break
57 fi
58 done
59 IFS="$save_ifs"
60
61 if test "X$echo" = Xecho; then
62 # We didn't find a better echo, so look for alternatives.
63 if test "X`(print -r '\t') 2>/dev/null`" = 'X\t'; then
64 # This shell has a builtin print -r that does the trick.
65 echo='print -r'
99e9c6f7
ILT
66 elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then
67 # If we have ksh, try running ltconfig again with it.
68 CONFIG_SHELL=/bin/ksh
69 export CONFIG_SHELL
70 exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
c0dea852
ILT
71 else
72 # Try using printf.
73 echo='printf %s\n'
99e9c6f7 74 if test "X`($echo '\t') 2>/dev/null`" != 'X\t'; then
c0dea852
ILT
75 # Oops. We lost completely, so just stick with echo.
76 echo=echo
fd3f7b52 77 fi
c0dea852 78 fi
fd3f7b52
ILT
79 fi
80fi
81
82# Sed substitution that helps us do robust quoting. It backslashifies
83# metacharacters that are still active within double-quoted strings.
84Xsed='sed -e s/^X//'
85sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
86
87# Same as above, but do not quote variable references.
88double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
89
90# The name of this program.
91progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
92
93# Constants:
94PROGRAM=ltconfig
95PACKAGE=libtool
99e9c6f7 96VERSION=1.2b
fd3f7b52
ILT
97ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
98ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
99rm="rm -f"
100
101help="Try \`$progname --help' for more information."
102
103# Global variables:
c0dea852 104default_ofile=libtool
fd3f7b52
ILT
105can_build_shared=yes
106enable_shared=yes
107# All known linkers require a `.a' archive for static linking.
108enable_static=yes
109ltmain=
110silent=
111srcdir=
112ac_config_guess=
113ac_config_sub=
114host=
115nonopt=
c0dea852 116ofile="$default_ofile"
fd3f7b52
ILT
117verify_host=yes
118with_gcc=no
119with_gnu_ld=no
c0dea852
ILT
120objext=o
121libext=a
fd3f7b52
ILT
122
123old_AR="$AR"
124old_CC="$CC"
125old_CFLAGS="$CFLAGS"
126old_CPPFLAGS="$CPPFLAGS"
127old_LD="$LD"
128old_LN_S="$LN_S"
129old_NM="$NM"
130old_RANLIB="$RANLIB"
131old_DLLTOOL="$DLLTOOL"
132old_AS="$AS"
133
134# Parse the command line options.
135args=
136prev=
137for option
138do
139 case "$option" in
140 -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
141 *) optarg= ;;
142 esac
143
144 # If the previous option needs an argument, assign it.
145 if test -n "$prev"; then
146 eval "$prev=\$option"
147 prev=
148 continue
149 fi
150
151 case "$option" in
152 --help) cat <<EOM
153Usage: $progname [OPTION]... LTMAIN [HOST]
154
155Generate a system-specific libtool script.
156
c0dea852 157 --debug enable verbose shell tracing
fd3f7b52
ILT
158 --disable-shared do not build shared libraries
159 --disable-static do not build static libraries
160 --help display this help and exit
161 --no-verify do not verify that HOST is a valid host type
c0dea852 162-o, --output=FILE specify the output file [default=$default_ofile]
fd3f7b52
ILT
163 --quiet same as \`--silent'
164 --silent do not print informational messages
165 --srcdir=DIR find \`config.guess' in DIR
166 --version output version information and exit
167 --with-gcc assume that the GNU C compiler will be used
168 --with-gnu-ld assume that the C compiler uses the GNU linker
169
170LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
171functionality.
172
173HOST is the canonical host system name [default=guessed].
174EOM
175 exit 0
176 ;;
177
c0dea852
ILT
178 --debug)
179 echo "$progname: enabling shell trace mode"
180 set -x
181 ;;
182
fd3f7b52
ILT
183 --disable-shared) enable_shared=no ;;
184
185 --disable-static) enable_static=no ;;
186
187 --quiet | --silent) silent=yes ;;
188
189 --srcdir) prev=srcdir ;;
190 --srcdir=*) srcdir="$optarg" ;;
191
192 --no-verify) verify_host=no ;;
193
c0dea852
ILT
194 --output | -o) prev=ofile ;;
195 --output=*) ofile="$optarg" ;;
196
fd3f7b52
ILT
197 --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
198
199 --with-gcc) with_gcc=yes ;;
200 --with-gnu-ld) with_gnu_ld=yes ;;
201
202 -*)
203 echo "$progname: unrecognized option \`$option'" 1>&2
204 echo "$help" 1>&2
205 exit 1
206 ;;
207
208 *)
209 if test -z "$ltmain"; then
210 ltmain="$option"
211 elif test -z "$host"; then
212# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
213# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
214# echo "$progname: warning \`$option' is not a valid host type" 1>&2
215# fi
216 host="$option"
217 else
218 echo "$progname: too many arguments" 1>&2
219 echo "$help" 1>&2
220 exit 1
221 fi ;;
222 esac
223done
224
225if test -z "$ltmain"; then
226 echo "$progname: you must specify a LTMAIN file" 1>&2
227 echo "$help" 1>&2
228 exit 1
229fi
230
99e9c6f7 231if test ! -f "$ltmain"; then
fd3f7b52
ILT
232 echo "$progname: \`$ltmain' does not exist" 1>&2
233 echo "$help" 1>&2
234 exit 1
235fi
236
237# Quote any args containing shell metacharacters.
238ltconfig_args=
239for arg
240do
241 case "$arg" in
242 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
243 ltconfig_args="$ltconfig_args '$arg'" ;;
244 *) ltconfig_args="$ltconfig_args $arg" ;;
245 esac
246done
247
248# A relevant subset of AC_INIT.
249
250# File descriptor usage:
251# 0 standard input
252# 1 file creation
253# 2 errors and warnings
254# 3 some systems may open it to /dev/tty
255# 4 used on the Kubota Titan
256# 5 compiler messages saved in config.log
257# 6 checking for... messages and results
258if test "$silent" = yes; then
259 exec 6>/dev/null
260else
261 exec 6>&1
262fi
263exec 5>>./config.log
264
265# NLS nuisances.
266# Only set LANG and LC_ALL to C if already set.
267# These must not be set unconditionally because not all systems understand
268# e.g. LANG=C (notably SCO).
269if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
270if test "${LANG+set}" = set; then LANG=C; export LANG; fi
271
272if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
273 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
274 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
275 ac_n= ac_c='
276' ac_t=' '
277 else
278 ac_n=-n ac_c= ac_t=
279 fi
280else
281 ac_n= ac_c='\c' ac_t=
282fi
283
284if test -z "$srcdir"; then
285 # Assume the source directory is the same one as the path to ltmain.sh.
286 srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
287 test "$srcdir" = "$ltmain" && srcdir=.
288fi
289
290trap "$rm conftest*; exit 1" 1 2 15
291if test "$verify_host" = yes; then
292 # Check for config.guess and config.sub.
293 ac_aux_dir=
294 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
295 if test -f $ac_dir/config.guess; then
296 ac_aux_dir=$ac_dir
297 break
298 fi
299 done
300 if test -z "$ac_aux_dir"; then
301 echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
302 echo "$help" 1>&2
303 exit 1
304 fi
305 ac_config_guess=$ac_aux_dir/config.guess
306 ac_config_sub=$ac_aux_dir/config.sub
307
308 # Make sure we can run config.sub.
c0dea852 309 if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
fd3f7b52
ILT
310 else
311 echo "$progname: cannot run $ac_config_sub" 1>&2
312 echo "$help" 1>&2
313 exit 1
314 fi
315
316 echo $ac_n "checking host system type""... $ac_c" 1>&6
317
318 host_alias=$host
319 case "$host_alias" in
320 "")
c0dea852 321 if host_alias=`$SHELL $ac_config_guess`; then :
fd3f7b52
ILT
322 else
323 echo "$progname: cannot guess host type; you must specify one" 1>&2
324 echo "$help" 1>&2
325 exit 1
326 fi ;;
327 esac
c0dea852 328 host=`$SHELL $ac_config_sub $host_alias`
fd3f7b52
ILT
329 echo "$ac_t$host" 1>&6
330
331 # Make sure the host verified.
332 test -z "$host" && exit 1
333
334elif test -z "$host"; then
335 echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
336 echo "$help" 1>&2
337 exit 1
338else
339 host_alias=$host
340fi
341
342# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
343case "$host_os" in
344linux-gnu*) ;;
345linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
346esac
347
348host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
349host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
350host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
351
352case "$host_os" in
353aix3*)
354 # AIX sometimes has problems with the GCC collect2 program. For some
355 # reason, if we set the COLLECT_NAMES environment variable, the problems
356 # vanish in a puff of smoke.
357 if test "${COLLECT_NAMES+set}" != set; then
358 COLLECT_NAMES=
359 export COLLECT_NAMES
360 fi
361 ;;
362esac
363
364# Determine commands to create old-style static archives.
365old_archive_cmds='$AR cru $oldlib$oldobjs'
366old_postinstall_cmds='chmod 644 $oldlib'
367old_postuninstall_cmds=
368
369# Set a sane default for `AR'.
370test -z "$AR" && AR=ar
371
372# If RANLIB is not set, then run the test.
373if test "${RANLIB+set}" != "set"; then
374 result=no
375
376 echo $ac_n "checking for ranlib... $ac_c" 1>&6
377 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
378 for dir in $PATH; do
379 test -z "$dir" && dir=.
380 if test -f $dir/ranlib; then
381 RANLIB="ranlib"
382 result="ranlib"
383 break
384 fi
385 done
386 IFS="$save_ifs"
387
388 echo "$ac_t$result" 1>&6
389fi
390
391if test -n "$RANLIB"; then
392 old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
393 old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds"
394fi
395
396# Set sane defaults for `DLLTOOL' and `AS', used on cygwin32.
397test -z "$DLLTOOL" && DLLTOOL=dlltool
398test -z "$AS" && AS=as
399
400# Check to see if we are using GCC.
401if test "$with_gcc" != yes || test -z "$CC"; then
402 # If CC is not set, then try to find GCC or a usable CC.
403 if test -z "$CC"; then
404 echo $ac_n "checking for gcc... $ac_c" 1>&6
405 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
406 for dir in $PATH; do
407 IFS="$save_ifs"
408 test -z "$dir" && dir=.
409 if test -f $dir/gcc; then
410 CC="gcc"
411 break
412 fi
413 done
414 IFS="$save_ifs"
415
416 if test -n "$CC"; then
417 echo "$ac_t$CC" 1>&6
418 else
419 echo "$ac_t"no 1>&6
420 fi
421 fi
422
423 # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
424 if test -z "$CC"; then
425 echo $ac_n "checking for cc... $ac_c" 1>&6
426 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
427 cc_rejected=no
428 for dir in $PATH; do
429 test -z "$dir" && dir=.
430 if test -f $dir/cc; then
431 if test "$dir/cc" = "/usr/ucb/cc"; then
432 cc_rejected=yes
433 continue
434 fi
435 CC="cc"
436 break
437 fi
438 done
439 IFS="$save_ifs"
440 if test $cc_rejected = yes; then
441 # We found a bogon in the path, so make sure we never use it.
442 set dummy $CC
443 shift
444 if test $# -gt 0; then
445 # We chose a different compiler from the bogus one.
446 # However, it has the same name, so the bogon will be chosen
447 # first if we set CC to just the name; use the full file name.
448 shift
449 set dummy "$dir/cc" "$@"
450 shift
451 CC="$@"
452 fi
453 fi
454
455 if test -n "$CC"; then
456 echo "$ac_t$CC" 1>&6
457 else
458 echo "$ac_t"no 1>&6
459 fi
460
461 if test -z "$CC"; then
462 echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
463 exit 1
464 fi
465 fi
466
467 # Now see if the compiler is really GCC.
468 with_gcc=no
469 echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
c0dea852 470 echo "$progname:470: checking whether we are using GNU C" >&5
fd3f7b52
ILT
471
472 $rm conftest.c
473 cat > conftest.c <<EOF
474#ifdef __GNUC__
475 yes;
476#endif
477EOF
c0dea852 478 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:478: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
fd3f7b52
ILT
479 with_gcc=yes
480 fi
481 $rm conftest.c
482 echo "$ac_t$with_gcc" 1>&6
483fi
484
485# Allow CC to be a program name with arguments.
486set dummy $CC
487compiler="$2"
488
c0dea852
ILT
489echo $ac_n "checking for object suffix... $ac_c" 1>&6
490$rm conftest*
491echo 'int i = 1;' > conftest.c
492echo "$progname:492: checking for object suffix" >& 5
493if { (eval echo $progname:493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
494 # Append any warnings to the config.log.
495 cat conftest.err 1>&5
496
497 for ac_file in conftest.*; do
498 case $ac_file in
499 *.c) ;;
500 *) objext=`echo $ac_file | sed -e s/conftest.//` ;;
501 esac
502 done
503else
504 cat conftest.err 1>&5
505 echo "$progname: failed program was:" >&5
506 cat conftest.c >&5
507fi
508$rm conftest*
509echo "$ac_t$objext" 1>&6
510
fd3f7b52
ILT
511echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
512pic_flag=
513special_shlib_compile_flags=
514wl=
515link_static_flag=
516no_builtin_flag=
517
518if test "$with_gcc" = yes; then
519 wl='-Wl,'
520 link_static_flag='-static'
521 no_builtin_flag=' -fno-builtin'
522
523 case "$host_os" in
524 aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
525 # PIC is the default for these OSes.
526 ;;
c0dea852 527 cygwin32* | mingw32* | os2*)
fd3f7b52
ILT
528 # We can build DLLs from non-PIC.
529 ;;
530 amigaos*)
531 # FIXME: we need at least 68020 code to build shared libraries, but
532 # adding the `-m68020' flag to GCC prevents building anything better,
533 # like `-m68040'.
534 pic_flag='-m68020 -resident32 -malways-restore-a4'
535 ;;
536 *)
537 pic_flag='-fPIC'
538 ;;
539 esac
540else
541 # PORTME Check for PIC flags for the system compiler.
542 case "$host_os" in
543 aix3* | aix4*)
544 # All AIX code is PIC.
545 link_static_flag='-bnso -bI:/lib/syscalls.exp'
546 ;;
547
548 hpux9* | hpux10* | hpux11*)
549 # Is there a better link_static_flag that works with the bundled CC?
550 wl='-Wl,'
551 link_static_flag="${wl}-a ${wl}archive"
552 pic_flag='+Z'
553 ;;
554
555 irix5* | irix6*)
556 wl='-Wl,'
557 link_static_flag='-non_shared'
558 # PIC (with -KPIC) is the default.
559 ;;
560
c0dea852 561 cygwin32* | mingw32* | os2*)
fd3f7b52
ILT
562 # We can build DLLs from non-PIC.
563 ;;
564
565 osf3* | osf4*)
566 # All OSF/1 code is PIC.
567 wl='-Wl,'
568 link_static_flag='-non_shared'
569 ;;
570
571 sco3.2v5*)
572 pic_flag='-Kpic'
573 link_static_flag='-dn'
574 special_shlib_compile_flags='-belf'
575 ;;
576
577 solaris2*)
578 pic_flag='-KPIC'
579 link_static_flag='-Bstatic'
580 wl='-Wl,'
581 ;;
582
583 sunos4*)
584 pic_flag='-PIC'
585 link_static_flag='-Bstatic'
586 wl='-Qoption ld '
587 ;;
588
589 sysv4.2uw2*)
590 pic_flag='-KPIC'
591 link_static_flag='-Bstatic'
592 wl='-Wl,'
593 ;;
594
595 uts4*)
596 pic_flag='-pic'
597 link_static_flag='-Bstatic'
598 ;;
599
600 *)
601 can_build_shared=no
602 ;;
603 esac
604fi
605
606if test -n "$pic_flag"; then
607 echo "$ac_t$pic_flag" 1>&6
608
609 # Check to make sure the pic_flag actually works.
610 echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
611 $rm conftest*
c0dea852 612 echo "int some_variable = 0;" > conftest.c
fd3f7b52
ILT
613 save_CFLAGS="$CFLAGS"
614 CFLAGS="$CFLAGS $pic_flag -DPIC"
c0dea852
ILT
615 echo "$progname:615: checking if $compiler PIC flag $pic_flag works" >&5
616 if { (eval echo $progname:616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
fd3f7b52
ILT
617 # Append any warnings to the config.log.
618 cat conftest.err 1>&5
619
620 # On HP-UX, both CC and GCC only warn that PIC is supported... then they
621 # create non-PIC objects. So, if there were any warnings, we assume that
622 # PIC is not supported.
623 if test -s conftest.err; then
624 echo "$ac_t"no 1>&6
625 can_build_shared=no
626 pic_flag=
627 else
628 echo "$ac_t"yes 1>&6
629 pic_flag=" $pic_flag"
630 fi
631 else
632 # Append any errors to the config.log.
633 cat conftest.err 1>&5
634 can_build_shared=no
635 pic_flag=
636 echo "$ac_t"no 1>&6
637 fi
638 CFLAGS="$save_CFLAGS"
639 $rm conftest*
640else
641 echo "$ac_t"none 1>&6
642fi
643
644# Check for any special shared library compilation flags.
645if test -n "$special_shlib_compile_flags"; then
646 echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
647 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
648 else
649 echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
650 can_build_shared=no
651 fi
652fi
653
654echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
655$rm conftest*
656echo 'main(){return(0);}' > conftest.c
657save_LDFLAGS="$LDFLAGS"
658LDFLAGS="$LDFLAGS $link_static_flag"
c0dea852
ILT
659echo "$progname:659: checking if $compiler static flag $link_static_flag works" >&5
660if { (eval echo $progname:660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
fd3f7b52
ILT
661 echo "$ac_t$link_static_flag" 1>&6
662else
663 echo "$ac_t"none 1>&6
664 link_static_flag=
665fi
666LDFLAGS="$save_LDFLAGS"
667$rm conftest*
668
669if test -z "$LN_S"; then
670 # Check to see if we can use ln -s, or we need hard links.
671 echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
672 $rm conftestdata
673 if ln -s X conftestdata 2>/dev/null; then
674 $rm conftestdata
675 LN_S="ln -s"
676 else
677 LN_S=ln
678 fi
679 if test "$LN_S" = "ln -s"; then
680 echo "$ac_t"yes 1>&6
681 else
682 echo "$ac_t"no 1>&6
683 fi
684fi
685
686# Make sure LD is an absolute path.
687if test -z "$LD"; then
688 ac_prog=ld
689 if test "$with_gcc" = yes; then
690 # Check if gcc -print-prog-name=ld gives a path.
691 echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
c0dea852 692 echo "$progname:692: checking for ld used by GCC" >&5
fd3f7b52
ILT
693 ac_prog=`($CC -print-prog-name=ld) 2>&5`
694 case "$ac_prog" in
695 # Accept absolute paths.
99e9c6f7 696 /* | [A-Za-z]:[/\\]*)
fd3f7b52
ILT
697 test -z "$LD" && LD="$ac_prog"
698 ;;
699 "")
700 # If it fails, then pretend we are not using GCC.
701 ac_prog=ld
702 ;;
703 *)
704 # If it is relative, then search for the first ld in PATH.
705 with_gnu_ld=unknown
706 ;;
707 esac
708 elif test "$with_gnu_ld" = yes; then
709 echo $ac_n "checking for GNU ld... $ac_c" 1>&6
c0dea852 710 echo "$progname:710: checking for GNU ld" >&5
fd3f7b52
ILT
711 else
712 echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
c0dea852 713 echo "$progname:713: checking for non-GNU ld" >&5
fd3f7b52
ILT
714 fi
715
716 if test -z "$LD"; then
717 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
718 for ac_dir in $PATH; do
719 test -z "$ac_dir" && ac_dir=.
720 if test -f "$ac_dir/$ac_prog"; then
721 LD="$ac_dir/$ac_prog"
722 # Check to see if the program is GNU ld. I'd rather use --version,
723 # but apparently some GNU ld's only accept -v.
724 # Break only if it was the GNU/non-GNU ld that we prefer.
725 if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
726 test "$with_gnu_ld" != no && break
727 else
728 test "$with_gnu_ld" != yes && break
729 fi
730 fi
731 done
732 IFS="$ac_save_ifs"
733 fi
734
735 if test -n "$LD"; then
736 echo "$ac_t$LD" 1>&6
737 else
738 echo "$ac_t"no 1>&6
739 fi
740
741 if test -z "$LD"; then
742 echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
743 exit 1
744 fi
745fi
746
747# Check to see if it really is or is not GNU ld.
748echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
749# I'd rather use --version here, but apparently some GNU ld's only accept -v.
750if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
751 with_gnu_ld=yes
752else
753 with_gnu_ld=no
754fi
755echo "$ac_t$with_gnu_ld" 1>&6
756
757# See if the linker supports building shared libraries.
758echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
759
760allow_undefined_flag=
761no_undefined_flag=
762archive_cmds=
763old_archive_from_new_cmds=
764export_dynamic_flag_spec=
99e9c6f7 765whole_archive_flag_spec=
fd3f7b52
ILT
766hardcode_libdir_flag_spec=
767hardcode_libdir_separator=
768hardcode_direct=no
769hardcode_minus_L=no
770hardcode_shlibpath_var=unsupported
771runpath_var=
c0dea852 772fix_srcfile_path=
fd3f7b52
ILT
773
774case "$host_os" in
c0dea852
ILT
775aix3* | aix4*)
776 # On AIX, the GNU linker works like the native linker.
777 with_gnu_ld=no
fd3f7b52
ILT
778 ;;
779esac
780
781ld_shlibs=yes
c0dea852 782if test "$with_gnu_ld" = yes; then
fd3f7b52
ILT
783
784 # See if GNU ld supports shared libraries.
c0dea852
ILT
785 case "$host_os" in
786 amigaos*)
787 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)'
788 hardcode_libdir_flag_spec='-L$libdir'
789 hardcode_minus_L=yes
790 ;;
fd3f7b52 791
c0dea852
ILT
792 sunos4*)
793 archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
99e9c6f7 794 hardcode_direct=yes
10b2757b
JL
795 # The GNU linker will only hardcode -L options if -rpath is not
796 # used, but we will be using -rpath because we set
797 # hardcode_libdir_flag_spec below.
798 hardcode_minus_L=no
99e9c6f7 799 hardcode_shlibpath_var=no
c0dea852
ILT
800 ;;
801
802 cygwin32* | mingw32*)
803 if test "$with_gcc" = yes; then
804 # hardcode_libdir_flag_spec is actually meaningless, as there is
805 # no search path for DLLs.
806 hardcode_libdir_flag_spec='-L$libdir'
807 allow_undefined_flag=unsupported
808 # Very, very bogus.
809 echo '
810#include <windows.h>
811
812struct _reent *_impure_ptr;
813extern struct _reent *__imp_reent_data;
814BOOL APIENTRY
815__dll_entry (HINSTANCE hinst, DWORD reason, LPVOID reserved)
816{
817 _impure_ptr = __imp_reent_data;
818}
819' > libtool.c
820 archive_cmds='$CC -c '"`pwd`"'/libtool.c;echo EXPORTS > $soname-def;$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' >> $soname-def;$LD -s --base-file $soname-base --dll -e ___dll_entry@12 -o $lib libtool.$objext$libobjs$deplibs;$DLLTOOL --as=$AS --dllname $soname --def $soname-def --base-file $soname-base --output-exp $soname-exp;$LD -s --base-file $soname-base $soname-exp --dll -e ___dll_entry@12 -o $lib libtool.$objext$libobjs$deplibs;$DLLTOOL --as=$AS --dllname $soname --def $soname-def --base-file $soname-base --output-exp $soname-exp;$LD $soname-exp --dll -e ___dll_entry@12 -o $lib libtool.$objext$libobjs$deplibs;$rm libtool.$objext $soname-base $soname-exp'
821 old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $soname-def --output-lib $objdir/$libname.a;$rm $soname-def'
822 else
823 # When not using gcc, we currently assume that we are using
824 # Microsoft Visual C++.
825 with_gnu_ld=no
826 # hardcode_libdir_flag_spec is actually meaningless, as there is
827 # no search path for DLLs.
828 hardcode_libdir_flag_spec=' '
829 allow_undefined_flag=unsupported
830 # Tell ltmain to make .lib files, not .a files.
831 libext=lib
832 # FIXME: Setting linknames here is a bad hack.
833 archive_cmds='$CC -o $lib$libobjs`echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll;linknames='
834 # The linker will automatically build a .lib file if we build a DLL.
835 old_archive_from_new_cmds='true'
836 # FIXME: Should let the user specify the lib program.
837 old_archive_cmds='lib /OUT:$oldlib$oldobjs'
838 fix_srcfile_path='`cygpath -w $srcfile`'
839 fi
840 ;;
841
842 *)
843 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
844 archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs'
845 else
846 ld_shlibs=no
847 fi
848 ;;
849 esac
850
851 if test "$ld_shlibs" = yes && test "$with_gnu_ld" = yes; then
852 runpath_var=LD_RUN_PATH
fd3f7b52
ILT
853 hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
854 export_dynamic_flag_spec='${wl}--export-dynamic'
99e9c6f7 855 whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
fd3f7b52
ILT
856 fi
857else
858 # PORTME fill in a description of your system's linker (not GNU ld)
859 case "$host_os" in
860 aix3*)
861 allow_undefined_flag=unsupported
862 archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE;$AR cru $lib $objdir/$soname'
863 # Note: this linker hardcodes the directories in LIBPATH if there
864 # are no directories specified by -L.
865 hardcode_minus_L=yes
866 if test "$with_gcc" = yes && test -z "$link_static_flag"; then
867 # Neither direct hardcoding nor static linking is supported with a
868 # broken collect2.
869 hardcode_direct=unsupported
870 fi
871 ;;
872
873 aix4*)
874 allow_undefined_flag=unsupported
875 archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$CC -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry;$AR cru $lib $objdir/$soname'
876 hardcode_direct=yes
877 hardcode_minus_L=yes
878 ;;
879
880 amigaos*)
881 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)'
882 hardcode_libdir_flag_spec='-L$libdir'
883 hardcode_minus_L=yes
884 ;;
885
c0dea852
ILT
886 cygwin32* | mingw32*)
887 if test "$with_gcc" = yes; then
888 # hardcode_libdir_flag_spec is actually meaningless, as there is
889 # no search path for DLLs.
890 hardcode_libdir_flag_spec='-L$libdir'
891 allow_undefined_flag=unsupported
892 # Very, very bogus.
893 echo '
fd3f7b52
ILT
894#include <windows.h>
895
896struct _reent *_impure_ptr;
897extern struct _reent *__imp_reent_data;
898BOOL APIENTRY
899__dll_entry (HINSTANCE hinst, DWORD reason, LPVOID reserved)
900{
901 _impure_ptr = __imp_reent_data;
902}
903' > libtool.c
c0dea852
ILT
904 archive_cmds='$CC -c '"`pwd`"'/libtool.c;echo EXPORTS > $soname-def;$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' >> $soname-def;$LD -s --base-file $soname-base --dll -e ___dll_entry@12 -o $lib libtool.$objext$libobjs$deplibs;$DLLTOOL --as=$AS --dllname $soname --def $soname-def --base-file $soname-base --output-exp $soname-exp;$LD -s --base-file $soname-base $soname-exp --dll -e ___dll_entry@12 -o $lib libtool.$objext$libobjs$deplibs;$DLLTOOL --as=$AS --dllname $soname --def $soname-def --base-file $soname-base --output-exp $soname-exp;$LD $soname-exp --dll -e ___dll_entry@12 -o $lib libtool.$objext$libobjs$deplibs;$rm libtool.$objext $soname-base $soname-exp'
905 old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $soname-def --output-lib $objdir/$libname.a;$rm $soname-def'
906 else
907 # When not using gcc, we currently assume that we are using
908 # Microsoft Visual C++.
909 # hardcode_libdir_flag_spec is actually meaningless, as there is
910 # no search path for DLLs.
911 hardcode_libdir_flag_spec=' '
912 allow_undefined_flag=unsupported
913 # Tell ltmain to make .lib files, not .a files.
914 libext=lib
915 # FIXME: Setting linknames here is a bad hack.
916 archive_cmds='$CC -o $lib$libobjs`echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll;linknames='
917 # The linker will automatically build a .lib file if we build a DLL.
918 old_archive_from_new_cmds='true'
919 # FIXME: Should let the user specify the lib program.
920 old_archive_cmds='lib /OUT:$oldlib$oldobjs'
921 fix_srcfile_path='`cygpath -w $srcfile`'
922 fi
fd3f7b52
ILT
923 ;;
924
925 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
926 # support. Future versions do this automatically, but an explicit c++rt0.o
927 # does not break anything, and helps significantly (at the cost of a little
928 # extra space).
929 freebsd2.2*)
930 archive_cmds='$LD -Bshareable -o $lib$libobjs /usr/lib/c++rt0.o'
931 hardcode_libdir_flag_spec='-R$libdir'
932 hardcode_direct=yes
933 hardcode_minus_L=yes
934 hardcode_shlibpath_var=no
935 ;;
936
937 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
938 freebsd2*)
939 archive_cmds='$LD -Bshareable -o $lib$libobjs'
940 hardcode_direct=yes
941 hardcode_minus_L=yes
942 hardcode_shlibpath_var=no
943 ;;
944
945 # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
946 freebsd3*)
947 archive_cmds='$CC -shared -o $lib$libobjs'
948 hardcode_libdir_flag_spec='-R$libdir'
949 hardcode_direct=yes
99e9c6f7 950 hardcode_minus_L=no
fd3f7b52
ILT
951 hardcode_shlibpath_var=no
952 ;;
953
954 hpux9*)
955 archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs;mv $objdir/$soname $lib'
956 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
957 hardcode_direct=yes
958 hardcode_minus_L=yes
959 export_dynamic_flag_spec='${wl}-E'
960 ;;
961
962 hpux10* | hpux11*)
963 archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs'
964 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
965 hardcode_direct=yes
966 hardcode_minus_L=yes
967 export_dynamic_flag_spec='${wl}-E'
968 ;;
969
970 irix5* | irix6*)
c0dea852
ILT
971 if test "$with_gcc" = yes; then
972 archive_cmds='$CC -shared -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring$libobjs'
973 else
974 archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs'
975 fi
fd3f7b52
ILT
976 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
977 ;;
978
979 netbsd*)
980 # Tested with NetBSD 1.2 ld
981 archive_cmds='$LD -Bshareable -o $lib$libobjs'
982 hardcode_libdir_flag_spec='-R$libdir'
983 hardcode_direct=yes
984 hardcode_shlibpath_var=no
985 ;;
986
987 openbsd*)
988 archive_cmds='$LD -Bshareable -o $lib$libobjs'
989 hardcode_libdir_flag_spec='-R$libdir'
990 hardcode_direct=yes
991 hardcode_shlibpath_var=no
992 ;;
993
994 os2*)
995 hardcode_libdir_flag_spec='-L$libdir'
996 hardcode_minus_L=yes
997 allow_undefined_flag=unsupported
998 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 $objdir/$libname.def'
999 old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
1000 ;;
1001
1002 osf3* | osf4*)
1003 allow_undefined_flag=' -expect_unresolved \*'
1004 archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
1005 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1006 hardcode_libdir_separator=:
1007 ;;
1008
1009 sco3.2v5*)
1010 archive_cmds='$LD -G -o $lib$libobjs'
1011 hardcode_direct=yes
1012 ;;
1013
1014 solaris2*)
1015 no_undefined_flag=' -z text'
1016 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs'
1017 hardcode_libdir_flag_spec='-R$libdir'
1018 hardcode_shlibpath_var=no
1019
1020 # Solaris 2 before 2.5 hardcodes -L paths.
1021 case "$host_os" in
1022 solaris2.[0-4]*)
1023 hardcode_minus_L=yes
1024 ;;
1025 esac
1026 ;;
1027
1028 sunos4*)
c0dea852 1029 archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
fd3f7b52
ILT
1030 hardcode_libdir_flag_spec='-L$libdir'
1031 hardcode_direct=yes
1032 hardcode_minus_L=yes
1033 hardcode_shlibpath_var=no
1034 ;;
1035
1036 uts4*)
1037 archive_cmds='$LD -G -h $soname -o $lib$libobjs'
1038 hardcode_libdir_flag_spec='-L$libdir'
1039 hardcode_direct=no
1040 hardcode_minus_L=no
1041 hardcode_shlibpath_var=no
1042 ;;
1043
1044 *)
1045 ld_shlibs=no
1046 can_build_shared=no
1047 ;;
1048 esac
1049fi
1050echo "$ac_t$ld_shlibs" 1>&6
1051
1052if test -z "$NM"; then
1053 echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
1054 case "$NM" in
99e9c6f7 1055 /* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path.
fd3f7b52
ILT
1056 *)
1057 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1058 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
1059 test -z "$ac_dir" && ac_dir=.
1060 if test -f $ac_dir/nm; then
1061 # Check to see if the nm accepts a BSD-compat flag.
1062 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1063 # nm: unknown option "B" ignored
1064 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1065 NM="$ac_dir/nm -B"
1066 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1067 NM="$ac_dir/nm -p"
1068 else
1069 NM="$ac_dir/nm"
1070 fi
1071 break
1072 fi
1073 done
1074 IFS="$ac_save_ifs"
1075 test -z "$NM" && NM=nm
1076 ;;
1077 esac
1078 echo "$ac_t$NM" 1>&6
1079fi
1080
1081# Check for command to grab the raw symbol name followed by C symbol from nm.
1082echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
1083
1084# These are sane defaults that work on at least a few old systems.
1085# [They come from Ultrix. What could be older than Ultrix?!! ;)]
1086
1087# Character class describing NM global symbol codes.
1088symcode='[BCDEGRSTU]'
1089
1090# Regexp to match symbols that can be accessed directly from C.
1091sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
1092
1093# Transform the above into a raw symbol and a C symbol.
1094symxfrm='\1 \1'
1095
1096# Define system-specific variables.
1097case "$host_os" in
1098aix*)
1099 symcode='[BCDTU]'
1100 ;;
c0dea852 1101cygwin32* | mingw32*)
fd3f7b52
ILT
1102 sympat='_\([_A-Za-z][_A-Za-z0-9]*\)'
1103 symxfrm='_\1 \1'
1104 ;;
1105irix*)
1106 # Cannot use undefined symbols on IRIX because inlined functions mess us up.
1107 symcode='[BCDEGRST]'
1108 ;;
1109solaris2*)
1110 symcode='[BDTU]'
1111 ;;
1112esac
1113
1114# If we're using GNU nm, then use its standard symbol codes.
1115if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1116 symcode='[ABCDGISTUW]'
1117fi
1118
1119case "$host_os" in
c0dea852 1120cygwin32* | mingw32*)
fd3f7b52
ILT
1121 # We do not want undefined symbols on cygwin32. The user must
1122 # arrange to define them via -l arguments.
1123 symcode='[ABCDGISTW]'
1124 ;;
1125esac
1126
1127# Write the raw and C identifiers.
1128global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
1129
1130# Check to see that the pipe works correctly.
1131pipe_works=no
1132$rm conftest*
1133cat > conftest.c <<EOF
1134#ifdef __cplusplus
1135extern "C" {
1136#endif
1137char nm_test_var;
1138void nm_test_func(){}
1139#ifdef __cplusplus
1140}
1141#endif
1142main(){nm_test_var='a';nm_test_func();return(0);}
1143EOF
1144
10b2757b
JL
1145echo "$progname:1145: checking if global_symbol_pipe works" >&5
1146if { (eval echo $progname:1146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
fd3f7b52
ILT
1147 # Now try to grab the symbols.
1148 nlist=conftest.nm
10b2757b 1149 if { echo "$progname:1149: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
fd3f7b52
ILT
1150
1151 # Try sorting and uniquifying the output.
1152 if sort "$nlist" | uniq > "$nlist"T; then
1153 mv -f "$nlist"T "$nlist"
1154 wcout=`wc "$nlist" 2>/dev/null`
1155 count=`$echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
1156 (test "$count" -ge 0) 2>/dev/null || count=-1
1157 else
1158 rm -f "$nlist"T
1159 count=-1
1160 fi
1161
1162 # Make sure that we snagged all the symbols we need.
1163 if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1164 if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1165 cat <<EOF > conftest.c
1166#ifdef __cplusplus
1167extern "C" {
1168#endif
1169
1170EOF
1171 # Now generate the symbol file.
1172 sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
1173
1174 cat <<EOF >> conftest.c
1175#if defined (__STDC__) && __STDC__
1176# define __ptr_t void *
1177#else
1178# define __ptr_t char *
1179#endif
1180
1181/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
1182int dld_preloaded_symbol_count = $count;
1183
1184/* The mapping between symbol names and symbols. */
1185struct {
1186 char *name;
1187 __ptr_t address;
1188}
1189dld_preloaded_symbols[] =
1190{
1191EOF
1192 sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c
1193 cat <<\EOF >> conftest.c
1194 {0, (__ptr_t) 0}
1195};
1196
1197#ifdef __cplusplus
1198}
1199#endif
1200EOF
1201 # Now try linking the two files.
c0dea852 1202 mv conftest.$objext conftestm.$objext
fd3f7b52
ILT
1203 save_LIBS="$LIBS"
1204 save_CFLAGS="$CFLAGS"
c0dea852 1205 LIBS="conftestm.$objext"
fd3f7b52 1206 CFLAGS="$CFLAGS$no_builtin_flag"
10b2757b 1207 if { (eval echo $progname:1207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
fd3f7b52
ILT
1208 pipe_works=yes
1209 else
1210 echo "$progname: failed program was:" >&5
1211 cat conftest.c >&5
1212 fi
1213 LIBS="$save_LIBS"
1214 else
1215 echo "cannot find nm_test_func in $nlist" >&5
1216 fi
1217 else
1218 echo "cannot find nm_test_var in $nlist" >&5
1219 fi
1220 else
1221 echo "cannot run $global_symbol_pipe" >&5
1222 fi
1223else
1224 echo "$progname: failed program was:" >&5
1225 cat conftest.c >&5
1226fi
1227$rm conftest*
1228
1229# Do not use the global_symbol_pipe unless it works.
1230echo "$ac_t$pipe_works" 1>&6
1231test "$pipe_works" = yes || global_symbol_pipe=
1232
1233# Check hardcoding attributes.
1234echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
1235hardcode_action=
1236if test -n "$hardcode_libdir_flag_spec" || \
1237 test -n "$runpath_var"; then
1238
1239 # We can hardcode non-existant directories.
1240 if test "$hardcode_direct" != no && \
1241 test "$hardcode_minus_L" != no && \
1242 test "$hardcode_shlibpath_var" != no; then
1243
1244 # Linking always hardcodes the temporary library directory.
1245 hardcode_action=relink
1246 else
1247 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1248 hardcode_action=immediate
1249 fi
fd3f7b52 1250else
c0dea852
ILT
1251 # We cannot hardcode anything, or else we can only hardcode existing
1252 # directories.
1253 hardcode_action=unsupported
fd3f7b52
ILT
1254fi
1255echo "$ac_t$hardcode_action" 1>&6
fd3f7b52
ILT
1256
1257
1258reload_flag=
1259reload_cmds='$LD$reload_flag -o $output$reload_objs'
1260echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
c0dea852 1261# PORTME Some linkers may need a different reload flag.
fd3f7b52 1262reload_flag='-r'
c0dea852 1263echo "$ac_t$reload_flag" 1>&6
fd3f7b52
ILT
1264test -n "$reload_flag" && reload_flag=" $reload_flag"
1265
1266# PORTME Fill in your ld.so characteristics
1267library_names_spec=
1268libname_spec='lib$name'
1269soname_spec=
1270postinstall_cmds=
1271postuninstall_cmds=
1272finish_cmds=
1273finish_eval=
1274shlibpath_var=
1275version_type=none
1276dynamic_linker="$host_os ld.so"
1277
1278echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
1279case "$host_os" in
1280aix3* | aix4*)
1281 version_type=linux
33e0ca61 1282 library_names_spec='${libname}${release}.so$versuffix $libname.a'
fd3f7b52
ILT
1283 shlibpath_var=LIBPATH
1284
1285 # AIX has no versioning support, so we append a major version to the name.
33e0ca61 1286 soname_spec='${libname}${release}.so$major'
fd3f7b52
ILT
1287 ;;
1288
1289amigaos*)
1290 library_names_spec='$libname.ixlibrary $libname.a'
1291 # Create ${libname}_ixlibrary.a entries in /sys/libs.
1292 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'
1293 ;;
1294
c0dea852 1295cygwin32* | mingw32*)
33e0ca61 1296 version_type=windows
c0dea852
ILT
1297 if test "$with_gcc" = yes; then
1298 library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
1299 else
1300 library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
1301 fi
fd3f7b52
ILT
1302 dynamic_linker='Win32 ld.exe'
1303 shlibpath_var=PATH
1304 ;;
1305
1306freebsd2* | freebsd3*)
1307 version_type=sunos
33e0ca61 1308 library_names_spec='${libname}${release}.so$versuffix $libname.so'
c0dea852 1309 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
fd3f7b52
ILT
1310 shlibpath_var=LD_LIBRARY_PATH
1311 ;;
1312
1313gnu*)
99e9c6f7
ILT
1314 version_type=linux
1315 library_names_spec='${libname}${release}.so$versuffix ${libname}.so'
fd3f7b52
ILT
1316 shlibpath_var=LD_LIBRARY_PATH
1317 ;;
1318
1319hpux9* | hpux10* | hpux11*)
1320 # Give a soname corresponding to the major version so that dld.sl refuses to
1321 # link against other versions.
1322 dynamic_linker="$host_os dld.sl"
1323 version_type=sunos
1324 shlibpath_var=SHLIB_PATH
33e0ca61
ILT
1325 library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
1326 soname_spec='${libname}${release}.sl$major'
fd3f7b52
ILT
1327 # HP-UX runs *really* slowly unless shared libraries are mode 555.
1328 postinstall_cmds='chmod 555 $lib'
1329 ;;
1330
1331irix5* | irix6*)
1332 version_type=osf
1333 soname_spec='${libname}${release}.so'
33e0ca61 1334 library_names_spec='${libname}${release}.so$versuffix $libname.so'
fd3f7b52
ILT
1335 shlibpath_var=LD_LIBRARY_PATH
1336 ;;
1337
1338# No shared lib support for Linux oldld, aout, or coff.
1339linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
1340 dynamic_linker=no
1341 ;;
1342
1343# This must be Linux ELF.
1344linux-gnu*)
1345 version_type=linux
33e0ca61
ILT
1346 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1347 soname_spec='${libname}${release}.so$major'
c0dea852 1348 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
fd3f7b52
ILT
1349 shlibpath_var=LD_LIBRARY_PATH
1350
1351 if test -f /lib/ld.so.1; then
1352 dynamic_linker='GNU ld.so'
1353 else
1354 # Only the GNU ld.so supports shared libraries on MkLinux.
1355 case "$host_cpu" in
1356 powerpc*) dynamic_linker=no ;;
1357 *) dynamic_linker='Linux ld.so' ;;
1358 esac
1359 fi
1360 ;;
1361
1362netbsd* | openbsd*)
1363 version_type=sunos
33e0ca61 1364 library_names_spec='${libname}${release}.so$versuffix'
c0dea852 1365 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
fd3f7b52
ILT
1366 shlibpath_var=LD_LIBRARY_PATH
1367 ;;
1368
1369os2*)
1370 libname_spec='$name'
1371 library_names_spec='$libname.dll $libname.a'
1372 dynamic_linker='OS/2 ld.exe'
1373 shlibpath_var=LIBPATH
1374 ;;
1375
1376osf3* | osf4*)
1377 version_type=osf
1378 soname_spec='${libname}${release}.so'
33e0ca61 1379 library_names_spec='${libname}${release}.so$versuffix $libname.so'
fd3f7b52
ILT
1380 shlibpath_var=LD_LIBRARY_PATH
1381 ;;
1382
1383sco3.2v5*)
1384 version_type=osf
33e0ca61
ILT
1385 soname_spec='${libname}${release}.so$major'
1386 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
fd3f7b52
ILT
1387 shlibpath_var=LD_LIBRARY_PATH
1388 ;;
1389
1390solaris2*)
1391 version_type=linux
33e0ca61
ILT
1392 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1393 soname_spec='${libname}${release}.so$major'
fd3f7b52 1394 shlibpath_var=LD_LIBRARY_PATH
99e9c6f7
ILT
1395 # ldd complains unless libraries are executable
1396 postinstall_cmds='chmod +x $lib'
fd3f7b52
ILT
1397 ;;
1398
1399sunos4*)
1400 version_type=sunos
10b2757b 1401 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
c0dea852 1402 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
fd3f7b52
ILT
1403 shlibpath_var=LD_LIBRARY_PATH
1404 ;;
1405
1406sysv4.2uw2*)
1407 version_type=linux
33e0ca61
ILT
1408 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1409 soname_spec='${libname}${release}.so$major'
fd3f7b52
ILT
1410 shlibpath_var=LD_LIBRARY_PATH
1411 ;;
1412
1413uts4*)
1414 version_type=linux
33e0ca61
ILT
1415 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1416 soname_spec='${libname}${release}.so$major'
fd3f7b52
ILT
1417 shlibpath_var=LD_LIBRARY_PATH
1418 ;;
1419
1420*)
1421 dynamic_linker=no
1422 ;;
1423esac
1424echo "$ac_t$dynamic_linker"
1425test "$dynamic_linker" = no && can_build_shared=no
1426
1427# Report the final consequences.
1428echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1429
1430echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
1431test "$can_build_shared" = "no" && enable_shared=no
1432
1433# On AIX, shared libraries and static libraries use the same namespace, and
1434# are all built from PIC.
1435case "$host_os" in
1436aix*)
1437 test "$enable_shared" = yes && enable_static=no
1438 if test -n "$RANLIB"; then
1439 archive_cmds="$archive_cmds;\$RANLIB \$lib"
1440 postinstall_cmds='$RANLIB $lib'
1441 fi
1442 ;;
1443esac
1444
1445echo "$ac_t$enable_shared" 1>&6
1446
1447# Make sure either enable_shared or enable_static is yes.
1448test "$enable_shared" = yes || enable_static=yes
1449
1450echo "checking whether to build static libraries... $enable_static" 1>&6
1451
1452echo $ac_n "checking for objdir... $ac_c" 1>&6
1453rm -f .libs 2>/dev/null
1454mkdir .libs 2>/dev/null
1455if test -d .libs; then
1456 objdir=.libs
1457else
1458 # MS-DOS does not allow filenames that begin with a dot.
1459 objdir=_libs
1460fi
1461rmdir .libs 2>/dev/null
1462echo "$ac_t$objdir" 1>&6
1463
1464# Copy echo and quote the copy, instead of the original, because it is
1465# used later.
1466ltecho="$echo"
1467
1468# Now quote all the things that may contain metacharacters.
1469for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
1470 old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM DLLTOOL AS reload_flag \
1471 reload_cmds wl pic_flag link_static_flag no_builtin_flag \
99e9c6f7
ILT
1472 export_dynamic_flag_spec whole_archive_flag_spec libname_spec \
1473 library_names_spec soname_spec RANLIB \
fd3f7b52
ILT
1474 old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
1475 old_postuninstall_cmds archive_cmds postinstall_cmds postuninstall_cmds \
c0dea852
ILT
1476 allow_undefined_flag no_undefined_flag objext libext \
1477 finish_cmds finish_eval global_symbol_pipe fix_srcfile_path \
fd3f7b52
ILT
1478 hardcode_libdir_flag_spec hardcode_libdir_separator; do
1479
1480 case "$var" in
1481 reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
1482 old_postinstall_cmds | old_postuninstall_cmds | archive_cmds | \
1483 postinstall_cmds | postuninstall_cmds | finish_cmds)
1484 # Double-quote double-evaled strings.
1485 eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`"
1486 ;;
1487 *)
1488 eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`"
1489 ;;
1490 esac
1491done
1492
c0dea852
ILT
1493trap "$rm \"$ofile\"; exit 1" 1 2 15
1494echo "creating $ofile"
1495$rm "$ofile"
1496cat <<EOF > "$ofile"
1497#! $SHELL
fd3f7b52 1498
c0dea852 1499# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
fd3f7b52
ILT
1500# Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
1501# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
1502#
1503# Copyright (C) 1996-1998 Free Software Foundation, Inc.
1504# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
1505#
1506# This program is free software; you can redistribute it and/or modify
1507# it under the terms of the GNU General Public License as published by
1508# the Free Software Foundation; either version 2 of the License, or
1509# (at your option) any later version.
1510#
1511# This program is distributed in the hope that it will be useful, but
1512# WITHOUT ANY WARRANTY; without even the implied warranty of
1513# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1514# General Public License for more details.
1515#
1516# You should have received a copy of the GNU General Public License
1517# along with this program; if not, write to the Free Software
1518# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1519#
1520# As a special exception to the GNU General Public License, if you
1521# distribute this file as part of a program that contains a
1522# configuration script generated by Autoconf, you may include it under
1523# the same distribution terms that you use for the rest of that program.
1524
c0dea852
ILT
1525# Sed that helps us avoid accidentally triggering echo(1) options like -n.
1526Xsed="sed -e s/^X//"
1527
1528# The HP-UX ksh and POSIX shell print the target directory to stdout
1529# if CDPATH is set.
1530if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
1531
1532### BEGIN LIBTOOL CONFIG
1533# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
fd3f7b52
ILT
1534#
1535# CC="$old_CC" CFLAGS="$old_CFLAGS" CPPFLAGS="$old_CPPFLAGS" \\
1536# LD="$old_LD" NM="$old_NM" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\
1537# DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\
1538# $0$ltconfig_args
1539#
1540# Compiler and other test output produced by $progname, useful for
1541# debugging $progname, is in ./config.log if it exists.
1542
fd3f7b52
ILT
1543# The version of $progname that generated this script.
1544LTCONFIG_VERSION="$VERSION"
1545
1546# Shell to use when invoking shell scripts.
c0dea852 1547SHELL="$SHELL"
fd3f7b52 1548
c0dea852 1549# Whether or not to build shared libraries.
fd3f7b52
ILT
1550build_libtool_libs=$enable_shared
1551
c0dea852 1552# Whether or not to build static libraries.
fd3f7b52
ILT
1553build_old_libs=$enable_static
1554
1555# The host system.
1556host_alias="$host_alias"
1557host="$host"
1558
c0dea852
ILT
1559# An echo program that does not interpret backslashes.
1560echo="$ltecho"
1561
fd3f7b52
ILT
1562# The archiver.
1563AR="$AR"
1564
1565# The default C compiler.
1566CC="$CC"
1567
1568# The linker used to build libraries.
1569LD="$LD"
1570
1571# Whether we need hard or soft links.
1572LN_S="$LN_S"
1573
1574# A BSD-compatible nm program.
1575NM="$NM"
1576
1577# Used on cygwin32: DLL creation program.
1578DLLTOOL="$DLLTOOL"
1579
1580# Used on cygwin32: assembler.
1581AS="$AS"
1582
1583# The name of the directory that contains temporary libtool files.
1584objdir="$objdir"
1585
1586# How to create reloadable object files.
1587reload_flag="$reload_flag"
1588reload_cmds="$reload_cmds"
1589
1590# How to pass a linker flag through the compiler.
1591wl="$wl"
1592
c0dea852
ILT
1593# Object file suffix (normally "o").
1594objext="$objext"
1595
1596# Old archive suffix (normally "a").
1597libext="$libext"
1598
fd3f7b52
ILT
1599# Additional compiler flags for building library objects.
1600pic_flag="$pic_flag"
1601
1602# Compiler flag to prevent dynamic linking.
1603link_static_flag="$link_static_flag"
1604
1605# Compiler flag to turn off builtin functions.
1606no_builtin_flag="$no_builtin_flag"
1607
1608# Compiler flag to allow reflexive dlopens.
1609export_dynamic_flag_spec="$export_dynamic_flag_spec"
1610
99e9c6f7
ILT
1611# Compiler flag to generate shared objects directly from archives.
1612whole_archive_flag_spec="$whole_archive_flag_spec"
1613
fd3f7b52
ILT
1614# Library versioning type.
1615version_type=$version_type
1616
1617# Format of library name prefix.
1618libname_spec="$libname_spec"
1619
1620# List of archive names. First name is the real one, the rest are links.
1621# The last name is the one that the linker finds with -lNAME.
1622library_names_spec="$library_names_spec"
1623
1624# The coded name of the library, if different from the real name.
1625soname_spec="$soname_spec"
1626
1627# Commands used to build and install an old-style archive.
1628RANLIB="$RANLIB"
1629old_archive_cmds="$old_archive_cmds"
1630old_postinstall_cmds="$old_postinstall_cmds"
1631old_postuninstall_cmds="$old_postuninstall_cmds"
1632
1633# Create an old-style archive from a shared archive.
1634old_archive_from_new_cmds="$old_archive_from_new_cmds"
1635
1636# Commands used to build and install a shared archive.
1637archive_cmds="$archive_cmds"
1638postinstall_cmds="$postinstall_cmds"
1639postuninstall_cmds="$postuninstall_cmds"
1640
1641# Flag that allows shared libraries with undefined symbols to be built.
1642allow_undefined_flag="$allow_undefined_flag"
1643
1644# Flag that forces no undefined symbols.
1645no_undefined_flag="$no_undefined_flag"
1646
1647# Commands used to finish a libtool library installation in a directory.
1648finish_cmds="$finish_cmds"
1649
1650# Same as above, but a single script fragment to be evaled but not shown.
1651finish_eval="$finish_eval"
1652
1653# Take the output of nm and produce a listing of raw symbols and C names.
1654global_symbol_pipe="$global_symbol_pipe"
1655
1656# This is the shared library runtime path variable.
1657runpath_var=$runpath_var
1658
1659# This is the shared library path variable.
1660shlibpath_var=$shlibpath_var
1661
1662# How to hardcode a shared library path into an executable.
1663hardcode_action=$hardcode_action
1664
1665# Flag to hardcode \$libdir into a binary during linking.
1666# This must work even if \$libdir does not exist.
1667hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec"
1668
1669# Whether we need a single -rpath flag with a separated argument.
1670hardcode_libdir_separator="$hardcode_libdir_separator"
1671
1672# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
1673# resulting binary.
1674hardcode_direct=$hardcode_direct
1675
1676# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
1677# resulting binary.
1678hardcode_minus_L=$hardcode_minus_L
1679
1680# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
1681# the resulting binary.
1682hardcode_shlibpath_var=$hardcode_shlibpath_var
1683
c0dea852
ILT
1684# Fix the shell variable \$srcfile for the compiler.
1685fix_srcfile_path="$fix_srcfile_path"
fd3f7b52
ILT
1686EOF
1687
1688case "$host_os" in
1689aix3*)
c0dea852
ILT
1690 cat <<\EOF >> "$ofile"
1691
fd3f7b52
ILT
1692# AIX sometimes has problems with the GCC collect2 program. For some
1693# reason, if we set the COLLECT_NAMES environment variable, the problems
1694# vanish in a puff of smoke.
1695if test "${COLLECT_NAMES+set}" != set; then
1696 COLLECT_NAMES=
1697 export COLLECT_NAMES
1698fi
fd3f7b52
ILT
1699EOF
1700 ;;
1701esac
1702
c0dea852
ILT
1703echo '### END LIBTOOL CONFIG' >> "$ofile"
1704echo >> "$ofile"
1705
fd3f7b52 1706# Append the ltmain.sh script.
c0dea852 1707cat "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
fd3f7b52 1708
c0dea852 1709chmod +x "$ofile"
fd3f7b52
ILT
1710exit 0
1711
1712# Local Variables:
1713# mode:shell-script
1714# sh-indentation:2
1715# End: