diff mbox

Move base_machine and machine settings from configure.ac to sysdeps preconfigure fragments

Message ID Pine.LNX.4.64.1406251720090.12113@digraph.polyomino.org.uk
State Committed
Headers show

Commit Message

Joseph Myers June 25, 2014, 5:20 p.m. UTC
This patch makes non-ex-ports architectures set base_machine and
machine based on the original configured machine value in preconfigure
fragments, like ex-ports architectures, rather than in the toplevel
configure.ac.

Tested x86 that the disassembly of installed shared libraries is
unchanged by the patch.

2014-06-25  Joseph Myers  <joseph@codesourcery.com>

	* configure.ac (base_machine): Do not set specially for particular
	machines here.
	* configure: Regenerated.
	* sysdeps/powerpc/preconfigure: Move machine and base_machine
	settings from configure.ac.
	* sysdeps/i386/preconfigure: New file.
	* sysdeps/s390/preconfigure: Likewise.
	* sysdeps/sh/preconfigure: Likewise.
	* sysdeps/sparc/preconfigure: Likewise.

Comments

Roland McGrath June 25, 2014, 5:48 p.m. UTC | #1
Each new file should have at least a minimal comment.
Otherwise OK.
diff mbox

Patch

diff --git a/configure b/configure
index ecc282b..e7ffb83 100755
--- a/configure
+++ b/configure
@@ -3965,39 +3965,8 @@  if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then
   esac
 fi
 
-# Expand the configuration machine name into a subdirectory by architecture
-# type and particular chip.  If an add-on configure fragment already set
-# base_machine, we don't change it.
-test -n "$base_machine" || case "$machine" in
-i[4567]86)	base_machine=i386 machine=i386/$machine ;;
-powerpc64*)	base_machine=powerpc machine=powerpc/powerpc64 ;;
-powerpc*)	base_machine=powerpc machine=powerpc/powerpc32 ;;
-s390)           base_machine=s390 machine=s390/s390-32 ;;
-s390x)          base_machine=s390 machine=s390/s390-64 ;;
-sh3*)		base_machine=sh machine=sh/sh3 ;;
-sh4*)		base_machine=sh machine=sh/sh4 ;;
-sparc | sparcv[67])
-		base_machine=sparc machine=sparc/sparc32 ;;
-sparcv8 | supersparc | hypersparc)
-		base_machine=sparc machine=sparc/sparc32/sparcv8 ;;
-sparcv8plus | sparcv8plusa | sparcv9)
-		base_machine=sparc machine=sparc/sparc32/sparcv9 ;;
-sparcv8plusb | sparcv9b)
-		base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;;
-sparcv9v)
-		base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v ;;
-sparcv9v2)
-		base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v2 ;;
-sparc64)
-		base_machine=sparc machine=sparc/sparc64 ;;
-sparc64b)
-		base_machine=sparc machine=sparc/sparc64/sparcv9b ;;
-sparc64v)
-		base_machine=sparc machine=sparc/sparc64/sparcv9v ;;
-sparc64v2)
-		base_machine=sparc machine=sparc/sparc64/sparcv9v2 ;;
-*)		base_machine=$machine ;;
-esac
+# Set base_machine if not set by a preconfigure fragment.
+test -n "$base_machine" || base_machine=$machine
 
 
 if test "$base_machine" = "i386"; then
diff --git a/configure.ac b/configure.ac
index babfe57..2d5b902 100644
--- a/configure.ac
+++ b/configure.ac
@@ -582,42 +582,8 @@  if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then
   esac
 fi
 
