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