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: <49AB4195.10101@gmail.com> Date: Mon, 02 Mar 2009 02:16:53 +0000 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Copy, rename, or what "gcc-4" to "gcc" References: <120849C396EC4056932F6397CF49B9A9 AT WMK> In-Reply-To: <120849C396EC4056932F6397CF49B9A9@WMK> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Bill Klein wrote: > When I did a complete re-install of Cygwin and selected ONLY the gcc4 > packages (core, C compiler, g++) after the install was done, I had a "gcc-4" > executable in my /bin directory, but no "gcc" executable. When I install > V3, I get both gcc-3 and gcc. Yes, gcc-4 has always supplied only a gcc-4 executable. 'gcc' used to be the gcc-3 exe, now it's a symlink via the alternatives system to get there. > If I just want gcc4, am I supposed to copy gcc-4 to gcc (or rename it) or > something else? No, you're not supposed to do that, you're supposed to use it with that name directly. The conventional way is to add "CC=gcc-4" (and maybe "CXX=g++-4" to your configure command line, or makefile flags, depending on how the build system for the code you're working with operates. > Is it intentional that when running setup, if you ONLY select gcc4, that you > won't end up with any "gcc" executable? Yep. It's always been that way. There is no way to ship two different "gcc.exe"s in two different distros, so the name "gcc.exe" has so far belonged to the gcc-3 version. > If not, is there some documentation > on making certain that you end up with "valid executables" (with the > expected names, if you only want gcc4? With this update, absolutely nothing has changed in the way you have been using gcc up until now. With the next gcc-4 update, options will be added to the alternatives system to allow gcc-4 to indeed become the one true "gcc.exe". Until now, creating a copy of gcc-4.exe, or a symlink to it, has been the only way to have v4 as the plain "gcc.exe", and that would have broken gcc-3 - until now, when there's a version-suffixed gcc-3. If you really can't wait, you could set up some alternatives by hand, by following these steps: 1. Create a file "/etc/setup/preremove/gcc4-core.sh", with this content: #!/bin/bash /usr/sbin/update-alternatives \ --remove "gcc" "/usr/bin/gcc-4.exe" 2. Create another file "/etc/setup/preremove/gcc4-g++.sh", with this: #!/bin/bash /usr/sbin/update-alternatives \ --remove "g++" "/usr/bin/g++-4.exe" 3. Run the following two commands at the commandline: /usr/sbin/update-alternatives \ --install "/usr/bin/g++.exe" "g++" "/usr/bin/g++-4.exe" 30 \ --slave "/usr/bin/c++.exe" "c++" "/usr/bin/c++-4.exe" \ --slave "/usr/bin/i686-pc-cygwin-c++.exe" "i686-pc-cygwin-c++" \ "/usr/bin/i686-pc-cygwin-c++-4.exe" \ --slave "/usr/bin/i686-pc-cygwin-g++.exe" "i686-pc-cygwin-g++" \ "/usr/bin/i686-pc-cygwin-g++-4.exe" \ --slave "/usr/share/man/man1/g++.1.gz" "g++.1.gz" \ "/usr/share/man/man1/g++-4.1.gz" /usr/sbin/update-alternatives \ --install "/usr/bin/g++.exe" "g++" "/usr/bin/g++-4.exe" 30 \ --slave "/usr/bin/c++.exe" "c++" "/usr/bin/c++-4.exe" \ --slave "/usr/bin/i686-pc-cygwin-c++.exe" "i686-pc-cygwin-c++" \ "/usr/bin/i686-pc-cygwin-c++-4.exe" \ --slave "/usr/bin/i686-pc-cygwin-g++.exe" "i686-pc-cygwin-g++" \ "/usr/bin/i686-pc-cygwin-g++-4.exe" \ --slave "/usr/share/man/man1/g++.1.gz" "g++.1.gz" \ "/usr/share/man/man1/g++-4.1.gz" You can then switch gcc and g++ separately (but should almost certainly always switch both at once) to default to either -3 or -4 by running "/usr/sbin/update-alternatives --config gcc" or "/usr/sbin/update-alternatives --config g++". The gcc-4.3.2-2 release will have a script to handle switching all the sub-languages for you simultaneously. cheers, DaveK -- 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/