ltcf-cxx.sh 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071
  1. #### This script is meant to be sourced by ltconfig.
  2. # ltcf-cxx.sh - Create a C++ 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 C++ support by:Gary V. Vaughan <gvv@techie.com>
  8. # Alexandre Oliva <oliva@lsd.ic.unicamp.br>
  9. # Ossama Othman <ossama@debian.org>
  10. # Thomas Thanner <tanner@gmx.de>
  11. #
  12. # This file is free software; you can redistribute it and/or modify it
  13. # under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License, or
  15. # (at your option) any later version.
  16. #
  17. # This program is distributed in the hope that it will be useful, but
  18. # WITHOUT ANY WARRANTY; without even the implied warranty of
  19. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  20. # General Public License for more details.
  21. #
  22. # You should have received a copy of the GNU General Public License
  23. # along with this program; if not, write to the Free Software
  24. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  25. #
  26. # As a special exception to the GNU General Public License, if you
  27. # distribute this file as part of a program that contains a
  28. # configuration script generated by Autoconf, you may include it under
  29. # the same distribution terms that you use for the rest of that program.
  30. # Source file extension for C++ test sources.
  31. ac_ext=cc
  32. # Object file extension for compiled C++ test sources.
  33. objext=o
  34. # Code to be used in simple compile tests
  35. lt_simple_compile_test_code="int some_variable = 0;"
  36. # Code to be used in simple link tests
  37. lt_simple_link_test_code='int main(int, char *[]) { return (0); }'
  38. # C++ compiler
  39. CXX=${CXX-c++}
  40. # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  41. CC=${CC-"$CXX"}
  42. CFLAGS=${CFLAGS-"$CXXFLAGS"}
  43. # Allow CC to be a program name with arguments.
  44. set dummy $CC
  45. compiler=$2
  46. cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
  47. # Check if we are using GNU gcc (taken/adapted from configure script)
  48. # We need to check here since "--with-gcc" is set at configure time,
  49. # not ltconfig time!
  50. cat > conftest.$ac_ext <<EOF
  51. #ifdef __GNUC__
  52. yes;
  53. #endif
  54. EOF
  55. if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  56. with_gcc=yes
  57. # Set up default GNU C++ configuration
  58. # Check if GNU C++ uses GNU ld as the underlying linker, since the
  59. # archiving commands below assume that GNU ld is being used. The
  60. # assumption here is that the linker is going to be the same as that
  61. # used by the C compiler. For the purposes of GCC, this is ok, but
  62. # if someone uses g++ along with a non-GNU C compiler that doesn't
  63. # use GNU ld, we may lose. This is ok for the toolchain tree, since
  64. # the only users of ltcf-cxx.sh are libstdc++-v3 and libjava,
  65. # anyway, and those use both gcc and g++, so the settings are bound
  66. # to be the same.
  67. if test "$with_gnu_ld" = yes; then
  68. archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  69. archive_expsym_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  70. hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
  71. export_dynamic_flag_spec='${wl}--export-dynamic'
  72. # If archive_cmds runs LD, not CC, wlarc should be empty
  73. # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
  74. # investigate it a little bit more. (MM)
  75. wlarc='${wl}'
  76. # ancient GNU ld didn't support --whole-archive et. al.
  77. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
  78. egrep 'no-whole-archive' > /dev/null; then
  79. whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  80. else
  81. whole_archive_flag_spec=
  82. fi
  83. else
  84. wlarc=
  85. # A generic and very simple default shared library creation
  86. # command for GNU C++ for the case where it uses the native
  87. # linker, instead of GNU ld. If possible, this setting should
  88. # overridden to take advantage of the native linker features on
  89. # the platform it is being used on.
  90. archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
  91. fi
  92. # Commands to make compiler produce verbose output that lists
  93. # what "hidden" libraries, object files and flags are used when
  94. # linking a shared library.
  95. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
  96. else
  97. with_gcc=no
  98. wlarc=
  99. fi
  100. # PORTME: fill in a description of your system's C++ link characteristics
  101. case $host_os in
  102. aix3*)
  103. # FIXME: insert proper C++ library support
  104. ld_shlibs=no
  105. ;;
  106. aix4* | aix5*)
  107. archive_cmds=''
  108. hardcode_direct=yes
  109. hardcode_libdir_separator=':'
  110. link_all_deplibs=yes
  111. file_list_spec='${wl}-f,'
  112. # When large executables or shared objects are built, AIX ld can
  113. # have problems creating the table of contents. If linking a library
  114. # or program results in "error TOC overflow" add -mminimal-toc to
  115. # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
  116. # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
  117. if test "$with_gcc" = yes; then
  118. case $host_os in aix4.[012]|aix4.[012].*)
  119. # We only want to do this on AIX 4.2 and lower, the check
  120. # below for broken collect2 doesn't work under 4.3+
  121. collect2name=`${CC} -print-prog-name=collect2`
  122. if test -f "$collect2name" && \
  123. strings "$collect2name" | grep resolve_lib_name >/dev/null
  124. then
  125. # We have reworked collect2
  126. hardcode_direct=yes
  127. else
  128. # We have old collect2
  129. hardcode_direct=unsupported
  130. # It fails to find uninstalled libraries when the uninstalled
  131. # path is not listed in the libpath. Setting hardcode_minus_L
  132. # to unsupported forces relinking
  133. hardcode_minus_L=yes
  134. hardcode_libdir_flag_spec='-L$libdir'
  135. hardcode_libdir_separator=
  136. fi
  137. esac
  138. shared_flag='-shared'
  139. else
  140. # not using gcc
  141. if test "$host_cpu" = ia64; then
  142. shared_flag='${wl}-G'
  143. else
  144. shared_flag='${wl}-bM:SRE'
  145. fi
  146. fi
  147. if test "$host_cpu" = ia64; then
  148. # On IA64, the linker does run time linking by default, so we don't
  149. # have to do anything special.
  150. aix_use_runtimelinking=no
  151. if test $with_gnu_ld = no; then
  152. exp_sym_flag='-Bexport'
  153. no_entry_flag=""
  154. fi
  155. else
  156. # Test if we are trying to use run time linking, or normal AIX style linking.
  157. # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
  158. aix_use_runtimelinking=no
  159. for ld_flag in $LDFLAGS; do
  160. if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
  161. aix_use_runtimelinking=yes
  162. break
  163. fi
  164. done
  165. exp_sym_flag='-bexport'
  166. no_entry_flag='-bnoentry'
  167. fi
  168. # It seems that -bexpall does not export symbols beginning with
  169. # underscore (_), so it is better to generate a list of symbols to export.
  170. always_export_symbols=yes
  171. if test "$aix_use_runtimelinking" = yes; then
  172. hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
  173. allow_undefined_flag=' -Wl,-G'
  174. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}-brtl \${wl}$exp_sym_flag:\$export_symbols"
  175. else
  176. if test "$host_cpu" = ia64; then
  177. if test $with_gnu_ld = no; then
  178. hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
  179. allow_undefined_flag="-z nodefs"
  180. 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"
  181. fi
  182. else
  183. hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
  184. # Warning - without using the other run time loading flags, -berok will
  185. # link without error, but may produce a broken library.
  186. no_undefined_flag=' ${wl}-bnoerok'
  187. allow_undefined_flag=' ${wl}-berok'
  188. # -bexpall does not export symbols beginning with underscore (_)
  189. always_export_symbols=yes
  190. # Exported symbols can be pulled into shared objects from archives
  191. whole_archive_flag_spec=' '
  192. build_libtool_need_lc=yes
  193. # This is similar to how AIX traditionally builds it's shared libraries.
  194. 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'
  195. fi
  196. fi
  197. ;;
  198. chorus*)
  199. case $cc_basename in
  200. *)
  201. # FIXME: insert proper C++ library support
  202. ld_shlibs=no
  203. ;;
  204. esac
  205. ;;
  206. darwin* | rhapsody*)
  207. case "$host_os" in
  208. rhapsody* | darwin1.[[012]])
  209. allow_undefined_flag='-undefined suppress'
  210. ;;
  211. *) # Darwin 1.3 on
  212. if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
  213. allow_undefined_flag='-flat_namespace -undefined suppress'
  214. else
  215. case ${MACOSX_DEPLOYMENT_TARGET} in
  216. 10.[[012]])
  217. allow_undefined_flag='-flat_namespace -undefined suppress'
  218. ;;
  219. 10.*)
  220. allow_undefined_flag='-undefined dynamic_lookup'
  221. ;;
  222. esac
  223. fi
  224. ;;
  225. esac
  226. # Disable shared library build on OS-X older than 10.3.
  227. case $host_os in
  228. darwin[1-6]*)
  229. can_build_shared=no
  230. ;;
  231. darwin7*)
  232. can_build_shared=yes
  233. ;;
  234. esac
  235. output_verbose_link_cmd='echo'
  236. archive_cmds='$CXX -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
  237. module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
  238. # Don't fix this by using the ld -exported_symbols_list flag,
  239. # it doesn't exist in older darwin ld's
  240. 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}'
  241. 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}'
  242. hardcode_direct=no
  243. hardcode_automatic=yes
  244. hardcode_shlibpath_var=unsupported
  245. link_all_deplibs=yes
  246. ;;
  247. dgux*)
  248. case $cc_basename in
  249. ec++)
  250. # FIXME: insert proper C++ library support
  251. ld_shlibs=no
  252. ;;
  253. ghcx)
  254. # Green Hills C++ Compiler
  255. # FIXME: insert proper C++ library support
  256. ld_shlibs=no
  257. ;;
  258. *)
  259. # FIXME: insert proper C++ library support
  260. ld_shlibs=no
  261. ;;
  262. esac
  263. ;;
  264. freebsd[12]*)
  265. # C++ shared libraries reported to be fairly broken before switch to ELF
  266. ld_shlibs=no
  267. ;;
  268. freebsd* | kfreebsd*-gnu)
  269. # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
  270. # conventions
  271. ld_shlibs=yes
  272. ;;
  273. gnu*)
  274. ;;
  275. hpux*)
  276. if test $with_gnu_ld = no; then
  277. case "$host_cpu" in
  278. ia64*)
  279. hardcode_libdir_flag_spec='-L$libdir'
  280. hardcode_shlibpath_var=no ;;
  281. *)
  282. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' ;;
  283. esac
  284. hardcode_direct=yes
  285. hardcode_libdir_separator=:
  286. export_dynamic_flag_spec='${wl}-E'
  287. fi
  288. hardcode_minus_L=yes # Not in the search PATH, but as the default
  289. # location of the library.
  290. case $cc_basename in
  291. CC)
  292. # FIXME: insert proper C++ library support
  293. ld_shlibs=no
  294. ;;
  295. aCC)
  296. case $host_os in
  297. hpux9*) archive_cmds='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
  298. *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
  299. esac
  300. # Commands to make compiler produce verbose output that lists
  301. # what "hidden" libraries, object files and flags are used when
  302. # linking a shared library.
  303. #
  304. # There doesn't appear to be a way to prevent this compiler from
  305. # explicitly linking system object files so we need to strip them
  306. # from the output so that they don't get included in the library
  307. # dependencies.
  308. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  309. ;;
  310. *)
  311. if test $with_gcc = yes; then
  312. if test $with_gnu_ld = no; then
  313. case "$host_os" in
  314. hpux9*) archive_cmds='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
  315. *)
  316. case "$host_cpu" in
  317. ia64*)
  318. archive_cmds='$LD -b +h $soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' ;;
  319. *)
  320. archive_cmds='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
  321. esac
  322. ;;
  323. esac
  324. fi
  325. else
  326. # FIXME: insert proper C++ library support
  327. ld_shlibs=no
  328. fi
  329. ;;
  330. esac
  331. ;;
  332. irix5* | irix6*)
  333. case $cc_basename in
  334. CC)
  335. # SGI C++
  336. archive_cmds='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
  337. # Archives containing C++ object files must be created using
  338. # "CC -ar", where "CC" is the IRIX C++ compiler. This is
  339. # necessary to make sure instantiated templates are included
  340. # in the archive.
  341. old_archive_cmds='$CC -ar -WR,-u -o $oldlib $oldobjs'
  342. ;;
  343. *)
  344. if test "$with_gcc" = yes; then
  345. if test "$with_gnu_ld" = no; then
  346. archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
  347. else
  348. archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
  349. fi
  350. fi
  351. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  352. hardcode_libdir_separator=:
  353. link_all_deplibs=yes
  354. ;;
  355. esac
  356. ;;
  357. linux*)
  358. case $cc_basename in
  359. KCC)
  360. # Kuck and Associates, Inc. (KAI) C++ Compiler
  361. # KCC will only create a shared library if the output file
  362. # ends with ".so" (or ".sl" for HP-UX), so rename the library
  363. # to its proper name (with version) after linking.
  364. archive_cmds='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  365. archive_expsym_cmds='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
  366. # Commands to make compiler produce verbose output that lists
  367. # what "hidden" libraries, object files and flags are used when
  368. # linking a shared library.
  369. #
  370. # There doesn't appear to be a way to prevent this compiler from
  371. # explicitly linking system object files so we need to strip them
  372. # from the output so that they don't get included in the library
  373. # dependencies.
  374. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest.so 2>&1 | egrep "ld"`; rm -f libconftest.so; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  375. hardcode_libdir_flag_spec='${wl}--rpath,$libdir'
  376. export_dynamic_flag_spec='${wl}--export-dynamic'
  377. # Archives containing C++ object files must be created using
  378. # "CC -Bstatic", where "CC" is the KAI C++ compiler.
  379. old_archive_cmds='$CC -Bstatic -o $oldlib $oldobjs'
  380. ;;
  381. cxx)
  382. # Compaq C++
  383. archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  384. archive_expsym_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
  385. runpath_var=LD_RUN_PATH
  386. hardcode_libdir_flag_spec='-rpath $libdir'
  387. hardcode_libdir_separator=:
  388. # Commands to make compiler produce verbose output that lists
  389. # what "hidden" libraries, object files and flags are used when
  390. # linking a shared library.
  391. #
  392. # There doesn't appear to be a way to prevent this compiler from
  393. # explicitly linking system object files so we need to strip them
  394. # from the output so that they don't get included in the library
  395. # dependencies.
  396. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  397. ;;
  398. esac
  399. ;;
  400. lynxos*)
  401. # FIXME: insert proper C++ library support
  402. ld_shlibs=no
  403. ;;
  404. m88k*)
  405. # FIXME: insert proper C++ library support
  406. ld_shlibs=no
  407. ;;
  408. mvs*)
  409. case $cc_basename in
  410. cxx)
  411. # FIXME: insert proper C++ library support
  412. ld_shlibs=no
  413. ;;
  414. *)
  415. # FIXME: insert proper C++ library support
  416. ld_shlibs=no
  417. ;;
  418. esac
  419. ;;
  420. netbsd* | knetbsd*-gnu)
  421. # NetBSD uses g++ - do we need to do anything?
  422. ;;
  423. osf3*)
  424. case $cc_basename in
  425. KCC)
  426. # Kuck and Associates, Inc. (KAI) C++ Compiler
  427. # KCC will only create a shared library if the output file
  428. # ends with ".so" (or ".sl" for HP-UX), so rename the library
  429. # to its proper name (with version) after linking.
  430. archive_cmds='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  431. hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  432. hardcode_libdir_separator=:
  433. # Archives containing C++ object files must be created using
  434. # "CC -Bstatic", where "CC" is the KAI C++ compiler.
  435. old_archive_cmds='$CC -Bstatic -o $oldlib $oldobjs'
  436. ;;
  437. RCC)
  438. # Rational C++ 2.4.1
  439. # FIXME: insert proper C++ library support
  440. ld_shlibs=no
  441. ;;
  442. cxx)
  443. allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
  444. archive_cmds='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
  445. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  446. hardcode_libdir_separator=:
  447. # Commands to make compiler produce verbose output that lists
  448. # what "hidden" libraries, object files and flags are used when
  449. # linking a shared library.
  450. #
  451. # There doesn't appear to be a way to prevent this compiler from
  452. # explicitly linking system object files so we need to strip them
  453. # from the output so that they don't get included in the library
  454. # dependencies.
  455. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  456. ;;
  457. *)
  458. if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
  459. allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
  460. archive_cmds='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $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. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  462. hardcode_libdir_separator=:
  463. # Commands to make compiler produce verbose output that lists
  464. # what "hidden" libraries, object files and flags are used when
  465. # linking a shared library.
  466. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
  467. else
  468. # FIXME: insert proper C++ library support
  469. ld_shlibs=no
  470. fi
  471. ;;
  472. esac
  473. ;;
  474. osf4* | osf5*)
  475. case $cc_basename in
  476. KCC)
  477. # Kuck and Associates, Inc. (KAI) C++ Compiler
  478. # KCC will only create a shared library if the output file
  479. # ends with ".so" (or ".sl" for HP-UX), so rename the library
  480. # to its proper name (with version) after linking.
  481. archive_cmds='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  482. hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  483. hardcode_libdir_separator=:
  484. # Archives containing C++ object files must be created using
  485. # the KAI C++ compiler.
  486. old_archive_cmds='$CC -o $oldlib $oldobjs'
  487. ;;
  488. RCC)
  489. # Rational C++ 2.4.1
  490. # FIXME: insert proper C++ library support
  491. ld_shlibs=no
  492. ;;
  493. cxx)
  494. allow_undefined_flag=' -expect_unresolved \*'
  495. archive_cmds='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
  496. archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done~
  497. echo "-hidden">> $lib.exp~
  498. $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
  499. $rm $lib.exp'
  500. hardcode_libdir_flag_spec='-rpath $libdir'
  501. hardcode_libdir_separator=:
  502. # Commands to make compiler produce verbose output that lists
  503. # what "hidden" libraries, object files and flags are used when
  504. # linking a shared library.
  505. #
  506. # There doesn't appear to be a way to prevent this compiler from
  507. # explicitly linking system object files so we need to strip them
  508. # from the output so that they don't get included in the library
  509. # dependencies.
  510. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  511. ;;
  512. *)
  513. if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
  514. allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
  515. archive_cmds='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $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'
  516. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  517. hardcode_libdir_separator=:
  518. # Commands to make compiler produce verbose output that lists
  519. # what "hidden" libraries, object files and flags are used when
  520. # linking a shared library.
  521. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
  522. else
  523. # FIXME: insert proper C++ library support
  524. ld_shlibs=no
  525. fi
  526. ;;
  527. esac
  528. ;;
  529. psos*)
  530. # FIXME: insert proper C++ library support
  531. ld_shlibs=no
  532. ;;
  533. sco*)
  534. case $cc_basename in
  535. CC)
  536. # FIXME: insert proper C++ library support
  537. ld_shlibs=no
  538. ;;
  539. *)
  540. # FIXME: insert proper C++ library support
  541. ld_shlibs=no
  542. ;;
  543. esac
  544. ;;
  545. sunos4*)
  546. case $cc_basename in
  547. CC)
  548. # Sun C++ 4.x
  549. # FIXME: insert proper C++ library support
  550. ld_shlibs=no
  551. ;;
  552. lcc)
  553. # Lucid
  554. # FIXME: insert proper C++ library support
  555. ld_shlibs=no
  556. ;;
  557. *)
  558. # FIXME: insert proper C++ library support
  559. ld_shlibs=no
  560. ;;
  561. esac
  562. ;;
  563. solaris*)
  564. case $cc_basename in
  565. CC)
  566. # Sun C++ 4.2, 5.x and Centerline C++
  567. no_undefined_flag=' -zdefs'
  568. archive_cmds='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  569. archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  570. $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
  571. hardcode_libdir_flag_spec='-R$libdir'
  572. hardcode_shlibpath_var=no
  573. case $host_os in
  574. solaris2.[0-5] | solaris2.[0-5].*) ;;
  575. *)
  576. # The C++ compiler is used as linker so we must use $wl
  577. # flag to pass the commands to the underlying system
  578. # linker.
  579. # Supported since Solaris 2.6 (maybe 2.5.1?)
  580. whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
  581. ;;
  582. esac
  583. link_all_deplibs=yes
  584. # Commands to make compiler produce verbose output that lists
  585. # what "hidden" libraries, object files and flags are used when
  586. # linking a shared library.
  587. #
  588. # There doesn't appear to be a way to prevent this compiler from
  589. # explicitly linking system object files so we need to strip them
  590. # from the output so that they don't get included in the library
  591. # dependencies.
  592. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep "\-R|\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  593. # Archives containing C++ object files must be created using
  594. # "CC -xar", where "CC" is the Sun C++ compiler. This is
  595. # necessary to make sure instantiated templates are included
  596. # in the archive.
  597. old_archive_cmds='$CC -xar -o $oldlib $oldobjs'
  598. ;;
  599. gcx)
  600. # Green Hills C++ Compiler
  601. archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  602. # The C++ compiler must be used to create the archive.
  603. old_archive_cmds='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
  604. ;;
  605. *)
  606. # GNU C++ compiler with Solaris linker
  607. if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
  608. no_undefined_flag=' ${wl}-z ${wl}defs'
  609. if $CC --version | egrep -v '^2\.7' > /dev/null; then
  610. archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  611. archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  612. $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
  613. # Commands to make compiler produce verbose output that lists
  614. # what "hidden" libraries, object files and flags are used when
  615. # linking a shared library.
  616. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
  617. else
  618. # g++ 2.7 appears to require `-G' NOT `-shared' on this
  619. # platform.
  620. archive_cmds='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  621. archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  622. $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
  623. # Commands to make compiler produce verbose output that lists
  624. # what "hidden" libraries, object files and flags are used when
  625. # linking a shared library.
  626. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
  627. fi
  628. hardcode_libdir_flag_spec='${wl}-R $wl$libdir'
  629. fi
  630. ;;
  631. esac
  632. ;;
  633. tandem*)
  634. case $cc_basename in
  635. NCC)
  636. # NonStop-UX NCC 3.20
  637. # FIXME: insert proper C++ library support
  638. ld_shlibs=no
  639. ;;
  640. *)
  641. # FIXME: insert proper C++ library support
  642. ld_shlibs=no
  643. ;;
  644. esac
  645. ;;
  646. tpf*)
  647. ld_shlibs=yes
  648. ;;
  649. unixware*)
  650. # FIXME: insert proper C++ library support
  651. ld_shlibs=no
  652. ;;
  653. vxworks*)
  654. # FIXME: insert proper C++ library support
  655. ld_shlibs=no
  656. ;;
  657. *)
  658. # FIXME: insert proper C++ library support
  659. ld_shlibs=no
  660. ;;
  661. esac
  662. ## Compiler Characteristics: PIC flags, static flags, etc
  663. # We don't use cached values here since only the C compiler
  664. # characteristics should be cached.
  665. ac_cv_prog_cc_pic=
  666. ac_cv_prog_cc_shlib=
  667. ac_cv_prog_cc_wl=
  668. ac_cv_prog_cc_static=
  669. ac_cv_prog_cc_no_builtin=
  670. ac_cv_prog_cc_can_build_shared=$can_build_shared
  671. ac_cv_prog_cc_pic_works=
  672. ac_cv_prog_cc_static_works=
  673. if test "$with_gcc" = yes; then
  674. ac_cv_prog_cc_wl='-Wl,'
  675. ac_cv_prog_cc_static='-static'
  676. case $host_os in
  677. aix*)
  678. # All AIX code is PIC.
  679. if test "$host_cpu" = ia64; then
  680. # AIX 5 now supports IA64 processor
  681. lt_cv_prog_cc_static='-Bstatic'
  682. else
  683. lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
  684. fi
  685. ;;
  686. amigaos*)
  687. # FIXME: we need at least 68020 code to build shared libraries, but
  688. # adding the `-m68020' flag to GCC prevents building anything better,
  689. # like `-m68040'.
  690. ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
  691. ;;
  692. beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
  693. # PIC is the default for these OSes.
  694. ;;
  695. cygwin* | mingw* | os2*)
  696. # This hack is so that the source file can tell whether it is being
  697. # built for inclusion in a dll (and should export symbols for example).
  698. ac_cv_prog_cc_pic='-DDLL_EXPORT'
  699. ;;
  700. darwin* | rhapsody*)
  701. # PIC is the default on this platform
  702. # Common symbols not allowed in MH_DYLIB files
  703. ac_cv_prog_cc_pic='-fno-common'
  704. ;;
  705. *djgpp*)
  706. # DJGPP does not support shared libraries at all
  707. ac_cv_prog_cc_pic=
  708. ;;
  709. sysv4*MP*)
  710. if test -d /usr/nec; then
  711. ac_cv_prog_cc_pic=-Kconform_pic
  712. fi
  713. ;;
  714. *)
  715. ac_cv_prog_cc_pic='-fPIC'
  716. ;;
  717. esac
  718. else
  719. case $host_os in
  720. aix4* | aix5*)
  721. # All AIX code is PIC.
  722. if test "$host_cpu" = ia64; then
  723. # AIX 5 now supports IA64 processor
  724. lt_cv_prog_cc_static='-Bstatic'
  725. else
  726. lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
  727. fi
  728. ;;
  729. chorus*)
  730. case $cc_basename in
  731. cxch68)
  732. # Green Hills C++ Compiler
  733. # ac_cv_prog_cc_static="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
  734. ;;
  735. esac
  736. ;;
  737. dgux*)
  738. case $cc_basename in
  739. ec++)
  740. ac_cv_prog_cc_pic='-KPIC'
  741. ;;
  742. ghcx)
  743. # Green Hills C++ Compiler
  744. ac_cv_prog_cc_pic='-pic'
  745. ;;
  746. *)
  747. ;;
  748. esac
  749. ;;
  750. freebsd* | kfreebsd*-gnu)
  751. # FreeBSD uses GNU C++
  752. ;;
  753. gnu*)
  754. ;;
  755. hpux9* | hpux10* | hpux11*)
  756. case $cc_basename in
  757. CC)
  758. ac_cv_prog_cc_wl='-Wl,'
  759. ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
  760. ac_cv_prog_cc_pic='+Z'
  761. ;;
  762. aCC)
  763. ac_cv_prog_cc_wl='-Wl,'
  764. ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
  765. ac_cv_prog_cc_pic='+Z'
  766. ;;
  767. *)
  768. ;;
  769. esac
  770. ;;
  771. irix5* | irix6*)
  772. case $cc_basename in
  773. CC)
  774. ac_cv_prog_cc_wl='-Wl,'
  775. ac_cv_prog_cc_static='-non_shared'
  776. ac_cv_prog_cc_pic='-KPIC'
  777. ;;
  778. *)
  779. ;;
  780. esac
  781. ;;
  782. linux*)
  783. case $cc_basename in
  784. KCC)
  785. # KAI C++ Compiler
  786. ac_cv_prog_cc_wl='--backend -Wl,'
  787. ac_cv_prog_cc_pic='-fPIC'
  788. ;;
  789. cxx)
  790. # Compaq C++
  791. # Make sure the PIC flag is empty. It appears that all Alpha
  792. # Linux and Compaq Tru64 Unix objects are PIC.
  793. ac_cv_prog_cc_pic=
  794. ac_cv_prog_cc_static='-non_shared'
  795. ;;
  796. *)
  797. ;;
  798. esac
  799. ;;
  800. lynxos*)
  801. ;;
  802. m88k*)
  803. ;;
  804. mvs*)
  805. case $cc_basename in
  806. cxx)
  807. ac_cv_prog_cc_pic='-W c,exportall'
  808. ;;
  809. *)
  810. ;;
  811. esac
  812. ;;
  813. netbsd*)
  814. ;;
  815. osf3* | osf4* | osf5*)
  816. case $cc_basename in
  817. KCC)
  818. ac_cv_prog_cc_wl='--backend -Wl,'
  819. ;;
  820. RCC)
  821. # Rational C++ 2.4.1
  822. ac_cv_prog_cc_pic='-pic'
  823. ;;
  824. cxx)
  825. # Digital/Compaq C++
  826. ac_cv_prog_cc_wl='-Wl,'
  827. # Make sure the PIC flag is empty. It appears that all Alpha
  828. # Linux and Compaq Tru64 Unix objects are PIC.
  829. ac_cv_prog_cc_pic=
  830. ac_cv_prog_cc_static='-non_shared'
  831. ;;
  832. *)
  833. ;;
  834. esac
  835. ;;
  836. psos*)
  837. ;;
  838. sco*)
  839. case $cc_basename in
  840. CC)
  841. ac_cv_prog_cc_pic='-fPIC'
  842. ;;
  843. *)
  844. ;;
  845. esac
  846. ;;
  847. solaris*)
  848. case $cc_basename in
  849. CC)
  850. # Sun C++ 4.2, 5.x and Centerline C++
  851. ac_cv_prog_cc_pic='-KPIC'
  852. ac_cv_prog_cc_static='-Bstatic'
  853. ac_cv_prog_cc_wl='-Qoption ld '
  854. ;;
  855. gcx)
  856. # Green Hills C++ Compiler
  857. ac_cv_prog_cc_pic='-PIC'
  858. ;;
  859. *)
  860. ;;
  861. esac
  862. ;;
  863. sunos4*)
  864. case $cc_basename in
  865. CC)
  866. # Sun C++ 4.x
  867. ac_cv_prog_cc_pic='-pic'
  868. ac_cv_prog_cc_static='-Bstatic'
  869. ;;
  870. lcc)
  871. # Lucid
  872. ac_cv_prog_cc_pic='-pic'
  873. ;;
  874. *)
  875. ;;
  876. esac
  877. ;;
  878. tandem*)
  879. case $cc_basename in
  880. NCC)
  881. # NonStop-UX NCC 3.20
  882. ac_cv_prog_cc_pic='-KPIC'
  883. ;;
  884. *)
  885. ;;
  886. esac
  887. ;;
  888. unixware*)
  889. ;;
  890. vxworks*)
  891. ;;
  892. *)
  893. ac_cv_prog_cc_can_build_shared=no
  894. ;;
  895. esac
  896. fi
  897. case "$host_os" in
  898. # Platforms which do not suport PIC and -DPIC is meaningless
  899. # on them:
  900. *djgpp*)
  901. ac_cv_prog_cc_pic=
  902. ;;
  903. *)
  904. ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
  905. ;;
  906. esac
  907. # Figure out "hidden" C++ library dependencies from verbose
  908. # compiler output whening linking a shared library.
  909. cat > conftest.$ac_ext <<EOF
  910. class Foo
  911. {
  912. public:
  913. Foo (void) { a = 0; }
  914. private:
  915. int a;
  916. };
  917. EOF
  918. if (eval $ac_compile) 2>&5; then
  919. # Parse the compiler output and extract the necessary
  920. # objects, libraries and library flags.
  921. # Sentinel used to keep track of whether or not we are before
  922. # the conftest object file.
  923. pre_test_object_deps_done=no
  924. for p in `eval $output_verbose_link_cmd`; do
  925. case $p in
  926. -L* | -R* | -l*)
  927. # Some compilers place space between "-{L,R}" and the path.
  928. # Remove the space.
  929. if test $p = "-L" \
  930. || test $p = "-R"; then
  931. prev=$p
  932. continue
  933. else
  934. prev=
  935. fi
  936. if test "$pre_test_object_deps_done" = no; then
  937. case $p in
  938. -L* | -R*)
  939. # Internal compiler library paths should come after those
  940. # provided the user. The postdeps already come after the
  941. # user supplied libs so there is no need to process them.
  942. if test -z "$compiler_lib_search_path"; then
  943. compiler_lib_search_path="${prev}${p}"
  944. else
  945. compiler_lib_search_path="${compiler_lib_search_path} ${prev}${p}"
  946. fi
  947. ;;
  948. # The "-l" case would never come before the object being
  949. # linked, so don't bother handling this case.
  950. esac
  951. else
  952. if test -z "$postdeps"; then
  953. postdeps="${prev}${p}"
  954. else
  955. postdeps="${postdeps} ${prev}${p}"
  956. fi
  957. fi
  958. ;;
  959. *.$objext)
  960. # This assumes that the test object file only shows up
  961. # once in the compiler output.
  962. if test "$p" = "conftest.$objext"; then
  963. pre_test_object_deps_done=yes
  964. continue
  965. fi
  966. if test "$pre_test_object_deps_done" = no; then
  967. if test -z "$predep_objects"; then
  968. predep_objects="$p"
  969. else
  970. predep_objects="$predep_objects $p"
  971. fi
  972. else
  973. if test -z "$postdep_objects"; then
  974. postdep_objects="$p"
  975. else
  976. postdep_objects="$postdep_objects $p"
  977. fi
  978. fi
  979. ;;
  980. *) ;; # Ignore the rest.
  981. esac
  982. done
  983. # Clean up.
  984. rm -f a.out
  985. else
  986. echo "ltcf-cxx.sh: error: problem compiling test program"
  987. fi
  988. $rm -f confest.$objext
  989. case " $postdeps " in
  990. *" -lc "*) need_lc=no ;;
  991. *) need_lc=yes ;;
  992. esac