* c-pragma.h: Define HANDLE_GENERIC_PRAGMAS if
[official-gcc.git] / ltcf-cxx.sh
blob45f8f432068b73a69e33854bb57183b542ab13bf
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 # FIXME: insert proper C++ library support
302 ld_shlibs=no
304 osf3*)
305 if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
306 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
307 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'
309 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
310 hardcode_libdir_separator=:
312 # Commands to make compiler produce verbose output that lists
313 # what "hidden" libraries, object files and flags are used when
314 # linking a shared library.
315 output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
318 case "$cc_basename" in
319 KCC)
320 # Kuck and Associates, Inc. (KAI) C++ Compiler
322 # KCC will only create a shared library if the output file
323 # ends with ".so" (or ".sl" for HP-UX), so rename the library
324 # to its proper name (with version) after linking.
325 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'
327 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
328 hardcode_libdir_separator=:
330 # Archives containing C++ object files must be created using
331 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
332 old_archive_cmds='$CC -Bstatic -o $oldlib $oldobjs'
335 RCC)
336 # Rational C++ 2.4.1
337 # FIXME: insert proper C++ library support
338 ld_shlibs=no
340 cxx)
341 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
342 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'
344 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
345 hardcode_libdir_separator=:
347 # Commands to make compiler produce verbose output that lists
348 # what "hidden" libraries, object files and flags are used when
349 # linking a shared library.
351 # There doesn't appear to be a way to prevent this compiler from
352 # explicitly linking system object files so we need to strip them
353 # from the output so that they don't get included in the library
354 # dependencies.
355 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'
358 # FIXME: insert proper C++ library support
359 ld_shlibs=no
361 esac
363 osf4* | osf5*)
364 if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
365 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
366 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'
368 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
369 hardcode_libdir_separator=:
371 # Commands to make compiler produce verbose output that lists
372 # what "hidden" libraries, object files and flags are used when
373 # linking a shared library.
374 output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
377 case "$cc_basename" in
378 KCC)
379 # Kuck and Associates, Inc. (KAI) C++ Compiler
381 # KCC will only create a shared library if the output file
382 # ends with ".so" (or ".sl" for HP-UX), so rename the library
383 # to its proper name (with version) after linking.
384 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'
386 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
387 hardcode_libdir_separator=:
389 # Archives containing C++ object files must be created using
390 # the KAI C++ compiler.
391 old_archive_cmds='$CC -o $oldlib $oldobjs'
393 RCC)
394 # Rational C++ 2.4.1
395 # FIXME: insert proper C++ library support
396 ld_shlibs=no
398 cxx)
399 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
400 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'
402 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
403 hardcode_libdir_separator=:
405 # Commands to make compiler produce verbose output that lists
406 # what "hidden" libraries, object files and flags are used when
407 # linking a shared library.
409 # There doesn't appear to be a way to prevent this compiler from
410 # explicitly linking system object files so we need to strip them
411 # from the output so that they don't get included in the library
412 # dependencies.
413 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'
416 # FIXME: insert proper C++ library support
417 ld_shlibs=no
419 esac
421 psos*)
422 # FIXME: insert proper C++ library support
423 ld_shlibs=no
425 sco*)
426 case "$cc_basename" in
428 # FIXME: insert proper C++ library support
429 ld_shlibs=no
432 # FIXME: insert proper C++ library support
433 ld_shlibs=no
435 esac
437 sunos4*)
438 case "$cc_basename" in
440 # Sun C++ 4.x
441 # FIXME: insert proper C++ library support
442 ld_shlibs=no
444 lcc)
445 # Lucid
446 # FIXME: insert proper C++ library support
447 ld_shlibs=no
450 # FIXME: insert proper C++ library support
451 ld_shlibs=no
453 esac
455 solaris*)
456 case "$cc_basename" in
458 # Sun C++ 4.2, 5.x and Centerline C++
459 no_undefined_flag=' -ztext'
460 archive_cmds='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
461 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
462 $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'
464 hardcode_libdir_flag_spec='-R$libdir'
465 hardcode_shlibpath_var=no
466 case "$host_os" in
467 solaris2.[0-5] | solaris2.[0-5].*) ;;
469 # The C++ compiler is used as linker so we must use $wl
470 # flag to pass the commands to the underlying system
471 # linker.
472 # Supported since Solaris 2.6 (maybe 2.5.1?)
473 whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
475 esac
476 link_all_deplibs=yes
478 # Commands to make compiler produce verbose output that lists
479 # what "hidden" libraries, object files and flags are used when
480 # linking a shared library.
482 # There doesn't appear to be a way to prevent this compiler from
483 # explicitly linking system object files so we need to strip them
484 # from the output so that they don't get included in the library
485 # dependencies.
486 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'
488 # Archives containing C++ object files must be created using
489 # "CC -xar", where "CC" is the Sun C++ compiler. This is
490 # necessary to make sure instantiated templates are included
491 # in the archive.
492 old_archive_cmds='$CC -xar -o $oldlib $oldobjs'
494 gcx)
495 # Green Hills C++ Compiler
496 archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
498 # The C++ compiler must be used to create the archive.
499 old_archive_cmds='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
502 # GNU C++ compiler with Solaris linker
503 if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
504 if $CC --version | egrep -v '^2\.7' > /dev/null; then
505 archive_cmds='$LD -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
506 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
507 $LD -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
509 # Commands to make compiler produce verbose output that lists
510 # what "hidden" libraries, object files and flags are used when
511 # linking a shared library.
512 output_verbose_link_cmds="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
513 else
514 # g++ 2.7 appears to require `-G' NOT `-shared' on this
515 # platform.
516 archive_cmds='$LD -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
517 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
518 $LD -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
520 # Commands to make compiler produce verbose output that lists
521 # what "hidden" libraries, object files and flags are used when
522 # linking a shared library.
523 output_verbose_link_cmds="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
526 hardcode_libdir_flag_spec='${wl}-R $wl$libdir'
529 esac
531 tandem*)
532 case "$cc_basename" in
533 NCC)
534 # NonStop-UX NCC 3.20
535 # FIXME: insert proper C++ library support
536 ld_shlibs=no
539 # FIXME: insert proper C++ library support
540 ld_shlibs=no
542 esac
544 unixware*)
545 # FIXME: insert proper C++ library support
546 ld_shlibs=no
548 vxworks*)
549 # FIXME: insert proper C++ library support
550 ld_shlibs=no
553 # FIXME: insert proper C++ library support
554 ld_shlibs=no
556 esac
559 ## Compiler Characteristics: PIC flags, static flags, etc
561 # We don't use cached values here since only the C compiler
562 # characteristics should be cached.
563 ac_cv_prog_cc_pic=
564 ac_cv_prog_cc_shlib=
565 ac_cv_prog_cc_wl=
566 ac_cv_prog_cc_static=
567 ac_cv_prog_cc_no_builtin=
568 ac_cv_prog_cc_can_build_shared=$can_build_shared
570 # It is not enough to reset these cached values, they must be unset.
571 unset ac_cv_prog_cc_pic_works
572 unset ac_cv_prog_cc_static_works
574 if test "$with_gcc" = yes; then
575 ac_cv_prog_cc_wl='-Wl,'
576 ac_cv_prog_cc_static='-static'
578 case "$host_os" in
579 beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
580 # PIC is the default for these OSes.
582 aix*)
583 # Below there is a dirty hack to force normal static linking with -ldl
584 # The problem is because libdl dynamically linked with both libc and
585 # libC (AIX C++ library), which obviously doesn't included in libraries
586 # list by gcc. This cause undefined symbols with -static flags.
587 # This hack allows C programs to be linked with "-static -ldl", but
588 # we not sure about C++ programs.
589 ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
591 cygwin* | mingw* | os2*)
592 # This hack is so that the source file can tell whether it is being
593 # built for inclusion in a dll (and should export symbols for example).
594 ac_cv_prog_cc_pic='-DDLL_EXPORT'
596 amigaos*)
597 # FIXME: we need at least 68020 code to build shared libraries, but
598 # adding the `-m68020' flag to GCC prevents building anything better,
599 # like `-m68040'.
600 ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
602 sysv4*MP*)
603 if test -d /usr/nec; then
604 ac_cv_prog_cc_pic=-Kconform_pic
608 ac_cv_prog_cc_pic='-fPIC'
610 esac
611 else
612 case "$host_os" in
613 aix4*)
614 # All AIX code is PIC.
616 chorus*)
617 case "$cc_basename" in
618 cxch68)
619 # Green Hills C++ Compiler
620 # 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"
622 esac
624 dgux*)
625 case "$cc_basename" in
626 ec++)
627 ac_cv_prog_cc_pic='-KPIC'
629 ghcx)
630 # Green Hills C++ Compiler
631 ac_cv_prog_cc_pic='-pic'
635 esac
637 freebsd*)
638 # FreeBSD uses GNU C++
640 hpux9* | hpux10* | hpux11*)
641 case "$cc_basename" in
643 ac_cv_prog_cc_wl='-Wl,'
644 ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
645 ac_cv_prog_cc_pic='+Z'
647 aCC)
648 ac_cv_prog_cc_wl='-Wl,'
649 ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
650 ac_cv_prog_cc_pic='+Z'
654 esac
656 irix5* | irix6*)
657 case "$cc_basename" in
659 ac_cv_prog_cc_wl='-Wl,'
660 ac_cv_prog_cc_static='-non_shared'
661 ac_cv_prog_cc_pic='-KPIC'
665 esac
667 linux*)
668 case "$cc_basename" in
669 KCC)
670 # KAI C++ Compiler
671 ac_cv_prog_cc_wl='--backend -Wl,'
672 ac_cv_prog_cc_pic='-fPIC'
674 cxx)
675 # Compaq C++
676 # Make sure the PIC flag is empty. It appears that all Alpha
677 # Linux and Compaq Tru64 Unix objects are PIC.
678 ac_cv_prog_cc_pic=
679 ac_cv_prog_cc_static='-non_shared'
683 esac
685 lynxos*)
687 m88k*)
689 mvs*)
690 case "$cc_basename" in
691 cxx)
692 ac_cv_prog_cc_pic='-W c,exportall'
696 esac
698 netbsd*)
700 osf3* | osf4* | osf5*)
701 case "$cc_basename" in
702 KCC)
703 ac_cv_prog_cc_wl='--backend -Wl,'
705 RCC)
706 # Rational C++ 2.4.1
707 ac_cv_prog_cc_pic='-pic'
709 cxx)
710 # Digital/Compaq C++
711 ac_cv_prog_cc_wl='-Wl,'
712 # Make sure the PIC flag is empty. It appears that all Alpha
713 # Linux and Compaq Tru64 Unix objects are PIC.
714 ac_cv_prog_cc_pic=
715 ac_cv_prog_cc_static='-non_shared'
719 esac
721 psos*)
723 sco*)
724 case "$cc_basename" in
726 ac_cv_prog_cc_pic='-fPIC'
730 esac
732 solaris*)
733 case "$cc_basename" in
735 # Sun C++ 4.2, 5.x and Centerline C++
736 ac_cv_prog_cc_pic='-KPIC'
737 ac_cv_prog_cc_static='-Bstatic'
738 ac_cv_prog_cc_wl='-Qoption ld '
740 gcx)
741 # Green Hills C++ Compiler
742 ac_cv_prog_cc_pic='-PIC'
746 esac
748 sunos4*)
749 case "$cc_basename" in
751 # Sun C++ 4.x
752 ac_cv_prog_cc_pic='-pic'
753 ac_cv_prog_cc_static='-Bstatic'
755 lcc)
756 # Lucid
757 ac_cv_prog_cc_pic='-pic'
761 esac
763 tandem*)
764 case "$cc_basename" in
765 NCC)
766 # NonStop-UX NCC 3.20
767 ac_cv_prog_cc_pic='-KPIC'
771 esac
773 unixware*)
775 vxworks*)
778 ac_cv_prog_cc_can_build_shared=no
780 esac
782 ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
785 # Figure out "hidden" C++ library dependencies from verbose
786 # compiler output whening linking a shared library.
787 cat > conftest.$ac_ext <<EOF
788 class Foo
790 public:
791 Foo (void) { a = 0; }
792 private:
793 int a;
798 if eval $ac_compile 2>&5; then
799 # Parse the compiler output and extract the necessary
800 # objects, libraries and library flags.
802 # Sentinel used to keep track of whether or not we are before
803 # the conftest object file.
804 pre_test_object_deps_done=no
806 for p in `eval $output_verbose_link_cmds`; do
808 case $p in
810 -L* | -R* | -l*)
811 # Some compilers place space between "-{L,R}" and the path.
812 # Remove the space.
813 if test $p = "-L" \
814 || test $p = "-R"; then
815 prev=$p
816 continue
817 else
818 prev=
821 if test "$pre_test_object_deps_done" = no; then
822 case $p in
823 -L* | -R*)
824 # Internal compiler library paths should come after those
825 # provided the user. The postdeps already come after the
826 # user supplied libs so there is no need to process them.
827 if test -z "$compiler_lib_search_path"; then
828 compiler_lib_search_path="${prev}${p}"
829 else
830 compiler_lib_search_path="${compiler_lib_search_path} ${prev}${p}"
833 # The "-l" case would never come before the object being
834 # linked, so don't bother handling this case.
835 esac
836 else
837 if test -z "$postdeps"; then
838 postdeps="${prev}${p}"
839 else
840 postdeps="${postdeps} ${prev}${p}"
845 *.$objext)
846 # This assumes that the test object file only shows up
847 # once in the compiler output.
848 if test "$p" = "conftest.$objext"; then
849 pre_test_object_deps_done=yes
850 continue
853 if test "$pre_test_object_deps_done" = no; then
854 if test -z "$predep_objects"; then
855 predep_objects="$p"
856 else
857 predep_objects="$predep_objects $p"
859 else
860 if test -z "$postdep_objects"; then
861 postdep_objects="$p"
862 else
863 postdep_objects="$postdep_objects $p"
868 *) ;; # Ignore the rest.
870 esac
871 done
873 # Clean up.
874 rm -f a.out
875 else
876 echo "ltcf-cxx.sh: error: problem compiling test program"
879 $rm -f confest.$objext
881 case " $postdeps " in
882 *" -lc "*) need_lc=no ;;
883 *) need_lc=yes ;;
884 esac