remove empty dir
[ghc-hetmet.git] / ghc / rts / gmp / ltconfig
1 #! /bin/sh
2
3 # ltconfig - Create a system-specific libtool.
4 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
5 # Originally by 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 # Check that we are running under the correct shell.
29 SHELL=${CONFIG_SHELL-/bin/sh}
30 echo=echo
31 if test "X$1" = X--no-reexec; then
32   # Discard the --no-reexec flag, and continue.
33   shift
34 elif test "X$1" = X--fallback-echo; then
35   # Avoid inline document here, it may be left over
36   :
37 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
38   # Yippee, $echo works!
39   :
40 else
41   # Restart under the correct shell.
42   exec "$SHELL" "$0" --no-reexec ${1+"$@"}
43 fi
44
45 if test "X$1" = X--fallback-echo; then
46   # used as fallback echo
47   shift
48   cat <<EOF
49 $*
50 EOF
51   exit 0
52 fi
53
54 # Find the correct PATH separator.  Usually this is `:', but
55 # DJGPP uses `;' like DOS.
56 if test "X${PATH_SEPARATOR+set}" != Xset; then
57   UNAME=${UNAME-`uname 2>/dev/null`}
58   case X$UNAME in
59     *-DOS) PATH_SEPARATOR=';' ;;
60     *)     PATH_SEPARATOR=':' ;;
61   esac
62 fi
63
64 # The HP-UX ksh and POSIX shell print the target directory to stdout
65 # if CDPATH is set.
66 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
67
68 if test "X${echo_test_string+set}" != Xset; then
69   # find a string as large as possible, as long as the shell can cope with it
70   for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
71     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
72     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
73        echo_test_string="`eval $cmd`" &&
74        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then
75       break
76     fi
77   done
78 fi
79
80 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
81    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
82    test "X$echo_testing_string" = "X$echo_test_string"; then
83   :
84 else
85   # The Solaris, AIX, and Digital Unix default echo programs unquote
86   # backslashes.  This makes it impossible to quote backslashes using
87   #   echo "$something" | sed 's/\\/\\\\/g'
88   #
89   # So, first we look for a working echo in the user's PATH.
90
91   IFS="${IFS=   }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
92   for dir in $PATH /usr/ucb; do
93     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
94        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
95        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
96        test "X$echo_testing_string" = "X$echo_test_string"; then
97       echo="$dir/echo"
98       break
99     fi
100   done
101   IFS="$save_ifs"
102
103   if test "X$echo" = Xecho; then
104     # We didn't find a better echo, so look for alternatives.
105     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
106        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
107        test "X$echo_testing_string" = "X$echo_test_string"; then
108       # This shell has a builtin print -r that does the trick.
109       echo='print -r'
110     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
111          test "X$CONFIG_SHELL" != X/bin/ksh; then
112       # If we have ksh, try running ltconfig again with it.
113       ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
114       export ORIGINAL_CONFIG_SHELL
115       CONFIG_SHELL=/bin/ksh
116       export CONFIG_SHELL
117       exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
118     else
119       # Try using printf.
120       echo='printf "%s\n"'
121       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
122          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
123          test "X$echo_testing_string" = "X$echo_test_string"; then
124         # Cool, printf works
125         :
126       elif echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` &&
127            test "X$echo_testing_string" = 'X\t' &&
128            echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
129            test "X$echo_testing_string" = "X$echo_test_string"; then
130         CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL"
131         export CONFIG_SHELL
132         SHELL="$CONFIG_SHELL"
133         export SHELL
134         echo="$CONFIG_SHELL $0 --fallback-echo"
135       elif echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` &&
136            test "X$echo_testing_string" = 'X\t' &&
137            echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
138            test "X$echo_testing_string" = "X$echo_test_string"; then
139         echo="$CONFIG_SHELL $0 --fallback-echo"
140       else
141         # maybe with a smaller string...
142         prev=:
143
144         for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
145           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then
146             break
147           fi
148           prev="$cmd"
149         done
150
151         if test "$prev" != 'sed 50q "$0"'; then
152           echo_test_string=`eval $prev`
153           export echo_test_string
154           exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"}
155         else
156           # Oops.  We lost completely, so just stick with echo.
157           echo=echo
158         fi
159       fi
160     fi
161   fi
162 fi
163
164 # Sed substitution that helps us do robust quoting.  It backslashifies
165 # metacharacters that are still active within double-quoted strings.
166 Xsed='sed -e s/^X//'
167 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
168
169 # Same as above, but do not quote variable references.
170 double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
171
172 # Sed substitution to delay expansion of an escaped shell variable in a
173 # double_quote_subst'ed string.
174 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
175
176 # The name of this program.
177 progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
178
179 # Constants:
180 PROGRAM=ltconfig
181 PACKAGE=libtool
182 VERSION=1.3c
183 TIMESTAMP=" (1.696 2000/03/14 20:22:42)"
184 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
185 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
186 rm="rm -f"
187
188 help="Try \`$progname --help' for more information."
189
190 # Global variables:
191 default_ofile=libtool
192 can_build_shared=yes
193 enable_shared=yes
194 # All known linkers require a `.a' archive for static linking (except M$VC,
195 # which needs '.lib').
196 enable_static=yes
197 enable_fast_install=yes
198 enable_dlopen=unknown
199 enable_win32_dll=no
200 pic_mode=default
201 ltmain=
202 silent=
203 srcdir=
204 ac_config_guess=
205 ac_config_sub=
206 host=
207 build=NONE
208 nonopt=NONE
209 ofile="$default_ofile"
210 verify_host=yes
211 with_gcc=no
212 with_gnu_ld=no
213 need_locks=yes
214 ac_ext=c
215 libext=a
216 cache_file=
217
218 old_AR="$AR"
219 old_CC="$CC"
220 old_CFLAGS="$CFLAGS"
221 old_CPPFLAGS="$CPPFLAGS"
222 old_LDFLAGS="$LDFLAGS"
223 old_LIBS="$LIBS"
224 old_MAGIC="$MAGIC"
225 old_LD="$LD"
226 old_LN_S="$LN_S"
227 old_NM="$NM"
228 old_RANLIB="$RANLIB"
229 old_STRIP="$STRIP"
230 old_AS="$AS"
231 old_DLLTOOL="$DLLTOOL"
232 old_OBJDUMP="$OBJDUMP"
233 old_OBJEXT="$OBJEXT"
234 old_EXEEXT="$EXEEXT"
235 old_reload_Flag="$reload_flag"
236 old_deplibs_check_method="$deplibs_check_method"
237 old_file_magic_cmd="$file_magic_cmd"
238
239 # Parse the command line options.
240 args=
241 prev=
242 for option
243 do
244   case "$option" in
245   -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
246   *) optarg= ;;
247   esac
248
249   # If the previous option needs an argument, assign it.
250   if test -n "$prev"; then
251     eval "$prev=\$option"
252     prev=
253     continue
254   fi
255
256   case "$option" in
257   --help) cat <<EOM
258 Usage: $progname [OPTION]... LTMAIN [HOST]
259
260 Generate a system-specific libtool script.
261
262     --build                configure for building on BUILD [BUILD=HOST]
263     --debug                enable verbose shell tracing
264     --disable-shared       do not build shared libraries
265     --disable-static       do not build static libraries
266     --disable-fast-install do not optimize for fast installation
267     --enable-dlopen        enable dlopen support
268     --enable-win32-dll     enable building dlls on win32 hosts
269     --help                 display this help and exit
270     --no-verify            do not verify that HOST is a valid host type
271 -o, --output=FILE          specify the output file [default=$default_ofile]
272     --quiet                same as \`--silent'
273     --silent               do not print informational messages
274     --srcdir=DIR           find \`config.guess' in DIR
275     --version              output version information and exit
276     --with-gcc             assume that the GNU C compiler will be used
277     --with-gnu-ld          assume that the C compiler uses the GNU linker
278     --prefer-pic           try to use only PIC objects
279     --prefer-non-pic       try to use only non-PIC objects
280     --disable-lock         disable file locking
281     --cache-file=FILE      configure cache file
282
283 LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
284 that provides basic libtool functionality.
285
286 HOST is the canonical host system name [default=guessed].
287 EOM
288   exit 0
289   ;;
290
291   --build) prev=build ;;
292   --build=*) build="$optarg" ;;
293
294   --debug)
295     echo "$progname: enabling shell trace mode"
296     set -x
297     ;;
298
299   --disable-shared) enable_shared=no ;;
300
301   --disable-static) enable_static=no ;;
302
303   --disable-fast-install) enable_fast_install=no ;;
304
305   --enable-dlopen) enable_dlopen=yes ;;
306
307   --enable-win32-dll) enable_win32_dll=yes ;;
308
309   --quiet | --silent) silent=yes ;;
310
311   --srcdir) prev=srcdir ;;
312   --srcdir=*) srcdir="$optarg" ;;
313
314   --no-verify) verify_host=no ;;
315
316   --output | -o) prev=ofile ;;
317   --output=*) ofile="$optarg" ;;
318
319   --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
320
321   --with-gcc) with_gcc=yes ;;
322   --with-gnu-ld) with_gnu_ld=yes ;;
323
324   --prefer-pic) pic_mode=yes ;;
325   --prefer-non-pic) pic_mode=no ;;
326
327   --disable-lock) need_locks=no ;;
328
329   --cache-file=*) cache_file="$optarg" ;;
330
331   -*)
332     echo "$progname: unrecognized option \`$option'" 1>&2
333     echo "$help" 1>&2
334     exit 1
335     ;;
336
337   *)
338     if test -z "$ltmain"; then
339       ltmain="$option"
340     elif test -z "$host"; then
341 # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
342 #      if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
343 #        echo "$progname: warning \`$option' is not a valid host type" 1>&2
344 #      fi
345       host="$option"
346     else
347       echo "$progname: too many arguments" 1>&2
348       echo "$help" 1>&2
349       exit 1
350     fi ;;
351   esac
352 done
353
354 if test -z "$ltmain"; then
355   echo "$progname: you must specify a LTMAIN file" 1>&2
356   echo "$help" 1>&2
357   exit 1
358 fi
359
360 if test ! -f "$ltmain"; then
361   echo "$progname: \`$ltmain' does not exist" 1>&2
362   echo "$help" 1>&2
363   exit 1
364 fi
365
366 # Quote any args containing shell metacharacters.
367 ltconfig_args=
368 for arg
369 do
370   case "$arg" in
371   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
372   ltconfig_args="$ltconfig_args '$arg'" ;;
373   *) ltconfig_args="$ltconfig_args $arg" ;;
374   esac
375 done
376
377 # A relevant subset of AC_INIT.
378
379 # File descriptor usage:
380 # 0 standard input
381 # 1 file creation
382 # 2 errors and warnings
383 # 3 some systems may open it to /dev/tty
384 # 4 used on the Kubota Titan
385 # 5 compiler messages saved in config.log
386 # 6 checking for... messages and results
387 if test "$silent" = yes; then
388   exec 6>/dev/null
389 else
390   exec 6>&1
391 fi
392 exec 5>>./config.log
393
394 # NLS nuisances.
395 # Only set LANG and LC_ALL to C if already set.
396 # These must not be set unconditionally because not all systems understand
397 # e.g. LANG=C (notably SCO).
398 if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi
399 if test "X${LANG+set}"   = Xset; then LANG=C;   export LANG;   fi
400
401 if test -n "$cache_file" && test -r "$cache_file"; then
402   echo "loading cache $cache_file within ltconfig"
403   . $cache_file
404 fi
405
406 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
407   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
408   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
409     ac_n= ac_c='
410 ' ac_t='        '
411   else
412     ac_n=-n ac_c= ac_t=
413   fi
414 else
415   ac_n= ac_c='\c' ac_t=
416 fi
417
418 if test -z "$srcdir"; then
419   # Assume the source directory is the same one as the path to LTMAIN.
420   srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
421   test "$srcdir" = "$ltmain" && srcdir=.
422 fi
423
424 trap "$rm conftest*; exit 1" 1 2 15
425 if test "$verify_host" = yes; then
426   # Check for config.guess and config.sub.
427   ac_aux_dir=
428   for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
429     if test -f $ac_dir/config.guess; then
430       ac_aux_dir=$ac_dir
431       break
432     fi
433   done
434   if test -z "$ac_aux_dir"; then
435     echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
436     echo "$help" 1>&2
437     exit 1
438   fi
439   ac_config_guess=$ac_aux_dir/config.guess
440   ac_config_sub=$ac_aux_dir/config.sub
441
442   # Make sure we can run config.sub.
443   if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
444   else
445     echo "$progname: cannot run $ac_config_sub" 1>&2
446     echo "$help" 1>&2
447     exit 1
448   fi
449
450   echo $ac_n "checking host system type""... $ac_c" 1>&6
451
452   host_alias=$host
453   case "$host_alias" in
454   "")
455     if host_alias=`$SHELL $ac_config_guess`; then :
456     else
457       echo "$progname: cannot guess host type; you must specify one" 1>&2
458       echo "$help" 1>&2
459       exit 1
460     fi ;;
461   esac
462   host=`$SHELL $ac_config_sub $host_alias`
463   echo "$ac_t$host" 1>&6
464
465   # Make sure the host verified.
466   test -z "$host" && exit 1
467
468   # Check for the build system type
469   echo $ac_n "checking build system type... $ac_c" 1>&6
470
471   build_alias=$build
472   case "$build_alias" in
473   NONE)
474     case $nonopt in
475     NONE) build_alias=$host_alias ;;
476     *) build_alias=$nonopt ;;
477     esac ;;
478   esac
479
480   build=`$SHELL $ac_config_sub $build_alias`
481   build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
482   build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
483   build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
484   echo "$ac_t""$build" 1>&6
485
486 elif test -z "$host"; then
487   echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
488   echo "$help" 1>&2
489   exit 1
490 else
491   host_alias=$host
492   build_alias=$host_alias
493   build=$host
494 fi
495
496 if test x"$host" != x"$build"; then
497   ac_tool_prefix=${host_alias}-
498 else
499   ac_tool_prefix=
500 fi
501
502 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
503 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
504 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
505
506 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
507 case "$host_os" in
508 linux-gnu*) ;;
509 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
510 esac
511
512 case "$host_os" in
513 aix3*)
514   # AIX sometimes has problems with the GCC collect2 program.  For some
515   # reason, if we set the COLLECT_NAMES environment variable, the problems
516   # vanish in a puff of smoke.
517   if test "X${COLLECT_NAMES+set}" != Xset; then
518     COLLECT_NAMES=
519     export COLLECT_NAMES
520   fi
521   ;;
522 esac
523
524 # Determine commands to create old-style static archives.
525 old_archive_cmds='$AR cru $oldlib$oldobjs$old_deplibs'
526 old_postinstall_cmds='chmod 644 $oldlib'
527 old_postuninstall_cmds=
528
529 # Set sane defaults for various variables
530 test -z "$AR" && AR=ar
531 test -z "$AS" && AS=as
532 test -z "$CC" && CC=cc
533 test -z "$DLLTOOL" && DLLTOOL=dlltool
534 test -z "$MAGIC" && MAGIC=file
535 test -z "$LD" && LD=ld
536 test -z "$LN_S" && LN_S="ln -s"
537 test -z "$NM" && NM=nm
538 test -z "$OBJDUMP" && OBJDUMP=objdump
539 test -z "$RANLIB" && RANLIB=:
540 test -z "$STRIP" && STRIP=:
541 test -z "$objext" && objext=o
542
543 echo $ac_n "checking for objdir... $ac_c" 1>&6
544 rm -f .libs 2>/dev/null
545 mkdir .libs 2>/dev/null
546 if test -d .libs; then
547   objdir=.libs
548 else
549   # MS-DOS does not allow filenames that begin with a dot.
550   objdir=_libs
551 fi
552 rmdir .libs 2>/dev/null
553 echo "$ac_t$objdir" 1>&6
554
555 # Allow CC to be a program name with arguments.
556 set dummy $CC
557 compiler="$2"
558
559 # We assume here that the value for ac_cv_prog_cc_pic will not be cached
560 # in isolation, and that seeing it set (from the cache) indicates that
561 # the associated values are set (in the cache) correctly too.
562 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
563 echo "$progname:563:checking for $compiler option to produce PIC" 1>&5
564 if test "X${ac_cv_prog_cc_pic+set}" = Xset; then
565   echo $ac_n "(cached) $ac_c" 1>&6
566 else
567   ac_cv_prog_cc_pic=
568   ac_cv_prog_cc_shlib=
569   ac_cv_prog_cc_wl=
570   ac_cv_prog_cc_static=
571   ac_cv_prog_cc_no_builtin=
572   ac_cv_prog_cc_can_build_shared=$can_build_shared
573
574   if test "$with_gcc" = yes; then
575     ac_cv_prog_cc_wl='-Wl,'
576     ac_cv_prog_cc_static='-static'
577
578     case "$host_os" in
579     beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
580       # PIC is the default for these OSes.
581       ;;
582     aix*)
583       # Below there is a dirty hack to force normal static linking with -ldl
584       # The problem is because libdl dynamically linked with both libc and
585       # libC (AIX C++ library), which obviously doesn't included in libraries
586       # list by gcc. This cause undefined symbols with -static flags.
587       # This hack allows C programs to be linked with "-static -ldl", but
588       # we not sure about C++ programs.
589       ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
590       ;;
591     cygwin* | mingw* | os2*)
592       # This hack is so that the source file can tell whether it is being
593       # built for inclusion in a dll (and should export symbols for example).
594       ac_cv_prog_cc_pic='-DDLL_EXPORT'
595       ;;
596     amigaos*)
597       # FIXME: we need at least 68020 code to build shared libraries, but
598       # adding the `-m68020' flag to GCC prevents building anything better,
599       # like `-m68040'.
600       ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
601       ;;
602     sysv4*MP*)
603       if test -d /usr/nec; then
604          ac_cv_prog_cc_pic=-Kconform_pic
605       fi
606       ;;
607     *)
608       ac_cv_prog_cc_pic='-fPIC'
609       ;;
610     esac
611   else
612     # PORTME Check for PIC flags for the system compiler.
613     case "$host_os" in
614     aix3* | aix4*)
615      # All AIX code is PIC.
616       ac_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
617       ;;
618
619     hpux9* | hpux10* | hpux11*)
620       # Is there a better ac_cv_prog_cc_static that works with the bundled CC?
621       ac_cv_prog_cc_wl='-Wl,'
622       ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
623       ac_cv_prog_cc_pic='+Z'
624       ;;
625
626     irix5* | irix6*)
627       ac_cv_prog_cc_wl='-Wl,'
628       ac_cv_prog_cc_static='-non_shared'
629       # PIC (with -KPIC) is the default.
630       ;;
631
632     cygwin* | mingw* | os2*)
633       # This hack is so that the source file can tell whether it is being
634       # built for inclusion in a dll (and should export symbols for example).
635       ac_cv_prog_cc_pic='-DDLL_EXPORT'
636       ;;
637
638     osf3* | osf4* | osf5*)
639       # All OSF/1 code is PIC.
640       ac_cv_prog_cc_wl='-Wl,'
641       ac_cv_prog_cc_static='-non_shared'
642       ;;
643
644     sco3.2v5*)
645       ac_cv_prog_cc_pic='-Kpic'
646       ac_cv_prog_cc_static='-dn'
647       ac_cv_prog_cc_shlib='-belf'
648       ;;
649
650     solaris*)
651       ac_cv_prog_cc_pic='-KPIC'
652       ac_cv_prog_cc_static='-Bstatic'
653       ac_cv_prog_cc_wl='-Wl,'
654       ;;
655
656     sunos4*)
657       ac_cv_prog_cc_pic='-PIC'
658       ac_cv_prog_cc_static='-Bstatic'
659       ac_cv_prog_cc_wl='-Qoption ld '
660       ;;
661
662     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
663       ac_cv_prog_cc_pic='-KPIC'
664       ac_cv_prog_cc_static='-Bstatic'
665       ac_cv_prog_cc_wl='-Wl,'
666       ;;
667
668     uts4*)
669       ac_cv_prog_cc_pic='-pic'
670       ac_cv_prog_cc_static='-Bstatic'
671       ;;
672
673     sysv4*MP*)
674       if test -d /usr/nec ;then
675         ac_cv_prog_cc_pic='-Kconform_pic'
676         ac_cv_prog_cc_static='-Bstatic'
677       fi
678       ;;
679
680     *)
681       ac_cv_prog_cc_can_build_shared=no
682       ;;
683     esac
684   fi
685 fi
686 if test -z "$ac_cv_prog_cc_pic"; then
687   echo "$ac_t"none 1>&6
688 else
689   echo "$ac_t""$ac_cv_prog_cc_pic" 1>&6
690
691   # Check to make sure the pic_flag actually works.
692   echo $ac_n "checking if $compiler PIC flag $ac_cv_prog_cc_pic works... $ac_c" 1>&6
693   echo "$progname:693:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5
694   if test "X${ac_cv_prog_cc_pic_works+set}" = Xset; then
695     echo $ac_n "(cached) $ac_c" 1>&6
696   else
697     ac_cv_prog_cc_pic_works=yes
698     $rm conftest*
699     echo "int some_variable = 0;" > conftest.c
700     save_CFLAGS="$CFLAGS"
701     CFLAGS="$CFLAGS $ac_cv_prog_cc_pic -DPIC"
702     if { (eval echo $progname:702: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
703       # Append any warnings to the config.log.
704       cat conftest.err 1>&5
705
706       case "$host_os" in
707       hpux9* | hpux10* | hpux11*)
708         # On HP-UX, both CC and GCC only warn that PIC is supported... then
709         # they create non-PIC objects.  So, if there were any warnings, we
710         # assume that PIC is not supported.
711         if test -s conftest.err; then
712           ac_cv_prog_cc_pic_works=no
713           ac_cv_prog_cc_can_build_shared=no
714           ac_cv_prog_cc_pic=
715         else
716           ac_cv_prog_cc_pic_works=yes
717           ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic"
718         fi
719         ;;
720       *)
721         ac_cv_prog_cc_pic_works=yes
722         ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic"
723         ;;
724       esac
725     else
726       # Append any errors to the config.log.
727       cat conftest.err 1>&5
728       ac_cv_prog_cc_pic_works=no
729       ac_cv_prog_cc_can_build_shared=no
730       ac_cv_prog_cc_pic=
731     fi
732     CFLAGS="$save_CFLAGS"
733     $rm conftest*
734   fi
735   # Belt *and* braces to stop my trousers falling down:
736   if test "X$ac_cv_prog_cc_pic_works" = Xno; then
737     ac_cv_prog_cc_pic=
738     ac_cv_prog_cc_can_build_shared=no
739   fi
740   echo "$ac_t""$ac_cv_prog_cc_pic_works" 1>&6
741 fi
742
743 # Check for any special shared library compilation flags.
744 if test -n "$ac_cv_prog_cc_shlib"; then
745   echo "$progname: warning: \`$CC' requires \`$ac_cv_prog_cc_shlib' to build shared libraries" 1>&2
746   if echo "$old_CC $old_CFLAGS " | egrep -e "[  ]$ac_cv_prog_cc_shlib[  ]" >/dev/null; then :
747   else
748     echo "$progname: add \`$ac_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
749     ac_cv_prog_cc_can_build_shared=no
750   fi
751 fi
752
753 echo $ac_n "checking if $compiler static flag $ac_cv_prog_cc_static works... $ac_c" 1>&6
754 echo "$progname:754: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5
755 if test "X${ac_cv_prog_cc_static_works+set}" = Xset; then
756   echo $ac_n "(cached) $ac_c" 1>&6
757 else
758   $rm conftest*
759   echo 'main(){return(0);}' > conftest.c
760   save_LDFLAGS="$LDFLAGS"
761   LDFLAGS="$LDFLAGS $ac_cv_prog_cc_static"
762   if { (eval echo $progname:762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
763     ac_cv_prog_cc_static_works=yes
764   else
765     ac_cv_prog_cc_static_works=no
766     ac_cv_prog_cc_static=
767   fi
768   LDFLAGS="$save_LDFLAGS"
769   $rm conftest*
770 fi
771 # Belt *and* braces to stop my trousers falling down:
772 if test "X$ac_cv_prog_cc_static_works" = Xno; then
773   ac_cv_prog_cc_static=
774 fi
775 echo "$ac_t""$ac_cv_prog_cc_static_works" 1>&6
776 pic_flag="$ac_cv_prog_cc_pic"
777 special_shlib_compile_flags="$ac_cv_prog_cc_shlib"
778 wl="$ac_cv_prog_cc_wl"
779 link_static_flag="$ac_cv_prog_cc_static"
780 no_builtin_flag="$ac_cv_prog_cc_no_builtin"
781 can_build_shared="$ac_cv_prog_cc_can_build_shared"
782
783 # Check to see if options -o and -c are simultaneously supported by compiler
784 echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
785 $rm -r conftest 2>/dev/null
786 mkdir conftest
787 cd conftest
788 $rm conftest*
789 echo "int some_variable = 0;" > conftest.c
790 mkdir out
791 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
792 # that will create temporary files in the current directory regardless of
793 # the output directory.  Thus, making CWD read-only will cause this test
794 # to fail, enabling locking or at least warning the user not to do parallel
795 # builds.
796 chmod -w .
797 save_CFLAGS="$CFLAGS"
798 CFLAGS="$CFLAGS -o out/conftest2.o"
799 echo "$progname:799: checking if $compiler supports -c -o file.o" >&5
800 if { (eval echo $progname:800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then
801
802   # The compiler can only warn and ignore the option if not recognized
803   # So say no if there are warnings
804     if test -s out/conftest.err; then
805       echo "$ac_t"no 1>&6
806       compiler_c_o=no
807     else
808       echo "$ac_t"yes 1>&6
809       compiler_c_o=yes
810     fi
811 else
812   # Append any errors to the config.log.
813   cat out/conftest.err 1>&5
814   compiler_c_o=no
815   echo "$ac_t"no 1>&6
816 fi
817 CFLAGS="$save_CFLAGS"
818 chmod u+w .
819 $rm conftest* out/*
820 rmdir out
821 cd ..
822 rmdir conftest
823 $rm -r conftest 2>/dev/null
824
825 if test x"$compiler_c_o" = x"yes"; then
826   # Check to see if we can write to a .lo
827   echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
828   $rm conftest*
829   echo "int some_variable = 0;" > conftest.c
830   save_CFLAGS="$CFLAGS"
831   CFLAGS="$CFLAGS -c -o conftest.lo"
832   echo "$progname:832: checking if $compiler supports -c -o file.lo" >&5
833 if { (eval echo $progname:833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
834
835     # The compiler can only warn and ignore the option if not recognized
836     # So say no if there are warnings
837       if test -s conftest.err; then
838         echo "$ac_t"no 1>&6
839         compiler_o_lo=no
840       else
841         echo "$ac_t"yes 1>&6
842         compiler_o_lo=yes
843       fi
844   else
845     # Append any errors to the config.log.
846     cat conftest.err 1>&5
847     compiler_o_lo=no
848     echo "$ac_t"no 1>&6
849   fi
850   CFLAGS="$save_CFLAGS"
851   $rm conftest*
852 else
853   compiler_o_lo=no
854 fi
855
856 # Check to see if we can do hard links to lock some files if needed
857 hard_links="nottested"
858 if test "$compiler_c_o" = no && test "$need_locks" != no; then
859   # do not overwrite the value of need_locks provided by the user
860   echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
861   hard_links=yes
862   $rm conftest*
863   ln conftest.a conftest.b 2>/dev/null && hard_links=no
864   touch conftest.a
865   ln conftest.a conftest.b 2>&5 || hard_links=no
866   ln conftest.a conftest.b 2>/dev/null && hard_links=no
867   echo "$ac_t$hard_links" 1>&6
868   $rm conftest*
869   if test "$hard_links" = no; then
870     echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
871     need_locks=warn
872   fi
873 else
874   need_locks=no
875 fi
876
877 if test "$with_gcc" = yes; then
878   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
879   echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
880   $rm conftest*
881   echo "int some_variable = 0;" > conftest.c
882   save_CFLAGS="$CFLAGS"
883   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
884   echo "$progname:884: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
885   if { (eval echo $progname:885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
886
887     # The compiler can only warn and ignore the option if not recognized
888     # So say no if there are warnings
889       if test -s conftest.err; then
890         echo "$ac_t"no 1>&6
891         compiler_rtti_exceptions=no
892       else
893         echo "$ac_t"yes 1>&6
894         compiler_rtti_exceptions=yes
895       fi
896   else
897     # Append any errors to the config.log.
898     cat conftest.err 1>&5
899     compiler_rtti_exceptions=no
900     echo "$ac_t"no 1>&6
901   fi
902   CFLAGS="$save_CFLAGS"
903   $rm conftest*
904
905   if test "$compiler_rtti_exceptions" = "yes"; then
906     no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
907   else
908     no_builtin_flag=' -fno-builtin'
909   fi
910
911 fi
912
913 # See if the linker supports building shared libraries.
914 echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
915
916 allow_undefined_flag=
917 no_undefined_flag=
918 need_lib_prefix=unknown
919 need_version=unknown
920 # when you set need_version to no, make sure it does not cause -set_version
921 # flags to be left without arguments
922 archive_cmds=
923 archive_expsym_cmds=
924 old_archive_from_new_cmds=
925 old_archive_from_expsyms_cmds=
926 striplib=
927 old_striplib=
928 export_dynamic_flag_spec=
929 whole_archive_flag_spec=
930 thread_safe_flag_spec=
931 hardcode_into_libs=no
932 hardcode_libdir_flag_spec=
933 hardcode_libdir_separator=
934 hardcode_direct=no
935 hardcode_minus_L=no
936 hardcode_shlibpath_var=unsupported
937 runpath_var=
938 link_all_deplibs=unknown
939 always_export_symbols=no
940 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
941 # include_expsyms should be a list of space-separated symbols to be *always*
942 # included in the symbol list
943 include_expsyms=
944 # exclude_expsyms can be an egrep regular expression of symbols to exclude
945 # it will be wrapped by ` (' and `)$', so one must not match beginning or
946 # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
947 # as well as any symbol that contains `d'.
948 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
949 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
950 # platforms (ab)use it in PIC code, but their linkers get confused if
951 # the symbol is explicitly referenced.  Since portable code cannot
952 # rely on this symbol name, it's probably fine to never include it in
953 # preloaded symbol tables.
954 extract_expsyms_cmds=
955
956 case "$host_os" in
957 cygwin* | mingw*)
958   # FIXME: the MSVC++ port hasn't been tested in a loooong time
959   # When not using gcc, we currently assume that we are using
960   # Microsoft Visual C++.
961   if test "$with_gcc" != yes; then
962     with_gnu_ld=no
963   fi
964   ;;
965
966 esac
967
968 ld_shlibs=yes
969 if test "$with_gnu_ld" = yes; then
970   # If archive_cmds runs LD, not CC, wlarc should be empty
971   wlarc='${wl}'
972
973   # See if GNU ld supports shared libraries.
974   case "$host_os" in
975   aix3* | aix4*)
976     # On AIX, the GNU linker is very broken
977     ld_shlibs=no
978     cat <<EOF 1>&2
979
980 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
981 *** to be unable to reliably create shared libraries on AIX.
982 *** Therefore, libtool is disabling shared libraries support.  If you
983 *** really care for shared libraries, you may want to modify your PATH
984 *** so that a non-GNU linker is found, and then restart.
985
986 EOF
987     ;;
988
989   amigaos*)
990     archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
991     hardcode_libdir_flag_spec='-L$libdir'
992     hardcode_minus_L=yes
993
994     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
995     # that the semantics of dynamic libraries on AmigaOS, at least up
996     # to version 4, is to share data among multiple programs linked
997     # with the same dynamic library.  Since this doesn't match the
998     # behavior of shared libraries on other platforms, we can use
999     # them.
1000     ld_shlibs=no
1001     ;;
1002
1003   beos*)
1004     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1005       allow_undefined_flag=unsupported
1006       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
1007       # support --undefined.  This deserves some investigation.  FIXME
1008       archive_cmds='$CC -nostart $libobjs $deplibs $linker_flags ${wl}-soname $wl$soname -o $lib'
1009     else
1010       ld_shlibs=no
1011     fi
1012     ;;
1013
1014   cygwin* | mingw*)
1015     # hardcode_libdir_flag_spec is actually meaningless, as there is
1016     # no search path for DLLs.
1017     hardcode_libdir_flag_spec='-L$libdir'
1018     allow_undefined_flag=unsupported
1019     always_export_symbols=yes
1020
1021     extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
1022       sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~
1023       test -f $output_objdir/impgen.exe || (cd $output_objdir && \
1024       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
1025       else $CC -o impgen impgen.c ; fi)~
1026       $output_objdir/impgen $dir/$soname > $output_objdir/$soname-def'
1027
1028     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
1029
1030     # cygwin and mingw dlls have different entry points and sets of symbols
1031     # to exclude.
1032     # FIXME: what about values for MSVC?
1033     dll_entry=__cygwin_dll_entry@12
1034     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
1035     case "$host_os" in
1036     mingw*)
1037       # mingw values
1038       dll_entry=_DllMainCRTStartup@12
1039       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
1040       ;;
1041     esac
1042
1043     # mingw and cygwin differ, and it's simplest to just exclude the union
1044     # of the two symbol sets.
1045     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
1046
1047     # recent cygwin and mingw systems supply a stub DllMain which the user
1048     # can override, but on older systems we have to supply one (in ltdll.c)
1049     if test "x$lt_cv_need_dllmain" = "xyes"; then
1050       ltdll_obj='$output_objdir/$soname-ltdll.'"$objext "
1051       ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/$soname-ltdll.c~
1052         test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
1053     else
1054       ltdll_obj=
1055       ltdll_cmds=
1056     fi
1057
1058     # Extract the symbol export list from an `--export-all' def file,
1059     # then regenerate the def file from the symbol export list, so that
1060     # the compiled dll only exports the symbol export list.
1061     # Be careful not to strip the DATA tag left be newer dlltools.
1062     export_symbols_cmds="$ltdll_cmds"'
1063       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
1064       sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
1065
1066     # If DATA tags from a recent dlltool are present, honour them!
1067     archive_expsym_cmds='echo EXPORTS > $output_objdir/$soname-def~
1068       _lt_hint=1;
1069       cat $export_symbols | while read symbol; do
1070         set dummy \$symbol;
1071         case \$# in
1072           2) echo "     \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
1073           *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
1074         esac;
1075         _lt_hint=`expr 1 + \$_lt_hint`;
1076       done~
1077       '"$ltdll_cmds"'
1078       $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~
1079       $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
1080       $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~
1081       $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
1082       $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags'
1083     ;;
1084
1085   netbsd*)
1086     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1087       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1088       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1089     else
1090       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
1091     fi
1092     ;;
1093
1094   solaris* | sysv5*)
1095     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
1096       ld_shlibs=no
1097       cat <<EOF 1>&2
1098
1099 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
1100 *** create shared libraries on Solaris systems.  Therefore, libtool
1101 *** is disabling shared libraries support.  We urge you to upgrade GNU
1102 *** binutils to release 2.9.1 or newer.  Another option is to modify
1103 *** your PATH or compiler configuration so that the native linker is
1104 *** used, and then restart.
1105
1106 EOF
1107     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1108       archive_cmds='$CC -shared $libobjs $deplibs $linker_flags ${wl}-soname $wl$soname -o $lib'
1109       archive_expsym_cmds='$CC -shared $libobjs $deplibs $linker_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1110     else
1111       ld_shlibs=no
1112     fi
1113     ;;
1114
1115   sunos4*)
1116     archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1117     wlarc=
1118     hardcode_direct=yes
1119     hardcode_shlibpath_var=no
1120     ;;
1121
1122   *)
1123     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1124       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1125       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1126     else
1127       ld_shlibs=no
1128     fi
1129     ;;
1130   esac
1131
1132   if test "$ld_shlibs" = yes; then
1133     runpath_var=LD_RUN_PATH
1134     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
1135     export_dynamic_flag_spec='${wl}--export-dynamic'
1136     case $host_os in
1137     cygwin* | mingw*)
1138       # dlltool doesn't understand --whole-archive et. al.
1139       whole_archive_flag_spec=
1140       ;;
1141     *)
1142       # ancient GNU ld didn't support --whole-archive et. al.
1143       if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
1144         whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
1145       else
1146         whole_archive_flag_spec=
1147       fi
1148       ;;
1149     esac
1150   fi
1151 else
1152   # PORTME fill in a description of your system's linker (not GNU ld)
1153   case "$host_os" in
1154   aix3*)
1155     allow_undefined_flag=unsupported
1156     always_export_symbols=yes
1157     archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $output_objdir/$soname'
1158     # Note: this linker hardcodes the directories in LIBPATH if there
1159     # are no directories specified by -L.
1160     hardcode_minus_L=yes
1161     if test "$with_gcc" = yes && test -z "$link_static_flag"; then
1162       # Neither direct hardcoding nor static linking is supported with a
1163       # broken collect2.
1164       hardcode_direct=unsupported
1165     fi
1166     ;;
1167
1168   aix4*)
1169     hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
1170     hardcode_libdir_separator=':'
1171     if test "$with_gcc" = yes; then
1172       collect2name=`${CC} -print-prog-name=collect2`
1173       if test -f "$collect2name" && \
1174          strings "$collect2name" | grep resolve_lib_name >/dev/null
1175       then
1176         # We have reworked collect2
1177         hardcode_direct=yes
1178       else
1179         # We have old collect2
1180         hardcode_direct=unsupported
1181         # It fails to find uninstalled libraries when the uninstalled
1182         # path is not listed in the libpath.  Setting hardcode_minus_L
1183         # to unsupported forces relinking
1184         hardcode_minus_L=yes
1185         hardcode_libdir_flag_spec='-L$libdir'
1186         hardcode_libdir_separator=
1187       fi
1188       shared_flag='-shared'
1189     else
1190       shared_flag='${wl}-bM:SRE'
1191       hardcode_direct=yes
1192     fi
1193     allow_undefined_flag=' ${wl}-berok'
1194     archive_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
1195     archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
1196     case "$host_os" in aix4.[01]|aix4.[01].*)
1197       # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
1198       always_export_symbols=yes ;;
1199     esac
1200    ;;
1201
1202   amigaos*)
1203     archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
1204     hardcode_libdir_flag_spec='-L$libdir'
1205     hardcode_minus_L=yes
1206     # see comment about different semantics on the GNU ld section
1207     ld_shlibs=no
1208     ;;
1209
1210   cygwin* | mingw*)
1211     # When not using gcc, we currently assume that we are using
1212     # Microsoft Visual C++.
1213     # hardcode_libdir_flag_spec is actually meaningless, as there is
1214     # no search path for DLLs.
1215     hardcode_libdir_flag_spec=' '
1216     allow_undefined_flag=unsupported
1217     # Tell ltmain to make .lib files, not .a files.
1218     libext=lib
1219     # FIXME: Setting linknames here is a bad hack.
1220     archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
1221     # The linker will automatically build a .lib file if we build a DLL.
1222     old_archive_from_new_cmds='true'
1223     # FIXME: Should let the user specify the lib program.
1224     old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
1225     fix_srcfile_path='`cygpath -w $srcfile`'
1226     ;;
1227
1228   freebsd1*)
1229     ld_shlibs=no
1230     ;;
1231
1232   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
1233   # support.  Future versions do this automatically, but an explicit c++rt0.o
1234   # does not break anything, and helps significantly (at the cost of a little
1235   # extra space).
1236   freebsd2.2*)
1237     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
1238     hardcode_libdir_flag_spec='-R$libdir'
1239     hardcode_direct=yes
1240     hardcode_shlibpath_var=no
1241     ;;
1242
1243   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
1244   freebsd2*)
1245     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1246     hardcode_direct=yes
1247     hardcode_minus_L=yes
1248     hardcode_shlibpath_var=no
1249     ;;
1250
1251   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
1252   freebsd*)
1253     archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
1254     hardcode_libdir_flag_spec='-R$libdir'
1255     hardcode_direct=yes
1256     hardcode_shlibpath_var=no
1257     ;;
1258
1259   hpux9* | hpux10* | hpux11*)
1260     case "$host_os" in
1261     hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
1262     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
1263     esac
1264     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
1265     hardcode_libdir_separator=:
1266     hardcode_direct=yes
1267     hardcode_minus_L=yes # Not in the search PATH, but as the default
1268                          # location of the library.
1269     export_dynamic_flag_spec='${wl}-E'
1270     ;;
1271
1272   irix5* | irix6*)
1273     if test "$with_gcc" = yes; then
1274       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1275     else
1276       archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
1277     fi
1278     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1279     hardcode_libdir_separator=:
1280     link_all_deplibs=yes
1281     ;;
1282
1283   netbsd*)
1284     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1285       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
1286     else
1287       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
1288     fi
1289     hardcode_libdir_flag_spec='${wl}-R$libdir'
1290     hardcode_direct=yes
1291     hardcode_shlibpath_var=no
1292     ;;
1293
1294   openbsd*)
1295     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1296     hardcode_libdir_flag_spec='-R$libdir'
1297     hardcode_direct=yes
1298     hardcode_shlibpath_var=no
1299     ;;
1300
1301   os2*)
1302     hardcode_libdir_flag_spec='-L$libdir'
1303     hardcode_minus_L=yes
1304     allow_undefined_flag=unsupported
1305     archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
1306     old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
1307     ;;
1308
1309   osf3*)
1310     if test "$with_gcc" = yes; then
1311       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1312       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1313     else
1314       allow_undefined_flag=' -expect_unresolved \*'
1315       archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
1316     fi
1317     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1318     hardcode_libdir_separator=:
1319     ;;
1320
1321   osf4* | osf5*)        # as osf3* with the addition of -msym flag
1322     if test "$with_gcc" = yes; then
1323       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1324       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1325     else
1326       allow_undefined_flag=' -expect_unresolved \*'
1327       archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
1328     fi
1329     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1330     hardcode_libdir_separator=:
1331     ;;
1332
1333   sco3.2v5*)
1334     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1335     hardcode_shlibpath_var=no
1336     runpath_var=LD_RUN_PATH
1337     hardcode_runpath_var=yes
1338     ;;
1339
1340   solaris*)
1341     no_undefined_flag=' -z text'
1342     # $CC -shared without GNU ld will not create a library from C++
1343     # object files and a static libstdc++, better avoid it by now
1344     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
1345     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
1346                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
1347     hardcode_libdir_flag_spec='-R$libdir'
1348     hardcode_shlibpath_var=no
1349     case "$host_os" in
1350     solaris2.[0-5] | solaris2.[0-5].*) ;;
1351     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
1352       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
1353     esac
1354     link_all_deplibs=yes
1355     ;;
1356
1357   sunos4*)
1358     archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
1359     hardcode_libdir_flag_spec='-L$libdir'
1360     hardcode_direct=yes
1361     hardcode_minus_L=yes
1362     hardcode_shlibpath_var=no
1363     ;;
1364
1365   sysv4)
1366     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1367     runpath_var='LD_RUN_PATH'
1368     hardcode_shlibpath_var=no
1369     hardcode_direct=no #Motorola manual says yes, but my tests say they lie
1370     ;;
1371
1372   sysv4.3*)
1373     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1374     hardcode_shlibpath_var=no
1375     export_dynamic_flag_spec='-Bexport'
1376     ;;
1377
1378   sysv5*)
1379     no_undefined_flag=' -z text'
1380     # $CC -shared without GNU ld will not create a library from C++
1381     # object files and a static libstdc++, better avoid it by now
1382     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
1383     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
1384                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
1385     hardcode_libdir_flag_spec=
1386     hardcode_shlibpath_var=no
1387     runpath_var='LD_RUN_PATH'
1388     ;;
1389
1390   uts4*)
1391     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1392     hardcode_libdir_flag_spec='-L$libdir'
1393     hardcode_shlibpath_var=no
1394     ;;
1395
1396   dgux*)
1397     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1398     hardcode_libdir_flag_spec='-L$libdir'
1399     hardcode_shlibpath_var=no
1400     ;;
1401
1402   sysv4*MP*)
1403     if test -d /usr/nec; then
1404       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1405       hardcode_shlibpath_var=no
1406       runpath_var=LD_RUN_PATH
1407       hardcode_runpath_var=yes
1408       ld_shlibs=yes
1409     fi
1410     ;;
1411
1412   sysv4.2uw2*)
1413     archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
1414     hardcode_direct=yes
1415     hardcode_minus_L=no
1416     hardcode_shlibpath_var=no
1417     hardcode_runpath_var=yes
1418     runpath_var=LD_RUN_PATH
1419     ;;
1420
1421   unixware7*)
1422     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
1423     runpath_var='LD_RUN_PATH'
1424     hardcode_shlibpath_var=no
1425     ;;
1426
1427   *)
1428     ld_shlibs=no
1429     ;;
1430   esac
1431 fi
1432 echo "$ac_t$ld_shlibs" 1>&6
1433 test "$ld_shlibs" = no && can_build_shared=no
1434
1435 # Check hardcoding attributes.
1436 echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
1437 hardcode_action=
1438 if test -n "$hardcode_libdir_flag_spec" || \
1439    test -n "$runpath_var"; then
1440
1441   # We can hardcode non-existant directories.
1442   if test "$hardcode_direct" != no &&
1443      # If the only mechanism to avoid hardcoding is shlibpath_var, we
1444      # have to relink, otherwise we might link with an installed library
1445      # when we should be linking with a yet-to-be-installed one
1446      ## test "$hardcode_shlibpath_var" != no &&
1447      test "$hardcode_minus_L" != no; then
1448     # Linking always hardcodes the temporary library directory.
1449     hardcode_action=relink
1450   else
1451     # We can link without hardcoding, and we can hardcode nonexisting dirs.
1452     hardcode_action=immediate
1453   fi
1454 else
1455   # We cannot hardcode anything, or else we can only hardcode existing
1456   # directories.
1457   hardcode_action=unsupported
1458 fi
1459 echo "$ac_t$hardcode_action" 1>&6
1460
1461 echo $ac_n "checking whether stripping libraries is possible... $ac_c" 1>&6
1462 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
1463   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
1464   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
1465   echo "${ac_t}yes" 1>&6
1466 else
1467   echo "${ac_t}no" 1>&6
1468 fi
1469
1470 reload_cmds='$LD$reload_flag -o $output$reload_objs'
1471 test -z "$deplibs_check_method" && deplibs_check_method=unknown
1472
1473 # PORTME Fill in your ld.so characteristics
1474 library_names_spec=
1475 libname_spec='lib$name'
1476 soname_spec=
1477 postinstall_cmds=
1478 postuninstall_cmds=
1479 finish_cmds=
1480 finish_eval=
1481 shlibpath_var=
1482 shlibpath_overrides_runpath=unknown
1483 version_type=none
1484 dynamic_linker="$host_os ld.so"
1485 sys_lib_dlsearch_path_spec="/lib /usr/lib"
1486 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
1487
1488 echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
1489 case "$host_os" in
1490 aix3*)
1491   version_type=linux
1492   library_names_spec='${libname}${release}.so$versuffix $libname.a'
1493   shlibpath_var=LIBPATH
1494
1495   # AIX has no versioning support, so we append a major version to the name.
1496   soname_spec='${libname}${release}.so$major'
1497   ;;
1498
1499 aix4*)
1500   version_type=linux
1501   # AIX has no versioning support, so currently we can not hardcode correct
1502   # soname into executable. Probably we can add versioning support to
1503   # collect2, so additional links can be useful in future.
1504   # We preserve .a as extension for shared libraries though AIX4.2
1505   # and later linker supports .so
1506   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a'
1507   shlibpath_var=LIBPATH
1508   ;;
1509
1510 amigaos*)
1511   library_names_spec='$libname.ixlibrary $libname.a'
1512   # Create ${libname}_ixlibrary.a entries in /sys/libs.
1513   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'
1514   ;;
1515
1516 beos*)
1517   library_names_spec='${libname}.so'
1518   dynamic_linker="$host_os ld.so"
1519   shlibpath_var=LIBRARY_PATH
1520   lt_cv_dlopen="load_add_on"
1521   lt_cv_dlopen_libs=
1522   lt_cv_dlopen_self=yes
1523   ;;
1524
1525 bsdi4*)
1526   version_type=linux
1527   need_version=no
1528   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1529   soname_spec='${libname}${release}.so$major'
1530   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
1531   shlibpath_var=LD_LIBRARY_PATH
1532   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
1533   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
1534   export_dynamic_flag_spec=-rdynamic
1535   # the default ld.so.conf also contains /usr/contrib/lib and
1536   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
1537   # libtool to hard-code these into programs
1538   ;;
1539
1540 cygwin* | mingw*)
1541   version_type=windows
1542   need_version=no
1543   need_lib_prefix=no
1544   if test "$with_gcc" = yes; then
1545     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
1546   else
1547     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
1548   fi
1549   dynamic_linker='Win32 ld.exe'
1550   # FIXME: first we should search . and the directory the executable is in
1551   shlibpath_var=PATH
1552   lt_cv_dlopen="LoadLibrary"
1553   lt_cv_dlopen_libs=
1554   ;;
1555
1556 freebsd1*)
1557   dynamic_linker=no
1558   ;;
1559
1560 freebsd*)
1561   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
1562   version_type=freebsd-$objformat
1563   case "$version_type" in
1564     freebsd-elf*)
1565       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1566       need_version=no
1567       need_lib_prefix=no
1568       ;;
1569     freebsd-*)
1570       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
1571       need_version=yes
1572       ;;
1573   esac
1574   shlibpath_var=LD_LIBRARY_PATH
1575   case "$host_os" in
1576   freebsd2*)
1577     shlibpath_overrides_runpath=yes
1578     ;;
1579   freebsd3.[01]* | freebsdelf3.[01]*)
1580     shlibpath_overrides_runpath=yes
1581     hardcode_into_libs=yes
1582     ;;
1583   *) # from 3.2 on
1584     shlibpath_overrides_runpath=no
1585     hardcode_into_libs=yes
1586     ;;
1587   esac
1588   ;;
1589
1590 gnu*)
1591   version_type=linux
1592   need_lib_prefix=no
1593   need_version=no
1594   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
1595   soname_spec='${libname}${release}.so$major'
1596   shlibpath_var=LD_LIBRARY_PATH
1597   hardcode_into_libs=yes
1598   ;;
1599
1600 hpux9* | hpux10* | hpux11*)
1601   # Give a soname corresponding to the major version so that dld.sl refuses to
1602   # link against other versions.
1603   dynamic_linker="$host_os dld.sl"
1604   version_type=sunos
1605   need_lib_prefix=no
1606   need_version=no
1607   shlibpath_var=SHLIB_PATH
1608   shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
1609   library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
1610   soname_spec='${libname}${release}.sl$major'
1611   # HP-UX runs *really* slowly unless shared libraries are mode 555.
1612   postinstall_cmds='chmod 555 $lib'
1613   ;;
1614
1615 irix5* | irix6*)
1616   version_type=irix
1617   need_lib_prefix=no
1618   need_version=no
1619   soname_spec='${libname}${release}.so.$major'
1620   library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so'
1621   case "$host_os" in
1622   irix5*)
1623     libsuff= shlibsuff=
1624     ;;
1625   *)
1626     case "$LD" in # libtool.m4 will add one of these switches to LD
1627     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
1628     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
1629     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
1630     *) libsuff= shlibsuff= libmagic=never-match;;
1631     esac
1632     ;;
1633   esac
1634   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
1635   shlibpath_overrides_runpath=no
1636   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1637   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
1638   ;;
1639
1640 # No shared lib support for Linux oldld, aout, or coff.
1641 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
1642   dynamic_linker=no
1643   ;;
1644
1645 # This must be Linux ELF.
1646 linux-gnu*)
1647   version_type=linux
1648   need_lib_prefix=no
1649   need_version=no
1650   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1651   soname_spec='${libname}${release}.so$major'
1652   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1653   shlibpath_var=LD_LIBRARY_PATH
1654   shlibpath_overrides_runpath=no
1655   # This implies no fast_install, which is unacceptable.
1656   # Some rework will be needed to allow for fast_install
1657   # before this can be enabled.
1658   hardcode_into_libs=yes
1659
1660   if test -f /lib/ld.so.1; then
1661     dynamic_linker='GNU ld.so'
1662   else
1663     # Only the GNU ld.so supports shared libraries on MkLinux.
1664     case "$host_cpu" in
1665     powerpc*) dynamic_linker=no ;;
1666     *) dynamic_linker='Linux ld.so' ;;
1667     esac
1668   fi
1669   ;;
1670
1671 netbsd*)
1672   version_type=sunos
1673   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1674     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1675     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1676     dynamic_linker='NetBSD (a.out) ld.so'
1677   else
1678     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
1679     soname_spec='${libname}${release}.so$major'
1680     dynamic_linker='NetBSD ld.elf_so'
1681   fi
1682   shlibpath_var=LD_LIBRARY_PATH
1683   ;;
1684
1685 openbsd*)
1686   version_type=sunos
1687   if test "$with_gnu_ld" = yes; then
1688     need_lib_prefix=no
1689     need_version=no
1690   fi
1691   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1692   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1693   shlibpath_var=LD_LIBRARY_PATH
1694   ;;
1695
1696 os2*)
1697   libname_spec='$name'
1698   need_lib_prefix=no
1699   library_names_spec='$libname.dll $libname.a'
1700   dynamic_linker='OS/2 ld.exe'
1701   shlibpath_var=LIBPATH
1702   ;;
1703
1704 osf3* | osf4* | osf5*)
1705   version_type=osf
1706   need_version=no
1707   soname_spec='${libname}${release}.so'
1708   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1709   shlibpath_var=LD_LIBRARY_PATH
1710   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
1711   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
1712   ;;
1713
1714 sco3.2v5*)
1715   version_type=osf
1716   soname_spec='${libname}${release}.so$major'
1717   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1718   shlibpath_var=LD_LIBRARY_PATH
1719   ;;
1720
1721 solaris*)
1722   version_type=linux
1723   need_lib_prefix=no
1724   need_version=no
1725   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1726   soname_spec='${libname}${release}.so$major'
1727   shlibpath_var=LD_LIBRARY_PATH
1728   shlibpath_overrides_runpath=yes
1729   hardcode_into_libs=yes
1730   # ldd complains unless libraries are executable
1731   postinstall_cmds='chmod +x $lib'
1732   ;;
1733
1734 sunos4*)
1735   version_type=sunos
1736   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1737   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1738   shlibpath_var=LD_LIBRARY_PATH
1739   shlibpath_overrides_runpath=yes
1740   if test "$with_gnu_ld" = yes; then
1741     need_lib_prefix=no
1742   fi
1743   need_version=yes
1744   ;;
1745
1746 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1747   version_type=linux
1748   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1749   soname_spec='${libname}${release}.so$major'
1750   shlibpath_var=LD_LIBRARY_PATH
1751   case "$host_vendor" in
1752     motorola)
1753       need_lib_prefix=no
1754       need_version=no
1755       shlibpath_overrides_runpath=no
1756       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
1757       ;;
1758   esac
1759   ;;
1760
1761 uts4*)
1762   version_type=linux
1763   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1764   soname_spec='${libname}${release}.so$major'
1765   shlibpath_var=LD_LIBRARY_PATH
1766   ;;
1767
1768 dgux*)
1769   version_type=linux
1770   need_lib_prefix=no
1771   need_version=no
1772   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1773   soname_spec='${libname}${release}.so$major'
1774   shlibpath_var=LD_LIBRARY_PATH
1775   ;;
1776
1777 sysv4*MP*)
1778   if test -d /usr/nec ;then
1779     version_type=linux
1780     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
1781     soname_spec='$libname.so.$major'
1782     shlibpath_var=LD_LIBRARY_PATH
1783   fi
1784   ;;
1785
1786 *)
1787   dynamic_linker=no
1788   ;;
1789 esac
1790 echo "$ac_t$dynamic_linker" 1>&6
1791 test "$dynamic_linker" = no && can_build_shared=no
1792
1793 # Check for command to grab the raw symbol name followed by C symbol from nm.
1794 echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
1795
1796 # These are sane defaults that work on at least a few old systems.
1797 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
1798
1799 # Character class describing NM global symbol codes.
1800 symcode='[BCDEGRST]'
1801
1802 # Regexp to match symbols that can be accessed directly from C.
1803 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
1804
1805 # Transform the above into a raw symbol and a C symbol.
1806 symxfrm='\1 \2\3 \3'
1807
1808 # Transform an extracted symbol line into a proper C declaration
1809 global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
1810
1811 # Define system-specific variables.
1812 case "$host_os" in
1813 aix*)
1814   symcode='[BCDT]'
1815   ;;
1816 cygwin* | mingw*)
1817   symcode='[ABCDGISTW]'
1818   ;;
1819 hpux*) # Its linker distinguishes data from code symbols
1820   global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
1821   ;;
1822 irix*)
1823   symcode='[BCDEGRST]'
1824   ;;
1825 solaris* | sysv5*)
1826   symcode='[BDT]'
1827   ;;
1828 sysv4)
1829   symcode='[DFNSTU]'
1830   ;;
1831 esac
1832
1833 # Handle CRLF in mingw too chain
1834 opt_cr=
1835 case "$host_os" in
1836 mingw*)
1837   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
1838   ;;
1839 esac
1840
1841 # If we're using GNU nm, then use its standard symbol codes.
1842 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1843   symcode='[ABCDGISTW]'
1844 fi
1845
1846 # Try without a prefix undercore, then with it.
1847 for ac_symprfx in "" "_"; do
1848
1849   # Write the raw and C identifiers.
1850 global_symbol_pipe="sed -n -e 's/^.*[   ]\($symcode\)[  ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
1851
1852   # Check to see that the pipe works correctly.
1853   pipe_works=no
1854   $rm conftest*
1855   cat > conftest.c <<EOF
1856 #ifdef __cplusplus
1857 extern "C" {
1858 #endif
1859 char nm_test_var;
1860 void nm_test_func(){}
1861 #ifdef __cplusplus
1862 }
1863 #endif
1864 main(){nm_test_var='a';nm_test_func();return(0);}
1865 EOF
1866
1867   echo "$progname:1867: checking if global_symbol_pipe works" >&5
1868   if { (eval echo $progname:1868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
1869     # Now try to grab the symbols.
1870     nlist=conftest.nm
1871     if { echo "$progname:1871: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
1872
1873       # Try sorting and uniquifying the output.
1874       if sort "$nlist" | uniq > "$nlist"T; then
1875         mv -f "$nlist"T "$nlist"
1876       else
1877         rm -f "$nlist"T
1878       fi
1879
1880       # Make sure that we snagged all the symbols we need.
1881       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1882         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1883           cat <<EOF > conftest.c
1884 #ifdef __cplusplus
1885 extern "C" {
1886 #endif
1887
1888 EOF
1889           # Now generate the symbol file.
1890           eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
1891
1892           cat <<EOF >> conftest.c
1893 #if defined (__STDC__) && __STDC__
1894 # define lt_ptr_t void *
1895 #else
1896 # define lt_ptr_t char *
1897 # define const
1898 #endif
1899
1900 /* The mapping between symbol names and symbols. */
1901 const struct {
1902   const char *name;
1903   lt_ptr_t address;
1904 }
1905 lt_preloaded_symbols[] =
1906 {
1907 EOF
1908           sed 's/^. \(.*\) \(.*\)$/  {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
1909           cat <<\EOF >> conftest.c
1910   {0, (lt_ptr_t) 0}
1911 };
1912
1913 #ifdef __cplusplus
1914 }
1915 #endif
1916 EOF
1917           # Now try linking the two files.
1918           mv conftest.$objext conftstm.$objext
1919           save_LIBS="$LIBS"
1920           save_CFLAGS="$CFLAGS"
1921           LIBS="conftstm.$objext"
1922           CFLAGS="$CFLAGS$no_builtin_flag"
1923           if { (eval echo $progname:1923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1924             pipe_works=yes
1925           else
1926             echo "$progname: failed program was:" >&5
1927             cat conftest.c >&5
1928           fi
1929           LIBS="$save_LIBS"
1930         else
1931           echo "cannot find nm_test_func in $nlist" >&5
1932         fi
1933       else
1934         echo "cannot find nm_test_var in $nlist" >&5
1935       fi
1936     else
1937       echo "cannot run $global_symbol_pipe" >&5
1938     fi
1939   else
1940     echo "$progname: failed program was:" >&5
1941     cat conftest.c >&5
1942   fi
1943   $rm conftest* conftst*
1944
1945   # Do not use the global_symbol_pipe unless it works.
1946   if test "$pipe_works" = yes; then
1947     break
1948   else
1949     global_symbol_pipe=
1950   fi
1951 done
1952 if test "$pipe_works" = yes; then
1953   echo "${ac_t}ok" 1>&6
1954 else
1955   echo "${ac_t}failed" 1>&6
1956 fi
1957
1958 if test -z "$global_symbol_pipe"; then
1959   global_symbol_to_cdecl=
1960 fi
1961
1962 # Report the final consequences.
1963 echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1964
1965 # Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in
1966 # configure.in, otherwise build static only libraries.
1967 case "$host_os" in
1968 cygwin* | mingw* | os2*)
1969   if test x$can_build_shared = xyes; then
1970     test x$enable_win32_dll = xno && can_build_shared=no
1971     echo "checking if package supports dlls... $can_build_shared" 1>&6
1972   fi
1973 ;;
1974 esac
1975
1976 echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
1977 test "$can_build_shared" = "no" && enable_shared=no
1978
1979 # On AIX, shared libraries and static libraries use the same namespace, and
1980 # are all built from PIC.
1981 case "$host_os" in
1982 aix3*)
1983   test "$enable_shared" = yes && enable_static=no
1984   if test -n "$RANLIB"; then
1985     archive_cmds="$archive_cmds~\$RANLIB \$lib"
1986     postinstall_cmds='$RANLIB $lib'
1987   fi
1988   ;;
1989
1990 aix4*)
1991   test "$enable_shared" = yes && enable_static=no
1992   ;;
1993 esac
1994
1995 echo "$ac_t$enable_shared" 1>&6
1996
1997 # Make sure either enable_shared or enable_static is yes.
1998 test "$enable_shared" = yes || enable_static=yes
1999
2000 echo "checking whether to build static libraries... $enable_static" 1>&6
2001
2002 if test "$hardcode_action" = relink || test "$hardcode_into_libs" = all; then
2003   # Fast installation is not supported
2004   enable_fast_install=no
2005 elif test "$shlibpath_overrides_runpath" = yes ||
2006      test "$enable_shared" = no; then
2007   # Fast installation is not necessary
2008   enable_fast_install=needless
2009 fi
2010
2011 # Check whether we must set pic_mode to default
2012 test -z "$pic_flag" && pic_mode=default
2013 # On Cygwin there's no "real" PIC flag so we must build both object types
2014 case "$host_os" in
2015 cygwin* | mingw* | os2*)
2016   pic_mode=default
2017   ;;
2018 esac
2019 if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
2020   # non-PIC code in shared libraries is not supported
2021   pic_mode=default
2022 fi
2023
2024 if test "x$enable_dlopen" != xyes; then
2025   enable_dlopen=unknown
2026   enable_dlopen_self=unknown
2027   enable_dlopen_self_static=unknown
2028 else
2029 if test "X${lt_cv_dlopen+set}" != Xset; then
2030   lt_cv_dlopen=no lt_cv_dlopen_libs=
2031 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
2032 echo "$progname:2032: checking for dlopen in -ldl" >&5
2033 if test "X${ac_cv_lib_dl_dlopen+set}" = Xset; then
2034   echo $ac_n "(cached) $ac_c" 1>&6
2035 else
2036   ac_save_LIBS="$LIBS"
2037 LIBS="-ldl  $LIBS"
2038 cat > conftest.$ac_ext <<EOF
2039 #line 2039 "ltconfig"
2040 /* Override any gcc2 internal prototype to avoid an error.  */
2041 /* We use char because int might match the return type of a gcc2
2042     builtin and then its argument prototype would still apply.  */
2043 #ifdef __cplusplus
2044 extern "C"
2045 #endif
2046 char dlopen();
2047
2048 int main() {
2049 dlopen()
2050 ; return 0; }
2051 EOF
2052 if { (eval echo $progname:2052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2053   rm -rf conftest*
2054   ac_cv_lib_dl_dlopen=yes
2055 else
2056   echo "$progname: failed program was:" >&5
2057   cat conftest.$ac_ext >&5
2058   rm -rf conftest*
2059   ac_cv_lib_dl_dlopen=no
2060 fi
2061 rm -f conftest*
2062 LIBS="$ac_save_LIBS"
2063
2064 fi
2065 if test "X$ac_cv_lib_dl_dlopen" = Xyes; then
2066   echo "$ac_t""yes" 1>&6
2067   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
2068 else
2069   echo "$ac_t""no" 1>&6
2070 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
2071 echo "$progname:2071: checking for dlopen" >&5
2072 if test "X${ac_cv_func_dlopen+set}" = Xset; then
2073   echo $ac_n "(cached) $ac_c" 1>&6
2074 else
2075   cat > conftest.$ac_ext <<EOF
2076 #line 2076 "ltconfig"
2077 /* System header to define __stub macros and hopefully few prototypes,
2078     which can conflict with char dlopen(); below.  */
2079 #include <assert.h>
2080 /* Override any gcc2 internal prototype to avoid an error.  */
2081 /* We use char because int might match the return type of a gcc2
2082     builtin and then its argument prototype would still apply.  */
2083 #ifdef __cplusplus
2084 extern "C"
2085 #endif
2086 char dlopen();
2087
2088 int main() {
2089
2090 /* The GNU C library defines this for functions which it implements
2091     to always fail with ENOSYS.  Some functions are actually named
2092     something starting with __ and the normal name is an alias.  */
2093 #if defined (__stub_dlopen) || defined (__stub___dlopen)
2094 choke me
2095 #else
2096 dlopen();
2097 #endif
2098
2099 ; return 0; }
2100 EOF
2101 if { (eval echo $progname:2101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2102   rm -rf conftest*
2103   ac_cv_func_dlopen=yes
2104 else
2105   echo "$progname: failed program was:" >&5
2106   cat conftest.$ac_ext >&5
2107   rm -rf conftest*
2108   ac_cv_func_dlopen=no
2109 fi
2110 rm -f conftest*
2111 fi
2112 if test "X$ac_cv_func_dlopen" = Xyes; then
2113   echo "$ac_t""yes" 1>&6
2114   lt_cv_dlopen="dlopen"
2115 else
2116   echo "$ac_t""no" 1>&6
2117 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
2118 echo "$progname:2118: checking for dld_link in -ldld" >&5
2119 if test "X${ac_cv_lib_dld_dld_link+set}" = Xset; then
2120   echo $ac_n "(cached) $ac_c" 1>&6
2121 else
2122   ac_save_LIBS="$LIBS"
2123 LIBS="-ldld  $LIBS"
2124 cat > conftest.$ac_ext <<EOF
2125 #line 2125 "ltconfig"
2126 /* Override any gcc2 internal prototype to avoid an error.  */
2127 /* We use char because int might match the return type of a gcc2
2128     builtin and then its argument prototype would still apply.  */
2129 #ifdef __cplusplus
2130 extern "C"
2131 #endif
2132 char dld_link();
2133
2134 int main() {
2135 dld_link()
2136 ; return 0; }
2137 EOF
2138 if { (eval echo $progname:2138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2139   rm -rf conftest*
2140   ac_cv_lib_dld_dld_link=yes
2141 else
2142   echo "$progname: failed program was:" >&5
2143   cat conftest.$ac_ext >&5
2144   rm -rf conftest*
2145   ac_cv_lib_dld_dld_link=no
2146 fi
2147 rm -f conftest*
2148 LIBS="$ac_save_LIBS"
2149
2150 fi
2151 if test "X$ac_cv_lib_dld_dld_link" = Xyes; then
2152   echo "$ac_t""yes" 1>&6
2153   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
2154 else
2155   echo "$ac_t""no" 1>&6
2156 echo $ac_n "checking for shl_load""... $ac_c" 1>&6
2157 echo "$progname:2157: checking for shl_load" >&5
2158 if test "X${ac_cv_func_shl_load+set}" = Xset; then
2159   echo $ac_n "(cached) $ac_c" 1>&6
2160 else
2161   cat > conftest.$ac_ext <<EOF
2162 #line 2162 "ltconfig"
2163 /* System header to define __stub macros and hopefully few prototypes,
2164     which can conflict with char shl_load(); below.  */
2165 #include <assert.h>
2166 /* Override any gcc2 internal prototype to avoid an error.  */
2167 /* We use char because int might match the return type of a gcc2
2168     builtin and then its argument prototype would still apply.  */
2169 #ifdef __cplusplus
2170 extern "C"
2171 #endif
2172 char shl_load();
2173
2174 int main() {
2175
2176 /* The GNU C library defines this for functions which it implements
2177     to always fail with ENOSYS.  Some functions are actually named
2178     something starting with __ and the normal name is an alias.  */
2179 #if defined (__stub_shl_load) || defined (__stub___shl_load)
2180 choke me
2181 #else
2182 shl_load();
2183 #endif
2184
2185 ; return 0; }
2186 EOF
2187 if { (eval echo $progname:2187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2188   rm -rf conftest*
2189   ac_cv_func_shl_load=yes
2190 else
2191   echo "$progname: failed program was:" >&5
2192   cat conftest.$ac_ext >&5
2193   rm -rf conftest*
2194   ac_cv_func_shl_load=no
2195 fi
2196 rm -f conftest*
2197 fi
2198
2199 if test "X$ac_cv_func_shl_load" = Xyes; then
2200   echo "$ac_t""yes" 1>&6
2201   lt_cv_dlopen="shl_load"
2202 else
2203   echo "$ac_t""no" 1>&6
2204 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
2205 echo "$progname:2205: checking for shl_load in -ldld" >&5
2206 if test "X${ac_cv_lib_dld_shl_load+set}" = Xset; then
2207   echo $ac_n "(cached) $ac_c" 1>&6
2208 else
2209   ac_save_LIBS="$LIBS"
2210 LIBS="-ldld  $LIBS"
2211 cat > conftest.$ac_ext <<EOF
2212 #line 2212 "ltconfig"
2213 #include "confdefs.h"
2214 /* Override any gcc2 internal prototype to avoid an error.  */
2215 /* We use char because int might match the return type of a gcc2
2216     builtin and then its argument prototype would still apply.  */
2217 #ifdef __cplusplus
2218 extern "C"
2219 #endif
2220 char shl_load();
2221
2222 int main() {
2223 shl_load()
2224 ; return 0; }
2225 EOF
2226 if { (eval echo $progname:2226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2227   rm -rf conftest*
2228   ac_cv_lib_dld_shl_load=yes
2229 else
2230   echo "$progname: failed program was:" >&5
2231   cat conftest.$ac_ext >&5
2232   rm -rf conftest*
2233   ac_cv_lib_dld_shl_load=no
2234 fi
2235 rm -f conftest*
2236 LIBS="$ac_save_LIBS"
2237
2238 fi
2239 if test "X$ac_cv_lib_dld_shl_load" = Xyes; then
2240   echo "$ac_t""yes" 1>&6
2241   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
2242 else
2243   echo "$ac_t""no" 1>&6
2244 fi
2245
2246
2247 fi
2248
2249
2250 fi
2251
2252
2253 fi
2254
2255
2256 fi
2257
2258 fi
2259
2260   if test "x$lt_cv_dlopen" != xno; then
2261     enable_dlopen=yes
2262   fi
2263
2264   case "$lt_cv_dlopen" in
2265   dlopen)
2266 for ac_hdr in dlfcn.h; do
2267 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2268 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2269 echo "$progname:2269: checking for $ac_hdr" >&5
2270 if eval "test \"`echo 'X$''{'ac_cv_header_$ac_safe'+set}'`\" = Xset"; then
2271   echo $ac_n "(cached) $ac_c" 1>&6
2272 else
2273   cat > conftest.$ac_ext <<EOF
2274 #line 2274 "ltconfig"
2275 #include <$ac_hdr>
2276 int fnord = 0;
2277 int main () { }
2278 EOF
2279 ac_try="$ac_compile >/dev/null 2>conftest.out"
2280 { (eval echo $progname:2280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2281 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2282 if test -z "$ac_err"; then
2283   rm -rf conftest*
2284   eval "ac_cv_header_$ac_safe=yes"
2285 else
2286   echo "$ac_err" >&5
2287   echo "$progname: failed program was:" >&5
2288   cat conftest.$ac_ext >&5
2289   rm -rf conftest*
2290   eval "ac_cv_header_$ac_safe=no"
2291 fi
2292 rm -f conftest*
2293 fi
2294 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2295   echo "$ac_t""yes" 1>&6
2296 else
2297   echo "$ac_t""no" 1>&6
2298 fi
2299 done
2300
2301     if test "x$ac_cv_header_dlfcn_h" = xyes; then
2302       CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2303     fi
2304     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2305     LIBS="$lt_cv_dlopen_libs $LIBS"
2306
2307   echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
2308 echo "$progname:2308: checking whether a program can dlopen itself" >&5
2309 if test "X${lt_cv_dlopen_self+set}" = Xset; then
2310   echo $ac_n "(cached) $ac_c" 1>&6
2311 else
2312   if test "$cross_compiling" = yes; then
2313     lt_cv_dlopen_self=cross
2314   else
2315     cat > conftest.c <<EOF
2316 #line 2316 "ltconfig"
2317
2318 #if HAVE_DLFCN_H
2319 #include <dlfcn.h>
2320 #endif
2321
2322 #include <stdio.h>
2323
2324 #ifdef RTLD_GLOBAL
2325 # define LTDL_GLOBAL    RTLD_GLOBAL
2326 #else
2327 # ifdef DL_GLOBAL
2328 #  define LTDL_GLOBAL   DL_GLOBAL
2329 # else
2330 #  define LTDL_GLOBAL   0
2331 # endif
2332 #endif
2333
2334 /* We may have to define LTDL_LAZY_OR_NOW in the command line if we
2335    find out it does not work in some platform. */
2336 #ifndef LTDL_LAZY_OR_NOW
2337 # ifdef RTLD_LAZY
2338 #  define LTDL_LAZY_OR_NOW      RTLD_LAZY
2339 # else
2340 #  ifdef DL_LAZY
2341 #   define LTDL_LAZY_OR_NOW     DL_LAZY
2342 #  else
2343 #   ifdef RTLD_NOW
2344 #    define LTDL_LAZY_OR_NOW    RTLD_NOW
2345 #   else
2346 #    ifdef DL_NOW
2347 #     define LTDL_LAZY_OR_NOW   DL_NOW
2348 #    else
2349 #     define LTDL_LAZY_OR_NOW   0
2350 #    endif
2351 #   endif
2352 #  endif
2353 # endif
2354 #endif
2355
2356 fnord() { int i=42;}
2357 main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
2358     if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
2359                if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
2360
2361 EOF
2362 if { (eval echo $progname:2362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2363 then
2364   lt_cv_dlopen_self=yes
2365 else
2366   echo "$progname: failed program was:" >&5
2367   cat conftest.$ac_ext >&5
2368   rm -fr conftest*
2369   lt_cv_dlopen_self=no
2370 fi
2371 rm -fr conftest*
2372 fi
2373
2374 fi
2375
2376 echo "$ac_t""$lt_cv_dlopen_self" 1>&6
2377
2378   if test "$lt_cv_dlopen_self" = yes; then
2379     LDFLAGS="$LDFLAGS $link_static_flag"
2380   echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
2381 echo "$progname:2381: checking whether a statically linked program can dlopen itself" >&5
2382 if test "X${lt_cv_dlopen_self_static+set}" = Xset; then
2383   echo $ac_n "(cached) $ac_c" 1>&6
2384 else
2385   if test "$cross_compiling" = yes; then
2386     lt_cv_dlopen_self_static=cross
2387   else
2388     cat > conftest.c <<EOF
2389 #line 2389 "ltconfig"
2390
2391 #if HAVE_DLFCN_H
2392 #include <dlfcn.h>
2393 #endif
2394
2395 #include <stdio.h>
2396
2397 #ifdef RTLD_GLOBAL
2398 # define LTDL_GLOBAL    RTLD_GLOBAL
2399 #else
2400 # ifdef DL_GLOBAL
2401 #  define LTDL_GLOBAL   DL_GLOBAL
2402 # else
2403 #  define LTDL_GLOBAL   0
2404 # endif
2405 #endif
2406
2407 /* We may have to define LTDL_LAZY_OR_NOW in the command line if we
2408    find out it does not work in some platform. */
2409 #ifndef LTDL_LAZY_OR_NOW
2410 # ifdef RTLD_LAZY
2411 #  define LTDL_LAZY_OR_NOW      RTLD_LAZY
2412 # else
2413 #  ifdef DL_LAZY
2414 #   define LTDL_LAZY_OR_NOW     DL_LAZY
2415 #  else
2416 #   ifdef RTLD_NOW
2417 #    define LTDL_LAZY_OR_NOW    RTLD_NOW
2418 #   else
2419 #    ifdef DL_NOW
2420 #     define LTDL_LAZY_OR_NOW   DL_NOW
2421 #    else
2422 #     define LTDL_LAZY_OR_NOW   0
2423 #    endif
2424 #   endif
2425 #  endif
2426 # endif
2427 #endif
2428
2429 fnord() { int i=42;}
2430 main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
2431     if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
2432     if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
2433
2434 EOF
2435 if { (eval echo $progname:2435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2436 then
2437   lt_cv_dlopen_self_static=yes
2438 else
2439   echo "$progname: failed program was:" >&5
2440   cat conftest.$ac_ext >&5
2441   rm -fr conftest*
2442   lt_cv_dlopen_self_static=no
2443 fi
2444 rm -fr conftest*
2445 fi
2446
2447 fi
2448
2449 echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
2450 fi
2451     ;;
2452   esac
2453
2454   case "$lt_cv_dlopen_self" in
2455   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2456   *) enable_dlopen_self=unknown ;;
2457   esac
2458
2459   case "$lt_cv_dlopen_self_static" in
2460   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2461   *) enable_dlopen_self_static=unknown ;;
2462   esac
2463 fi
2464
2465 # Copy echo and quote the copy, instead of the original, because it is
2466 # used later.
2467 ltecho="$echo"
2468 if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then
2469    ltecho="$CONFIG_SHELL \$0 --fallback-echo"
2470 fi
2471 LTSHELL="$SHELL"
2472
2473 LTCONFIG_VERSION="$VERSION"
2474
2475 # Only quote variables if we're using ltmain.sh.
2476 case "$ltmain" in
2477 *.sh)
2478   # Now quote all the things that may contain metacharacters.
2479   for var in ltecho old_AR old_CC old_CFLAGS old_CPPFLAGS \
2480     old_MAGIC old_LD old_LDFLAGS old_LIBS \
2481     old_LN_S old_NM old_RANLIB old_STRIP \
2482     old_AS old_DLLTOOL old_OBJDUMP \
2483     old_OBJEXT old_EXEEXT old_reload_flag \
2484     old_deplibs_check_method old_file_magic_cmd \
2485     AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \
2486     reload_flag reload_cmds wl \
2487     pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
2488     thread_safe_flag_spec whole_archive_flag_spec libname_spec \
2489     library_names_spec soname_spec \
2490     RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
2491     old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
2492     postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
2493     old_striplib striplib file_magic_cmd export_symbols_cmds \
2494     deplibs_check_method allow_undefined_flag no_undefined_flag \
2495     finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
2496     hardcode_libdir_flag_spec hardcode_libdir_separator  \
2497     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
2498     compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
2499
2500     case "$var" in
2501     reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
2502     old_postinstall_cmds | old_postuninstall_cmds | \
2503     export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
2504     extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
2505     postinstall_cmds | postuninstall_cmds | \
2506     finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
2507       # Double-quote double-evaled strings.
2508       eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ### testsuite: skip nested quoting test
2509       ;;
2510     *)
2511       eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ### testsuite: skip nested quoting test
2512       ;;
2513     esac
2514   done
2515
2516   case "$ltecho" in
2517   *'\$0 --fallback-echo"')
2518     ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
2519     ;;
2520   esac
2521
2522   trap "$rm \"$ofile\"; exit 1" 1 2 15
2523   echo "creating $ofile"
2524   $rm "$ofile"
2525   cat <<EOF > "$ofile"
2526 #! $SHELL
2527
2528 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
2529 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2530 # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
2531 #
2532 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
2533 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2534 #
2535 # This program is free software; you can redistribute it and/or modify
2536 # it under the terms of the GNU General Public License as published by
2537 # the Free Software Foundation; either version 2 of the License, or
2538 # (at your option) any later version.
2539 #
2540 # This program is distributed in the hope that it will be useful, but
2541 # WITHOUT ANY WARRANTY; without even the implied warranty of
2542 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2543 # General Public License for more details.
2544 #
2545 # You should have received a copy of the GNU General Public License
2546 # along with this program; if not, write to the Free Software
2547 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2548 #
2549 # As a special exception to the GNU General Public License, if you
2550 # distribute this file as part of a program that contains a
2551 # configuration script generated by Autoconf, you may include it under
2552 # the same distribution terms that you use for the rest of that program.
2553
2554 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
2555 Xsed="sed -e s/^X//"
2556
2557 # The HP-UX ksh and POSIX shell print the target directory to stdout
2558 # if CDPATH is set.
2559 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
2560
2561 ### BEGIN LIBTOOL CONFIG
2562 EOF
2563   cfgfile="$ofile"
2564   ;;
2565
2566 *)
2567   # Double-quote the variables that need it (for aesthetics).
2568   for var in old_AR old_CC old_CFLAGS old_CPPFLAGS \
2569     old_MAGIC old_LD old_LDFLAGS old_LIBS \
2570     old_LN_S old_NM old_RANLIB old_STRIP \
2571     old_AS old_DLLTOOL old_OBJDUMP \
2572     old_OBJEXT old_EXEEXT old_reload_flag \
2573     old_deplibs_check_method old_file_magic_cmd; do
2574     eval "$var=\\\"\$var\\\""
2575   done
2576
2577   # Just create a config file.
2578   cfgfile="$ofile.cfg"
2579   trap "$rm \"$cfgfile\"; exit 1" 1 2 15
2580   echo "creating $cfgfile"
2581   $rm "$cfgfile"
2582   cat <<EOF > "$cfgfile"
2583 # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
2584 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2585 EOF
2586   ;;
2587 esac
2588
2589 cat <<EOF >> "$cfgfile"
2590 # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2591 #
2592 # AR=$old_AR CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
2593 # MAGIC=$old_MAGIC LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\
2594 # LN_S=$old_LN_S NM=$old_NM RANLIB=$old_RANLIB STRIP=$old_STRIP \\
2595 # AS=$old_AS DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP \\
2596 # objext=$old_OBJEXT exeext=$old_EXEEXT reload_flag=$old_reload_flag \\
2597 # deplibs_check_method=$old_deplibs_check_method file_magic_cmd=$old_file_magic_cmd \\
2598 #   $0$ltconfig_args
2599 #
2600 # Compiler and other test output produced by $progname, useful for
2601 # debugging $progname, is in ./config.log if it exists.
2602 # The version of $progname that generated this script.
2603 LTCONFIG_VERSION=$LTCONFIG_VERSION
2604
2605 # Shell to use when invoking shell scripts.
2606 SHELL=$LTSHELL
2607
2608 # Whether or not to build shared libraries.
2609 build_libtool_libs=$enable_shared
2610
2611 # Whether or not to build static libraries.
2612 build_old_libs=$enable_static
2613
2614 # Whether or not to optimize for fast installation.
2615 fast_install=$enable_fast_install
2616
2617 # The host system.
2618 host_alias=$host_alias
2619 host=$host
2620
2621 # An echo program that does not interpret backslashes.
2622 echo=$ltecho
2623
2624 # The archiver.
2625 AR=$AR
2626
2627 # The default C compiler.
2628 CC=$CC
2629
2630 # The linker used to build libraries.
2631 LD=$LD
2632
2633 # Whether we need hard or soft links.
2634 LN_S=$LN_S
2635
2636 # A BSD-compatible nm program.
2637 NM=$NM
2638
2639 # A symbol stripping program
2640 STRIP=$STRIP
2641
2642 # Used to examine libraries when file_magic_cmd begins "file"
2643 MAGIC=$MAGIC
2644
2645 # Used on cygwin: DLL creation program.
2646 DLLTOOL="$DLLTOOL"
2647
2648 # Used on cygwin: object dumper.
2649 OBJDUMP="$OBJDUMP"
2650
2651 # Used on cygwin: assembler.
2652 AS="$AS"
2653
2654 # The name of the directory that contains temporary libtool files.
2655 objdir=$objdir
2656
2657 # How to create reloadable object files.
2658 reload_flag=$reload_flag
2659 reload_cmds=$reload_cmds
2660
2661 # How to pass a linker flag through the compiler.
2662 wl=$wl
2663
2664 # Object file suffix (normally "o").
2665 objext="$objext"
2666
2667 # Old archive suffix (normally "a").
2668 libext="$libext"
2669
2670 # Executable file suffix (normally "").
2671 exeext="$exeext"
2672
2673 # Additional compiler flags for building library objects.
2674 pic_flag=$pic_flag
2675 pic_mode=$pic_mode
2676
2677 # Does compiler simultaneously support -c and -o options?
2678 compiler_c_o=$compiler_c_o
2679
2680 # Can we write directly to a .lo ?
2681 compiler_o_lo=$compiler_o_lo
2682
2683 # Must we lock files when doing compilation ?
2684 need_locks=$need_locks
2685
2686 # Do we need the lib prefix for modules?
2687 need_lib_prefix=$need_lib_prefix
2688
2689 # Do we need a version for libraries?
2690 need_version=$need_version
2691
2692 # Whether dlopen is supported.
2693 dlopen_support=$enable_dlopen
2694
2695 # Whether dlopen of programs is supported.
2696 dlopen_self=$enable_dlopen_self
2697
2698 # Whether dlopen of statically linked programs is supported.
2699 dlopen_self_static=$enable_dlopen_self_static
2700
2701 # Compiler flag to prevent dynamic linking.
2702 link_static_flag=$link_static_flag
2703
2704 # Compiler flag to turn off builtin functions.
2705 no_builtin_flag=$no_builtin_flag
2706
2707 # Compiler flag to allow reflexive dlopens.
2708 export_dynamic_flag_spec=$export_dynamic_flag_spec
2709
2710 # Compiler flag to generate shared objects directly from archives.
2711 whole_archive_flag_spec=$whole_archive_flag_spec
2712
2713 # Compiler flag to generate thread-safe objects.
2714 thread_safe_flag_spec=$thread_safe_flag_spec
2715
2716 # Library versioning type.
2717 version_type=$version_type
2718
2719 # Format of library name prefix.
2720 libname_spec=$libname_spec
2721
2722 # List of archive names.  First name is the real one, the rest are links.
2723 # The last name is the one that the linker finds with -lNAME.
2724 library_names_spec=$library_names_spec
2725
2726 # The coded name of the library, if different from the real name.
2727 soname_spec=$soname_spec
2728
2729 # Commands used to build and install an old-style archive.
2730 RANLIB=$RANLIB
2731 old_archive_cmds=$old_archive_cmds
2732 old_postinstall_cmds=$old_postinstall_cmds
2733 old_postuninstall_cmds=$old_postuninstall_cmds
2734
2735 # Create an old-style archive from a shared archive.
2736 old_archive_from_new_cmds=$old_archive_from_new_cmds
2737
2738 # Create a temporary old-style archive to link instead of a shared archive.
2739 old_archive_from_expsyms_cmds=$old_archive_from_expsyms_cmds
2740
2741 # Commands used to build and install a shared archive.
2742 archive_cmds=$archive_cmds
2743 archive_expsym_cmds=$archive_expsym_cmds
2744 postinstall_cmds=$postinstall_cmds
2745 postuninstall_cmds=$postuninstall_cmds
2746
2747 # Commands to strip libraries.
2748 old_striplib=$old_striplib
2749 striplib=$striplib
2750
2751 # Method to check whether dependent libraries are shared objects.
2752 deplibs_check_method=$deplibs_check_method
2753
2754 # Command to use when deplibs_check_method == file_magic.
2755 file_magic_cmd=$file_magic_cmd
2756
2757 # Flag that allows shared libraries with undefined symbols to be built.
2758 allow_undefined_flag=$allow_undefined_flag
2759
2760 # Flag that forces no undefined symbols.
2761 no_undefined_flag=$no_undefined_flag
2762
2763 # Commands used to finish a libtool library installation in a directory.
2764 finish_cmds=$finish_cmds
2765
2766 # Same as above, but a single script fragment to be evaled but not shown.
2767 finish_eval=$finish_eval
2768
2769 # Take the output of nm and produce a listing of raw symbols and C names.
2770 global_symbol_pipe=$global_symbol_pipe
2771
2772 # Transform the output of nm in a proper C declaration
2773 global_symbol_to_cdecl=$global_symbol_to_cdecl
2774
2775 # This is the shared library runtime path variable.
2776 runpath_var=$runpath_var
2777
2778 # This is the shared library path variable.
2779 shlibpath_var=$shlibpath_var
2780
2781 # Is shlibpath searched before the hard-coded library search path?
2782 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
2783
2784 # How to hardcode a shared library path into an executable.
2785 hardcode_action=$hardcode_action
2786
2787 # Whether we should hardcode library paths into libraries.
2788 hardcode_into_libs=$hardcode_into_libs
2789
2790 # Flag to hardcode \$libdir into a binary during linking.
2791 # This must work even if \$libdir does not exist.
2792 hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
2793
2794 # Whether we need a single -rpath flag with a separated argument.
2795 hardcode_libdir_separator=$hardcode_libdir_separator
2796
2797 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
2798 # resulting binary.
2799 hardcode_direct=$hardcode_direct
2800
2801 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
2802 # resulting binary.
2803 hardcode_minus_L=$hardcode_minus_L
2804
2805 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
2806 # the resulting binary.
2807 hardcode_shlibpath_var=$hardcode_shlibpath_var
2808
2809 # Whether libtool must link a program against all its dependency libraries.
2810 link_all_deplibs=$link_all_deplibs
2811
2812 # Compile-time system search path for libraries
2813 sys_lib_search_path_spec=$sys_lib_search_path_spec
2814
2815 # Run-time system search path for libraries
2816 sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
2817
2818 # Fix the shell variable \$srcfile for the compiler.
2819 fix_srcfile_path="$fix_srcfile_path"
2820
2821 # Set to yes if exported symbols are required.
2822 always_export_symbols=$always_export_symbols
2823
2824 # The commands to list exported symbols.
2825 export_symbols_cmds=$export_symbols_cmds
2826
2827 # The commands to extract the exported symbol list from a shared archive.
2828 extract_expsyms_cmds=$extract_expsyms_cmds
2829
2830 # Symbols that should not be listed in the preloaded symbols.
2831 exclude_expsyms=$exclude_expsyms
2832
2833 # Symbols that must always be exported.
2834 include_expsyms=$include_expsyms
2835
2836 EOF
2837
2838 case "$ltmain" in
2839 *.sh)
2840   echo '### END LIBTOOL CONFIG' >> "$ofile"
2841   echo >> "$ofile"
2842   case "$host_os" in
2843   aix3*)
2844     cat <<\EOF >> "$ofile"
2845
2846 # AIX sometimes has problems with the GCC collect2 program.  For some
2847 # reason, if we set the COLLECT_NAMES environment variable, the problems
2848 # vanish in a puff of smoke.
2849 if test "X${COLLECT_NAMES+set}" != Xset; then
2850   COLLECT_NAMES=
2851   export COLLECT_NAMES
2852 fi
2853 EOF
2854     ;;
2855   esac
2856   case "$host" in
2857   *-*-cygwin* | *-*-mingw* | *-*-os2*)
2858     cat <<'EOF' >> "$ofile"
2859       # This is a source program that is used to create dlls on Windows
2860       # Don't remove nor modify the starting and closing comments
2861 # /* ltdll.c starts here */
2862 # #define WIN32_LEAN_AND_MEAN
2863 # #include <windows.h>
2864 # #undef WIN32_LEAN_AND_MEAN
2865 # #include <stdio.h>
2866 #
2867 # #ifndef __CYGWIN__
2868 # #  ifdef __CYGWIN32__
2869 # #    define __CYGWIN__ __CYGWIN32__
2870 # #  endif
2871 # #endif
2872 #
2873 # #ifdef __cplusplus
2874 # extern "C" {
2875 # #endif
2876 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
2877 # #ifdef __cplusplus
2878 # }
2879 # #endif
2880 #
2881 # #ifdef __CYGWIN__
2882 # #include <cygwin/cygwin_dll.h>
2883 # DECLARE_CYGWIN_DLL( DllMain );
2884 # #endif
2885 # HINSTANCE __hDllInstance_base;
2886 #
2887 # BOOL APIENTRY
2888 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
2889 # {
2890 #   __hDllInstance_base = hInst;
2891 #   return TRUE;
2892 # }
2893 # /* ltdll.c ends here */
2894       # This is a source program that is used to create import libraries
2895       # on Windows for dlls which lack them. Don't remove nor modify the
2896       # starting and closing comments
2897 # /* impgen.c starts here */
2898 # /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
2899 #
2900 #  This file is part of GNU libtool.
2901 #
2902 #  This program is free software; you can redistribute it and/or modify
2903 #  it under the terms of the GNU General Public License as published by
2904 #  the Free Software Foundation; either version 2 of the License, or
2905 #  (at your option) any later version.
2906 #
2907 #  This program is distributed in the hope that it will be useful,
2908 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
2909 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2910 #  GNU General Public License for more details.
2911 #
2912 #  You should have received a copy of the GNU General Public License
2913 #  along with this program; if not, write to the Free Software
2914 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2915 #  */
2916 #
2917 #  #include <stdio.h>           /* for printf() */
2918 #  #include <unistd.h>          /* for open(), lseek(), read() */
2919 #  #include <fcntl.h>           /* for O_RDONLY, O_BINARY */
2920 #  #include <string.h>          /* for strdup() */
2921 #
2922 #  /* O_BINARY isn't required (or even defined sometimes) under Unix */
2923 #  #ifndef O_BINARY
2924 #  #define O_BINARY 0
2925 #  #endif
2926 #
2927 #  static unsigned int
2928 #  pe_get16 (fd, offset)
2929 #       int fd;
2930 #       int offset;
2931 #  {
2932 #    unsigned char b[2];
2933 #    lseek (fd, offset, SEEK_SET);
2934 #    read (fd, b, 2);
2935 #    return b[0] + (b[1]<<8);
2936 #  }
2937 #
2938 #  static unsigned int
2939 #  pe_get32 (fd, offset)
2940 #      int fd;
2941 #      int offset;
2942 #  {
2943 #    unsigned char b[4];
2944 #    lseek (fd, offset, SEEK_SET);
2945 #    read (fd, b, 4);
2946 #    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
2947 #  }
2948 #
2949 #  static unsigned int
2950 #  pe_as32 (ptr)
2951 #       void *ptr;
2952 #  {
2953 #    unsigned char *b = ptr;
2954 #    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
2955 #  }
2956 #
2957 #  int
2958 #  main (argc, argv)
2959 #      int argc;
2960 #      char *argv[];
2961 #  {
2962 #      int dll;
2963 #      unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
2964 #      unsigned long export_rva, export_size, nsections, secptr, expptr;
2965 #      unsigned long name_rvas, nexp;
2966 #      unsigned char *expdata, *erva;
2967 #      char *filename, *dll_name;
2968 #
2969 #      filename = argv[1];
2970 #
2971 #      dll = open(filename, O_RDONLY|O_BINARY);
2972 #      if (!dll)
2973 #       return 1;
2974 #
2975 #      dll_name = filename;
2976 #
2977 #      for (i=0; filename[i]; i++)
2978 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
2979 #           dll_name = filename + i +1;
2980 #
2981 #      pe_header_offset = pe_get32 (dll, 0x3c);
2982 #      opthdr_ofs = pe_header_offset + 4 + 20;
2983 #      num_entries = pe_get32 (dll, opthdr_ofs + 92);
2984 #
2985 #      if (num_entries < 1) /* no exports */
2986 #       return 1;
2987 #
2988 #      export_rva = pe_get32 (dll, opthdr_ofs + 96);
2989 #      export_size = pe_get32 (dll, opthdr_ofs + 100);
2990 #      nsections = pe_get16 (dll, pe_header_offset + 4 +2);
2991 #      secptr = (pe_header_offset + 4 + 20 +
2992 #             pe_get16 (dll, pe_header_offset + 4 + 16));
2993 #
2994 #      expptr = 0;
2995 #      for (i = 0; i < nsections; i++)
2996 #      {
2997 #       char sname[8];
2998 #       unsigned long secptr1 = secptr + 40 * i;
2999 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
3000 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
3001 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
3002 #       lseek(dll, secptr1, SEEK_SET);
3003 #       read(dll, sname, 8);
3004 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
3005 #       {
3006 #           expptr = fptr + (export_rva - vaddr);
3007 #           if (export_rva + export_size > vaddr + vsize)
3008 #               export_size = vsize - (export_rva - vaddr);
3009 #           break;
3010 #       }
3011 #      }
3012 #
3013 #      expdata = (unsigned char*)malloc(export_size);
3014 #      lseek (dll, expptr, SEEK_SET);
3015 #      read (dll, expdata, export_size);
3016 #      erva = expdata - export_rva;
3017 #
3018 #      nexp = pe_as32 (expdata+24);
3019 #      name_rvas = pe_as32 (expdata+32);
3020 #
3021 #      printf ("EXPORTS\n");
3022 #      for (i = 0; i<nexp; i++)
3023 #      {
3024 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
3025 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
3026 #      }
3027 #
3028 #      return 0;
3029 #  }
3030 # /* impgen.c ends here */
3031
3032 EOF
3033     ;;
3034   esac
3035
3036
3037   # Append the ltmain.sh script.
3038   sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
3039   # We use sed instead of cat because bash on DJGPP gets confused if
3040   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
3041   # text mode, it properly converts lines to CR/LF.  This bash problem
3042   # is reportedly fixed, but why not run on old versions too?
3043
3044   chmod +x "$ofile"
3045   ;;
3046
3047 *)
3048   # Compile the libtool program.
3049   echo "FIXME: would compile $ltmain"
3050   ;;
3051 esac
3052
3053 test -n "$cache_file" || exit 0
3054
3055 # AC_CACHE_SAVE
3056 trap '' 1 2 15
3057 cat > confcache <<\EOF
3058 # This file is a shell script that caches the results of configure
3059 # tests run on this system so they can be shared between configure
3060 # scripts and configure runs.  It is not useful on other systems.
3061 # If it contains results you don't want to keep, you may remove or edit it.
3062 #
3063 # By default, configure uses ./config.cache as the cache file,
3064 # creating it if it does not exist already.  You can give configure
3065 # the --cache-file=FILE option to use a different cache file; that is
3066 # what configure does when it calls configure scripts in
3067 # subdirectories, so they share the cache.
3068 # Giving --cache-file=/dev/null disables caching, for debugging configure.
3069 # config.status only pays attention to the cache file if you give it the
3070 # --recheck option to rerun configure.
3071 #
3072 EOF
3073 # The following way of writing the cache mishandles newlines in values,
3074 # but we know of no workaround that is simple, portable, and efficient.
3075 # So, don't put newlines in cache variables' values.
3076 # Ultrix sh set writes to stderr and can't be redirected directly,
3077 # and sets the high bit in the cache file unless we assign to the vars.
3078 (set) 2>&1 |
3079   case `(ac_space=' '; set | grep ac_space) 2>&1` in
3080   *ac_space=\ *)
3081     # `set' does not quote correctly, so add quotes (double-quote substitution
3082     # turns \\\\ into \\, and sed turns \\ into \).
3083     sed -n \
3084       -e "s/'/'\\\\''/g" \
3085       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3086     ;;
3087   *)
3088     # `set' quotes correctly as required by POSIX, so do not add quotes.
3089     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3090     ;;
3091   esac >> confcache
3092 if cmp -s $cache_file confcache; then
3093   :
3094 else
3095   if test -w $cache_file; then
3096     echo "updating cache $cache_file"
3097     cat confcache > $cache_file
3098   else
3099     echo "not updating unwritable cache $cache_file"
3100   fi
3101 fi
3102 rm -f confcache
3103
3104 exit 0
3105
3106 # Local Variables:
3107 # mode:shell-script
3108 # sh-indentation:2
3109 # End: