X-Spam-Check-By: sourceware.org Message-ID: <466E2E95.5BDBF088@dessent.net> Date: Mon, 11 Jun 2007 22:26:45 -0700 From: Brian Dessent X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Using a secondary install of gcc/g++ binutils References: <466E2B5D DOT C565B230 AT dessent DOT net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com 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 Brian Dessent wrote: > However, it seems you also want it to not even consider /usr/include and > /usr/lib (or for the case of -mno-cygwin it's actually > /usr/include/mingw and /usr/lib/mingw) and instead use a different tree > alltogether. That is going to take a lot more work, and just changing > --prefix won't do it. I'm not even sure it's possible to build a native > compiler that does not consider /usr/{include,lib} without doing what > you've done already: specify -nostdlib plus -B and a bunch of -L and -I. I forgot to mention that an alternative would be to build gcc as a cross (i.e. --host=i686-pc-cygwin --build=i686-pc-cygwin --target=i686-pc-mingw32) and use --with-sysroot to give the location of the desired isolated copy of the headers/libs. That should produce something that both understands POSIX paths and doesn't look at native headers. You'd invoke it as i686-pc-mingw32-gcc without -mno-cygwin, which fits more gracefully into the autoconf world, as you just configure for a standard cross compile, e.g. "configure --host=i686-pc-mingw32" and it should find and use i686-pc-mingw32-gcc et al. The problem then becomes that since you are essentially cross compiling everything you run into configure scripts that weren't designed to work in cross environments, typically by requiring execute tests instead of just compile or link tests. You can generally work around this by either preloading the cache for such values (e.g. "configure ... cv_foo_bar=yes") or otherwise just faking the build system into actually running the test. Most larger libraries should support cross compilation, so it's only the smaller or less well-tested ones that you'd have to worry about. Yet another workaround, which to my eyes is even yet uglier, is telling autoconf you're doing a native build but using the cross-gcc, e.g. configure CC="i686-pc-mingw32-gcc" CXX="i686-pc-mingw32-g++" I suppose this is no more ugly than what you're doing now by adding -mno-cygwin to CFLAGS, since "gcc -mno-cygwin" is roughly the same in concept as a cross compiler only the results are still executable on the host. Brian -- 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/