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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [libgomp/] [acinclude.m4] - Diff between revs 816 and 826

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 816 Rev 826
dnl ----------------------------------------------------------------------
dnl ----------------------------------------------------------------------
dnl This whole bit snagged from libgfortran.
dnl This whole bit snagged from libgfortran.
 
 
dnl Check whether the target supports __sync_*_compare_and_swap.
dnl Check whether the target supports __sync_*_compare_and_swap.
AC_DEFUN([LIBGOMP_CHECK_SYNC_BUILTINS], [
AC_DEFUN([LIBGOMP_CHECK_SYNC_BUILTINS], [
  AC_CACHE_CHECK([whether the target supports __sync_*_compare_and_swap],
  AC_CACHE_CHECK([whether the target supports __sync_*_compare_and_swap],
                 libgomp_cv_have_sync_builtins, [
                 libgomp_cv_have_sync_builtins, [
  AC_TRY_LINK([], [int foo, bar; bar = __sync_val_compare_and_swap(&foo, 0, 1);],
  AC_TRY_LINK([], [int foo, bar; bar = __sync_val_compare_and_swap(&foo, 0, 1);],
              libgomp_cv_have_sync_builtins=yes, libgomp_cv_have_sync_builtins=no)])
              libgomp_cv_have_sync_builtins=yes, libgomp_cv_have_sync_builtins=no)])
  if test $libgomp_cv_have_sync_builtins = yes; then
  if test $libgomp_cv_have_sync_builtins = yes; then
    AC_DEFINE(HAVE_SYNC_BUILTINS, 1,
    AC_DEFINE(HAVE_SYNC_BUILTINS, 1,
              [Define to 1 if the target supports __sync_*_compare_and_swap])
              [Define to 1 if the target supports __sync_*_compare_and_swap])
  fi])
  fi])
 
 
dnl Check whether the target supports hidden visibility.
dnl Check whether the target supports hidden visibility.
AC_DEFUN([LIBGOMP_CHECK_ATTRIBUTE_VISIBILITY], [
AC_DEFUN([LIBGOMP_CHECK_ATTRIBUTE_VISIBILITY], [
  AC_CACHE_CHECK([whether the target supports hidden visibility],
  AC_CACHE_CHECK([whether the target supports hidden visibility],
                 libgomp_cv_have_attribute_visibility, [
                 libgomp_cv_have_attribute_visibility, [
  save_CFLAGS="$CFLAGS"
  save_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS -Werror"
  CFLAGS="$CFLAGS -Werror"
  AC_TRY_COMPILE([void __attribute__((visibility("hidden"))) foo(void) { }],
  AC_TRY_COMPILE([void __attribute__((visibility("hidden"))) foo(void) { }],
                 [], libgomp_cv_have_attribute_visibility=yes,
                 [], libgomp_cv_have_attribute_visibility=yes,
                 libgomp_cv_have_attribute_visibility=no)
                 libgomp_cv_have_attribute_visibility=no)
  CFLAGS="$save_CFLAGS"])
  CFLAGS="$save_CFLAGS"])
  if test $libgomp_cv_have_attribute_visibility = yes; then
  if test $libgomp_cv_have_attribute_visibility = yes; then
    AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1,
    AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1,
      [Define to 1 if the target supports __attribute__((visibility(...))).])
      [Define to 1 if the target supports __attribute__((visibility(...))).])
  fi])
  fi])
 
 
