public inbox for rda@sourceware.org
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: rda@sources.redhat.com
Subject: [PATCH] mips64 configury changes
Date: Fri, 17 Jan 2003 20:13:00 -0000	[thread overview]
Message-ID: <1030117201328.ZM11512@localhost.localdomain> (raw)

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)

                 reply	other threads:[~2003-01-17 20:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1030117201328.ZM11512@localhost.localdomain \
    --to=kevinb@redhat.com \
    --cc=rda@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).