2012-11-14 13:05:49 +00:00
|
|
|
# Copyright 2012 Yann Diorcet
|
|
|
|
# Licensed under the GPL v2. See COPYING in the root of this package
|
|
|
|
|
|
|
|
do_libc_get() {
|
|
|
|
CT_GetFile "mingw-w64-v${CT_WINAPI_VERSION}" \
|
|
|
|
http://downloads.sourceforge.net/sourceforge/mingw-w64
|
2010-07-11 19:36:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_libc_extract() {
|
2012-11-14 13:05:49 +00:00
|
|
|
CT_Extract "mingw-w64-v${CT_WINAPI_VERSION}"
|
|
|
|
CT_Pushd "${CT_SRC_DIR}/mingw-w64-v${CT_WINAPI_VERSION}/"
|
|
|
|
CT_Patch nochdir mingw-w64 "${CT_WINAPI_VERSION}"
|
|
|
|
CT_Popd
|
2010-07-11 19:36:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_libc_check_config() {
|
|
|
|
:
|
|
|
|
}
|
|
|
|
|
2015-03-24 14:07:51 +00:00
|
|
|
do_set_mingw_install_prefix(){
|
|
|
|
MINGW_INSTALL_PREFIX=/usr/${CT_TARGET}
|
|
|
|
if [[ ${CT_WINAPI_VERSION} == 2* ]]; then
|
|
|
|
MINGW_INSTALL_PREFIX=/usr
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2011-01-22 21:32:44 +00:00
|
|
|
do_libc_start_files() {
|
2012-11-14 13:05:49 +00:00
|
|
|
local -a sdk_opts
|
|
|
|
|
2010-07-11 19:36:20 +00:00
|
|
|
CT_DoStep INFO "Installing C library headers"
|
|
|
|
|
2012-11-14 13:05:49 +00:00
|
|
|
case "${CT_MINGW_DIRECTX}:${CT_MINGW_DDK}" in
|
|
|
|
y:y) sdk_opts+=( "--enable-sdk=all" );;
|
|
|
|
y:) sdk_opts+=( "--enable-sdk=directx" );;
|
|
|
|
:y) sdk_opts+=( "--enable-sdk=ddk" );;
|
|
|
|
:) ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-mingw-w64-headers"
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Configuring Headers"
|
|
|
|
|
2015-03-24 14:07:51 +00:00
|
|
|
do_set_mingw_install_prefix
|
2012-11-14 13:05:49 +00:00
|
|
|
CT_DoExecLog CFG \
|
|
|
|
"${CT_SRC_DIR}/mingw-w64-v${CT_WINAPI_VERSION}/mingw-w64-headers/configure" \
|
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${CT_TARGET} \
|
2015-03-24 14:07:51 +00:00
|
|
|
--prefix=${MINGW_INSTALL_PREFIX} \
|
2012-11-14 13:05:49 +00:00
|
|
|
"${sdk_opts[@]}"
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Compile Headers"
|
|
|
|
CT_DoExecLog ALL make
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Installing Headers"
|
|
|
|
CT_DoExecLog ALL make install DESTDIR=${CT_SYSROOT_DIR}
|
2015-03-24 14:07:51 +00:00
|
|
|
|
2012-11-14 13:05:49 +00:00
|
|
|
CT_Popd
|
2011-01-25 23:04:41 +00:00
|
|
|
|
|
|
|
# It seems mingw is strangely set up to look into /mingw instead of
|
|
|
|
# /usr (notably when looking for the headers). This symlink is
|
|
|
|
# here to workaround this, and seems to be here to last... :-/
|
2012-11-14 13:05:49 +00:00
|
|
|
CT_DoExecLog ALL ln -sv "usr/${CT_TARGET}" "${CT_SYSROOT_DIR}/mingw"
|
2010-07-11 19:36:20 +00:00
|
|
|
|
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
|
2015-03-24 14:07:51 +00:00
|
|
|
do_check_mingw_vendor_tuple()
|
|
|
|
{
|
|
|
|
if [[ ${CT_WINAPI_VERSION} == 4* ]]; then
|
|
|
|
CT_DoStep INFO "Checking vendor tuple configured in crosstool-ng .config"
|
|
|
|
if [[ ${CT_TARGET_VENDOR} == w64 ]]; then
|
|
|
|
CT_DoLog EXTRA "The tuple is set to '${CT_TARGET_VENDOR}', as recommended by mingw-64 team."
|
|
|
|
else
|
|
|
|
CT_DoLog WARN "WARNING! The tuple '${CT_TARGET_VENDOR}', is not equal to w64 and might break the toolchain! WARNING!"
|
|
|
|
fi
|
|
|
|
CT_EndStep
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2010-07-11 19:36:20 +00:00
|
|
|
do_libc() {
|
2015-03-24 14:07:51 +00:00
|
|
|
do_check_mingw_vendor_tuple
|
|
|
|
|
2012-11-14 13:05:49 +00:00
|
|
|
CT_DoStep INFO "Building mingw-w64 files"
|
2010-07-11 19:36:20 +00:00
|
|
|
|
2012-11-14 13:05:49 +00:00
|
|
|
CT_DoLog EXTRA "Configuring mingw-w64-crt"
|
2010-07-11 19:36:20 +00:00
|
|
|
|
2012-11-14 13:05:49 +00:00
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-mingw-w64-crt"
|
2010-07-11 19:36:20 +00:00
|
|
|
|
2015-03-24 14:07:51 +00:00
|
|
|
do_set_mingw_install_prefix
|
2012-11-14 13:05:49 +00:00
|
|
|
CT_DoExecLog CFG \
|
|
|
|
"${CT_SRC_DIR}/mingw-w64-v${CT_WINAPI_VERSION}/mingw-w64-crt/configure" \
|
2015-04-07 09:04:39 +00:00
|
|
|
--with-sysroot=${CT_SYSROOT_DIR} \
|
2015-03-24 14:07:51 +00:00
|
|
|
--prefix=${MINGW_INSTALL_PREFIX} \
|
2012-11-14 13:05:49 +00:00
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${CT_TARGET} \
|
2010-07-11 19:36:20 +00:00
|
|
|
|
2012-11-14 13:05:49 +00:00
|
|
|
CT_DoLog EXTRA "Building mingw-w64-crt"
|
2011-01-22 21:35:43 +00:00
|
|
|
CT_DoExecLog ALL make ${JOBSFLAGS}
|
2010-07-11 19:36:20 +00:00
|
|
|
|
2012-11-14 13:05:49 +00:00
|
|
|
CT_DoLog EXTRA "Installing mingw-w64-crt"
|
|
|
|
CT_DoExecLog ALL make install DESTDIR=${CT_SYSROOT_DIR}
|
2010-07-11 19:36:20 +00:00
|
|
|
|
|
|
|
CT_EndStep
|
|
|
|
}
|