dnl Check whether the target supports dllexport
dnl Check whether the target supports dllexport
AC_DEFUN([LIBGOMP_CHECK_ATTRIBUTE_DLLEXPORT], [
AC_DEFUN([LIBGOMP_CHECK_ATTRIBUTE_DLLEXPORT], [
  AC_CACHE_CHECK([whether the target supports dllexport],
  AC_CACHE_CHECK([whether the target supports dllexport],
                 libgomp_cv_have_attribute_dllexport, [
                 libgomp_cv_have_attribute_dllexport, [
  save_CFLAGS="$CFLAGS"
  save_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS -Werror"
  CFLAGS="$CFLAGS -Werror"
  AC_TRY_COMPILE([void __attribute__((dllexport)) foo(void) { }],
  AC_TRY_COMPILE([void __attribute__((dllexport)) foo(void) { }],
                 [], libgomp_cv_have_attribute_dllexport=yes,
                 [], libgomp_cv_have_attribute_dllexport=yes,
                 libgomp_cv_have_attribute_dllexport=no)
                 libgomp_cv_have_attribute_dllexport=no)
  CFLAGS="$save_CFLAGS"])
  CFLAGS="$save_CFLAGS"])
  if test $libgomp_cv_have_attribute_dllexport = yes; then
  if test $libgomp_cv_have_attribute_dllexport = yes; then
    AC_DEFINE(HAVE_ATTRIBUTE_DLLEXPORT, 1,
    AC_DEFINE(HAVE_ATTRIBUTE_DLLEXPORT, 1,
      [Define to 1 if the target supports __attribute__((dllexport)).])
      [Define to 1 if the target supports __attribute__((dllexport)).])
  fi])
  fi])
 
 
dnl Check whether the target supports symbol aliases.
dnl Check whether the target supports symbol aliases.
AC_DEFUN([LIBGOMP_CHECK_ATTRIBUTE_ALIAS], [
AC_DEFUN([LIBGOMP_CHECK_ATTRIBUTE_ALIAS], [
  AC_CACHE_CHECK([whether the target supports symbol aliases],
  AC_CACHE_CHECK([whether the target supports symbol aliases],
                 libgomp_cv_have_attribute_alias, [
                 libgomp_cv_have_attribute_alias, [
  AC_TRY_LINK([
  AC_TRY_LINK([
void foo(void) { }
void foo(void) { }
extern void bar(void) __attribute__((alias("foo")));],
extern void bar(void) __attribute__((alias("foo")));],
    [bar();], libgomp_cv_have_attribute_alias=yes, libgomp_cv_have_attribute_alias=no)])
    [bar();], libgomp_cv_have_attribute_alias=yes, libgomp_cv_have_attribute_alias=no)])
  if test $libgomp_cv_have_attribute_alias = yes; then
  if test $libgomp_cv_have_attribute_alias = yes; then
    AC_DEFINE(HAVE_ATTRIBUTE_ALIAS, 1,
    AC_DEFINE(HAVE_ATTRIBUTE_ALIAS, 1,
      [Define to 1 if the target supports __attribute__((alias(...))).])
      [Define to 1 if the target supports __attribute__((alias(...))).])
  fi])
  fi])
 
 
