blob: 4d871d879dd229383b2001d06c2997781962e705 [file] [log] [blame]
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -08001#
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
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -080029TOOLS_EXE_SUFFIX :=
Ying Wang6feb6d52014-04-17 10:03:35 -070030$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -DUSE_MINGW
Andrew Hsiehed6b8152012-02-27 21:03:30 -080031TOOLS_PREFIX := /usr/bin/i586-mingw32msvc-
Ying Wang6feb6d52014-04-17 10:03:35 -070032$(combo_2nd_arch_prefix)HOST_C_INCLUDES += /usr/lib/gcc/i586-mingw32msvc/3.4.4/include
33$(combo_2nd_arch_prefix)HOST_GLOBAL_LD_DIRS += -L/usr/i586-mingw32msvc/lib
Andrew Hsiehed6b8152012-02-27 21:03:30 -080034endif # USE_MINGW
35endif # Linux
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -080036
Ian Rogers694b2b72014-01-29 21:37:37 -080037# Workaround differences in inttypes.h between host and target.
38# See bug 12708004.
Ying Wang6feb6d52014-04-17 10:03:35 -070039$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D__USE_MINGW_ANSI_STDIO
Ian Rogers694b2b72014-01-29 21:37:37 -080040
Ying Wang6feb6d52014-04-17 10:03:35 -070041$(combo_2nd_arch_prefix)HOST_CC := $(TOOLS_PREFIX)gcc$(TOOLS_EXE_SUFFIX)
42$(combo_2nd_arch_prefix)HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX)
43$(combo_2nd_arch_prefix)HOST_AR := $(TOOLS_PREFIX)ar$(TOOLS_EXE_SUFFIX)
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -080044
Ying Wang6feb6d52014-04-17 10:03:35 -070045$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += \
46 -include $(call select-android-config-h,windows)
47$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += \
48 --enable-stdcall-fixup
49
Andrew Hsiehf9613a42012-04-28 00:35:19 +080050ifneq ($(strip $(BUILD_HOST_static)),)
51# Statically-linked binaries are desirable for sandboxed environment
Ying Wang6feb6d52014-04-17 10:03:35 -070052$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -static
Andrew Hsiehf9613a42012-04-28 00:35:19 +080053endif # BUILD_HOST_static
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -080054
55# when building under Cygwin, ensure that we use Mingw compilation by default.
56# you can disable this (i.e. to generate Cygwin executables) by defining the
57# USE_CYGWIN variable in your environment, e.g.:
58#
59# export USE_CYGWIN=1
60#
61# note that the -mno-cygwin flags are not needed when cross-compiling the
62# Windows host tools on Linux
63#
64ifneq ($(findstring CYGWIN,$(UNAME)),)
65ifeq ($(strip $(USE_CYGWIN)),)
Ying Wang6feb6d52014-04-17 10:03:35 -070066$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -mno-cygwin
67$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -mno-cygwin -mconsole
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -080068endif
69endif
70
Ying Wang6feb6d52014-04-17 10:03:35 -070071############################################################
72## Macros after this line are shared by the 64-bit config.
73
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -080074HOST_SHLIB_SUFFIX := .dll
75HOST_EXECUTABLE_SUFFIX := .exe
76
77# $(1): The file to check
78# TODO: find out what format cygwin's stat(1) uses
79define get-file-size
80999999999
81endef