OSDN Git Service

* cselib.c (hash_rtx): Ensure that hash isn't zero upon return.
[pf3gnuchains/gcc-fork.git] / ltcf-c.sh
1 #### This script is meant to be sourced by ltconfig.
2
3 # ltcf-c.sh - Create a C compiler specific configuration
4 #
5 # Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc.
6 # Originally by 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
28 # Source file extension for C test sources.
29 ac_ext=c
30
31 # Object file extension for compiled C test sources.
32 objext=o
33
34 # Code to be used in simple compile tests
35 lt_simple_compile_test_code="int some_variable = 0;"
36
37 # Code to be used in simple link tests
38 lt_simple_link_test_code='main(){return(0);}'
39
40 ## Linker Characteristics
41 case "$host_os" in
42 cygwin* | mingw*)
43   # FIXME: the MSVC++ port hasn't been tested in a loooong time
44   # When not using gcc, we currently assume that we are using
45   # Microsoft Visual C++.
46   if test "$with_gcc" != yes; then
47     with_gnu_ld=no
48   fi
49   ;;
50
51 esac
52
53 ld_shlibs=yes
54 if test "$with_gnu_ld" = yes; then
55   # If archive_cmds runs LD, not CC, wlarc should be empty
56   wlarc='${wl}'
57
58   # See if GNU ld supports shared libraries.
59   case "$host_os" in
60   aix3* | aix4* | aix5*)
61     # On AIX, the GNU linker is very broken
62     ld_shlibs=no
63     cat <<EOF 1>&2
64
65 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
66 *** to be unable to reliably create shared libraries on AIX.
67 *** Therefore, libtool is disabling shared libraries support.  If you
68 *** really care for shared libraries, you may want to modify your PATH
69 *** so that a non-GNU linker is found, and then restart.
70
71 EOF
72     ;;
73
74   amigaos*)
75     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 $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
76     hardcode_libdir_flag_spec='-L$libdir'
77     hardcode_minus_L=yes
78
79     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
80     # that the semantics of dynamic libraries on AmigaOS, at least up
81     # to version 4, is to share data among multiple programs linked
82     # with the same dynamic library.  Since this doesn't match the
83     # behavior of shared libraries on other platforms, we can use
84     # them.
85     ld_shlibs=no
86     ;;
87
88   beos*)
89     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
90       allow_undefined_flag=unsupported
91       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
92       # support --undefined.  This deserves some investigation.  FIXME
93       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
94     else
95       ld_shlibs=no
96     fi
97     ;;
98
99   cygwin* | mingw*)
100     # hardcode_libdir_flag_spec is actually meaningless, as there is
101     # no search path for DLLs.
102     hardcode_libdir_flag_spec='-L$libdir'
103     allow_undefined_flag=unsupported
104     always_export_symbols=yes
105
106     extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
107       sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~
108       test -f $output_objdir/impgen.exe || (cd $output_objdir && \
109       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
110       else $CC -o impgen impgen.c ; fi)~
111       $output_objdir/impgen $dir/$soname > $output_objdir/$soname-def'
112
113     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
114
115     # cygwin and mingw dlls have different entry points and sets of symbols
116     # to exclude.
117     # FIXME: what about values for MSVC?
118     dll_entry=__cygwin_dll_entry@12
119     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
120     case "$host_os" in
121     mingw*)
122       # mingw values
123       dll_entry=_DllMainCRTStartup@12
124       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
125       ;;
126     esac
127
128     # mingw and cygwin differ, and it's simplest to just exclude the union
129     # of the two symbol sets.
130     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
131
132     # recent cygwin and mingw systems supply a stub DllMain which the user
133     # can override, but on older systems we have to supply one (in ltdll.c)
134     if test "x$lt_cv_need_dllmain" = "xyes"; then
135       ltdll_obj='$output_objdir/$soname-ltdll.'"$objext "
136       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~
137         test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
138     else
139       ltdll_obj=
140       ltdll_cmds=
141     fi
142
143     # Extract the symbol export list from an `--export-all' def file,
144     # then regenerate the def file from the symbol export list, so that
145     # the compiled dll only exports the symbol export list.
146     # Be careful not to strip the DATA tag left be newer dlltools.
147     export_symbols_cmds="$ltdll_cmds"'
148       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
149       sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
150
151     # If DATA tags from a recent dlltool are present, honour them!
152     archive_expsym_cmds='echo EXPORTS > $output_objdir/$soname-def~
153       _lt_hint=1;
154       cat $export_symbols | while read symbol; do
155         set dummy \$symbol;
156         case \$# in
157           2) echo "     \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
158           *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
159         esac;
160         _lt_hint=`expr 1 + \$_lt_hint`;
161       done~
162       '"$ltdll_cmds"'
163       $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~
164       $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~
165       $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~
166       $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~
167       $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags'
168     ;;
169
170   netbsd*)
171     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
172       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
173       wlarc=
174     else
175       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
176       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
177     fi
178     ;;
179
180   solaris* | sysv5*)
181     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
182       ld_shlibs=no
183       cat <<EOF 1>&2
184
185 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
186 *** create shared libraries on Solaris systems.  Therefore, libtool
187 *** is disabling shared libraries support.  We urge you to upgrade GNU
188 *** binutils to release 2.9.1 or newer.  Another option is to modify
189 *** your PATH or compiler configuration so that the native linker is
190 *** used, and then restart.
191
192 EOF
193     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
194       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
195       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
196     else
197       ld_shlibs=no
198     fi
199     ;;
200
201   sunos4*)
202     archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
203     wlarc=
204     hardcode_direct=yes
205     hardcode_shlibpath_var=no
206     ;;
207
208   *)
209     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
210       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${allow_undefined_flag} ${wl}-soname $wl$soname -o $lib'
211       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${allow_undefined_flag} ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
212       no_undefined_flag='${wl}--no-undefined'
213     else
214       ld_shlibs=no
215     fi
216     ;;
217   esac
218
219   if test "$ld_shlibs" = yes; then
220     runpath_var=LD_RUN_PATH
221     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
222     export_dynamic_flag_spec='${wl}--export-dynamic'
223     case $host_os in
224     cygwin* | mingw*)
225       # dlltool doesn't understand --whole-archive et. al.
226       whole_archive_flag_spec=
227       ;;
228     *)
229       # ancient GNU ld didn't support --whole-archive et. al.
230       if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
231         whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
232       else
233         whole_archive_flag_spec=
234       fi
235       ;;
236     esac
237   fi
238 else
239   # PORTME fill in a description of your system's linker (not GNU ld)
240   case "$host_os" in
241   aix3*)
242     allow_undefined_flag=unsupported
243     always_export_symbols=yes
244     archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
245     # Note: this linker hardcodes the directories in LIBPATH if there
246     # are no directories specified by -L.
247     hardcode_minus_L=yes
248     if test "$with_gcc" = yes && test -z "$link_static_flag"; then
249       # Neither direct hardcoding nor static linking is supported with a
250       # broken collect2.
251       hardcode_direct=unsupported
252     fi
253     ;;
254
255   aix4* | aix5*)
256     hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
257     hardcode_libdir_separator=':'
258     if test "$with_gcc" = yes; then
259       collect2name=`${CC} -print-prog-name=collect2`
260       if test -f "$collect2name" && \
261          strings "$collect2name" | grep resolve_lib_name >/dev/null
262       then
263         # We have reworked collect2
264         hardcode_direct=yes
265       else
266         # We have old collect2
267         hardcode_direct=unsupported
268         # It fails to find uninstalled libraries when the uninstalled
269         # path is not listed in the libpath.  Setting hardcode_minus_L
270         # to unsupported forces relinking
271         hardcode_minus_L=yes
272         hardcode_libdir_flag_spec='-L$libdir'
273         hardcode_libdir_separator=
274       fi
275       shared_flag='-shared'
276     else
277       shared_flag='${wl}-bM:SRE'
278       hardcode_direct=yes
279     fi
280     allow_undefined_flag=' ${wl}-berok'
281     archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
282     # -bexpall does not export symbols beginning with underscore (_)
283     always_export_symbols=yes
284     # Exported symbols can be pulled into shared objects from archives
285     whole_archive_flag_spec=' '
286     build_libtool_need_lc=yes
287
288     # We don't want to build shared libraries on unknown CPU types.
289     case $host_cpu in
290     powerpc | rs6000) ;;
291     *) ld_shlibs=no ;;
292     esac
293     ;;
294
295   amigaos*)
296     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 $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
297     hardcode_libdir_flag_spec='-L$libdir'
298     hardcode_minus_L=yes
299     # see comment about different semantics on the GNU ld section
300     ld_shlibs=no
301     ;;
302
303   cygwin* | mingw*)
304     # When not using gcc, we currently assume that we are using
305     # Microsoft Visual C++.
306     # hardcode_libdir_flag_spec is actually meaningless, as there is
307     # no search path for DLLs.
308     hardcode_libdir_flag_spec=' '
309     allow_undefined_flag=unsupported
310     # Tell ltmain to make .lib files, not .a files.
311     libext=lib
312     # FIXME: Setting linknames here is a bad hack.
313     archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
314     # The linker will automatically build a .lib file if we build a DLL.
315     old_archive_from_new_cmds='true'
316     # FIXME: Should let the user specify the lib program.
317     old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
318     fix_srcfile_path='`cygpath -w $srcfile`'
319     ;;
320
321   freebsd1*)
322     ld_shlibs=no
323     ;;
324
325   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
326   # support.  Future versions do this automatically, but an explicit c++rt0.o
327   # does not break anything, and helps significantly (at the cost of a little
328   # extra space).
329   freebsd2.2*)
330     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
331     hardcode_libdir_flag_spec='-R$libdir'
332     hardcode_direct=yes
333     hardcode_shlibpath_var=no
334     ;;
335
336   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
337   freebsd2*)
338     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
339     hardcode_direct=yes
340     hardcode_minus_L=yes
341     hardcode_shlibpath_var=no
342     ;;
343
344   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
345   freebsd*)
346     archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
347     hardcode_libdir_flag_spec='-R$libdir'
348     hardcode_direct=yes
349     hardcode_shlibpath_var=no
350     ;;
351
352   hpux9* | hpux10* | hpux11*)
353     case "$host_os" in
354     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' ;;
355     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
356     esac
357     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
358     hardcode_libdir_separator=:
359     hardcode_direct=yes
360     hardcode_minus_L=yes # Not in the search PATH, but as the default
361                          # location of the library.
362     export_dynamic_flag_spec='${wl}-E'
363     ;;
364
365   irix5* | irix6*)
366     if test "$with_gcc" = yes; then
367       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}${objdir}/so_locations -o $lib'
368     else
369       archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
370     fi
371     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
372     hardcode_libdir_separator=:
373     link_all_deplibs=yes
374     ;;
375
376   netbsd*)
377     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
378       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
379     else
380       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
381     fi
382     hardcode_libdir_flag_spec='${wl}-R$libdir'
383     hardcode_direct=yes
384     hardcode_shlibpath_var=no
385     ;;
386
387   openbsd*)
388     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
389     hardcode_libdir_flag_spec='-R$libdir'
390     hardcode_direct=yes
391     hardcode_shlibpath_var=no
392     ;;
393
394   os2*)
395     hardcode_libdir_flag_spec='-L$libdir'
396     hardcode_minus_L=yes
397     allow_undefined_flag=unsupported
398     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'
399     old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
400     ;;
401
402   osf3*)
403     if test "$with_gcc" = yes; then
404       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
405       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}${objdir}/so_locations -o $lib'
406     else
407       allow_undefined_flag=' -expect_unresolved \*'
408       archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
409     fi
410     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
411     hardcode_libdir_separator=:
412     ;;
413
414   osf4* | osf5*)        # as osf3* with the addition of -msym flag
415     if test "$with_gcc" = yes; then
416       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
417       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}${objdir}/so_locations -o $lib'
418     else
419       allow_undefined_flag=' -expect_unresolved \*'
420       archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
421     fi
422     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
423     hardcode_libdir_separator=:
424     ;;
425
426   sco3.2v5*)
427     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
428     hardcode_shlibpath_var=no
429     runpath_var=LD_RUN_PATH
430     hardcode_runpath_var=yes
431     ;;
432
433   solaris*)
434     no_undefined_flag=' -z text'
435     if test "$with_gcc" = yes; then
436       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
437       archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
438                   $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
439     else
440       archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
441       archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
442                   $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
443     fi
444     hardcode_libdir_flag_spec='-R$libdir'
445     hardcode_shlibpath_var=no
446     case "$host_os" in
447     solaris2.[0-5] | solaris2.[0-5].*) ;;
448     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
449       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
450     esac
451     link_all_deplibs=yes
452     ;;
453
454   sunos4*)
455     archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
456     hardcode_libdir_flag_spec='-L$libdir'
457     hardcode_direct=yes
458     hardcode_minus_L=yes
459     hardcode_shlibpath_var=no
460     ;;
461
462   sysv4)
463     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
464     runpath_var='LD_RUN_PATH'
465     hardcode_shlibpath_var=no
466     hardcode_direct=no #Motorola manual says yes, but my tests say they lie
467     ;;
468
469   sysv4.3*)
470     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
471     hardcode_shlibpath_var=no
472     export_dynamic_flag_spec='-Bexport'
473     ;;
474
475   sysv5*)
476     no_undefined_flag=' -z text'
477     # $CC -shared without GNU ld will not create a library from C++
478     # object files and a static libstdc++, better avoid it by now
479     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
480     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
481                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
482     hardcode_libdir_flag_spec=
483     hardcode_shlibpath_var=no
484     runpath_var='LD_RUN_PATH'
485     ;;
486
487   uts4*)
488     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
489     hardcode_libdir_flag_spec='-L$libdir'
490     hardcode_shlibpath_var=no
491     ;;
492
493   dgux*)
494     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
495     hardcode_libdir_flag_spec='-L$libdir'
496     hardcode_shlibpath_var=no
497     ;;
498
499   sysv4*MP*)
500     if test -d /usr/nec; then
501       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
502       hardcode_shlibpath_var=no
503       runpath_var=LD_RUN_PATH
504       hardcode_runpath_var=yes
505       ld_shlibs=yes
506     fi
507     ;;
508
509   sysv4.2uw2*)
510     archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
511     hardcode_direct=yes
512     hardcode_minus_L=no
513     hardcode_shlibpath_var=no
514     hardcode_runpath_var=yes
515     runpath_var=LD_RUN_PATH
516     ;;
517
518   unixware7*)
519     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
520     runpath_var='LD_RUN_PATH'
521     hardcode_shlibpath_var=no
522     ;;
523
524   *)
525     ld_shlibs=no
526     ;;
527   esac
528 fi
529
530 ## Compiler Characteristics: PIC flags, static flags, etc
531 if test "X${ac_cv_prog_cc_pic+set}" = Xset; then
532   :
533 else
534   ac_cv_prog_cc_pic=
535   ac_cv_prog_cc_shlib=
536   ac_cv_prog_cc_wl=
537   ac_cv_prog_cc_static=
538   ac_cv_prog_cc_no_builtin=
539   ac_cv_prog_cc_can_build_shared=$can_build_shared
540
541   if test "$with_gcc" = yes; then
542     ac_cv_prog_cc_wl='-Wl,'
543     ac_cv_prog_cc_static='-static'
544
545     case "$host_os" in
546     beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
547       # PIC is the default for these OSes.
548       ;;
549     aix*)
550       # Below there is a dirty hack to force normal static linking with -ldl
551       # The problem is because libdl dynamically linked with both libc and
552       # libC (AIX C++ library), which obviously doesn't included in libraries
553       # list by gcc. This cause undefined symbols with -static flags.
554       # This hack allows C programs to be linked with "-static -ldl", but
555       # we not sure about C++ programs.
556       ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
557       ;;
558     *djgpp*)
559       # DJGPP does not support shared libraries at all
560       ac_cv_prog_cc_pic=
561       ;;
562     cygwin* | mingw* | os2*)
563       # This hack is so that the source file can tell whether it is being
564       # built for inclusion in a dll (and should export symbols for example).
565       ac_cv_prog_cc_pic='-DDLL_EXPORT'
566       ;;
567     amigaos*)
568       # FIXME: we need at least 68020 code to build shared libraries, but
569       # adding the `-m68020' flag to GCC prevents building anything better,
570       # like `-m68040'.
571       ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
572       ;;
573     sysv4*MP*)
574       if test -d /usr/nec; then
575          ac_cv_prog_cc_pic=-Kconform_pic
576       fi
577       ;;
578     *)
579       ac_cv_prog_cc_pic='-fPIC'
580       ;;
581     esac
582   else
583     # PORTME Check for PIC flags for the system compiler.
584     case "$host_os" in
585     aix3* | aix4* | aix5*)
586      # All AIX code is PIC.
587       ac_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
588       ;;
589
590     hpux9* | hpux10* | hpux11*)
591       # Is there a better ac_cv_prog_cc_static that works with the bundled CC?
592       ac_cv_prog_cc_wl='-Wl,'
593       ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
594       ac_cv_prog_cc_pic='+Z'
595       ;;
596
597     irix5* | irix6*)
598       ac_cv_prog_cc_wl='-Wl,'
599       ac_cv_prog_cc_static='-non_shared'
600       # PIC (with -KPIC) is the default.
601       ;;
602
603     cygwin* | mingw* | os2*)
604       # This hack is so that the source file can tell whether it is being
605       # built for inclusion in a dll (and should export symbols for example).
606       ac_cv_prog_cc_pic='-DDLL_EXPORT'
607       ;;
608
609     osf3* | osf4* | osf5*)
610       # All OSF/1 code is PIC.
611       ac_cv_prog_cc_wl='-Wl,'
612       ac_cv_prog_cc_static='-non_shared'
613       ;;
614
615     sco3.2v5*)
616       ac_cv_prog_cc_pic='-Kpic'
617       ac_cv_prog_cc_static='-dn'
618       ac_cv_prog_cc_shlib='-belf'
619       ;;
620
621     solaris*)
622       ac_cv_prog_cc_pic='-KPIC'
623       ac_cv_prog_cc_static='-Bstatic'
624       ac_cv_prog_cc_wl='-Wl,'
625       ;;
626
627     sunos4*)
628       ac_cv_prog_cc_pic='-PIC'
629       ac_cv_prog_cc_static='-Bstatic'
630       ac_cv_prog_cc_wl='-Qoption ld '
631       ;;
632
633     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
634       ac_cv_prog_cc_pic='-KPIC'
635       ac_cv_prog_cc_static='-Bstatic'
636       ac_cv_prog_cc_wl='-Wl,'
637       ;;
638
639     uts4*)
640       ac_cv_prog_cc_pic='-pic'
641       ac_cv_prog_cc_static='-Bstatic'
642       ;;
643
644     sysv4*MP*)
645       if test -d /usr/nec ;then
646         ac_cv_prog_cc_pic='-Kconform_pic'
647         ac_cv_prog_cc_static='-Bstatic'
648       fi
649       ;;
650
651     *)
652       ac_cv_prog_cc_can_build_shared=no
653       ;;
654     esac
655   fi
656   case "$host_os" in
657       # Platforms which do not suport PIC and -DPIC is meaningless
658       # on them:
659       *djgpp*)
660         ac_cv_prog_cc_pic=
661         ;;
662       *)
663         ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
664         ;;
665   esac
666 fi
667
668 need_lc=yes
669 if test "$enable_shared" = yes && test "$with_gcc" = yes; then
670   case "$archive_cmds" in
671   *'~'*)
672     # FIXME: we may have to deal with multi-command sequences.
673     ;;
674   '$CC '*)
675     # Test whether the compiler implicitly links with -lc since on some
676     # systems, -lgcc has to come before -lc. If gcc already passes -lc
677     # to ld, don't add -lc before -lgcc.
678     echo $ac_n "checking whether -lc should be explicitly linked in... $ac_c" 1>&6
679     if eval "test \"`echo '$''{'ac_cv_archive_cmds_needs_lc'+set}'`\" = set"; then
680       echo $ac_n "(cached) $ac_c" 1>&6
681       need_lc=$ac_cv_archive_cmds_needs_lc
682     else
683       $rm conftest*
684       echo "static int dummy;" > conftest.$ac_ext
685       if { (eval echo ltcf-c.sh:need_lc: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
686         # Append any warnings to the config.log.
687         cat conftest.err 1>&5
688         soname=conftest
689         lib=conftest
690         libobjs=conftest.o
691         deplibs=
692         wl=$ac_cv_prog_cc_wl
693         compiler_flags=-v
694         linker_flags=-v
695         verstring=
696         output_objdir=.
697         libname=conftest
698         save_allow_undefined_flag=$allow_undefined_flag
699         allow_undefined_flag=
700         if { (eval echo ltcf-c.sh:need_lc: \"$archive_cmds\") 1>&5; (eval $archive_cmds) 2>&1 | grep " -lc " 1>&5 ; }; then
701           need_lc=no
702         fi
703         allow_undefined_flag=$save_allow_undefined_flag
704       else
705         cat conftest.err 1>&5
706       fi
707     fi
708     $rm conftest*
709     echo "$ac_t$need_lc" 1>&6
710     ;;
711   esac
712 fi
713 ac_cv_archive_cmds_needs_lc=$need_lc