sinclude(../libtool.m4)
sinclude(../libtool.m4)
dnl The lines below arrange for aclocal not to bring an installed
dnl The lines below arrange for aclocal not to bring an installed
dnl libtool.m4 into aclocal.m4, while still arranging for automake to
dnl libtool.m4 into aclocal.m4, while still arranging for automake to
dnl add a definition of LIBTOOL to Makefile.in.
dnl add a definition of LIBTOOL to Makefile.in.
ifelse(,,,[AC_SUBST(LIBTOOL)
ifelse(,,,[AC_SUBST(LIBTOOL)
AC_DEFUN([AM_PROG_LIBTOOL])
AC_DEFUN([AM_PROG_LIBTOOL])
AC_DEFUN([AC_LIBTOOL_DLOPEN])
AC_DEFUN([AC_LIBTOOL_DLOPEN])
AC_DEFUN([AC_PROG_LD])
AC_DEFUN([AC_PROG_LD])
])
])
 
 
dnl ----------------------------------------------------------------------
dnl ----------------------------------------------------------------------
dnl This whole bit snagged from libstdc++-v3.
dnl This whole bit snagged from libstdc++-v3.
 
 
dnl
dnl
dnl LIBGOMP_ENABLE
dnl LIBGOMP_ENABLE
dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING)
dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING)
dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c)
dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c)
dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER)
dnl    (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER)
dnl
dnl
dnl See docs/html/17_intro/configury.html#enable for documentation.
dnl See docs/html/17_intro/configury.html#enable for documentation.
dnl
dnl
m4_define([LIBGOMP_ENABLE],[dnl
m4_define([LIBGOMP_ENABLE],[dnl
m4_define([_g_switch],[--enable-$1])dnl
m4_define([_g_switch],[--enable-$1])dnl
m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl
m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl
 AC_ARG_ENABLE($1,_g_help,
 AC_ARG_ENABLE($1,_g_help,
  m4_bmatch([$5],
  m4_bmatch([$5],
   [^permit ],
   [^permit ],
     [[
     [[
      case "$enableval" in
      case "$enableval" in
       m4_bpatsubst([$5],[permit ])) ;;
       m4_bpatsubst([$5],[permit ])) ;;
       *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;;
       *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;;
          dnl Idea for future:  generate a URL pointing to
          dnl Idea for future:  generate a URL pointing to
          dnl "onlinedocs/configopts.html#whatever"
          dnl "onlinedocs/configopts.html#whatever"
      esac
      esac
     ]],
     ]],
   [^$],
   [^$],
     [[
     [[
      case "$enableval" in
      case "$enableval" in
       yes|no) ;;
       yes|no) ;;
       *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;;
       *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;;
      esac
      esac
     ]],
     ]],
   [[$5]]),
   [[$5]]),
  [enable_]m4_bpatsubst([$1],-,_)[=][$2])
  [enable_]m4_bpatsubst([$1],-,_)[=][$2])
