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