From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31473 invoked by alias); 11 Apr 2010 15:25:23 -0000 Received: (qmail 31455 invoked by uid 22791); 11 Apr 2010 15:25:22 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtp19.orange.fr (HELO smtp19.orange.fr) (80.12.242.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 11 Apr 2010 15:25:11 +0000 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1906.orange.fr (SMTP Server) with ESMTP id E4087200025A; Sun, 11 Apr 2010 17:25:08 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1906.orange.fr (SMTP Server) with ESMTP id D20A620004F5; Sun, 11 Apr 2010 17:25:08 +0200 (CEST) Received: from [192.168.127.10] (ARennes-256-1-137-34.w90-32.abo.wanadoo.fr [90.32.248.34]) by mwinf1906.orange.fr (SMTP Server) with ESMTP id 92D22200025A; Sun, 11 Apr 2010 17:25:08 +0200 (CEST) From: "Yann E. MORIN" To: crossgcc@sourceware.org Subject: Re: [CT-NG:patch 11/19] Add mingw as kernel type Date: Sun, 11 Apr 2010 15:25:00 -0000 User-Agent: KMail/1.9.9 Cc: Remy Bohmer , "Bart vdr. Meulen" References: <20100409190419.325379428@bohmer.net> <20100409190419.325379428@bohmer.net>> <4bbf8112.0d67f10a.7b99.6161@mx.google.com> In-Reply-To: <4bbf8112.0d67f10a.7b99.6161@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201004111725.08131.yann.morin.1998@anciens.enib.fr> X-IsSubscribed: yes Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00087.txt.bz2 Remy, Bart, All, On Friday 09 April 2010 21:04:30 Remy Bohmer wrote: > Add the option to build a cross-compiler for kernel type 'mingw'. > The resulting cross-compiler can be used to build applications on a Linux host > that can be run on a Windows target. > > Compiler is build using the mingwrt and w32-api packages aviable from the > MinGW project (http://sourceforge.net/projects/mingw). > > The windows headers (w32-api package) are extracting with the kernel_headers > step The libraries and other headers from both packages are build and > installed in the various steps of libc [--SNIP--] > Index: crosstool-ng/config/kernel/mingw32.in > =================================================================== > --- /dev/null > +++ crosstool-ng/config/kernel/mingw32.in > @@ -0,0 +1,33 @@ > +# Bare metal config options > + > +config KERNEL_mingw32 > + select MINGW32 > + help > + Build a toolchain targeting systems running Windows as host > + > +choice > + bool > + prompt "Windows api version" > + > +config W32API_V_3_13 > + bool > + prompt "3.13" > + > +# CT_INSERT_VERSION_ABOVE > +# Don't remove above line! This is now the opposite: CT_INSERT_VERSION_BELOW Eg., see in config/cc/gcc.in > + > +config W32API_V_select > + bool > + prompt "Other version" > + > +endchoice > + > +config W32API_VERSION > + string > + prompt "W32 api version" if W32API_V_select > + default "3.13" if W32API_V_3_13 > +# CT_INSERT_VERSION_STRING_ABOVE > +# Don't remove above line! Ditto. > + help > + Enter the version number of the windows api files to use > + [--SNIP--] > Index: crosstool-ng/config/libc/mingw.in > =================================================================== > --- /dev/null > +++ crosstool-ng/config/libc/mingw.in > @@ -0,0 +1,35 @@ > +# mingw options > +# depends on MINGW32 > + > +config LIBC_mingw > + bool > + select LIBC_SUPPORT_WIN32THREADS > + help > + The de-facto standard for Mingw distributions. > + > +choice > + bool > + prompt "Mingw runtime version" > + > +config MINGWRT_V_3_15_2 > + bool > + prompt "3.15.2" > + > +# CT_INSERT_VERSION_ABOVE > +# Don't remove above line! Ditto. > + > +config MINGWRT_V_select > + bool > + prompt "Other version" > + > +endchoice > + > +config MINGWRT_VERSION > + string > + prompt "Mingw runtime version" if MINGWRT_V_select > + default "3.15.2" if MINGWRT_V_3_15_2 > +# CT_INSERT_VERSION_STRING_ABOVE > +# Don't remove above line! Ditto. > + help > + Enter the version number of the mingw runtime files to use > + [--SNIP--] > Index: crosstool-ng/scripts/build/cc/gcc.sh > =================================================================== > --- crosstool-ng.orig/scripts/build/cc/gcc.sh > +++ crosstool-ng/scripts/build/cc/gcc.sh > @@ -68,6 +68,8 @@ do_cc_core_pass_2() { > ,,nptl) > do_cc_core mode=shared build_libgcc=yes > ;; > + ,,win32) do_cc_core mode=static build_libgcc=yes > + ;; > *) if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then > do_cc_core mode=static build_libgcc=yes > else > @@ -317,7 +319,12 @@ do_cc() { > extra_config+=("--disable-libgomp") > fi > else > - extra_config+=("--enable-threads=posix") > + if [ "${CT_THREADS}" = "win32" ]; then > + extra_config+=("--enable-threads=win32") > + extra_config+=("--disable-win32-registry") > + else > + extra_config+=("--enable-threads=posix") > + fi Space-damage: use spaces, not tabs. > fi > > CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'" > Index: crosstool-ng/scripts/build/kernel/mingw32.sh > =================================================================== > --- /dev/null > +++ crosstool-ng/scripts/build/kernel/mingw32.sh > @@ -0,0 +1,30 @@ > +# This file declares functions to install the kernel headers for mingw > +# Copyright 2009 Bart vdr. Meulen > +# Licensed under the GPL v2. See COPYING in the root of this package > + > +CT_DoKernelTupleValues() { > + CT_TARGET_KERNEL="mingw32" > + CT_TARGET_SYS= > +} > + > +do_kernel_get() { > + CT_GetFile "w32api-${CT_W32API_VERSION}-mingw32-src" \ > + http://downloads.sourceforge.net/sourceforge/mingw > + > + return 0 > +} > + > +do_kernel_extract() { > + CT_Extract "w32api-${CT_W32API_VERSION}-mingw32-src" > + return 0 > +} > + > +do_kernel_headers() { > + CT_DoStep INFO "Installing kernel headers" > + > + mkdir -p "${CT_SYSROOT_DIR}/include" > + cp -r ${CT_SRC_DIR}/w32api-${CT_W32API_VERSION}-mingw32/include \ > + ${CT_SYSROOT_DIR} > + > + CT_EndStep Space-damage: bad indent. > +} > Index: crosstool-ng/scripts/build/libc/mingw.sh > =================================================================== > --- /dev/null > +++ crosstool-ng/scripts/build/libc/mingw.sh > @@ -0,0 +1,75 @@ > +do_libc_get() { > + CT_GetFile "mingwrt-${CT_MINGWRT_VERSION}-mingw32-src" \ > + http://downloads.sourceforge.net/sourceforge/mingw > +} > + > +do_libc_extract() { > + Un-needed empty line. [--SNIP--] Globally looks good. Care to address the few issues? Thank you! Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' -- For unsubscribe information see http://sourceware.org/lists.html#faq