103a78d15Sespie#### This script is meant to be sourced by ltconfig. 203a78d15Sespie 303a78d15Sespie# ltcf-c.sh - Create a C compiler specific configuration 403a78d15Sespie# 503a78d15Sespie# Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc. 603a78d15Sespie# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 703a78d15Sespie# 803a78d15Sespie# This file is free software; you can redistribute it and/or modify it 903a78d15Sespie# under the terms of the GNU General Public License as published by 1003a78d15Sespie# the Free Software Foundation; either version 2 of the License, or 1103a78d15Sespie# (at your option) any later version. 1203a78d15Sespie# 1303a78d15Sespie# This program is distributed in the hope that it will be useful, but 1403a78d15Sespie# WITHOUT ANY WARRANTY; without even the implied warranty of 1503a78d15Sespie# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1603a78d15Sespie# General Public License for more details. 1703a78d15Sespie# 1803a78d15Sespie# You should have received a copy of the GNU General Public License 1903a78d15Sespie# along with this program; if not, write to the Free Software 2003a78d15Sespie# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 2103a78d15Sespie# 2203a78d15Sespie# As a special exception to the GNU General Public License, if you 2303a78d15Sespie# distribute this file as part of a program that contains a 2403a78d15Sespie# configuration script generated by Autoconf, you may include it under 2503a78d15Sespie# the same distribution terms that you use for the rest of that program. 2603a78d15Sespie 2703a78d15Sespie 2803a78d15Sespie# Source file extension for C test sources. 2903a78d15Sespieac_ext=c 3003a78d15Sespie 3103a78d15Sespie# Object file extension for compiled C test sources. 3203a78d15Sespieobjext=o 3303a78d15Sespie 3403a78d15Sespie# Code to be used in simple compile tests 3503a78d15Sespielt_simple_compile_test_code="int some_variable = 0;" 3603a78d15Sespie 3703a78d15Sespie# Code to be used in simple link tests 3803a78d15Sespielt_simple_link_test_code='main(){return(0);}' 3903a78d15Sespie 4003a78d15Sespie## Linker Characteristics 4103a78d15Sespiecase $host_os in 4203a78d15Sespiecygwin* | mingw*) 4303a78d15Sespie # FIXME: the MSVC++ port hasn't been tested in a loooong time 4403a78d15Sespie # When not using gcc, we currently assume that we are using 4503a78d15Sespie # Microsoft Visual C++. 4603a78d15Sespie if test "$with_gcc" != yes; then 4703a78d15Sespie with_gnu_ld=no 4803a78d15Sespie fi 4903a78d15Sespie ;; 5003a78d15Sespie 5103a78d15Sespieesac 5203a78d15Sespie 5303a78d15Sespield_shlibs=yes 5403a78d15Sespieif test "$with_gnu_ld" = yes; then 5503a78d15Sespie # If archive_cmds runs LD, not CC, wlarc should be empty 5603a78d15Sespie wlarc='${wl}' 5703a78d15Sespie 5803a78d15Sespie # See if GNU ld supports shared libraries. 5903a78d15Sespie case $host_os in 6003a78d15Sespie aix3* | aix4* | aix5*) 6103a78d15Sespie # On AIX/PPC, the GNU linker is very broken 6203a78d15Sespie if test "$host_cpu" != ia64; then 6303a78d15Sespie ld_shlibs=no 6403a78d15Sespie cat <<EOF 1>&2 6503a78d15Sespie 6603a78d15Sespie*** Warning: the GNU linker, at least up to release 2.9.1, is reported 6703a78d15Sespie*** to be unable to reliably create shared libraries on AIX. 6803a78d15Sespie*** Therefore, libtool is disabling shared libraries support. If you 6903a78d15Sespie*** really care for shared libraries, you may want to modify your PATH 7003a78d15Sespie*** so that a non-GNU linker is found, and then restart. 7103a78d15Sespie 7203a78d15SespieEOF 7303a78d15Sespie fi 7403a78d15Sespie ;; 7503a78d15Sespie 7603a78d15Sespie amigaos*) 7703a78d15Sespie 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)' 7803a78d15Sespie hardcode_libdir_flag_spec='-L$libdir' 7903a78d15Sespie hardcode_minus_L=yes 8003a78d15Sespie 8103a78d15Sespie # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports 8203a78d15Sespie # that the semantics of dynamic libraries on AmigaOS, at least up 8303a78d15Sespie # to version 4, is to share data among multiple programs linked 8403a78d15Sespie # with the same dynamic library. Since this doesn't match the 8503a78d15Sespie # behavior of shared libraries on other platforms, we can use 8603a78d15Sespie # them. 8703a78d15Sespie ld_shlibs=no 8803a78d15Sespie ;; 8903a78d15Sespie 9003a78d15Sespie beos*) 9103a78d15Sespie if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then 9203a78d15Sespie allow_undefined_flag=unsupported 9303a78d15Sespie # Joseph Beckenbach <jrb3@best.com> says some releases of gcc 9403a78d15Sespie # support --undefined. This deserves some investigation. FIXME 9503a78d15Sespie archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 9603a78d15Sespie else 9703a78d15Sespie ld_shlibs=no 9803a78d15Sespie fi 9903a78d15Sespie ;; 10003a78d15Sespie 10103a78d15Sespie cygwin* | mingw*) 10203a78d15Sespie # hardcode_libdir_flag_spec is actually meaningless, as there is 10303a78d15Sespie # no search path for DLLs. 10403a78d15Sespie hardcode_libdir_flag_spec='-L$libdir' 10503a78d15Sespie allow_undefined_flag=unsupported 10603a78d15Sespie always_export_symbols=yes 10703a78d15Sespie 10803a78d15Sespie extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ 10903a78d15Sespie sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~ 11003a78d15Sespie test -f $output_objdir/impgen.exe || (cd $output_objdir && \ 11103a78d15Sespie if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ 11203a78d15Sespie else $CC -o impgen impgen.c ; fi)~ 11303a78d15Sespie $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' 11403a78d15Sespie 11503a78d15Sespie old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' 11603a78d15Sespie 11703a78d15Sespie # cygwin and mingw dlls have different entry points and sets of symbols 11803a78d15Sespie # to exclude. 11903a78d15Sespie # FIXME: what about values for MSVC? 12003a78d15Sespie dll_entry=__cygwin_dll_entry@12 12103a78d15Sespie dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ 12203a78d15Sespie case $host_os in 12303a78d15Sespie mingw*) 12403a78d15Sespie # mingw values 12503a78d15Sespie dll_entry=_DllMainCRTStartup@12 12603a78d15Sespie dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ 12703a78d15Sespie ;; 12803a78d15Sespie esac 12903a78d15Sespie 13003a78d15Sespie # mingw and cygwin differ, and it's simplest to just exclude the union 13103a78d15Sespie # of the two symbol sets. 13203a78d15Sespie dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 13303a78d15Sespie 13403a78d15Sespie # recent cygwin and mingw systems supply a stub DllMain which the user 13503a78d15Sespie # can override, but on older systems we have to supply one (in ltdll.c) 13603a78d15Sespie if test "x$lt_cv_need_dllmain" = "xyes"; then 13703a78d15Sespie ltdll_obj='$output_objdir/$soname-ltdll.'"$objext " 13803a78d15Sespie 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~ 13903a78d15Sespie test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' 14003a78d15Sespie else 14103a78d15Sespie ltdll_obj= 14203a78d15Sespie ltdll_cmds= 14303a78d15Sespie fi 14403a78d15Sespie 14503a78d15Sespie # Extract the symbol export list from an `--export-all' def file, 14603a78d15Sespie # then regenerate the def file from the symbol export list, so that 14703a78d15Sespie # the compiled dll only exports the symbol export list. 14803a78d15Sespie # Be careful not to strip the DATA tag left be newer dlltools. 14903a78d15Sespie export_symbols_cmds="$ltdll_cmds"' 15003a78d15Sespie $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ 15103a78d15Sespie sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' 15203a78d15Sespie 15303a78d15Sespie # If the export-symbols file already is a .def file (1st line 15403a78d15Sespie # is EXPORTS), use it as is. 15503a78d15Sespie # If DATA tags from a recent dlltool are present, honour them! 15603a78d15Sespie archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then 15703a78d15Sespie cp $export_symbols $output_objdir/$soname-def; 15803a78d15Sespie else 15903a78d15Sespie echo EXPORTS > $output_objdir/$soname-def; 16003a78d15Sespie _lt_hint=1; 16103a78d15Sespie cat $export_symbols | while read symbol; do 16203a78d15Sespie set dummy \$symbol; 16303a78d15Sespie case \[$]# in 16403a78d15Sespie 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; 16503a78d15Sespie *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; 16603a78d15Sespie esac; 16703a78d15Sespie _lt_hint=`expr 1 + \$_lt_hint`; 16803a78d15Sespie done; 16903a78d15Sespie fi~ 17003a78d15Sespie '"$ltdll_cmds"' 17103a78d15Sespie $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~ 17203a78d15Sespie $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~ 17303a78d15Sespie $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~ 17403a78d15Sespie $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~ 17503a78d15Sespie $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' 17603a78d15Sespie ;; 17703a78d15Sespie 17803a78d15Sespie darwin* | rhapsody*) 17903a78d15Sespie allow_undefined_flag='-undefined suppress' 18003a78d15Sespie 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`' 18103a78d15Sespie # We need to add '_' to the symbols in $export_symbols first 18203a78d15Sespie #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' 18303a78d15Sespie hardcode_direct=yes 18403a78d15Sespie hardcode_shlibpath_var=no 18503a78d15Sespie whole_archive_flag_spec='-all_load $convenience' 18603a78d15Sespie ;; 18703a78d15Sespie 18803a78d15Sespie netbsd*) 18903a78d15Sespie if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then 19003a78d15Sespie archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' 19103a78d15Sespie wlarc= 19203a78d15Sespie else 19303a78d15Sespie archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 19403a78d15Sespie archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' 19503a78d15Sespie fi 19603a78d15Sespie ;; 19703a78d15Sespie 19803a78d15Sespie solaris* | sysv5*) 19903a78d15Sespie if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then 20003a78d15Sespie ld_shlibs=no 20103a78d15Sespie cat <<EOF 1>&2 20203a78d15Sespie 20303a78d15Sespie*** Warning: The releases 2.8.* of the GNU linker cannot reliably 20403a78d15Sespie*** create shared libraries on Solaris systems. Therefore, libtool 20503a78d15Sespie*** is disabling shared libraries support. We urge you to upgrade GNU 20603a78d15Sespie*** binutils to release 2.9.1 or newer. Another option is to modify 20703a78d15Sespie*** your PATH or compiler configuration so that the native linker is 20803a78d15Sespie*** used, and then restart. 20903a78d15Sespie 21003a78d15SespieEOF 21103a78d15Sespie elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then 21203a78d15Sespie archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 21303a78d15Sespie archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' 21403a78d15Sespie else 21503a78d15Sespie ld_shlibs=no 21603a78d15Sespie fi 21703a78d15Sespie ;; 21803a78d15Sespie 21903a78d15Sespie sunos4*) 22003a78d15Sespie archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' 22103a78d15Sespie wlarc= 22203a78d15Sespie hardcode_direct=yes 22303a78d15Sespie hardcode_shlibpath_var=no 22403a78d15Sespie ;; 22503a78d15Sespie 22603a78d15Sespie *) 22703a78d15Sespie if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then 22803a78d15Sespie archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 22903a78d15Sespie archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' 23003a78d15Sespie else 23103a78d15Sespie ld_shlibs=no 23203a78d15Sespie fi 23303a78d15Sespie ;; 23403a78d15Sespie esac 23503a78d15Sespie 23603a78d15Sespie if test "$ld_shlibs" = yes; then 23703a78d15Sespie runpath_var=LD_RUN_PATH 23803a78d15Sespie hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' 23903a78d15Sespie export_dynamic_flag_spec='${wl}--export-dynamic' 24003a78d15Sespie case $host_os in 24103a78d15Sespie cygwin* | mingw*) 24203a78d15Sespie # dlltool doesn't understand --whole-archive et. al. 24303a78d15Sespie whole_archive_flag_spec= 24403a78d15Sespie ;; 24503a78d15Sespie *) 24603a78d15Sespie # ancient GNU ld didn't support --whole-archive et. al. 24703a78d15Sespie if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then 24803a78d15Sespie whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' 24903a78d15Sespie else 25003a78d15Sespie whole_archive_flag_spec= 25103a78d15Sespie fi 25203a78d15Sespie ;; 25303a78d15Sespie esac 25403a78d15Sespie fi 25503a78d15Sespieelse 25603a78d15Sespie # PORTME fill in a description of your system's linker (not GNU ld) 25703a78d15Sespie case $host_os in 25803a78d15Sespie aix3*) 25903a78d15Sespie allow_undefined_flag=unsupported 26003a78d15Sespie always_export_symbols=yes 26103a78d15Sespie 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' 26203a78d15Sespie # Note: this linker hardcodes the directories in LIBPATH if there 26303a78d15Sespie # are no directories specified by -L. 26403a78d15Sespie hardcode_minus_L=yes 26503a78d15Sespie if test "$with_gcc" = yes && test -z "$link_static_flag"; then 26603a78d15Sespie # Neither direct hardcoding nor static linking is supported with a 26703a78d15Sespie # broken collect2. 26803a78d15Sespie hardcode_direct=unsupported 26903a78d15Sespie fi 27003a78d15Sespie ;; 27103a78d15Sespie 27203a78d15Sespie aix4* | aix5*) 27303a78d15Sespie hardcode_direct=yes 27403a78d15Sespie hardcode_libdir_separator=':' 27503a78d15Sespie link_all_deplibs=yes 27603a78d15Sespie # When large executables or shared objects are built, AIX ld can 27703a78d15Sespie # have problems creating the table of contents. If linking a library 27803a78d15Sespie # or program results in "error TOC overflow" add -mminimal-toc to 27903a78d15Sespie # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not 28003a78d15Sespie # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. 28103a78d15Sespie if test "$with_gcc" = yes; then 28203a78d15Sespie case $host_os in aix4.[012]|aix4.[012].*) 28303a78d15Sespie # We only want to do this on AIX 4.2 and lower, the check 28403a78d15Sespie # below for broken collect2 doesn't work under 4.3+ 28503a78d15Sespie collect2name=`${CC} -print-prog-name=collect2` 28603a78d15Sespie if test -f "$collect2name" && \ 28703a78d15Sespie strings "$collect2name" | grep resolve_lib_name >/dev/null 28803a78d15Sespie then 28903a78d15Sespie # We have reworked collect2 29003a78d15Sespie hardcode_direct=yes 29103a78d15Sespie else 29203a78d15Sespie # We have old collect2 29303a78d15Sespie hardcode_direct=unsupported 29403a78d15Sespie # It fails to find uninstalled libraries when the uninstalled 29503a78d15Sespie # path is not listed in the libpath. Setting hardcode_minus_L 29603a78d15Sespie # to unsupported forces relinking 29703a78d15Sespie hardcode_minus_L=yes 29803a78d15Sespie hardcode_libdir_flag_spec='-L$libdir' 29903a78d15Sespie hardcode_libdir_separator= 30003a78d15Sespie fi 30103a78d15Sespie esac 30203a78d15Sespie shared_flag='-shared' 30303a78d15Sespie else 30403a78d15Sespie # not using gcc 30503a78d15Sespie if test "$host_cpu" = ia64; then 30603a78d15Sespie shared_flag='${wl}-G' 30703a78d15Sespie else 30803a78d15Sespie shared_flag='${wl}-bM:SRE' 30903a78d15Sespie fi 31003a78d15Sespie fi 31103a78d15Sespie 31203a78d15Sespie if test "$host_cpu" = ia64; then 31303a78d15Sespie # On IA64, the linker does run time linking by default, so we don't 31403a78d15Sespie # have to do anything special. 31503a78d15Sespie aix_use_runtimelinking=no 31603a78d15Sespie if test $with_gnu_ld = no; then 31703a78d15Sespie exp_sym_flag='-Bexport' 31803a78d15Sespie no_entry_flag="" 31903a78d15Sespie fi 32003a78d15Sespie else 32103a78d15Sespie # Test if we are trying to use run time linking, or normal AIX style linking. 32203a78d15Sespie # If -brtl is somewhere in LDFLAGS, we need to do run time linking. 32303a78d15Sespie aix_use_runtimelinking=no 32403a78d15Sespie for ld_flag in $LDFLAGS; do 32503a78d15Sespie if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then 32603a78d15Sespie aix_use_runtimelinking=yes 32703a78d15Sespie break 32803a78d15Sespie fi 32903a78d15Sespie done 33003a78d15Sespie exp_sym_flag='-bexport' 33103a78d15Sespie no_entry_flag='-bnoentry' 33203a78d15Sespie fi 33303a78d15Sespie # -bexpall does not export symbols beginning with underscore (_) 33403a78d15Sespie always_export_symbols=yes 33503a78d15Sespie if test "$aix_use_runtimelinking" = yes; then 33603a78d15Sespie # Warning - without using the other run time loading flags (-brtl), -berok will 33703a78d15Sespie # link without error, but may produce a broken library. 33803a78d15Sespie allow_undefined_flag=' ${wl}-berok' 33903a78d15Sespie hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' 34003a78d15Sespie 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" 34103a78d15Sespie else 34203a78d15Sespie if test "$host_cpu" = ia64; then 34303a78d15Sespie if test $with_gnu_ld = no; then 34403a78d15Sespie hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' 34503a78d15Sespie allow_undefined_flag="-z nodefs" 34603a78d15Sespie 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" 34703a78d15Sespie fi 34803a78d15Sespie else 34903a78d15Sespie allow_undefined_flag=' ${wl}-berok' 35003a78d15Sespie # -bexpall does not export symbols beginning with underscore (_) 35103a78d15Sespie always_export_symbols=yes 35203a78d15Sespie # Exported symbols can be pulled into shared objects from archives 35303a78d15Sespie whole_archive_flag_spec=' ' 35403a78d15Sespie build_libtool_need_lc=yes 35503a78d15Sespie hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' 35603a78d15Sespie # This is similar to how AIX traditionally builds it's shared libraries. 35703a78d15Sespie 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' 35803a78d15Sespie fi 35903a78d15Sespie fi 36003a78d15Sespie ;; 36103a78d15Sespie 36203a78d15Sespie amigaos*) 36303a78d15Sespie 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)' 36403a78d15Sespie hardcode_libdir_flag_spec='-L$libdir' 36503a78d15Sespie hardcode_minus_L=yes 36603a78d15Sespie # see comment about different semantics on the GNU ld section 36703a78d15Sespie ld_shlibs=no 36803a78d15Sespie ;; 36903a78d15Sespie 37003a78d15Sespie cygwin* | mingw*) 37103a78d15Sespie # When not using gcc, we currently assume that we are using 37203a78d15Sespie # Microsoft Visual C++. 37303a78d15Sespie # hardcode_libdir_flag_spec is actually meaningless, as there is 37403a78d15Sespie # no search path for DLLs. 37503a78d15Sespie hardcode_libdir_flag_spec=' ' 37603a78d15Sespie allow_undefined_flag=unsupported 37703a78d15Sespie # Tell ltmain to make .lib files, not .a files. 37803a78d15Sespie libext=lib 37903a78d15Sespie # FIXME: Setting linknames here is a bad hack. 38003a78d15Sespie archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' 38103a78d15Sespie # The linker will automatically build a .lib file if we build a DLL. 38203a78d15Sespie old_archive_from_new_cmds='true' 38303a78d15Sespie # FIXME: Should let the user specify the lib program. 38403a78d15Sespie old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' 38503a78d15Sespie fix_srcfile_path='`cygpath -w "$srcfile"`' 38603a78d15Sespie ;; 38703a78d15Sespie 38803a78d15Sespie freebsd1*) 38903a78d15Sespie ld_shlibs=no 39003a78d15Sespie ;; 39103a78d15Sespie 39203a78d15Sespie # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor 39303a78d15Sespie # support. Future versions do this automatically, but an explicit c++rt0.o 39403a78d15Sespie # does not break anything, and helps significantly (at the cost of a little 39503a78d15Sespie # extra space). 39603a78d15Sespie freebsd2.2*) 39703a78d15Sespie archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' 39803a78d15Sespie hardcode_libdir_flag_spec='-R$libdir' 39903a78d15Sespie hardcode_direct=yes 40003a78d15Sespie hardcode_shlibpath_var=no 40103a78d15Sespie ;; 40203a78d15Sespie 40303a78d15Sespie # Unfortunately, older versions of FreeBSD 2 do not have this feature. 40403a78d15Sespie freebsd2*) 40503a78d15Sespie archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' 40603a78d15Sespie hardcode_direct=yes 40703a78d15Sespie hardcode_minus_L=yes 40803a78d15Sespie hardcode_shlibpath_var=no 40903a78d15Sespie ;; 41003a78d15Sespie 41103a78d15Sespie # FreeBSD 3 and greater uses gcc -shared to do shared libraries. 41203a78d15Sespie freebsd*) 41303a78d15Sespie archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' 41403a78d15Sespie hardcode_libdir_flag_spec='-R$libdir' 41503a78d15Sespie hardcode_direct=yes 41603a78d15Sespie hardcode_shlibpath_var=no 41703a78d15Sespie ;; 41803a78d15Sespie 41903a78d15Sespie hpux9* | hpux10* | hpux11*) 42003a78d15Sespie case "$host_cpu" in 42103a78d15Sespie ia64*) 42203a78d15Sespie hardcode_direct=no 42303a78d15Sespie hardcode_shlibpath_var=no 42403a78d15Sespie archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' 42503a78d15Sespie hardcode_libdir_flag_spec='-L$libdir' ;; 42603a78d15Sespie *) 42703a78d15Sespie if test $with_gcc = yes; then 42803a78d15Sespie case "$host_os" in 42903a78d15Sespie hpux9*) archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; 43003a78d15Sespie *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; 43103a78d15Sespie esac 43203a78d15Sespie else 43303a78d15Sespie case $host_os in 43403a78d15Sespie 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' ;; 43503a78d15Sespie *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; 43603a78d15Sespie esac 43703a78d15Sespie fi 43803a78d15Sespie hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' 43903a78d15Sespie hardcode_libdir_separator=: 44003a78d15Sespie hardcode_minus_L=yes # Not in the search PATH, but as the default 44103a78d15Sespie # location of the library. 44203a78d15Sespie ;; 44303a78d15Sespie esac 44403a78d15Sespie export_dynamic_flag_spec='${wl}-E' 44503a78d15Sespie hardcode_direct=yes 44603a78d15Sespie ;; 44703a78d15Sespie 44803a78d15Sespie irix5* | irix6*) 44903a78d15Sespie if test "$with_gcc" = yes; then 45003a78d15Sespie 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' 45103a78d15Sespie else 45203a78d15Sespie archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' 45303a78d15Sespie fi 45403a78d15Sespie hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 45503a78d15Sespie hardcode_libdir_separator=: 45603a78d15Sespie link_all_deplibs=yes 45703a78d15Sespie ;; 45803a78d15Sespie 45903a78d15Sespie netbsd*) 46003a78d15Sespie if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then 46103a78d15Sespie archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out 46203a78d15Sespie else 46303a78d15Sespie archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF 46403a78d15Sespie fi 46503a78d15Sespie hardcode_libdir_flag_spec='-R$libdir' 46603a78d15Sespie hardcode_direct=yes 46703a78d15Sespie hardcode_shlibpath_var=no 46803a78d15Sespie ;; 46903a78d15Sespie 47003a78d15Sespie newsos6) 47103a78d15Sespie archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' 47203a78d15Sespie hardcode_direct=yes 47303a78d15Sespie hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 47403a78d15Sespie hardcode_libdir_separator=: 47503a78d15Sespie hardcode_shlibpath_var=no 47603a78d15Sespie ;; 47703a78d15Sespie 47803a78d15Sespie openbsd*) 479*c5bbcf84Sespie archive_cmds='$CC $pic_flag -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' 480*c5bbcf84Sespie archive_expsym_cmds='$CC $pic_flag -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' 481*c5bbcf84Sespie hardcode_libdir_flag_spec='${wl}-R$libdir' 48203a78d15Sespie hardcode_direct=yes 48303a78d15Sespie hardcode_shlibpath_var=no 484*c5bbcf84Sespie remove_lgcc=yes 485*c5bbcf84Sespie output_verbose_link_cmds='$CC $ac_cv_prog_cc_pic -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"' 48603a78d15Sespie ;; 48703a78d15Sespie 48803a78d15Sespie os2*) 48903a78d15Sespie hardcode_libdir_flag_spec='-L$libdir' 49003a78d15Sespie hardcode_minus_L=yes 49103a78d15Sespie allow_undefined_flag=unsupported 49203a78d15Sespie 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' 49303a78d15Sespie old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' 49403a78d15Sespie ;; 49503a78d15Sespie 49603a78d15Sespie osf3*) 49703a78d15Sespie if test "$with_gcc" = yes; then 49803a78d15Sespie allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' 49903a78d15Sespie 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' 50003a78d15Sespie else 50103a78d15Sespie allow_undefined_flag=' -expect_unresolved \*' 50203a78d15Sespie 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' 50303a78d15Sespie fi 50403a78d15Sespie hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 50503a78d15Sespie hardcode_libdir_separator=: 50603a78d15Sespie ;; 50703a78d15Sespie 50803a78d15Sespie osf4* | osf5*) # as osf3* with the addition of -msym flag 50903a78d15Sespie if test "$with_gcc" = yes; then 51003a78d15Sespie allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' 51103a78d15Sespie 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' 51203a78d15Sespie hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 51303a78d15Sespie else 51403a78d15Sespie allow_undefined_flag=' -expect_unresolved \*' 51503a78d15Sespie 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' 51603a78d15Sespie archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ 51703a78d15Sespie $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' 51803a78d15Sespie 51903a78d15Sespie # cc supports -rpath directly 52003a78d15Sespie hardcode_libdir_flag_spec='-rpath $libdir' 52103a78d15Sespie fi 52203a78d15Sespie hardcode_libdir_separator=: 52303a78d15Sespie ;; 52403a78d15Sespie 52503a78d15Sespie sco3.2v5*) 52603a78d15Sespie archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 52703a78d15Sespie hardcode_shlibpath_var=no 52803a78d15Sespie runpath_var=LD_RUN_PATH 52903a78d15Sespie hardcode_runpath_var=yes 53003a78d15Sespie ;; 53103a78d15Sespie 53203a78d15Sespie solaris*) 53303a78d15Sespie no_undefined_flag=' -z defs' 53403a78d15Sespie if test "$with_gcc" = yes; then 53503a78d15Sespie archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' 53603a78d15Sespie archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ 53703a78d15Sespie $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' 53803a78d15Sespie else 53903a78d15Sespie archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' 54003a78d15Sespie archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ 54103a78d15Sespie $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' 54203a78d15Sespie fi 54303a78d15Sespie hardcode_libdir_flag_spec='-R$libdir' 54403a78d15Sespie hardcode_shlibpath_var=no 54503a78d15Sespie case $host_os in 54603a78d15Sespie solaris2.[0-5] | solaris2.[0-5].*) ;; 54703a78d15Sespie *) # Supported since Solaris 2.6 (maybe 2.5.1?) 54803a78d15Sespie whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; 54903a78d15Sespie esac 55003a78d15Sespie link_all_deplibs=yes 55103a78d15Sespie ;; 55203a78d15Sespie 55303a78d15Sespie sunos4*) 55403a78d15Sespie archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' 55503a78d15Sespie hardcode_libdir_flag_spec='-L$libdir' 55603a78d15Sespie hardcode_direct=yes 55703a78d15Sespie hardcode_minus_L=yes 55803a78d15Sespie hardcode_shlibpath_var=no 55903a78d15Sespie ;; 56003a78d15Sespie 56103a78d15Sespie sysv4) 56203a78d15Sespie archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 56303a78d15Sespie runpath_var='LD_RUN_PATH' 56403a78d15Sespie hardcode_shlibpath_var=no 56503a78d15Sespie hardcode_direct=no #Motorola manual says yes, but my tests say they lie 56603a78d15Sespie ;; 56703a78d15Sespie 56803a78d15Sespie sysv4.3*) 56903a78d15Sespie archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 57003a78d15Sespie hardcode_shlibpath_var=no 57103a78d15Sespie export_dynamic_flag_spec='-Bexport' 57203a78d15Sespie ;; 57303a78d15Sespie 57403a78d15Sespie sysv5*) 57503a78d15Sespie no_undefined_flag=' -z text' 57603a78d15Sespie # $CC -shared without GNU ld will not create a library from C++ 57703a78d15Sespie # object files and a static libstdc++, better avoid it by now 57803a78d15Sespie archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' 57903a78d15Sespie archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ 58003a78d15Sespie $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' 58103a78d15Sespie hardcode_libdir_flag_spec= 58203a78d15Sespie hardcode_shlibpath_var=no 58303a78d15Sespie runpath_var='LD_RUN_PATH' 58403a78d15Sespie ;; 58503a78d15Sespie 58603a78d15Sespie uts4*) 58703a78d15Sespie archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 58803a78d15Sespie hardcode_libdir_flag_spec='-L$libdir' 58903a78d15Sespie hardcode_shlibpath_var=no 59003a78d15Sespie ;; 59103a78d15Sespie 59203a78d15Sespie dgux*) 59303a78d15Sespie archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 59403a78d15Sespie hardcode_libdir_flag_spec='-L$libdir' 59503a78d15Sespie hardcode_shlibpath_var=no 59603a78d15Sespie ;; 59703a78d15Sespie 59803a78d15Sespie sysv4*MP*) 59903a78d15Sespie if test -d /usr/nec; then 60003a78d15Sespie archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 60103a78d15Sespie hardcode_shlibpath_var=no 60203a78d15Sespie runpath_var=LD_RUN_PATH 60303a78d15Sespie hardcode_runpath_var=yes 60403a78d15Sespie ld_shlibs=yes 60503a78d15Sespie fi 60603a78d15Sespie ;; 60703a78d15Sespie 60803a78d15Sespie sysv4.2uw2*) 60903a78d15Sespie archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' 61003a78d15Sespie hardcode_direct=yes 61103a78d15Sespie hardcode_minus_L=no 61203a78d15Sespie hardcode_shlibpath_var=no 61303a78d15Sespie hardcode_runpath_var=yes 61403a78d15Sespie runpath_var=LD_RUN_PATH 61503a78d15Sespie ;; 61603a78d15Sespie 61703a78d15Sespie sysv5uw7* | unixware7*) 61803a78d15Sespie no_undefined_flag='${wl}-z ${wl}text' 61903a78d15Sespie if test "$GCC" = yes; then 62003a78d15Sespie archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' 62103a78d15Sespie else 62203a78d15Sespie archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' 62303a78d15Sespie fi 62403a78d15Sespie runpath_var='LD_RUN_PATH' 62503a78d15Sespie hardcode_shlibpath_var=no 62603a78d15Sespie ;; 62703a78d15Sespie 62803a78d15Sespie *) 62903a78d15Sespie ld_shlibs=no 63003a78d15Sespie ;; 63103a78d15Sespie esac 63203a78d15Sespiefi 63303a78d15Sespie 63403a78d15Sespie## Compiler Characteristics: PIC flags, static flags, etc 63503a78d15Sespieif test "X${ac_cv_prog_cc_pic+set}" = Xset; then 63603a78d15Sespie : 63703a78d15Sespieelse 63803a78d15Sespie ac_cv_prog_cc_pic= 63903a78d15Sespie ac_cv_prog_cc_shlib= 64003a78d15Sespie ac_cv_prog_cc_wl= 64103a78d15Sespie ac_cv_prog_cc_static= 64203a78d15Sespie ac_cv_prog_cc_no_builtin= 64303a78d15Sespie ac_cv_prog_cc_can_build_shared=$can_build_shared 64403a78d15Sespie 64503a78d15Sespie if test "$with_gcc" = yes; then 64603a78d15Sespie ac_cv_prog_cc_wl='-Wl,' 64703a78d15Sespie ac_cv_prog_cc_static='-static' 64803a78d15Sespie 64903a78d15Sespie case $host_os in 65003a78d15Sespie aix*) 65103a78d15Sespie # All AIX code is PIC. 65203a78d15Sespie if test "$host_cpu" = ia64; then 65303a78d15Sespie # AIX 5 now supports IA64 processor 65403a78d15Sespie lt_cv_prog_cc_static='-Bstatic' 65503a78d15Sespie else 65603a78d15Sespie lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' 65703a78d15Sespie fi 65803a78d15Sespie ;; 65903a78d15Sespie amigaos*) 66003a78d15Sespie # FIXME: we need at least 68020 code to build shared libraries, but 66103a78d15Sespie # adding the `-m68020' flag to GCC prevents building anything better, 66203a78d15Sespie # like `-m68040'. 66303a78d15Sespie ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' 66403a78d15Sespie ;; 66503a78d15Sespie beos* | irix5* | irix6* | osf3* | osf4* | osf5*) 66603a78d15Sespie # PIC is the default for these OSes. 66703a78d15Sespie ;; 66803a78d15Sespie cygwin* | mingw* | os2*) 66903a78d15Sespie # This hack is so that the source file can tell whether it is being 67003a78d15Sespie # built for inclusion in a dll (and should export symbols for example). 67103a78d15Sespie ac_cv_prog_cc_pic='-DDLL_EXPORT' 67203a78d15Sespie ;; 67303a78d15Sespie darwin* | rhapsody*) 67403a78d15Sespie # PIC is the default on this platform 67503a78d15Sespie # Common symbols not allowed in MH_DYLIB files 67603a78d15Sespie lt_cv_prog_cc_pic='-fno-common' 67703a78d15Sespie ;; 67803a78d15Sespie *djgpp*) 67903a78d15Sespie # DJGPP does not support shared libraries at all 68003a78d15Sespie ac_cv_prog_cc_pic= 68103a78d15Sespie ;; 68203a78d15Sespie sysv4*MP*) 68303a78d15Sespie if test -d /usr/nec; then 68403a78d15Sespie ac_cv_prog_cc_pic=-Kconform_pic 68503a78d15Sespie fi 68603a78d15Sespie ;; 68703a78d15Sespie *) 68803a78d15Sespie ac_cv_prog_cc_pic='-fPIC' 68903a78d15Sespie ;; 69003a78d15Sespie esac 69103a78d15Sespie else 69203a78d15Sespie # PORTME Check for PIC flags for the system compiler. 69303a78d15Sespie case $host_os in 69403a78d15Sespie aix*) 69503a78d15Sespie # All AIX code is PIC. 69603a78d15Sespie ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC" 69703a78d15Sespie ;; 69803a78d15Sespie 69903a78d15Sespie hpux9* | hpux10* | hpux11*) 70003a78d15Sespie # Is there a better ac_cv_prog_cc_static that works with the bundled CC? 70103a78d15Sespie ac_cv_prog_cc_wl='-Wl,' 70203a78d15Sespie ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" 70303a78d15Sespie ac_cv_prog_cc_pic='+Z' 70403a78d15Sespie ;; 70503a78d15Sespie 70603a78d15Sespie irix5* | irix6*) 70703a78d15Sespie ac_cv_prog_cc_wl='-Wl,' 70803a78d15Sespie ac_cv_prog_cc_static='-non_shared' 70903a78d15Sespie # PIC (with -KPIC) is the default. 71003a78d15Sespie ;; 71103a78d15Sespie 71203a78d15Sespie cygwin* | mingw* | os2*) 71303a78d15Sespie # This hack is so that the source file can tell whether it is being 71403a78d15Sespie # built for inclusion in a dll (and should export symbols for example). 71503a78d15Sespie ac_cv_prog_cc_pic='-DDLL_EXPORT' 71603a78d15Sespie ;; 71703a78d15Sespie 71803a78d15Sespie newsos6) 71903a78d15Sespie ac_cv_prog_cc_pic='-KPIC' 72003a78d15Sespie ac_cv_prog_cc_static='-Bstatic' 72103a78d15Sespie ;; 72203a78d15Sespie 72303a78d15Sespie osf3* | osf4* | osf5*) 72403a78d15Sespie # All OSF/1 code is PIC. 72503a78d15Sespie ac_cv_prog_cc_wl='-Wl,' 72603a78d15Sespie ac_cv_prog_cc_static='-non_shared' 72703a78d15Sespie ;; 72803a78d15Sespie 72903a78d15Sespie sco3.2v5*) 73003a78d15Sespie ac_cv_prog_cc_pic='-Kpic' 73103a78d15Sespie ac_cv_prog_cc_static='-dn' 73203a78d15Sespie ac_cv_prog_cc_shlib='-belf' 73303a78d15Sespie ;; 73403a78d15Sespie 73503a78d15Sespie solaris*) 73603a78d15Sespie ac_cv_prog_cc_pic='-KPIC' 73703a78d15Sespie ac_cv_prog_cc_static='-Bstatic' 73803a78d15Sespie ac_cv_prog_cc_wl='-Wl,' 73903a78d15Sespie ;; 74003a78d15Sespie 74103a78d15Sespie sunos4*) 74203a78d15Sespie ac_cv_prog_cc_pic='-PIC' 74303a78d15Sespie ac_cv_prog_cc_static='-Bstatic' 74403a78d15Sespie ac_cv_prog_cc_wl='-Qoption ld ' 74503a78d15Sespie ;; 74603a78d15Sespie 74703a78d15Sespie sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) 74803a78d15Sespie ac_cv_prog_cc_pic='-KPIC' 74903a78d15Sespie ac_cv_prog_cc_static='-Bstatic' 75003a78d15Sespie ac_cv_prog_cc_wl='-Wl,' 75103a78d15Sespie ;; 75203a78d15Sespie 75303a78d15Sespie uts4*) 75403a78d15Sespie ac_cv_prog_cc_pic='-pic' 75503a78d15Sespie ac_cv_prog_cc_static='-Bstatic' 75603a78d15Sespie ;; 75703a78d15Sespie 75803a78d15Sespie sysv4*MP*) 75903a78d15Sespie if test -d /usr/nec ;then 76003a78d15Sespie ac_cv_prog_cc_pic='-Kconform_pic' 76103a78d15Sespie ac_cv_prog_cc_static='-Bstatic' 76203a78d15Sespie fi 76303a78d15Sespie ;; 76403a78d15Sespie 76503a78d15Sespie *) 76603a78d15Sespie ac_cv_prog_cc_can_build_shared=no 76703a78d15Sespie ;; 76803a78d15Sespie esac 76903a78d15Sespie fi 77003a78d15Sespie case "$host_os" in 77103a78d15Sespie # Platforms which do not suport PIC and -DPIC is meaningless 77203a78d15Sespie # on them: 77303a78d15Sespie *djgpp*) 77403a78d15Sespie ac_cv_prog_cc_pic= 77503a78d15Sespie ;; 77603a78d15Sespie *) 77703a78d15Sespie ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC" 77803a78d15Sespie ;; 77903a78d15Sespie esac 78003a78d15Sespiefi 78103a78d15Sespie 78203a78d15Sespieneed_lc=yes 78303a78d15Sespieif test "$enable_shared" = yes && test "$with_gcc" = yes; then 78403a78d15Sespie case $archive_cmds in 78503a78d15Sespie *'~'*) 78603a78d15Sespie # FIXME: we may have to deal with multi-command sequences. 78703a78d15Sespie ;; 78803a78d15Sespie '$CC '*) 78903a78d15Sespie # Test whether the compiler implicitly links with -lc since on some 79003a78d15Sespie # systems, -lgcc has to come before -lc. If gcc already passes -lc 79103a78d15Sespie # to ld, don't add -lc before -lgcc. 79203a78d15Sespie echo $ac_n "checking whether -lc should be explicitly linked in... $ac_c" 1>&6 79303a78d15Sespie if eval "test \"`echo '$''{'ac_cv_archive_cmds_needs_lc'+set}'`\" = set"; then 79403a78d15Sespie echo $ac_n "(cached) $ac_c" 1>&6 79503a78d15Sespie need_lc=$ac_cv_archive_cmds_needs_lc 79603a78d15Sespie else 79703a78d15Sespie $rm conftest* 79803a78d15Sespie echo "static int dummy;" > conftest.$ac_ext 79903a78d15Sespie if { (eval echo ltcf-c.sh:need_lc: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then 80003a78d15Sespie # Append any warnings to the config.log. 80103a78d15Sespie cat conftest.err 1>&5 80203a78d15Sespie soname=conftest 80303a78d15Sespie lib=conftest 80403a78d15Sespie libobjs=conftest.$objext 80503a78d15Sespie deplibs= 80603a78d15Sespie wl=$ac_cv_prog_cc_wl 80703a78d15Sespie compiler_flags=-v 80803a78d15Sespie linker_flags=-v 80903a78d15Sespie verstring= 81003a78d15Sespie output_objdir=. 81103a78d15Sespie libname=conftest 81203a78d15Sespie save_allow_undefined_flag=$allow_undefined_flag 81303a78d15Sespie allow_undefined_flag= 81403a78d15Sespie if { (eval echo ltcf-c.sh:need_lc: \"$archive_cmds\") 1>&5; (eval $archive_cmds) 2>&1 | grep " -lc " 1>&5 ; }; then 81503a78d15Sespie need_lc=no 81603a78d15Sespie fi 81703a78d15Sespie allow_undefined_flag=$save_allow_undefined_flag 81803a78d15Sespie else 81903a78d15Sespie cat conftest.err 1>&5 82003a78d15Sespie fi 82103a78d15Sespie fi 82203a78d15Sespie $rm conftest* 82303a78d15Sespie echo "$ac_t$need_lc" 1>&6 82403a78d15Sespie ;; 82503a78d15Sespie esac 82603a78d15Sespiefi 82703a78d15Sespieac_cv_archive_cmds_needs_lc=$need_lc 828