-dnl We need to use [ and ] for other purposes for a while now.
-changequote(,)dnl
-# Expand the configuration machine name into a subdirectory by architecture
-# type and particular chip.  If an add-on configure fragment already set
-# base_machine, we don't change it.
-test -n "$base_machine" || case "$machine" in
-i[4567]86)	base_machine=i386 machine=i386/$machine ;;
-powerpc64*)	base_machine=powerpc machine=powerpc/powerpc64 ;;
-powerpc*)	base_machine=powerpc machine=powerpc/powerpc32 ;;
-s390)           base_machine=s390 machine=s390/s390-32 ;;
-s390x)          base_machine=s390 machine=s390/s390-64 ;;
-sh3*)		base_machine=sh machine=sh/sh3 ;;
-sh4*)		base_machine=sh machine=sh/sh4 ;;
-sparc | sparcv[67])
-		base_machine=sparc machine=sparc/sparc32 ;;
-sparcv8 | supersparc | hypersparc)
-		base_machine=sparc machine=sparc/sparc32/sparcv8 ;;
-sparcv8plus | sparcv8plusa | sparcv9)
-		base_machine=sparc machine=sparc/sparc32/sparcv9 ;;
-sparcv8plusb | sparcv9b)
-		base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;;
-sparcv9v)
-		base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v ;;
-sparcv9v2)
-		base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v2 ;;
-sparc64)
-		base_machine=sparc machine=sparc/sparc64 ;;
-sparc64b)
-		base_machine=sparc machine=sparc/sparc64/sparcv9b ;;
-sparc64v)
-		base_machine=sparc machine=sparc/sparc64/sparcv9v ;;
-sparc64v2)
-		base_machine=sparc machine=sparc/sparc64/sparcv9v2 ;;
-*)		base_machine=$machine ;;
-esac
-changequote([,])dnl
+# Set base_machine if not set by a preconfigure fragment.
+test -n "$base_machine" || base_machine=$machine
 AC_SUBST(base_machine)
 
 if test "$base_machine" = "i386"; then
diff --git a/sysdeps/i386/preconfigure b/sysdeps/i386/preconfigure
new file mode 100644
index 0000000..d06c1a1
--- /dev/null
+++ b/sysdeps/i386/preconfigure
@@ -0,0 +1,3 @@ 
+case "$machine" in
+i[4567]86)	base_machine=i386 machine=i386/$machine ;;
+esac
diff --git a/sysdeps/powerpc/preconfigure b/sysdeps/powerpc/preconfigure
index 1741c25..f4d9f46 100644
--- a/sysdeps/powerpc/preconfigure
+++ b/sysdeps/powerpc/preconfigure
@@ -1,10 +1,14 @@ 
-# Check for e500.
-
 case "$machine" in
-powerpc)
+powerpc64*)
+  base_machine=powerpc machine=powerpc/powerpc64
+  ;;
+powerpc*)
+  # Check for e500.
   $CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null > conftest.i
   if grep -q __NO_FPRS__ conftest.i && ! grep -q _SOFT_FLOAT conftest.i; then
     base_machine=powerpc machine=powerpc/powerpc32/e500
+  else
+    base_machine=powerpc machine=powerpc/powerpc32
   fi
   rm -f conftest.i
   ;;
diff --git a/sysdeps/s390/preconfigure b/sysdeps/s390/preconfigure
new file mode 100644
index 0000000..9eaf38a
--- /dev/null
+++ b/sysdeps/s390/preconfigure
@@ -0,0 +1,4 @@ 
+case "$machine" in
+s390)           base_machine=s390 machine=s390/s390-32 ;;
+s390x)          base_machine=s390 machine=s390/s390-64 ;;
+esac
diff --git a/sysdeps/sh/preconfigure b/sysdeps/sh/preconfigure
new file mode 100644
index 0000000..d955c44
--- /dev/null
+++ b/sysdeps/sh/preconfigure
@@ -0,0 +1,4 @@ 
+case "$machine" in
+sh3*)		base_machine=sh machine=sh/sh3 ;;
+sh4*)		base_machine=sh machine=sh/sh4 ;;
+esac
diff --git a/sysdeps/sparc/preconfigure b/sysdeps/sparc/preconfigure
new file mode 100644
index 0000000..e468a39
--- /dev/null
+++ b/sysdeps/sparc/preconfigure
@@ -0,0 +1,22 @@ 
+case "$machine" in
+sparc | sparcv[67])
+		base_machine=sparc machine=sparc/sparc32 ;;
+sparcv8 | supersparc | hypersparc)
+		base_machine=sparc machine=sparc/sparc32/sparcv8 ;;
+sparcv8plus | sparcv8plusa | sparcv9)
+		base_machine=sparc machine=sparc/sparc32/sparcv9 ;;
+sparcv8plusb | sparcv9b)
+		base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;;
+sparcv9v)
+		base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v ;;
+sparcv9v2)
+		base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v2 ;;
+sparc64)
+		base_machine=sparc machine=sparc/sparc64 ;;
+sparc64b)
+		base_machine=sparc machine=sparc/sparc64/sparcv9b ;;
+sparc64v)
+		base_machine=sparc machine=sparc/sparc64/sparcv9v ;;
+sparc64v2)
+		base_machine=sparc machine=sparc/sparc64/sparcv9v2 ;;
+esac