* coff-alpha.c (reloc_nil): Likewise.
[binutils.git] / ltcf-c.sh
blob17b65111c9277c98c62d1903b912f33ae3d3f24c
1 #### This script is meant to be sourced by ltconfig.
3 # ltcf-c.sh - Create a C compiler specific configuration
5 # Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
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.
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.
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.
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.
28 # Source file extension for C test sources.
29 ac_ext=c
31 # Object file extension for compiled C test sources.
32 objext=o
34 # Code to be used in simple compile tests
35 lt_simple_compile_test_code="int some_variable = 0;"
37 # Code to be used in simple link tests
38 lt_simple_link_test_code='main(){return(0);}'
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
51 esac
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}'
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
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.
71 EOF
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
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
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
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
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/$soroot > $output_objdir/$soname-def'
113 old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
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~
126 esac
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
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=
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'
151 # If the export-symbols file already is a .def file (1st line
152 # is EXPORTS), use it as is.
153 # If DATA tags from a recent dlltool are present, honour them!
154 archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
155 cp $export_symbols $output_objdir/$soname-def;
156 else
157 echo EXPORTS > $output_objdir/$soname-def;
158 _lt_hint=1;
159 cat $export_symbols | while read symbol; do
160 set dummy \$symbol;
161 case \[$]# in
162 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
163 *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
164 esac;
165 _lt_hint=`expr 1 + \$_lt_hint`;
166 done;
168 '"$ltdll_cmds"'
169 $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
170 $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~
171 $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
172 $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 --output-lib $output_objdir/$libname.dll.a~
173 $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
176 darwin* | rhapsody*)
177 allow_undefined_flag='-undefined suppress'
178 archive_cmds='$CC `test .$module = .yes && echo -bundle || echo -dynamiclib` $allow_undefined_flag -o $lib $libobjs $deplibs $linkopts -install_name $rpath/$soname `test -n "$verstring" -a x$verstring != x0.0 && echo $verstring`'
179 # We need to add '_' to the symbols in $export_symbols first
180 #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
181 hardcode_direct=yes
182 hardcode_shlibpath_var=no
183 whole_archive_flag_spec='-all_load $convenience'
186 netbsd*)
187 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
188 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
189 wlarc=
190 else
191 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
192 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
196 solaris* | sysv5*)
197 if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
198 ld_shlibs=no
199 cat <<EOF 1>&2
201 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
202 *** create shared libraries on Solaris systems. Therefore, libtool
203 *** is disabling shared libraries support. We urge you to upgrade GNU
204 *** binutils to release 2.9.1 or newer. Another option is to modify
205 *** your PATH or compiler configuration so that the native linker is
206 *** used, and then restart.
209 elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
210 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
211 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
212 else
213 ld_shlibs=no
217 sunos4*)
218 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
219 wlarc=
220 hardcode_direct=yes
221 hardcode_shlibpath_var=no
225 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
226 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
227 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
228 else
229 ld_shlibs=no
232 esac
234 if test "$ld_shlibs" = yes; then
235 runpath_var=LD_RUN_PATH
236 hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
237 export_dynamic_flag_spec='${wl}--export-dynamic'
238 case $host_os in
239 cygwin* | mingw*)
240 # dlltool doesn't understand --whole-archive et. al.
241 whole_archive_flag_spec=
244 # ancient GNU ld didn't support --whole-archive et. al.
245 if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
246 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
247 else
248 whole_archive_flag_spec=
251 esac
253 else
254 # PORTME fill in a description of your system's linker (not GNU ld)
255 case $host_os in
256 aix3*)
257 allow_undefined_flag=unsupported
258 always_export_symbols=yes
259 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'
260 # Note: this linker hardcodes the directories in LIBPATH if there
261 # are no directories specified by -L.
262 hardcode_minus_L=yes
263 if test "$with_gcc" = yes && test -z "$link_static_flag"; then
264 # Neither direct hardcoding nor static linking is supported with a
265 # broken collect2.
266 hardcode_direct=unsupported
270 aix4* | aix5*)
271 hardcode_direct=yes
272 hardcode_libdir_separator=':'
273 link_all_deplibs=yes
274 # When large executables or shared objects are built, AIX ld can
275 # have problems creating the table of contents. If linking a library
276 # or program results in "error TOC overflow" add -mminimal-toc to
277 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
278 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
279 if test "$with_gcc" = yes; then
280 case $host_os in aix4.[012]|aix4.[012].*)
281 # We only want to do this on AIX 4.2 and lower, the check
282 # below for broken collect2 doesn't work under 4.3+
283 collect2name=`${CC} -print-prog-name=collect2`
284 if test -f "$collect2name" && \
285 strings "$collect2name" | grep resolve_lib_name >/dev/null
286 then
287 # We have reworked collect2
288 hardcode_direct=yes
289 else
290 # We have old collect2
291 hardcode_direct=unsupported
292 # It fails to find uninstalled libraries when the uninstalled
293 # path is not listed in the libpath. Setting hardcode_minus_L
294 # to unsupported forces relinking
295 hardcode_minus_L=yes
296 hardcode_libdir_flag_spec='-L$libdir'
297 hardcode_libdir_separator=
299 esac
300 shared_flag='-shared'
301 else
302 # not using gcc
303 if test "$host_cpu" = ia64; then
304 shared_flag='${wl}-G'
305 else
306 shared_flag='${wl}-bM:SRE'
310 if test "$host_cpu" = ia64; then
311 # On IA64, the linker does run time linking by default, so we don't
312 # have to do anything special.
313 aix_use_runtimelinking=no
314 exp_sym_flag='-Bexport'
315 no_entry_flag=""
316 else
317 # Test if we are trying to use run time linking, or normal AIX style linking.
318 # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
319 aix_use_runtimelinking=no
320 for ld_flag in $LDFLAGS; do
321 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
322 aix_use_runtimelinking=yes
323 break
325 done
326 exp_sym_flag='-bexport'
327 no_entry_flag='-bnoentry'
329 # -bexpall does not export symbols beginning with underscore (_)
330 always_export_symbols=yes
331 if test "$aix_use_runtimelinking" = yes; then
332 # Warning - without using the other run time loading flags (-brtl), -berok will
333 # link without error, but may produce a broken library.
334 allow_undefined_flag=' ${wl}-berok'
335 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
336 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
337 else
338 if test "$host_cpu" = ia64; then
339 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
340 allow_undefined_flag="-z nodefs"
341 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
342 else
343 allow_undefined_flag=' ${wl}-berok'
344 # -bexpall does not export symbols beginning with underscore (_)
345 always_export_symbols=yes
346 # Exported symbols can be pulled into shared objects from archives
347 whole_archive_flag_spec=' '
348 build_libtool_need_lc=yes
349 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
350 # This is similar to how AIX traditionally builds it's shared libraries.
351 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'
356 amigaos*)
357 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)'
358 hardcode_libdir_flag_spec='-L$libdir'
359 hardcode_minus_L=yes
360 # see comment about different semantics on the GNU ld section
361 ld_shlibs=no
364 cygwin* | mingw*)
365 # When not using gcc, we currently assume that we are using
366 # Microsoft Visual C++.
367 # hardcode_libdir_flag_spec is actually meaningless, as there is
368 # no search path for DLLs.
369 hardcode_libdir_flag_spec=' '
370 allow_undefined_flag=unsupported
371 # Tell ltmain to make .lib files, not .a files.
372 libext=lib
373 # FIXME: Setting linknames here is a bad hack.
374 archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
375 # The linker will automatically build a .lib file if we build a DLL.
376 old_archive_from_new_cmds='true'
377 # FIXME: Should let the user specify the lib program.
378 old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
379 fix_srcfile_path='`cygpath -w "$srcfile"`'
382 freebsd1*)
383 ld_shlibs=no
386 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
387 # support. Future versions do this automatically, but an explicit c++rt0.o
388 # does not break anything, and helps significantly (at the cost of a little
389 # extra space).
390 freebsd2.2*)
391 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
392 hardcode_libdir_flag_spec='-R$libdir'
393 hardcode_direct=yes
394 hardcode_shlibpath_var=no
397 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
398 freebsd2*)
399 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
400 hardcode_direct=yes
401 hardcode_minus_L=yes
402 hardcode_shlibpath_var=no
405 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
406 freebsd*)
407 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
408 hardcode_libdir_flag_spec='-R$libdir'
409 hardcode_direct=yes
410 hardcode_shlibpath_var=no
413 hpux9* | hpux10* | hpux11*)
414 case $host_os in
415 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' ;;
416 *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
417 esac
418 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
419 hardcode_libdir_separator=:
420 hardcode_direct=yes
421 hardcode_minus_L=yes # Not in the search PATH, but as the default
422 # location of the library.
423 export_dynamic_flag_spec='${wl}-E'
426 irix5* | irix6*)
427 if test "$with_gcc" = yes; then
428 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'
429 else
430 archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
432 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
433 hardcode_libdir_separator=:
434 link_all_deplibs=yes
437 netbsd*)
438 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
439 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
440 else
441 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
443 hardcode_libdir_flag_spec='-R$libdir'
444 hardcode_direct=yes
445 hardcode_shlibpath_var=no
448 newsos6)
449 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
450 hardcode_direct=yes
451 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
452 hardcode_libdir_separator=:
453 hardcode_shlibpath_var=no
456 openbsd*)
457 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
458 hardcode_libdir_flag_spec='-R$libdir'
459 hardcode_direct=yes
460 hardcode_shlibpath_var=no
463 os2*)
464 hardcode_libdir_flag_spec='-L$libdir'
465 hardcode_minus_L=yes
466 allow_undefined_flag=unsupported
467 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'
468 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
471 osf3*)
472 if test "$with_gcc" = yes; then
473 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
474 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'
475 else
476 allow_undefined_flag=' -expect_unresolved \*'
477 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'
479 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
480 hardcode_libdir_separator=:
483 osf4* | osf5*) # as osf3* with the addition of -msym flag
484 if test "$with_gcc" = yes; then
485 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
486 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'
487 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
488 else
489 allow_undefined_flag=' -expect_unresolved \*'
490 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'
491 archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
492 $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
494 # cc supports -rpath directly
495 hardcode_libdir_flag_spec='-rpath $libdir'
497 hardcode_libdir_separator=:
500 sco3.2v5*)
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
507 solaris*)
508 no_undefined_flag=' -z defs'
509 # $CC -shared without GNU ld will not create a library from C++
510 # object files and a static libstdc++, better avoid it by now
511 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
512 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
513 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
514 hardcode_libdir_flag_spec='-R$libdir'
515 hardcode_shlibpath_var=no
516 case $host_os in
517 solaris2.[0-5] | solaris2.[0-5].*) ;;
518 *) # Supported since Solaris 2.6 (maybe 2.5.1?)
519 whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
520 esac
521 link_all_deplibs=yes
524 sunos4*)
525 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
526 hardcode_libdir_flag_spec='-L$libdir'
527 hardcode_direct=yes
528 hardcode_minus_L=yes
529 hardcode_shlibpath_var=no
532 sysv4)
533 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
534 runpath_var='LD_RUN_PATH'
535 hardcode_shlibpath_var=no
536 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
539 sysv4.3*)
540 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
541 hardcode_shlibpath_var=no
542 export_dynamic_flag_spec='-Bexport'
545 sysv5*)
546 no_undefined_flag=' -z text'
547 # $CC -shared without GNU ld will not create a library from C++
548 # object files and a static libstdc++, better avoid it by now
549 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
550 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
551 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
552 hardcode_libdir_flag_spec=
553 hardcode_shlibpath_var=no
554 runpath_var='LD_RUN_PATH'
557 uts4*)
558 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
559 hardcode_libdir_flag_spec='-L$libdir'
560 hardcode_shlibpath_var=no
563 dgux*)
564 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
565 hardcode_libdir_flag_spec='-L$libdir'
566 hardcode_shlibpath_var=no
569 sysv4*MP*)
570 if test -d /usr/nec; then
571 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
572 hardcode_shlibpath_var=no
573 runpath_var=LD_RUN_PATH
574 hardcode_runpath_var=yes
575 ld_shlibs=yes
579 sysv4.2uw2*)
580 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
581 hardcode_direct=yes
582 hardcode_minus_L=no
583 hardcode_shlibpath_var=no
584 hardcode_runpath_var=yes
585 runpath_var=LD_RUN_PATH
588 unixware7*)
589 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
590 runpath_var='LD_RUN_PATH'
591 hardcode_shlibpath_var=no
595 ld_shlibs=no
597 esac
600 ## Compiler Characteristics: PIC flags, static flags, etc
601 if test "X${ac_cv_prog_cc_pic+set}" = Xset; then
603 else
604 ac_cv_prog_cc_pic=
605 ac_cv_prog_cc_shlib=
606 ac_cv_prog_cc_wl=
607 ac_cv_prog_cc_static=
608 ac_cv_prog_cc_no_builtin=
609 ac_cv_prog_cc_can_build_shared=$can_build_shared
611 if test "$with_gcc" = yes; then
612 ac_cv_prog_cc_wl='-Wl,'
613 ac_cv_prog_cc_static='-static'
615 case $host_os in
616 aix*)
617 # All AIX code is PIC.
618 if test "$host_cpu" = ia64; then
619 # AIX 5 now supports IA64 processor
620 lt_cv_prog_cc_static='-Bstatic'
621 else
622 lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
625 amigaos*)
626 # FIXME: we need at least 68020 code to build shared libraries, but
627 # adding the `-m68020' flag to GCC prevents building anything better,
628 # like `-m68040'.
629 ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
631 beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
632 # PIC is the default for these OSes.
634 cygwin* | mingw* | os2*)
635 # This hack is so that the source file can tell whether it is being
636 # built for inclusion in a dll (and should export symbols for example).
637 ac_cv_prog_cc_pic='-DDLL_EXPORT'
639 darwin* | rhapsody*)
640 # PIC is the default on this platform
641 # Common symbols not allowed in MH_DYLIB files
642 lt_cv_prog_cc_pic='-fno-common'
644 *djgpp*)
645 # DJGPP does not support shared libraries at all
646 ac_cv_prog_cc_pic=
648 sysv4*MP*)
649 if test -d /usr/nec; then
650 ac_cv_prog_cc_pic=-Kconform_pic
654 ac_cv_prog_cc_pic='-fPIC'
656 esac
657 else
658 # PORTME Check for PIC flags for the system compiler.
659 case $host_os in
660 aix*)
661 # All AIX code is PIC.
662 ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
665 hpux9* | hpux10* | hpux11*)
666 # Is there a better ac_cv_prog_cc_static that works with the bundled CC?
667 ac_cv_prog_cc_wl='-Wl,'
668 ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
669 ac_cv_prog_cc_pic='+Z'
672 irix5* | irix6*)
673 ac_cv_prog_cc_wl='-Wl,'
674 ac_cv_prog_cc_static='-non_shared'
675 # PIC (with -KPIC) is the default.
678 cygwin* | mingw* | os2*)
679 # This hack is so that the source file can tell whether it is being
680 # built for inclusion in a dll (and should export symbols for example).
681 ac_cv_prog_cc_pic='-DDLL_EXPORT'
684 newsos6)
685 ac_cv_prog_cc_pic='-KPIC'
686 ac_cv_prog_cc_static='-Bstatic'
689 osf3* | osf4* | osf5*)
690 # All OSF/1 code is PIC.
691 ac_cv_prog_cc_wl='-Wl,'
692 ac_cv_prog_cc_static='-non_shared'
695 sco3.2v5*)
696 ac_cv_prog_cc_pic='-Kpic'
697 ac_cv_prog_cc_static='-dn'
698 ac_cv_prog_cc_shlib='-belf'
701 solaris*)
702 ac_cv_prog_cc_pic='-KPIC'
703 ac_cv_prog_cc_static='-Bstatic'
704 ac_cv_prog_cc_wl='-Wl,'
707 sunos4*)
708 ac_cv_prog_cc_pic='-PIC'
709 ac_cv_prog_cc_static='-Bstatic'
710 ac_cv_prog_cc_wl='-Qoption ld '
713 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
714 ac_cv_prog_cc_pic='-KPIC'
715 ac_cv_prog_cc_static='-Bstatic'
716 ac_cv_prog_cc_wl='-Wl,'
719 uts4*)
720 ac_cv_prog_cc_pic='-pic'
721 ac_cv_prog_cc_static='-Bstatic'
724 sysv4*MP*)
725 if test -d /usr/nec ;then
726 ac_cv_prog_cc_pic='-Kconform_pic'
727 ac_cv_prog_cc_static='-Bstatic'
732 ac_cv_prog_cc_can_build_shared=no
734 esac
736 case "$host_os" in
737 # Platforms which do not suport PIC and -DPIC is meaningless
738 # on them:
739 *djgpp*)
740 ac_cv_prog_cc_pic=
743 ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
745 esac
748 need_lc=yes
749 if test "$enable_shared" = yes && test "$with_gcc" = yes; then
750 case $archive_cmds in
751 *'~'*)
752 # FIXME: we may have to deal with multi-command sequences.
754 '$CC '*)
755 # Test whether the compiler implicitly links with -lc since on some
756 # systems, -lgcc has to come before -lc. If gcc already passes -lc
757 # to ld, don't add -lc before -lgcc.
758 echo $ac_n "checking whether -lc should be explicitly linked in... $ac_c" 1>&6
759 if eval "test \"`echo '$''{'ac_cv_archive_cmds_needs_lc'+set}'`\" = set"; then
760 echo $ac_n "(cached) $ac_c" 1>&6
761 need_lc=$ac_cv_archive_cmds_needs_lc
762 else
763 $rm conftest*
764 echo "static int dummy;" > conftest.$ac_ext
765 if { (eval echo ltcf-c.sh:need_lc: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
766 # Append any warnings to the config.log.
767 cat conftest.err 1>&5
768 soname=conftest
769 lib=conftest
770 libobjs=conftest.$ac_objext
771 deplibs=
772 wl=$ac_cv_prog_cc_wl
773 compiler_flags=-v
774 linker_flags=-v
775 verstring=
776 output_objdir=.
777 libname=conftest
778 save_allow_undefined_flag=$allow_undefined_flag
779 allow_undefined_flag=
780 if { (eval echo ltcf-c.sh:need_lc: \"$archive_cmds\") 1>&5; (eval $archive_cmds) 2>&1 | grep " -lc " 1>&5 ; }; then
781 need_lc=no
783 allow_undefined_flag=$save_allow_undefined_flag
784 else
785 cat conftest.err 1>&5
788 $rm conftest*
789 echo "$ac_t$need_lc" 1>&6
791 esac
793 ac_cv_archive_cmds_needs_lc=$need_lc