X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A539385840A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=t-online.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=t-online.de Subject: Re: Setting up toolchains To: cygwin AT cygwin DOT com References: <3034fa70-ad4c-3e8a-31da-d892c7deb3b7 AT reckeng DOT com> From: =?UTF-8?Q?Hans-Bernhard_Br=c3=b6ker?= Message-ID: <72e93446-9bb8-75a3-8f59-2a20f58138ca@t-online.de> Date: Mon, 27 Sep 2021 23:06:13 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <3034fa70-ad4c-3e8a-31da-d892c7deb3b7@reckeng.com> Content-Language: en-US X-TOI-EXPURGATEID: 150726::1632776777-00001454-D5B3EA89/0/0 CLEAN NORMAL X-TOI-MSGID: f4427573-b6ac-4879-9809-31a3d63599a7 X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Am 27.09.2021 um 13:27 schrieb Anthony Webber: > Anyway, I am trying to set up my gcc toolchains in Cygwin, by which I > mean that I'm trying to set up the environment so that the right > programs are called at the right time by build systems like cmake and > waf, or if I want to build in a more manual fashion. Particularly, I > want to be able to switch between toolchains easily. That's hardly ever a question of "setting up" the toolchains. It's rather a question of a) which build system those programs you're trying to build uses, and b) how you initialize/use said build systems. GNU autoconf and cmake have relatively mature mechanisms for doing this. For autoconf you just pass --host=... to configure, and that takes care of everything (assuming the package is capable of cross-building in the first place). For cmake you can preload a cmake script like this: cmake -C some/where/preload_mingw.cmake ../../path/to/source where preload_mingw.cmake might look like this: set(CMAKE_CXX_COMPILER "/usr/bin/x86_64-w64-mingw32-g++" CACHE FILEPATH "CXX compiler") set(CMAKE_C_COMPILER "/usr/bin/x86_64-w64-mingw32-gcc" CACHE FILEPATH "C compiler") set(CMAKE_CXX_FLAGS "-D_WIN32_WINNT=0x0601" CACHE STRING "") set(CMAKE_C_FLAGS "-D_WIN32_WINNT=0x0601" CACHE STRING "") set(WIN32 "1" CACHE STRING "") The benefit of doing it this way is that the preload script can stay the same for quite a lot of packages, and the system default compiler does not even enter the picture, so there will be no misled tests. -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple