Skip to content

Commit

Permalink
Check for sys/auxv.h and only use it if available.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Rønne Petersen committed Jul 20, 2013
1 parent bfefbf3 commit 08d4170
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions configure.in
Expand Up @@ -1150,6 +1150,8 @@ if test x$target_win32 = xno; then

AC_CHECK_HEADERS(execinfo.h)

AC_CHECK_HEADERS(sys/auxv.h)

AC_CHECK_FUNCS(getgrgid_r)
AC_CHECK_FUNCS(getgrnam_r)
AC_CHECK_FUNCS(getpwnam_r)
Expand Down
4 changes: 2 additions & 2 deletions mono/utils/mono-hwcap-arm.c
Expand Up @@ -22,7 +22,7 @@

#if defined(PLATFORM_ANDROID)
#include <stdio.h>
#elif defined(__linux__)
#elif defined(__linux__) && defined(HAVE_SYS_AUXV_H)
#include <sys/auxv.h>
#elif defined(__APPLE__)
#include <mach/machine.h>
Expand Down Expand Up @@ -91,7 +91,7 @@ mono_hwcap_arch_init (void)

fclose (file);
}
#elif defined(__linux__)
#elif defined(__linux__) && defined(HAVE_SYS_AUXV_H)
unsigned long hwcap;
unsigned long platform;

Expand Down
4 changes: 2 additions & 2 deletions mono/utils/mono-hwcap-ppc.c
Expand Up @@ -20,7 +20,7 @@

#include "mono/utils/mono-hwcap-ppc.h"

#if defined(__linux__)
#if defined(__linux__) && defined(HAVE_SYS_AUXV_H)
#include <string.h>
#include <sys/auxv.h>
#endif
Expand All @@ -34,7 +34,7 @@ gboolean mono_hwcap_ppc_has_multiple_ls_units = FALSE;
void
mono_hwcap_arch_init (void)
{
#if defined(__linux__)
#if defined(__linux__) && defined(HAVE_SYS_AUXV_H)
unsigned long hwcap;
unsigned long platform;

Expand Down

0 comments on commit 08d4170

Please sign in to comment.