This is the mail archive of the
rda@sources.redhat.com
mailing list for the rda project.
[PATCH] mips64 configury changes
- From: Kevin Buettner <kevinb at redhat dot com>
- To: rda at sources dot redhat dot com
- Date: Fri, 17 Jan 2003 13:13:28 -0700
- Subject: [PATCH] mips64 configury changes
I've just committed the patch below. Previously, I had set things up
so that you had to use a funny looking target name like
mips64-linux-gnun32 to specify which ABI the tool was being built for.
But that in turn necessitated the use of --program-prefix to pick up the
correct set of tools. It was very ugly. Alex Oliva suggested using
the compiler's preprocessor symbols to determine the correct ABI, and
that's what this patch does.
An added advantage of this approach is that it won't be possible to
get a mismatch between the abi that the compiler is using and what
might've been specified in the funny looking target name.
* configure.in (mips64*linux*n64, mips64*linux*n32, mips64*linux*o32):
Remove cases. Instead, use compiler's preprocessor symbols to test
which ABI is being used.
* configure: Regenerate.
Index: configure.in
===================================================================
RCS file: /cvs/src/src/rda/unix/configure.in,v
retrieving revision 1.3
diff -u -p -r1.3 configure.in
--- configure.in 16 Jan 2003 18:20:19 -0000 1.3
+++ configure.in 17 Jan 2003 20:04:24 -0000
@@ -26,9 +26,6 @@ dnl headers
AC_CHECK_HEADERS(errno.h ptrace.h signal.h string.h strings.h sys/procfs.h \
asm/reg.h sys/ptrace.h sys/reg.h sys/user.h sys/wait.h )
-dnl define ptrace_xfer_type
-dnl define ptrace_arg3_type
-
case "$target" in
mips64*linux*)
TARGET_MODULES="linux-target.o thread-db.o ptrace-target.o"
@@ -94,35 +91,50 @@ case "$target" in
AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
;;
- mips64*linux*n64)
- AC_DEFINE(MIPS64_LINUX_TARGET)
- AC_DEFINE(MIPS_ABI_N64)
- AC_DEFINE(PTRACE_XFER_SIZE, 8)
- AC_DEFINE(PTRACE_XFER_TYPE_LONG)
- AC_DEFINE(PTRACE_ARG1_TYPE_LONG)
- AC_DEFINE(PTRACE_ARG2_TYPE_LONG)
- AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
- AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
- ;;
- mips64*linux*n32)
- AC_DEFINE(MIPS64_LINUX_TARGET)
- AC_DEFINE(MIPS_ABI_N32)
- AC_DEFINE(PTRACE_XFER_SIZE, 8)
- AC_DEFINE(PTRACE_XFER_TYPE_LONG_LONG)
- AC_DEFINE(PTRACE_ARG1_TYPE_LONG_LONG)
- AC_DEFINE(PTRACE_ARG2_TYPE_LONG_LONG)
- AC_DEFINE(PTRACE_ARG3_TYPE_LONG_LONG)
- AC_DEFINE(PTRACE_ARG4_TYPE_LONG_LONG)
- ;;
- mips64*linux*o32)
+ mips64*linux*)
AC_DEFINE(MIPS64_LINUX_TARGET)
- AC_DEFINE(MIPS_ABI_O32)
- AC_DEFINE(PTRACE_XFER_SIZE, 4)
- AC_DEFINE(PTRACE_XFER_TYPE_LONG)
- AC_DEFINE(PTRACE_ARG1_TYPE_LONG)
- AC_DEFINE(PTRACE_ARG2_TYPE_LONG)
- AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
- AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
+ AC_MSG_CHECKING([mips abi])
+ mipsabi=o32
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#if !defined(_ABIN32) || _MIPS_SIM != _ABIN32
+#error not n32
+#endif
+ ]])],[mipsabi=n32])
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#if !defined(_ABI64) || _MIPS_SIM != _ABI64
+#error not n64
+#endif
+ ]])],[mipsabi=n64])
+ AC_MSG_RESULT([$mipsabi])
+ case $mipsabi in
+ o32)
+ AC_DEFINE(MIPS_ABI_O32)
+ AC_DEFINE(PTRACE_XFER_SIZE, 4)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
+ ;;
+ n32)
+ AC_DEFINE(MIPS_ABI_N32)
+ AC_DEFINE(PTRACE_XFER_SIZE, 8)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG_LONG)
+ ;;
+ n64)
+ AC_DEFINE(MIPS_ABI_N64)
+ AC_DEFINE(PTRACE_XFER_SIZE, 8)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
+ ;;
+ esac
;;
mips*linux*)
AC_DEFINE(MIPS_LINUX_TARGET)