esac
if test x$with_arch != x; then
default_mips_arch=$with_arch
+ else
+ with_arch=$default_mips_arch
fi
if test x$with_abi != x; then
default_mips_abi=$with_abi
#endif
+/* Define to 1 if you have the <sys/auxv.h> header file. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_SYS_AUXV_H
+#endif
+
+
/* Define to 1 if you have the <sys/file.h> header file. */
#ifndef USED_FOR_TARGET
#undef HAVE_SYS_FILE_H
#undef vfork
#endif
+/* Define to 1 if you have the `getauxval' function. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_GETAUXVAL
+#endif
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#ifdef HAVE_SYS_AUXV_H
+#include <sys/auxv.h>
+#endif
/* This will be called by the spec parser in gcc.cc when it sees
a %:local_cpu_detect(args) construct. Currently it will be called
host_detect_local_cpu (int argc, const char **argv)
{
const char *cpu = NULL;
+ char *ret = NULL;
char buf[128];
FILE *f;
bool arch;
f = fopen ("/proc/cpuinfo", "r");
if (f == NULL)
- return NULL;
+ goto fallback_cpu;
while (fgets (buf, sizeof (buf), f) != NULL)
if (startswith (buf, "cpu model"))
fclose (f);
+fallback_cpu:
+#if defined (__mips_nan2008)
+ ret = reconcat (ret, " -mnan=2008 ", NULL);
+#endif
+
+#ifdef HAVE_GETAUXVAL
if (cpu == NULL)
- return NULL;
+ cpu = (const char *) getauxval (AT_BASE_PLATFORM);
+#endif
+
+#if defined (_MIPS_ARCH)
+ if (cpu == NULL)
+ cpu = _MIPS_ARCH;
+#endif
+
+ if (cpu)
+ ret = reconcat (ret, ret, "-m", argv[0], "=", cpu, NULL);
- return concat ("-m", argv[0], "=", cpu, NULL);
+ return ret;
}
fi
for ac_header in limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
- fcntl.h ftw.h unistd.h sys/file.h sys/time.h sys/mman.h \
+ fcntl.h ftw.h unistd.h sys/auxv.h sys/file.h sys/time.h sys/mman.h \
sys/resource.h sys/param.h sys/times.h sys/stat.h sys/locking.h \
direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h
do :
for ac_func in times clock kill getrlimit setrlimit atoq \
popen sysconf strsignal getrusage nl_langinfo \
gettimeofday mbstowcs wcswidth mmap posix_fallocate setlocale \
- clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked madvise mallinfo mallinfo2 fstatat
+ clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked madvise mallinfo mallinfo2 fstatat getauxval
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
AC_HEADER_SYS_WAIT
AC_HEADER_TIOCGWINSZ
AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
- fcntl.h ftw.h unistd.h sys/file.h sys/time.h sys/mman.h \
+ fcntl.h ftw.h unistd.h sys/auxv.h sys/file.h sys/time.h sys/mman.h \
sys/resource.h sys/param.h sys/times.h sys/stat.h sys/locking.h \
direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h)
AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoq \
popen sysconf strsignal getrusage nl_langinfo \
gettimeofday mbstowcs wcswidth mmap posix_fallocate setlocale \
- gcc_UNLOCKED_FUNCS madvise mallinfo mallinfo2 fstatat)
+ gcc_UNLOCKED_FUNCS madvise mallinfo mallinfo2 fstatat getauxval)
if test x$ac_cv_func_mbstowcs = xyes; then
AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works,