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