OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [config.if] - Diff between revs 1005 and 1765

Only display areas with differences | Details | Blame | View Log

Rev 1005 Rev 1765
#! /dev/null
#! /dev/null
# Don't call it directly. This shell script fragment is called to
# Don't call it directly. This shell script fragment is called to
# determine:
# determine:
#
#
#       1. libstcxx_interface: the interface name for libstdc++.
#       1. libstcxx_interface: the interface name for libstdc++.
#       2. cxx_interface: the interface name for c++.
#       2. cxx_interface: the interface name for c++.
#       3. libc_interface: the interface name for libc.
#       3. libc_interface: the interface name for libc.
#
#
# Get the top level src dir.
# Get the top level src dir.
if [ -z "${topsrcdir}" -a -z "${top_srcdir}" ]
if [ -z "${topsrcdir}" -a -z "${top_srcdir}" ]
then
then
  echo "Undefined top level src dir: topsrcdir and top_srcdir are empty" >&2
  echo "Undefined top level src dir: topsrcdir and top_srcdir are empty" >&2
  exit 1
  exit 1
fi
fi
if [ -n "${topsrcdir}" ]
if [ -n "${topsrcdir}" ]
then
then
  if_topsrcdir=${topsrcdir}
  if_topsrcdir=${topsrcdir}
else
else
  if_topsrcdir=${top_srcdir}
  if_topsrcdir=${top_srcdir}
fi
fi
if [ "${enable_libstdcxx_v3}" = "yes" ] ; then
if [ "${enable_libstdcxx_v3}" = "yes" ] ; then
  libstdcxx_srcdir=${if_topsrcdir}/libstdc++-v3
  libstdcxx_srcdir=${if_topsrcdir}/libstdc++-v3
else
else
  libstdcxx_srcdir=${if_topsrcdir}/libstdc++
  libstdcxx_srcdir=${if_topsrcdir}/libstdc++
fi
fi
if [ -f ${libstdcxx_srcdir}/Makefile.in ]; then
if [ -f ${libstdcxx_srcdir}/Makefile.in ]; then
# We check libstdc++ for libstdcxx_interface.
# We check libstdc++ for libstdcxx_interface.
libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/Makefile.in | sed 's/INTERFACE[      ]*=[    ]*\(.*\)/\1/'`
libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/Makefile.in | sed 's/INTERFACE[      ]*=[    ]*\(.*\)/\1/'`
else
else
libstdcxx_interface=
libstdcxx_interface=
fi
fi
if [ -f ${if_topsrcdir}/gcc/cp/Makefile.in ]; then
if [ -f ${if_topsrcdir}/gcc/cp/Makefile.in ]; then
# We check gcc/cp for cxx_interface.
# We check gcc/cp for cxx_interface.
cxx_interface=`grep "^INTERFACE" ${if_topsrcdir}/gcc/cp/Makefile.in | sed 's/INTERFACE[         ]*=[    ]*\(.*\)/\1/'`
cxx_interface=`grep "^INTERFACE" ${if_topsrcdir}/gcc/cp/Makefile.in | sed 's/INTERFACE[         ]*=[    ]*\(.*\)/\1/'`
else
else
cxx_interface=
cxx_interface=
fi
fi
# The trickiest part is libc_interface.
# The trickiest part is libc_interface.
if [ -z "${libc_interface}" ]
if [ -z "${libc_interface}" ]
then
then
  case ${target_os} in
  case ${target_os} in
  *linux*libc1*|*linux*libc5*)
  *linux*libc1*|*linux*libc5*)
    case ${target_alias} in
    case ${target_alias} in
    *alpha*|*powerpc*)
    *alpha*|*powerpc*)
      libc_interface=-libc5.9-
      libc_interface=-libc5.9-
      ;;
      ;;
    *)
    *)
      libc_interface=-libc5-
      libc_interface=-libc5-
      ;;
      ;;
    esac
    esac
    ;;
    ;;
  *linux*gnu*)
  *linux*gnu*)
    # We have to work harder to figure it out.
    # We have to work harder to figure it out.
    if [ ${target_alias} = ${build_alias} ]
    if [ ${target_alias} = ${build_alias} ]
    then
    then
      dummy=if$$
      dummy=if$$
      cat >$dummy.c <
      cat >$dummy.c <
#include 
#include 
main(argc, argv)
main(argc, argv)
     int argc;
     int argc;
     char *argv[];
     char *argv[];
{
{
  printf("%d\n", __GLIBC_MINOR__);
  printf("%d\n", __GLIBC_MINOR__);
  return 0;
  return 0;
}
}
EOF
EOF
      ${CC-cc} $dummy.c -o $dummy 2>/dev/null
      ${CC-cc} $dummy.c -o $dummy 2>/dev/null
      if [ "$?" = 0 ]
      if [ "$?" = 0 ]
      then
      then
        libc_interface=-libc6.`./$dummy`-
        libc_interface=-libc6.`./$dummy`-
        rm -f $dummy.c $dummy
        rm -f $dummy.c $dummy
      else
      else
        # It should never happen.
        # It should never happen.
        echo "Cannot find the GNU C library minor version number." >&2
        echo "Cannot find the GNU C library minor version number." >&2
        rm -f $dummy.c $dummy
        rm -f $dummy.c $dummy
        exit 1
        exit 1
      fi
      fi
    else
    else
      # Cross compiling. Assume glibc 2.2.
      # Cross compiling. Assume glibc 2.2.
      libc_interface=-libc6.2-
      libc_interface=-libc6.2-
    fi
    fi
    ;;
    ;;
  *)
  *)
    libc_interface=-
    libc_interface=-
    ;;
    ;;
  esac
  esac
fi
fi
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.