2 #### This script is meant to be sourced by ltconfig.
4 # ltcf-c.sh - Create a C compiler specific configuration
6 # Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc.
7 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
9 # This file is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
29 # Source file extension for C test sources.
32 # Object file extension for compiled C test sources.
35 # Code to be used in simple compile tests
36 lt_simple_compile_test_code="int some_variable = 0;\n"
38 # Code to be used in simple link tests
39 lt_simple_link_test_code="main(){return(0);}\n"
41 ## Linker Characteristics
44 # FIXME: the MSVC++ port hasn't been tested in a loooong time
45 # When not using gcc, we currently assume that we are using
46 # Microsoft Visual C++.
47 if test "$with_gcc" != yes; then
55 if test "$with_gnu_ld" = yes; then
56 # If archive_cmds runs LD, not CC, wlarc should be empty
59 # See if GNU ld supports shared libraries.
61 aix3* | aix4* | aix5*)
62 # On AIX, the GNU linker is very broken
66 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
67 *** to be unable to reliably create shared libraries on AIX.
68 *** Therefore, libtool is disabling shared libraries support. If you
69 *** really care for shared libraries, you may want to modify your PATH
70 *** so that a non-GNU linker is found, and then restart.
76 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)'
77 hardcode_libdir_flag_spec='-L$libdir'
80 # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
81 # that the semantics of dynamic libraries on AmigaOS, at least up
82 # to version 4, is to share data among multiple programs linked
83 # with the same dynamic library. Since this doesn't match the
84 # behavior of shared libraries on other platforms, we can use
90 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
91 allow_undefined_flag=unsupported
92 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
93 # support --undefined. This deserves some investigation. FIXME
94 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
101 # hardcode_libdir_flag_spec is actually meaningless, as there is
102 # no search path for DLLs.
103 hardcode_libdir_flag_spec='-L$libdir'
104 allow_undefined_flag=unsupported
105 always_export_symbols=yes
107 extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
108 sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~
109 test -f $output_objdir/impgen.exe || (cd $output_objdir && \
110 if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
111 else $CC -o impgen impgen.c ; fi)~
112 $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
114 old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
116 # cygwin and mingw dlls have different entry points and sets of symbols
118 # FIXME: what about values for MSVC?
119 dll_entry=__cygwin_dll_entry@12
120 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
124 dll_entry=_DllMainCRTStartup@12
125 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
129 # mingw and cygwin differ, and it's simplest to just exclude the union
130 # of the two symbol sets.
131 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
133 # recent cygwin and mingw systems supply a stub DllMain which the user
134 # can override, but on older systems we have to supply one (in ltdll.c)
135 if test "x$lt_cv_need_dllmain" = "xyes"; then
136 ltdll_obj='$output_objdir/$soname-ltdll.'"$objext "
137 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~
138 test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
144 # Extract the symbol export list from an `--export-all' def file,
145 # then regenerate the def file from the symbol export list, so that
146 # the compiled dll only exports the symbol export list.
147 # Be careful not to strip the DATA tag left be newer dlltools.
148 export_symbols_cmds="$ltdll_cmds"'
149 $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
150 sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
152 # If the export-symbols file already is a .def file (1st line
153 # is EXPORTS), use it as is.
154 # If DATA tags from a recent dlltool are present, honour them!
155 archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
156 cp $export_symbols $output_objdir/$soname-def;
158 echo EXPORTS > $output_objdir/$soname-def;
160 cat $export_symbols | while read symbol; do
163 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
164 *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
166 _lt_hint=`expr 1 + \$_lt_hint`;
170 $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~
171 $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~
172 $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~
173 $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~
174 $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
178 allow_undefined_flag='-undefined suppress'
179 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`'
180 # We need to add '_' to the symbols in $export_symbols first
181 #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
183 hardcode_shlibpath_var=no
184 whole_archive_flag_spec='-all_load $convenience'
188 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
189 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
192 archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
193 archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
198 if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
202 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
203 *** create shared libraries on Solaris systems. Therefore, libtool
204 *** is disabling shared libraries support. We urge you to upgrade GNU
205 *** binutils to release 2.9.1 or newer. Another option is to modify
206 *** your PATH or compiler configuration so that the native linker is
207 *** used, and then restart.
210 elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
211 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
212 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
219 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
222 hardcode_shlibpath_var=no
226 # This catches the Portland compilers on linux/intel
230 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
231 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
232 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
239 if test "$ld_shlibs" = yes; then
240 runpath_var=LD_RUN_PATH
241 hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
242 export_dynamic_flag_spec='${wl}--export-dynamic'
245 # dlltool doesn't understand --whole-archive et. al.
246 whole_archive_flag_spec=
249 # ancient GNU ld didn't support --whole-archive et. al.
250 if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
251 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
253 whole_archive_flag_spec=
259 # PORTME fill in a description of your system's linker (not GNU ld)
262 allow_undefined_flag=unsupported
263 always_export_symbols=yes
264 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'
265 # Note: this linker hardcodes the directories in LIBPATH if there
266 # are no directories specified by -L.
268 if test "$with_gcc" = yes && test -z "$link_static_flag"; then
269 # Neither direct hardcoding nor static linking is supported with a
271 hardcode_direct=unsupported
277 hardcode_libdir_separator=':'
279 # When large executables or shared objects are built, AIX ld can
280 # have problems creating the table of contents. If linking a library
281 # or program results in "error TOC overflow" add -mminimal-toc to
282 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
283 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
284 if test "$with_gcc" = yes; then
285 case $host_os in aix4.[012]|aix4.[012].*)
286 # We only want to do this on AIX 4.2 and lower, the check
287 # below for broken collect2 doesn't work under 4.3+
288 collect2name=`${CC} -print-prog-name=collect2`
289 if test -f "$collect2name" && \
290 strings "$collect2name" | grep resolve_lib_name >/dev/null
292 # We have reworked collect2
295 # We have old collect2
296 hardcode_direct=unsupported
297 # It fails to find uninstalled libraries when the uninstalled
298 # path is not listed in the libpath. Setting hardcode_minus_L
299 # to unsupported forces relinking
301 hardcode_libdir_flag_spec='-L$libdir'
302 hardcode_libdir_separator=
305 shared_flag='-shared'
308 if test "$host_cpu" = ia64; then
309 shared_flag='${wl}-G'
311 shared_flag='${wl}-bM:SRE'
315 if test "$host_cpu" = ia64; then
316 # On IA64, the linker does run time linking by default, so we don't
317 # have to do anything special.
318 aix_use_runtimelinking=no
319 exp_sym_flag='-Bexport'
322 # Test if we are trying to use run time linking, or normal AIX style linking.
323 # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
324 aix_use_runtimelinking=no
325 for ld_flag in $LDFLAGS; do
326 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
327 aix_use_runtimelinking=yes
331 exp_sym_flag='-bexport'
332 no_entry_flag='-bnoentry'
334 # -bexpall does not export symbols beginning with underscore (_)
335 always_export_symbols=yes
336 if test "$aix_use_runtimelinking" = yes; then
337 # Warning - without using the other run time loading flags (-brtl), -berok will
338 # link without error, but may produce a broken library.
339 allow_undefined_flag=' ${wl}-berok'
340 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
341 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"
343 if test "$host_cpu" = ia64; then
344 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
345 allow_undefined_flag="-z nodefs"
346 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"
348 allow_undefined_flag=' ${wl}-berok'
349 # -bexpall does not export symbols beginning with underscore (_)
350 always_export_symbols=yes
351 # Exported symbols can be pulled into shared objects from archives
352 whole_archive_flag_spec=' '
353 build_libtool_need_lc=yes
354 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
355 # This is similar to how AIX traditionally builds it's shared libraries.
356 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'
362 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)'
363 hardcode_libdir_flag_spec='-L$libdir'
365 # see comment about different semantics on the GNU ld section
370 # When not using gcc, we currently assume that we are using
371 # Microsoft Visual C++.
372 # hardcode_libdir_flag_spec is actually meaningless, as there is
373 # no search path for DLLs.
374 hardcode_libdir_flag_spec=' '
375 allow_undefined_flag=unsupported
376 # Tell ltmain to make .lib files, not .a files.
378 # FIXME: Setting linknames here is a bad hack.
379 archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
380 # The linker will automatically build a .lib file if we build a DLL.
381 old_archive_from_new_cmds='true'
382 # FIXME: Should let the user specify the lib program.
383 old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
384 fix_srcfile_path='`cygpath -w "$srcfile"`'
391 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
392 # support. Future versions do this automatically, but an explicit c++rt0.o
393 # does not break anything, and helps significantly (at the cost of a little
396 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
397 hardcode_libdir_flag_spec='-R$libdir'
399 hardcode_shlibpath_var=no
402 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
404 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
407 hardcode_shlibpath_var=no
410 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
412 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
413 hardcode_libdir_flag_spec='-R$libdir'
415 hardcode_shlibpath_var=no
418 hpux9* | hpux10* | hpux11*)
420 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' ;;
421 *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
423 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
424 hardcode_libdir_separator=:
426 hardcode_minus_L=yes # Not in the search PATH, but as the default
427 # location of the library.
428 export_dynamic_flag_spec='${wl}-E'
432 if test "$with_gcc" = yes; then
433 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'
435 archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
437 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
438 hardcode_libdir_separator=:
443 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
444 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
446 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
448 hardcode_libdir_flag_spec='-R$libdir'
450 hardcode_shlibpath_var=no
454 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
456 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
457 hardcode_libdir_separator=:
458 hardcode_shlibpath_var=no
462 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
463 hardcode_libdir_flag_spec='-R$libdir'
465 hardcode_shlibpath_var=no
469 hardcode_libdir_flag_spec='-L$libdir'
471 allow_undefined_flag=unsupported
472 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'
473 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
477 if test "$with_gcc" = yes; then
478 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
479 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'
481 allow_undefined_flag=' -expect_unresolved \*'
482 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'
484 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
485 hardcode_libdir_separator=:
488 osf4* | osf5*) # as osf3* with the addition of -msym flag
489 if test "$with_gcc" = yes; then
490 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
491 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'
492 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
494 allow_undefined_flag=' -expect_unresolved \*'
495 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'
496 archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
497 $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'
499 # cc supports -rpath directly
500 hardcode_libdir_flag_spec='-rpath $libdir'
502 hardcode_libdir_separator=:
506 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
507 hardcode_shlibpath_var=no
508 runpath_var=LD_RUN_PATH
509 hardcode_runpath_var=yes
513 no_undefined_flag=' -z defs'
514 # $CC -shared without GNU ld will not create a library from C++
515 # object files and a static libstdc++, better avoid it by now
516 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
517 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
518 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
519 hardcode_libdir_flag_spec='-R$libdir'
520 hardcode_shlibpath_var=no
522 solaris2.[0-5] | solaris2.[0-5].*) ;;
523 *) # Supported since Solaris 2.6 (maybe 2.5.1?)
524 whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
530 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
531 hardcode_libdir_flag_spec='-L$libdir'
534 hardcode_shlibpath_var=no
538 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
539 runpath_var='LD_RUN_PATH'
540 hardcode_shlibpath_var=no
541 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
545 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
546 hardcode_shlibpath_var=no
547 export_dynamic_flag_spec='-Bexport'
551 no_undefined_flag=' -z text'
552 # $CC -shared without GNU ld will not create a library from C++
553 # object files and a static libstdc++, better avoid it by now
554 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
555 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
556 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
557 hardcode_libdir_flag_spec=
558 hardcode_shlibpath_var=no
559 runpath_var='LD_RUN_PATH'
563 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
564 hardcode_libdir_flag_spec='-L$libdir'
565 hardcode_shlibpath_var=no
569 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
570 hardcode_libdir_flag_spec='-L$libdir'
571 hardcode_shlibpath_var=no
575 if test -d /usr/nec; then
576 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
577 hardcode_shlibpath_var=no
578 runpath_var=LD_RUN_PATH
579 hardcode_runpath_var=yes
585 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
588 hardcode_shlibpath_var=no
589 hardcode_runpath_var=yes
590 runpath_var=LD_RUN_PATH
593 sysv5uw7* | unixware7*)
594 no_undefined_flag='${wl}-z ${wl}text'
595 if test "$GCC" = yes; then
596 archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
598 archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
600 runpath_var='LD_RUN_PATH'
601 hardcode_shlibpath_var=no
610 ## Compiler Characteristics: PIC flags, static flags, etc
611 if test "X${ac_cv_prog_cc_pic+set}" = Xset; then
617 ac_cv_prog_cc_static=
618 ac_cv_prog_cc_no_builtin=
619 ac_cv_prog_cc_can_build_shared=$can_build_shared
621 if test "$with_gcc" = yes; then
622 ac_cv_prog_cc_wl='-Wl,'
623 ac_cv_prog_cc_static='-static'
627 # All AIX code is PIC.
628 if test "$host_cpu" = ia64; then
629 # AIX 5 now supports IA64 processor
630 lt_cv_prog_cc_static='-Bstatic'
632 lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
636 # FIXME: we need at least 68020 code to build shared libraries, but
637 # adding the `-m68020' flag to GCC prevents building anything better,
639 ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
641 beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
642 # PIC is the default for these OSes.
644 cygwin* | mingw* | os2*)
645 # This hack is so that the source file can tell whether it is being
646 # built for inclusion in a dll (and should export symbols for example).
647 ac_cv_prog_cc_pic='-DDLL_EXPORT'
650 # PIC is the default on this platform
651 # Common symbols not allowed in MH_DYLIB files
652 lt_cv_prog_cc_pic='-fno-common'
655 # DJGPP does not support shared libraries at all
659 if test -d /usr/nec; then
660 ac_cv_prog_cc_pic=-Kconform_pic
664 ac_cv_prog_cc_pic='-fPIC'
668 # PORTME Check for PIC flags for the system compiler.
671 # All AIX code is PIC.
672 ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
675 hpux9* | hpux10* | hpux11*)
676 # Is there a better ac_cv_prog_cc_static that works with the bundled CC?
677 ac_cv_prog_cc_wl='-Wl,'
678 ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
679 ac_cv_prog_cc_pic='+Z'
683 ac_cv_prog_cc_wl='-Wl,'
684 ac_cv_prog_cc_static='-non_shared'
685 # PIC (with -KPIC) is the default.
688 cygwin* | mingw* | os2*)
689 # This hack is so that the source file can tell whether it is being
690 # built for inclusion in a dll (and should export symbols for example).
691 ac_cv_prog_cc_pic='-DDLL_EXPORT'
695 ac_cv_prog_cc_pic='-KPIC'
696 ac_cv_prog_cc_static='-Bstatic'
699 osf3* | osf4* | osf5*)
700 # All OSF/1 code is PIC.
701 ac_cv_prog_cc_wl='-Wl,'
702 ac_cv_prog_cc_static='-non_shared'
706 ac_cv_prog_cc_pic='-Kpic'
707 ac_cv_prog_cc_static='-dn'
708 ac_cv_prog_cc_shlib='-belf'
712 ac_cv_prog_cc_pic='-KPIC'
713 ac_cv_prog_cc_static='-Bstatic'
714 ac_cv_prog_cc_wl='-Wl,'
718 ac_cv_prog_cc_pic='-PIC'
719 ac_cv_prog_cc_static='-Bstatic'
720 ac_cv_prog_cc_wl='-Qoption ld '
723 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
724 ac_cv_prog_cc_pic='-KPIC'
725 ac_cv_prog_cc_static='-Bstatic'
726 ac_cv_prog_cc_wl='-Wl,'
730 ac_cv_prog_cc_pic='-pic'
731 ac_cv_prog_cc_static='-Bstatic'
735 if test -d /usr/nec ;then
736 ac_cv_prog_cc_pic='-Kconform_pic'
737 ac_cv_prog_cc_static='-Bstatic'
742 ac_cv_prog_cc_can_build_shared=no
747 # Platforms which do not suport PIC and -DPIC is meaningless
753 ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
759 if test "$enable_shared" = yes && test "$with_gcc" = yes; then
760 case $archive_cmds in
762 # FIXME: we may have to deal with multi-command sequences.
765 # Test whether the compiler implicitly links with -lc since on some
766 # systems, -lgcc has to come before -lc. If gcc already passes -lc
767 # to ld, don't add -lc before -lgcc.
768 echo $ac_n "checking whether -lc should be explicitly linked in... $ac_c" 1>&6
769 if eval "test \"`echo '$''{'ac_cv_archive_cmds_needs_lc'+set}'`\" = set"; then
770 echo $ac_n "(cached) $ac_c" 1>&6
771 need_lc=$ac_cv_archive_cmds_needs_lc
774 echo "static int dummy;" > conftest.$ac_ext
775 if { (eval echo ltcf-c.sh:need_lc: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
776 # Append any warnings to the config.log.
777 cat conftest.err 1>&5
780 libobjs=conftest.$ac_objext
788 save_allow_undefined_flag=$allow_undefined_flag
789 allow_undefined_flag=
790 if { (eval echo ltcf-c.sh:need_lc: \"$archive_cmds\") 1>&5; (eval $archive_cmds) 2>&1 | grep " -lc " 1>&5 ; }; then
793 allow_undefined_flag=$save_allow_undefined_flag
795 cat conftest.err 1>&5
799 echo "$ac_t$need_lc" 1>&6
803 ac_cv_archive_cmds_needs_lc=$need_lc