mips: move ABI check to configure.ac

* configure.ac [MIPS]: Check for MIPS ABI.
* defs.h [MIPS]: Remove MIPS ABI check.
* ioctlsort.c: Likewise.
This commit is contained in:
Дмитрий Левин 2015-02-15 01:08:48 +00:00
parent 4a00fc4867
commit 047365efde
3 changed files with 23 additions and 26 deletions

View File

@ -143,6 +143,29 @@ AC_MSG_RESULT($arch)
AC_SUBST(arch)
if test "$arch" = mips; then
AC_CACHE_CHECK([for MIPS ABI], [ac_cv_mips_abi],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <sgidefs.h>]],
[[int i[_MIPS_SIM == _MIPS_SIM_ABI32 ? 1 : - 1];]])],
[ac_cv_mips_abi=o32],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <sgidefs.h>]],
[[int i[_MIPS_SIM == _MIPS_SIM_NABI32 ? 1 : - 1];]])],
[ac_cv_mips_abi=n32],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <sgidefs.h>]],
[[int i[_MIPS_SIM == _MIPS_SIM_ABI64 ? 1 : - 1];]])],
[ac_cv_mips_abi=n64],
[ac_cv_mips_abi=unknown])])])])
case "$ac_cv_mips_abi" in
o32) AC_DEFINE([LINUX_MIPSO32], [1], [Define for _MIPS_SIM_ABI32.]);;
n32) AC_DEFINE([LINUX_MIPSN32], [1], [Define for _MIPS_SIM_NABI32.]);;
n64) AC_DEFINE([LINUX_MIPSN64], [1], [Define for _MIPS_SIM_ABI64.]);;
*) AC_MSG_ERROR([Unsupported _MIPS_SIM]);;
esac
fi
AC_ARG_ENABLE([arm-oabi],
[AS_HELP_STRING([--enable-arm-oabi],
[enable OABI support on ARM EABI])],

13
defs.h
View File

@ -31,19 +31,6 @@
# include "config.h"
#endif
#ifdef MIPS
# include <sgidefs.h>
# if _MIPS_SIM == _MIPS_SIM_ABI64
# define LINUX_MIPSN64
# elif _MIPS_SIM == _MIPS_SIM_NABI32
# define LINUX_MIPSN32
# elif _MIPS_SIM == _MIPS_SIM_ABI32
# define LINUX_MIPSO32
# else
# error Unsupported _MIPS_SIM
# endif
#endif
#include <features.h>
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>

View File

@ -30,19 +30,6 @@
# include "config.h"
#endif
#ifdef MIPS
# include <sgidefs.h>
# if _MIPS_SIM == _MIPS_SIM_ABI64
# define LINUX_MIPSN64
# elif _MIPS_SIM == _MIPS_SIM_NABI32
# define LINUX_MIPSN32
# elif _MIPS_SIM == _MIPS_SIM_ABI32
# define LINUX_MIPSO32
# else
# error Unsupported _MIPS_SIM
# endif
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>