ltcf-gcj.sh 29 KB

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