]> gcc.gnu.org Git - gcc.git/blame - ltconfig
This commit was generated by cvs2svn to compensate for changes in r19789,
[gcc.git] / ltconfig
CommitLineData
6599da04
JM
1#! /bin/sh
2
3# ltconfig - Create a system-specific libtool.
cf4ccd63 4# Copyright (C) 1996-1998 Free Software Foundation, Inc.
6599da04
JM
5# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
6#
7# This file is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful, but
13# WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15# General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20#
21# As a special exception to the GNU General Public License, if you
22# distribute this file as part of a program that contains a
23# configuration script generated by Autoconf, you may include it under
24# the same distribution terms that you use for the rest of that program.
25
26# A lot of this script is taken from autoconf-2.10.
27
cf4ccd63
JL
28# Check that we are running under the correct shell.
29SHELL=${CONFIG_SHELL-/bin/sh}
30if test "X$1" = "X--no-reexec"; then
31 # Discard the --no-reexec flag, and continue.
32 shift
33elif test "X$SHELL" != X/bin/sh; then
34 # Restart under the correct shell.
35 exec "$SHELL" "$0" --no-reexec ${1+"$@"}
36fi
37
38# The HP-UX ksh and POSIX shell print the target directory to stdout
39# if CDPATH is set.
40if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
41
42echo=echo
43if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
44else
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'
48 #
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
55 fi
56 done
57 IFS="$save_ifs"
58
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
76 fi
77 fi
78 fi
79fi
80
81# Sed substitution that helps us do robust quoting. It backslashifies
82# metacharacters that are still active within double-quoted strings.
83Xsed='sed -e s/^X//'
84sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
85
86# Same as above, but do not quote variable references.
87double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
88
6599da04 89# The name of this program.
cf4ccd63 90progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
6599da04
JM
91
92# Constants:
93PROGRAM=ltconfig
94PACKAGE=libtool
cf4ccd63 95VERSION=1.2a
6599da04 96ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
cf4ccd63 97ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
6599da04
JM
98rm="rm -f"
99
100help="Try \`$progname --help' for more information."
101
102# Global variables:
cf4ccd63 103default_ofile=libtool
6599da04
JM
104can_build_shared=yes
105enable_shared=yes
106# All known linkers require a `.a' archive for static linking.
107enable_static=yes
108ltmain=
109silent=
110srcdir=
111ac_config_guess=
112ac_config_sub=
113host=
114nonopt=
cf4ccd63 115ofile="$default_ofile"
6599da04
JM
116verify_host=yes
117with_gcc=no
118with_gnu_ld=no
119
120old_AR="$AR"
121old_CC="$CC"
122old_CFLAGS="$CFLAGS"
123old_CPPFLAGS="$CPPFLAGS"
124old_LD="$LD"
125old_LN_S="$LN_S"
cf4ccd63 126old_NM="$NM"
6599da04 127old_RANLIB="$RANLIB"
cf4ccd63
JL
128old_DLLTOOL="$DLLTOOL"
129old_AS="$AS"
6599da04
JM
130
131# Parse the command line options.
132args=
133prev=
134for option
135do
136 case "$option" in
137 -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
138 *) optarg= ;;
139 esac
140
141 # If the previous option needs an argument, assign it.
142 if test -n "$prev"; then
143 eval "$prev=\$option"
144 prev=
145 continue
146 fi
147
148 case "$option" in
149 --help) cat <<EOM
150Usage: $progname [OPTION]... LTMAIN [HOST]
151
152Generate a system-specific libtool script.
153
cf4ccd63 154 --debug enable verbose shell tracing
6599da04
JM
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
cf4ccd63 159-o, --output=FILE specify the output file [default=$default_ofile]
6599da04 160 --quiet same as \`--silent'
cf4ccd63 161 --silent do not print informational messages
6599da04
JM
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
166
167LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
168functionality.
169
170HOST is the canonical host system name [default=guessed].
171EOM
172 exit 0
173 ;;
174
cf4ccd63
JL
175 --debug)
176 echo "$progname: enabling shell trace mode"
177 set -x
178 ;;
179
6599da04
JM
180 --disable-shared) enable_shared=no ;;
181
182 --disable-static) enable_static=no ;;
183
184 --quiet | --silent) silent=yes ;;
185
186 --srcdir) prev=srcdir ;;
187 --srcdir=*) srcdir="$optarg" ;;
188
189 --no-verify) verify_host=no ;;
190
cf4ccd63
JL
191 --output | -o) prev=ofile ;;
192 --output=*) ofile="$optarg" ;;
193
6599da04
JM
194 --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
195
196 --with-gcc) with_gcc=yes ;;
197 --with-gnu-ld) with_gnu_ld=yes ;;
198
199 -*)
200 echo "$progname: unrecognized option \`$option'" 1>&2
201 echo "$help" 1>&2
202 exit 1
203 ;;
204
205 *)
206 if test -z "$ltmain"; then
207 ltmain="$option"
208 elif test -z "$host"; then
cf4ccd63 209# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
6599da04
JM
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
220done
221
222if test -z "$ltmain"; then
223 echo "$progname: you must specify a LTMAIN file" 1>&2
224 echo "$help" 1>&2
225 exit 1
226fi
227
228if test -f "$ltmain"; then :
229else
cf4ccd63
JL
230 echo "$progname: \`$ltmain' does not exist" 1>&2
231 echo "$help" 1>&2
232 exit 1
6599da04
JM
233fi
234
235# Quote any args containing shell metacharacters.
236ltconfig_args=
237for arg
238do
239 case "$arg" in
240 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
241 ltconfig_args="$ltconfig_args '$arg'" ;;
242 *) ltconfig_args="$ltconfig_args $arg" ;;
243 esac
244done
245
246# A relevant subset of AC_INIT.
247
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
256if test "$silent" = yes; then
257 exec 6>/dev/null
258else
259 exec 6>&1
260fi
261exec 5>>./config.log
262
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).
267if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
268if test "${LANG+set}" = set; then LANG=C; export LANG; fi
269
270if (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=
277 fi
278else
279 ac_n= ac_c='\c' ac_t=
280fi
281
282if test -z "$srcdir"; then
283 # Assume the source directory is the same one as the path to ltmain.sh.
cf4ccd63 284 srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
6599da04
JM
285 test "$srcdir" = "$ltmain" && srcdir=.
286fi
287
cf4ccd63 288trap "$rm conftest*; exit 1" 1 2 15
6599da04
JM
289if 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
296 fi
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
302 fi
303 ac_config_guess=$ac_aux_dir/config.guess
304 ac_config_sub=$ac_aux_dir/config.sub
305
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
312 fi
313
314 echo $ac_n "checking host system type""... $ac_c" 1>&6
315
316 host_alias=$host
317 case "$host_alias" in
318 "")
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`
cf4ccd63
JL
327 echo "$ac_t$host" 1>&6
328
329 # Make sure the host verified.
330 test -z "$host" && exit 1
6599da04
JM
331
332elif 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
336else
337 host_alias=$host
338fi
339
cf4ccd63
JL
340# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
341case "$host_os" in
342linux-gnu*) ;;
343linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
6599da04
JM
344esac
345
346host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
347host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
348host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
349
cf4ccd63
JL
350case "$host_os" in
351aix3*)
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
358 fi
359 ;;
360esac
361
6599da04
JM
362# Determine commands to create old-style static archives.
363old_archive_cmds='$AR cru $oldlib$oldobjs'
364old_postinstall_cmds='chmod 644 $oldlib'
cf4ccd63
JL
365old_postuninstall_cmds=
366
367# Set a sane default for `AR'.
368test -z "$AR" && AR=ar
6599da04
JM
369
370# If RANLIB is not set, then run the test.
371if test "${RANLIB+set}" != "set"; then
372 result=no
373
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
382 fi
383 done
384 IFS="$save_ifs"
385
cf4ccd63 386 echo "$ac_t$result" 1>&6
6599da04
JM
387fi
388
389if test -n "$RANLIB"; then
390 old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
cf4ccd63 391 old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds"
6599da04
JM
392fi
393
cf4ccd63
JL
394# Set sane defaults for `DLLTOOL' and `AS', used on cygwin32.
395test -z "$DLLTOOL" && DLLTOOL=dlltool
396test -z "$AS" && AS=as
397
6599da04
JM
398# Check to see if we are using GCC.
399if 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
410 fi
411 done
412 IFS="$save_ifs"
413
414 if test -n "$CC"; then
cf4ccd63 415 echo "$ac_t$CC" 1>&6
6599da04 416 else
cf4ccd63 417 echo "$ac_t"no 1>&6
6599da04
JM
418 fi
419 fi
420
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
432 fi
433 CC="cc"
434 break
435 fi
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="$@"
450 fi
451 fi
452
453 if test -n "$CC"; then
cf4ccd63 454 echo "$ac_t$CC" 1>&6
6599da04 455 else
cf4ccd63 456 echo "$ac_t"no 1>&6
6599da04
JM
457 fi
458
459 if test -z "$CC"; then
460 echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
461 exit 1
462 fi
463 fi
464
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
cf4ccd63 468 echo "$progname:468: checking whether we are using GNU C" >&5
6599da04 469
6599da04
JM
470 $rm conftest.c
471 cat > conftest.c <<EOF
472#ifdef __GNUC__
473 yes;
474#endif
475EOF
cf4ccd63 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
6599da04
JM
477 with_gcc=yes
478 fi
479 $rm conftest.c
cf4ccd63 480 echo "$ac_t$with_gcc" 1>&6
6599da04
JM
481fi
482
483# Allow CC to be a program name with arguments.
484set dummy $CC
485compiler="$2"
486
487echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
488pic_flag=
6599da04
JM
489special_shlib_compile_flags=
490wl=
491link_static_flag=
cf4ccd63 492no_builtin_flag=
6599da04
JM
493
494if test "$with_gcc" = yes; then
6599da04
JM
495 wl='-Wl,'
496 link_static_flag='-static'
cf4ccd63
JL
497 no_builtin_flag=' -fno-builtin'
498
499 case "$host_os" in
500 aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
501 # PIC is the default for these OSes.
502 ;;
503 cygwin32* | os2*)
504 # We can build DLLs from non-PIC.
505 ;;
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'
511 ;;
512 *)
513 pic_flag='-fPIC'
514 ;;
515 esac
6599da04
JM
516else
517 # PORTME Check for PIC flags for the system compiler.
518 case "$host_os" in
519 aix3* | aix4*)
cf4ccd63 520 # All AIX code is PIC.
6599da04
JM
521 link_static_flag='-bnso -bI:/lib/syscalls.exp'
522 ;;
523
cf4ccd63
JL
524 hpux9* | hpux10* | hpux11*)
525 # Is there a better link_static_flag that works with the bundled CC?
6599da04 526 wl='-Wl,'
cf4ccd63 527 link_static_flag="${wl}-a ${wl}archive"
6599da04
JM
528 pic_flag='+Z'
529 ;;
530
531 irix5* | irix6*)
532 wl='-Wl,'
533 link_static_flag='-non_shared'
534 # PIC (with -KPIC) is the default.
cf4ccd63
JL
535 ;;
536
537 cygwin32* | os2*)
538 # We can build DLLs from non-PIC.
6599da04
JM
539 ;;
540
541 osf3* | osf4*)
cf4ccd63 542 # All OSF/1 code is PIC.
6599da04
JM
543 wl='-Wl,'
544 link_static_flag='-non_shared'
545 ;;
546
547 sco3.2v5*)
548 pic_flag='-Kpic'
549 link_static_flag='-dn'
550 special_shlib_compile_flags='-belf'
551 ;;
552
553 solaris2*)
554 pic_flag='-KPIC'
555 link_static_flag='-Bstatic'
556 wl='-Wl,'
557 ;;
558
559 sunos4*)
560 pic_flag='-PIC'
561 link_static_flag='-Bstatic'
562 wl='-Qoption ld '
563 ;;
564
cf4ccd63
JL
565 sysv4.2uw2*)
566 pic_flag='-KPIC'
567 link_static_flag='-Bstatic'
568 wl='-Wl,'
569 ;;
570
571 uts4*)
572 pic_flag='-pic'
573 link_static_flag='-Bstatic'
574 ;;
575
6599da04
JM
576 *)
577 can_build_shared=no
578 ;;
579 esac
580fi
581
6599da04 582if test -n "$pic_flag"; then
cf4ccd63
JL
583 echo "$ac_t$pic_flag" 1>&6
584
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
595
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"
606 fi
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
613 fi
614 CFLAGS="$save_CFLAGS"
615 $rm conftest*
6599da04 616else
cf4ccd63 617 echo "$ac_t"none 1>&6
6599da04
JM
618fi
619
620# Check for any special shared library compilation flags.
621if 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
627 fi
628fi
629
cf4ccd63
JL
630echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
631$rm conftest*
632echo 'main(){return(0);}' > conftest.c
633save_LDFLAGS="$LDFLAGS"
634LDFLAGS="$LDFLAGS $link_static_flag"
635echo "$progname:635: checking if $compiler static flag $link_static_flag works" >&5
636if { (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
6599da04 638else
cf4ccd63
JL
639 echo "$ac_t"none 1>&6
640 link_static_flag=
6599da04 641fi
cf4ccd63
JL
642LDFLAGS="$save_LDFLAGS"
643$rm conftest*
6599da04
JM
644
645if 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
cf4ccd63 648 $rm conftestdata
6599da04 649 if ln -s X conftestdata 2>/dev/null; then
cf4ccd63 650 $rm conftestdata
6599da04
JM
651 LN_S="ln -s"
652 else
653 LN_S=ln
654 fi
655 if test "$LN_S" = "ln -s"; then
656 echo "$ac_t"yes 1>&6
657 else
658 echo "$ac_t"no 1>&6
659 fi
660fi
661
cf4ccd63
JL
662# Make sure LD is an absolute path.
663if 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"
674 ;;
675 "")
676 # If it fails, then pretend we are not using GCC.
677 ac_prog=ld
678 ;;
679 *)
680 # If it is relative, then search for the first ld in PATH.
681 with_gnu_ld=unknown
682 ;;
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
690 fi
6599da04 691
cf4ccd63 692 if test -z "$LD"; then
6599da04
JM
693 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
694 for ac_dir in $PATH; do
695 test -z "$ac_dir" && ac_dir=.
cf4ccd63
JL
696 if test -f "$ac_dir/$ac_prog"; then
697 LD="$ac_dir/$ac_prog"
6599da04
JM
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.
cf4ccd63
JL
701 if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
702 test "$with_gnu_ld" != no && break
6599da04
JM
703 else
704 test "$with_gnu_ld" != yes && break
705 fi
706 fi
707 done
708 IFS="$ac_save_ifs"
cf4ccd63 709 fi
6599da04 710
cf4ccd63
JL
711 if test -n "$LD"; then
712 echo "$ac_t$LD" 1>&6
713 else
714 echo "$ac_t"no 1>&6
6599da04
JM
715 fi
716
cf4ccd63
JL
717 if test -z "$LD"; then
718 echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
719 exit 1
6599da04 720 fi
6599da04
JM
721fi
722
cf4ccd63
JL
723# Check to see if it really is or is not GNU ld.
724echo $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.
726if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
727 with_gnu_ld=yes
728else
729 with_gnu_ld=no
730fi
731echo "$ac_t$with_gnu_ld" 1>&6
732
6599da04
JM
733# See if the linker supports building shared libraries.
734echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
735
736allow_undefined_flag=
cf4ccd63 737no_undefined_flag=
6599da04 738archive_cmds=
cf4ccd63
JL
739old_archive_from_new_cmds=
740export_dynamic_flag_spec=
6599da04
JM
741hardcode_libdir_flag_spec=
742hardcode_libdir_separator=
743hardcode_direct=no
744hardcode_minus_L=no
6599da04
JM
745hardcode_shlibpath_var=unsupported
746runpath_var=
747
748ld_shlibs=yes
749if test "$with_gnu_ld" = yes; then
6599da04 750
cf4ccd63 751 # See if GNU ld supports shared libraries.
6599da04 752 case "$host_os" in
cf4ccd63
JL
753 amigaos*)
754 archive_cmds='$rm $objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data;$AR cru $lib$libobjs;$RANLIB $lib;(cd $objdir && a2ixlibrary -32)'
755 hardcode_libdir_flag_spec='-L$libdir'
756 hardcode_minus_L=yes
757 ;;
758
6599da04 759 sunos4*)
cf4ccd63
JL
760 archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
761 ;;
762
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>
771
772struct _reent *_impure_ptr;
773extern struct _reent *__imp_reent_data;
774BOOL APIENTRY
775__dll_entry (HINSTANCE hinst, DWORD reason, LPVOID reserved)
776{
777 _impure_ptr = __imp_reent_data;
778}
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'
6599da04
JM
782 ;;
783
784 *)
785 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
cf4ccd63 786 archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs'
6599da04
JM
787 else
788 ld_shlibs=no
789 fi
790 ;;
791 esac
792
793 if test "$ld_shlibs" = yes; then
cf4ccd63
JL
794 runpath_var=LD_RUN_PATH
795 hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
796 export_dynamic_flag_spec='${wl}--export-dynamic'
6599da04
JM
797 fi
798else
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
cf4ccd63 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'
6599da04
JM
804 # Note: this linker hardcodes the directories in LIBPATH if there
805 # are no directories specified by -L.
806 hardcode_minus_L=yes
cf4ccd63
JL
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
811 fi
6599da04
JM
812 ;;
813
814 aix4*)
815 allow_undefined_flag=unsupported
cf4ccd63 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'
6599da04
JM
817 hardcode_direct=yes
818 hardcode_minus_L=yes
819 ;;
820
cf4ccd63
JL
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
825 ;;
826
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>
835
836struct _reent *_impure_ptr;
837extern struct _reent *__imp_reent_data;
838BOOL APIENTRY
839__dll_entry (HINSTANCE hinst, DWORD reason, LPVOID reserved)
840{
841 _impure_ptr = __imp_reent_data;
842}
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'
846 ;;
847
6599da04
JM
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
cf4ccd63 850 # does not break anything, and helps significantly (at the cost of a little
6599da04
JM
851 # extra space).
852 freebsd2.2*)
cf4ccd63
JL
853 archive_cmds='$LD -Bshareable -o $lib$libobjs /usr/lib/c++rt0.o'
854 hardcode_libdir_flag_spec='-R$libdir'
6599da04
JM
855 hardcode_direct=yes
856 hardcode_minus_L=yes
857 hardcode_shlibpath_var=no
858 ;;
859
cf4ccd63 860 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6599da04 861 freebsd2*)
cf4ccd63 862 archive_cmds='$LD -Bshareable -o $lib$libobjs'
6599da04
JM
863 hardcode_direct=yes
864 hardcode_minus_L=yes
865 hardcode_shlibpath_var=no
866 ;;
867
868 # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
869 freebsd3*)
cf4ccd63
JL
870 archive_cmds='$CC -shared -o $lib$libobjs'
871 hardcode_libdir_flag_spec='-R$libdir'
6599da04 872 hardcode_direct=yes
cf4ccd63 873 hardcode_minus_L=yes
6599da04
JM
874 hardcode_shlibpath_var=no
875 ;;
876
877 hpux9*)
cf4ccd63 878 archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs;mv $objdir/$soname $lib'
6599da04
JM
879 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
880 hardcode_direct=yes
881 hardcode_minus_L=yes
cf4ccd63 882 export_dynamic_flag_spec='${wl}-E'
6599da04
JM
883 ;;
884
cf4ccd63
JL
885 hpux10* | hpux11*)
886 archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs'
6599da04
JM
887 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
888 hardcode_direct=yes
889 hardcode_minus_L=yes
cf4ccd63 890 export_dynamic_flag_spec='${wl}-E'
6599da04
JM
891 ;;
892
893 irix5* | irix6*)
cf4ccd63
JL
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'
898 fi
6599da04
JM
899 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
900 ;;
901
cf4ccd63 902 netbsd*)
6599da04 903 # Tested with NetBSD 1.2 ld
cf4ccd63 904 archive_cmds='$LD -Bshareable -o $lib$libobjs'
6599da04
JM
905 hardcode_libdir_flag_spec='-R$libdir'
906 hardcode_direct=yes
907 hardcode_shlibpath_var=no
908 ;;
909
cf4ccd63
JL
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
915 ;;
916
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'
923 ;;
924
6599da04 925 osf3* | osf4*)
cf4ccd63
JL
926 allow_undefined_flag=' -expect_unresolved \*'
927 archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
6599da04
JM
928 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
929 hardcode_libdir_separator=:
930 ;;
931
932 sco3.2v5*)
cf4ccd63 933 archive_cmds='$LD -G -o $lib$libobjs'
6599da04
JM
934 hardcode_direct=yes
935 ;;
936
937 solaris2*)
cf4ccd63
JL
938 no_undefined_flag=' -z text'
939 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs'
6599da04
JM
940 hardcode_libdir_flag_spec='-R$libdir'
941 hardcode_shlibpath_var=no
cf4ccd63
JL
942
943 # Solaris 2 before 2.5 hardcodes -L paths.
944 case "$host_os" in
945 solaris2.[0-4]*)
946 hardcode_minus_L=yes
947 ;;
948 esac
6599da04
JM
949 ;;
950
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
957 ;;
958
cf4ccd63
JL
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
965 ;;
966
6599da04
JM
967 *)
968 ld_shlibs=no
969 can_build_shared=no
970 ;;
971 esac
972fi
cf4ccd63
JL
973echo "$ac_t$ld_shlibs" 1>&6
974
975if 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.
979 *)
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"
993 fi
994 break
995 fi
996 done
997 IFS="$ac_save_ifs"
998 test -z "$NM" && NM=nm
999 ;;
1000 esac
1001 echo "$ac_t$NM" 1>&6
1002fi
1003
1004# Check for command to grab the raw symbol name followed by C symbol from nm.
1005echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
1006
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?!! ;)]
1009
1010# Character class describing NM global symbol codes.
1011symcode='[BCDEGRSTU]'
1012
1013# Regexp to match symbols that can be accessed directly from C.
1014sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
1015
1016# Transform the above into a raw symbol and a C symbol.
1017symxfrm='\1 \1'
1018
1019# Define system-specific variables.
1020case "$host_os" in
1021aix*)
1022 symcode='[BCDTU]'
1023 ;;
1024cygwin32*)
1025 sympat='_\([_A-Za-z][_A-Za-z0-9]*\)'
1026 symxfrm='_\1 \1'
1027 ;;
1028irix*)
1029 # Cannot use undefined symbols on IRIX because inlined functions mess us up.
1030 symcode='[BCDEGRST]'
1031 ;;
1032solaris2*)
1033 symcode='[BDTU]'
1034 ;;
1035esac
1036
1037# If we're using GNU nm, then use its standard symbol codes.
1038if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1039 symcode='[ABCDGISTUW]'
1040fi
1041
1042case "$host_os" in
1043cygwin32*)
1044 # We do not want undefined symbols on cygwin32. The user must
1045 # arrange to define them via -l arguments.
1046 symcode='[ABCDGISTW]'
1047 ;;
1048esac
1049
1050# Write the raw and C identifiers.
1051global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
1052
1053# Check to see that the pipe works correctly.
1054pipe_works=no
1055$rm conftest*
1056cat > conftest.c <<EOF
1057#ifdef __cplusplus
1058extern "C" {
1059#endif
1060char nm_test_var;
1061void nm_test_func(){}
1062#ifdef __cplusplus
1063}
1064#endif
1065main(){nm_test_var='a';nm_test_func();return(0);}
1066EOF
1067
1068echo "$progname:1068: checking if global_symbol_pipe works" >&5
1069if { (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
1073
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
1083 fi
1084
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
1090extern "C" {
1091#endif
1092
1093EOF
1094 # Now generate the symbol file.
1095 sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
1096
1097 cat <<EOF >> conftest.c
1098#if defined (__STDC__) && __STDC__
1099# define __ptr_t void *
1100#else
1101# define __ptr_t char *
1102#endif
1103
1104/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
1105int dld_preloaded_symbol_count = $count;
1106
1107/* The mapping between symbol names and symbols. */
1108struct {
1109 char *name;
1110 __ptr_t address;
1111}
1112dld_preloaded_symbols[] =
1113{
1114EOF
1115 sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c
1116 cat <<\EOF >> conftest.c
1117 {0, (__ptr_t) 0}
1118};
1119
1120#ifdef __cplusplus
1121}
1122#endif
1123EOF
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
1135 fi
1136 LIBS="$save_LIBS"
1137 else
1138 echo "cannot find nm_test_func in $nlist" >&5
1139 fi
1140 else
1141 echo "cannot find nm_test_var in $nlist" >&5
1142 fi
1143 else
1144 echo "cannot run $global_symbol_pipe" >&5
1145 fi
1146else
1147 echo "$progname: failed program was:" >&5
1148 cat conftest.c >&5
1149fi
1150$rm conftest*
1151
1152# Do not use the global_symbol_pipe unless it works.
1153echo "$ac_t$pipe_works" 1>&6
1154test "$pipe_works" = yes || global_symbol_pipe=
6599da04
JM
1155
1156# Check hardcoding attributes.
1157echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
1158hardcode_action=
1159if test -n "$hardcode_libdir_flag_spec" || \
cf4ccd63 1160 test -n "$runpath_var"; then
6599da04
JM
1161
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
1166
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
1172 fi
6599da04 1173else
cf4ccd63
JL
1174 # We cannot hardcode anything, or else we can only hardcode existing
1175 # directories.
1176 hardcode_action=unsupported
6599da04 1177fi
cf4ccd63 1178echo "$ac_t$hardcode_action" 1>&6
6599da04
JM
1179
1180
1181reload_flag=
1182reload_cmds='$LD$reload_flag -o $output$reload_objs'
1183echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
cf4ccd63 1184# PORTME Some linkers may need a different reload flag.
6599da04 1185reload_flag='-r'
cf4ccd63 1186echo "$ac_t$reload_flag" 1>&6
6599da04
JM
1187test -n "$reload_flag" && reload_flag=" $reload_flag"
1188
1189# PORTME Fill in your ld.so characteristics
1190library_names_spec=
cf4ccd63 1191libname_spec='lib$name'
6599da04
JM
1192soname_spec=
1193postinstall_cmds=
cf4ccd63 1194postuninstall_cmds=
6599da04 1195finish_cmds=
cf4ccd63 1196finish_eval=
6599da04
JM
1197shlibpath_var=
1198version_type=none
1199dynamic_linker="$host_os ld.so"
1200
1201echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
1202case "$host_os" in
1203aix3* | aix4*)
1204 version_type=linux
cf4ccd63 1205 library_names_spec='${libname}${release}.so$versuffix $libname.a'
6599da04
JM
1206 shlibpath_var=LIBPATH
1207
1208 # AIX has no versioning support, so we append a major version to the name.
cf4ccd63
JL
1209 soname_spec='${libname}${release}.so$major'
1210 ;;
1211
1212amigaos*)
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'
1216 ;;
1217
1218cygwin32*)
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
6599da04
JM
1223 ;;
1224
1225freebsd2* | freebsd3*)
1226 version_type=sunos
cf4ccd63 1227 library_names_spec='${libname}${release}.so$versuffix $libname.so'
6599da04
JM
1228 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1229 shlibpath_var=LD_LIBRARY_PATH
1230 ;;
1231
1232gnu*)
1233 version_type=sunos
cf4ccd63 1234 library_names_spec='${libname}${release}.so$versuffix'
6599da04
JM
1235 shlibpath_var=LD_LIBRARY_PATH
1236 ;;
1237
cf4ccd63 1238hpux9* | hpux10* | hpux11*)
6599da04
JM
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
cf4ccd63
JL
1244 library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
1245 soname_spec='${libname}${release}.sl$major'
6599da04
JM
1246 # HP-UX runs *really* slowly unless shared libraries are mode 555.
1247 postinstall_cmds='chmod 555 $lib'
1248 ;;
1249
1250irix5* | irix6*)
1251 version_type=osf
cf4ccd63
JL
1252 soname_spec='${libname}${release}.so'
1253 library_names_spec='${libname}${release}.so$versuffix $libname.so'
6599da04
JM
1254 shlibpath_var=LD_LIBRARY_PATH
1255 ;;
1256
1257# No shared lib support for Linux oldld, aout, or coff.
1258linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
1259 dynamic_linker=no
1260 ;;
1261
1262# This must be Linux ELF.
1263linux-gnu*)
1264 version_type=linux
cf4ccd63
JL
1265 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1266 soname_spec='${libname}${release}.so$major'
6599da04
JM
1267 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1268 shlibpath_var=LD_LIBRARY_PATH
1269
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
1278 fi
1279 ;;
1280
1281netbsd* | openbsd*)
1282 version_type=sunos
cf4ccd63 1283 library_names_spec='${libname}${release}.so$versuffix'
6599da04
JM
1284 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1285 shlibpath_var=LD_LIBRARY_PATH
1286 ;;
1287
cf4ccd63
JL
1288os2*)
1289 libname_spec='$name'
1290 library_names_spec='$libname.dll $libname.a'
1291 dynamic_linker='OS/2 ld.exe'
1292 shlibpath_var=LIBPATH
1293 ;;
1294
6599da04
JM
1295osf3* | osf4*)
1296 version_type=osf
cf4ccd63
JL
1297 soname_spec='${libname}${release}.so'
1298 library_names_spec='${libname}${release}.so$versuffix $libname.so'
6599da04
JM
1299 shlibpath_var=LD_LIBRARY_PATH
1300 ;;
1301
1302sco3.2v5*)
1303 version_type=osf
cf4ccd63
JL
1304 soname_spec='${libname}${release}.so$major'
1305 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6599da04
JM
1306 shlibpath_var=LD_LIBRARY_PATH
1307 ;;
1308
1309solaris2*)
1310 version_type=linux
cf4ccd63
JL
1311 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1312 soname_spec='${libname}${release}.so$major'
6599da04
JM
1313 shlibpath_var=LD_LIBRARY_PATH
1314 ;;
1315
1316sunos4*)
1317 version_type=sunos
cf4ccd63 1318 library_names_spec='${libname}${release}.so$versuffix'
6599da04
JM
1319 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1320 shlibpath_var=LD_LIBRARY_PATH
1321 ;;
1322
cf4ccd63
JL
1323sysv4.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
1328 ;;
1329
1330uts4*)
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
1335 ;;
1336
6599da04
JM
1337*)
1338 dynamic_linker=no
1339 ;;
1340esac
cf4ccd63 1341echo "$ac_t$dynamic_linker"
6599da04
JM
1342test "$dynamic_linker" = no && can_build_shared=no
1343
cf4ccd63 1344# Report the final consequences.
6599da04
JM
1345echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1346
1347echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
1348test "$can_build_shared" = "no" && enable_shared=no
1349
cf4ccd63
JL
1350# On AIX, shared libraries and static libraries use the same namespace, and
1351# are all built from PIC.
6599da04
JM
1352case "$host_os" in
1353aix*)
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'
1358 fi
1359 ;;
1360esac
1361
cf4ccd63 1362echo "$ac_t$enable_shared" 1>&6
6599da04
JM
1363
1364# Make sure either enable_shared or enable_static is yes.
1365test "$enable_shared" = yes || enable_static=yes
1366
1367echo "checking whether to build static libraries... $enable_static" 1>&6
1368
cf4ccd63
JL
1369echo $ac_n "checking for objdir... $ac_c" 1>&6
1370rm -f .libs 2>/dev/null
1371mkdir .libs 2>/dev/null
1372if test -d .libs; then
1373 objdir=.libs
1374else
1375 # MS-DOS does not allow filenames that begin with a dot.
1376 objdir=_libs
1377fi
1378rmdir .libs 2>/dev/null
1379echo "$ac_t$objdir" 1>&6
1380
1381# Copy echo and quote the copy, instead of the original, because it is
1382# used later.
1383ltecho="$echo"
1384
1385# Now quote all the things that may contain metacharacters.
1386for 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
1395
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\"\`"
1402 ;;
1403 *)
1404 eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`"
1405 ;;
1406 esac
1407done
6599da04 1408
cf4ccd63
JL
1409trap "$rm \"$ofile\"; exit 1" 1 2 15
1410echo "creating $ofile"
1411$rm "$ofile"
1412cat <<EOF > "$ofile"
1413#! $SHELL
1414
1415# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
6599da04 1416# Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
cf4ccd63
JL
1417# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
1418#
1419# Copyright (C) 1996-1998 Free Software Foundation, Inc.
1420# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
1421#
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.
1426#
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.
1431#
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.
1435#
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.
1440
1441# Sed that helps us avoid accidentally triggering echo(1) options like -n.
1442Xsed="sed -e s/^X//"
1443
1444# The HP-UX ksh and POSIX shell print the target directory to stdout
1445# if CDPATH is set.
1446if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
1447
1448### BEGIN LIBTOOL CONFIG
1449# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
6599da04
JM
1450#
1451# CC="$old_CC" CFLAGS="$old_CFLAGS" CPPFLAGS="$old_CPPFLAGS" \\
cf4ccd63
JL
1452# LD="$old_LD" NM="$old_NM" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\
1453# DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\
6599da04
JM
1454# $0$ltconfig_args
1455#
1456# Compiler and other test output produced by $progname, useful for
1457# debugging $progname, is in ./config.log if it exists.
1458
1459# The version of $progname that generated this script.
1460LTCONFIG_VERSION="$VERSION"
1461
cf4ccd63
JL
1462# Shell to use when invoking shell scripts.
1463SHELL="$SHELL"
1464
1465# Whether or not to build shared libraries.
6599da04
JM
1466build_libtool_libs=$enable_shared
1467
cf4ccd63 1468# Whether or not to build static libraries.
6599da04
JM
1469build_old_libs=$enable_static
1470
1471# The host system.
1472host_alias="$host_alias"
1473host="$host"
1474
cf4ccd63
JL
1475# An echo program that does not interpret backslashes.
1476echo="$ltecho"
1477
6599da04 1478# The archiver.
cf4ccd63
JL
1479AR="$AR"
1480
1481# The default C compiler.
1482CC="$CC"
6599da04
JM
1483
1484# The linker used to build libraries.
cf4ccd63 1485LD="$LD"
6599da04
JM
1486
1487# Whether we need hard or soft links.
cf4ccd63
JL
1488LN_S="$LN_S"
1489
1490# A BSD-compatible nm program.
1491NM="$NM"
1492
1493# Used on cygwin32: DLL creation program.
1494DLLTOOL="$DLLTOOL"
1495
1496# Used on cygwin32: assembler.
1497AS="$AS"
1498
1499# The name of the directory that contains temporary libtool files.
1500objdir="$objdir"
6599da04
JM
1501
1502# How to create reloadable object files.
cf4ccd63
JL
1503reload_flag="$reload_flag"
1504reload_cmds="$reload_cmds"
6599da04
JM
1505
1506# How to pass a linker flag through the compiler.
cf4ccd63 1507wl="$wl"
6599da04
JM
1508
1509# Additional compiler flags for building library objects.
cf4ccd63 1510pic_flag="$pic_flag"
6599da04
JM
1511
1512# Compiler flag to prevent dynamic linking.
cf4ccd63 1513link_static_flag="$link_static_flag"
6599da04 1514
cf4ccd63
JL
1515# Compiler flag to turn off builtin functions.
1516no_builtin_flag="$no_builtin_flag"
6599da04 1517
cf4ccd63
JL
1518# Compiler flag to allow reflexive dlopens.
1519export_dynamic_flag_spec="$export_dynamic_flag_spec"
6599da04
JM
1520
1521# Library versioning type.
1522version_type=$version_type
1523
cf4ccd63
JL
1524# Format of library name prefix.
1525libname_spec="$libname_spec"
1526
6599da04
JM
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.
cf4ccd63 1529library_names_spec="$library_names_spec"
6599da04
JM
1530
1531# The coded name of the library, if different from the real name.
cf4ccd63 1532soname_spec="$soname_spec"
6599da04
JM
1533
1534# Commands used to build and install an old-style archive.
cf4ccd63
JL
1535RANLIB="$RANLIB"
1536old_archive_cmds="$old_archive_cmds"
1537old_postinstall_cmds="$old_postinstall_cmds"
1538old_postuninstall_cmds="$old_postuninstall_cmds"
1539
1540# Create an old-style archive from a shared archive.
1541old_archive_from_new_cmds="$old_archive_from_new_cmds"
6599da04
JM
1542
1543# Commands used to build and install a shared archive.
cf4ccd63
JL
1544archive_cmds="$archive_cmds"
1545postinstall_cmds="$postinstall_cmds"
1546postuninstall_cmds="$postuninstall_cmds"
6599da04
JM
1547
1548# Flag that allows shared libraries with undefined symbols to be built.
cf4ccd63
JL
1549allow_undefined_flag="$allow_undefined_flag"
1550
1551# Flag that forces no undefined symbols.
1552no_undefined_flag="$no_undefined_flag"
6599da04
JM
1553
1554# Commands used to finish a libtool library installation in a directory.
cf4ccd63
JL
1555finish_cmds="$finish_cmds"
1556
1557# Same as above, but a single script fragment to be evaled but not shown.
1558finish_eval="$finish_eval"
6599da04 1559
cf4ccd63
JL
1560# Take the output of nm and produce a listing of raw symbols and C names.
1561global_symbol_pipe="$global_symbol_pipe"
6599da04
JM
1562
1563# This is the shared library runtime path variable.
1564runpath_var=$runpath_var
1565
1566# This is the shared library path variable.
1567shlibpath_var=$shlibpath_var
1568
1569# How to hardcode a shared library path into an executable.
1570hardcode_action=$hardcode_action
1571
1572# Flag to hardcode \$libdir into a binary during linking.
1573# This must work even if \$libdir does not exist.
cf4ccd63 1574hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec"
6599da04
JM
1575
1576# Whether we need a single -rpath flag with a separated argument.
cf4ccd63 1577hardcode_libdir_separator="$hardcode_libdir_separator"
6599da04
JM
1578
1579# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
1580# resulting binary.
1581hardcode_direct=$hardcode_direct
1582
1583# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
1584# resulting binary.
1585hardcode_minus_L=$hardcode_minus_L
1586
6599da04
JM
1587# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
1588# the resulting binary.
1589hardcode_shlibpath_var=$hardcode_shlibpath_var
6599da04
JM
1590EOF
1591
cf4ccd63
JL
1592case "$host_os" in
1593aix3*)
1594 cat <<\EOF >> "$ofile"
1595
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.
1599if test "${COLLECT_NAMES+set}" != set; then
1600 COLLECT_NAMES=
1601 export COLLECT_NAMES
1602fi
1603EOF
6599da04
JM
1604 ;;
1605esac
1606
cf4ccd63
JL
1607echo '### END LIBTOOL CONFIG' >> "$ofile"
1608echo >> "$ofile"
1609
1610# Append the ltmain.sh script.
1611cat "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
6599da04 1612
cf4ccd63 1613chmod +x "$ofile"
6599da04
JM
1614exit 0
1615
1616# Local Variables:
1617# mode:shell-script
1618# sh-indentation:2
1619# End:
This page took 0.221829 seconds and 5 git commands to generate.