1130803Smarcel#### This script is meant to be sourced by ltconfig.
2130803Smarcel
3130803Smarcel# ltcf-c.sh - Create a C compiler specific configuration
4130803Smarcel#
5130803Smarcel# Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc.
6130803Smarcel# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7130803Smarcel#
8130803Smarcel# This file is free software; you can redistribute it and/or modify it
9130803Smarcel# under the terms of the GNU General Public License as published by
10130803Smarcel# the Free Software Foundation; either version 2 of the License, or
11130803Smarcel# (at your option) any later version.
12130803Smarcel#
13130803Smarcel# This program is distributed in the hope that it will be useful, but
14130803Smarcel# WITHOUT ANY WARRANTY; without even the implied warranty of
15130803Smarcel# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16130803Smarcel# General Public License for more details.
17130803Smarcel#
18130803Smarcel# You should have received a copy of the GNU General Public License
19130803Smarcel# along with this program; if not, write to the Free Software
20130803Smarcel# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21130803Smarcel#
22130803Smarcel# As a special exception to the GNU General Public License, if you
23130803Smarcel# distribute this file as part of a program that contains a
24130803Smarcel# configuration script generated by Autoconf, you may include it under
25130803Smarcel# the same distribution terms that you use for the rest of that program.
26130803Smarcel
27130803Smarcel
28130803Smarcel# Source file extension for C test sources.
29130803Smarcelac_ext=c
30130803Smarcel
31130803Smarcel# Object file extension for compiled C test sources.
32130803Smarcelobjext=o
33130803Smarcel
34130803Smarcel# Code to be used in simple compile tests
35130803Smarcellt_simple_compile_test_code="int some_variable = 0;"
36130803Smarcel
37130803Smarcel# Code to be used in simple link tests
38130803Smarcellt_simple_link_test_code='main(){return(0);}'
39130803Smarcel
40130803Smarcel## Linker Characteristics
41130803Smarcelcase $host_os in
42130803Smarcelcygwin* | mingw*)
43130803Smarcel  # FIXME: the MSVC++ port hasn't been tested in a loooong time
44130803Smarcel  # When not using gcc, we currently assume that we are using
45130803Smarcel  # Microsoft Visual C++.
46130803Smarcel  if test "$with_gcc" != yes; then
47130803Smarcel    with_gnu_ld=no
48130803Smarcel  fi
49130803Smarcel  ;;
50130803Smarcel
51130803Smarcelesac
52130803Smarcel
53130803Smarcelld_shlibs=yes
54130803Smarcelif test "$with_gnu_ld" = yes; then
55130803Smarcel  # If archive_cmds runs LD, not CC, wlarc should be empty
56130803Smarcel  wlarc='${wl}'
57130803Smarcel
58130803Smarcel  # See if GNU ld supports shared libraries.
59130803Smarcel  case $host_os in
60130803Smarcel  aix3* | aix4* | aix5*)
61130803Smarcel    # On AIX/PPC, the GNU linker is very broken
62130803Smarcel    if test "$host_cpu" != ia64; then
63130803Smarcel      ld_shlibs=no
64130803Smarcel      cat <<EOF 1>&2
65130803Smarcel
66130803Smarcel*** Warning: the GNU linker, at least up to release 2.9.1, is reported
67130803Smarcel*** to be unable to reliably create shared libraries on AIX.
68130803Smarcel*** Therefore, libtool is disabling shared libraries support.  If you
69130803Smarcel*** really care for shared libraries, you may want to modify your PATH
70130803Smarcel*** so that a non-GNU linker is found, and then restart.
71130803Smarcel
72130803SmarcelEOF
73130803Smarcel    fi
74130803Smarcel    ;;
75130803Smarcel
76130803Smarcel  amigaos*)
77130803Smarcel    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)'
78130803Smarcel    hardcode_libdir_flag_spec='-L$libdir'
79130803Smarcel    hardcode_minus_L=yes
80130803Smarcel
81130803Smarcel    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
82130803Smarcel    # that the semantics of dynamic libraries on AmigaOS, at least up
83130803Smarcel    # to version 4, is to share data among multiple programs linked
84130803Smarcel    # with the same dynamic library.  Since this doesn't match the
85130803Smarcel    # behavior of shared libraries on other platforms, we can use
86130803Smarcel    # them.
87130803Smarcel    ld_shlibs=no
88130803Smarcel    ;;
89130803Smarcel
90130803Smarcel  beos*)
91130803Smarcel    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
92130803Smarcel      allow_undefined_flag=unsupported
93130803Smarcel      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
94130803Smarcel      # support --undefined.  This deserves some investigation.  FIXME
95130803Smarcel      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
96130803Smarcel    else
97130803Smarcel      ld_shlibs=no
98130803Smarcel    fi
99130803Smarcel    ;;
100130803Smarcel
101130803Smarcel  cygwin* | mingw*)
102130803Smarcel    # hardcode_libdir_flag_spec is actually meaningless, as there is
103130803Smarcel    # no search path for DLLs.
104130803Smarcel    hardcode_libdir_flag_spec='-L$libdir'
105130803Smarcel    allow_undefined_flag=unsupported
106130803Smarcel    always_export_symbols=yes
107130803Smarcel
108130803Smarcel    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
109130803Smarcel      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~
110130803Smarcel      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
111130803Smarcel      if test "x$BUILD_CC" != "x" ; then $BUILD_CC -o impgen impgen.c ; \
112130803Smarcel      else $CC -o impgen impgen.c ; fi)~
113130803Smarcel      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
114130803Smarcel
115130803Smarcel    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
116130803Smarcel
117130803Smarcel    # cygwin and mingw dlls have different entry points and sets of symbols
118130803Smarcel    # to exclude.
119130803Smarcel    # FIXME: what about values for MSVC?
120130803Smarcel    dll_entry=__cygwin_dll_entry@12
121130803Smarcel    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
122130803Smarcel    case $host_os in
123130803Smarcel    mingw*)
124130803Smarcel      # mingw values
125130803Smarcel      dll_entry=_DllMainCRTStartup@12
126130803Smarcel      dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
127130803Smarcel      ;;
128130803Smarcel    esac
129130803Smarcel
130130803Smarcel    # mingw and cygwin differ, and it's simplest to just exclude the union
131130803Smarcel    # of the two symbol sets.
132130803Smarcel    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
133130803Smarcel
134130803Smarcel    # recent cygwin and mingw systems supply a stub DllMain which the user
135130803Smarcel    # can override, but on older systems we have to supply one (in ltdll.c)
136130803Smarcel    if test "x$lt_cv_need_dllmain" = "xyes"; then
137130803Smarcel      ltdll_obj='$output_objdir/$soname-ltdll.'"$objext "
138130803Smarcel      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~
139130803Smarcel	test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
140130803Smarcel    else
141130803Smarcel      ltdll_obj=
142130803Smarcel      ltdll_cmds=
143130803Smarcel    fi
144130803Smarcel
145130803Smarcel    # Extract the symbol export list from an `--export-all' def file,
146130803Smarcel    # then regenerate the def file from the symbol export list, so that
147130803Smarcel    # the compiled dll only exports the symbol export list.
148130803Smarcel    # Be careful not to strip the DATA tag left be newer dlltools.
149130803Smarcel    export_symbols_cmds="$ltdll_cmds"'
150130803Smarcel      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
151130803Smarcel      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
152130803Smarcel
153130803Smarcel    # If the export-symbols file already is a .def file (1st line
154130803Smarcel    # is EXPORTS), use it as is.
155130803Smarcel    # If DATA tags from a recent dlltool are present, honour them!
156130803Smarcel    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
157130803Smarcel        cp $export_symbols $output_objdir/$soname-def;
158130803Smarcel      else
159130803Smarcel        echo EXPORTS > $output_objdir/$soname-def;
160130803Smarcel        _lt_hint=1;
161130803Smarcel        cat $export_symbols | while read symbol; do
162130803Smarcel         set dummy \$symbol;
163130803Smarcel         case \[$]# in
164130803Smarcel           2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
165130803Smarcel           *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
166130803Smarcel         esac;
167130803Smarcel         _lt_hint=`expr 1 + \$_lt_hint`;
168130803Smarcel        done;
169130803Smarcel      fi~
170130803Smarcel      '"$ltdll_cmds"'
171130803Smarcel      $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~
172130803Smarcel      $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~
173130803Smarcel      $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~
174130803Smarcel      $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~
175130803Smarcel      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
176130803Smarcel    ;;
177130803Smarcel
178130803Smarcel  darwin* | rhapsody*)
179130803Smarcel    allow_undefined_flag='-undefined suppress'
180130803Smarcel    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`'
181130803Smarcel    # We need to add '_' to the symbols in $export_symbols first
182130803Smarcel    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
183130803Smarcel    hardcode_direct=yes
184130803Smarcel    hardcode_shlibpath_var=no
185130803Smarcel    whole_archive_flag_spec='-all_load $convenience'
186130803Smarcel    ;;
187130803Smarcel
188130803Smarcel  netbsd*)
189130803Smarcel    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
190130803Smarcel      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
191130803Smarcel      wlarc=
192130803Smarcel    else
193130803Smarcel      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
194130803Smarcel      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
195130803Smarcel    fi
196130803Smarcel    ;;
197130803Smarcel
198130803Smarcel  solaris* | sysv5*)
199130803Smarcel    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
200130803Smarcel      ld_shlibs=no
201130803Smarcel      cat <<EOF 1>&2
202130803Smarcel
203130803Smarcel*** Warning: The releases 2.8.* of the GNU linker cannot reliably
204130803Smarcel*** create shared libraries on Solaris systems.  Therefore, libtool
205130803Smarcel*** is disabling shared libraries support.  We urge you to upgrade GNU
206130803Smarcel*** binutils to release 2.9.1 or newer.  Another option is to modify
207130803Smarcel*** your PATH or compiler configuration so that the native linker is
208130803Smarcel*** used, and then restart.
209130803Smarcel
210130803SmarcelEOF
211130803Smarcel    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
212130803Smarcel      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
213130803Smarcel      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
214130803Smarcel    else
215130803Smarcel      ld_shlibs=no
216130803Smarcel    fi
217130803Smarcel    ;;
218130803Smarcel
219130803Smarcel  sunos4*)
220130803Smarcel    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
221130803Smarcel    wlarc=
222130803Smarcel    hardcode_direct=yes
223130803Smarcel    hardcode_shlibpath_var=no
224130803Smarcel    ;;
225130803Smarcel
226130803Smarcel  *)
227130803Smarcel    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
228130803Smarcel      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
229130803Smarcel      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
230130803Smarcel    else
231130803Smarcel      ld_shlibs=no
232130803Smarcel    fi
233130803Smarcel    ;;
234130803Smarcel  esac
235130803Smarcel
236130803Smarcel  if test "$ld_shlibs" = yes; then
237130803Smarcel    runpath_var=LD_RUN_PATH
238130803Smarcel    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
239130803Smarcel    export_dynamic_flag_spec='${wl}--export-dynamic'
240130803Smarcel    case $host_os in
241130803Smarcel    cygwin* | mingw*)
242130803Smarcel      # dlltool doesn't understand --whole-archive et. al.
243130803Smarcel      whole_archive_flag_spec=
244130803Smarcel      ;;
245130803Smarcel    *)
246130803Smarcel      # ancient GNU ld didn't support --whole-archive et. al.
247130803Smarcel      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
248130803Smarcel	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
249130803Smarcel      else
250130803Smarcel	whole_archive_flag_spec=
251130803Smarcel      fi
252130803Smarcel      ;;
253130803Smarcel    esac
254130803Smarcel  fi
255130803Smarcelelse
256130803Smarcel  # PORTME fill in a description of your system's linker (not GNU ld)
257130803Smarcel  case $host_os in
258130803Smarcel  aix3*)
259130803Smarcel    allow_undefined_flag=unsupported
260130803Smarcel    always_export_symbols=yes
261130803Smarcel    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'
262130803Smarcel    # Note: this linker hardcodes the directories in LIBPATH if there
263130803Smarcel    # are no directories specified by -L.
264130803Smarcel    hardcode_minus_L=yes
265130803Smarcel    if test "$with_gcc" = yes && test -z "$link_static_flag"; then
266130803Smarcel      # Neither direct hardcoding nor static linking is supported with a
267130803Smarcel      # broken collect2.
268130803Smarcel      hardcode_direct=unsupported
269130803Smarcel    fi
270130803Smarcel    ;;
271130803Smarcel
272130803Smarcel  aix4* | aix5*)
273130803Smarcel    hardcode_direct=yes
274130803Smarcel    hardcode_libdir_separator=':'
275130803Smarcel    link_all_deplibs=yes
276130803Smarcel    # When large executables or shared objects are built, AIX ld can
277130803Smarcel    # have problems creating the table of contents.  If linking a library
278130803Smarcel    # or program results in "error TOC overflow" add -mminimal-toc to
279130803Smarcel    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
280130803Smarcel    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
281130803Smarcel    if test "$with_gcc" = yes; then
282130803Smarcel      case $host_os in aix4.[012]|aix4.[012].*)
283130803Smarcel      # We only want to do this on AIX 4.2 and lower, the check
284130803Smarcel      # below for broken collect2 doesn't work under 4.3+
285130803Smarcel        collect2name=`${CC} -print-prog-name=collect2`
286130803Smarcel        if test -f "$collect2name" && \
287130803Smarcel	   strings "$collect2name" | grep resolve_lib_name >/dev/null
288130803Smarcel        then
289130803Smarcel	  # We have reworked collect2
290130803Smarcel	  hardcode_direct=yes
291130803Smarcel        else
292130803Smarcel	  # We have old collect2
293130803Smarcel	  hardcode_direct=unsupported
294130803Smarcel	  # It fails to find uninstalled libraries when the uninstalled
295130803Smarcel	  # path is not listed in the libpath.  Setting hardcode_minus_L
296130803Smarcel	  # to unsupported forces relinking
297130803Smarcel	  hardcode_minus_L=yes
298130803Smarcel	  hardcode_libdir_flag_spec='-L$libdir'
299130803Smarcel	  hardcode_libdir_separator=
300130803Smarcel        fi
301130803Smarcel      esac
302130803Smarcel      shared_flag='-shared'
303130803Smarcel    else
304130803Smarcel      # not using gcc
305130803Smarcel      if test "$host_cpu" = ia64; then
306130803Smarcel        shared_flag='${wl}-G'
307130803Smarcel      else
308130803Smarcel        shared_flag='${wl}-bM:SRE'
309130803Smarcel      fi
310130803Smarcel    fi
311130803Smarcel
312130803Smarcel    if test "$host_cpu" = ia64; then
313130803Smarcel      # On IA64, the linker does run time linking by default, so we don't
314130803Smarcel      # have to do anything special.
315130803Smarcel      aix_use_runtimelinking=no
316130803Smarcel      if test $with_gnu_ld = no; then
317130803Smarcel        exp_sym_flag='-Bexport'
318130803Smarcel        no_entry_flag=""
319130803Smarcel      fi
320130803Smarcel    else
321130803Smarcel      # Test if we are trying to use run time linking, or normal AIX style linking.
322130803Smarcel      # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
323130803Smarcel      aix_use_runtimelinking=no
324130803Smarcel      for ld_flag in $LDFLAGS; do
325130803Smarcel        if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
326130803Smarcel          aix_use_runtimelinking=yes
327130803Smarcel          break
328130803Smarcel        fi
329130803Smarcel      done
330130803Smarcel      exp_sym_flag='-bexport'
331130803Smarcel      no_entry_flag='-bnoentry'
332130803Smarcel    fi
333130803Smarcel    # -bexpall does not export symbols beginning with underscore (_)
334130803Smarcel    always_export_symbols=yes
335130803Smarcel    if test "$aix_use_runtimelinking" = yes; then
336130803Smarcel      # Warning - without using the other run time loading flags (-brtl), -berok will
337130803Smarcel      #           link without error, but may produce a broken library.
338130803Smarcel      allow_undefined_flag=' ${wl}-berok'
339130803Smarcel      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
340130803Smarcel      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"
341130803Smarcel    else
342130803Smarcel      if test "$host_cpu" = ia64; then
343130803Smarcel        if test $with_gnu_ld = no; then
344130803Smarcel          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
345130803Smarcel          allow_undefined_flag="-z nodefs"
346130803Smarcel          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"
347130803Smarcel        fi
348130803Smarcel      else
349130803Smarcel        allow_undefined_flag=' ${wl}-berok'
350130803Smarcel        # -bexpall does not export symbols beginning with underscore (_)
351130803Smarcel        always_export_symbols=yes
352130803Smarcel        # Exported symbols can be pulled into shared objects from archives
353130803Smarcel        whole_archive_flag_spec=' '
354130803Smarcel        build_libtool_need_lc=yes
355130803Smarcel        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
356130803Smarcel        # This is similar to how AIX traditionally builds it's shared libraries.
357130803Smarcel        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'
358130803Smarcel      fi
359130803Smarcel    fi
360130803Smarcel    ;;
361130803Smarcel
362130803Smarcel  amigaos*)
363130803Smarcel    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)'
364130803Smarcel    hardcode_libdir_flag_spec='-L$libdir'
365130803Smarcel    hardcode_minus_L=yes
366130803Smarcel    # see comment about different semantics on the GNU ld section
367130803Smarcel    ld_shlibs=no
368130803Smarcel    ;;
369130803Smarcel
370130803Smarcel  cygwin* | mingw*)
371130803Smarcel    # When not using gcc, we currently assume that we are using
372130803Smarcel    # Microsoft Visual C++.
373130803Smarcel    # hardcode_libdir_flag_spec is actually meaningless, as there is
374130803Smarcel    # no search path for DLLs.
375130803Smarcel    hardcode_libdir_flag_spec=' '
376130803Smarcel    allow_undefined_flag=unsupported
377130803Smarcel    # Tell ltmain to make .lib files, not .a files.
378130803Smarcel    libext=lib
379130803Smarcel    # FIXME: Setting linknames here is a bad hack.
380130803Smarcel    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
381130803Smarcel    # The linker will automatically build a .lib file if we build a DLL.
382130803Smarcel    old_archive_from_new_cmds='true'
383130803Smarcel    # FIXME: Should let the user specify the lib program.
384130803Smarcel    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
385130803Smarcel    fix_srcfile_path='`cygpath -w "$srcfile"`'
386130803Smarcel    ;;
387130803Smarcel
388130803Smarcel  freebsd1*)
389130803Smarcel    ld_shlibs=no
390130803Smarcel    ;;
391130803Smarcel
392130803Smarcel  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
393130803Smarcel  # support.  Future versions do this automatically, but an explicit c++rt0.o
394130803Smarcel  # does not break anything, and helps significantly (at the cost of a little
395130803Smarcel  # extra space).
396130803Smarcel  freebsd2.2*)
397130803Smarcel    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
398130803Smarcel    hardcode_libdir_flag_spec='-R$libdir'
399130803Smarcel    hardcode_direct=yes
400130803Smarcel    hardcode_shlibpath_var=no
401130803Smarcel    ;;
402130803Smarcel
403130803Smarcel  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
404130803Smarcel  freebsd2*)
405130803Smarcel    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
406130803Smarcel    hardcode_direct=yes
407130803Smarcel    hardcode_minus_L=yes
408130803Smarcel    hardcode_shlibpath_var=no
409130803Smarcel    ;;
410130803Smarcel
411130803Smarcel  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
412130803Smarcel  freebsd*)
413130803Smarcel    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
414130803Smarcel    hardcode_libdir_flag_spec='-R$libdir'
415130803Smarcel    hardcode_direct=yes
416130803Smarcel    hardcode_shlibpath_var=no
417130803Smarcel    ;;
418130803Smarcel
419130803Smarcel  hpux9* | hpux10* | hpux11*)
420130803Smarcel    case "$host_cpu" in
421130803Smarcel    ia64*)
422130803Smarcel      hardcode_direct=no
423130803Smarcel      hardcode_shlibpath_var=no
424130803Smarcel      archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
425130803Smarcel      hardcode_libdir_flag_spec='-L$libdir' ;;
426130803Smarcel    *)
427130803Smarcel      if test $with_gcc = yes; then
428130803Smarcel        case "$host_os" in
429130803Smarcel        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' ;;
430130803Smarcel        *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;;
431130803Smarcel        esac
432130803Smarcel      else
433130803Smarcel        case $host_os in
434130803Smarcel        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' ;;
435130803Smarcel        *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
436130803Smarcel        esac
437130803Smarcel      fi
438130803Smarcel      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
439130803Smarcel      hardcode_libdir_separator=:
440130803Smarcel      hardcode_minus_L=yes # Not in the search PATH, but as the default
441130803Smarcel			   # location of the library.
442130803Smarcel      ;;
443130803Smarcel    esac
444130803Smarcel    export_dynamic_flag_spec='${wl}-E'
445130803Smarcel    hardcode_direct=yes
446130803Smarcel    ;;
447130803Smarcel
448130803Smarcel  irix5* | irix6*)
449130803Smarcel    if test "$with_gcc" = yes; then
450130803Smarcel      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'
451130803Smarcel    else
452130803Smarcel      archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
453130803Smarcel    fi
454130803Smarcel    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
455130803Smarcel    hardcode_libdir_separator=:
456130803Smarcel    link_all_deplibs=yes
457130803Smarcel    ;;
458130803Smarcel
459130803Smarcel  netbsd*)
460130803Smarcel    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
461130803Smarcel      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
462130803Smarcel    else
463130803Smarcel      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
464130803Smarcel    fi
465130803Smarcel    hardcode_libdir_flag_spec='-R$libdir'
466130803Smarcel    hardcode_direct=yes
467130803Smarcel    hardcode_shlibpath_var=no
468130803Smarcel    ;;
469130803Smarcel
470130803Smarcel  newsos6)
471130803Smarcel    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
472130803Smarcel    hardcode_direct=yes
473130803Smarcel    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
474130803Smarcel    hardcode_libdir_separator=:
475130803Smarcel    hardcode_shlibpath_var=no
476130803Smarcel    ;;
477130803Smarcel
478130803Smarcel  openbsd*)
479130803Smarcel    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
480130803Smarcel    hardcode_libdir_flag_spec='-R$libdir'
481130803Smarcel    hardcode_direct=yes
482130803Smarcel    hardcode_shlibpath_var=no
483130803Smarcel    ;;
484130803Smarcel
485130803Smarcel  os2*)
486130803Smarcel    hardcode_libdir_flag_spec='-L$libdir'
487130803Smarcel    hardcode_minus_L=yes
488130803Smarcel    allow_undefined_flag=unsupported
489130803Smarcel    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'
490130803Smarcel    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
491130803Smarcel    ;;
492130803Smarcel
493130803Smarcel  osf3*)
494130803Smarcel    if test "$with_gcc" = yes; then
495130803Smarcel      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
496130803Smarcel      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'
497130803Smarcel    else
498130803Smarcel      allow_undefined_flag=' -expect_unresolved \*'
499130803Smarcel      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'
500130803Smarcel    fi
501130803Smarcel    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
502130803Smarcel    hardcode_libdir_separator=:
503130803Smarcel    ;;
504130803Smarcel
505130803Smarcel  osf4* | osf5*)	# as osf3* with the addition of -msym flag
506130803Smarcel    if test "$with_gcc" = yes; then
507130803Smarcel      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
508130803Smarcel      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'
509130803Smarcel      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
510130803Smarcel    else
511130803Smarcel      allow_undefined_flag=' -expect_unresolved \*'
512130803Smarcel      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'
513130803Smarcel      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
514130803Smarcel      $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'
515130803Smarcel
516130803Smarcel      # cc supports -rpath directly
517130803Smarcel      hardcode_libdir_flag_spec='-rpath $libdir'
518130803Smarcel    fi
519130803Smarcel    hardcode_libdir_separator=:
520130803Smarcel    ;;
521130803Smarcel
522130803Smarcel  sco3.2v5*)
523130803Smarcel    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
524130803Smarcel    hardcode_shlibpath_var=no
525130803Smarcel    runpath_var=LD_RUN_PATH
526130803Smarcel    hardcode_runpath_var=yes
527130803Smarcel    ;;
528130803Smarcel
529130803Smarcel  solaris*)
530130803Smarcel    no_undefined_flag=' -z defs'
531130803Smarcel    if test "$with_gcc" = yes; then
532130803Smarcel      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
533130803Smarcel      archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
534130803Smarcel                  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
535130803Smarcel    else
536130803Smarcel      archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
537130803Smarcel      archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
538130803Smarcel		  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
539130803Smarcel    fi
540130803Smarcel    hardcode_libdir_flag_spec='-R$libdir'
541130803Smarcel    hardcode_shlibpath_var=no
542130803Smarcel    case $host_os in
543130803Smarcel    solaris2.[0-5] | solaris2.[0-5].*) ;;
544130803Smarcel    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
545130803Smarcel      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
546130803Smarcel    esac
547130803Smarcel    link_all_deplibs=yes
548130803Smarcel    ;;
549130803Smarcel
550130803Smarcel  sunos4*)
551130803Smarcel    archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
552130803Smarcel    hardcode_libdir_flag_spec='-L$libdir'
553130803Smarcel    hardcode_direct=yes
554130803Smarcel    hardcode_minus_L=yes
555130803Smarcel    hardcode_shlibpath_var=no
556130803Smarcel    ;;
557130803Smarcel
558130803Smarcel  sysv4)
559130803Smarcel    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
560130803Smarcel    runpath_var='LD_RUN_PATH'
561130803Smarcel    hardcode_shlibpath_var=no
562130803Smarcel    hardcode_direct=no #Motorola manual says yes, but my tests say they lie
563130803Smarcel    ;;
564130803Smarcel
565130803Smarcel  sysv4.3*)
566130803Smarcel    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
567130803Smarcel    hardcode_shlibpath_var=no
568130803Smarcel    export_dynamic_flag_spec='-Bexport'
569130803Smarcel    ;;
570130803Smarcel
571130803Smarcel  sysv5*)
572130803Smarcel    no_undefined_flag=' -z text'
573130803Smarcel    # $CC -shared without GNU ld will not create a library from C++
574130803Smarcel    # object files and a static libstdc++, better avoid it by now
575130803Smarcel    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
576130803Smarcel    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
577130803Smarcel		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
578130803Smarcel    hardcode_libdir_flag_spec=
579130803Smarcel    hardcode_shlibpath_var=no
580130803Smarcel    runpath_var='LD_RUN_PATH'
581130803Smarcel    ;;
582130803Smarcel
583130803Smarcel  uts4*)
584130803Smarcel    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
585130803Smarcel    hardcode_libdir_flag_spec='-L$libdir'
586130803Smarcel    hardcode_shlibpath_var=no
587130803Smarcel    ;;
588130803Smarcel
589130803Smarcel  dgux*)
590130803Smarcel    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
591130803Smarcel    hardcode_libdir_flag_spec='-L$libdir'
592130803Smarcel    hardcode_shlibpath_var=no
593130803Smarcel    ;;
594130803Smarcel
595130803Smarcel  sysv4*MP*)
596130803Smarcel    if test -d /usr/nec; then
597130803Smarcel      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
598130803Smarcel      hardcode_shlibpath_var=no
599130803Smarcel      runpath_var=LD_RUN_PATH
600130803Smarcel      hardcode_runpath_var=yes
601130803Smarcel      ld_shlibs=yes
602130803Smarcel    fi
603130803Smarcel    ;;
604130803Smarcel
605130803Smarcel  sysv4.2uw2*)
606130803Smarcel    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
607130803Smarcel    hardcode_direct=yes
608130803Smarcel    hardcode_minus_L=no
609130803Smarcel    hardcode_shlibpath_var=no
610130803Smarcel    hardcode_runpath_var=yes
611130803Smarcel    runpath_var=LD_RUN_PATH
612130803Smarcel    ;;
613130803Smarcel
614130803Smarcel  sysv5uw7* | unixware7*)
615130803Smarcel    no_undefined_flag='${wl}-z ${wl}text'
616130803Smarcel    if test "$GCC" = yes; then
617130803Smarcel      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
618130803Smarcel    else
619130803Smarcel      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
620130803Smarcel    fi
621130803Smarcel    runpath_var='LD_RUN_PATH'
622130803Smarcel    hardcode_shlibpath_var=no
623130803Smarcel    ;;
624130803Smarcel
625130803Smarcel  *)
626130803Smarcel    ld_shlibs=no
627130803Smarcel    ;;
628130803Smarcel  esac
629130803Smarcelfi
630130803Smarcel
631130803Smarcel## Compiler Characteristics: PIC flags, static flags, etc
632130803Smarcelif test "X${ac_cv_prog_cc_pic+set}" = Xset; then
633130803Smarcel  :
634130803Smarcelelse
635130803Smarcel  ac_cv_prog_cc_pic=
636130803Smarcel  ac_cv_prog_cc_shlib=
637130803Smarcel  ac_cv_prog_cc_wl=
638130803Smarcel  ac_cv_prog_cc_static=
639130803Smarcel  ac_cv_prog_cc_no_builtin=
640130803Smarcel  ac_cv_prog_cc_can_build_shared=$can_build_shared
641130803Smarcel
642130803Smarcel  if test "$with_gcc" = yes; then
643130803Smarcel    ac_cv_prog_cc_wl='-Wl,'
644130803Smarcel    ac_cv_prog_cc_static='-static'
645130803Smarcel
646130803Smarcel    case $host_os in
647130803Smarcel    aix*)
648130803Smarcel      # All AIX code is PIC.
649130803Smarcel      if test "$host_cpu" = ia64; then
650130803Smarcel        # AIX 5 now supports IA64 processor
651130803Smarcel        lt_cv_prog_cc_static='-Bstatic'
652130803Smarcel      else
653130803Smarcel        lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
654130803Smarcel      fi
655130803Smarcel      ;;
656130803Smarcel    amigaos*)
657130803Smarcel      # FIXME: we need at least 68020 code to build shared libraries, but
658130803Smarcel      # adding the `-m68020' flag to GCC prevents building anything better,
659130803Smarcel      # like `-m68040'.
660130803Smarcel      ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
661130803Smarcel      ;;
662130803Smarcel    beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
663130803Smarcel      # PIC is the default for these OSes.
664130803Smarcel      ;;
665130803Smarcel    cygwin* | mingw* | os2*)
666130803Smarcel      # This hack is so that the source file can tell whether it is being
667130803Smarcel      # built for inclusion in a dll (and should export symbols for example).
668130803Smarcel      ac_cv_prog_cc_pic='-DDLL_EXPORT'
669130803Smarcel      ;;
670130803Smarcel    darwin* | rhapsody*)
671130803Smarcel      # PIC is the default on this platform
672130803Smarcel      # Common symbols not allowed in MH_DYLIB files
673130803Smarcel      lt_cv_prog_cc_pic='-fno-common'
674130803Smarcel      ;;
675130803Smarcel    *djgpp*)
676130803Smarcel      # DJGPP does not support shared libraries at all
677130803Smarcel      ac_cv_prog_cc_pic=
678130803Smarcel      ;;
679130803Smarcel    sysv4*MP*)
680130803Smarcel      if test -d /usr/nec; then
681130803Smarcel	 ac_cv_prog_cc_pic=-Kconform_pic
682130803Smarcel      fi
683130803Smarcel      ;;
684130803Smarcel    *)
685130803Smarcel      ac_cv_prog_cc_pic='-fPIC'
686130803Smarcel      ;;
687130803Smarcel    esac
688130803Smarcel  else
689130803Smarcel    # PORTME Check for PIC flags for the system compiler.
690130803Smarcel    case $host_os in
691130803Smarcel    aix*)
692130803Smarcel     # All AIX code is PIC.
693130803Smarcel      ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
694130803Smarcel      ;;
695130803Smarcel
696130803Smarcel    hpux9* | hpux10* | hpux11*)
697130803Smarcel      # Is there a better ac_cv_prog_cc_static that works with the bundled CC?
698130803Smarcel      ac_cv_prog_cc_wl='-Wl,'
699130803Smarcel      ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
700130803Smarcel      ac_cv_prog_cc_pic='+Z'
701130803Smarcel      ;;
702130803Smarcel
703130803Smarcel    irix5* | irix6*)
704130803Smarcel      ac_cv_prog_cc_wl='-Wl,'
705130803Smarcel      ac_cv_prog_cc_static='-non_shared'
706130803Smarcel      # PIC (with -KPIC) is the default.
707130803Smarcel      ;;
708130803Smarcel
709130803Smarcel    cygwin* | mingw* | os2*)
710130803Smarcel      # This hack is so that the source file can tell whether it is being
711130803Smarcel      # built for inclusion in a dll (and should export symbols for example).
712130803Smarcel      ac_cv_prog_cc_pic='-DDLL_EXPORT'
713130803Smarcel      ;;
714130803Smarcel
715130803Smarcel    newsos6)
716130803Smarcel      ac_cv_prog_cc_pic='-KPIC'
717130803Smarcel      ac_cv_prog_cc_static='-Bstatic'
718130803Smarcel      ;;
719130803Smarcel
720130803Smarcel    osf3* | osf4* | osf5*)
721130803Smarcel      # All OSF/1 code is PIC.
722130803Smarcel      ac_cv_prog_cc_wl='-Wl,'
723130803Smarcel      ac_cv_prog_cc_static='-non_shared'
724130803Smarcel      ;;
725130803Smarcel
726130803Smarcel    sco3.2v5*)
727130803Smarcel      ac_cv_prog_cc_pic='-Kpic'
728130803Smarcel      ac_cv_prog_cc_static='-dn'
729130803Smarcel      ac_cv_prog_cc_shlib='-belf'
730130803Smarcel      ;;
731130803Smarcel
732130803Smarcel    solaris*)
733130803Smarcel      ac_cv_prog_cc_pic='-KPIC'
734130803Smarcel      ac_cv_prog_cc_static='-Bstatic'
735130803Smarcel      ac_cv_prog_cc_wl='-Wl,'
736130803Smarcel      ;;
737130803Smarcel
738130803Smarcel    sunos4*)
739130803Smarcel      ac_cv_prog_cc_pic='-PIC'
740130803Smarcel      ac_cv_prog_cc_static='-Bstatic'
741130803Smarcel      ac_cv_prog_cc_wl='-Qoption ld '
742130803Smarcel      ;;
743130803Smarcel
744130803Smarcel    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
745130803Smarcel      ac_cv_prog_cc_pic='-KPIC'
746130803Smarcel      ac_cv_prog_cc_static='-Bstatic'
747130803Smarcel      ac_cv_prog_cc_wl='-Wl,'
748130803Smarcel      ;;
749130803Smarcel
750130803Smarcel    uts4*)
751130803Smarcel      ac_cv_prog_cc_pic='-pic'
752130803Smarcel      ac_cv_prog_cc_static='-Bstatic'
753130803Smarcel      ;;
754130803Smarcel
755130803Smarcel    sysv4*MP*)
756130803Smarcel      if test -d /usr/nec ;then
757130803Smarcel	ac_cv_prog_cc_pic='-Kconform_pic'
758130803Smarcel	ac_cv_prog_cc_static='-Bstatic'
759130803Smarcel      fi
760130803Smarcel      ;;
761130803Smarcel
762130803Smarcel    *)
763130803Smarcel      ac_cv_prog_cc_can_build_shared=no
764130803Smarcel      ;;
765130803Smarcel    esac
766130803Smarcel  fi
767130803Smarcel  case "$host_os" in
768130803Smarcel      # Platforms which do not suport PIC and -DPIC is meaningless
769130803Smarcel      # on them:
770130803Smarcel      *djgpp*)
771130803Smarcel        ac_cv_prog_cc_pic=
772130803Smarcel        ;;
773130803Smarcel      *)
774130803Smarcel        ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
775130803Smarcel        ;;
776130803Smarcel  esac
777130803Smarcelfi
778130803Smarcel
779130803Smarcelneed_lc=yes
780130803Smarcelif test "$enable_shared" = yes && test "$with_gcc" = yes; then
781130803Smarcel  case $archive_cmds in
782130803Smarcel  *'~'*)
783130803Smarcel    # FIXME: we may have to deal with multi-command sequences.
784130803Smarcel    ;;
785130803Smarcel  '$CC '*)
786130803Smarcel    # Test whether the compiler implicitly links with -lc since on some
787130803Smarcel    # systems, -lgcc has to come before -lc. If gcc already passes -lc
788130803Smarcel    # to ld, don't add -lc before -lgcc.
789130803Smarcel    echo $ac_n "checking whether -lc should be explicitly linked in... $ac_c" 1>&6
790130803Smarcel    if eval "test \"`echo '$''{'ac_cv_archive_cmds_needs_lc'+set}'`\" = set"; then
791130803Smarcel      echo $ac_n "(cached) $ac_c" 1>&6
792130803Smarcel      need_lc=$ac_cv_archive_cmds_needs_lc
793130803Smarcel    else
794130803Smarcel      $rm conftest*
795130803Smarcel      echo "static int dummy;" > conftest.$ac_ext
796130803Smarcel      if { (eval echo ltcf-c.sh:need_lc: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
797130803Smarcel	# Append any warnings to the config.log.
798130803Smarcel	cat conftest.err 1>&5
799130803Smarcel	soname=conftest
800130803Smarcel	lib=conftest
801130803Smarcel	libobjs=conftest.$objext
802130803Smarcel	deplibs=
803130803Smarcel	wl=$ac_cv_prog_cc_wl
804130803Smarcel	compiler_flags=-v
805130803Smarcel	linker_flags=-v
806130803Smarcel	verstring=
807130803Smarcel	output_objdir=.
808130803Smarcel	libname=conftest
809130803Smarcel	save_allow_undefined_flag=$allow_undefined_flag
810130803Smarcel	allow_undefined_flag=
811130803Smarcel	if { (eval echo ltcf-c.sh:need_lc: \"$archive_cmds\") 1>&5; (eval $archive_cmds) 2>&1 | grep " -lc " 1>&5 ; }; then
812130803Smarcel	  need_lc=no
813130803Smarcel	fi
814130803Smarcel	allow_undefined_flag=$save_allow_undefined_flag
815130803Smarcel      else
816130803Smarcel	cat conftest.err 1>&5
817130803Smarcel      fi
818130803Smarcel    fi
819130803Smarcel    $rm conftest*
820130803Smarcel    echo "$ac_t$need_lc" 1>&6
821130803Smarcel    ;;
822130803Smarcel  esac
823130803Smarcelfi
824130803Smarcelac_cv_archive_cmds_needs_lc=$need_lc
825