* simpos.h: prototype for scm_primitive_exit.
[bpt/guile.git] / ltconfig
CommitLineData
a7a8349d
MV
1#! /bin/sh
2
3# ltconfig - Create a system-specific libtool.
96abf47d 4# When updating this script, search for LINENUM and fix line number refs.
a7a8349d 5# Generated automatically from ltconfig.in by configure.
96abf47d 6# Copyright (C) 1996, 1997, Free Software Foundation, Inc.
a7a8349d
MV
7# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8#
9# This file is free software; you can redistribute it and/or modify it
10# under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful, but
15# WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17# General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, write to the Free Software
21# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22#
23# As a special exception to the GNU General Public License, if you
24# distribute this file as part of a program that contains a
25# configuration script generated by Autoconf, you may include it under
26# the same distribution terms that you use for the rest of that program.
27
28# A lot of this script is taken from autoconf-2.10.
29
30# The name of this program.
31progname=`echo "$0" | sed 's%^.*/%%'`
32
33# Constants:
34PROGRAM=ltconfig
35PACKAGE=libtool
a6a5a664 36VERSION=0.9h
a7a8349d
MV
37ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
38rm="rm -f"
39
40help="Try \`$progname --help' for more information."
41
42# Global variables:
96abf47d 43can_build_shared=yes
a7a8349d
MV
44enable_shared=yes
45# All known linkers require a `.a' archive for static linking.
46enable_static=yes
47ltmain=NONE
48silent=
49srcdir=
50ac_config_guess=
51ac_config_sub=
52host=NONE
53nonopt=NONE
54verify_host=yes
55with_gcc=no
56
4cdcd100 57old_AR="$AR"
a7a8349d
MV
58old_CC="$CC"
59old_CFLAGS="$CFLAGS"
60old_CPPFLAGS="$CPPFLAGS"
61old_LD="$LD"
62old_RANLIB="$RANLIB"
63
4cdcd100
JB
64test -z "$AR" && AR=ar
65
a7a8349d
MV
66# Parse the command line options.
67args=
68prev=
69for option
70do
71 case "$option" in
72 -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
73 *) optarg= ;;
74 esac
75
76 # If the previous option needs an argument, assign it.
77 if test -n "$prev"; then
78 eval "$prev=\$option"
79 prev=
80 continue
81 fi
82
83 case "$option" in
84 --help) cat <<EOM
85Usage: $progname [OPTION]... LTMAIN [HOST]
86
87Generate a system-specific libtool script.
88
89 --disable-shared do not build shared libraries
393e4e4d 90 --disable-static do not build static libraries
a7a8349d
MV
91 --help display this help and exit
92 --no-verify do not verify that HOST is a valid host type
93 --quiet same as \`--silent'
94 --silent don't print informational messages
95 --srcdir=DIR find \`config.guess' in DIR
96 --version output version information and exit
97 --with-gcc assume that the GNU C compiler will be used
98
99LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
100functionality.
101
102HOST is the canonical host system name [default=guessed].
103EOM
104 exit 0
105 ;;
106
107 --disable-shared) enable_shared=no ;;
108
393e4e4d
JB
109 --disable-static) enable_static=no ;;
110
a7a8349d
MV
111 --quiet | --silent) silent=yes ;;
112
113 --srcdir) prev=srcdir ;;
114 --srcdir=*) srcdir="$optarg" ;;
115
116 --no-verify) verify_host=no ;;
117
118 --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
119
120 --with-gcc) with_gcc=yes ;;
121
122 -*)
123 echo "$progname: unrecognized option \`$option'" 1>&2
124 echo "$help" 1>&2
125 exit 1
126 ;;
127
128 *)
129 if test "$ltmain" = NONE; then
130 ltmain="$option"
131 elif test "$host" = NONE; then
132# FIXME This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
133# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
134# echo "$progname: warning \`$option' is not a valid host type" 1>&2
135# fi
136 host="$option"
137 else
138 echo "$progname: too many arguments" 1>&2
139 echo "$help" 1>&2
140 exit 1
141 fi ;;
142 esac
143done
144
145if test "$ltmain" = NONE; then
146 echo "$progname: you must specify a LTMAIN file" 1>&2
147 echo "$help" 1>&2
148 exit 1
149fi
150
151if test -f "$ltmain"; then :
152else
153 echo "$progname: warning: \`$ltmain' does not exist" 1>&2
154fi
155
156# Quote any args containing shell metacharacters.
157ltconfig_args=
158for arg
159do
160 case "$arg" in
161 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
162 ltconfig_args="$ltconfig_args '$arg'" ;;
163 *) ltconfig_args="$ltconfig_args $arg" ;;
164 esac
165done
166
167# A relevant subset of AC_INIT.
168
169# File descriptor usage:
170# 0 standard input
171# 1 file creation
172# 2 errors and warnings
173# 3 some systems may open it to /dev/tty
174# 4 used on the Kubota Titan
175# 5 compiler messages saved in config.log
176# 6 checking for... messages and results
177if test "$silent" = yes; then
178 exec 6>/dev/null
179else
180 exec 6>&1
181fi
182exec 5>>./config.log
183
184# NLS nuisances.
185# Only set LANG and LC_ALL to C if already set.
186# These must not be set unconditionally because not all systems understand
187# e.g. LANG=C (notably SCO).
188if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
189if test "${LANG+set}" = set; then LANG=C; export LANG; fi
190
191if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
192 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
193 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
194 ac_n= ac_c='
195' ac_t=' '
196 else
197 ac_n=-n ac_c= ac_t=
198 fi
199else
200 ac_n= ac_c='\c' ac_t=
201fi
202
203if test -z "$srcdir"; then
204 # Assume the source directory is the same one as the path to ltmain.sh.
205 srcdir=`echo "$ltmain" | sed 's%/[^/]*$%%'`
206 test "$srcdir" = "$ltmain" && srcdir=.
207fi
208
209if test "$verify_host" = yes; then
210 # Check for config.guess and config.sub.
211 ac_aux_dir=
212 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
213 if test -f $ac_dir/config.guess; then
214 ac_aux_dir=$ac_dir
215 break
216 fi
217 done
218 if test -z "$ac_aux_dir"; then
219 echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
220 echo "$help" 1>&2
221 exit 1
222 fi
223 ac_config_guess=$ac_aux_dir/config.guess
224 ac_config_sub=$ac_aux_dir/config.sub
225
226 # Make sure we can run config.sub.
227 if $ac_config_sub sun4 >/dev/null 2>&1; then :
228 else
229 echo "$progname: cannot run $ac_config_sub" 1>&2
230 echo "$help" 1>&2
231 exit 1
232 fi
233
234 echo $ac_n "checking host system type""... $ac_c" 1>&6
235
236 host_alias=$host
237 case "$host_alias" in
238 NONE)
239 if host_alias=`$ac_config_guess`; then :
240 else
241 echo "$progname: cannot guess host type; you must specify one" 1>&2
242 echo "$help" 1>&2
243 exit 1
244 fi ;;
245 esac
246 host=`$ac_config_sub $host_alias`
247 echo "$ac_t""$host" 1>&6
248
249elif test "$host" = NONE; then
250 echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
251 echo "$help" 1>&2
252 exit 1
96abf47d 253else
a7a8349d
MV
254 host_alias=$host
255fi
256
4cdcd100
JB
257# Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
258case "$host" in
259*-*-linux-gnu*) ;;
260*-*-linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
261esac
262
393e4e4d
JB
263host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
264host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
265host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
a7a8349d
MV
266
267# Determine commands to create old-style static archives.
4cdcd100 268old_archive_cmds='$AR cru $oldlib$oldobjs'
a7a8349d
MV
269old_postinstall_cmds='chmod 644 $oldlib'
270
271# If RANLIB is not set, then run the test.
272if test "${RANLIB+set}" != "set"; then
273 result=no
274
275 echo $ac_n "checking for ranlib... $ac_c" 1>&6
276 if test "$result" = no; then
277 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
278 for dir in $PATH; do
279 test -z "$dir" && dir=.
280 if test -f $dir/ranlib; then
281 RANLIB="ranlib"
282 result="ranlib"
283 break
284 fi
285 done
286 IFS="$save_ifs"
287 fi
288
289 echo $ac_t "$result" 1>&6
290fi
291
292if test -n "$RANLIB"; then
293 old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
294 old_postinstall_cmds="$old_postinstall_cmds;\$RANLIB \$oldlib"
295fi
296
a7a8349d
MV
297# Check to see if we are using GCC.
298if test "$with_gcc" = no; then
299 # If CC is not set, then try to find GCC or a usable CC.
300 if test -z "$CC"; then
301 echo $ac_n "checking for gcc... $ac_c" 1>&6
302 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
303 for dir in $PATH; do
304 IFS="$save_ifs"
305 test -z "$dir" && dir=.
306 if test -f $dir/gcc; then
307 CC="gcc"
308 break
309 fi
310 done
311 IFS="$save_ifs"
312
313 if test -n "$CC"; then
314 echo "$ac_t""$CC" 1>&6
315 else
316 echo "$ac_t""no" 1>&6
317 fi
318 fi
319
320 # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
321 if test -z "$CC"; then
322 echo $ac_n "checking for cc... $ac_c" 1>&6
323 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
324 cc_rejected=no
325 for dir in $PATH; do
326 test -z "$dir" && dir=.
327 if test -f $dir/cc; then
328 if test "$dir/cc" = "/usr/ucb/cc"; then
329 cc_rejected=yes
330 continue
331 fi
332 CC="cc"
333 break
334 fi
335 done
336 IFS="$save_ifs"
337 if test $cc_rejected = yes; then
338 # We found a bogon in the path, so make sure we never use it.
339 set dummy $CC
340 shift
341 if test $# -gt 0; then
342 # We chose a different compiler from the bogus one.
343 # However, it has the same name, so the bogon will be chosen
344 # first if we set CC to just the name; use the full file name.
345 shift
346 set dummy "$dir/cc" "$@"
347 shift
348 CC="$@"
349 fi
350 fi
351
352 if test -n "$CC"; then
353 echo "$ac_t""$CC" 1>&6
354 else
355 echo "$ac_t""no" 1>&6
356 fi
357
358 if test -z "$CC"; then
359 echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
360 exit 1
361 fi
362 fi
363
364 # Now see if the compiler is really GCC.
365 with_gcc=no
366 echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
367
368 trap "$rm conftest.c; exit 1" 1 2 15
369 $rm conftest.c
370 cat > conftest.c <<EOF
371#ifdef __GNUC__
372 yes;
373#endif
374EOF
96abf47d 375 # LINENUM
393e4e4d 376 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:376: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
a7a8349d
MV
377 with_gcc=yes
378 fi
379 $rm conftest.c
380 echo $ac_t "$with_gcc" 1>&6
381fi
382
383# Allow CC to be a program name with arguments.
384set dummy $CC
385compiler="$2"
386
387echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
388pic_flag=
389profile_flag_pattern=
96abf47d 390special_shlib_compile_flags=
a7a8349d
MV
391wl=
392link_static_flag=
393
394if test "$with_gcc" = yes; then
395 pic_flag='-fPIC'
396 profile_flag_pattern='-pg?'
397 wl='-Wl,'
398 link_static_flag='-static'
399else
400 # PORTME Check for PIC flags for the system compiler.
393e4e4d
JB
401 case "$host_os" in
402 aix3* | aix4*)
a7a8349d 403 # FIXME All rs/6000 code is PIC, but is there any non-rs/6000 AIX platform?
96abf47d 404 pic_flag=
a7a8349d
MV
405 link_static_flag='-bnso -bI:/lib/syscalls.exp'
406 ;;
407
393e4e4d 408 hpux9* | hpux10*)
96abf47d
MD
409 # FIXME is there a better link_static_flag that works with the bundled CC?
410 wl='-Wl,'
411 link_static_flag='${wl}-a ${wl}archive'
a7a8349d
MV
412 pic_flag='+Z'
413 ;;
414
393e4e4d 415 irix5* | irix6*)
96abf47d
MD
416 wl='-Wl,'
417 link_static_flag='-non_shared'
418 # PIC (with -KPIC) is the default.
419 pic_flag=
420 ;;
421
393e4e4d 422 osf3* | osf4*)
96abf47d
MD
423 # FIXME - pic_flag is probably required for hppa*-osf* and i860-osf*
424 wl='-Wl,'
425 link_static_flag='-non_shared'
426 ;;
427
393e4e4d 428 sco3.2v5*)
96abf47d
MD
429 pic_flag='-Kpic'
430 link_static_flag='-dn'
431 special_shlib_compile_flags='-belf'
a7a8349d
MV
432 ;;
433
393e4e4d 434 solaris2*)
a7a8349d
MV
435 pic_flag='-KPIC'
436 link_static_flag='-Bstatic'
a6a5a664 437 wl='-Wl,'
a7a8349d
MV
438 ;;
439
393e4e4d 440 sunos4*)
a7a8349d
MV
441 pic_flag='-PIC'
442 link_static_flag='-Bstatic'
443 wl='-Qoption ld '
444 ;;
445
446 *)
447 can_build_shared=no
448 ;;
449 esac
450fi
451
393e4e4d
JB
452case "$host_cpu" in
453rs6000 | powerpc | powerpcle)
96abf47d 454 # Yippee! All RS/6000 and PowerPC code is position-independent.
a7a8349d
MV
455 pic_flag=
456 ;;
457esac
458
459if test -n "$pic_flag"; then
460 echo $ac_t "$pic_flag" 1>&6
461 pic_flag=" $pic_flag"
462else
463 echo $ac_t none 1>&6
464fi
465
96abf47d
MD
466# Check for any special shared library compilation flags.
467if test -n "$special_shlib_compile_flags"; then
468 echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
469 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
470 else
471 echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
472 can_build_shared=no
473 fi
474fi
475
393e4e4d
JB
476# See if we are using a broken GCC collect2 program.
477if test "$with_gcc" = yes; then
478 echo $ac_n "checking for broken GCC collect2... $ac_c" 1>&6
479
480 # FIXME: Run a test here, instead of relying on the canonical system name.
481 case "$host_os" in
482 aix3*)
483 can_build_shared=no
484 echo $ac_t yes 1>&6
485 echo "$progname: to build shared libraries, set the CC env variable to \`xlc' and reconfigure" 1>&2
486 ;;
487 *)
488 echo $ac_t no 1>&6
489 ;;
490 esac
491fi
492
a7a8349d
MV
493echo $ac_n "checking for $compiler option to statically link programs... $ac_c" 1>&6
494if test -n "$link_static_flag"; then
495 echo $ac_t "$link_static_flag" 1>&6
496else
497 echo $ac_t none 1>&6
498fi
499
a6a5a664
JB
500if test -z "$LD"; then
501 # Find the linker that we think the C compiler uses.
502 echo $ac_n "checking for ld used by $compiler... $ac_c" 1>&6
503
504 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
505 for ac_dir in $PATH; do
506 test -z "$ac_dir" && ac_dir=.
507 if test -f "$ac_dir/ld"; then
508 # Check to see if the program is GNU ld. I'd rather use --version,
509 # but apparently some GNU ld's only accept -v.
510 if "$ac_dir/ld" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
511 # If it was GNU ld, only accept it if we're using GCC.
512 LD="$ac_dir/ld"
513 test "$with_gcc" = yes && break
514 else
515 # If it was not GNU ld, and we are not using GCC, then accept it.
516 LD="$ac_dir/ld"
517 break
518 fi
519 fi
520 done
521 IFS="$ac_save_ifs"
522
523 if test -n "$CC"; then
524 echo "$ac_t""$LD" 1>&6
525 else
526 echo "$ac_t""no" 1>&6
527 fi
528
529 if test -z "$LD"; then
530 echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
531 exit 1
532 fi
533fi
534
a7a8349d 535# See if we're really using GNU ld.
a7a8349d
MV
536with_gnu_ld=no
537# Allow LD to be a program name with arguments.
538set dummy $LD
539linker="$2"
540echo $ac_n "checking if $LD is GNU ld... $ac_c" 1>&6
393e4e4d
JB
541# I'd rather use --version here, but apparently some GNU ld's don't accept
542# it, but do accept -v.
79131585 543if $LD -v 2>&1 | egrep '(GNU ld|with BFD)' > /dev/null; then
a7a8349d
MV
544 with_gnu_ld=yes
545 linker="GNU ld"
546fi
547echo $ac_t "$with_gnu_ld" 1>&6
548
549# See if the linker supports building shared libraries.
550echo $ac_n "checking if $linker supports shared libraries... $ac_c" 1>&6
551
393e4e4d 552allow_undefined_flag=
a7a8349d 553archive_cmds=
4cdcd100
JB
554export_dynamic_flag=
555hardcode_libdir_flag_spec=
556hardcode_libdir_separator=
96abf47d 557hardcode_direct=no
a7a8349d 558hardcode_minus_L=no
393e4e4d 559hardcode_runpath_var=no
96abf47d 560hardcode_shlibpath_var=unsupported
393e4e4d 561runpath_var=
a7a8349d
MV
562
563ld_shlibs=yes
564if test "$with_gnu_ld" = yes; then
565 # See if GNU ld supports shared libraries.
566
393e4e4d
JB
567 case "$host_os" in
568 sunos4*)
a7a8349d 569 ld_shlibs=yes
96abf47d
MD
570 hardcode_direct=yes
571 hardcode_shlibpath_var=no
a7a8349d
MV
572 ;;
573
574 *)
575 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
393e4e4d
JB
576 runpath_var=LD_RUN_PATH
577 hardcode_runpath_var=yes
a7a8349d
MV
578 ld_shlibs=yes
579 else
580 ld_shlibs=no
581 fi
582 ;;
583 esac
584
585 if test "$ld_shlibs" = yes; then
586 archive_cmds='$cc -shared ${wl}-soname $wl$soname -o $lib$libobjs$deplibs'
4cdcd100
JB
587 hardcode_libdir_flag_spec='${wl}-rpath $wl$libdir'
588 export_dynamic_flag='${wl}-export-dynamic'
a7a8349d
MV
589 fi
590else
591 # PORTME fill in a description of your system's linker (not GNU ld)
393e4e4d
JB
592 case "$host_os" in
593 aix3*)
594 allow_undefined_flag=unsupported
4cdcd100
JB
595 archive_cmds='/usr/ucb/nm$libobjs | egrep \" [BD] \" | sed \"s/^.* //\" > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE -lc$deplibs;$AR cru $lib $objdir/$soname'
596 # Note: this linker hardcodes the directories in LIBPATH if there
597 # are no directories specified by -L.
a7a8349d
MV
598 hardcode_minus_L=yes
599 ;;
600
393e4e4d
JB
601 aix4*)
602 allow_undefined_flag=unsupported
4cdcd100 603 archive_cmds='/bin/nm -B$libobjs | egrep \" [BD] \" | 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 604 hardcode_direct=yes
a7a8349d
MV
605 hardcode_minus_L=yes
606 ;;
607
393e4e4d
JB
608 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
609 # support. Future versions do this automatically, but an explicit c++rt0.o
610 # doesn't break anything, and helps significantly (at the cost of a little
611 # extra space).
612 freebsd2.2*)
613 archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs /usr/lib/c++rt0.o'
614 hardcode_direct=yes
615 hardcode_minus_L=yes
616 hardcode_shlibpath_var=no
617 ;;
618
619 # Unfortunately, older versions of FreeBSD 2 don't have this feature.
620 freebsd2*)
a7a8349d 621 archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
96abf47d
MD
622 hardcode_direct=yes
623 hardcode_minus_L=yes
624 hardcode_shlibpath_var=no
625 ;;
626
393e4e4d
JB
627 # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
628 freebsd3*)
629 archive_cmds='$CC -shared -o $lib$libobjs$deplibs'
630 hardcode_direct=yes
631 hardcode_minusL=yes
632 hardcode_shlibpath_var=no
633 ;;
634
635 hpux9*)
96abf47d 636 archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs$deplibs;mv $objdir/$soname $lib'
4cdcd100 637 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
96abf47d 638 hardcode_direct=yes
a7a8349d
MV
639 hardcode_minus_L=yes
640 ;;
641
393e4e4d 642 hpux10*)
a7a8349d 643 archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs$deplibs'
4cdcd100 644 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
96abf47d 645 hardcode_direct=yes
a7a8349d 646 hardcode_minus_L=yes
96abf47d
MD
647 ;;
648
393e4e4d 649 irix5* | irix6*)
96abf47d 650 archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs -lc$deplibs'
4cdcd100 651 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
a7a8349d
MV
652 ;;
653
393e4e4d 654 netbsd* | openbsd*)
a7a8349d
MV
655 # Tested with NetBSD 1.2 ld
656 archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
4cdcd100 657 hardcode_libdir_flag_spec='-R$libdir'
96abf47d
MD
658 hardcode_direct=yes
659 hardcode_shlibpath_var=no
a7a8349d
MV
660 ;;
661
393e4e4d
JB
662 osf3* | osf4*)
663 allow_undefined_flag=' -expect_unresolved'
664 archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs -lc$deplibs'
4cdcd100
JB
665 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
666 hardcode_libdir_separator=:
96abf47d
MD
667 ;;
668
393e4e4d 669 sco3.2v5*)
96abf47d
MD
670 archive_cmds='$LD -G -o $lib$libobjs$deplibs'
671 hardcode_direct=yes
a7a8349d
MV
672 ;;
673
393e4e4d 674 solaris2*)
a7a8349d 675 archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs'
4cdcd100 676 hardcode_libdir_flag_spec='-R$libdir'
96abf47d 677 hardcode_shlibpath_var=no
a7a8349d
MV
678 ;;
679
393e4e4d 680 sunos4*)
96abf47d 681 archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
4cdcd100 682 hardcode_libdir_flag_spec='-L$libdir'
96abf47d 683 hardcode_direct=yes
a7a8349d 684 hardcode_minus_L=yes
96abf47d 685 hardcode_shlibpath_var=no
a7a8349d
MV
686 ;;
687
688 *)
689 ld_shlibs=no
690 can_build_shared=no
691 ;;
692 esac
693fi
694echo $ac_t "$ld_shlibs" 1>&6
695
96abf47d
MD
696# Check hardcoding attributes.
697echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
698hardcode_action=
393e4e4d
JB
699if test -n "$hardcode_libdir_flag_spec" || \
700 test "$hardcode_runpath_var" = yes; then
701
96abf47d 702 # We can hardcode non-existant directories.
393e4e4d
JB
703 if test "$hardcode_direct" != no && \
704 test "$hardcode_minus_L" != no && \
96abf47d
MD
705 test "$hardcode_shlibpath_var" != no; then
706
79131585 707 # Linking always hardcodes the temporary library directory.
96abf47d
MD
708 hardcode_action=relink
709 else
79131585 710 # We can link without hardcoding, and we can hardcode nonexisting dirs.
4cdcd100 711 hardcode_action=immediate
96abf47d 712 fi
393e4e4d
JB
713elif test "$hardcode_direct" != yes && \
714 test "$hardcode_minus_L" != yes && \
79131585 715 test "$hardcode_shlibpath_var" != yes; then
96abf47d
MD
716 # We can't hardcode anything.
717 hardcode_action=unsupported
79131585
JB
718else
719 # We can only hardcode existing directories.
720 hardcode_action=relink
a7a8349d 721fi
96abf47d
MD
722echo $ac_t "$hardcode_action" 1>&6
723test "$hardcode_action" = unsupported && can_build_shared=no
724
a7a8349d
MV
725
726reload_flag=
727reload_cmds='$LD$reload_flag -o $output$reload_objs'
728echo $ac_n "checking for $linker option to reload object files... $ac_c" 1>&6
729# PORTME Some linker may need a different reload flag.
730reload_flag='-r'
731echo $ac_t "$reload_flag"
732test -n "$reload_flag" && reload_flag=" $reload_flag"
733
734# PORTME Fill in your ld.so characteristics
4cdcd100 735library_names_spec=
a7a8349d
MV
736soname_spec=
737postinstall_cmds=
738finish_cmds=
739shlibpath_var=
740version_type=none
741dynamic_linker="$host_os ld.so"
742
743echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
393e4e4d
JB
744case "$host_os" in
745aix3* | aix4*)
a7a8349d 746 version_type=linux
4cdcd100 747 library_names_spec='$libname.so.$versuffix $libname.a'
a7a8349d
MV
748 shlibpath_var=LIBPATH
749
750 # AIX has no versioning support, so we append a major version to the name.
751 soname_spec='$libname.so.$major'
752 ;;
753
393e4e4d 754freebsd2* | freebsd3*)
a7a8349d 755 version_type=sunos
4cdcd100 756 library_names_spec='$libname.so.$versuffix $libname.so'
a7a8349d
MV
757 finish_cmds='ldconfig -m $libdir'
758 shlibpath_var=LD_LIBRARY_PATH
759 ;;
760
393e4e4d
JB
761gnu*)
762 version_type=sunos
763 library_names_spec='$libname.so.$versuffix'
764 shlibpath_var=LD_LIBRARY_PATH
765 ;;
a7a8349d 766
393e4e4d 767hpux9* | hpux10*)
a7a8349d
MV
768 # Give a soname corresponding to the major version so that dld.sl refuses to
769 # link against other versions.
770 dynamic_linker="$host_os dld.sl"
771 version_type=sunos
772 shlibpath_var=SHLIB_PATH
4cdcd100 773 library_names_spec='$libname.sl.$versuffix $libname.sl.$major $libname.sl'
a7a8349d
MV
774 soname_spec='$libname.sl.$major'
775 # HP-UX runs *really* slowly unless shared libraries are mode 555.
776 postinstall_cmds='chmod 555 $lib'
777 ;;
778
393e4e4d 779irix5* | irix6*)
96abf47d
MD
780 version_type=osf
781 soname_spec='$libname.so'
4cdcd100 782 library_names_spec='$libname.so.$versuffix $libname.so'
96abf47d
MD
783 shlibpath_var=LD_LIBRARY_PATH
784 ;;
785
4cdcd100 786# No shared lib support for Linux oldld, aout, or coff.
393e4e4d 787linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
a7a8349d
MV
788 dynamic_linker=no
789 can_build_shared=no
790 ;;
791
4cdcd100 792# This must be Linux ELF.
393e4e4d 793linux-gnu*)
a7a8349d 794 version_type=linux
4cdcd100 795 library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
a7a8349d
MV
796 soname_spec='$libname.so.$major'
797 finish_cmds='ldconfig -n $libdir'
798 shlibpath_var=LD_LIBRARY_PATH
799 ;;
800
393e4e4d 801netbsd* | openbsd*)
a7a8349d 802 version_type=sunos
4cdcd100 803 library_names_spec='$libname.so.$versuffix'
a7a8349d
MV
804 finish_cmds='ldconfig -m $libdir'
805 shlibpath_var=LD_LIBRARY_PATH
806 ;;
807
393e4e4d 808osf3* | osf4*)
a7a8349d
MV
809 version_type=osf
810 soname_spec='$libname.so'
4cdcd100 811 library_names_spec='$libname.so.$versuffix $libname.so'
a7a8349d
MV
812 shlibpath_var=LD_LIBRARY_PATH
813 ;;
814
393e4e4d 815sco3.2v5*)
96abf47d
MD
816 version_type=osf
817 soname_spec='$libname.so.$major'
4cdcd100 818 library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
96abf47d
MD
819 shlibpath_var=LD_LIBRARY_PATH
820 ;;
821
393e4e4d 822solaris2*)
a7a8349d 823 version_type=linux
4cdcd100 824 library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
a7a8349d
MV
825 soname_spec='$libname.so.$major'
826 shlibpath_var=LD_LIBRARY_PATH
827 ;;
828
393e4e4d 829sunos4*)
a7a8349d 830 version_type=sunos
4cdcd100 831 library_names_spec='$libname.so.$versuffix'
a7a8349d
MV
832 finish_cmds='ldconfig $libdir'
833 shlibpath_var=LD_LIBRARY_PATH
834 ;;
835
836*)
837 dynamic_linker=no
838 can_build_shared=no
839 ;;
840esac
841echo "$ac_t""$dynamic_linker"
842
843
96abf47d
MD
844# FIXME need to add library stripping features
845# strip -x works for most platforms, though not for static libraries on NetBSD
846# HP-UX requires "-r" for library stripping
847striplib=
848old_striplib=
849
850#echo $ac_n "checking for static library strip program... $ac_c" 1>&6
851#if test -n "$old_striplib"; then
852# echo $ac_t "$old_striplib" 1>&6
853#else
854# echo $ac_t none 1>&6
855#fi
856
857#if test "$can_build_shared" = yes; then
858# echo $ac_n "checking for shared library strip program... $ac_c" 1>&6
859#
860# if test -n "$striplib"; then
861# echo $ac_t "$striplib" 1>&6
862# else
863# echo $ac_t none 1>&6
864# fi
865#fi
866
a7a8349d
MV
867# Report the consequences.
868echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
869
870echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
871test "$can_build_shared" = "no" && enable_shared=no
872
4cdcd100
JB
873# On AIX, shared libraries and static libraries use the same namespace.
874case "$host_os" in
875aix*)
876 test "$enable_shared" = yes && enable_static=no
877 if test -n "$RANLIB"; then
878 archive_cmds="$archive_cmds;\$RANLIB \$lib"
879 postinstall_cmds='$RANLIB $lib'
880 fi
881 ;;
882esac
a7a8349d
MV
883
884echo "$ac_t""$enable_shared" 1>&6
885
4cdcd100
JB
886# Make sure either enable_shared or enable_static is yes.
887test "$enable_shared" = yes || enable_static=yes
a7a8349d 888
393e4e4d
JB
889echo "checking whether to build static libraries... $enable_static" 1>&6
890
a7a8349d
MV
891ofile=libtool
892trap "$rm $ofile; exit 1" 1 2 15
893echo creating $ofile
894rm -fr $ofile
895cat <<EOF > $ofile
896#! /bin/sh
897
898# libtool - Provide generalized library-building support services.
899#
900# Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
901# This program was configured as follows,
902# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
903#
904# CC="$old_CC" CFLAGS="$old_CFLAGS" LD="$old_LD" RANLIB="$old_RANLIB" \\
905# $0$ltconfig_args
906#
907# Compiler and other test output produced by $progname, useful for
908# debugging $progname, is in ./config.log if it exists.
909
910# The version of $progname that generated this script.
911LTCONFIG_VERSION="$VERSION"
912
913# Whether or not to build libtool libraries.
914build_libtool_libs=$enable_shared
915
916# Whether or not to build old-style libraries.
917build_old_libs=$enable_static
918
919# The host system.
920host_alias="$host_alias"
921host="$host"
922
4cdcd100
JB
923# The archiver.
924AR='$AR'
925
a7a8349d
MV
926# The linker used to build libraries.
927LD='$LD'
928
929# How to create reloadable object files.
930reload_flag='$reload_flag'
931reload_cmds='$reload_cmds'
932
933# How to pass a linker flag through the compiler.
934wl='$wl'
935
936# Additional compiler flags for building library objects.
937pic_flag='$pic_flag'
938
939# Compiler flag to prevent dynamic linking.
940link_static_flag='$link_static_flag'
941
4cdcd100
JB
942# Compiler flag to allow reflexive dlopens.
943export_dynamic_flag='$export_dynamic_flag'
944
a7a8349d
MV
945# Pattern to match compiler flags for creating libNAME_p libraries:
946profile_flag_pattern='$profile_flag_pattern'
947
948# Library versioning type.
949version_type=$version_type
950
951# List of archive names. First name is the real one, the rest are links.
96abf47d 952# The last name is the one that the linker finds with -lNAME.
4cdcd100 953library_names_spec='$library_names_spec'
a7a8349d
MV
954
955# The coded name of the library, if different from the real name.
956soname_spec='$soname_spec'
957
958# Commands used to build and install an old-style archive.
959RANLIB='$RANLIB'
960old_archive_cmds='$old_archive_cmds'
961old_postinstall_cmds='$old_postinstall_cmds'
962
963# Commands used to build and install a shared archive.
964archive_cmds='$archive_cmds'
965postinstall_cmds='$postinstall_cmds'
966
393e4e4d
JB
967# Flag that allows shared libraries with undefined symbols to be built.
968allow_undefined_flag='$allow_undefined_flag'
969
a7a8349d
MV
970# Commands used to finish a libtool library installation in a directory.
971finish_cmds='$finish_cmds'
972
a7a8349d
MV
973# How to strip a library file.
974striplib='$striplib'
975old_striplib='$old_striplib'
976
393e4e4d
JB
977# This is the shared library runtime path variable.
978runpath_var=$runpath_var
979
a7a8349d
MV
980# This is the shared library path variable.
981shlibpath_var=$shlibpath_var
982
96abf47d
MD
983# How to hardcode a shared library path into an executable.
984hardcode_action=$hardcode_action
985
986# Flag to hardcode \$libdir into a binary during linking.
987# This must work even if \$libdir does not exist.
4cdcd100
JB
988hardcode_libdir_flag_spec='$hardcode_libdir_flag_spec'
989
990# Whether we need a single -rpath flag with a separated argument.
991hardcode_libdir_separator='$hardcode_libdir_separator'
96abf47d
MD
992
993# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
994# resulting binary.
995hardcode_direct=$hardcode_direct
a7a8349d
MV
996
997# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
998# resulting binary.
999hardcode_minus_L=$hardcode_minus_L
1000
393e4e4d
JB
1001# Set to yes if using RUNPATH_VAR=DIR during linking hardcodes DIR into the
1002# resulting binary.
1003hardcode_runpath_var=$hardcode_runpath_var
1004
1005# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
96abf47d
MD
1006# the resulting binary.
1007hardcode_shlibpath_var=$hardcode_shlibpath_var
1008
a7a8349d
MV
1009EOF
1010
1011# Detect if we are using a relative or absolute path to ltmain.sh.
1012case "$ltmain" in
1013/*) cat <<EOF2 >> $ofile
1014# Execute the libtool backend.
1015. $ltmain
1016EOF2
1017 ;;
1018*) cat <<EOF3 >> $ofile
1019# Find the path to this script.
1020thisdir=\`echo "\$0" | sed -e 's%/[^/]*\$%%'\`
1021test "X\$0" = "X\$thisdir" && thisdir=.
1022
1023# Execute the libtool backend.
1024. \$thisdir/$ltmain
1025EOF3
1026 ;;
1027esac
1028
1029echo 'exit 1' >> $ofile
1030
1031chmod +x $ofile
1032exit 0
1033
1034# Local Variables:
1035# mode:shell-script
1036# sh-indentation:2
1037# End: