HOST_windows-x86.mk revision dc64c7b460c5ba3578d2531c33da1df6cc2e4c26
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# Configuration for Linux on x86.
18# Included by combo/select.make
19
20# right now we get these from the environment, but we should
21# pick them from the tree somewhere
22TOOLS_PREFIX := #prebuilt/windows/host/bin/
23TOOLS_EXE_SUFFIX := .exe
24
25# Settings to use MinGW has a cross-compiler under Linux
26ifneq ($(findstring Linux,$(UNAME)),)
27ifneq ($(strip $(USE_MINGW)),)
28HOST_ACP_UNAVAILABLE := true
29TOOLS_EXE_SUFFIX :=
30$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -DUSE_MINGW
31$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -Wno-unused-parameter
32$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += --sysroot=prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32
33$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -m32
34$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -m32
35TOOLS_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/bin/x86_64-w64-mingw32-
36$(combo_2nd_arch_prefix)HOST_C_INCLUDES += prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32/include
37$(combo_2nd_arch_prefix)HOST_C_INCLUDES += prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/lib/gcc/x86_64-w64-mingw32/4.8.3/include
38$(combo_2nd_arch_prefix)HOST_GLOBAL_LD_DIRS += -Lprebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32/lib32
39endif # USE_MINGW
40endif # Linux
41
42# Workaround differences in inttypes.h between host and target.
43# See bug 12708004.
44$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D__USE_MINGW_ANSI_STDIO
45
46$(combo_2nd_arch_prefix)HOST_CC := $(TOOLS_PREFIX)gcc$(TOOLS_EXE_SUFFIX)
47$(combo_2nd_arch_prefix)HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX)
48$(combo_2nd_arch_prefix)HOST_AR := $(TOOLS_PREFIX)ar$(TOOLS_EXE_SUFFIX)
49
50$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += \
51    -include $(call select-android-config-h,windows)
52$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += \
53    --enable-stdcall-fixup
54
55ifneq ($(strip $(BUILD_HOST_static)),)
56# Statically-linked binaries are desirable for sandboxed environment
57$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -static
58endif # BUILD_HOST_static
59
60# when building under Cygwin, ensure that we use Mingw compilation by default.
61# you can disable this (i.e. to generate Cygwin executables) by defining the
62# USE_CYGWIN variable in your environment, e.g.:
63#
64#   export USE_CYGWIN=1
65#
66# note that the -mno-cygwin flags are not needed when cross-compiling the
67# Windows host tools on Linux
68#
69ifneq ($(findstring CYGWIN,$(UNAME)),)
70ifeq ($(strip $(USE_CYGWIN)),)
71$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -mno-cygwin
72$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -mno-cygwin -mconsole
73endif
74endif
75
76############################################################
77## Macros after this line are shared by the 64-bit config.
78
79HOST_SHLIB_SUFFIX := .dll
80HOST_EXECUTABLE_SUFFIX := .exe
81
82# $(1): The file to check
83# TODO: find out what format cygwin's stat(1) uses
84define get-file-size
85999999999
86endef
87