diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2010-07-11 19:36:20 (GMT) |
---|---|---|
committer | Bart vdr Meulen <bartvdrmeulen@gmail.com> | 2010-07-11 19:36:20 (GMT) |
commit | b81d232a9bae21ef1bc896f106a926b66dcae869 (patch) | |
tree | f7d5dc20946087204ba17bde901acc70911bbd70 /scripts/build/libc | |
parent | 7707f0fb542406fbfe8b1cf6f80ba488a135314a (diff) |
kernel: add mingw
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
Signed-off-by: Bart vdr Meulen <bartvdrmeulen@gmail.com>
[yann.morin.1998@anciens.enib.fr: fix kernel headers comment, don't "return 0"]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'scripts/build/libc')
-rw-r--r-- | scripts/build/libc/mingw.sh | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/scripts/build/libc/mingw.sh b/scripts/build/libc/mingw.sh new file mode 100644 index 0000000..28d74d6 --- /dev/null +++ b/scripts/build/libc/mingw.sh @@ -0,0 +1,74 @@ +do_libc_get() { + CT_GetFile "mingwrt-${CT_MINGWRT_VERSION}-mingw32-src" \ + http://downloads.sourceforge.net/sourceforge/mingw +} + +do_libc_extract() { + CT_Extract "mingwrt-${CT_MINGWRT_VERSION}-mingw32-src" +} + +do_libc_check_config() { + : +} + +do_libc_headers() { + CT_DoStep INFO "Installing C library headers" + + CT_DoLog EXTRA "Installing MinGW Runtime headers" + mkdir -p "${CT_SYSROOT_DIR}/include" + cp -r ${CT_SRC_DIR}/mingwrt-${CT_MINGWRT_VERSION}-mingw32/include \ + ${CT_SYSROOT_DIR} + + CT_EndStep +} + +do_libc_start_files() { + : +} + +do_libc() { + CT_DoStep INFO "Building MinGW files" + + CT_DoLog EXTRA "Configuring W32-API" + + mkdir -p "${CT_BUILD_DIR}/build-w32api" + cd "${CT_BUILD_DIR}/build-w32api" + + CFLAGS="-I${CT_SYSROOT_DIR}/include" \ + LDFLAGS="-L${CT_SYSROOT_DIR}/lib" \ + CT_DoExecLog ALL \ + "${CT_SRC_DIR}/w32api-${CT_W32API_VERSION}-mingw32/configure" \ + --prefix=${CT_SYSROOT_DIR} \ + --host=${CT_TARGET} + + CT_DoLog EXTRA "Building W32-API" + CT_DoExecLog ALL make ${PARALLELMFLAGS} + + CT_DoLog EXTRA "Installing W32-API" + CT_DoExecLog ALL make install + + CT_DoLog EXTRA "Configuring MinGW Runtime" + + mkdir -p "${CT_BUILD_DIR}/build-mingwrt" + cd "${CT_BUILD_DIR}/build-mingwrt" + + CFLAGS="-I${CT_SYSROOT_DIR}/include" \ + LDFLAGS="-L${CT_SYSROOT_DIR}/lib" \ + CT_DoExecLog ALL \ + "${CT_SRC_DIR}/mingwrt-${CT_MINGWRT_VERSION}-mingw32/configure" \ + --prefix=${CT_SYSROOT_DIR}/ \ + --host=${CT_TARGET} + + CT_DoLog EXTRA "Building MinGW Runtime" + CT_DoExecLog ALL make ${PARALLELMFLAGS} + + CT_DoLog EXTRA "Installing MinGW Runtime" + CT_DoExecLog ALL make install + + CT_EndStep +} + +do_libc_finish() { + : +} + |