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