Ignore:
Timestamp:
Aug 16, 2003, 6:41:03 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/ltcf-cxx.sh

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r604 r605  
    33# ltcf-cxx.sh - Create a C++ compiler specific configuration
    44#
    5 # Copyright (C) 1996-1999,2000 Free Software Foundation, Inc.
     5# Copyright (C) 1996-1999, 2000, 2001, 2003 Free Software Foundation, Inc.
    66# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    77#
     
    6969
    7070  # 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
    75 
     71  # archiving commands below assume that GNU ld is being used.  The
     72  # assumption here is that the linker is going to be the same as that
     73  # used by the C compiler.  For the purposes of GCC, this is ok, but
     74  # if someone uses g++ along with a non-GNU C compiler that doesn't
     75  # use GNU ld, we may lose.  This is ok for the toolchain tree, since
     76  # the only users of ltcf-cxx.sh are libstdc++-v3 and libjava,
     77  # anyway, and those use both gcc and g++, so the settings are bound
     78  # to be the same.
     79
     80  if test "$with_gnu_ld" = yes; then
    7681    archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
    7782    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'
     
    9398    fi
    9499  else
    95     with_gnu_ld=no
    96100    wlarc=
    97101
     
    107111  # what "hidden" libraries, object files and flags are used when
    108112  # linking a shared library.
    109   output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
     113  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
    110114
    111115else
    112116  with_gcc=no
    113   with_gnu_ld=no
    114117  wlarc=
    115118fi
    116119
    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"
    123   ;;
    124 *)
    125   LD="$CC"
    126   LDFLAGS="$LDFLAGS"
    127   ;;
    128 esac
    129 
    130 
    131120# PORTME: fill in a description of your system's C++ link characteristics
    132 case "$host_os" in
     121case $host_os in
    133122  aix3*)
    134123    # FIXME: insert proper C++ library support
    135124    ld_shlibs=no
    136125    ;;
    137   aix4*)
    138     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'
    139     # -bexpall does not export symbols beginning with underscore (_)
     126  aix4* | aix5*)
     127    archive_cmds=''
     128    hardcode_direct=yes
     129    hardcode_libdir_separator=':'
     130    link_all_deplibs=yes
     131    # When large executables or shared objects are built, AIX ld can
     132    # have problems creating the table of contents.  If linking a library
     133    # or program results in "error TOC overflow" add -mminimal-toc to
     134    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
     135    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
     136    if test "$with_gcc" = yes; then
     137      case $host_os in aix4.[012]|aix4.[012].*)
     138      # We only want to do this on AIX 4.2 and lower, the check
     139      # below for broken collect2 doesn't work under 4.3+
     140        collect2name=`${CC} -print-prog-name=collect2`
     141        if test -f "$collect2name" && \
     142           strings "$collect2name" | grep resolve_lib_name >/dev/null
     143        then
     144          # We have reworked collect2
     145          hardcode_direct=yes
     146        else
     147          # We have old collect2
     148          hardcode_direct=unsupported
     149          # It fails to find uninstalled libraries when the uninstalled
     150          # path is not listed in the libpath.  Setting hardcode_minus_L
     151          # to unsupported forces relinking
     152          hardcode_minus_L=yes
     153          hardcode_libdir_flag_spec='-L$libdir'
     154          hardcode_libdir_separator=
     155        fi
     156      esac
     157      shared_flag='-shared'
     158    else
     159      # not using gcc
     160      if test "$host_cpu" = ia64; then
     161        shared_flag='${wl}-G'
     162      else
     163        shared_flag='${wl}-bM:SRE'
     164      fi
     165    fi
     166
     167    if test "$host_cpu" = ia64; then
     168      # On IA64, the linker does run time linking by default, so we don't
     169      # have to do anything special.
     170      aix_use_runtimelinking=no
     171      if test $with_gnu_ld = no; then
     172        exp_sym_flag='-Bexport'
     173        no_entry_flag=""
     174      fi
     175    else
     176      # Test if we are trying to use run time linking, or normal AIX style linking.
     177      # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
     178      aix_use_runtimelinking=no
     179      for ld_flag in $LDFLAGS; do
     180        if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
     181          aix_use_runtimelinking=yes
     182          break
     183        fi
     184      done
     185      exp_sym_flag='-bexport'
     186      no_entry_flag='-bnoentry'
     187    fi
     188    # It seems that -bexpall does not export symbols beginning with
     189    # underscore (_), so it is better to generate a list of symbols to export.
    140190    always_export_symbols=yes
    141     # Exported symbols can be pulled into shared objects from archives
    142     whole_archive_flag_spec=' '
    143     build_libtool_need_lc=yes
     191    if test "$aix_use_runtimelinking" = yes; then
     192      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
     193      allow_undefined_flag=' -Wl,-G'
     194      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"
     195     else
     196      if test "$host_cpu" = ia64; then
     197        if test $with_gnu_ld = no; then
     198          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
     199          allow_undefined_flag="-z nodefs"
     200          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"
     201        fi
     202      else
     203        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
     204        # Warning - without using the other run time loading flags, -berok will
     205        #           link without error, but may produce a broken library.
     206        no_undefined_flag=' ${wl}-bnoerok'
     207        allow_undefined_flag=' ${wl}-berok'
     208        # -bexpall does not export symbols beginning with underscore (_)
     209        always_export_symbols=yes
     210        # Exported symbols can be pulled into shared objects from archives
     211        whole_archive_flag_spec=' '
     212        build_libtool_need_lc=yes
     213        # This is similar to how AIX traditionally builds it's shared libraries.
     214        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'
     215      fi
     216    fi
    144217    ;;
    145218  chorus*)
    146     case "$cc_basename" in
     219    case $cc_basename in
    147220      *)
    148221        # FIXME: insert proper C++ library support
    149222        ld_shlibs=no
    150223        ;;
    151     esac 
     224    esac
    152225    ;;
    153226  dgux*)
    154     case "$cc_basename" in
     227    case $cc_basename in
    155228      ec++)
    156229        # FIXME: insert proper C++ library support
     
    168241    esac
    169242    ;;
     243  freebsd[12]*)
     244    # C++ shared libraries reported to be fairly broken before switch to ELF
     245    ld_shlibs=no
     246    ;;
    170247  freebsd*)
    171     # FreeBSD uses GNU C++ and GNU ld
    172     # FIXME: insert proper C++ library support
    173     ld_shlibs=no
     248    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
     249    # conventions
     250    ld_shlibs=yes
     251    ;;
     252  gnu*)
    174253    ;;
    175254  hpux*)
    176     case "$cc_basename" in
     255    if test $with_gnu_ld = no; then
     256      case "$host_cpu" in
     257        ia64*)
     258          hardcode_libdir_flag_spec='-L$libdir'
     259          hardcode_shlibpath_var=no ;;
     260        *)
     261          hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' ;;
     262      esac
     263      hardcode_direct=yes
     264      hardcode_libdir_separator=:
     265      export_dynamic_flag_spec='${wl}-E'
     266    fi
     267    hardcode_minus_L=yes # Not in the search PATH, but as the default
     268                         # location of the library.
     269
     270    case $cc_basename in
    177271      CC)
    178272        # FIXME: insert proper C++ library support
     
    180274        ;;
    181275      aCC)
    182         case "$host_os" in
     276        case $host_os in
    183277        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' ;;
    184278        *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
    185279        esac
    186         hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
    187         hardcode_libdir_separator=:
    188         hardcode_direct=yes
    189         hardcode_minus_L=yes # Not in the search PATH, but as the default
    190                              # location of the library.
    191         export_dynamic_flag_spec='${wl}-E'
    192 
    193280        # Commands to make compiler produce verbose output that lists
    194281        # what "hidden" libraries, object files and flags are used when
     
    199286        # from the output so that they don't get included in the library
    200287        # dependencies.
    201         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'
     288        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'
    202289        ;;
    203290      *)
    204         # FIXME: insert proper C++ library support
    205         ld_shlibs=no
     291        if test $with_gcc = yes; then
     292          if test $with_gnu_ld = no; then
     293            case "$host_os" in
     294            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' ;;
     295            *)
     296              case "$host_cpu" in
     297                ia64*)
     298                  archive_cmds='$LD -b +h $soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' ;;
     299                *)
     300                  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' ;;
     301              esac
     302              ;;
     303            esac
     304          fi
     305        else
     306          # FIXME: insert proper C++ library support
     307          ld_shlibs=no
     308        fi
    206309        ;;
    207310    esac
    208311    ;;
    209312  irix5* | irix6*)
    210     case "$cc_basename" in
     313    case $cc_basename in
    211314      CC)
    212315        # SGI C++
     
    222325        if test "$with_gcc" = yes; then
    223326          if test "$with_gnu_ld" = no; then
    224             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'
     327            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'
    225328          else
    226             archive_cmds='$LD -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
     329            archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
    227330          fi
    228331        fi
     
    234337    ;;
    235338  linux*)
    236     case "$cc_basename" in
     339    case $cc_basename in
    237340      KCC)
    238341        # Kuck and Associates, Inc. (KAI) C++ Compiler
     
    252355        # from the output so that they don't get included in the library
    253356        # dependencies.
    254         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'
     357        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'
    255358
    256359        hardcode_libdir_flag_spec='${wl}--rpath,$libdir'
     
    278381        # from the output so that they don't get included in the library
    279382        # dependencies.
    280         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'
     383        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'
    281384        ;;
    282385    esac
     
    291394    ;;
    292395  mvs*)
    293     case "$cc_basename" in
     396    case $cc_basename in
    294397      cxx)
    295398        # FIXME: insert proper C++ library support
     
    300403        ld_shlibs=no
    301404        ;;
    302     esac   
     405    esac
    303406    ;;
    304407  netbsd*)
     
    306409    ;;
    307410  osf3*)
    308     if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
    309       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
    310       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'
    311 
    312       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
    313       hardcode_libdir_separator=:
    314 
    315       # Commands to make compiler produce verbose output that lists
    316       # what "hidden" libraries, object files and flags are used when
    317       # linking a shared library.
    318       output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
    319     fi
    320 
    321     case "$cc_basename" in
     411    case $cc_basename in
    322412      KCC)
    323413        # Kuck and Associates, Inc. (KAI) C++ Compiler
     
    356446        # from the output so that they don't get included in the library
    357447        # dependencies.
    358         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'
     448        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'
    359449        ;;
    360450      *)
    361         # FIXME: insert proper C++ library support
    362         ld_shlibs=no
     451        if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
     452          allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
     453          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'
     454
     455          hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
     456          hardcode_libdir_separator=:
     457
     458          # Commands to make compiler produce verbose output that lists
     459          # what "hidden" libraries, object files and flags are used when
     460          # linking a shared library.
     461          output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
     462    else
     463          # FIXME: insert proper C++ library support
     464          ld_shlibs=no
     465    fi
    363466        ;;
    364467    esac
    365468    ;;
    366469  osf4* | osf5*)
    367     if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
    368       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
    369       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'
    370 
    371       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
    372       hardcode_libdir_separator=:
    373 
    374       # Commands to make compiler produce verbose output that lists
    375       # what "hidden" libraries, object files and flags are used when
    376       # linking a shared library.
    377       output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
    378     fi
    379 
    380     case "$cc_basename" in
     470    case $cc_basename in
    381471      KCC)
    382472        # Kuck and Associates, Inc. (KAI) C++ Compiler
     
    400490        ;;
    401491      cxx)
    402         allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
    403         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'
    404        
    405         hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
     492        allow_undefined_flag=' -expect_unresolved \*'
     493        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'
     494        archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done~
     495          echo "-hidden">> $lib.exp~
     496          $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~
     497          $rm $lib.exp'
     498
     499        hardcode_libdir_flag_spec='-rpath $libdir'
    406500        hardcode_libdir_separator=:
    407501
     
    414508        # from the output so that they don't get included in the library
    415509        # dependencies.
    416         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'
     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'
    417511        ;;
    418512      *)
    419         # FIXME: insert proper C++ library support
    420         ld_shlibs=no
     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         
     517          hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
     518          hardcode_libdir_separator=:
     519         
     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_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
     524    else
     525          # FIXME: insert proper C++ library support
     526          ld_shlibs=no
     527    fi
    421528        ;;
    422529    esac
     
    427534    ;;
    428535  sco*)
    429     case "$cc_basename" in
     536    case $cc_basename in
    430537      CC)
    431538        # FIXME: insert proper C++ library support
     
    439546    ;;
    440547  sunos4*)
    441     case "$cc_basename" in
     548    case $cc_basename in
    442549      CC)
    443550        # Sun C++ 4.x
     
    457564    ;;
    458565  solaris*)
    459     case "$cc_basename" in
     566    case $cc_basename in
    460567      CC)
    461568        # Sun C++ 4.2, 5.x and Centerline C++
    462         no_undefined_flag=' -ztext'
     569        no_undefined_flag=' -zdefs'
    463570        archive_cmds='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
    464571        archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
     
    467574        hardcode_libdir_flag_spec='-R$libdir'
    468575        hardcode_shlibpath_var=no
    469         case "$host_os" in
     576        case $host_os in
    470577          solaris2.[0-5] | solaris2.[0-5].*) ;;
    471578          *)
     
    487594        # from the output so that they don't get included in the library
    488595        # dependencies.
    489         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'
     596        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'
    490597
    491598        # Archives containing C++ object files must be created using
     
    505612        # GNU C++ compiler with Solaris linker
    506613        if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
     614          no_undefined_flag=' ${wl}-z ${wl}defs'
    507615          if $CC --version | egrep -v '^2\.7' > /dev/null; then
    508             archive_cmds='$LD -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
     616            archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
    509617            archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
    510                 $LD -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
     618                $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
    511619
    512620            # Commands to make compiler produce verbose output that lists
    513621            # what "hidden" libraries, object files and flags are used when
    514622            # linking a shared library.
    515             output_verbose_link_cmds="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
     623            output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
    516624          else
    517625            # g++ 2.7 appears to require `-G' NOT `-shared' on this
    518626            # platform.
    519             archive_cmds='$LD -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
     627            archive_cmds='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
    520628            archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
    521                 $LD -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
     629                $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
    522630
    523631            # Commands to make compiler produce verbose output that lists
    524632            # what "hidden" libraries, object files and flags are used when
    525633            # linking a shared library.
    526             output_verbose_link_cmds="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
     634            output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
    527635          fi
    528636
     
    530638        fi
    531639        ;;
    532     esac   
     640    esac
    533641    ;;
    534642  tandem*)
    535     case "$cc_basename" in
     643    case $cc_basename in
    536644      NCC)
    537645        # NonStop-UX NCC 3.20
     
    543651        ld_shlibs=no
    544652        ;;
    545     esac   
     653    esac
    546654    ;;
    547655  unixware*)
     
    571679ac_cv_prog_cc_can_build_shared=$can_build_shared
    572680
    573 # It is not enough to reset these cached values, they must be unset.
    574 unset ac_cv_prog_cc_pic_works
    575 unset ac_cv_prog_cc_static_works
     681ac_cv_prog_cc_pic_works=
     682ac_cv_prog_cc_static_works=
    576683
    577684if test "$with_gcc" = yes; then
     
    579686  ac_cv_prog_cc_static='-static'
    580687
    581   case "$host_os" in
    582   beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
    583     # PIC is the default for these OSes.
    584     ;;
     688  case $host_os in
    585689  aix*)
    586     # Below there is a dirty hack to force normal static linking with -ldl
    587     # The problem is because libdl dynamically linked with both libc and
    588     # libC (AIX C++ library), which obviously doesn't included in libraries
    589     # list by gcc. This cause undefined symbols with -static flags.
    590     # This hack allows C programs to be linked with "-static -ldl", but
    591     # we not sure about C++ programs.
    592     ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
    593     ;;
    594   cygwin* | mingw* | os2*)
    595     # This hack is so that the source file can tell whether it is being
    596     # built for inclusion in a dll (and should export symbols for example).
    597     ac_cv_prog_cc_pic='-DDLL_EXPORT'
     690    # All AIX code is PIC.
     691    if test "$host_cpu" = ia64; then
     692      # AIX 5 now supports IA64 processor
     693      lt_cv_prog_cc_static='-Bstatic'
     694    else
     695      lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
     696    fi
    598697    ;;
    599698  amigaos*)
     
    603702    ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
    604703    ;;
     704  beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
     705    # PIC is the default for these OSes.
     706    ;;
     707  cygwin* | mingw* | os2*)
     708    # This hack is so that the source file can tell whether it is being
     709    # built for inclusion in a dll (and should export symbols for example).
     710    ac_cv_prog_cc_pic='-DDLL_EXPORT'
     711    ;;
     712  darwin* | rhapsody*)
     713    # PIC is the default on this platform
     714    # Common symbols not allowed in MH_DYLIB files
     715    lt_cv_prog_cc_pic='-fno-common'
     716    ;;
     717  *djgpp*)
     718    # DJGPP does not support shared libraries at all
     719    ac_cv_prog_cc_pic=
     720    ;;
    605721  sysv4*MP*)
    606722    if test -d /usr/nec; then
     
    613729  esac
    614730else
    615   case "$host_os" in
    616     aix4*)
     731  case $host_os in
     732    aix4* | aix5*)
    617733      # All AIX code is PIC.
     734      if test "$host_cpu" = ia64; then
     735        # AIX 5 now supports IA64 processor
     736        lt_cv_prog_cc_static='-Bstatic'
     737      else
     738        lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
     739      fi
    618740      ;;
    619741    chorus*)
    620       case "$cc_basename" in
     742      case $cc_basename in
    621743      cxch68)
    622744        # Green Hills C++ Compiler
    623745        # 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"
    624746        ;;
    625       esac 
     747      esac
    626748      ;;
    627749    dgux*)
    628       case "$cc_basename" in
     750      case $cc_basename in
    629751        ec++)
    630752          ac_cv_prog_cc_pic='-KPIC'
     
    641763      # FreeBSD uses GNU C++
    642764      ;;
     765    gnu*)
     766      ;;
    643767    hpux9* | hpux10* | hpux11*)
    644       case "$cc_basename" in
     768      case $cc_basename in
    645769        CC)
    646770          ac_cv_prog_cc_wl='-Wl,'
     
    658782      ;;
    659783    irix5* | irix6*)
    660       case "$cc_basename" in
     784      case $cc_basename in
    661785        CC)
    662786          ac_cv_prog_cc_wl='-Wl,'
     
    669793      ;;
    670794    linux*)
    671       case "$cc_basename" in
     795      case $cc_basename in
    672796        KCC)
    673797          # KAI C++ Compiler
     
    691815      ;;
    692816    mvs*)
    693       case "$cc_basename" in
     817      case $cc_basename in
    694818        cxx)
    695819          ac_cv_prog_cc_pic='-W c,exportall'
     
    697821        *)
    698822          ;;
    699       esac   
     823      esac
    700824      ;;
    701825    netbsd*)
    702826      ;;
    703827    osf3* | osf4* | osf5*)
    704       case "$cc_basename" in
     828      case $cc_basename in
    705829        KCC)
    706830          ac_cv_prog_cc_wl='--backend -Wl,'
     
    725849      ;;
    726850    sco*)
    727       case "$cc_basename" in
     851      case $cc_basename in
    728852        CC)
    729853          ac_cv_prog_cc_pic='-fPIC'
     
    734858      ;;
    735859    solaris*)
    736       case "$cc_basename" in
     860      case $cc_basename in
    737861        CC)
    738862          # Sun C++ 4.2, 5.x and Centerline C++
     
    747871        *)
    748872          ;;
    749       esac   
     873      esac
    750874      ;;
    751875    sunos4*)
    752       case "$cc_basename" in
     876      case $cc_basename in
    753877        CC)
    754878          # Sun C++ 4.x
     
    765889      ;;
    766890    tandem*)
    767       case "$cc_basename" in
     891      case $cc_basename in
    768892        NCC)
    769893          # NonStop-UX NCC 3.20
     
    772896        *)
    773897          ;;
    774       esac   
     898      esac
    775899      ;;
    776900    unixware*)
     
    783907  esac
    784908fi
    785 ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
     909
     910case "$host_os" in
     911    # Platforms which do not suport PIC and -DPIC is meaningless
     912    # on them:
     913    *djgpp*)
     914      ac_cv_prog_cc_pic=
     915      ;;
     916    *)
     917      ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
     918      ;;
     919esac
    786920
    787921
     
    799933
    800934
    801 if eval $ac_compile 2>&5; then
     935if (eval $ac_compile) 2>&5; then
    802936  # Parse the compiler output and extract the necessary
    803937  # objects, libraries and library flags.
     
    807941  pre_test_object_deps_done=no
    808942
    809   for p in `eval $output_verbose_link_cmds`; do
     943  for p in `eval $output_verbose_link_cmd`; do
    810944
    811945    case $p in
Note: See TracChangeset for help on using the changeset viewer.