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