www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/03/25/15:05:37

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <49CA90D2.9080809@gmail.com>
Date: Wed, 25 Mar 2009 20:15:14 +0000
From: Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: [Re: GCC 4 installation problem]
References: <49CA8243 DOT 2090908 AT encelade DOT com>
In-Reply-To: <49CA8243.2090908@encelade.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------080505030209040807090307
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Vincent De Groote wrote:
> 
> 
> Help request cancelled.
> The symbolic link was not built properly (I forgot the -s argument)

  Sounds more to me like you forgot to use the alternatives program to
configure the alternatives and have been messing around manually in its
private data directories and broken it.

  (You're not the first person to do this.  For some reason it seems to be a
hard-to-resist temptation for people to just dive into the data directories
and start tampering, rather than say reading the alternatives readme or
man/info page which would explain the easy-to-use command-line syntax by which
alternatives.exe will switch over the symlinks correctly.)

  Probably the easiest way to repair it would be to manually run all the
/etc/preremove/ scripts to uninstall the alternatives links, then run the
/etc/postinstall/ scripts to re-create them.  You'll need to run these files:

/etc/preremove/gcc-g++.sh
/etc/preremove/gcc-g77.sh
/etc/preremove/gcc-gdc.sh
/etc/preremove/gcc-gnat.sh
/etc/preremove/gcc-gpc.sh
/etc/preremove/gcc-java.sh
/etc/preremove/gcc.sh
/etc/preremove/gcc4-ada.sh
/etc/preremove/gcc4-core.sh
/etc/preremove/gcc4-fortran.sh
/etc/preremove/gcc4-g++.sh
/etc/preremove/gcc4-java.sh

and then these files:

/etc/postinstall/gcc-g++.sh.done
/etc/postinstall/gcc-g77.sh.done
/etc/postinstall/gcc-gdc.sh.done
/etc/postinstall/gcc-gnat.sh.done
/etc/postinstall/gcc-gpc.sh.done
/etc/postinstall/gcc-java.sh.done
/etc/postinstall/gcc.sh.done
/etc/postinstall/gcc4-ada.sh.done
/etc/postinstall/gcc4-core.sh.done
/etc/postinstall/gcc4-fortran.sh.done
/etc/postinstall/gcc4-g++.sh.done
/etc/postinstall/gcc4-java.sh.done

which should work if you just cut and paste those lists into a bash shell.

  Attached are the two scripts that will ship with the next release of GCC to
manage switching all the alternatives at once to select either gcc-3 or gcc-4
as the default compiler, just to show everyone the proper way how to drive the
alternatives system from an end-user's point of view.

    cheers,
      DaveK

--------------080505030209040807090307
Content-Type: text/plain;
 name="set-gcc-default-4.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="set-gcc-default-4.sh"

#!/bin/bash

# We only switch the alternatives that exist for both compilers;
# gdc, gpc, g77 and gfortran never get switched.

for x in gcc g++ gcj gnat ; do
  /usr/sbin/alternatives --set $x /usr/bin/$x-4.exe
done

--------------080505030209040807090307
Content-Type: text/plain;
 name="set-gcc-default-3.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="set-gcc-default-3.sh"

#!/bin/bash

# We only switch the alternatives that exist for both compilers;
# gdc, gpc, g77 and gfortran never get switched.

for x in gcc g++ gcj gnat ; do
  /usr/sbin/alternatives --set $x /usr/bin/$x-3.exe
done


--------------080505030209040807090307
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
--------------080505030209040807090307--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019