HOST_CROSS_windows-x86.mk revision 7728817ab9cf9ba97ab8a8d6df27324ea7ccb0c2
1#
2# Copyright (C) 2006 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17# Settings to use MinGW as a cross-compiler under Linux
18# Included by combo/select.make
19
20$(combo_var_prefix)GLOBAL_CFLAGS += -DUSE_MINGW -DWIN32_LEAN_AND_MEAN
21$(combo_var_prefix)GLOBAL_CFLAGS += -Wno-unused-parameter
22$(combo_var_prefix)GLOBAL_CFLAGS += --sysroot=prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32
23$(combo_var_prefix)GLOBAL_CFLAGS += -m32
24$(combo_var_prefix)GLOBAL_LDFLAGS += -m32
25TOOLS_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/bin/x86_64-w64-mingw32-
26$(combo_var_prefix)C_INCLUDES += prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32/include
27$(combo_var_prefix)C_INCLUDES += prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/lib/gcc/x86_64-w64-mingw32/4.8.3/include
28$(combo_var_prefix)GLOBAL_LD_DIRS += -Lprebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32/lib32
29
30# Workaround differences in inttypes.h between host and target.
31# See bug 12708004.
32$(combo_var_prefix)GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
33# Use C99-compliant printf functions (%zd).
34$(combo_var_prefix)GLOBAL_CFLAGS += -D__USE_MINGW_ANSI_STDIO=1
35# Admit to using >= Win2K.
36$(combo_var_prefix)GLOBAL_CFLAGS += -D_WIN32_WINNT=0x0500
37# Get 64-bit off_t and related functions.
38$(combo_var_prefix)GLOBAL_CFLAGS += -D_FILE_OFFSET_BITS=64
39
40$(combo_var_prefix)CC := $(TOOLS_PREFIX)gcc
41$(combo_var_prefix)CXX := $(TOOLS_PREFIX)g++
42$(combo_var_prefix)AR := $(TOOLS_PREFIX)ar
43
44$(combo_var_prefix)GLOBAL_LDFLAGS += \
45    --enable-stdcall-fixup
46
47ifneq ($(strip $(BUILD_HOST_static)),)
48# Statically-linked binaries are desirable for sandboxed environment
49$(combo_var_prefix)GLOBAL_LDFLAGS += -static
50endif # BUILD_HOST_static
51
52$(combo_var_prefix)SHLIB_SUFFIX := .dll
53$(combo_var_prefix)EXECUTABLE_SUFFIX := .exe
54
55$(combo_var_prefix)IS_64_BIT :=
56