m4_undefine([_g_switch])dnl
m4_undefine([_g_switch])dnl
m4_undefine([_g_help])dnl
m4_undefine([_g_help])dnl
])
])
 
 
 
 
dnl
dnl
dnl If GNU ld is in use, check to see if tricky linker opts can be used.  If
dnl If GNU ld is in use, check to see if tricky linker opts can be used.  If
dnl the native linker is in use, all variables will be defined to something
dnl the native linker is in use, all variables will be defined to something
dnl safe (like an empty string).
dnl safe (like an empty string).
dnl
dnl
dnl Defines:
dnl Defines:
dnl  SECTION_LDFLAGS='-Wl,--gc-sections' if possible
dnl  SECTION_LDFLAGS='-Wl,--gc-sections' if possible
dnl  OPT_LDFLAGS='-Wl,-O1' if possible
dnl  OPT_LDFLAGS='-Wl,-O1' if possible
dnl  LD (as a side effect of testing)
dnl  LD (as a side effect of testing)
dnl Sets:
dnl Sets:
dnl  with_gnu_ld
dnl  with_gnu_ld
dnl  libgomp_ld_is_gold (possibly)
dnl  libgomp_ld_is_gold (possibly)
dnl  libgomp_gnu_ld_version (possibly)
dnl  libgomp_gnu_ld_version (possibly)
dnl
dnl
dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
dnl set libgomp_gnu_ld_version to 12345.  Zeros cause problems.
dnl set libgomp_gnu_ld_version to 12345.  Zeros cause problems.
dnl
dnl
AC_DEFUN([LIBGOMP_CHECK_LINKER_FEATURES], [
AC_DEFUN([LIBGOMP_CHECK_LINKER_FEATURES], [
  # If we're not using GNU ld, then there's no point in even trying these
  # If we're not using GNU ld, then there's no point in even trying these
  # tests.  Check for that first.  We should have already tested for gld
  # tests.  Check for that first.  We should have already tested for gld
  # by now (in libtool), but require it now just to be safe...
  # by now (in libtool), but require it now just to be safe...
  test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
  test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
  test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
  test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
  AC_REQUIRE([AC_PROG_LD])
  AC_REQUIRE([AC_PROG_LD])
  AC_REQUIRE([AC_PROG_AWK])
  AC_REQUIRE([AC_PROG_AWK])
 
 
  # The name set by libtool depends on the version of libtool.  Shame on us
  # The name set by libtool depends on the version of libtool.  Shame on us
  # for depending on an impl detail, but c'est la vie.  Older versions used
  # for depending on an impl detail, but c'est la vie.  Older versions used
  # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
  # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
  # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
  # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
  # makes sense).  We'll test with_gnu_ld everywhere else, so if that isn't
  # makes sense).  We'll test with_gnu_ld everywhere else, so if that isn't
  # set (hence we're using an older libtool), then set it.
  # set (hence we're using an older libtool), then set it.
  if test x${with_gnu_ld+set} != xset; then
  if test x${with_gnu_ld+set} != xset; then
    if test x${ac_cv_prog_gnu_ld+set} != xset; then
    if test x${ac_cv_prog_gnu_ld+set} != xset; then
      # We got through "ac_require(ac_prog_ld)" and still not set?  Huh?
      # We got through "ac_require(ac_prog_ld)" and still not set?  Huh?
      with_gnu_ld=no
      with_gnu_ld=no
    else
    else
      with_gnu_ld=$ac_cv_prog_gnu_ld
      with_gnu_ld=$ac_cv_prog_gnu_ld
    fi
    fi
  fi
  fi
 
 
  # Start by getting the version number.  I think the libtool test already
  # Start by getting the version number.  I think the libtool test already
  # does some of this, but throws away the result.
  # does some of this, but throws away the result.
  libgomp_ld_is_gold=no
  libgomp_ld_is_gold=no
  if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then
  if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then
    libgomp_ld_is_gold=yes
    libgomp_ld_is_gold=yes
  fi
  fi
  changequote(,)
  changequote(,)
  ldver=`$LD --version 2>/dev/null |
  ldver=`$LD --version 2>/dev/null |
         sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
         sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
  changequote([,])
  changequote([,])
  libgomp_gnu_ld_version=`echo $ldver | \
  libgomp_gnu_ld_version=`echo $ldver | \
         $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
         $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
 
 
  # Set --gc-sections.
  # Set --gc-sections.
  if test "$with_gnu_ld" = "notbroken"; then
  if test "$with_gnu_ld" = "notbroken"; then
    # GNU ld it is!  Joy and bunny rabbits!
    # GNU ld it is!  Joy and bunny rabbits!
 
 
    # All these tests are for C++; save the language and the compiler flags.
    # All these tests are for C++; save the language and the compiler flags.
    # Need to do this so that g++ won't try to link in libstdc++
    # Need to do this so that g++ won't try to link in libstdc++
    ac_test_CFLAGS="${CFLAGS+set}"
    ac_test_CFLAGS="${CFLAGS+set}"
    ac_save_CFLAGS="$CFLAGS"
    ac_save_CFLAGS="$CFLAGS"
    CFLAGS='-x c++  -Wl,--gc-sections'
    CFLAGS='-x c++  -Wl,--gc-sections'
 
 
    # Check for -Wl,--gc-sections
    # Check for -Wl,--gc-sections
    # XXX This test is broken at the moment, as symbols required for linking
    # XXX This test is broken at the moment, as symbols required for linking
    # are now in libsupc++ (not built yet).  In addition, this test has
    # are now in libsupc++ (not built yet).  In addition, this test has
    # cored on solaris in the past.  In addition, --gc-sections doesn't
    # cored on solaris in the past.  In addition, --gc-sections doesn't
    # really work at the moment (keeps on discarding used sections, first
    # really work at the moment (keeps on discarding used sections, first
    # .eh_frame and now some of the glibc sections for iconv).
    # .eh_frame and now some of the glibc sections for iconv).
    # Bzzzzt.  Thanks for playing, maybe next time.
    # Bzzzzt.  Thanks for playing, maybe next time.
    AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
    AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
    AC_TRY_RUN([
    AC_TRY_RUN([
     int main(void)
     int main(void)
     {
     {
       try { throw 1; }
       try { throw 1; }
       catch (...) { };
       catch (...) { };
       return 0;
       return 0;
     }
     }
    ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
    ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
    if test "$ac_test_CFLAGS" = set; then
    if test "$ac_test_CFLAGS" = set; then
      CFLAGS="$ac_save_CFLAGS"
      CFLAGS="$ac_save_CFLAGS"
    else
    else
      # this is the suspicious part
      # this is the suspicious part
      CFLAGS=''
      CFLAGS=''
    fi
    fi
    if test "$ac_sectionLDflags" = "yes"; then
    if test "$ac_sectionLDflags" = "yes"; then
      SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
      SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
    fi
    fi
    AC_MSG_RESULT($ac_sectionLDflags)
    AC_MSG_RESULT($ac_sectionLDflags)
  fi
  fi
 
 
  # Set linker optimization flags.
  # Set linker optimization flags.
  if test x"$with_gnu_ld" = x"yes"; then
  if test x"$with_gnu_ld" = x"yes"; then
    OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
    OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
  fi
  fi
 
 
  AC_SUBST(SECTION_LDFLAGS)
  AC_SUBST(SECTION_LDFLAGS)
  AC_SUBST(OPT_LDFLAGS)
  AC_SUBST(OPT_LDFLAGS)
])
])
 
 
 
 
dnl
dnl
dnl Add version tags to symbols in shared library (or not), additionally
dnl Add version tags to symbols in shared library (or not), additionally
dnl marking other symbols as private/local (or not).
dnl marking other symbols as private/local (or not).
dnl
dnl
dnl --enable-symvers=style adds a version script to the linker call when
dnl --enable-symvers=style adds a version script to the linker call when
dnl       creating the shared library.  The choice of version script is
dnl       creating the shared library.  The choice of version script is
dnl       controlled by 'style'.
dnl       controlled by 'style'.
dnl --disable-symvers does not.
dnl --disable-symvers does not.
dnl  +  Usage:  LIBGOMP_ENABLE_SYMVERS[(DEFAULT)]
dnl  +  Usage:  LIBGOMP_ENABLE_SYMVERS[(DEFAULT)]
dnl       Where DEFAULT is either 'yes' or 'no'.  Passing `yes' tries to
dnl       Where DEFAULT is either 'yes' or 'no'.  Passing `yes' tries to
dnl       choose a default style based on linker characteristics.  Passing
dnl       choose a default style based on linker characteristics.  Passing
dnl       'no' disables versioning.
dnl       'no' disables versioning.
dnl
dnl
AC_DEFUN([LIBGOMP_ENABLE_SYMVERS], [
AC_DEFUN([LIBGOMP_ENABLE_SYMVERS], [
 
 
LIBGOMP_ENABLE(symvers,yes,[=STYLE],
LIBGOMP_ENABLE(symvers,yes,[=STYLE],
  [enables symbol versioning of the shared library],
  [enables symbol versioning of the shared library],
  [permit yes|no|gnu])
  [permit yes|no|gnu])
 
 
# If we never went through the LIBGOMP_CHECK_LINKER_FEATURES macro, then we
# If we never went through the LIBGOMP_CHECK_LINKER_FEATURES macro, then we
# don't know enough about $LD to do tricks...
# don't know enough about $LD to do tricks...
AC_REQUIRE([LIBGOMP_CHECK_LINKER_FEATURES])
AC_REQUIRE([LIBGOMP_CHECK_LINKER_FEATURES])
# FIXME  The following test is too strict, in theory.
# FIXME  The following test is too strict, in theory.
if test $enable_shared = no ||
if test $enable_shared = no ||
        test "x$LD" = x ||
        test "x$LD" = x ||
        test x$libgomp_gnu_ld_version = x; then
        test x$libgomp_gnu_ld_version = x; then
  enable_symvers=no
  enable_symvers=no
fi
fi
 
 
# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
if test $enable_symvers != no; then
if test $enable_symvers != no; then
  AC_MSG_CHECKING([for shared libgcc])
  AC_MSG_CHECKING([for shared libgcc])
  ac_save_CFLAGS="$CFLAGS"
  ac_save_CFLAGS="$CFLAGS"
  CFLAGS=' -lgcc_s'
  CFLAGS=' -lgcc_s'
  AC_TRY_LINK(, [return 0;], libgomp_shared_libgcc=yes, libgomp_shared_libgcc=no)
  AC_TRY_LINK(, [return 0;], libgomp_shared_libgcc=yes, libgomp_shared_libgcc=no)
  CFLAGS="$ac_save_CFLAGS"
  CFLAGS="$ac_save_CFLAGS"
  if test $libgomp_shared_libgcc = no; then
  if test $libgomp_shared_libgcc = no; then
    cat > conftest.c <<EOF
    cat > conftest.c <<EOF
int main (void) { return 0; }
int main (void) { return 0; }
EOF
EOF
changequote(,)dnl
changequote(,)dnl
    libgomp_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
    libgomp_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
                             -shared -shared-libgcc -o conftest.so \
                             -shared -shared-libgcc -o conftest.so \
                             conftest.c -v 2>&1 >/dev/null \
                             conftest.c -v 2>&1 >/dev/null \
                             | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
                             | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
changequote([,])dnl
changequote([,])dnl
    rm -f conftest.c conftest.so
    rm -f conftest.c conftest.so
    if test x${libgomp_libgcc_s_suffix+set} = xset; then
    if test x${libgomp_libgcc_s_suffix+set} = xset; then
      CFLAGS=" -lgcc_s$libgomp_libgcc_s_suffix"
      CFLAGS=" -lgcc_s$libgomp_libgcc_s_suffix"
      AC_TRY_LINK(, [return 0;], libgomp_shared_libgcc=yes)
      AC_TRY_LINK(, [return 0;], libgomp_shared_libgcc=yes)
      CFLAGS="$ac_save_CFLAGS"
      CFLAGS="$ac_save_CFLAGS"
    fi
    fi
  fi
  fi
  AC_MSG_RESULT($libgomp_shared_libgcc)
  AC_MSG_RESULT($libgomp_shared_libgcc)
fi
fi
 
 
# For GNU ld, we need at least this version.  The format is described in
# For GNU ld, we need at least this version.  The format is described in
# LIBGOMP_CHECK_LINKER_FEATURES above.
# LIBGOMP_CHECK_LINKER_FEATURES above.
libgomp_min_gnu_ld_version=21400
libgomp_min_gnu_ld_version=21400
# XXXXXXXXXXX libgomp_gnu_ld_version=21390
# XXXXXXXXXXX libgomp_gnu_ld_version=21390
 
 
# Check to see if unspecified "yes" value can win, given results above.
# Check to see if unspecified "yes" value can win, given results above.
# Change "yes" into either "no" or a style name.
# Change "yes" into either "no" or a style name.
if test $enable_symvers = yes; then
if test $enable_symvers = yes; then
  if test $with_gnu_ld = yes &&
  if test $with_gnu_ld = yes &&
     test $libgomp_shared_libgcc = yes;
     test $libgomp_shared_libgcc = yes;
  then
  then
    if test $libgomp_gnu_ld_version -ge $libgomp_min_gnu_ld_version ; then
    if test $libgomp_gnu_ld_version -ge $libgomp_min_gnu_ld_version ; then
      enable_symvers=gnu
      enable_symvers=gnu
    elif test $libgomp_ld_is_gold = yes ; then
    elif test $libgomp_ld_is_gold = yes ; then
      enable_symvers=gnu
      enable_symvers=gnu
    else
    else
      # The right tools, the right setup, but too old.  Fallbacks?
      # The right tools, the right setup, but too old.  Fallbacks?
      AC_MSG_WARN(=== Linker version $libgomp_gnu_ld_version is too old for)
      AC_MSG_WARN(=== Linker version $libgomp_gnu_ld_version is too old for)
      AC_MSG_WARN(=== full symbol versioning support in this release of GCC.)
      AC_MSG_WARN(=== full symbol versioning support in this release of GCC.)
      AC_MSG_WARN(=== You would need to upgrade your binutils to version)
      AC_MSG_WARN(=== You would need to upgrade your binutils to version)
      AC_MSG_WARN(=== $libgomp_min_gnu_ld_version or later and rebuild GCC.)
      AC_MSG_WARN(=== $libgomp_min_gnu_ld_version or later and rebuild GCC.)
      if test $libgomp_gnu_ld_version -ge 21200 ; then
      if test $libgomp_gnu_ld_version -ge 21200 ; then
        # Globbing fix is present, proper block support is not.
        # Globbing fix is present, proper block support is not.
        dnl AC_MSG_WARN([=== Dude, you are soooo close.  Maybe we can fake it.])
        dnl AC_MSG_WARN([=== Dude, you are soooo close.  Maybe we can fake it.])
        dnl enable_symvers=???
        dnl enable_symvers=???
        AC_MSG_WARN([=== Symbol versioning will be disabled.])
        AC_MSG_WARN([=== Symbol versioning will be disabled.])
        enable_symvers=no
        enable_symvers=no
      else
      else
        # 2.11 or older.
        # 2.11 or older.
        AC_MSG_WARN([=== Symbol versioning will be disabled.])
        AC_MSG_WARN([=== Symbol versioning will be disabled.])
        enable_symvers=no
        enable_symvers=no
      fi
      fi
    fi
    fi
  else
  else
    # just fail for now
    # just fail for now
    AC_MSG_WARN([=== You have requested some kind of symbol versioning, but])
    AC_MSG_WARN([=== You have requested some kind of symbol versioning, but])
    AC_MSG_WARN([=== either you are not using a supported linker, or you are])
    AC_MSG_WARN([=== either you are not using a supported linker, or you are])
    AC_MSG_WARN([=== not building a shared libgcc_s (which is required).])
    AC_MSG_WARN([=== not building a shared libgcc_s (which is required).])
    AC_MSG_WARN([=== Symbol versioning will be disabled.])
    AC_MSG_WARN([=== Symbol versioning will be disabled.])
    enable_symvers=no
    enable_symvers=no
  fi
  fi
fi
fi
 
 
AC_CACHE_CHECK([whether the target supports .symver directive],
AC_CACHE_CHECK([whether the target supports .symver directive],
               libgomp_cv_have_as_symver_directive, [
               libgomp_cv_have_as_symver_directive, [
  AC_TRY_COMPILE([void foo (void); __asm (".symver foo, bar@SYMVER");],
  AC_TRY_COMPILE([void foo (void); __asm (".symver foo, bar@SYMVER");],
                 [], libgomp_cv_have_as_symver_directive=yes,
                 [], libgomp_cv_have_as_symver_directive=yes,
                 libgomp_cv_have_as_symver_directive=no)])
                 libgomp_cv_have_as_symver_directive=no)])
if test $libgomp_cv_have_as_symver_directive = yes; then
if test $libgomp_cv_have_as_symver_directive = yes; then
  AC_DEFINE(HAVE_AS_SYMVER_DIRECTIVE, 1,
  AC_DEFINE(HAVE_AS_SYMVER_DIRECTIVE, 1,
    [Define to 1 if the target assembler supports .symver directive.])
    [Define to 1 if the target assembler supports .symver directive.])
fi
fi
 
 
AM_CONDITIONAL(LIBGOMP_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
AM_CONDITIONAL(LIBGOMP_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
])
])
 
 

powered by: WebSVN 2.1.0

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