xref: /openbsd-src/gnu/usr.bin/binutils-2.17/ltcf-gcj.sh (revision 3d8817e467ea46cf4772788d6804dd293abfb01a)
1*3d8817e4Smiod#### This script is meant to be sourced by ltconfig.
2*3d8817e4Smiod
3*3d8817e4Smiod# ltcf-gcj.sh - Create a GCJ compiler specific configuration
4*3d8817e4Smiod#
5*3d8817e4Smiod# Copyright (C) 1996-1999, 2000, 2001, 2003 Free Software Foundation, Inc.
6*3d8817e4Smiod# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7*3d8817e4Smiod#
8*3d8817e4Smiod# Original GCJ support by:
9*3d8817e4Smiod#    Alexandre Oliva <oliva@lsd.ic.unicamp.br>
10*3d8817e4Smiod#
11*3d8817e4Smiod# This file is free software; you can redistribute it and/or modify it
12*3d8817e4Smiod# under the terms of the GNU General Public License as published by
13*3d8817e4Smiod# the Free Software Foundation; either version 2 of the License, or
14*3d8817e4Smiod# (at your option) any later version.
15*3d8817e4Smiod#
16*3d8817e4Smiod# This program is distributed in the hope that it will be useful, but
17*3d8817e4Smiod# WITHOUT ANY WARRANTY; without even the implied warranty of
18*3d8817e4Smiod# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19*3d8817e4Smiod# General Public License for more details.
20*3d8817e4Smiod#
21*3d8817e4Smiod# You should have received a copy of the GNU General Public License
22*3d8817e4Smiod# along with this program; if not, write to the Free Software
23*3d8817e4Smiod# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24*3d8817e4Smiod#
25*3d8817e4Smiod# As a special exception to the GNU General Public License, if you
26*3d8817e4Smiod# distribute this file as part of a program that contains a
27*3d8817e4Smiod# configuration script generated by Autoconf, you may include it under
28*3d8817e4Smiod# the same distribution terms that you use for the rest of that program.
29*3d8817e4Smiod
30*3d8817e4Smiod
31*3d8817e4Smiod# Source file extension for Java test sources.
32*3d8817e4Smiodac_ext=java
33*3d8817e4Smiod
34*3d8817e4Smiod# Object file extension for compiled Java test sources.
35*3d8817e4Smiodobjext=o
36*3d8817e4Smiod
37*3d8817e4Smiod# Code to be used in simple compile tests
38*3d8817e4Smiodlt_simple_compile_test_code="class foo {}"
39*3d8817e4Smiod
40*3d8817e4Smiod# Code to be used in simple link tests
41*3d8817e4Smiodlt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
42*3d8817e4Smiod
43*3d8817e4Smiod## Linker Characteristics
44*3d8817e4Smiodcase $host_os in
45*3d8817e4Smiodcygwin* | mingw*)
46*3d8817e4Smiod  # FIXME: the MSVC++ port hasn't been tested in a loooong time
47*3d8817e4Smiod  # When not using gcc, we currently assume that we are using
48*3d8817e4Smiod  # Microsoft Visual C++.
49*3d8817e4Smiod  if test "$with_gcc" != yes; then
50*3d8817e4Smiod    with_gnu_ld=no
51*3d8817e4Smiod  fi
52*3d8817e4Smiod  ;;
53*3d8817e4Smiod
54*3d8817e4Smiodesac
55*3d8817e4Smiod
56*3d8817e4Smiodld_shlibs=yes
57*3d8817e4Smiodif test "$with_gnu_ld" = yes; then
58*3d8817e4Smiod  # If archive_cmds runs LD, not CC, wlarc should be empty
59*3d8817e4Smiod  wlarc='${wl}'
60*3d8817e4Smiod
61*3d8817e4Smiod  # See if GNU ld supports shared libraries.
62*3d8817e4Smiod  case $host_os in
63*3d8817e4Smiod  aix3* | aix4* | aix5*)
64*3d8817e4Smiod    # On AIX/PPC, the GNU linker is very broken
65*3d8817e4Smiod    if test "$host_cpu" != ia64; then
66*3d8817e4Smiod      ld_shlibs=no
67*3d8817e4Smiod      cat <<EOF 1>&2
68*3d8817e4Smiod
69*3d8817e4Smiod*** Warning: the GNU linker, at least up to release 2.9.1, is reported
70*3d8817e4Smiod*** to be unable to reliably create shared libraries on AIX.
71*3d8817e4Smiod*** Therefore, libtool is disabling shared libraries support.  If you
72*3d8817e4Smiod*** really care for shared libraries, you may want to modify your PATH
73*3d8817e4Smiod*** so that a non-GNU linker is found, and then restart.
74*3d8817e4Smiod
75*3d8817e4SmiodEOF
76*3d8817e4Smiod    fi
77*3d8817e4Smiod    ;;
78*3d8817e4Smiod
79*3d8817e4Smiod  amigaos*)
80*3d8817e4Smiod    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)'
81*3d8817e4Smiod    hardcode_libdir_flag_spec='-L$libdir'
82*3d8817e4Smiod    hardcode_minus_L=yes
83*3d8817e4Smiod
84*3d8817e4Smiod    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
85*3d8817e4Smiod    # that the semantics of dynamic libraries on AmigaOS, at least up
86*3d8817e4Smiod    # to version 4, is to share data among multiple programs linked
87*3d8817e4Smiod    # with the same dynamic library.  Since this doesn't match the
88*3d8817e4Smiod    # behavior of shared libraries on other platforms, we can use
89*3d8817e4Smiod    # them.
90*3d8817e4Smiod    ld_shlibs=no
91*3d8817e4Smiod    ;;
92*3d8817e4Smiod
93*3d8817e4Smiod  beos*)
94*3d8817e4Smiod    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
95*3d8817e4Smiod      allow_undefined_flag=unsupported
96*3d8817e4Smiod      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
97*3d8817e4Smiod      # support --undefined.  This deserves some investigation.  FIXME
98*3d8817e4Smiod      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
99*3d8817e4Smiod    else
100*3d8817e4Smiod      ld_shlibs=no
101*3d8817e4Smiod    fi
102*3d8817e4Smiod    ;;
103*3d8817e4Smiod
104*3d8817e4Smiod  cygwin* | mingw*)
105*3d8817e4Smiod    # hardcode_libdir_flag_spec is actually meaningless, as there is
106*3d8817e4Smiod    # no search path for DLLs.
107*3d8817e4Smiod    hardcode_libdir_flag_spec='-L$libdir'
108*3d8817e4Smiod    allow_undefined_flag=unsupported
109*3d8817e4Smiod    always_export_symbols=yes
110*3d8817e4Smiod
111*3d8817e4Smiod    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
112*3d8817e4Smiod      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~
113*3d8817e4Smiod      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
114*3d8817e4Smiod      if test "x$BUILD_CC" != "x" ; then $BUILD_CC -o impgen impgen.c ; \
115*3d8817e4Smiod      else $CC -o impgen impgen.c ; fi)~
116*3d8817e4Smiod      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
117*3d8817e4Smiod
118*3d8817e4Smiod    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
119*3d8817e4Smiod
120*3d8817e4Smiod    # cygwin and mingw dlls have different entry points and sets of symbols
121*3d8817e4Smiod    # to exclude.
122*3d8817e4Smiod    # FIXME: what about values for MSVC?
123*3d8817e4Smiod    dll_entry=__cygwin_dll_entry@12
124*3d8817e4Smiod    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
125*3d8817e4Smiod    case $host_os in
126*3d8817e4Smiod    mingw*)
127*3d8817e4Smiod      # mingw values
128*3d8817e4Smiod      dll_entry=_DllMainCRTStartup@12
129*3d8817e4Smiod      dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
130*3d8817e4Smiod      ;;
131*3d8817e4Smiod    esac
132*3d8817e4Smiod
133*3d8817e4Smiod    # mingw and cygwin differ, and it's simplest to just exclude the union
134*3d8817e4Smiod    # of the two symbol sets.
135*3d8817e4Smiod    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
136*3d8817e4Smiod
137*3d8817e4Smiod    # recent cygwin and mingw systems supply a stub DllMain which the user
138*3d8817e4Smiod    # can override, but on older systems we have to supply one (in ltdll.c)
139*3d8817e4Smiod    if test "x$lt_cv_need_dllmain" = "xyes"; then
140*3d8817e4Smiod      ltdll_obj='$output_objdir/$soname-ltdll.'"$objext "
141*3d8817e4Smiod      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~
142*3d8817e4Smiod	test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
143*3d8817e4Smiod    else
144*3d8817e4Smiod      ltdll_obj=
145*3d8817e4Smiod      ltdll_cmds=
146*3d8817e4Smiod    fi
147*3d8817e4Smiod
148*3d8817e4Smiod    # Extract the symbol export list from an `--export-all' def file,
149*3d8817e4Smiod    # then regenerate the def file from the symbol export list, so that
150*3d8817e4Smiod    # the compiled dll only exports the symbol export list.
151*3d8817e4Smiod    # Be careful not to strip the DATA tag left be newer dlltools.
152*3d8817e4Smiod    export_symbols_cmds="$ltdll_cmds"'
153*3d8817e4Smiod      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
154*3d8817e4Smiod      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
155*3d8817e4Smiod
156*3d8817e4Smiod    # If the export-symbols file already is a .def file (1st line
157*3d8817e4Smiod    # is EXPORTS), use it as is.
158*3d8817e4Smiod    # If DATA tags from a recent dlltool are present, honour them!
159*3d8817e4Smiod    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
160*3d8817e4Smiod        cp $export_symbols $output_objdir/$soname-def;
161*3d8817e4Smiod      else
162*3d8817e4Smiod        echo EXPORTS > $output_objdir/$soname-def;
163*3d8817e4Smiod        _lt_hint=1;
164*3d8817e4Smiod        cat $export_symbols | while read symbol; do
165*3d8817e4Smiod         set dummy \$symbol;
166*3d8817e4Smiod         case \[$]# in
167*3d8817e4Smiod           2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
168*3d8817e4Smiod           *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
169*3d8817e4Smiod         esac;
170*3d8817e4Smiod         _lt_hint=`expr 1 + \$_lt_hint`;
171*3d8817e4Smiod        done;
172*3d8817e4Smiod      fi~
173*3d8817e4Smiod      '"$ltdll_cmds"'
174*3d8817e4Smiod      $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~
175*3d8817e4Smiod      $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~
176*3d8817e4Smiod      $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~
177*3d8817e4Smiod      $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~
178*3d8817e4Smiod      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
179*3d8817e4Smiod    ;;
180*3d8817e4Smiod
181*3d8817e4Smiod  netbsd* | knetbsd*-gnu)
182*3d8817e4Smiod    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
183*3d8817e4Smiod      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
184*3d8817e4Smiod      wlarc=
185*3d8817e4Smiod    else
186*3d8817e4Smiod      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
187*3d8817e4Smiod      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
188*3d8817e4Smiod    fi
189*3d8817e4Smiod    ;;
190*3d8817e4Smiod
191*3d8817e4Smiod  solaris* | sysv5*)
192*3d8817e4Smiod    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
193*3d8817e4Smiod      ld_shlibs=no
194*3d8817e4Smiod      cat <<EOF 1>&2
195*3d8817e4Smiod
196*3d8817e4Smiod*** Warning: The releases 2.8.* of the GNU linker cannot reliably
197*3d8817e4Smiod*** create shared libraries on Solaris systems.  Therefore, libtool
198*3d8817e4Smiod*** is disabling shared libraries support.  We urge you to upgrade GNU
199*3d8817e4Smiod*** binutils to release 2.9.1 or newer.  Another option is to modify
200*3d8817e4Smiod*** your PATH or compiler configuration so that the native linker is
201*3d8817e4Smiod*** used, and then restart.
202*3d8817e4Smiod
203*3d8817e4SmiodEOF
204*3d8817e4Smiod    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
205*3d8817e4Smiod      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
206*3d8817e4Smiod      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
207*3d8817e4Smiod    else
208*3d8817e4Smiod      ld_shlibs=no
209*3d8817e4Smiod    fi
210*3d8817e4Smiod    ;;
211*3d8817e4Smiod
212*3d8817e4Smiod  sunos4*)
213*3d8817e4Smiod    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
214*3d8817e4Smiod    wlarc=
215*3d8817e4Smiod    hardcode_direct=yes
216*3d8817e4Smiod    hardcode_shlibpath_var=no
217*3d8817e4Smiod    ;;
218*3d8817e4Smiod
219*3d8817e4Smiod  *)
220*3d8817e4Smiod    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
221*3d8817e4Smiod      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
222*3d8817e4Smiod      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
223*3d8817e4Smiod    else
224*3d8817e4Smiod      ld_shlibs=no
225*3d8817e4Smiod    fi
226*3d8817e4Smiod    ;;
227*3d8817e4Smiod  esac
228*3d8817e4Smiod
229*3d8817e4Smiod  if test "$ld_shlibs" = yes; then
230*3d8817e4Smiod    runpath_var=LD_RUN_PATH
231*3d8817e4Smiod    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
232*3d8817e4Smiod    export_dynamic_flag_spec='${wl}--export-dynamic'
233*3d8817e4Smiod    case $host_os in
234*3d8817e4Smiod    cygwin* | mingw*)
235*3d8817e4Smiod      # dlltool doesn't understand --whole-archive et. al.
236*3d8817e4Smiod      whole_archive_flag_spec=
237*3d8817e4Smiod      ;;
238*3d8817e4Smiod    *)
239*3d8817e4Smiod      # ancient GNU ld didn't support --whole-archive et. al.
240*3d8817e4Smiod      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
241*3d8817e4Smiod	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
242*3d8817e4Smiod      else
243*3d8817e4Smiod	whole_archive_flag_spec=
244*3d8817e4Smiod      fi
245*3d8817e4Smiod      ;;
246*3d8817e4Smiod    esac
247*3d8817e4Smiod  fi
248*3d8817e4Smiodelse
249*3d8817e4Smiod  # PORTME fill in a description of your system's linker (not GNU ld)
250*3d8817e4Smiod  case $host_os in
251*3d8817e4Smiod  aix3*)
252*3d8817e4Smiod    allow_undefined_flag=unsupported
253*3d8817e4Smiod    always_export_symbols=yes
254*3d8817e4Smiod    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'
255*3d8817e4Smiod    # Note: this linker hardcodes the directories in LIBPATH if there
256*3d8817e4Smiod    # are no directories specified by -L.
257*3d8817e4Smiod    hardcode_minus_L=yes
258*3d8817e4Smiod    if test "$with_gcc" = yes && test -z "$link_static_flag"; then
259*3d8817e4Smiod      # Neither direct hardcoding nor static linking is supported with a
260*3d8817e4Smiod      # broken collect2.
261*3d8817e4Smiod      hardcode_direct=unsupported
262*3d8817e4Smiod    fi
263*3d8817e4Smiod    ;;
264*3d8817e4Smiod
265*3d8817e4Smiod  aix4* | aix5*)
266*3d8817e4Smiod    hardcode_direct=yes
267*3d8817e4Smiod    hardcode_libdir_separator=':'
268*3d8817e4Smiod    link_all_deplibs=yes
269*3d8817e4Smiod    # When large executables or shared objects are built, AIX ld can
270*3d8817e4Smiod    # have problems creating the table of contents.  If linking a library
271*3d8817e4Smiod    # or program results in "error TOC overflow" add -mminimal-toc to
272*3d8817e4Smiod    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
273*3d8817e4Smiod    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
274*3d8817e4Smiod    if test "$with_gcc" = yes; then
275*3d8817e4Smiod      case $host_os in aix4.[012]|aix4.[012].*)
276*3d8817e4Smiod      # We only want to do this on AIX 4.2 and lower, the check
277*3d8817e4Smiod      # below for broken collect2 doesn't work under 4.3+
278*3d8817e4Smiod        collect2name=`${CC} -print-prog-name=collect2`
279*3d8817e4Smiod        if test -f "$collect2name" && \
280*3d8817e4Smiod	   strings "$collect2name" | grep resolve_lib_name >/dev/null
281*3d8817e4Smiod        then
282*3d8817e4Smiod	  # We have reworked collect2
283*3d8817e4Smiod	  hardcode_direct=yes
284*3d8817e4Smiod        else
285*3d8817e4Smiod	  # We have old collect2
286*3d8817e4Smiod	  hardcode_direct=unsupported
287*3d8817e4Smiod	  # It fails to find uninstalled libraries when the uninstalled
288*3d8817e4Smiod	  # path is not listed in the libpath.  Setting hardcode_minus_L
289*3d8817e4Smiod	  # to unsupported forces relinking
290*3d8817e4Smiod	  hardcode_minus_L=yes
291*3d8817e4Smiod	  hardcode_libdir_flag_spec='-L$libdir'
292*3d8817e4Smiod	  hardcode_libdir_separator=
293*3d8817e4Smiod        fi
294*3d8817e4Smiod      esac
295*3d8817e4Smiod      shared_flag='-shared'
296*3d8817e4Smiod    else
297*3d8817e4Smiod      # not using gcc
298*3d8817e4Smiod      if test "$host_cpu" = ia64; then
299*3d8817e4Smiod        shared_flag='${wl}-G'
300*3d8817e4Smiod      else
301*3d8817e4Smiod        shared_flag='${wl}-bM:SRE'
302*3d8817e4Smiod      fi
303*3d8817e4Smiod    fi
304*3d8817e4Smiod
305*3d8817e4Smiod    if test "$host_cpu" = ia64; then
306*3d8817e4Smiod      # On IA64, the linker does run time linking by default, so we don't
307*3d8817e4Smiod      # have to do anything special.
308*3d8817e4Smiod      aix_use_runtimelinking=no
309*3d8817e4Smiod      if test $with_gnu_ld = no; then
310*3d8817e4Smiod        exp_sym_flag='-Bexport'
311*3d8817e4Smiod        no_entry_flag=""
312*3d8817e4Smiod      fi
313*3d8817e4Smiod    else
314*3d8817e4Smiod      # Test if we are trying to use run time linking, or normal AIX style linking.
315*3d8817e4Smiod      # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
316*3d8817e4Smiod      aix_use_runtimelinking=no
317*3d8817e4Smiod      for ld_flag in $LDFLAGS; do
318*3d8817e4Smiod        if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
319*3d8817e4Smiod          aix_use_runtimelinking=yes
320*3d8817e4Smiod          break
321*3d8817e4Smiod        fi
322*3d8817e4Smiod      done
323*3d8817e4Smiod      exp_sym_flag='-bexport'
324*3d8817e4Smiod      no_entry_flag='-bnoentry'
325*3d8817e4Smiod    fi
326*3d8817e4Smiod    # -bexpall does not export symbols beginning with underscore (_)
327*3d8817e4Smiod    always_export_symbols=yes
328*3d8817e4Smiod    if test "$aix_use_runtimelinking" = yes; then
329*3d8817e4Smiod      # Warning - without using the other run time loading flags (-brtl), -berok will
330*3d8817e4Smiod      #           link without error, but may produce a broken library.
331*3d8817e4Smiod      allow_undefined_flag=' ${wl}-berok'
332*3d8817e4Smiod      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
333*3d8817e4Smiod      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"
334*3d8817e4Smiod    else
335*3d8817e4Smiod      if test "$host_cpu" = ia64; then
336*3d8817e4Smiod        if test $with_gnu_ld = no; then
337*3d8817e4Smiod          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
338*3d8817e4Smiod          allow_undefined_flag="-z nodefs"
339*3d8817e4Smiod          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"
340*3d8817e4Smiod        fi
341*3d8817e4Smiod      else
342*3d8817e4Smiod        allow_undefined_flag=' ${wl}-berok'
343*3d8817e4Smiod        # -bexpall does not export symbols beginning with underscore (_)
344*3d8817e4Smiod        always_export_symbols=yes
345*3d8817e4Smiod        # Exported symbols can be pulled into shared objects from archives
346*3d8817e4Smiod        whole_archive_flag_spec=' '
347*3d8817e4Smiod        build_libtool_need_lc=yes
348*3d8817e4Smiod        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
349*3d8817e4Smiod        # This is similar to how AIX traditionally builds it's shared libraries.
350*3d8817e4Smiod        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'
351*3d8817e4Smiod      fi
352*3d8817e4Smiod    fi
353*3d8817e4Smiod  ;;
354*3d8817e4Smiod
355*3d8817e4Smiod  amigaos*)
356*3d8817e4Smiod    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)'
357*3d8817e4Smiod    hardcode_libdir_flag_spec='-L$libdir'
358*3d8817e4Smiod    hardcode_minus_L=yes
359*3d8817e4Smiod    # see comment about different semantics on the GNU ld section
360*3d8817e4Smiod    ld_shlibs=no
361*3d8817e4Smiod    ;;
362*3d8817e4Smiod
363*3d8817e4Smiod  cygwin* | mingw*)
364*3d8817e4Smiod    # When not using gcc, we currently assume that we are using
365*3d8817e4Smiod    # Microsoft Visual C++.
366*3d8817e4Smiod    # hardcode_libdir_flag_spec is actually meaningless, as there is
367*3d8817e4Smiod    # no search path for DLLs.
368*3d8817e4Smiod    hardcode_libdir_flag_spec=' '
369*3d8817e4Smiod    allow_undefined_flag=unsupported
370*3d8817e4Smiod    # Tell ltmain to make .lib files, not .a files.
371*3d8817e4Smiod    libext=lib
372*3d8817e4Smiod    # FIXME: Setting linknames here is a bad hack.
373*3d8817e4Smiod    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
374*3d8817e4Smiod    # The linker will automatically build a .lib file if we build a DLL.
375*3d8817e4Smiod    old_archive_from_new_cmds='true'
376*3d8817e4Smiod    # FIXME: Should let the user specify the lib program.
377*3d8817e4Smiod    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
378*3d8817e4Smiod    fix_srcfile_path='`cygpath -w "$srcfile"`'
379*3d8817e4Smiod    ;;
380*3d8817e4Smiod
381*3d8817e4Smiod  freebsd1*)
382*3d8817e4Smiod    ld_shlibs=no
383*3d8817e4Smiod    ;;
384*3d8817e4Smiod
385*3d8817e4Smiod  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
386*3d8817e4Smiod  # support.  Future versions do this automatically, but an explicit c++rt0.o
387*3d8817e4Smiod  # does not break anything, and helps significantly (at the cost of a little
388*3d8817e4Smiod  # extra space).
389*3d8817e4Smiod  freebsd2.2*)
390*3d8817e4Smiod    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
391*3d8817e4Smiod    hardcode_libdir_flag_spec='-R$libdir'
392*3d8817e4Smiod    hardcode_direct=yes
393*3d8817e4Smiod    hardcode_shlibpath_var=no
394*3d8817e4Smiod    ;;
395*3d8817e4Smiod
396*3d8817e4Smiod  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
397*3d8817e4Smiod  freebsd2*)
398*3d8817e4Smiod    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
399*3d8817e4Smiod    hardcode_direct=yes
400*3d8817e4Smiod    hardcode_minus_L=yes
401*3d8817e4Smiod    hardcode_shlibpath_var=no
402*3d8817e4Smiod    ;;
403*3d8817e4Smiod
404*3d8817e4Smiod  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
405*3d8817e4Smiod  freebsd* | kfreebsd*-gnu)
406*3d8817e4Smiod    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
407*3d8817e4Smiod    hardcode_libdir_flag_spec='-R$libdir'
408*3d8817e4Smiod    hardcode_direct=yes
409*3d8817e4Smiod    hardcode_shlibpath_var=no
410*3d8817e4Smiod    ;;
411*3d8817e4Smiod
412*3d8817e4Smiod  hpux9* | hpux10* | hpux11*)
413*3d8817e4Smiod    case $host_os in
414*3d8817e4Smiod    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' ;;
415*3d8817e4Smiod    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
416*3d8817e4Smiod    esac
417*3d8817e4Smiod    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
418*3d8817e4Smiod    hardcode_libdir_separator=:
419*3d8817e4Smiod    hardcode_direct=yes
420*3d8817e4Smiod    hardcode_minus_L=yes # Not in the search PATH, but as the default
421*3d8817e4Smiod			 # location of the library.
422*3d8817e4Smiod    export_dynamic_flag_spec='${wl}-E'
423*3d8817e4Smiod    ;;
424*3d8817e4Smiod
425*3d8817e4Smiod  irix5* | irix6*)
426*3d8817e4Smiod    if test "$with_gcc" = yes; then
427*3d8817e4Smiod      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'
428*3d8817e4Smiod    else
429*3d8817e4Smiod      archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
430*3d8817e4Smiod    fi
431*3d8817e4Smiod    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
432*3d8817e4Smiod    hardcode_libdir_separator=:
433*3d8817e4Smiod    link_all_deplibs=yes
434*3d8817e4Smiod    ;;
435*3d8817e4Smiod
436*3d8817e4Smiod  netbsd* | knetbsd*-gnu)
437*3d8817e4Smiod    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
438*3d8817e4Smiod      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
439*3d8817e4Smiod    else
440*3d8817e4Smiod      archive_cmds='$LD -shared -nodefaultlibs -o $lib $libobjs $deplibs $linker_flags'      # ELF
441*3d8817e4Smiod    fi
442*3d8817e4Smiod    hardcode_libdir_flag_spec='${wl}-R$libdir'
443*3d8817e4Smiod    hardcode_direct=yes
444*3d8817e4Smiod    hardcode_shlibpath_var=no
445*3d8817e4Smiod    ;;
446*3d8817e4Smiod
447*3d8817e4Smiod  openbsd*)
448*3d8817e4Smiod    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
449*3d8817e4Smiod    hardcode_libdir_flag_spec='-R$libdir'
450*3d8817e4Smiod    hardcode_direct=yes
451*3d8817e4Smiod    hardcode_shlibpath_var=no
452*3d8817e4Smiod    ;;
453*3d8817e4Smiod
454*3d8817e4Smiod  os2*)
455*3d8817e4Smiod    hardcode_libdir_flag_spec='-L$libdir'
456*3d8817e4Smiod    hardcode_minus_L=yes
457*3d8817e4Smiod    allow_undefined_flag=unsupported
458*3d8817e4Smiod    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'
459*3d8817e4Smiod    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
460*3d8817e4Smiod    ;;
461*3d8817e4Smiod
462*3d8817e4Smiod  osf3*)
463*3d8817e4Smiod    if test "$with_gcc" = yes; then
464*3d8817e4Smiod      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
465*3d8817e4Smiod      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'
466*3d8817e4Smiod    else
467*3d8817e4Smiod      allow_undefined_flag=' -expect_unresolved \*'
468*3d8817e4Smiod      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'
469*3d8817e4Smiod    fi
470*3d8817e4Smiod    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
471*3d8817e4Smiod    hardcode_libdir_separator=:
472*3d8817e4Smiod    ;;
473*3d8817e4Smiod
474*3d8817e4Smiod  osf4* | osf5*)	# as osf3* with the addition of -msym flag
475*3d8817e4Smiod    if test "$with_gcc" = yes; then
476*3d8817e4Smiod      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
477*3d8817e4Smiod      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'
478*3d8817e4Smiod    else
479*3d8817e4Smiod      allow_undefined_flag=' -expect_unresolved \*'
480*3d8817e4Smiod      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'
481*3d8817e4Smiod    fi
482*3d8817e4Smiod    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
483*3d8817e4Smiod    hardcode_libdir_separator=:
484*3d8817e4Smiod    ;;
485*3d8817e4Smiod
486*3d8817e4Smiod  sco3.2v5*)
487*3d8817e4Smiod    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
488*3d8817e4Smiod    hardcode_shlibpath_var=no
489*3d8817e4Smiod    runpath_var=LD_RUN_PATH
490*3d8817e4Smiod    hardcode_runpath_var=yes
491*3d8817e4Smiod    ;;
492*3d8817e4Smiod
493*3d8817e4Smiod  solaris*)
494*3d8817e4Smiod    no_undefined_flag=' ${wl}-z ${wl}defs'
495*3d8817e4Smiod    archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
496*3d8817e4Smiod    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
497*3d8817e4Smiod      $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
498*3d8817e4Smiod
499*3d8817e4Smiod    # Commands to make compiler produce verbose output that lists
500*3d8817e4Smiod    # what "hidden" libraries, object files and flags are used when
501*3d8817e4Smiod    # linking a shared library.
502*3d8817e4Smiod    output_verbose_link_cmds="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
503*3d8817e4Smiod
504*3d8817e4Smiod    hardcode_libdir_flag_spec='${wl}-R $wl$libdir'
505*3d8817e4Smiod    hardcode_shlibpath_var=no
506*3d8817e4Smiod    case $host_os in
507*3d8817e4Smiod    solaris2.[0-5] | solaris2.[0-5].*) ;;
508*3d8817e4Smiod    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
509*3d8817e4Smiod      whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;;
510*3d8817e4Smiod    esac
511*3d8817e4Smiod    link_all_deplibs=yes
512*3d8817e4Smiod    ;;
513*3d8817e4Smiod
514*3d8817e4Smiod  sunos4*)
515*3d8817e4Smiod    archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
516*3d8817e4Smiod    hardcode_libdir_flag_spec='-L$libdir'
517*3d8817e4Smiod    hardcode_direct=yes
518*3d8817e4Smiod    hardcode_minus_L=yes
519*3d8817e4Smiod    hardcode_shlibpath_var=no
520*3d8817e4Smiod    ;;
521*3d8817e4Smiod
522*3d8817e4Smiod  sysv4)
523*3d8817e4Smiod    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
524*3d8817e4Smiod    runpath_var='LD_RUN_PATH'
525*3d8817e4Smiod    hardcode_shlibpath_var=no
526*3d8817e4Smiod    hardcode_direct=no #Motorola manual says yes, but my tests say they lie
527*3d8817e4Smiod    ;;
528*3d8817e4Smiod
529*3d8817e4Smiod  sysv4.3*)
530*3d8817e4Smiod    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
531*3d8817e4Smiod    hardcode_shlibpath_var=no
532*3d8817e4Smiod    export_dynamic_flag_spec='-Bexport'
533*3d8817e4Smiod    ;;
534*3d8817e4Smiod
535*3d8817e4Smiod  sysv5*)
536*3d8817e4Smiod    no_undefined_flag=' -z text'
537*3d8817e4Smiod    # $CC -shared without GNU ld will not create a library from C++
538*3d8817e4Smiod    # object files and a static libstdc++, better avoid it by now
539*3d8817e4Smiod    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
540*3d8817e4Smiod    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
541*3d8817e4Smiod		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
542*3d8817e4Smiod    hardcode_libdir_flag_spec=
543*3d8817e4Smiod    hardcode_shlibpath_var=no
544*3d8817e4Smiod    runpath_var='LD_RUN_PATH'
545*3d8817e4Smiod    ;;
546*3d8817e4Smiod
547*3d8817e4Smiod  uts4*)
548*3d8817e4Smiod    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
549*3d8817e4Smiod    hardcode_libdir_flag_spec='-L$libdir'
550*3d8817e4Smiod    hardcode_shlibpath_var=no
551*3d8817e4Smiod    ;;
552*3d8817e4Smiod
553*3d8817e4Smiod  dgux*)
554*3d8817e4Smiod    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
555*3d8817e4Smiod    hardcode_libdir_flag_spec='-L$libdir'
556*3d8817e4Smiod    hardcode_shlibpath_var=no
557*3d8817e4Smiod    ;;
558*3d8817e4Smiod
559*3d8817e4Smiod  sysv4*MP*)
560*3d8817e4Smiod    if test -d /usr/nec; then
561*3d8817e4Smiod      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
562*3d8817e4Smiod      hardcode_shlibpath_var=no
563*3d8817e4Smiod      runpath_var=LD_RUN_PATH
564*3d8817e4Smiod      hardcode_runpath_var=yes
565*3d8817e4Smiod      ld_shlibs=yes
566*3d8817e4Smiod    fi
567*3d8817e4Smiod    ;;
568*3d8817e4Smiod
569*3d8817e4Smiod  sysv4.2uw2*)
570*3d8817e4Smiod    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
571*3d8817e4Smiod    hardcode_direct=yes
572*3d8817e4Smiod    hardcode_minus_L=no
573*3d8817e4Smiod    hardcode_shlibpath_var=no
574*3d8817e4Smiod    hardcode_runpath_var=yes
575*3d8817e4Smiod    runpath_var=LD_RUN_PATH
576*3d8817e4Smiod    ;;
577*3d8817e4Smiod
578*3d8817e4Smiod  sysv5uw7* | unixware7*)
579*3d8817e4Smiod    no_undefined_flag='${wl}-z ${wl}text'
580*3d8817e4Smiod    if test "$GCC" = yes; then
581*3d8817e4Smiod      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
582*3d8817e4Smiod    else
583*3d8817e4Smiod      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
584*3d8817e4Smiod    fi
585*3d8817e4Smiod    runpath_var='LD_RUN_PATH'
586*3d8817e4Smiod    hardcode_shlibpath_var=no
587*3d8817e4Smiod    ;;
588*3d8817e4Smiod
589*3d8817e4Smiod  *)
590*3d8817e4Smiod    ld_shlibs=no
591*3d8817e4Smiod    ;;
592*3d8817e4Smiod  esac
593*3d8817e4Smiodfi
594*3d8817e4Smiod
595*3d8817e4Smiod## Compiler Characteristics: PIC flags, static flags, etc
596*3d8817e4Smiod
597*3d8817e4Smiod# We don't use cached values here since only the C compiler
598*3d8817e4Smiod# characteristics should be cached.
599*3d8817e4Smiod  ac_cv_prog_cc_pic=
600*3d8817e4Smiod  ac_cv_prog_cc_shlib=
601*3d8817e4Smiod  ac_cv_prog_cc_wl=
602*3d8817e4Smiod  ac_cv_prog_cc_static=
603*3d8817e4Smiod  ac_cv_prog_cc_no_builtin=
604*3d8817e4Smiod  ac_cv_prog_cc_can_build_shared=$can_build_shared
605*3d8817e4Smiod
606*3d8817e4Smiod    ac_cv_prog_cc_wl='-Wl,'
607*3d8817e4Smiod    ac_cv_prog_cc_static='-static'
608*3d8817e4Smiod
609*3d8817e4Smiod    case $host_os in
610*3d8817e4Smiod    beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
611*3d8817e4Smiod      # PIC is the default for these OSes.
612*3d8817e4Smiod      ;;
613*3d8817e4Smiod    aix*)
614*3d8817e4Smiod      # Below there is a dirty hack to force normal static linking with -ldl
615*3d8817e4Smiod      # The problem is because libdl dynamically linked with both libc and
616*3d8817e4Smiod      # libC (AIX C++ library), which obviously doesn't included in libraries
617*3d8817e4Smiod      # list by gcc. This cause undefined symbols with -static flags.
618*3d8817e4Smiod      # This hack allows C programs to be linked with "-static -ldl", but
619*3d8817e4Smiod      # we not sure about C++ programs.
620*3d8817e4Smiod      ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
621*3d8817e4Smiod      ;;
622*3d8817e4Smiod    *djgpp*)
623*3d8817e4Smiod      # DJGPP does not suppot shared libraries at all
624*3d8817e4Smiod      ac_cv_prog_cc_pic=
625*3d8817e4Smiod      ;;
626*3d8817e4Smiod    cygwin* | mingw* | os2*)
627*3d8817e4Smiod      # This hack is so that the source file can tell whether it is being
628*3d8817e4Smiod      # built for inclusion in a dll (and should export symbols for example).
629*3d8817e4Smiod      ac_cv_prog_cc_pic='-DDLL_EXPORT'
630*3d8817e4Smiod      ;;
631*3d8817e4Smiod    amigaos*)
632*3d8817e4Smiod      # FIXME: we need at least 68020 code to build shared libraries, but
633*3d8817e4Smiod      # adding the `-m68020' flag to GCC prevents building anything better,
634*3d8817e4Smiod      # like `-m68040'.
635*3d8817e4Smiod      ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
636*3d8817e4Smiod      ;;
637*3d8817e4Smiod    sysv4*MP*)
638*3d8817e4Smiod      if test -d /usr/nec; then
639*3d8817e4Smiod	 ac_cv_prog_cc_pic=-Kconform_pic
640*3d8817e4Smiod      fi
641*3d8817e4Smiod      ;;
642*3d8817e4Smiod    *)
643*3d8817e4Smiod      ac_cv_prog_cc_pic='-fPIC'
644*3d8817e4Smiod      ;;
645*3d8817e4Smiod    esac
646*3d8817e4Smiod
647*3d8817e4Smiod# GCJ did not exist at the time GCC didn't implicitly link libc in.
648*3d8817e4Smiodneed_lc=no
649*3d8817e4Smiod
650*3d8817e4Smiod# All existing releases of GCJ support `-c -o'.
651*3d8817e4Smiodlt_cv_compiler_c_o=yes
652