blob: 527af3fb1b461dcf7f5eeddf211009ca30f6e16e [file] [log] [blame]
Daniel Veillard36169f81998-07-24 19:30:47 +00001#! /bin/sh
2
3# ltconfig - Create a system-specific libtool.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00004# Copyright (C) 1996-1998 Free Software Foundation, Inc.
Daniel Veillard36169f81998-07-24 19:30:47 +00005# 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
Daniel Veillardda4d3c41998-11-04 20:07:05 +000028# Check that we are running under the correct shell.
29SHELL=${CONFIG_SHELL-/bin/sh}
30echo=echo
31if test "X$1" = X--no-reexec; then
32 # Discard the --no-reexec flag, and continue.
33 shift
34elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
36 :
37else
38 # Restart under the correct shell.
39 exec "$SHELL" "$0" --no-reexec ${1+"$@"}
40fi
41
42# The HP-UX ksh and POSIX shell print the target directory to stdout
43# if CDPATH is set.
44if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
45
46if test "X`($echo '\t') 2>/dev/null`" != 'X\t'; then
47 # The Solaris, AIX, and Digital Unix default echo programs unquote
48 # backslashes. This makes it impossible to quote backslashes using
49 # echo "$something" | sed 's/\\/\\\\/g'
50 #
51 # So, first we look for a working echo in the user's PATH.
52 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
53 for dir in $PATH /usr/ucb; do
54 if test -f $dir/echo && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t'; then
55 echo="$dir/echo"
56 break
57 fi
58 done
59 IFS="$save_ifs"
60
61 if test "X$echo" = Xecho; then
62 # We didn't find a better echo, so look for alternatives.
63 if test "X`(print -r '\t') 2>/dev/null`" = 'X\t'; then
64 # This shell has a builtin print -r that does the trick.
65 echo='print -r'
66 elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then
67 # If we have ksh, try running ltconfig again with it.
68 CONFIG_SHELL=/bin/ksh
69 export CONFIG_SHELL
70 exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
71 else
72 # Try using printf.
73 echo='printf %s\n'
74 if test "X`($echo '\t') 2>/dev/null`" != 'X\t'; then
75 # Oops. We lost completely, so just stick with echo.
76 echo=echo
77 fi
78 fi
79 fi
80fi
81
82# Sed substitution that helps us do robust quoting. It backslashifies
83# metacharacters that are still active within double-quoted strings.
84Xsed='sed -e s/^X//'
85sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
86
87# Same as above, but do not quote variable references.
88double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
89
Daniel Veillard36169f81998-07-24 19:30:47 +000090# The name of this program.
Daniel Veillardda4d3c41998-11-04 20:07:05 +000091progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +000092
93# Constants:
94PROGRAM=ltconfig
95PACKAGE=libtool
Daniel Veillardda4d3c41998-11-04 20:07:05 +000096VERSION=1.2b
Daniel Veillard36169f81998-07-24 19:30:47 +000097ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
98ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
99rm="rm -f"
100
101help="Try \`$progname --help' for more information."
102
Daniel Veillard36169f81998-07-24 19:30:47 +0000103# Global variables:
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000104default_ofile=libtool
Daniel Veillard36169f81998-07-24 19:30:47 +0000105can_build_shared=yes
106enable_shared=yes
107# All known linkers require a `.a' archive for static linking.
108enable_static=yes
109ltmain=
110silent=
111srcdir=
112ac_config_guess=
113ac_config_sub=
114host=
115nonopt=
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000116ofile="$default_ofile"
Daniel Veillard36169f81998-07-24 19:30:47 +0000117verify_host=yes
118with_gcc=no
119with_gnu_ld=no
120
121old_AR="$AR"
122old_CC="$CC"
123old_CFLAGS="$CFLAGS"
124old_CPPFLAGS="$CPPFLAGS"
125old_LD="$LD"
126old_LN_S="$LN_S"
127old_NM="$NM"
128old_RANLIB="$RANLIB"
129
130# Parse the command line options.
131args=
132prev=
133for option
134do
135 case "$option" in
136 -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
137 *) optarg= ;;
138 esac
139
140 # If the previous option needs an argument, assign it.
141 if test -n "$prev"; then
142 eval "$prev=\$option"
143 prev=
144 continue
145 fi
146
147 case "$option" in
148 --help) cat <<EOM
149Usage: $progname [OPTION]... LTMAIN [HOST]
150
151Generate a system-specific libtool script.
152
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000153 --debug enable verbose shell tracing
Daniel Veillard36169f81998-07-24 19:30:47 +0000154 --disable-shared do not build shared libraries
155 --disable-static do not build static libraries
156 --help display this help and exit
157 --no-verify do not verify that HOST is a valid host type
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000158-o, --output=FILE specify the output file [default=$default_ofile]
Daniel Veillard36169f81998-07-24 19:30:47 +0000159 --quiet same as \`--silent'
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000160 --silent do not print informational messages
Daniel Veillard36169f81998-07-24 19:30:47 +0000161 --srcdir=DIR find \`config.guess' in DIR
162 --version output version information and exit
163 --with-gcc assume that the GNU C compiler will be used
164 --with-gnu-ld assume that the C compiler uses the GNU linker
165
166LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
167functionality.
168
169HOST is the canonical host system name [default=guessed].
170EOM
171 exit 0
172 ;;
173
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000174 --debug)
175 echo "$progname: enabling shell trace mode"
176 set -x
177 ;;
178
Daniel Veillard36169f81998-07-24 19:30:47 +0000179 --disable-shared) enable_shared=no ;;
180
181 --disable-static) enable_static=no ;;
182
183 --quiet | --silent) silent=yes ;;
184
185 --srcdir) prev=srcdir ;;
186 --srcdir=*) srcdir="$optarg" ;;
187
188 --no-verify) verify_host=no ;;
189
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000190 --output | -o) prev=ofile ;;
191 --output=*) ofile="$optarg" ;;
192
Daniel Veillard36169f81998-07-24 19:30:47 +0000193 --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
194
195 --with-gcc) with_gcc=yes ;;
196 --with-gnu-ld) with_gnu_ld=yes ;;
197
198 -*)
199 echo "$progname: unrecognized option \`$option'" 1>&2
200 echo "$help" 1>&2
201 exit 1
202 ;;
203
204 *)
205 if test -z "$ltmain"; then
206 ltmain="$option"
207 elif test -z "$host"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000208# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
Daniel Veillard36169f81998-07-24 19:30:47 +0000209# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
210# echo "$progname: warning \`$option' is not a valid host type" 1>&2
211# fi
212 host="$option"
213 else
214 echo "$progname: too many arguments" 1>&2
215 echo "$help" 1>&2
216 exit 1
217 fi ;;
218 esac
219done
220
221if test -z "$ltmain"; then
222 echo "$progname: you must specify a LTMAIN file" 1>&2
223 echo "$help" 1>&2
224 exit 1
225fi
226
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000227if test ! -f "$ltmain"; then
228 echo "$progname: \`$ltmain' does not exist" 1>&2
229 echo "$help" 1>&2
230 exit 1
Daniel Veillard36169f81998-07-24 19:30:47 +0000231fi
232
233# Quote any args containing shell metacharacters.
234ltconfig_args=
235for arg
236do
237 case "$arg" in
238 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
239 ltconfig_args="$ltconfig_args '$arg'" ;;
240 *) ltconfig_args="$ltconfig_args $arg" ;;
241 esac
242done
243
244# A relevant subset of AC_INIT.
245
246# File descriptor usage:
247# 0 standard input
248# 1 file creation
249# 2 errors and warnings
250# 3 some systems may open it to /dev/tty
251# 4 used on the Kubota Titan
252# 5 compiler messages saved in config.log
253# 6 checking for... messages and results
254if test "$silent" = yes; then
255 exec 6>/dev/null
256else
257 exec 6>&1
258fi
259exec 5>>./config.log
260
261# NLS nuisances.
262# Only set LANG and LC_ALL to C if already set.
263# These must not be set unconditionally because not all systems understand
264# e.g. LANG=C (notably SCO).
265if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
266if test "${LANG+set}" = set; then LANG=C; export LANG; fi
267
268if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
269 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
270 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
271 ac_n= ac_c='
272' ac_t=' '
273 else
274 ac_n=-n ac_c= ac_t=
275 fi
276else
277 ac_n= ac_c='\c' ac_t=
278fi
279
280if test -z "$srcdir"; then
281 # Assume the source directory is the same one as the path to ltmain.sh.
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000282 srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +0000283 test "$srcdir" = "$ltmain" && srcdir=.
284fi
285
286trap "$rm conftest*; exit 1" 1 2 15
287if test "$verify_host" = yes; then
288 # Check for config.guess and config.sub.
289 ac_aux_dir=
290 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
291 if test -f $ac_dir/config.guess; then
292 ac_aux_dir=$ac_dir
293 break
294 fi
295 done
296 if test -z "$ac_aux_dir"; then
297 echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
298 echo "$help" 1>&2
299 exit 1
300 fi
301 ac_config_guess=$ac_aux_dir/config.guess
302 ac_config_sub=$ac_aux_dir/config.sub
303
304 # Make sure we can run config.sub.
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000305 if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
Daniel Veillard36169f81998-07-24 19:30:47 +0000306 else
307 echo "$progname: cannot run $ac_config_sub" 1>&2
308 echo "$help" 1>&2
309 exit 1
310 fi
311
312 echo $ac_n "checking host system type""... $ac_c" 1>&6
313
314 host_alias=$host
315 case "$host_alias" in
316 "")
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000317 if host_alias=`$SHELL $ac_config_guess`; then :
Daniel Veillard36169f81998-07-24 19:30:47 +0000318 else
319 echo "$progname: cannot guess host type; you must specify one" 1>&2
320 echo "$help" 1>&2
321 exit 1
322 fi ;;
323 esac
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000324 host=`$SHELL $ac_config_sub $host_alias`
Daniel Veillard36169f81998-07-24 19:30:47 +0000325 echo "$ac_t$host" 1>&6
326
327 # Make sure the host verified.
328 test -z "$host" && exit 1
329
330elif test -z "$host"; then
331 echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
332 echo "$help" 1>&2
333 exit 1
334else
335 host_alias=$host
336fi
337
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000338# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
339case "$host_os" in
340linux-gnu*) ;;
341linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
Daniel Veillard36169f81998-07-24 19:30:47 +0000342esac
343
344host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
345host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
346host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
347
348case "$host_os" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000349aix3*)
Daniel Veillard36169f81998-07-24 19:30:47 +0000350 # AIX sometimes has problems with the GCC collect2 program. For some
351 # reason, if we set the COLLECT_NAMES environment variable, the problems
352 # vanish in a puff of smoke.
353 if test "${COLLECT_NAMES+set}" != set; then
354 COLLECT_NAMES=
355 export COLLECT_NAMES
356 fi
357 ;;
358esac
359
360# Determine commands to create old-style static archives.
361old_archive_cmds='$AR cru $oldlib$oldobjs'
362old_postinstall_cmds='chmod 644 $oldlib'
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000363old_postuninstall_cmds=
Daniel Veillard36169f81998-07-24 19:30:47 +0000364
365# Set a sane default for `AR'.
366test -z "$AR" && AR=ar
367
368# If RANLIB is not set, then run the test.
369if test "${RANLIB+set}" != "set"; then
370 result=no
371
372 echo $ac_n "checking for ranlib... $ac_c" 1>&6
373 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
374 for dir in $PATH; do
375 test -z "$dir" && dir=.
376 if test -f $dir/ranlib; then
377 RANLIB="ranlib"
378 result="ranlib"
379 break
380 fi
381 done
382 IFS="$save_ifs"
383
384 echo "$ac_t$result" 1>&6
385fi
386
387if test -n "$RANLIB"; then
388 old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000389 old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds"
Daniel Veillard36169f81998-07-24 19:30:47 +0000390fi
391
392# Check to see if we are using GCC.
393if test "$with_gcc" != yes || test -z "$CC"; then
394 # If CC is not set, then try to find GCC or a usable CC.
395 if test -z "$CC"; then
396 echo $ac_n "checking for gcc... $ac_c" 1>&6
397 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
398 for dir in $PATH; do
399 IFS="$save_ifs"
400 test -z "$dir" && dir=.
401 if test -f $dir/gcc; then
402 CC="gcc"
403 break
404 fi
405 done
406 IFS="$save_ifs"
407
408 if test -n "$CC"; then
409 echo "$ac_t$CC" 1>&6
410 else
411 echo "$ac_t"no 1>&6
412 fi
413 fi
414
415 # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
416 if test -z "$CC"; then
417 echo $ac_n "checking for cc... $ac_c" 1>&6
418 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
419 cc_rejected=no
420 for dir in $PATH; do
421 test -z "$dir" && dir=.
422 if test -f $dir/cc; then
423 if test "$dir/cc" = "/usr/ucb/cc"; then
424 cc_rejected=yes
425 continue
426 fi
427 CC="cc"
428 break
429 fi
430 done
431 IFS="$save_ifs"
432 if test $cc_rejected = yes; then
433 # We found a bogon in the path, so make sure we never use it.
434 set dummy $CC
435 shift
436 if test $# -gt 0; then
437 # We chose a different compiler from the bogus one.
438 # However, it has the same name, so the bogon will be chosen
439 # first if we set CC to just the name; use the full file name.
440 shift
441 set dummy "$dir/cc" "$@"
442 shift
443 CC="$@"
444 fi
445 fi
446
447 if test -n "$CC"; then
448 echo "$ac_t$CC" 1>&6
449 else
450 echo "$ac_t"no 1>&6
451 fi
452
453 if test -z "$CC"; then
454 echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
455 exit 1
456 fi
457 fi
458
459 # Now see if the compiler is really GCC.
460 with_gcc=no
461 echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000462 echo "$progname:462: checking whether we are using GNU C" >&5
Daniel Veillard36169f81998-07-24 19:30:47 +0000463
464 $rm conftest.c
465 cat > conftest.c <<EOF
466#ifdef __GNUC__
467 yes;
468#endif
469EOF
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000470 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:470: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
Daniel Veillard36169f81998-07-24 19:30:47 +0000471 with_gcc=yes
472 fi
473 $rm conftest.c
474 echo "$ac_t$with_gcc" 1>&6
475fi
476
477# Allow CC to be a program name with arguments.
478set dummy $CC
479compiler="$2"
480
481echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
482pic_flag=
Daniel Veillard36169f81998-07-24 19:30:47 +0000483special_shlib_compile_flags=
484wl=
485link_static_flag=
486no_builtin_flag=
487
488if test "$with_gcc" = yes; then
Daniel Veillard36169f81998-07-24 19:30:47 +0000489 wl='-Wl,'
490 link_static_flag='-static'
491 no_builtin_flag=' -fno-builtin'
492
493 case "$host_os" in
494 aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
495 # PIC is the default for these OSes.
496 ;;
497 os2*)
498 # We can build DLLs from non-PIC.
499 ;;
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000500 amigaos*)
501 # FIXME: we need at least 68020 code to build shared libraries, but
502 # adding the `-m68020' flag to GCC prevents building anything better,
503 # like `-m68040'.
504 pic_flag='-m68020 -resident32 -malways-restore-a4'
505 ;;
Daniel Veillard36169f81998-07-24 19:30:47 +0000506 *)
507 pic_flag='-fPIC'
508 ;;
509 esac
510else
511 # PORTME Check for PIC flags for the system compiler.
512 case "$host_os" in
513 aix3* | aix4*)
514 # All AIX code is PIC.
515 link_static_flag='-bnso -bI:/lib/syscalls.exp'
516 ;;
517
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000518 hpux9* | hpux10* | hpux11*)
Daniel Veillard36169f81998-07-24 19:30:47 +0000519 # Is there a better link_static_flag that works with the bundled CC?
520 wl='-Wl,'
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000521 link_static_flag="${wl}-a ${wl}archive"
Daniel Veillard36169f81998-07-24 19:30:47 +0000522 pic_flag='+Z'
523 ;;
524
525 irix5* | irix6*)
526 wl='-Wl,'
527 link_static_flag='-non_shared'
528 # PIC (with -KPIC) is the default.
529 ;;
530
531 os2*)
532 # We can build DLLs from non-PIC.
533 ;;
534
535 osf3* | osf4*)
536 # All OSF/1 code is PIC.
537 wl='-Wl,'
538 link_static_flag='-non_shared'
539 ;;
540
541 sco3.2v5*)
542 pic_flag='-Kpic'
543 link_static_flag='-dn'
544 special_shlib_compile_flags='-belf'
545 ;;
546
547 solaris2*)
548 pic_flag='-KPIC'
549 link_static_flag='-Bstatic'
550 wl='-Wl,'
551 ;;
552
553 sunos4*)
554 pic_flag='-PIC'
555 link_static_flag='-Bstatic'
556 wl='-Qoption ld '
557 ;;
558
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000559 sysv4.2uw2*)
560 pic_flag='-KPIC'
561 link_static_flag='-Bstatic'
562 wl='-Wl,'
563 ;;
564
Daniel Veillard36169f81998-07-24 19:30:47 +0000565 uts4*)
566 pic_flag='-pic'
567 link_static_flag='-Bstatic'
568 ;;
569
570 *)
571 can_build_shared=no
572 ;;
573 esac
574fi
575
576if test -n "$pic_flag"; then
577 echo "$ac_t$pic_flag" 1>&6
578
579 # Check to make sure the pic_flag actually works.
580 echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
581 $rm conftest*
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000582 echo "int some_variable = 0;" > conftest.c
Daniel Veillard36169f81998-07-24 19:30:47 +0000583 save_CFLAGS="$CFLAGS"
584 CFLAGS="$CFLAGS $pic_flag -DPIC"
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000585 echo "$progname:585: checking if $compiler PIC flag $pic_flag works" >&5
586 if { (eval echo $progname:586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
587 # Append any warnings to the config.log.
Daniel Veillard36169f81998-07-24 19:30:47 +0000588 cat conftest.err 1>&5
589
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000590 # On HP-UX, both CC and GCC only warn that PIC is supported... then they
591 # create non-PIC objects. So, if there were any warnings, we assume that
592 # PIC is not supported.
593 if test -s conftest.err; then
Daniel Veillard36169f81998-07-24 19:30:47 +0000594 echo "$ac_t"no 1>&6
595 can_build_shared=no
596 pic_flag=
597 else
598 echo "$ac_t"yes 1>&6
599 pic_flag=" $pic_flag"
600 fi
601 else
602 # Append any errors to the config.log.
603 cat conftest.err 1>&5
604 can_build_shared=no
605 pic_flag=
606 echo "$ac_t"no 1>&6
607 fi
608 CFLAGS="$save_CFLAGS"
609 $rm conftest*
610else
611 echo "$ac_t"none 1>&6
612fi
613
614# Check for any special shared library compilation flags.
615if test -n "$special_shlib_compile_flags"; then
616 echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
617 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
618 else
619 echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
620 can_build_shared=no
621 fi
622fi
623
624echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
625$rm conftest*
626echo 'main(){return(0);}' > conftest.c
627save_LDFLAGS="$LDFLAGS"
628LDFLAGS="$LDFLAGS $link_static_flag"
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000629echo "$progname:629: checking if $compiler static flag $link_static_flag works" >&5
630if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
Daniel Veillard36169f81998-07-24 19:30:47 +0000631 echo "$ac_t$link_static_flag" 1>&6
632else
633 echo "$ac_t"none 1>&6
634 link_static_flag=
635fi
636LDFLAGS="$save_LDFLAGS"
637$rm conftest*
638
639if test -z "$LN_S"; then
640 # Check to see if we can use ln -s, or we need hard links.
641 echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
642 $rm conftestdata
643 if ln -s X conftestdata 2>/dev/null; then
644 $rm conftestdata
645 LN_S="ln -s"
646 else
647 LN_S=ln
648 fi
649 if test "$LN_S" = "ln -s"; then
650 echo "$ac_t"yes 1>&6
651 else
652 echo "$ac_t"no 1>&6
653 fi
654fi
655
656# Make sure LD is an absolute path.
657if test -z "$LD"; then
658 ac_prog=ld
659 if test "$with_gcc" = yes; then
660 # Check if gcc -print-prog-name=ld gives a path.
661 echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000662 echo "$progname:662: checking for ld used by GCC" >&5
Daniel Veillard36169f81998-07-24 19:30:47 +0000663 ac_prog=`($CC -print-prog-name=ld) 2>&5`
664 case "$ac_prog" in
665 # Accept absolute paths.
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000666 /* | [A-Za-z]:[/\\]*)
Daniel Veillard36169f81998-07-24 19:30:47 +0000667 test -z "$LD" && LD="$ac_prog"
668 ;;
669 "")
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000670 # If it fails, then pretend we are not using GCC.
Daniel Veillard36169f81998-07-24 19:30:47 +0000671 ac_prog=ld
672 ;;
673 *)
674 # If it is relative, then search for the first ld in PATH.
675 with_gnu_ld=unknown
676 ;;
677 esac
678 elif test "$with_gnu_ld" = yes; then
679 echo $ac_n "checking for GNU ld... $ac_c" 1>&6
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000680 echo "$progname:680: checking for GNU ld" >&5
Daniel Veillard36169f81998-07-24 19:30:47 +0000681 else
682 echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000683 echo "$progname:683: checking for non-GNU ld" >&5
Daniel Veillard36169f81998-07-24 19:30:47 +0000684 fi
685
686 if test -z "$LD"; then
687 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
688 for ac_dir in $PATH; do
689 test -z "$ac_dir" && ac_dir=.
690 if test -f "$ac_dir/$ac_prog"; then
691 LD="$ac_dir/$ac_prog"
692 # Check to see if the program is GNU ld. I'd rather use --version,
693 # but apparently some GNU ld's only accept -v.
694 # Break only if it was the GNU/non-GNU ld that we prefer.
695 if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
696 test "$with_gnu_ld" != no && break
697 else
698 test "$with_gnu_ld" != yes && break
699 fi
700 fi
701 done
702 IFS="$ac_save_ifs"
703 fi
704
705 if test -n "$LD"; then
706 echo "$ac_t$LD" 1>&6
707 else
708 echo "$ac_t"no 1>&6
709 fi
710
711 if test -z "$LD"; then
712 echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
713 exit 1
714 fi
715fi
716
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000717# Check to see if it really is or is not GNU ld.
Daniel Veillard36169f81998-07-24 19:30:47 +0000718echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
719# I'd rather use --version here, but apparently some GNU ld's only accept -v.
720if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
721 with_gnu_ld=yes
722else
723 with_gnu_ld=no
724fi
725echo "$ac_t$with_gnu_ld" 1>&6
726
727# See if the linker supports building shared libraries.
728echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
729
730allow_undefined_flag=
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000731no_undefined_flag=
Daniel Veillard36169f81998-07-24 19:30:47 +0000732archive_cmds=
733old_archive_from_new_cmds=
734export_dynamic_flag_spec=
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000735whole_archive_flag_spec=
Daniel Veillard36169f81998-07-24 19:30:47 +0000736hardcode_libdir_flag_spec=
737hardcode_libdir_separator=
738hardcode_direct=no
739hardcode_minus_L=no
Daniel Veillard36169f81998-07-24 19:30:47 +0000740hardcode_shlibpath_var=unsupported
741runpath_var=
742
Daniel Veillard36169f81998-07-24 19:30:47 +0000743ld_shlibs=yes
Miguel de Icaza442321c1998-11-04 18:13:38 +0000744if test "$with_gnu_ld" = yes; then
Miguel de Icaza442321c1998-11-04 18:13:38 +0000745
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000746 # See if GNU ld supports shared libraries.
Miguel de Icaza442321c1998-11-04 18:13:38 +0000747 case "$host_os" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000748 amigaos*)
749 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)'
750 hardcode_libdir_flag_spec='-L$libdir'
751 hardcode_minus_L=yes
752 ;;
753
Miguel de Icaza442321c1998-11-04 18:13:38 +0000754 sunos4*)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000755 archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
Miguel de Icaza442321c1998-11-04 18:13:38 +0000756 hardcode_direct=yes
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000757 hardcode_minus_L=yes
Miguel de Icaza442321c1998-11-04 18:13:38 +0000758 hardcode_shlibpath_var=no
759 ;;
760
761 *)
762 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000763 archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs'
Miguel de Icaza442321c1998-11-04 18:13:38 +0000764 else
765 ld_shlibs=no
766 fi
767 ;;
768 esac
Daniel Veillard36169f81998-07-24 19:30:47 +0000769
770 if test "$ld_shlibs" = yes; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000771 runpath_var=LD_RUN_PATH
772 hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
773 export_dynamic_flag_spec='${wl}--export-dynamic'
774 whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
Daniel Veillard36169f81998-07-24 19:30:47 +0000775 fi
776else
777 # PORTME fill in a description of your system's linker (not GNU ld)
778 case "$host_os" in
779 aix3*)
780 allow_undefined_flag=unsupported
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000781 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'
Daniel Veillard36169f81998-07-24 19:30:47 +0000782 # Note: this linker hardcodes the directories in LIBPATH if there
783 # are no directories specified by -L.
784 hardcode_minus_L=yes
785 if test "$with_gcc" = yes && test -z "$link_static_flag"; then
786 # Neither direct hardcoding nor static linking is supported with a
787 # broken collect2.
788 hardcode_direct=unsupported
789 fi
790 ;;
791
792 aix4*)
793 allow_undefined_flag=unsupported
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000794 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'
Daniel Veillard36169f81998-07-24 19:30:47 +0000795 hardcode_direct=yes
796 hardcode_minus_L=yes
797 ;;
798
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000799 amigaos*)
800 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)'
801 hardcode_libdir_flag_spec='-L$libdir'
802 hardcode_minus_L=yes
803 ;;
804
Daniel Veillard36169f81998-07-24 19:30:47 +0000805 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
806 # support. Future versions do this automatically, but an explicit c++rt0.o
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000807 # does not break anything, and helps significantly (at the cost of a little
Daniel Veillard36169f81998-07-24 19:30:47 +0000808 # extra space).
809 freebsd2.2*)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000810 archive_cmds='$LD -Bshareable -o $lib$libobjs /usr/lib/c++rt0.o'
811 hardcode_libdir_flag_spec='-R$libdir'
Daniel Veillard36169f81998-07-24 19:30:47 +0000812 hardcode_direct=yes
813 hardcode_minus_L=yes
814 hardcode_shlibpath_var=no
815 ;;
816
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000817 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
Daniel Veillard36169f81998-07-24 19:30:47 +0000818 freebsd2*)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000819 archive_cmds='$LD -Bshareable -o $lib$libobjs'
Daniel Veillard36169f81998-07-24 19:30:47 +0000820 hardcode_direct=yes
821 hardcode_minus_L=yes
822 hardcode_shlibpath_var=no
823 ;;
824
825 # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
826 freebsd3*)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000827 archive_cmds='$CC -shared -o $lib$libobjs'
Daniel Veillard36169f81998-07-24 19:30:47 +0000828 hardcode_libdir_flag_spec='-R$libdir'
829 hardcode_direct=yes
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000830 hardcode_minus_L=no
Daniel Veillard36169f81998-07-24 19:30:47 +0000831 hardcode_shlibpath_var=no
832 ;;
833
834 hpux9*)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000835 archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs;mv $objdir/$soname $lib'
Daniel Veillard36169f81998-07-24 19:30:47 +0000836 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
837 hardcode_direct=yes
838 hardcode_minus_L=yes
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000839 export_dynamic_flag_spec='${wl}-E'
Daniel Veillard36169f81998-07-24 19:30:47 +0000840 ;;
841
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000842 hpux10* | hpux11*)
843 archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs'
Daniel Veillard36169f81998-07-24 19:30:47 +0000844 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
845 hardcode_direct=yes
846 hardcode_minus_L=yes
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000847 export_dynamic_flag_spec='${wl}-E'
Daniel Veillard36169f81998-07-24 19:30:47 +0000848 ;;
849
850 irix5* | irix6*)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000851 if test "$with_gcc" = yes; then
852 archive_cmds='$CC -shared -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring$libobjs'
853 else
854 archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs'
855 fi
Daniel Veillard36169f81998-07-24 19:30:47 +0000856 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
857 ;;
858
859 netbsd*)
860 # Tested with NetBSD 1.2 ld
861 archive_cmds='$LD -Bshareable -o $lib$libobjs'
862 hardcode_libdir_flag_spec='-R$libdir'
863 hardcode_direct=yes
864 hardcode_shlibpath_var=no
865 ;;
866
867 openbsd*)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000868 archive_cmds='$LD -Bshareable -o $lib$libobjs'
Daniel Veillard36169f81998-07-24 19:30:47 +0000869 hardcode_libdir_flag_spec='-R$libdir'
870 hardcode_direct=yes
871 hardcode_shlibpath_var=no
872 ;;
873
874 os2*)
875 hardcode_libdir_flag_spec='-L$libdir'
876 hardcode_minus_L=yes
877 allow_undefined_flag=unsupported
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000878 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 +0000879 old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
880 ;;
881
882 osf3* | osf4*)
883 allow_undefined_flag=' -expect_unresolved \*'
884 archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
885 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
886 hardcode_libdir_separator=:
887 ;;
888
889 sco3.2v5*)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000890 archive_cmds='$LD -G -o $lib$libobjs'
Daniel Veillard36169f81998-07-24 19:30:47 +0000891 hardcode_direct=yes
892 ;;
893
894 solaris2*)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000895 no_undefined_flag=' -z text'
896 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs'
Daniel Veillard36169f81998-07-24 19:30:47 +0000897 hardcode_libdir_flag_spec='-R$libdir'
898 hardcode_shlibpath_var=no
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000899
900 # Solaris 2 before 2.5 hardcodes -L paths.
901 case "$host_os" in
902 solaris2.[0-4]*)
903 hardcode_minus_L=yes
904 ;;
905 esac
Daniel Veillard36169f81998-07-24 19:30:47 +0000906 ;;
907
908 sunos4*)
Miguel de Icaza442321c1998-11-04 18:13:38 +0000909 archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
Daniel Veillard36169f81998-07-24 19:30:47 +0000910 hardcode_libdir_flag_spec='-L$libdir'
911 hardcode_direct=yes
912 hardcode_minus_L=yes
913 hardcode_shlibpath_var=no
914 ;;
915
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000916 uts4*)
917 archive_cmds='$LD -G -h $soname -o $lib$libobjs'
918 hardcode_libdir_flag_spec='-L$libdir'
919 hardcode_direct=no
920 hardcode_minus_L=no
921 hardcode_shlibpath_var=no
922 ;;
Daniel Veillard36169f81998-07-24 19:30:47 +0000923
924 *)
925 ld_shlibs=no
926 can_build_shared=no
927 ;;
928 esac
929fi
930echo "$ac_t$ld_shlibs" 1>&6
931
932if test -z "$NM"; then
933 echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
934 case "$NM" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000935 /* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path.
Daniel Veillard36169f81998-07-24 19:30:47 +0000936 *)
937 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000938 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
939 test -z "$ac_dir" && ac_dir=.
Daniel Veillard36169f81998-07-24 19:30:47 +0000940 if test -f $ac_dir/nm; then
941 # Check to see if the nm accepts a BSD-compat flag.
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000942 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
943 # nm: unknown option "B" ignored
944 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
Daniel Veillard36169f81998-07-24 19:30:47 +0000945 NM="$ac_dir/nm -B"
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000946 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
Daniel Veillard36169f81998-07-24 19:30:47 +0000947 NM="$ac_dir/nm -p"
948 else
949 NM="$ac_dir/nm"
950 fi
951 break
952 fi
953 done
954 IFS="$ac_save_ifs"
955 test -z "$NM" && NM=nm
956 ;;
957 esac
958 echo "$ac_t$NM" 1>&6
959fi
960
961# Check for command to grab the raw symbol name followed by C symbol from nm.
962echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
963
964# These are sane defaults that work on at least a few old systems.
965# [They come from Ultrix. What could be older than Ultrix?!! ;)]
966
967# Character class describing NM global symbol codes.
968symcode='[BCDEGRSTU]'
969
970# Regexp to match symbols that can be accessed directly from C.
971sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
972
973# Transform the above into a raw symbol and a C symbol.
974symxfrm='\1 \1'
975
976# Define system-specific variables.
977case "$host_os" in
978aix*)
979 symcode='[BCDTU]'
980 ;;
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000981irix*)
982 # Cannot use undefined symbols on IRIX because inlined functions mess us up.
983 symcode='[BCDEGRST]'
984 ;;
Daniel Veillard36169f81998-07-24 19:30:47 +0000985solaris2*)
986 symcode='[BDTU]'
987 ;;
988esac
989
990# If we're using GNU nm, then use its standard symbol codes.
991if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
992 symcode='[ABCDGISTUW]'
993fi
994
995# Write the raw and C identifiers.
996global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
997
998# Check to see that the pipe works correctly.
999pipe_works=no
1000$rm conftest*
1001cat > conftest.c <<EOF
1002#ifdef __cplusplus
1003extern "C" {
1004#endif
1005char nm_test_var;
1006void nm_test_func(){}
1007#ifdef __cplusplus
1008}
1009#endif
1010main(){nm_test_var='a';nm_test_func();return(0);}
1011EOF
1012
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001013echo "$progname:1013: checking if global_symbol_pipe works" >&5
1014if { (eval echo $progname:1014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then
Daniel Veillard36169f81998-07-24 19:30:47 +00001015 # Now try to grab the symbols.
1016 nlist=conftest.nm
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001017 if { echo "$progname:1017: 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 +00001018
1019 # Try sorting and uniquifying the output.
1020 if sort "$nlist" | uniq > "$nlist"T; then
1021 mv -f "$nlist"T "$nlist"
1022 wcout=`wc "$nlist" 2>/dev/null`
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001023 count=`$echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001024 (test "$count" -ge 0) 2>/dev/null || count=-1
1025 else
1026 rm -f "$nlist"T
1027 count=-1
1028 fi
1029
1030 # Make sure that we snagged all the symbols we need.
1031 if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1032 if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1033 cat <<EOF > conftest.c
1034#ifdef __cplusplus
1035extern "C" {
1036#endif
1037
1038EOF
1039 # Now generate the symbol file.
1040 sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
1041
1042 cat <<EOF >> conftest.c
1043#if defined (__STDC__) && __STDC__
1044# define __ptr_t void *
1045#else
1046# define __ptr_t char *
1047#endif
1048
1049/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
1050int dld_preloaded_symbol_count = $count;
1051
1052/* The mapping between symbol names and symbols. */
1053struct {
1054 char *name;
1055 __ptr_t address;
1056}
1057dld_preloaded_symbols[] =
1058{
1059EOF
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001060 sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c
Daniel Veillard36169f81998-07-24 19:30:47 +00001061 cat <<\EOF >> conftest.c
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001062 {0, (__ptr_t) 0}
Daniel Veillard36169f81998-07-24 19:30:47 +00001063};
1064
1065#ifdef __cplusplus
1066}
1067#endif
1068EOF
1069 # Now try linking the two files.
1070 mv conftest.o conftestm.o
1071 save_LIBS="$LIBS"
1072 save_CFLAGS="$CFLAGS"
1073 LIBS='conftestm.o'
1074 CFLAGS="$CFLAGS$no_builtin_flag"
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001075 if { (eval echo $progname:1075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
Daniel Veillard36169f81998-07-24 19:30:47 +00001076 pipe_works=yes
1077 else
1078 echo "$progname: failed program was:" >&5
1079 cat conftest.c >&5
1080 fi
1081 LIBS="$save_LIBS"
1082 else
1083 echo "cannot find nm_test_func in $nlist" >&5
1084 fi
1085 else
1086 echo "cannot find nm_test_var in $nlist" >&5
1087 fi
1088 else
1089 echo "cannot run $global_symbol_pipe" >&5
1090 fi
1091else
1092 echo "$progname: failed program was:" >&5
1093 cat conftest.c >&5
1094fi
1095$rm conftest*
1096
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001097# Do not use the global_symbol_pipe unless it works.
Daniel Veillard36169f81998-07-24 19:30:47 +00001098echo "$ac_t$pipe_works" 1>&6
1099test "$pipe_works" = yes || global_symbol_pipe=
1100
1101# Check hardcoding attributes.
1102echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
1103hardcode_action=
1104if test -n "$hardcode_libdir_flag_spec" || \
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001105 test -n "$runpath_var"; then
Daniel Veillard36169f81998-07-24 19:30:47 +00001106
1107 # We can hardcode non-existant directories.
1108 if test "$hardcode_direct" != no && \
1109 test "$hardcode_minus_L" != no && \
1110 test "$hardcode_shlibpath_var" != no; then
1111
1112 # Linking always hardcodes the temporary library directory.
1113 hardcode_action=relink
1114 else
1115 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1116 hardcode_action=immediate
1117 fi
Daniel Veillard36169f81998-07-24 19:30:47 +00001118else
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001119 # We cannot hardcode anything, or else we can only hardcode existing
1120 # directories.
1121 hardcode_action=unsupported
Daniel Veillard36169f81998-07-24 19:30:47 +00001122fi
1123echo "$ac_t$hardcode_action" 1>&6
Daniel Veillard36169f81998-07-24 19:30:47 +00001124
1125
1126reload_flag=
1127reload_cmds='$LD$reload_flag -o $output$reload_objs'
1128echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001129# PORTME Some linkers may need a different reload flag.
Daniel Veillard36169f81998-07-24 19:30:47 +00001130reload_flag='-r'
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001131echo "$ac_t$reload_flag" 1>&6
Daniel Veillard36169f81998-07-24 19:30:47 +00001132test -n "$reload_flag" && reload_flag=" $reload_flag"
1133
1134# PORTME Fill in your ld.so characteristics
1135library_names_spec=
1136libname_spec='lib$name'
1137soname_spec=
1138postinstall_cmds=
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001139postuninstall_cmds=
Daniel Veillard36169f81998-07-24 19:30:47 +00001140finish_cmds=
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001141finish_eval=
Daniel Veillard36169f81998-07-24 19:30:47 +00001142shlibpath_var=
1143version_type=none
1144dynamic_linker="$host_os ld.so"
1145
1146echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
1147case "$host_os" in
1148aix3* | aix4*)
1149 version_type=linux
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001150 library_names_spec='${libname}${release}.so$versuffix $libname.a'
Daniel Veillard36169f81998-07-24 19:30:47 +00001151 shlibpath_var=LIBPATH
1152
1153 # AIX has no versioning support, so we append a major version to the name.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001154 soname_spec='${libname}${release}.so$major'
1155 ;;
1156
1157amigaos*)
1158 library_names_spec='$libname.ixlibrary $libname.a'
1159 # Create ${libname}_ixlibrary.a entries in /sys/libs.
1160 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'
Daniel Veillard36169f81998-07-24 19:30:47 +00001161 ;;
1162
Daniel Veillard36169f81998-07-24 19:30:47 +00001163freebsd2* | freebsd3*)
1164 version_type=sunos
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001165 library_names_spec='${libname}${release}.so$versuffix $libname.so'
Daniel Veillard36169f81998-07-24 19:30:47 +00001166 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1167 shlibpath_var=LD_LIBRARY_PATH
1168 ;;
1169
1170gnu*)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001171 version_type=linux
1172 library_names_spec='${libname}${release}.so$versuffix ${libname}.so'
Daniel Veillard36169f81998-07-24 19:30:47 +00001173 shlibpath_var=LD_LIBRARY_PATH
1174 ;;
1175
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001176hpux9* | hpux10* | hpux11*)
Daniel Veillard36169f81998-07-24 19:30:47 +00001177 # Give a soname corresponding to the major version so that dld.sl refuses to
1178 # link against other versions.
1179 dynamic_linker="$host_os dld.sl"
1180 version_type=sunos
1181 shlibpath_var=SHLIB_PATH
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001182 library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
1183 soname_spec='${libname}${release}.sl$major'
Daniel Veillard36169f81998-07-24 19:30:47 +00001184 # HP-UX runs *really* slowly unless shared libraries are mode 555.
1185 postinstall_cmds='chmod 555 $lib'
1186 ;;
1187
1188irix5* | irix6*)
1189 version_type=osf
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001190 soname_spec='${libname}${release}.so'
1191 library_names_spec='${libname}${release}.so$versuffix $libname.so'
Daniel Veillard36169f81998-07-24 19:30:47 +00001192 shlibpath_var=LD_LIBRARY_PATH
1193 ;;
1194
1195# No shared lib support for Linux oldld, aout, or coff.
1196linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
1197 dynamic_linker=no
1198 ;;
1199
1200# This must be Linux ELF.
1201linux-gnu*)
1202 version_type=linux
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001203 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1204 soname_spec='${libname}${release}.so$major'
Daniel Veillard36169f81998-07-24 19:30:47 +00001205 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1206 shlibpath_var=LD_LIBRARY_PATH
1207
1208 if test -f /lib/ld.so.1; then
1209 dynamic_linker='GNU ld.so'
1210 else
1211 # Only the GNU ld.so supports shared libraries on MkLinux.
1212 case "$host_cpu" in
1213 powerpc*) dynamic_linker=no ;;
1214 *) dynamic_linker='Linux ld.so' ;;
1215 esac
1216 fi
1217 ;;
1218
1219netbsd* | openbsd*)
1220 version_type=sunos
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001221 library_names_spec='${libname}${release}.so$versuffix'
Daniel Veillard36169f81998-07-24 19:30:47 +00001222 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1223 shlibpath_var=LD_LIBRARY_PATH
1224 ;;
1225
1226os2*)
1227 libname_spec='$name'
1228 library_names_spec='$libname.dll $libname.a'
1229 dynamic_linker='OS/2 ld.exe'
1230 shlibpath_var=LIBPATH
1231 ;;
1232
1233osf3* | osf4*)
1234 version_type=osf
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001235 soname_spec='${libname}${release}.so'
1236 library_names_spec='${libname}${release}.so$versuffix $libname.so'
Daniel Veillard36169f81998-07-24 19:30:47 +00001237 shlibpath_var=LD_LIBRARY_PATH
1238 ;;
1239
1240sco3.2v5*)
1241 version_type=osf
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001242 soname_spec='${libname}${release}.so$major'
1243 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
Daniel Veillard36169f81998-07-24 19:30:47 +00001244 shlibpath_var=LD_LIBRARY_PATH
1245 ;;
1246
1247solaris2*)
1248 version_type=linux
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001249 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1250 soname_spec='${libname}${release}.so$major'
Daniel Veillard36169f81998-07-24 19:30:47 +00001251 shlibpath_var=LD_LIBRARY_PATH
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001252 # ldd complains unless libraries are executable
1253 postinstall_cmds='chmod +x $lib'
Daniel Veillard36169f81998-07-24 19:30:47 +00001254 ;;
1255
1256sunos4*)
1257 version_type=sunos
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001258 library_names_spec='${libname}${release}.so$versuffix'
Daniel Veillard36169f81998-07-24 19:30:47 +00001259 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1260 shlibpath_var=LD_LIBRARY_PATH
1261 ;;
1262
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001263sysv4.2uw2*)
1264 version_type=linux
1265 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1266 soname_spec='${libname}${release}.so$major'
1267 shlibpath_var=LD_LIBRARY_PATH
1268 ;;
1269
Daniel Veillard36169f81998-07-24 19:30:47 +00001270uts4*)
1271 version_type=linux
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001272 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1273 soname_spec='${libname}${release}.so$major'
Daniel Veillard36169f81998-07-24 19:30:47 +00001274 shlibpath_var=LD_LIBRARY_PATH
1275 ;;
1276
1277*)
1278 dynamic_linker=no
1279 ;;
1280esac
1281echo "$ac_t$dynamic_linker"
1282test "$dynamic_linker" = no && can_build_shared=no
1283
Daniel Veillard36169f81998-07-24 19:30:47 +00001284# Report the final consequences.
1285echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1286
1287echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
1288test "$can_build_shared" = "no" && enable_shared=no
1289
1290# On AIX, shared libraries and static libraries use the same namespace, and
1291# are all built from PIC.
1292case "$host_os" in
1293aix*)
1294 test "$enable_shared" = yes && enable_static=no
1295 if test -n "$RANLIB"; then
1296 archive_cmds="$archive_cmds;\$RANLIB \$lib"
1297 postinstall_cmds='$RANLIB $lib'
1298 fi
1299 ;;
1300esac
1301
1302echo "$ac_t$enable_shared" 1>&6
1303
1304# Make sure either enable_shared or enable_static is yes.
1305test "$enable_shared" = yes || enable_static=yes
1306
1307echo "checking whether to build static libraries... $enable_static" 1>&6
1308
1309echo $ac_n "checking for objdir... $ac_c" 1>&6
1310rm -f .libs 2>/dev/null
1311mkdir .libs 2>/dev/null
1312if test -d .libs; then
1313 objdir=.libs
1314else
1315 # MS-DOS does not allow filenames that begin with a dot.
1316 objdir=_libs
1317fi
1318rmdir .libs 2>/dev/null
1319echo "$ac_t$objdir" 1>&6
1320
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001321# Copy echo and quote the copy, instead of the original, because it is
1322# used later.
1323ltecho="$echo"
1324
Daniel Veillard36169f81998-07-24 19:30:47 +00001325# Now quote all the things that may contain metacharacters.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001326for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
Daniel Veillard36169f81998-07-24 19:30:47 +00001327 old_LN_S AR CC LD LN_S NM reload_flag reload_cmds wl pic_flag \
1328 link_static_flag no_builtin_flag export_dynamic_flag_spec \
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001329 whole_archive_flag_spec libname_spec library_names_spec soname_spec RANLIB \
Daniel Veillard36169f81998-07-24 19:30:47 +00001330 old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001331 old_postuninstall_cmds archive_cmds postinstall_cmds postuninstall_cmds \
1332 allow_undefined_flag no_undefined_flag \
1333 finish_cmds finish_eval global_symbol_pipe \
Daniel Veillard36169f81998-07-24 19:30:47 +00001334 hardcode_libdir_flag_spec hardcode_libdir_separator; do
1335
1336 case "$var" in
1337 reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001338 old_postinstall_cmds | old_postuninstall_cmds | archive_cmds | \
1339 postinstall_cmds | postuninstall_cmds | finish_cmds)
Daniel Veillard36169f81998-07-24 19:30:47 +00001340 # Double-quote double-evaled strings.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001341 eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`"
Daniel Veillard36169f81998-07-24 19:30:47 +00001342 ;;
1343 *)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001344 eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`"
Daniel Veillard36169f81998-07-24 19:30:47 +00001345 ;;
1346 esac
1347done
1348
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001349trap "$rm \"$ofile\"; exit 1" 1 2 15
1350echo "creating $ofile"
1351$rm "$ofile"
1352cat <<EOF > "$ofile"
1353#! $SHELL
Daniel Veillard36169f81998-07-24 19:30:47 +00001354
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001355# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
Daniel Veillard36169f81998-07-24 19:30:47 +00001356# Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001357# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
1358#
1359# Copyright (C) 1996-1998 Free Software Foundation, Inc.
1360# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
1361#
1362# This program is free software; you can redistribute it and/or modify
1363# it under the terms of the GNU General Public License as published by
1364# the Free Software Foundation; either version 2 of the License, or
1365# (at your option) any later version.
1366#
1367# This program is distributed in the hope that it will be useful, but
1368# WITHOUT ANY WARRANTY; without even the implied warranty of
1369# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1370# General Public License for more details.
1371#
1372# You should have received a copy of the GNU General Public License
1373# along with this program; if not, write to the Free Software
1374# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1375#
1376# As a special exception to the GNU General Public License, if you
1377# distribute this file as part of a program that contains a
1378# configuration script generated by Autoconf, you may include it under
1379# the same distribution terms that you use for the rest of that program.
1380
1381# Sed that helps us avoid accidentally triggering echo(1) options like -n.
1382Xsed="sed -e s/^X//"
1383
1384# The HP-UX ksh and POSIX shell print the target directory to stdout
1385# if CDPATH is set.
1386if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
1387
1388### BEGIN LIBTOOL CONFIG
1389# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
Daniel Veillard36169f81998-07-24 19:30:47 +00001390#
1391# CC="$old_CC" CFLAGS="$old_CFLAGS" CPPFLAGS="$old_CPPFLAGS" \\
1392# LD="$old_LD" NM="$old_NM" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\
1393# $0$ltconfig_args
1394#
1395# Compiler and other test output produced by $progname, useful for
1396# debugging $progname, is in ./config.log if it exists.
1397
Daniel Veillard36169f81998-07-24 19:30:47 +00001398# The version of $progname that generated this script.
1399LTCONFIG_VERSION="$VERSION"
1400
1401# Shell to use when invoking shell scripts.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001402SHELL="$SHELL"
Daniel Veillard36169f81998-07-24 19:30:47 +00001403
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001404# Whether or not to build shared libraries.
Daniel Veillard36169f81998-07-24 19:30:47 +00001405build_libtool_libs=$enable_shared
1406
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001407# Whether or not to build static libraries.
Daniel Veillard36169f81998-07-24 19:30:47 +00001408build_old_libs=$enable_static
1409
1410# The host system.
1411host_alias="$host_alias"
1412host="$host"
1413
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001414# An echo program that does not interpret backslashes.
1415echo="$ltecho"
1416
Daniel Veillard36169f81998-07-24 19:30:47 +00001417# The archiver.
1418AR="$AR"
1419
1420# The default C compiler.
1421CC="$CC"
1422
1423# The linker used to build libraries.
1424LD="$LD"
1425
1426# Whether we need hard or soft links.
1427LN_S="$LN_S"
1428
1429# A BSD-compatible nm program.
1430NM="$NM"
1431
1432# The name of the directory that contains temporary libtool files.
1433objdir="$objdir"
1434
1435# How to create reloadable object files.
1436reload_flag="$reload_flag"
1437reload_cmds="$reload_cmds"
1438
1439# How to pass a linker flag through the compiler.
1440wl="$wl"
1441
1442# Additional compiler flags for building library objects.
1443pic_flag="$pic_flag"
1444
1445# Compiler flag to prevent dynamic linking.
1446link_static_flag="$link_static_flag"
1447
1448# Compiler flag to turn off builtin functions.
1449no_builtin_flag="$no_builtin_flag"
1450
1451# Compiler flag to allow reflexive dlopens.
1452export_dynamic_flag_spec="$export_dynamic_flag_spec"
1453
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001454# Compiler flag to generate shared objects directly from archives.
1455whole_archive_flag_spec="$whole_archive_flag_spec"
Daniel Veillard36169f81998-07-24 19:30:47 +00001456
1457# Library versioning type.
1458version_type=$version_type
1459
1460# Format of library name prefix.
1461libname_spec="$libname_spec"
1462
1463# List of archive names. First name is the real one, the rest are links.
1464# The last name is the one that the linker finds with -lNAME.
1465library_names_spec="$library_names_spec"
1466
1467# The coded name of the library, if different from the real name.
1468soname_spec="$soname_spec"
1469
1470# Commands used to build and install an old-style archive.
1471RANLIB="$RANLIB"
1472old_archive_cmds="$old_archive_cmds"
1473old_postinstall_cmds="$old_postinstall_cmds"
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001474old_postuninstall_cmds="$old_postuninstall_cmds"
Daniel Veillard36169f81998-07-24 19:30:47 +00001475
1476# Create an old-style archive from a shared archive.
1477old_archive_from_new_cmds="$old_archive_from_new_cmds"
1478
1479# Commands used to build and install a shared archive.
1480archive_cmds="$archive_cmds"
1481postinstall_cmds="$postinstall_cmds"
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001482postuninstall_cmds="$postuninstall_cmds"
Daniel Veillard36169f81998-07-24 19:30:47 +00001483
1484# Flag that allows shared libraries with undefined symbols to be built.
1485allow_undefined_flag="$allow_undefined_flag"
1486
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001487# Flag that forces no undefined symbols.
1488no_undefined_flag="$no_undefined_flag"
1489
Daniel Veillard36169f81998-07-24 19:30:47 +00001490# Commands used to finish a libtool library installation in a directory.
1491finish_cmds="$finish_cmds"
1492
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001493# Same as above, but a single script fragment to be evaled but not shown.
1494finish_eval="$finish_eval"
1495
Daniel Veillard36169f81998-07-24 19:30:47 +00001496# Take the output of nm and produce a listing of raw symbols and C names.
1497global_symbol_pipe="$global_symbol_pipe"
1498
Daniel Veillard36169f81998-07-24 19:30:47 +00001499# This is the shared library runtime path variable.
1500runpath_var=$runpath_var
1501
1502# This is the shared library path variable.
1503shlibpath_var=$shlibpath_var
1504
1505# How to hardcode a shared library path into an executable.
1506hardcode_action=$hardcode_action
1507
1508# Flag to hardcode \$libdir into a binary during linking.
1509# This must work even if \$libdir does not exist.
1510hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec"
1511
1512# Whether we need a single -rpath flag with a separated argument.
1513hardcode_libdir_separator="$hardcode_libdir_separator"
1514
1515# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
1516# resulting binary.
1517hardcode_direct=$hardcode_direct
1518
1519# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
1520# resulting binary.
1521hardcode_minus_L=$hardcode_minus_L
1522
Daniel Veillard36169f81998-07-24 19:30:47 +00001523# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
1524# the resulting binary.
1525hardcode_shlibpath_var=$hardcode_shlibpath_var
Daniel Veillard36169f81998-07-24 19:30:47 +00001526EOF
1527
1528case "$host_os" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001529aix3*)
1530 cat <<\EOF >> "$ofile"
1531
Daniel Veillard36169f81998-07-24 19:30:47 +00001532# AIX sometimes has problems with the GCC collect2 program. For some
1533# reason, if we set the COLLECT_NAMES environment variable, the problems
1534# vanish in a puff of smoke.
1535if test "${COLLECT_NAMES+set}" != set; then
1536 COLLECT_NAMES=
1537 export COLLECT_NAMES
1538fi
Daniel Veillard36169f81998-07-24 19:30:47 +00001539EOF
1540 ;;
1541esac
1542
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001543echo '### END LIBTOOL CONFIG' >> "$ofile"
1544echo >> "$ofile"
Daniel Veillard36169f81998-07-24 19:30:47 +00001545
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001546# Append the ltmain.sh script.
1547cat "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
Daniel Veillard36169f81998-07-24 19:30:47 +00001548
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001549chmod +x "$ofile"
Daniel Veillard36169f81998-07-24 19:30:47 +00001550exit 0
1551
1552# Local Variables:
1553# mode:shell-script
1554# sh-indentation:2
1555# End: