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 Windows on x86_64. 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)),) 27ifdef USE_MINGW 28HOST_ACP_UNAVAILABLE := true 29TOOLS_EXE_SUFFIX := 30HOST_GLOBAL_CFLAGS += -DUSE_MINGW 31TOOLS_PREFIX := /usr/bin/amd64-mingw32msvc- 32HOST_C_INCLUDES += /usr/lib/gcc/amd64-mingw32msvc/4.4.2/include 33HOST_GLOBAL_LD_DIRS += -L/usr/amd64-mingw32msvc/lib 34endif # USE_MINGW 35endif # Linux 36 37# Workaround differences in inttypes.h between host and target. 38# See bug 12708004. 39HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D__USE_MINGW_ANSI_STDIO 40 41HOST_CC := $(TOOLS_PREFIX)gcc$(TOOLS_EXE_SUFFIX) 42HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX) 43HOST_AR := $(TOOLS_PREFIX)ar$(TOOLS_EXE_SUFFIX) 44 45HOST_GLOBAL_CFLAGS += -include $(call select-android-config-h,windows) 46HOST_GLOBAL_LDFLAGS += --enable-stdcall-fixup 47ifneq ($(strip $(BUILD_HOST_static)),) 48# Statically-linked binaries are desirable for sandboxed environment 49HOST_GLOBAL_LDFLAGS += -static 50endif # BUILD_HOST_static 51 52# when building under Cygwin, ensure that we use Mingw compilation by default. 53# you can disable this (i.e. to generate Cygwin executables) by defining the 54# USE_CYGWIN variable in your environment, e.g.: 55# 56# export USE_CYGWIN=1 57# 58# note that the -mno-cygwin flags are not needed when cross-compiling the 59# Windows host tools on Linux 60# 61ifneq ($(findstring CYGWIN,$(UNAME)),) 62ifeq ($(strip $(USE_CYGWIN)),) 63HOST_GLOBAL_CFLAGS += -mno-cygwin 64HOST_GLOBAL_LDFLAGS += -mno-cygwin -mconsole 65endif 66endif 67