From b81d232a9bae21ef1bc896f106a926b66dcae869 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 11 Jul 2010 21:36:20 +0200 Subject: 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 [yann.morin.1998@anciens.enib.fr: fix kernel headers comment, don't "return 0"] Signed-off-by: "Yann E. MORIN" --- scripts/build/libc/mingw.sh | 74 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 scripts/build/libc/mingw.sh (limited to 'scripts/build/libc') diff --git a/scripts/build/libc/mingw.sh b/scripts/build/libc/mingw.sh new file mode 100644 index 00000000..28d74d66 --- /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() { + : +} + -- cgit v1.2.3