Allow INLINE to be defined for debugging
[official-gcc.git] / ltconfig
blob4f1a9cec0e419e79448ac0bbf8f75e3ebf33921f
1 #! /bin/sh
3 # ltconfig - Create a system-specific libtool.
4 # Copyright (C) 1996-1998 Free Software Foundation, Inc.
5 # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 # This file is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
26 # A lot of this script is taken from autoconf-2.10.
28 # Check that we are running under the correct shell.
29 SHELL=${CONFIG_SHELL-/bin/sh}
30 if test "X$1" = "X--no-reexec"; then
31 # Discard the --no-reexec flag, and continue.
32 shift
33 elif test "X$SHELL" != X/bin/sh; then
34 # Restart under the correct shell.
35 exec "$SHELL" "$0" --no-reexec ${1+"$@"}
38 # The HP-UX ksh and POSIX shell print the target directory to stdout
39 # if CDPATH is set.
40 if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
42 echo=echo
43 if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
44 else
45 # The Solaris, AIX, and Digital Unix default echo programs unquote
46 # backslashes. This makes it impossible to quote backslashes using
47 # echo "$something" | sed 's/\\/\\\\/g'
49 # So, first we look for a working echo in the user's PATH.
50 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
51 for dir in $PATH /usr/ucb; do
52 if test -f $dir/echo && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t'; then
53 echo="$dir/echo"
54 break
56 done
57 IFS="$save_ifs"
59 if test "X$echo" = Xecho; then
60 # We didn't find a better echo, so look for alternatives.
61 if test "X`(print -r '\t') 2>/dev/null`" = 'X\t'; then
62 # This shell has a builtin print -r that does the trick.
63 echo='print -r'
64 # elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then
65 # # If we have ksh, try running ltconfig again with it.
66 # CONFIG_SHELL=/bin/ksh
67 # export CONFIG_SHELL
68 # exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
69 else
70 # Try using printf.
71 echo='printf %s\n'
72 if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
73 else
74 # Oops. We lost completely, so just stick with echo.
75 echo=echo
81 # Sed substitution that helps us do robust quoting. It backslashifies
82 # metacharacters that are still active within double-quoted strings.
83 Xsed='sed -e s/^X//'
84 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
86 # Same as above, but do not quote variable references.
87 double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
89 # The name of this program.
90 progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
92 # Constants:
93 PROGRAM=ltconfig
94 PACKAGE=libtool
95 VERSION=1.2a
96 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
97 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
98 rm="rm -f"
100 help="Try \`$progname --help' for more information."
102 # Global variables:
103 default_ofile=libtool
104 can_build_shared=yes
105 enable_shared=yes
106 # All known linkers require a `.a' archive for static linking.
107 enable_static=yes
108 ltmain=
109 silent=
110 srcdir=
111 ac_config_guess=
112 ac_config_sub=
113 host=
114 nonopt=
115 ofile="$default_ofile"
116 verify_host=yes
117 with_gcc=no
118 with_gnu_ld=no
120 old_AR="$AR"
121 old_CC="$CC"
122 old_CFLAGS="$CFLAGS"
123 old_CPPFLAGS="$CPPFLAGS"
124 old_LD="$LD"
125 old_LN_S="$LN_S"
126 old_NM="$NM"
127 old_RANLIB="$RANLIB"
128 old_DLLTOOL="$DLLTOOL"
129 old_AS="$AS"
131 # Parse the command line options.
132 args=
133 prev=
134 for option
136 case "$option" in
137 -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
138 *) optarg= ;;
139 esac
141 # If the previous option needs an argument, assign it.
142 if test -n "$prev"; then
143 eval "$prev=\$option"
144 prev=
145 continue
148 case "$option" in
149 --help) cat <<EOM
150 Usage: $progname [OPTION]... LTMAIN [HOST]
152 Generate a system-specific libtool script.
154 --debug enable verbose shell tracing
155 --disable-shared do not build shared libraries
156 --disable-static do not build static libraries
157 --help display this help and exit
158 --no-verify do not verify that HOST is a valid host type
159 -o, --output=FILE specify the output file [default=$default_ofile]
160 --quiet same as \`--silent'
161 --silent do not print informational messages
162 --srcdir=DIR find \`config.guess' in DIR
163 --version output version information and exit
164 --with-gcc assume that the GNU C compiler will be used
165 --with-gnu-ld assume that the C compiler uses the GNU linker
167 LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
168 functionality.
170 HOST is the canonical host system name [default=guessed].
172 exit 0
175 --debug)
176 echo "$progname: enabling shell trace mode"
177 set -x
180 --disable-shared) enable_shared=no ;;
182 --disable-static) enable_static=no ;;
184 --quiet | --silent) silent=yes ;;
186 --srcdir) prev=srcdir ;;
187 --srcdir=*) srcdir="$optarg" ;;
189 --no-verify) verify_host=no ;;
191 --output | -o) prev=ofile ;;
192 --output=*) ofile="$optarg" ;;
194 --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
196 --with-gcc) with_gcc=yes ;;
197 --with-gnu-ld) with_gnu_ld=yes ;;
200 echo "$progname: unrecognized option \`$option'" 1>&2
201 echo "$help" 1>&2
202 exit 1
206 if test -z "$ltmain"; then
207 ltmain="$option"
208 elif test -z "$host"; then
209 # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
210 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
211 # echo "$progname: warning \`$option' is not a valid host type" 1>&2
212 # fi
213 host="$option"
214 else
215 echo "$progname: too many arguments" 1>&2
216 echo "$help" 1>&2
217 exit 1
218 fi ;;
219 esac
220 done
222 if test -z "$ltmain"; then
223 echo "$progname: you must specify a LTMAIN file" 1>&2
224 echo "$help" 1>&2
225 exit 1
228 if test -f "$ltmain"; then :
229 else
230 echo "$progname: \`$ltmain' does not exist" 1>&2
231 echo "$help" 1>&2
232 exit 1
235 # Quote any args containing shell metacharacters.
236 ltconfig_args=
237 for arg
239 case "$arg" in
240 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
241 ltconfig_args="$ltconfig_args '$arg'" ;;
242 *) ltconfig_args="$ltconfig_args $arg" ;;
243 esac
244 done
246 # A relevant subset of AC_INIT.
248 # File descriptor usage:
249 # 0 standard input
250 # 1 file creation
251 # 2 errors and warnings
252 # 3 some systems may open it to /dev/tty
253 # 4 used on the Kubota Titan
254 # 5 compiler messages saved in config.log
255 # 6 checking for... messages and results
256 if test "$silent" = yes; then
257 exec 6>/dev/null
258 else
259 exec 6>&1
261 exec 5>>./config.log
263 # NLS nuisances.
264 # Only set LANG and LC_ALL to C if already set.
265 # These must not be set unconditionally because not all systems understand
266 # e.g. LANG=C (notably SCO).
267 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
268 if test "${LANG+set}" = set; then LANG=C; export LANG; fi
270 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
271 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
272 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
273 ac_n= ac_c='
274 ' ac_t=' '
275 else
276 ac_n=-n ac_c= ac_t=
278 else
279 ac_n= ac_c='\c' ac_t=
282 if test -z "$srcdir"; then
283 # Assume the source directory is the same one as the path to ltmain.sh.
284 srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
285 test "$srcdir" = "$ltmain" && srcdir=.
288 trap "$rm conftest*; exit 1" 1 2 15
289 if test "$verify_host" = yes; then
290 # Check for config.guess and config.sub.
291 ac_aux_dir=
292 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
293 if test -f $ac_dir/config.guess; then
294 ac_aux_dir=$ac_dir
295 break
297 done
298 if test -z "$ac_aux_dir"; then
299 echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
300 echo "$help" 1>&2
301 exit 1
303 ac_config_guess=$ac_aux_dir/config.guess
304 ac_config_sub=$ac_aux_dir/config.sub
306 # Make sure we can run config.sub.
307 if $ac_config_sub sun4 >/dev/null 2>&1; then :
308 else
309 echo "$progname: cannot run $ac_config_sub" 1>&2
310 echo "$help" 1>&2
311 exit 1
314 echo $ac_n "checking host system type""... $ac_c" 1>&6
316 host_alias=$host
317 case "$host_alias" in
319 if host_alias=`$ac_config_guess`; then :
320 else
321 echo "$progname: cannot guess host type; you must specify one" 1>&2
322 echo "$help" 1>&2
323 exit 1
324 fi ;;
325 esac
326 host=`$ac_config_sub $host_alias`
327 echo "$ac_t$host" 1>&6
329 # Make sure the host verified.
330 test -z "$host" && exit 1
332 elif test -z "$host"; then
333 echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
334 echo "$help" 1>&2
335 exit 1
336 else
337 host_alias=$host
340 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
341 case "$host_os" in
342 linux-gnu*) ;;
343 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
344 esac
346 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
347 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
348 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
350 case "$host_os" in
351 aix3*)
352 # AIX sometimes has problems with the GCC collect2 program. For some
353 # reason, if we set the COLLECT_NAMES environment variable, the problems
354 # vanish in a puff of smoke.
355 if test "${COLLECT_NAMES+set}" != set; then
356 COLLECT_NAMES=
357 export COLLECT_NAMES
360 esac
362 # Determine commands to create old-style static archives.
363 old_archive_cmds='$AR cru $oldlib$oldobjs'
364 old_postinstall_cmds='chmod 644 $oldlib'
365 old_postuninstall_cmds=
367 # Set a sane default for `AR'.
368 test -z "$AR" && AR=ar
370 # If RANLIB is not set, then run the test.
371 if test "${RANLIB+set}" != "set"; then
372 result=no
374 echo $ac_n "checking for ranlib... $ac_c" 1>&6
375 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
376 for dir in $PATH; do
377 test -z "$dir" && dir=.
378 if test -f $dir/ranlib; then
379 RANLIB="ranlib"
380 result="ranlib"
381 break
383 done
384 IFS="$save_ifs"
386 echo "$ac_t$result" 1>&6
389 if test -n "$RANLIB"; then
390 old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
391 old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds"
394 # Set sane defaults for `DLLTOOL' and `AS', used on cygwin32.
395 test -z "$DLLTOOL" && DLLTOOL=dlltool
396 test -z "$AS" && AS=as
398 # Check to see if we are using GCC.
399 if test "$with_gcc" != yes || test -z "$CC"; then
400 # If CC is not set, then try to find GCC or a usable CC.
401 if test -z "$CC"; then
402 echo $ac_n "checking for gcc... $ac_c" 1>&6
403 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
404 for dir in $PATH; do
405 IFS="$save_ifs"
406 test -z "$dir" && dir=.
407 if test -f $dir/gcc; then
408 CC="gcc"
409 break
411 done
412 IFS="$save_ifs"
414 if test -n "$CC"; then
415 echo "$ac_t$CC" 1>&6
416 else
417 echo "$ac_t"no 1>&6
421 # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
422 if test -z "$CC"; then
423 echo $ac_n "checking for cc... $ac_c" 1>&6
424 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
425 cc_rejected=no
426 for dir in $PATH; do
427 test -z "$dir" && dir=.
428 if test -f $dir/cc; then
429 if test "$dir/cc" = "/usr/ucb/cc"; then
430 cc_rejected=yes
431 continue
433 CC="cc"
434 break
436 done
437 IFS="$save_ifs"
438 if test $cc_rejected = yes; then
439 # We found a bogon in the path, so make sure we never use it.
440 set dummy $CC
441 shift
442 if test $# -gt 0; then
443 # We chose a different compiler from the bogus one.
444 # However, it has the same name, so the bogon will be chosen
445 # first if we set CC to just the name; use the full file name.
446 shift
447 set dummy "$dir/cc" "$@"
448 shift
449 CC="$@"
453 if test -n "$CC"; then
454 echo "$ac_t$CC" 1>&6
455 else
456 echo "$ac_t"no 1>&6
459 if test -z "$CC"; then
460 echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
461 exit 1
465 # Now see if the compiler is really GCC.
466 with_gcc=no
467 echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
468 echo "$progname:468: checking whether we are using GNU C" >&5
470 $rm conftest.c
471 cat > conftest.c <<EOF
472 #ifdef __GNUC__
473 yes;
474 #endif
476 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
477 with_gcc=yes
479 $rm conftest.c
480 echo "$ac_t$with_gcc" 1>&6
483 # Allow CC to be a program name with arguments.
484 set dummy $CC
485 compiler="$2"
487 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
488 pic_flag=
489 special_shlib_compile_flags=
491 link_static_flag=
492 no_builtin_flag=
494 if test "$with_gcc" = yes; then
495 wl='-Wl,'
496 link_static_flag='-static'
497 no_builtin_flag=' -fno-builtin'
499 case "$host_os" in
500 aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
501 # PIC is the default for these OSes.
503 cygwin32* | os2*)
504 # We can build DLLs from non-PIC.
506 amigaos*)
507 # FIXME: we need at least 68020 code to build shared libraries, but
508 # adding the `-m68020' flag to GCC prevents building anything better,
509 # like `-m68040'.
510 pic_flag='-m68020 -resident32 -malways-restore-a4'
513 pic_flag='-fPIC'
515 esac
516 else
517 # PORTME Check for PIC flags for the system compiler.
518 case "$host_os" in
519 aix3* | aix4*)
520 # All AIX code is PIC.
521 link_static_flag='-bnso -bI:/lib/syscalls.exp'
524 hpux9* | hpux10* | hpux11*)
525 # Is there a better link_static_flag that works with the bundled CC?
526 wl='-Wl,'
527 link_static_flag="${wl}-a ${wl}archive"
528 pic_flag='+Z'
531 irix5* | irix6*)
532 wl='-Wl,'
533 link_static_flag='-non_shared'
534 # PIC (with -KPIC) is the default.
537 cygwin32* | os2*)
538 # We can build DLLs from non-PIC.
541 osf3* | osf4*)
542 # All OSF/1 code is PIC.
543 wl='-Wl,'
544 link_static_flag='-non_shared'
547 sco3.2v5*)
548 pic_flag='-Kpic'
549 link_static_flag='-dn'
550 special_shlib_compile_flags='-belf'
553 solaris2*)
554 pic_flag='-KPIC'
555 link_static_flag='-Bstatic'
556 wl='-Wl,'
559 sunos4*)
560 pic_flag='-PIC'
561 link_static_flag='-Bstatic'
562 wl='-Qoption ld '
565 sysv4.2uw2*)
566 pic_flag='-KPIC'
567 link_static_flag='-Bstatic'
568 wl='-Wl,'
571 uts4*)
572 pic_flag='-pic'
573 link_static_flag='-Bstatic'
577 can_build_shared=no
579 esac
582 if test -n "$pic_flag"; then
583 echo "$ac_t$pic_flag" 1>&6
585 # Check to make sure the pic_flag actually works.
586 echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
587 $rm conftest*
588 echo "int some_variable = 0;" > conftest.c
589 save_CFLAGS="$CFLAGS"
590 CFLAGS="$CFLAGS $pic_flag -DPIC"
591 echo "$progname:591: checking if $compiler PIC flag $pic_flag works" >&5
592 if { (eval echo $progname:592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
593 # Append any warnings to the config.log.
594 cat conftest.err 1>&5
596 # On HP-UX, both CC and GCC only warn that PIC is supported... then they
597 # create non-PIC objects. So, if there were any warnings, we assume that
598 # PIC is not supported.
599 if test -s conftest.err; then
600 echo "$ac_t"no 1>&6
601 can_build_shared=no
602 pic_flag=
603 else
604 echo "$ac_t"yes 1>&6
605 pic_flag=" $pic_flag"
607 else
608 # Append any errors to the config.log.
609 cat conftest.err 1>&5
610 can_build_shared=no
611 pic_flag=
612 echo "$ac_t"no 1>&6
614 CFLAGS="$save_CFLAGS"
615 $rm conftest*
616 else
617 echo "$ac_t"none 1>&6
620 # Check for any special shared library compilation flags.
621 if test -n "$special_shlib_compile_flags"; then
622 echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
623 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
624 else
625 echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
626 can_build_shared=no
630 echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
631 $rm conftest*
632 echo 'main(){return(0);}' > conftest.c
633 save_LDFLAGS="$LDFLAGS"
634 LDFLAGS="$LDFLAGS $link_static_flag"
635 echo "$progname:635: checking if $compiler static flag $link_static_flag works" >&5
636 if { (eval echo $progname:636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
637 echo "$ac_t$link_static_flag" 1>&6
638 else
639 echo "$ac_t"none 1>&6
640 link_static_flag=
642 LDFLAGS="$save_LDFLAGS"
643 $rm conftest*
645 if test -z "$LN_S"; then
646 # Check to see if we can use ln -s, or we need hard links.
647 echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
648 $rm conftestdata
649 if ln -s X conftestdata 2>/dev/null; then
650 $rm conftestdata
651 LN_S="ln -s"
652 else
653 LN_S=ln
655 if test "$LN_S" = "ln -s"; then
656 echo "$ac_t"yes 1>&6
657 else
658 echo "$ac_t"no 1>&6
662 # Make sure LD is an absolute path.
663 if test -z "$LD"; then
664 ac_prog=ld
665 if test "$with_gcc" = yes; then
666 # Check if gcc -print-prog-name=ld gives a path.
667 echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
668 echo "$progname:668: checking for ld used by GCC" >&5
669 ac_prog=`($CC -print-prog-name=ld) 2>&5`
670 case "$ac_prog" in
671 # Accept absolute paths.
672 /* | [A-Za-z]:\\*)
673 test -z "$LD" && LD="$ac_prog"
676 # If it fails, then pretend we are not using GCC.
677 ac_prog=ld
680 # If it is relative, then search for the first ld in PATH.
681 with_gnu_ld=unknown
683 esac
684 elif test "$with_gnu_ld" = yes; then
685 echo $ac_n "checking for GNU ld... $ac_c" 1>&6
686 echo "$progname:686: checking for GNU ld" >&5
687 else
688 echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
689 echo "$progname:689: checking for non-GNU ld" >&5
692 if test -z "$LD"; then
693 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
694 for ac_dir in $PATH; do
695 test -z "$ac_dir" && ac_dir=.
696 if test -f "$ac_dir/$ac_prog"; then
697 LD="$ac_dir/$ac_prog"
698 # Check to see if the program is GNU ld. I'd rather use --version,
699 # but apparently some GNU ld's only accept -v.
700 # Break only if it was the GNU/non-GNU ld that we prefer.
701 if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
702 test "$with_gnu_ld" != no && break
703 else
704 test "$with_gnu_ld" != yes && break
707 done
708 IFS="$ac_save_ifs"
711 if test -n "$LD"; then
712 echo "$ac_t$LD" 1>&6
713 else
714 echo "$ac_t"no 1>&6
717 if test -z "$LD"; then
718 echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
719 exit 1
723 # Check to see if it really is or is not GNU ld.
724 echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
725 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
726 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
727 with_gnu_ld=yes
728 else
729 with_gnu_ld=no
731 echo "$ac_t$with_gnu_ld" 1>&6
733 # See if the linker supports building shared libraries.
734 echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
736 allow_undefined_flag=
737 no_undefined_flag=
738 archive_cmds=
739 old_archive_from_new_cmds=
740 export_dynamic_flag_spec=
741 hardcode_libdir_flag_spec=
742 hardcode_libdir_separator=
743 hardcode_direct=no
744 hardcode_minus_L=no
745 hardcode_shlibpath_var=unsupported
746 runpath_var=
748 ld_shlibs=yes
749 if test "$with_gnu_ld" = yes; then
751 # See if GNU ld supports shared libraries.
752 case "$host_os" in
753 amigaos*)
754 archive_cmds='$rm $objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data;$AR cru $lib$libobjs;$RANLIB $lib;(cd $objdir && a2ixlibrary -32)'
755 hardcode_libdir_flag_spec='-L$libdir'
756 hardcode_minus_L=yes
759 sunos4*)
760 archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
763 cygwin32*)
764 # hardcode_libdir_flag_spec is actually meaningless, as there is
765 # no search path for DLLs.
766 hardcode_libdir_flag_spec='-L$libdir'
767 allow_undefined_flag=unsupported
768 # Very, very bogus.
769 echo '
770 #include <windows.h>
772 struct _reent *_impure_ptr;
773 extern struct _reent *__imp_reent_data;
774 BOOL APIENTRY
775 __dll_entry (HINSTANCE hinst, DWORD reason, LPVOID reserved)
777 _impure_ptr = __imp_reent_data;
779 ' > libtool.c
780 archive_cmds='$CC -c '"`pwd`"'/libtool.c;echo EXPORTS > $soname-def;$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' >> $soname-def;$LD -s --base-file $soname-base --dll -e ___dll_entry@12 -o $lib libtool.o$libobjs$deplibs;$DLLTOOL --as=$AS --dllname $soname --def $soname-def --base-file $soname-base --output-exp $soname-exp;$LD -s --base-file $soname-base $soname-exp --dll -e ___dll_entry@12 -o $lib libtool.o$libobjs$deplibs;$DLLTOOL --as=$AS --dllname $soname --def $soname-def --base-file $soname-base --output-exp $soname-exp;$LD $soname-exp --dll -e ___dll_entry@12 -o $lib libtool.o$libobjs$deplibs;$rm libtool.o $soname-base $soname-exp'
781 old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $soname-def --output-lib $objdir/$libname.a;$rm $soname-def'
785 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
786 archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs'
787 else
788 ld_shlibs=no
791 esac
793 if test "$ld_shlibs" = yes; then
794 runpath_var=LD_RUN_PATH
795 hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
796 export_dynamic_flag_spec='${wl}--export-dynamic'
798 else
799 # PORTME fill in a description of your system's linker (not GNU ld)
800 case "$host_os" in
801 aix3*)
802 allow_undefined_flag=unsupported
803 archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE;$AR cru $lib $objdir/$soname'
804 # Note: this linker hardcodes the directories in LIBPATH if there
805 # are no directories specified by -L.
806 hardcode_minus_L=yes
807 if test "$with_gcc" = yes && test -z "$link_static_flag"; then
808 # Neither direct hardcoding nor static linking is supported with a
809 # broken collect2.
810 hardcode_direct=unsupported
814 aix4*)
815 allow_undefined_flag=unsupported
816 archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$CC -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry;$AR cru $lib $objdir/$soname'
817 hardcode_direct=yes
818 hardcode_minus_L=yes
821 amigaos*)
822 archive_cmds='$rm $objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data;$AR cru $lib$libobjs;$RANLIB $lib;(cd $objdir && a2ixlibrary -32)'
823 hardcode_libdir_flag_spec='-L$libdir'
824 hardcode_minus_L=yes
827 cygwin32*)
828 # hardcode_libdir_flag_spec is actually meaningless, as there is
829 # no search path for DLLs.
830 hardcode_libdir_flag_spec='-L$libdir'
831 allow_undefined_flag=unsupported
832 # Very, very bogus.
833 echo '
834 #include <windows.h>
836 struct _reent *_impure_ptr;
837 extern struct _reent *__imp_reent_data;
838 BOOL APIENTRY
839 __dll_entry (HINSTANCE hinst, DWORD reason, LPVOID reserved)
841 _impure_ptr = __imp_reent_data;
843 ' > libtool.c
844 archive_cmds='$CC -c '"`pwd`"'/libtool.c;echo EXPORTS > $soname-def;$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' >> $soname-def;$LD -s --base-file $soname-base --dll -e ___dll_entry@12 -o $lib libtool.o$libobjs$deplibs;$DLLTOOL --as=$AS --dllname $soname --def $soname-def --base-file $soname-base --output-exp $soname-exp;$LD -s --base-file $soname-base $soname-exp --dll -e ___dll_entry@12 -o $lib libtool.o$libobjs$deplibs;$DLLTOOL --as=$AS --dllname $soname --def $soname-def --base-file $soname-base --output-exp $soname-exp;$LD $soname-exp --dll -e ___dll_entry@12 -o $lib libtool.o$libobjs$deplibs;$rm libtool.o $soname-base $soname-exp'
845 old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $soname-def --output-lib $objdir/$libname.a;$rm $soname-def'
848 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
849 # support. Future versions do this automatically, but an explicit c++rt0.o
850 # does not break anything, and helps significantly (at the cost of a little
851 # extra space).
852 freebsd2.2*)
853 archive_cmds='$LD -Bshareable -o $lib$libobjs /usr/lib/c++rt0.o'
854 hardcode_libdir_flag_spec='-R$libdir'
855 hardcode_direct=yes
856 hardcode_minus_L=yes
857 hardcode_shlibpath_var=no
860 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
861 freebsd2*)
862 archive_cmds='$LD -Bshareable -o $lib$libobjs'
863 hardcode_direct=yes
864 hardcode_minus_L=yes
865 hardcode_shlibpath_var=no
868 # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
869 freebsd3*)
870 archive_cmds='$CC -shared -o $lib$libobjs'
871 hardcode_libdir_flag_spec='-R$libdir'
872 hardcode_direct=yes
873 hardcode_minus_L=yes
874 hardcode_shlibpath_var=no
877 hpux9*)
878 archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs;mv $objdir/$soname $lib'
879 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
880 hardcode_direct=yes
881 hardcode_minus_L=yes
882 export_dynamic_flag_spec='${wl}-E'
885 hpux10* | hpux11*)
886 archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs'
887 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
888 hardcode_direct=yes
889 hardcode_minus_L=yes
890 export_dynamic_flag_spec='${wl}-E'
893 irix5* | irix6*)
894 if test "$with_gcc" = yes; then
895 archive_cmds='$CC -shared -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring$libobjs'
896 else
897 archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs'
899 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
902 netbsd*)
903 # Tested with NetBSD 1.2 ld
904 archive_cmds='$LD -Bshareable -o $lib$libobjs'
905 hardcode_libdir_flag_spec='-R$libdir'
906 hardcode_direct=yes
907 hardcode_shlibpath_var=no
910 openbsd*)
911 archive_cmds='$LD -Bshareable -o $lib$libobjs'
912 hardcode_libdir_flag_spec='-R$libdir'
913 hardcode_direct=yes
914 hardcode_shlibpath_var=no
917 os2*)
918 hardcode_libdir_flag_spec='-L$libdir'
919 hardcode_minus_L=yes
920 allow_undefined_flag=unsupported
921 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'
922 old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
925 osf3* | osf4*)
926 allow_undefined_flag=' -expect_unresolved \*'
927 archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
928 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
929 hardcode_libdir_separator=:
932 sco3.2v5*)
933 archive_cmds='$LD -G -o $lib$libobjs'
934 hardcode_direct=yes
937 solaris2*)
938 no_undefined_flag=' -z text'
939 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs'
940 hardcode_libdir_flag_spec='-R$libdir'
941 hardcode_shlibpath_var=no
943 # Solaris 2 before 2.5 hardcodes -L paths.
944 case "$host_os" in
945 solaris2.[0-4]*)
946 hardcode_minus_L=yes
948 esac
951 sunos4*)
952 archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
953 hardcode_libdir_flag_spec='-L$libdir'
954 hardcode_direct=yes
955 hardcode_minus_L=yes
956 hardcode_shlibpath_var=no
959 uts4*)
960 archive_cmds='$LD -G -h $soname -o $lib$libobjs'
961 hardcode_libdir_flag_spec='-L$libdir'
962 hardcode_direct=no
963 hardcode_minus_L=no
964 hardcode_shlibpath_var=no
968 ld_shlibs=no
969 can_build_shared=no
971 esac
973 echo "$ac_t$ld_shlibs" 1>&6
975 if test -z "$NM"; then
976 echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
977 case "$NM" in
978 /* | [A-Za-z]:\\*) ;; # Let the user override the test with a path.
980 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
981 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
982 test -z "$ac_dir" && ac_dir=.
983 if test -f $ac_dir/nm; then
984 # Check to see if the nm accepts a BSD-compat flag.
985 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
986 # nm: unknown option "B" ignored
987 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
988 NM="$ac_dir/nm -B"
989 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
990 NM="$ac_dir/nm -p"
991 else
992 NM="$ac_dir/nm"
994 break
996 done
997 IFS="$ac_save_ifs"
998 test -z "$NM" && NM=nm
1000 esac
1001 echo "$ac_t$NM" 1>&6
1004 # Check for command to grab the raw symbol name followed by C symbol from nm.
1005 echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
1007 # These are sane defaults that work on at least a few old systems.
1008 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
1010 # Character class describing NM global symbol codes.
1011 symcode='[BCDEGRSTU]'
1013 # Regexp to match symbols that can be accessed directly from C.
1014 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
1016 # Transform the above into a raw symbol and a C symbol.
1017 symxfrm='\1 \1'
1019 # Define system-specific variables.
1020 case "$host_os" in
1021 aix*)
1022 symcode='[BCDTU]'
1024 cygwin32*)
1025 sympat='_\([_A-Za-z][_A-Za-z0-9]*\)'
1026 symxfrm='_\1 \1'
1028 irix*)
1029 # Cannot use undefined symbols on IRIX because inlined functions mess us up.
1030 symcode='[BCDEGRST]'
1032 solaris2*)
1033 symcode='[BDTU]'
1035 esac
1037 # If we're using GNU nm, then use its standard symbol codes.
1038 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1039 symcode='[ABCDGISTUW]'
1042 case "$host_os" in
1043 cygwin32*)
1044 # We do not want undefined symbols on cygwin32. The user must
1045 # arrange to define them via -l arguments.
1046 symcode='[ABCDGISTW]'
1048 esac
1050 # Write the raw and C identifiers.
1051 global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
1053 # Check to see that the pipe works correctly.
1054 pipe_works=no
1055 $rm conftest*
1056 cat > conftest.c <<EOF
1057 #ifdef __cplusplus
1058 extern "C" {
1059 #endif
1060 char nm_test_var;
1061 void nm_test_func(){}
1062 #ifdef __cplusplus
1064 #endif
1065 main(){nm_test_var='a';nm_test_func();return(0);}
1068 echo "$progname:1068: checking if global_symbol_pipe works" >&5
1069 if { (eval echo $progname:1069: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then
1070 # Now try to grab the symbols.
1071 nlist=conftest.nm
1072 if { echo "$progname:1072: eval \"$NM conftest.o | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.o | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
1074 # Try sorting and uniquifying the output.
1075 if sort "$nlist" | uniq > "$nlist"T; then
1076 mv -f "$nlist"T "$nlist"
1077 wcout=`wc "$nlist" 2>/dev/null`
1078 count=`$echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
1079 (test "$count" -ge 0) 2>/dev/null || count=-1
1080 else
1081 rm -f "$nlist"T
1082 count=-1
1085 # Make sure that we snagged all the symbols we need.
1086 if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1087 if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1088 cat <<EOF > conftest.c
1089 #ifdef __cplusplus
1090 extern "C" {
1091 #endif
1094 # Now generate the symbol file.
1095 sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
1097 cat <<EOF >> conftest.c
1098 #if defined (__STDC__) && __STDC__
1099 # define __ptr_t void *
1100 #else
1101 # define __ptr_t char *
1102 #endif
1104 /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
1105 int dld_preloaded_symbol_count = $count;
1107 /* The mapping between symbol names and symbols. */
1108 struct {
1109 char *name;
1110 __ptr_t address;
1112 dld_preloaded_symbols[] =
1115 sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c
1116 cat <<\EOF >> conftest.c
1117 {0, (__ptr_t) 0}
1120 #ifdef __cplusplus
1122 #endif
1124 # Now try linking the two files.
1125 mv conftest.o conftestm.o
1126 save_LIBS="$LIBS"
1127 save_CFLAGS="$CFLAGS"
1128 LIBS='conftestm.o'
1129 CFLAGS="$CFLAGS$no_builtin_flag"
1130 if { (eval echo $progname:1130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1131 pipe_works=yes
1132 else
1133 echo "$progname: failed program was:" >&5
1134 cat conftest.c >&5
1136 LIBS="$save_LIBS"
1137 else
1138 echo "cannot find nm_test_func in $nlist" >&5
1140 else
1141 echo "cannot find nm_test_var in $nlist" >&5
1143 else
1144 echo "cannot run $global_symbol_pipe" >&5
1146 else
1147 echo "$progname: failed program was:" >&5
1148 cat conftest.c >&5
1150 $rm conftest*
1152 # Do not use the global_symbol_pipe unless it works.
1153 echo "$ac_t$pipe_works" 1>&6
1154 test "$pipe_works" = yes || global_symbol_pipe=
1156 # Check hardcoding attributes.
1157 echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
1158 hardcode_action=
1159 if test -n "$hardcode_libdir_flag_spec" || \
1160 test -n "$runpath_var"; then
1162 # We can hardcode non-existant directories.
1163 if test "$hardcode_direct" != no && \
1164 test "$hardcode_minus_L" != no && \
1165 test "$hardcode_shlibpath_var" != no; then
1167 # Linking always hardcodes the temporary library directory.
1168 hardcode_action=relink
1169 else
1170 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1171 hardcode_action=immediate
1173 else
1174 # We cannot hardcode anything, or else we can only hardcode existing
1175 # directories.
1176 hardcode_action=unsupported
1178 echo "$ac_t$hardcode_action" 1>&6
1181 reload_flag=
1182 reload_cmds='$LD$reload_flag -o $output$reload_objs'
1183 echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
1184 # PORTME Some linkers may need a different reload flag.
1185 reload_flag='-r'
1186 echo "$ac_t$reload_flag" 1>&6
1187 test -n "$reload_flag" && reload_flag=" $reload_flag"
1189 # PORTME Fill in your ld.so characteristics
1190 library_names_spec=
1191 libname_spec='lib$name'
1192 soname_spec=
1193 postinstall_cmds=
1194 postuninstall_cmds=
1195 finish_cmds=
1196 finish_eval=
1197 shlibpath_var=
1198 version_type=none
1199 dynamic_linker="$host_os ld.so"
1201 echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
1202 case "$host_os" in
1203 aix3* | aix4*)
1204 version_type=linux
1205 library_names_spec='${libname}${release}.so$versuffix $libname.a'
1206 shlibpath_var=LIBPATH
1208 # AIX has no versioning support, so we append a major version to the name.
1209 soname_spec='${libname}${release}.so$major'
1212 amigaos*)
1213 library_names_spec='$libname.ixlibrary $libname.a'
1214 # Create ${libname}_ixlibrary.a entries in /sys/libs.
1215 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
1218 cygwin32*)
1219 version_type=windows
1220 library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
1221 dynamic_linker='Win32 ld.exe'
1222 shlibpath_var=PATH
1225 freebsd2* | freebsd3*)
1226 version_type=sunos
1227 library_names_spec='${libname}${release}.so$versuffix $libname.so'
1228 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1229 shlibpath_var=LD_LIBRARY_PATH
1232 gnu*)
1233 version_type=sunos
1234 library_names_spec='${libname}${release}.so$versuffix'
1235 shlibpath_var=LD_LIBRARY_PATH
1238 hpux9* | hpux10* | hpux11*)
1239 # Give a soname corresponding to the major version so that dld.sl refuses to
1240 # link against other versions.
1241 dynamic_linker="$host_os dld.sl"
1242 version_type=sunos
1243 shlibpath_var=SHLIB_PATH
1244 library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
1245 soname_spec='${libname}${release}.sl$major'
1246 # HP-UX runs *really* slowly unless shared libraries are mode 555.
1247 postinstall_cmds='chmod 555 $lib'
1250 irix5* | irix6*)
1251 version_type=osf
1252 soname_spec='${libname}${release}.so'
1253 library_names_spec='${libname}${release}.so$versuffix $libname.so'
1254 shlibpath_var=LD_LIBRARY_PATH
1257 # No shared lib support for Linux oldld, aout, or coff.
1258 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
1259 dynamic_linker=no
1262 # This must be Linux ELF.
1263 linux-gnu*)
1264 version_type=linux
1265 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1266 soname_spec='${libname}${release}.so$major'
1267 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1268 shlibpath_var=LD_LIBRARY_PATH
1270 if test -f /lib/ld.so.1; then
1271 dynamic_linker='GNU ld.so'
1272 else
1273 # Only the GNU ld.so supports shared libraries on MkLinux.
1274 case "$host_cpu" in
1275 powerpc*) dynamic_linker=no ;;
1276 *) dynamic_linker='Linux ld.so' ;;
1277 esac
1281 netbsd* | openbsd*)
1282 version_type=sunos
1283 library_names_spec='${libname}${release}.so$versuffix'
1284 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1285 shlibpath_var=LD_LIBRARY_PATH
1288 os2*)
1289 libname_spec='$name'
1290 library_names_spec='$libname.dll $libname.a'
1291 dynamic_linker='OS/2 ld.exe'
1292 shlibpath_var=LIBPATH
1295 osf3* | osf4*)
1296 version_type=osf
1297 soname_spec='${libname}${release}.so'
1298 library_names_spec='${libname}${release}.so$versuffix $libname.so'
1299 shlibpath_var=LD_LIBRARY_PATH
1302 sco3.2v5*)
1303 version_type=osf
1304 soname_spec='${libname}${release}.so$major'
1305 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1306 shlibpath_var=LD_LIBRARY_PATH
1309 solaris2*)
1310 version_type=linux
1311 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1312 soname_spec='${libname}${release}.so$major'
1313 shlibpath_var=LD_LIBRARY_PATH
1316 sunos4*)
1317 version_type=sunos
1318 library_names_spec='${libname}${release}.so$versuffix'
1319 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1320 shlibpath_var=LD_LIBRARY_PATH
1323 sysv4.2uw2*)
1324 version_type=linux
1325 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1326 soname_spec='${libname}${release}.so$major'
1327 shlibpath_var=LD_LIBRARY_PATH
1330 uts4*)
1331 version_type=linux
1332 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1333 soname_spec='${libname}${release}.so$major'
1334 shlibpath_var=LD_LIBRARY_PATH
1338 dynamic_linker=no
1340 esac
1341 echo "$ac_t$dynamic_linker"
1342 test "$dynamic_linker" = no && can_build_shared=no
1344 # Report the final consequences.
1345 echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1347 echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
1348 test "$can_build_shared" = "no" && enable_shared=no
1350 # On AIX, shared libraries and static libraries use the same namespace, and
1351 # are all built from PIC.
1352 case "$host_os" in
1353 aix*)
1354 test "$enable_shared" = yes && enable_static=no
1355 if test -n "$RANLIB"; then
1356 archive_cmds="$archive_cmds;\$RANLIB \$lib"
1357 postinstall_cmds='$RANLIB $lib'
1360 esac
1362 echo "$ac_t$enable_shared" 1>&6
1364 # Make sure either enable_shared or enable_static is yes.
1365 test "$enable_shared" = yes || enable_static=yes
1367 echo "checking whether to build static libraries... $enable_static" 1>&6
1369 echo $ac_n "checking for objdir... $ac_c" 1>&6
1370 rm -f .libs 2>/dev/null
1371 mkdir .libs 2>/dev/null
1372 if test -d .libs; then
1373 objdir=.libs
1374 else
1375 # MS-DOS does not allow filenames that begin with a dot.
1376 objdir=_libs
1378 rmdir .libs 2>/dev/null
1379 echo "$ac_t$objdir" 1>&6
1381 # Copy echo and quote the copy, instead of the original, because it is
1382 # used later.
1383 ltecho="$echo"
1385 # Now quote all the things that may contain metacharacters.
1386 for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
1387 old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM DLLTOOL AS reload_flag \
1388 reload_cmds wl pic_flag link_static_flag no_builtin_flag \
1389 export_dynamic_flag_spec libname_spec library_names_spec soname_spec RANLIB \
1390 old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
1391 old_postuninstall_cmds archive_cmds postinstall_cmds postuninstall_cmds \
1392 allow_undefined_flag no_undefined_flag \
1393 finish_cmds finish_eval global_symbol_pipe \
1394 hardcode_libdir_flag_spec hardcode_libdir_separator; do
1396 case "$var" in
1397 reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
1398 old_postinstall_cmds | old_postuninstall_cmds | archive_cmds | \
1399 postinstall_cmds | postuninstall_cmds | finish_cmds)
1400 # Double-quote double-evaled strings.
1401 eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`"
1404 eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`"
1406 esac
1407 done
1409 trap "$rm \"$ofile\"; exit 1" 1 2 15
1410 echo "creating $ofile"
1411 $rm "$ofile"
1412 cat <<EOF > "$ofile"
1413 #! $SHELL
1415 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1416 # Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
1417 # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
1419 # Copyright (C) 1996-1998 Free Software Foundation, Inc.
1420 # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
1422 # This program is free software; you can redistribute it and/or modify
1423 # it under the terms of the GNU General Public License as published by
1424 # the Free Software Foundation; either version 2 of the License, or
1425 # (at your option) any later version.
1427 # This program is distributed in the hope that it will be useful, but
1428 # WITHOUT ANY WARRANTY; without even the implied warranty of
1429 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1430 # General Public License for more details.
1432 # You should have received a copy of the GNU General Public License
1433 # along with this program; if not, write to the Free Software
1434 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1436 # As a special exception to the GNU General Public License, if you
1437 # distribute this file as part of a program that contains a
1438 # configuration script generated by Autoconf, you may include it under
1439 # the same distribution terms that you use for the rest of that program.
1441 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
1442 Xsed="sed -e s/^X//"
1444 # The HP-UX ksh and POSIX shell print the target directory to stdout
1445 # if CDPATH is set.
1446 if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
1448 ### BEGIN LIBTOOL CONFIG
1449 # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1451 # CC="$old_CC" CFLAGS="$old_CFLAGS" CPPFLAGS="$old_CPPFLAGS" \\
1452 # LD="$old_LD" NM="$old_NM" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\
1453 # DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\
1454 # $0$ltconfig_args
1456 # Compiler and other test output produced by $progname, useful for
1457 # debugging $progname, is in ./config.log if it exists.
1459 # The version of $progname that generated this script.
1460 LTCONFIG_VERSION="$VERSION"
1462 # Shell to use when invoking shell scripts.
1463 SHELL="$SHELL"
1465 # Whether or not to build shared libraries.
1466 build_libtool_libs=$enable_shared
1468 # Whether or not to build static libraries.
1469 build_old_libs=$enable_static
1471 # The host system.
1472 host_alias="$host_alias"
1473 host="$host"
1475 # An echo program that does not interpret backslashes.
1476 echo="$ltecho"
1478 # The archiver.
1479 AR="$AR"
1481 # The default C compiler.
1482 CC="$CC"
1484 # The linker used to build libraries.
1485 LD="$LD"
1487 # Whether we need hard or soft links.
1488 LN_S="$LN_S"
1490 # A BSD-compatible nm program.
1491 NM="$NM"
1493 # Used on cygwin32: DLL creation program.
1494 DLLTOOL="$DLLTOOL"
1496 # Used on cygwin32: assembler.
1497 AS="$AS"
1499 # The name of the directory that contains temporary libtool files.
1500 objdir="$objdir"
1502 # How to create reloadable object files.
1503 reload_flag="$reload_flag"
1504 reload_cmds="$reload_cmds"
1506 # How to pass a linker flag through the compiler.
1507 wl="$wl"
1509 # Additional compiler flags for building library objects.
1510 pic_flag="$pic_flag"
1512 # Compiler flag to prevent dynamic linking.
1513 link_static_flag="$link_static_flag"
1515 # Compiler flag to turn off builtin functions.
1516 no_builtin_flag="$no_builtin_flag"
1518 # Compiler flag to allow reflexive dlopens.
1519 export_dynamic_flag_spec="$export_dynamic_flag_spec"
1521 # Library versioning type.
1522 version_type=$version_type
1524 # Format of library name prefix.
1525 libname_spec="$libname_spec"
1527 # List of archive names. First name is the real one, the rest are links.
1528 # The last name is the one that the linker finds with -lNAME.
1529 library_names_spec="$library_names_spec"
1531 # The coded name of the library, if different from the real name.
1532 soname_spec="$soname_spec"
1534 # Commands used to build and install an old-style archive.
1535 RANLIB="$RANLIB"
1536 old_archive_cmds="$old_archive_cmds"
1537 old_postinstall_cmds="$old_postinstall_cmds"
1538 old_postuninstall_cmds="$old_postuninstall_cmds"
1540 # Create an old-style archive from a shared archive.
1541 old_archive_from_new_cmds="$old_archive_from_new_cmds"
1543 # Commands used to build and install a shared archive.
1544 archive_cmds="$archive_cmds"
1545 postinstall_cmds="$postinstall_cmds"
1546 postuninstall_cmds="$postuninstall_cmds"
1548 # Flag that allows shared libraries with undefined symbols to be built.
1549 allow_undefined_flag="$allow_undefined_flag"
1551 # Flag that forces no undefined symbols.
1552 no_undefined_flag="$no_undefined_flag"
1554 # Commands used to finish a libtool library installation in a directory.
1555 finish_cmds="$finish_cmds"
1557 # Same as above, but a single script fragment to be evaled but not shown.
1558 finish_eval="$finish_eval"
1560 # Take the output of nm and produce a listing of raw symbols and C names.
1561 global_symbol_pipe="$global_symbol_pipe"
1563 # This is the shared library runtime path variable.
1564 runpath_var=$runpath_var
1566 # This is the shared library path variable.
1567 shlibpath_var=$shlibpath_var
1569 # How to hardcode a shared library path into an executable.
1570 hardcode_action=$hardcode_action
1572 # Flag to hardcode \$libdir into a binary during linking.
1573 # This must work even if \$libdir does not exist.
1574 hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec"
1576 # Whether we need a single -rpath flag with a separated argument.
1577 hardcode_libdir_separator="$hardcode_libdir_separator"
1579 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
1580 # resulting binary.
1581 hardcode_direct=$hardcode_direct
1583 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
1584 # resulting binary.
1585 hardcode_minus_L=$hardcode_minus_L
1587 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
1588 # the resulting binary.
1589 hardcode_shlibpath_var=$hardcode_shlibpath_var
1592 case "$host_os" in
1593 aix3*)
1594 cat <<\EOF >> "$ofile"
1596 # AIX sometimes has problems with the GCC collect2 program. For some
1597 # reason, if we set the COLLECT_NAMES environment variable, the problems
1598 # vanish in a puff of smoke.
1599 if test "${COLLECT_NAMES+set}" != set; then
1600 COLLECT_NAMES=
1601 export COLLECT_NAMES
1605 esac
1607 echo '### END LIBTOOL CONFIG' >> "$ofile"
1608 echo >> "$ofile"
1610 # Append the ltmain.sh script.
1611 cat "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
1613 chmod +x "$ofile"
1614 exit 0
1616 # Local Variables:
1617 # mode:shell-script
1618 # sh-indentation:2
1619 # End: