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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [config/] [weakref.m4] - Blame information for rev 753

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 722 jeremybenn
 
2
dnl Check if the target supports weak.
3
AC_DEFUN([GCC_CHECK_ATTRIBUTE_WEAK], [
4
  AC_CACHE_CHECK([whether the target supports weak],
5
                 ac_cv_have_attribute_weak, [
6
  weakref_m4_saved_CFLAGS="$CFLAGS"
7
  CFLAGS="$CFLAGS -Werror"
8
  AC_TRY_COMPILE([void __attribute__((weak)) foo(void) { }],
9
                 [], ac_cv_have_attribute_weak=yes,
10
                 ac_cv_have_attribute_weak=no)
11
  CFLAGS="$weakref_m4_saved_CFLAGS"])
12
  if test x"$ac_cv_have_attribute_weak" = xyes; then
13
    AC_DEFINE(HAVE_ATTRIBUTE_WEAK, 1,
14
      [Define to 1 if the target supports __attribute__((weak)).])
15
  fi])
16
 
17
dnl Check whether weak refs work like the ELF ones.
18
dnl This means that the weak reference works without having to satify
19
dnl linkage for the item.
20
dnl There are targets (at least Darwin) where we have fully functional
21
dnl weakrefs at runtime, but must supply the referenced item at link time.
22
AC_DEFUN([GCC_CHECK_ELF_STYLE_WEAKREF], [
23
  AC_CACHE_CHECK([whether weak refs work like ELF],
24
                  ac_cv_have_elf_style_weakref, [
25
  weakref_m4_saved_CFLAGS="$CFLAGS"
26
  case "${host}" in
27
    *-apple-darwin*) CFLAGS="$CFLAGS -Wl,-undefined,dynamic_lookup" ;;
28
    *) ;;
29
  esac
30
  AC_RUN_IFELSE([AC_LANG_SOURCE([[
31
extern void fNotToBeFound(void) __attribute__((weak));
32
int main ()
33
{
34
  if (fNotToBeFound)
35
    return 1;
36
  else
37
    return 0;
38
}
39
]])], ac_cv_have_elf_style_weakref=yes, ac_cv_have_elf_style_weakref=no, [
40
case "${host}" in
41
  alpha*-dec-osf*) ac_cv_have_elf_style_weakref=no ;;
42
  *-apple-darwin[[89]]*) ac_cv_have_elf_style_weakref=no ;;
43
  *) ac_cv_have_elf_style_weakref=yes;;
44
esac])CFLAGS="$weakref_m4_saved_CFLAGS"])
45
if test x"$ac_cv_have_elf_style_weakref" = xyes; then
46
  AC_DEFINE(HAVE_ELF_STYLE_WEAKREF, 1, [Define to 1 if target has a weakref that works like the ELF one.])
47
fi])
48
 

powered by: WebSVN 2.1.0

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