This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: flag day for Solaris portions of config.{guess,sub}


Ben Elliston <bje@wasabisystems.com> writes:

> I'm convinced that the proposed change ... would have too much
> impact on users (both of Autoconf and auxillary config.* users).

OK, how about the following more-conservative change instead?  This
patch uses correct version numbers for future versions of SunOS /
Solaris, while leaving the existing incorrect numbers in place.  This
is an upward compatible change that shouldn't affect existing code
that depends on the existin numbers, and this should avoid the
backward-compatibility hassles that have been mentioned in this
thread.


2003-12-04  Paul Eggert  <eggert@twinsun.com>

	* config.guess, config.sub: Use names like "sunos5.10" for future
	Solaris versions, thus fixing the incorrect version numbers
	(like "solaris2.9") in the old scheme.

diff -pru config/config.guess config-sunos/config.guess
--- config/config.guess	Sun Nov 23 21:42:42 2003
+++ config-sunos/config.guess	Thu Dec  4 13:29:46 2003
@@ -136,6 +136,43 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` |
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_SYSTEM}" in
+SunOS)
+    # Solaris 2.0 - 2.6 (SunOS 5.0 - 5.6) are "solaris2.0" - "solaris2.6",
+    # and Solaris 7 - 9 (SunOS 5.7 - 5.9) are "solaris2.7" - "solaris2.9".
+    # This numbering scheme is incorrect, and in retrospect it would have
+    # been better to use SunOS versions (namely, "sunos5.0" - "sunos5.9").
+    # However, many configure scripts depend on this behavior,
+    # so use the traditional scheme for SunOS 5.0 through 5.9.
+    # Starting with SunOS 5.10, use sunos names uniformly (e.g., "sunos5.10").
+    # As SunOS 5.9 and earlier become obsolete the incorrect numbering
+    # problem should also become obsolete.
+
+    # If you prefer using "sunos" names uniformly, set
+    # CONFIG_PREFERS_SUNOS="true" in your environment,
+    # or modify the following line to read "true" rather than "false".
+    CONFIG_PREFERS_SUNOS_DEFAULT=false
+
+    case "${UNAME_MACHINE}:${UNAME_RELEASE}" in
+    sun4*:[0-4].*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=$UNAME_VERSION ;;
+	esac ;;
+    esac
+
+    # Use "sunos" names if they are preferred; otherwise use the
+    # traditional misnumbering scheme.
+    CONFIG_PREFERS_SUNOS=${CONFIG_PREFERS_SUNOS-$CONFIG_PREFERS_SUNOS_DEFAULT}
+    case "${CONFIG_PREFERS_SUNOS}:${UNAME_RELEASE}" in
+	true:* | *:[0-4].* | *:5.[1-9][0-9]*)
+	     # Japanese Language versions have a version number like `4.1.3-JL'.
+	     sun_os_release=sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` ;;
+	*)
+	     sun_os_release=solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//' -e 's/-/_/'` ;;
+    esac ;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -337,29 +374,14 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	case `/usr/bin/uname -p` in
 	    sparc) echo sparc-icl-nx7 && exit 0 ;;
 	esac ;;
-    sun4H:SunOS:5.*:*)
-	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+    sun4H:SunOS:*:*)
+	echo sparc-hal-$sun_os_release
 	exit 0 ;;
-    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+    sun4*:SunOS:*:* | tadpole*:SunOS:*:*)
+	echo sparc-sun-$sun_os_release
 	exit 0 ;;
     i86pc:SunOS:5.*:*)
-	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
-    sun4*:SunOS:6*:*)
-	# According to config.sub, this is the proper way to canonicalize
-	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
-	# it's likely to be more like Solaris than SunOS4.
-	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
-    sun4*:SunOS:*:*)
-	case "`/usr/bin/arch -k`" in
-	    Series*|S4*)
-		UNAME_RELEASE=`uname -v`
-		;;
-	esac
-	# Japanese Language versions have a version number like `4.1.3-JL'.
-	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	echo i386-pc-$sun_os_release
 	exit 0 ;;
     sun3*:SunOS:*:*)
 	echo m68k-sun-sunos${UNAME_RELEASE}
@@ -377,7 +399,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	esac
 	exit 0 ;;
     aushp:SunOS:*:*)
-	echo sparc-auspex-sunos${UNAME_RELEASE}
+	echo sparc-auspex-$sun_os_release
 	exit 0 ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
@@ -807,7 +829,7 @@ EOF
 	echo powerpcle-unknown-cygwin
 	exit 0 ;;
     prep*:SunOS:5.*:*)
-	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo powerpcle-unknown-$sun_os_release
 	exit 0 ;;
     *:GNU:*:*)
 	# the GNU system
diff -pru config/config.sub config-sunos/config.sub
--- config/config.sub	Sun Nov 23 21:42:43 2003
+++ config-sunos/config.sub	Wed Dec  3 15:04:23 2003
@@ -1110,15 +1110,27 @@ esac
 
 if [ x"$os" != x"" ]
 then
+
+# Deal with "traditional" names (-solaris*) versus "sunos" names (-sunos*)
+# for SunOS 5.0 through 5.9.  See config.guess for details.
+# If you prefer using "sunos" names uniformly, set
+# CONFIG_PREFERS_SUNOS="true" in your environment,
+# or modify the following line to read "true" rather than "false".
+CONFIG_PREFERS_SUNOS_DEFAULT=false
+CONFIG_PREFERS_SUNOS=${CONFIG_PREFERS_SUNOS-$CONFIG_PREFERS_SUNOS_DEFAULT}
+
 case $os in
         # First match some system type aliases
         # that might get confused with valid system types.
-	# -solaris* is a basic system type, with this one exception.
+	# Traditional -solaris* is a basic system type, with this one exception.
 	-solaris1 | -solaris1.*)
 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
 		;;
 	-solaris)
-		os=-solaris2
+		case "$CONFIG_PREFERS_SUNOS" in
+		    true) os=-sunos5 ;;
+		    *)    os=-solaris2 ;;
+		esac
 		;;
 	-svr4*)
 		os=-sysv4
@@ -1135,6 +1147,7 @@ case $os in
 	# -sysv* is not here because it comes later, after sysvr4.
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+	      | -sunos5.[1-9][0-9]* | -sunos[6-9]* | -sunos[1-9][0-9]* \
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
 	      | -aos* \
@@ -1182,11 +1195,11 @@ case $os in
 	-linux*)
 		os=`echo $os | sed -e 's|linux|linux-gnu|'`
 		;;
-	-sunos5*)
-		os=`echo $os | sed -e 's|sunos5|solaris2|'`
-		;;
-	-sunos6*)
-		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+	-sunos5.[0-9] | -sunos5.[0-9].*)
+		case "$CONFIG_PREFERS_SUNOS" in
+		    true) ;;
+		    *) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;;
+		esac
 		;;
 	-opened*)
 		os=-openedition


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]