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