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