Forced checkin for testing.
[official-gcc.git] / ltcf-cxx.sh
blobc134a4294864fca39e6a7804dc4de4b8c13a4862
1 #### This script is meant to be sourced by ltconfig.
3 # ltcf-cxx.sh - Create a C++ compiler specific configuration
5 # Copyright (C) 1996-1999,2000 Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # Original C++ support by:Gary V. Vaughan <gvv@techie.com>
9 # Alexandre Oliva <oliva@lsd.ic.unicamp.br>
10 # Ossama Othman <ossama@debian.org>
11 # Thomas Thanner <tanner@gmx.de>
13 # This file is free software; you can redistribute it and/or modify it
14 # under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful, but
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 # General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
33 # Source file extension for C++ test sources.
34 ac_ext=cc
36 # Object file extension for compiled C++ test sources.
37 objext=o
39 # Code to be used in simple compile tests
40 lt_simple_compile_test_code="int some_variable = 0;"
42 # Code to be used in simple link tests
43 lt_simple_link_test_code='int main(int, char *[]) { return (0); }'
45 # C++ compiler
46 CXX=${CXX-c++}
48 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
49 CC=${CC-"$CXX"}
50 CFLAGS=${CFLAGS-"$CXXFLAGS"}
52 # Allow CC to be a program name with arguments.
53 set dummy $CC
54 compiler=$2
55 cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
57 # Check if we are using GNU gcc (taken/adapted from configure script)
58 # We need to check here since "--with-gcc" is set at configure time,
59 # not ltconfig time!
60 cat > conftest.$ac_ext <<EOF
61 #ifdef __GNUC__
62 yes;
63 #endif
64 EOF
65 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
66 with_gcc=yes
68 # Set up default GNU C++ configuration
70 # Check if GNU C++ uses GNU ld as the underlying linker, since the
71 # archiving commands below assume that GNU ld is being used.
72 if eval "`$CC -print-prog-name=ld` --version 2>&1" | \
73 egrep 'GNU ld' > /dev/null; then
74 with_gnu_ld=yes
76 archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
77 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'
79 hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
80 export_dynamic_flag_spec='${wl}--export-dynamic'
82 # If archive_cmds runs LD, not CC, wlarc should be empty
83 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
84 # investigate it a little bit more. (MM)
85 wlarc='${wl}'
87 # ancient GNU ld didn't support --whole-archive et. al.
88 if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
89 egrep 'no-whole-archive' > /dev/null; then
90 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
91 else
92 whole_archive_flag_spec=
94 else
95 with_gnu_ld=no
96 wlarc=
98 # A generic and very simple default shared library creation
99 # command for GNU C++ for the case where it uses the native
100 # linker, instead of GNU ld. If possible, this setting should
101 # overridden to take advantage of the native linker features on
102 # the platform it is being used on.
103 archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
106 # Commands to make compiler produce verbose output that lists
107 # what "hidden" libraries, object files and flags are used when
108 # linking a shared library.
109 output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
111 else
112 with_gcc=no
113 with_gnu_ld=no
114 wlarc=
117 # In general, the C++ compiler should always link C++ objects.
118 case $target in
119 *aix3* | *aix4*)
120 # AIX just has to be different, doesn't it? :-\
121 LD=makeC++SharedLib_r
122 LDFLAGS="$LDFLAGS -p 0"
125 LD="$CC"
126 LDFLAGS="$LDFLAGS"
128 esac
131 # PORTME: fill in a description of your system's C++ link characteristics
132 case "$host_os" in
133 aix3*)
134 # FIXME: insert proper C++ library support
135 ld_shlibs=no
137 aix4*)
138 # FIXME: insert proper C++ library support
139 ld_shlibs=no
141 chorus*)
142 case "$cc_basename" in
144 # FIXME: insert proper C++ library support
145 ld_shlibs=no
147 esac
149 dgux*)
150 case "$cc_basename" in
151 ec++)
152 # FIXME: insert proper C++ library support
153 ld_shlibs=no
155 ghcx)
156 # Green Hills C++ Compiler
157 # FIXME: insert proper C++ library support
158 ld_shlibs=no
161 # FIXME: insert proper C++ library support
162 ld_shlibs=no
164 esac
166 freebsd*)
167 # FreeBSD uses GNU C++ and GNU ld
168 # FIXME: insert proper C++ library support
169 ld_shlibs=no
171 hpux*)
172 case "$cc_basename" in
174 # FIXME: insert proper C++ library support
175 ld_shlibs=no
177 aCC)
178 case "$host_os" in
179 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' ;;
180 *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
181 esac
182 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
183 hardcode_libdir_separator=:
184 hardcode_direct=yes
185 hardcode_minus_L=yes # Not in the search PATH, but as the default
186 # location of the library.
187 export_dynamic_flag_spec='${wl}-E'
189 # Commands to make compiler produce verbose output that lists
190 # what "hidden" libraries, object files and flags are used when
191 # linking a shared library.
193 # There doesn't appear to be a way to prevent this compiler from
194 # explicitly linking system object files so we need to strip them
195 # from the output so that they don't get included in the library
196 # dependencies.
197 output_verbose_link_cmds='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'
200 # FIXME: insert proper C++ library support
201 ld_shlibs=no
203 esac
205 irix5* | irix6*)
206 case "$cc_basename" in
208 # SGI C++
209 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'
211 # Archives containing C++ object files must be created using
212 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
213 # necessary to make sure instantiated templates are included
214 # in the archive.
215 old_archive_cmds='$CC -ar -WR,-u -o $oldlib $oldobjs'
218 if test "$with_gcc" = yes; then
219 if test "$with_gnu_ld" = no; then
220 archive_cmds='$CC -shared $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'
221 else
222 archive_cmds='$LD -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
225 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
226 hardcode_libdir_separator=:
227 link_all_deplibs=yes
229 esac
231 linux*)
232 case "$cc_basename" in
233 KCC)
234 # Kuck and Associates, Inc. (KAI) C++ Compiler
236 # KCC will only create a shared library if the output file
237 # ends with ".so" (or ".sl" for HP-UX), so rename the library
238 # to its proper name (with version) after linking.
239 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'
240 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'
242 # Commands to make compiler produce verbose output that lists
243 # what "hidden" libraries, object files and flags are used when
244 # linking a shared library.
246 # There doesn't appear to be a way to prevent this compiler from
247 # explicitly linking system object files so we need to strip them
248 # from the output so that they don't get included in the library
249 # dependencies.
250 output_verbose_link_cmds='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'
252 hardcode_libdir_flag_spec='${wl}--rpath,$libdir'
253 export_dynamic_flag_spec='${wl}--export-dynamic'
255 # Archives containing C++ object files must be created using
256 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
257 old_archive_cmds='$CC -Bstatic -o $oldlib $oldobjs'
259 cxx)
260 # Compaq C++
261 archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
262 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'
264 runpath_var=LD_RUN_PATH
265 hardcode_libdir_flag_spec='-rpath $libdir'
266 hardcode_libdir_separator=:
268 # Commands to make compiler produce verbose output that lists
269 # what "hidden" libraries, object files and flags are used when
270 # linking a shared library.
272 # There doesn't appear to be a way to prevent this compiler from
273 # explicitly linking system object files so we need to strip them
274 # from the output so that they don't get included in the library
275 # dependencies.
276 output_verbose_link_cmds='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'
278 esac
280 lynxos*)
281 # FIXME: insert proper C++ library support
282 ld_shlibs=no
284 m88k*)
285 # FIXME: insert proper C++ library support
286 ld_shlibs=no
288 mvs*)
289 case "$cc_basename" in
290 cxx)
291 # FIXME: insert proper C++ library support
292 ld_shlibs=no
295 # FIXME: insert proper C++ library support
296 ld_shlibs=no
298 esac
300 netbsd*)
301 # NetBSD uses g++ - do we need to do anything?
303 osf3*)
304 if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
305 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
306 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'
308 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
309 hardcode_libdir_separator=:
311 # Commands to make compiler produce verbose output that lists
312 # what "hidden" libraries, object files and flags are used when
313 # linking a shared library.
314 output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
317 case "$cc_basename" in
318 KCC)
319 # Kuck and Associates, Inc. (KAI) C++ Compiler
321 # KCC will only create a shared library if the output file
322 # ends with ".so" (or ".sl" for HP-UX), so rename the library
323 # to its proper name (with version) after linking.
324 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'
326 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
327 hardcode_libdir_separator=:
329 # Archives containing C++ object files must be created using
330 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
331 old_archive_cmds='$CC -Bstatic -o $oldlib $oldobjs'
334 RCC)
335 # Rational C++ 2.4.1
336 # FIXME: insert proper C++ library support
337 ld_shlibs=no
339 cxx)
340 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
341 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'
343 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
344 hardcode_libdir_separator=:
346 # Commands to make compiler produce verbose output that lists
347 # what "hidden" libraries, object files and flags are used when
348 # linking a shared library.
350 # There doesn't appear to be a way to prevent this compiler from
351 # explicitly linking system object files so we need to strip them
352 # from the output so that they don't get included in the library
353 # dependencies.
354 output_verbose_link_cmds='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'
357 # FIXME: insert proper C++ library support
358 ld_shlibs=no
360 esac
362 osf4* | osf5*)
363 if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
364 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
365 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'
367 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
368 hardcode_libdir_separator=:
370 # Commands to make compiler produce verbose output that lists
371 # what "hidden" libraries, object files and flags are used when
372 # linking a shared library.
373 output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
376 case "$cc_basename" in
377 KCC)
378 # Kuck and Associates, Inc. (KAI) C++ Compiler
380 # KCC will only create a shared library if the output file
381 # ends with ".so" (or ".sl" for HP-UX), so rename the library
382 # to its proper name (with version) after linking.
383 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'
385 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
386 hardcode_libdir_separator=:
388 # Archives containing C++ object files must be created using
389 # the KAI C++ compiler.
390 old_archive_cmds='$CC -o $oldlib $oldobjs'
392 RCC)
393 # Rational C++ 2.4.1
394 # FIXME: insert proper C++ library support
395 ld_shlibs=no
397 cxx)
398 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
399 archive_cmds='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
401 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
402 hardcode_libdir_separator=:
404 # Commands to make compiler produce verbose output that lists
405 # what "hidden" libraries, object files and flags are used when
406 # linking a shared library.
408 # There doesn't appear to be a way to prevent this compiler from
409 # explicitly linking system object files so we need to strip them
410 # from the output so that they don't get included in the library
411 # dependencies.
412 output_verbose_link_cmds='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'
415 # FIXME: insert proper C++ library support
416 ld_shlibs=no
418 esac
420 psos*)
421 # FIXME: insert proper C++ library support
422 ld_shlibs=no
424 sco*)
425 case "$cc_basename" in
427 # FIXME: insert proper C++ library support
428 ld_shlibs=no
431 # FIXME: insert proper C++ library support
432 ld_shlibs=no
434 esac
436 sunos4*)
437 case "$cc_basename" in
439 # Sun C++ 4.x
440 # FIXME: insert proper C++ library support
441 ld_shlibs=no
443 lcc)
444 # Lucid
445 # FIXME: insert proper C++ library support
446 ld_shlibs=no
449 # FIXME: insert proper C++ library support
450 ld_shlibs=no
452 esac
454 solaris*)
455 case "$cc_basename" in
457 # Sun C++ 4.2, 5.x and Centerline C++
458 no_undefined_flag=' -ztext'
459 archive_cmds='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
460 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
461 $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'
463 hardcode_libdir_flag_spec='-R$libdir'
464 hardcode_shlibpath_var=no
465 case "$host_os" in
466 solaris2.[0-5] | solaris2.[0-5].*) ;;
468 # The C++ compiler is used as linker so we must use $wl
469 # flag to pass the commands to the underlying system
470 # linker.
471 # Supported since Solaris 2.6 (maybe 2.5.1?)
472 whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
474 esac
475 link_all_deplibs=yes
477 # Commands to make compiler produce verbose output that lists
478 # what "hidden" libraries, object files and flags are used when
479 # linking a shared library.
481 # There doesn't appear to be a way to prevent this compiler from
482 # explicitly linking system object files so we need to strip them
483 # from the output so that they don't get included in the library
484 # dependencies.
485 output_verbose_link_cmds='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'
487 # Archives containing C++ object files must be created using
488 # "CC -xar", where "CC" is the Sun C++ compiler. This is
489 # necessary to make sure instantiated templates are included
490 # in the archive.
491 old_archive_cmds='$CC -xar -o $oldlib $oldobjs'
493 gcx)
494 # Green Hills C++ Compiler
495 archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
497 # The C++ compiler must be used to create the archive.
498 old_archive_cmds='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
501 # GNU C++ compiler with Solaris linker
502 if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
503 if $CC --version | egrep -v '^2\.7' > /dev/null; then
504 archive_cmds='$LD -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
505 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
506 $LD -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
508 # Commands to make compiler produce verbose output that lists
509 # what "hidden" libraries, object files and flags are used when
510 # linking a shared library.
511 output_verbose_link_cmds="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
512 else
513 # g++ 2.7 appears to require `-G' NOT `-shared' on this
514 # platform.
515 archive_cmds='$LD -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
516 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
517 $LD -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
519 # Commands to make compiler produce verbose output that lists
520 # what "hidden" libraries, object files and flags are used when
521 # linking a shared library.
522 output_verbose_link_cmds="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
525 hardcode_libdir_flag_spec='${wl}-R $wl$libdir'
528 esac
530 tandem*)
531 case "$cc_basename" in
532 NCC)
533 # NonStop-UX NCC 3.20
534 # FIXME: insert proper C++ library support
535 ld_shlibs=no
538 # FIXME: insert proper C++ library support
539 ld_shlibs=no
541 esac
543 unixware*)
544 # FIXME: insert proper C++ library support
545 ld_shlibs=no
547 vxworks*)
548 # FIXME: insert proper C++ library support
549 ld_shlibs=no
552 # FIXME: insert proper C++ library support
553 ld_shlibs=no
555 esac
558 ## Compiler Characteristics: PIC flags, static flags, etc
560 # We don't use cached values here since only the C compiler
561 # characteristics should be cached.
562 ac_cv_prog_cc_pic=
563 ac_cv_prog_cc_shlib=
564 ac_cv_prog_cc_wl=
565 ac_cv_prog_cc_static=
566 ac_cv_prog_cc_no_builtin=
567 ac_cv_prog_cc_can_build_shared=$can_build_shared
569 # It is not enough to reset these cached values, they must be unset.
570 unset ac_cv_prog_cc_pic_works
571 unset ac_cv_prog_cc_static_works
573 if test "$with_gcc" = yes; then
574 ac_cv_prog_cc_wl='-Wl,'
575 ac_cv_prog_cc_static='-static'
577 case "$host_os" in
578 beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
579 # PIC is the default for these OSes.
581 aix*)
582 # Below there is a dirty hack to force normal static linking with -ldl
583 # The problem is because libdl dynamically linked with both libc and
584 # libC (AIX C++ library), which obviously doesn't included in libraries
585 # list by gcc. This cause undefined symbols with -static flags.
586 # This hack allows C programs to be linked with "-static -ldl", but
587 # we not sure about C++ programs.
588 ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
590 cygwin* | mingw* | os2*)
591 # This hack is so that the source file can tell whether it is being
592 # built for inclusion in a dll (and should export symbols for example).
593 ac_cv_prog_cc_pic='-DDLL_EXPORT'
595 amigaos*)
596 # FIXME: we need at least 68020 code to build shared libraries, but
597 # adding the `-m68020' flag to GCC prevents building anything better,
598 # like `-m68040'.
599 ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
601 sysv4*MP*)
602 if test -d /usr/nec; then
603 ac_cv_prog_cc_pic=-Kconform_pic
607 ac_cv_prog_cc_pic='-fPIC'
609 esac
610 else
611 case "$host_os" in
612 aix4*)
613 # All AIX code is PIC.
615 chorus*)
616 case "$cc_basename" in
617 cxch68)
618 # Green Hills C++ Compiler
619 # 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"
621 esac
623 dgux*)
624 case "$cc_basename" in
625 ec++)
626 ac_cv_prog_cc_pic='-KPIC'
628 ghcx)
629 # Green Hills C++ Compiler
630 ac_cv_prog_cc_pic='-pic'
634 esac
636 freebsd*)
637 # FreeBSD uses GNU C++
639 hpux9* | hpux10* | hpux11*)
640 case "$cc_basename" in
642 ac_cv_prog_cc_wl='-Wl,'
643 ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
644 ac_cv_prog_cc_pic='+Z'
646 aCC)
647 ac_cv_prog_cc_wl='-Wl,'
648 ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
649 ac_cv_prog_cc_pic='+Z'
653 esac
655 irix5* | irix6*)
656 case "$cc_basename" in
658 ac_cv_prog_cc_wl='-Wl,'
659 ac_cv_prog_cc_static='-non_shared'
660 ac_cv_prog_cc_pic='-KPIC'
664 esac
666 linux*)
667 case "$cc_basename" in
668 KCC)
669 # KAI C++ Compiler
670 ac_cv_prog_cc_wl='--backend -Wl,'
671 ac_cv_prog_cc_pic='-fPIC'
673 cxx)
674 # Compaq C++
675 # Make sure the PIC flag is empty. It appears that all Alpha
676 # Linux and Compaq Tru64 Unix objects are PIC.
677 ac_cv_prog_cc_pic=
678 ac_cv_prog_cc_static='-non_shared'
682 esac
684 lynxos*)
686 m88k*)
688 mvs*)
689 case "$cc_basename" in
690 cxx)
691 ac_cv_prog_cc_pic='-W c,exportall'
695 esac
697 netbsd*)
699 osf3* | osf4* | osf5*)
700 case "$cc_basename" in
701 KCC)
702 ac_cv_prog_cc_wl='--backend -Wl,'
704 RCC)
705 # Rational C++ 2.4.1
706 ac_cv_prog_cc_pic='-pic'
708 cxx)
709 # Digital/Compaq C++
710 ac_cv_prog_cc_wl='-Wl,'
711 # Make sure the PIC flag is empty. It appears that all Alpha
712 # Linux and Compaq Tru64 Unix objects are PIC.
713 ac_cv_prog_cc_pic=
714 ac_cv_prog_cc_static='-non_shared'
718 esac
720 psos*)
722 sco*)
723 case "$cc_basename" in
725 ac_cv_prog_cc_pic='-fPIC'
729 esac
731 solaris*)
732 case "$cc_basename" in
734 # Sun C++ 4.2, 5.x and Centerline C++
735 ac_cv_prog_cc_pic='-KPIC'
736 ac_cv_prog_cc_static='-Bstatic'
737 ac_cv_prog_cc_wl='-Qoption ld '
739 gcx)
740 # Green Hills C++ Compiler
741 ac_cv_prog_cc_pic='-PIC'
745 esac
747 sunos4*)
748 case "$cc_basename" in
750 # Sun C++ 4.x
751 ac_cv_prog_cc_pic='-pic'
752 ac_cv_prog_cc_static='-Bstatic'
754 lcc)
755 # Lucid
756 ac_cv_prog_cc_pic='-pic'
760 esac
762 tandem*)
763 case "$cc_basename" in
764 NCC)
765 # NonStop-UX NCC 3.20
766 ac_cv_prog_cc_pic='-KPIC'
770 esac
772 unixware*)
774 vxworks*)
777 ac_cv_prog_cc_can_build_shared=no
779 esac
781 ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
784 # Figure out "hidden" C++ library dependencies from verbose
785 # compiler output whening linking a shared library.
786 cat > conftest.$ac_ext <<EOF
787 class Foo
789 public:
790 Foo (void) { a = 0; }
791 private:
792 int a;
797 if eval $ac_compile 2>&5; then
798 # Parse the compiler output and extract the necessary
799 # objects, libraries and library flags.
801 # Sentinel used to keep track of whether or not we are before
802 # the conftest object file.
803 pre_test_object_deps_done=no
805 for p in `eval $output_verbose_link_cmds`; do
807 case $p in
809 -L* | -R* | -l*)
810 # Some compilers place space between "-{L,R}" and the path.
811 # Remove the space.
812 if test $p = "-L" \
813 || test $p = "-R"; then
814 prev=$p
815 continue
816 else
817 prev=
820 if test "$pre_test_object_deps_done" = no; then
821 case $p in
822 -L* | -R*)
823 # Internal compiler library paths should come after those
824 # provided the user. The postdeps already come after the
825 # user supplied libs so there is no need to process them.
826 if test -z "$compiler_lib_search_path"; then
827 compiler_lib_search_path="${prev}${p}"
828 else
829 compiler_lib_search_path="${compiler_lib_search_path} ${prev}${p}"
832 # The "-l" case would never come before the object being
833 # linked, so don't bother handling this case.
834 esac
835 else
836 if test -z "$postdeps"; then
837 postdeps="${prev}${p}"
838 else
839 postdeps="${postdeps} ${prev}${p}"
844 *.$objext)
845 # This assumes that the test object file only shows up
846 # once in the compiler output.
847 if test "$p" = "conftest.$objext"; then
848 pre_test_object_deps_done=yes
849 continue
852 if test "$pre_test_object_deps_done" = no; then
853 if test -z "$predep_objects"; then
854 predep_objects="$p"
855 else
856 predep_objects="$predep_objects $p"
858 else
859 if test -z "$postdep_objects"; then
860 postdep_objects="$p"
861 else
862 postdep_objects="$postdep_objects $p"
867 *) ;; # Ignore the rest.
869 esac
870 done
872 # Clean up.
873 rm -f a.out
874 else
875 echo "ltcf-cxx.sh: error: problem compiling test program"
878 $rm -f confest.$objext
880 case " $postdeps " in
881 *" -lc "*) need_lc=no ;;
882 *) need_lc=yes ;;
883 esac