bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] Re: config.guess misidentifies Solaris 7 through 9 (and pro


From: Paul Eggert
Subject: [Bug-gnulib] Re: config.guess misidentifies Solaris 7 through 9 (and probably 10)
Date: 22 Jul 2003 16:26:51 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

This email follows up on a 6-month-old topic.

In January RMS asked me to bug <address@hidden> about fixing
config.guess and config.sub to identify Solaris version numbers
properly.  The problem is that config.guess misidentifies Solaris 7,
8, and 9, and it will probably misidentify Solaris 10 (unless Sun
marketing changes Solaris names again).  For example, on a Solaris 8
box, config.guess outputs "sparc-sun-solaris2.8"; but there never was
and never will be a "Solaris 2.8", as Solaris 2.6 (SunOS 5.6) was
immediately followed by Solaris 7 (SunOS 5.7).

Ben Elliston replied:

> Date: 13 Jan 2003 22:23:55 +1100
> 
> Whoa -- the GCC project imports config.guess almost on a weekly basis.
> It would be unreasonable to change config.guess and break GCC without
> at least discussing this with them.  I think they will be amenable to
> the change, but I'd like you to discuss it with address@hidden first.
> Agreed?

I agreed that there was no rush, since we're talking about the Emacs
after the next Emacs, but I'd like to raise the issue again and ask
what progress was made on the gcc front.  I looked for a discussion of
this in <http://gcc.gnu.org/ml/gcc/2003-01/> but didn't find anything,
perhaps because I used the wrong keywords to search for it.

I'm asking because this issue recently came up with gnulib
<http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00075.html>
and I was trying to fix all Solaris version misidentifications in
gnulib.  gnulib has config.guess, so....

Anyway, here's a proposed patch against the current versions of
config.guess and config.sub.

2003-07-22  Paul Eggert  <address@hidden>

        SunOS 5.X is Solaris X for X = 7, 8, 9.  Guess that this will also
        happen for X = 10, though one never knows with Sun marketing.
        * config.guess (solaris_version_sed): New var.
        (sun4H:SunOS:5.*:*, sun4*:SunOS:5.*:*, tadpole*:SunOS:5.*:*,
        i86pc:SunOS:5.*:*, prep*:SunOS:5.*:*): Use it.
        (sun4*:SunOS:6*:*): Remove; SunOS6 does not exist, and may never exist.
        * config.sub (-sunos6*): Remove; likewise.
        (-sunos5*): Use correct Solaris numbering.
        (-solaris2.[789]): Normalize these old names to the new ones.

diff -pu config/config.guess config-solaris/config.guess
--- config/config.guess Tue Jul  8 14:16:47 2003
+++ config-solaris/config.guess Tue Jul 22 16:10:11 2003
@@ -131,6 +131,14 @@ if (test -f /.attbin/uname) >/dev/null 2
        PATH=$PATH:/.attbin ; export PATH
 fi
 
+solaris_version_sed='
+    s/^[^0-9]*//
+    s/^5\./ 2./
+    s/^ 2\.\([789]\)/\1/
+    s/^ 2\.\([1-9][0-9]\)/\1/
+    s/^ //
+'
+
 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
@@ -332,19 +340,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
            sparc) echo sparc-icl-nx7 && exit 0 ;;
        esac ;;
     sun4H:SunOS:5.*:*)
-       echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo sparc-hal-solaris`echo ${UNAME_RELEASE}|sed -e 
"$solaris_version_sed"`
        exit 0 ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo sparc-sun-solaris`echo ${UNAME_RELEASE}|sed -e 
"$solaris_version_sed"`
        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/[^.]*//'`
+       echo i386-pc-solaris`echo ${UNAME_RELEASE}|sed -e 
"$solaris_version_sed"`
        exit 0 ;;
     sun4*:SunOS:*:*)
        case "`/usr/bin/arch -k`" in
@@ -796,7 +798,7 @@ EOF
        echo powerpcle-unknown-cygwin
        exit 0 ;;
     prep*:SunOS:5.*:*)
-       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 
's/[^.]*//'`
+       echo powerpcle-unknown-solaris`echo ${UNAME_RELEASE}|sed -e 
"$solaris_version_sed"`
        exit 0 ;;
     *:GNU:*:*)
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo 
${UNAME_RELEASE}|sed -e 's,/.*$,,'`
diff -pu config/config.sub config-solaris/config.sub
--- config/config.sub   Tue Jul 22 16:07:03 2003
+++ config-solaris/config.sub   Tue Jul 22 16:10:11 2003
@@ -1102,10 +1102,13 @@ then
 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.
+       # -solaris* is a basic system type, with these exceptions.
        -solaris1 | -solaris1.*)
                os=`echo $os | sed -e 's|solaris1|sunos4|'`
                ;;
+       -solaris2.[789])
+               os=`echo "$os" | sed -e 's/2\.//'`
+               ;;
        -solaris)
                os=-solaris2
                ;;
@@ -1169,10 +1172,12 @@ case $os in
                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|'`
+               solaris_version_sed='
+                   s/^-sunos5\.\([789]\)/-solaris\1/
+                   s/^-sunos5\.\([1-9][0-9]\)/-solaris\1/
+                   s/^-sunos5/-solaris2/
+               '
+               os=`echo $os | sed -e "$solaris_version_sed"`
                ;;
        -opened*)
                os=-openedition




reply via email to

[Prev in Thread] Current Thread [Next in Thread]