HOST_windows-x86.mk revision 9b4a81237be29b0aae50d1e370b63a07ea2b88b9
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_PREFIX := /usr/bin/i586-mingw32msvc-
30TOOLS_EXE_SUFFIX :=
31HOST_GLOBAL_CFLAGS += -DUSE_MINGW
32HOST_C_INCLUDES += /usr/lib/gcc/i586-mingw32msvc/3.4.4/include
33HOST_GLOBAL_LD_DIRS += -L/usr/i586-mingw32msvc/lib
34endif
35endif
36
37HOST_CC := $(TOOLS_PREFIX)gcc$(TOOLS_EXE_SUFFIX)
38HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX)
39HOST_AR := $(TOOLS_PREFIX)ar$(TOOLS_EXE_SUFFIX)
40
41HOST_GLOBAL_CFLAGS += -include $(call select-android-config-h,windows)
42HOST_GLOBAL_LDFLAGS += --enable-stdcall-fixup
43
44# when building under Cygwin, ensure that we use Mingw compilation by default.
45# you can disable this (i.e. to generate Cygwin executables) by defining the
46# USE_CYGWIN variable in your environment, e.g.:
47#
48#   export USE_CYGWIN=1
49#
50# note that the -mno-cygwin flags are not needed when cross-compiling the
51# Windows host tools on Linux
52#
53ifneq ($(findstring CYGWIN,$(UNAME)),)
54ifeq ($(strip $(USE_CYGWIN)),)
55HOST_GLOBAL_CFLAGS += -mno-cygwin
56HOST_GLOBAL_LDFLAGS += -mno-cygwin -mconsole
57endif
58endif
59
60HOST_SHLIB_SUFFIX := .dll
61HOST_EXECUTABLE_SUFFIX := .exe
62
63# $(1): The file to check
64# TODO: find out what format cygwin's stat(1) uses
65define get-file-size
66999999999
67endef
68