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